Browse Source

fix(service): 修改价格体系维护时数据不准确问题

pull/37/head
zhaoqiaobo 9 months ago
parent
commit
40e3b63bf3
  1. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java

@ -147,7 +147,7 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
// 最低计费
if (ObjectUtil.isNotEmpty(vo.getMinCost())) {
List<BasicdataPriceGeneralEntity> priceGeneralEntities = new ArrayList<>();
biuldGeneral(route.getId(), generalServiceTypeEnums.getCode(), vo.getMinCost(), vo.getAdditionalCost(), priceGeneralEntities);
biuldGeneral(route, generalServiceTypeEnums.getCode(), vo.getMinCost(), vo.getAdditionalCost(), priceGeneralEntities);
generalService.saveOrUpdateBatch(priceGeneralEntities);
}
return route.getId();
@ -263,16 +263,16 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
}
}
private void biuldGeneral(Long priceId, Integer code, Double minCost, Double additionalCost, List<BasicdataPriceGeneralEntity> generalList) {
private void biuldGeneral(BasicdataPriceRouteEntity routeEntity, Integer code, Double minCost, Double additionalCost, List<BasicdataPriceGeneralEntity> generalList) {
// 1 最低计费一个价格体系一个服务类型只存在一条
BasicdataPriceGeneralEntity generalEntity = generalService.getOne(Wrappers.<BasicdataPriceGeneralEntity>lambdaQuery()
.eq(BasicdataPriceGeneralEntity::getBoId, priceId)
.eq(BasicdataPriceGeneralEntity::getBoId, routeEntity.getId())
.eq(BasicdataPriceGeneralEntity::getServiceType, code)
);
if (ObjectUtil.isEmpty(generalEntity)) {
generalEntity = new BasicdataPriceGeneralEntity();
generalEntity.setBoId(priceId);
generalEntity.setPriceId(priceId);
generalEntity.setBoId(routeEntity.getId());
generalEntity.setPriceId(routeEntity.getPriceId());
generalEntity.setServiceType(code);
}
// 设置最低计费和加算价格

Loading…
Cancel
Save