From daf3b4d88613d12938edf314798af5c706fcdb69 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 22 May 2024 22:34:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=BD=93=E7=B3=BB=E6=9B=B4=E4=B8=A5=E6=A0=BC=E7=9A=84?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataPriceServiceImpl.java | 468 ++++++++++-------- 1 file changed, 252 insertions(+), 216 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 67a8f3779..a2792c54b 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -1346,121 +1346,134 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) { - boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); - BasicdataPriceFullVehicleEntity entity = null; - if (b) { - entity = new BasicdataPriceFullVehicleEntity(); - } else { - if (pickupEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { - entity = pickupEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); - } else { + String pickupPricingType = templateEntity.getPickupPricingType(); + // 提货费的计价方式是否包含整车 + if (StrUtil.isNotEmpty(pickupPricingType) && StrUtil.contains(pickupPricingType, PickupPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) { + boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); + BasicdataPriceFullVehicleEntity entity = null; + if (b) { entity = new BasicdataPriceFullVehicleEntity(); - pickupEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); + } else { + if (pickupEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { + entity = pickupEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); + } else { + entity = new BasicdataPriceFullVehicleEntity(); + pickupEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); + } } - } - if (b) { - if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) { - String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(), - excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "1"); - BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); - if (ObjectUtil.isNotEmpty(routeEntity)) { - entity.setBoId(routeEntity.getId()); + if (b) { + if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) { + String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(), + excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "1"); + BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); + if (ObjectUtil.isNotEmpty(routeEntity)) { + entity.setBoId(routeEntity.getId()); + } + } else { + entity.setBoId(priceEntity.getId()); + log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel)); + continue; } } else { + // 统一计费 entity.setBoId(priceEntity.getId()); - log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel)); - continue; } - } else { - // 统一计费 - entity.setBoId(priceEntity.getId()); - } - entity.setPriceId(priceEntity.getId()); - // 类型 - entity.setType(FullVehicleTypeEnums.PICK_UP.getCode()); - // 车型 - if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { - String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); - if (StrUtil.isNotEmpty(vehicleType)) { - entity.setVehicleType(Convert.toInt(vehicleType)); + entity.setPriceId(priceEntity.getId()); + // 类型 + entity.setType(FullVehicleTypeEnums.PICK_UP.getCode()); + // 车型 + if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { + String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); + if (StrUtil.isNotEmpty(vehicleType)) { + entity.setVehicleType(Convert.toInt(vehicleType)); + } + } + // 价格 + entity.setPrice(Convert.toDouble(pickupPrice)); + if (b) { + entities.add(entity); } } - // 价格 - entity.setPrice(Convert.toDouble(pickupPrice)); - if (b) { - entities.add(entity); - } + } if (StrUtil.isNotEmpty(trunkLinePrice) && Convert.toDouble(trunkLinePrice) > 0) { - boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); - BasicdataPriceFullVehicleEntity entity = null; - if (b) { - entity = new BasicdataPriceFullVehicleEntity(); - } else { - if (trunkLineEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { - entity = trunkLineEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); - } else { + String pricingType = templateEntity.getTrunklinePricingType(); + // 提货费的计价方式是否包含整车 + if (StrUtil.isNotEmpty(pricingType) && StrUtil.contains(pricingType, TrunkLinePricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) { + boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); + BasicdataPriceFullVehicleEntity entity = null; + if (b) { entity = new BasicdataPriceFullVehicleEntity(); - trunkLineEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); + } else { + if (trunkLineEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { + entity = trunkLineEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); + } else { + entity = new BasicdataPriceFullVehicleEntity(); + trunkLineEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); + } } - } - if (ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) { - if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) { - String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(), - excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "2"); - BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); - if (ObjectUtil.isNotEmpty(routeEntity)) { - entity.setBoId(routeEntity.getId()); + if (ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode())) { + if (!ObjectUtil.isAllEmpty(excel.getClient(), excel.getBrand(), excel.getSendOrg())) { + String key = buildRoutKeyV2(excel.getClient(), excel.getBrand(), excel.getStartProvince(), excel.getStartCity(), + excel.getStartArea(), excel.getEndProvince(), excel.getEndCity(), excel.getEndArea(), excel.getSendOrg(), "2"); + BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); + if (ObjectUtil.isNotEmpty(routeEntity)) { + entity.setBoId(routeEntity.getId()); + } + } else { + entity.setBoId(priceEntity.getId()); + log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel)); + continue; } } else { + // 统一计费 entity.setBoId(priceEntity.getId()); - log.error("价格体系导入FullVehicle数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(excel)); - continue; } - } else { - // 统一计费 - entity.setBoId(priceEntity.getId()); - } - entity.setPriceId(priceEntity.getId()); - // 类型 - entity.setType(FullVehicleTypeEnums.TRUNK_LINE.getCode()); - // 车型 - if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { - String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); - if (StrUtil.isNotEmpty(vehicleType)) { - entity.setVehicleType(Convert.toInt(vehicleType)); + entity.setPriceId(priceEntity.getId()); + // 类型 + entity.setType(FullVehicleTypeEnums.TRUNK_LINE.getCode()); + // 车型 + if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { + String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); + if (StrUtil.isNotEmpty(vehicleType)) { + entity.setVehicleType(Convert.toInt(vehicleType)); + } + } + // 价格 + entity.setPrice(Convert.toDouble(trunkLinePrice)); + if (b) { + entities.add(entity); } - } - // 价格 - entity.setPrice(Convert.toDouble(trunkLinePrice)); - if (b) { - entities.add(entity); } } if (StrUtil.isNotEmpty(dispatchPrice) && Convert.toDouble(dispatchPrice) > 0) { - BasicdataPriceFullVehicleEntity entity = null; - if (dispatchEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { - entity = dispatchEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); - } else { - entity = new BasicdataPriceFullVehicleEntity(); - dispatchEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); - } - // 统一计费 - entity.setBoId(priceEntity.getId()); - entity.setPriceId(priceEntity.getId()); - // 类型 - entity.setType(FullVehicleTypeEnums.DISPATCH.getCode()); - // 车型 - if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { - String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); - if (StrUtil.isNotEmpty(vehicleType)) { - entity.setVehicleType(Convert.toInt(vehicleType)); + String pricingType = templateEntity.getDispatchPricingType(); + // 提货费的计价方式是否包含整车 + if (StrUtil.isNotEmpty(pricingType) && StrUtil.contains(pricingType, DispatchPricingTypeEnums.COMPLETE_VEHICLE.getCode().toString())) { + BasicdataPriceFullVehicleEntity entity = null; + if (dispatchEntityMap.containsKey(excel.getClient() + excel.getBrand() + excel.getVehicleType())) { + entity = dispatchEntityMap.get(excel.getClient() + excel.getBrand() + excel.getVehicleType()); + } else { + entity = new BasicdataPriceFullVehicleEntity(); + dispatchEntityMap.put(excel.getClient() + excel.getBrand() + excel.getVehicleType(), entity); } + // 统一计费 + entity.setBoId(priceEntity.getId()); + entity.setPriceId(priceEntity.getId()); + // 类型 + entity.setType(FullVehicleTypeEnums.DISPATCH.getCode()); + // 车型 + if (ObjectUtil.isNotEmpty(excel.getVehicleType())) { + String vehicleType = vehicleTypeMap.get(excel.getVehicleType()); + if (StrUtil.isNotEmpty(vehicleType)) { + entity.setVehicleType(Convert.toInt(vehicleType)); + } + } + // 价格 + entity.setPrice(Convert.toDouble(dispatchPrice)); } - // 价格 - entity.setPrice(Convert.toDouble(dispatchPrice)); } } @@ -1556,135 +1569,148 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) { - boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); - // 服务类型 - BasicdataPriceGeneralEntity basicEntity = null; - if (b) { - basicEntity = new BasicdataPriceGeneralEntity(); - } else { - if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { + Integer isMinCost = templateEntity.getPickupIsMinCost(); + if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) { + boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); + // 服务类型 + BasicdataPriceGeneralEntity basicEntity = null; + if (b) { basicEntity = new BasicdataPriceGeneralEntity(); - pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } else { + if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + basicEntity = new BasicdataPriceGeneralEntity(); + pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } } - } - basicEntity.setServiceType(GeneralServiceTypeEnums.PICK_UP.getCode()); - // 按区域计费 - if (b) { - if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { - String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(), - basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "1"); - BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); - if (ObjectUtil.isNotEmpty(routeEntity)) { - basicEntity.setBoId(routeEntity.getId()); + basicEntity.setServiceType(GeneralServiceTypeEnums.PICK_UP.getCode()); + // 按区域计费 + if (b) { + if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { + String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(), + basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "1"); + BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); + if (ObjectUtil.isNotEmpty(routeEntity)) { + basicEntity.setBoId(routeEntity.getId()); + } + } else { + basicEntity.setBoId(priceEntity.getId()); + log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); + continue; } } else { + // 统一计费 basicEntity.setBoId(priceEntity.getId()); - log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); - continue; } - } else { - // 统一计费 - basicEntity.setBoId(priceEntity.getId()); - } - basicEntity.setPriceId(priceEntity.getId()); - // 最低计费 - basicEntity.setMinCost(Convert.toDouble(pickupMinCost)); - // 加算价格 - if (StrUtil.isNotEmpty(basicExcel.getPickupAddCost())) { - basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getPickupAddCost())); - } - // 按区域计费直接加入保存队列 - if (b) { - entities.add(basicEntity); + basicEntity.setPriceId(priceEntity.getId()); + // 最低计费 + basicEntity.setMinCost(Convert.toDouble(pickupMinCost)); + // 加算价格 + if (StrUtil.isNotEmpty(basicExcel.getPickupAddCost())) { + basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getPickupAddCost())); + } + // 按区域计费直接加入保存队列 + if (b) { + entities.add(basicEntity); + } } + } if (StrUtil.isNotEmpty(trunkLineMinCost) && Convert.toDouble(trunkLineMinCost) > 0) { - boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); - // 服务类型 - BasicdataPriceGeneralEntity basicEntity = null; - if (b) { - basicEntity = new BasicdataPriceGeneralEntity(); - } else { - if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { + Integer isMinCost = templateEntity.getTrunklineIsMinCost(); + if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) { + boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); + // 服务类型 + BasicdataPriceGeneralEntity basicEntity = null; + if (b) { basicEntity = new BasicdataPriceGeneralEntity(); - trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } else { + if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + basicEntity = new BasicdataPriceGeneralEntity(); + trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } } - } - basicEntity.setServiceType(GeneralServiceTypeEnums.TRUNK_LINE.getCode()); - // 按区域计费 - if (b) { - if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { - String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(), - basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "2"); - BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); - if (ObjectUtil.isNotEmpty(routeEntity)) { - basicEntity.setBoId(routeEntity.getId()); + basicEntity.setServiceType(GeneralServiceTypeEnums.TRUNK_LINE.getCode()); + // 按区域计费 + if (b) { + if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { + String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), basicExcel.getStartCity(), + basicExcel.getStartArea(), basicExcel.getEndProvince(), basicExcel.getEndCity(), basicExcel.getEndArea(), basicExcel.getSendOrg(), "2"); + BasicdataPriceRouteEntity routeEntity = routeEntityMap.get(key); + if (ObjectUtil.isNotEmpty(routeEntity)) { + basicEntity.setBoId(routeEntity.getId()); + } + } else { + basicEntity.setBoId(priceEntity.getId()); + log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); + continue; } } else { + // 统一计费 basicEntity.setBoId(priceEntity.getId()); - log.error("价格体系导入General数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); - continue; } - } else { - // 统一计费 - basicEntity.setBoId(priceEntity.getId()); - } - basicEntity.setPriceId(priceEntity.getId()); - // 最低计费 - basicEntity.setMinCost(Convert.toDouble(trunkLineMinCost)); - // 加算价格 - if (StrUtil.isNotEmpty(basicExcel.getTrunkLineAddCost())) { - basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getTrunkLineAddCost())); - } - if (b) { - entities.add(basicEntity); + basicEntity.setPriceId(priceEntity.getId()); + // 最低计费 + basicEntity.setMinCost(Convert.toDouble(trunkLineMinCost)); + // 加算价格 + if (StrUtil.isNotEmpty(basicExcel.getTrunkLineAddCost())) { + basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getTrunkLineAddCost())); + } + if (b) { + entities.add(basicEntity); + } } } if (StrUtil.isNotEmpty(dispatchMinCost) && Convert.toDouble(dispatchMinCost) > 0) { // 服务类型 - BasicdataPriceGeneralEntity basicEntity = null; - if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { - basicEntity = new BasicdataPriceGeneralEntity(); - dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); - } - basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH.getCode()); - // 统一计费 - basicEntity.setBoId(priceEntity.getId()); - basicEntity.setPriceId(priceEntity.getId()); - // 最低计费 - basicEntity.setMinCost(Convert.toDouble(dispatchMinCost)); - // 加算价格 - if (StrUtil.isNotEmpty(basicExcel.getDispatchAddCost())) { - basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchAddCost())); + Integer isMinCost = templateEntity.getDispatchIsMinCost(); + if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) { + BasicdataPriceGeneralEntity basicEntity = null; + if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + basicEntity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + basicEntity = new BasicdataPriceGeneralEntity(); + dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } + basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH.getCode()); + // 统一计费 + basicEntity.setBoId(priceEntity.getId()); + basicEntity.setPriceId(priceEntity.getId()); + // 最低计费 + basicEntity.setMinCost(Convert.toDouble(dispatchMinCost)); + // 加算价格 + if (StrUtil.isNotEmpty(basicExcel.getDispatchAddCost())) { + basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchAddCost())); + } } } if (StrUtil.isNotEmpty(dispatchLeaveBehindMinCost) && Convert.toDouble(dispatchLeaveBehindMinCost) > 0) { // 服务类型 - BasicdataPriceGeneralEntity basicEntity = null; - if (dispatchLeaveBehindEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = dispatchLeaveBehindEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { - basicEntity = new BasicdataPriceGeneralEntity(); - dispatchLeaveBehindEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); - } - basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode()); - // 统一计费 - basicEntity.setBoId(priceEntity.getId()); - basicEntity.setPriceId(priceEntity.getId()); - // 最低计费 - basicEntity.setMinCost(Convert.toDouble(dispatchLeaveBehindMinCost)); - // 加算价格 - if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindAddCost())) { - basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchLeaveBehindAddCost())); + Integer isMinCost = templateEntity.getDispatchIsMinCost(); + if (ObjectUtil.isNotEmpty(isMinCost) && ObjectUtil.equal(isMinCost, BooleanZeroOneEnums.YES.getCode())) { + BasicdataPriceGeneralEntity basicEntity = null; + if (dispatchLeaveBehindEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + basicEntity = dispatchLeaveBehindEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + basicEntity = new BasicdataPriceGeneralEntity(); + dispatchLeaveBehindEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); + } + basicEntity.setServiceType(GeneralServiceTypeEnums.DISPATCH_LEAVE_BEHIND.getCode()); + // 统一计费 + basicEntity.setBoId(priceEntity.getId()); + basicEntity.setPriceId(priceEntity.getId()); + // 最低计费 + basicEntity.setMinCost(Convert.toDouble(dispatchLeaveBehindMinCost)); + // 加算价格 + if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindAddCost())) { + basicEntity.setAdditionalCost(Convert.toDouble(basicExcel.getDispatchLeaveBehindAddCost())); + } } } @@ -1865,13 +1891,18 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntityMap, Map dispatchAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + // 配送是否附加费 + Integer dispatchIsAddFee = templateEntity.getDispatchIsAddFee(); + if(ObjectUtil.isEmpty(dispatchIsAddFee) || ObjectUtil.equal(dispatchIsAddFee, BooleanZeroOneEnums.NO.getCode())){ + return; + } Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); // 按品类计费 boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryDispatchEntity entity = null; - if(categoryFlag){ + if (categoryFlag) { String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); - if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { key = key + basicExcel.getDispatchUnit(); } if (dispatchAddEntityMap.containsKey(key)) { @@ -1880,9 +1911,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntityMap, Map warehouseAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + // 仓储是否附加费 + Integer warehouseIsAddFee = templateEntity.getWarehouseIsAddFee(); + if(ObjectUtil.isEmpty(warehouseIsAddFee) || ObjectUtil.equal(warehouseIsAddFee, BooleanZeroOneEnums.NO.getCode())){ + return; + } Integer pickupIsByCategory = templateEntity.getWarehouseIsCategorySubjoin(); // 按品类计费 boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryWarehouseEntity warehouseEntity = null; - if(categoryFlag){ + if (categoryFlag) { String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); - if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { key = key + basicExcel.getDispatchUnit(); } if (warehouseAddEntityMap.containsKey(key)) { @@ -1992,9 +2028,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl