Browse Source

feat(all): 价格体系增加历史版本查询功能

dist.1.3.0
zhaoqiaobo 8 months ago
parent
commit
aad03bc192
  1. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java
  2. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.java
  4. 23
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml
  5. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java
  6. 31
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataPricePageVO.java

@ -45,6 +45,9 @@ public class BasicdataPricePageVO implements Serializable {
@ApiModelProperty(value = "品牌id")
private String brandId;
@ApiModelProperty(value = "客户id")
private String clientId;
@ApiModelProperty(value = "价格模板id")
private String templateId;

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataPriceController.java

@ -101,6 +101,16 @@ public class BasicdataPriceController extends BladeController {
IPage<BasicdataPricePageVO> pages = basicdataPriceService.selectBasicdataPricePage(Condition.getPage(query), basicdataPrice);
return R.data(pages);
}
/**
* 基础价格表 历史版本查询
*/
@GetMapping("hisPage")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "历史版本查询", notes = "历史版本查询")
public R<IPage<BasicdataPricePageVO>> hisPage(BasicdataPricePageVO basicdataPrice, Query query) {
IPage<BasicdataPricePageVO> pages = basicdataPriceService.hisPage(Condition.getPage(query), basicdataPrice);
return R.data(pages);
}
/**
* 基础价格表 修改

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.java

@ -54,4 +54,6 @@ public interface BasicdataPriceMapper extends BaseMapper<BasicdataPriceEntity> {
List<BasicdataPriceImportVO> findEntityByClientAndBrand(@Param("prices") List<BasicdataPriceExcel> prices);
List<BasicdataPriceImportVO> findEntityByClientAndBrandV2(@Param("prices") List<BasicdataPriceV2Excel> priceExcels);
List<BasicdataPricePageVO> hisPage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice);
}

23
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataPriceMapper.xml

@ -44,6 +44,29 @@
</if>
</if>
</select>
<select id="hisPage" resultType="com.logpm.basicdata.vo.BasicdataPricePageVO">
select t.id,
cli.client_name,
t.brand_id,
t.template_id,
ldb.brand_name,
lbpt.service_type,
case
when t.maintenance_status = 1 then '未维护'
when t.maintenance_status = 2 then '已维护'
else ''
end maintenance_status,
t.update_time,
t.effective_time,
t.expiry_time
from logpm_basicdata_price t
left join logpm_basicdata_price_template lbpt on t.template_id = lbpt.id
left join logpm_basicdata_client cli on cli.id = t.client_id
left join logpm_basicdata_brand ldb on ldb.id = t.brand_id
where t.is_deleted = 0
and t.client_id = #{basicdataPrice.clientId}
and t.brand_id = #{basicdataPrice.brandId}
</select>
<select id="findEntityByClientAndBrand" resultType="com.logpm.basicdata.vo.BasicdataPriceImportVO">
select t.*,lbc.client_name,lbb.brand_name,lbc.client_code

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataPriceService.java

@ -71,4 +71,7 @@ public interface IBasicdataPriceService extends BaseService<BasicdataPriceEntity
String upload(MultipartFile file);
String uploadV2(MultipartFile file);
IPage<BasicdataPricePageVO> hisPage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice);
}

31
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java

@ -171,6 +171,37 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl<BasicdataPriceMap
return page.setRecords(basicdataPriceVOS);
}
@Override
public IPage<BasicdataPricePageVO> hisPage(IPage<BasicdataPricePageVO> page, BasicdataPricePageVO basicdataPrice) {
if (ObjectUtil.hasEmpty(basicdataPrice.getClientId(), basicdataPrice.getBrandId())) {
throw new ServiceException("客户id和品牌id不能为空");
}
List<BasicdataPricePageVO> basicdataPriceVOS = baseMapper.hisPage(page, basicdataPrice);
if (CollUtil.isNotEmpty(basicdataPriceVOS)) {
for (BasicdataPricePageVO basicdataPriceVO : basicdataPriceVOS) {
// 维护状态
if (ObjectUtil.isNotEmpty(basicdataPriceVO.getExpiryTime())) {
DateTime now = DateUtil.date();
if (now.isAfter(basicdataPriceVO.getExpiryTime())) {
// 已到期
basicdataPriceVO.setMaintenanceStatus("已过期");
}
}
// 服务类型
String serviceType = basicdataPriceVO.getServiceType();
if (StrUtil.isNotEmpty(serviceType)) {
List<String> res = new ArrayList<>();
List<String> split = StrUtil.split(serviceType, ",");
for (String s : split) {
res.add(IDict.getTextByCode(ServiceTypeEnums.class, Convert.toInt(s)));
}
basicdataPriceVO.setServiceType(StrUtil.join("/", res));
}
}
}
return page.setRecords(basicdataPriceVOS);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean basicUpdate(BasicdataPriceBasicUpdateVO vo) {

Loading…
Cancel
Save