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 cb50fdc19..a72c5609e 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 @@ -931,10 +931,10 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) { + Long routeId = null; + Integer pickupIsByCategory = templateEntity.getPickupIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + // 按区域计费 有路径的 boolean b = ObjectUtil.isNotEmpty(pickupIsUnifyAreaBill) && ObjectUtil.equal(pickupIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); BasicdataPriceCategoryBasicEntity basicEntity = null; - if (b) { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - } else { - if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), basicEntity); - } - } - // 按区域计费 if (b) { if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), @@ -1820,15 +1814,45 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) { + Long routeId = null; + Integer pickupIsByCategory = templateEntity.getTrunklineIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + // 按区域计费 有路径的 boolean b = ObjectUtil.isNotEmpty(trunklineIsUnifyAreaBill) && ObjectUtil.equal(trunklineIsUnifyAreaBill, BooleanZeroOneEnums.NO.getCode()); BasicdataPriceCategoryBasicEntity basicEntity = null; - if (b) { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - } else { - if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), basicEntity); - } - } - // 按区域计费 if (b) { if (!ObjectUtil.isAllEmpty(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getSendOrg())) { String key = buildRoutKeyV2(basicExcel.getClient(), basicExcel.getBrand(), basicExcel.getStartProvince(), @@ -1870,15 +1890,45 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) || (ObjectUtil.isNotEmpty(beyondSixtyPrice) && Convert.toDouble(beyondSixtyPrice) > 0) || (ObjectUtil.isNotEmpty(beyondNinetyPrice) && Convert.toDouble(beyondNinetyPrice) > 0)) { + Integer pickupIsByCategory = templateEntity.getWarehouseIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryWarehouseEntity warehouseEntity = null; - if (warehouseEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - warehouseEntity = warehouseEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); - warehouseEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), warehouseEntity); + if(categoryFlag){ + if (warehouseEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { + warehouseEntity = warehouseEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), warehouseEntity); + } + }else{ + if (warehouseEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + warehouseEntity = warehouseEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), warehouseEntity); + } } + if (ObjectUtil.isNotEmpty(priceEntity)) { warehouseEntity.setPriceId(priceEntity.getId()); warehouseEntity.setBoId(priceEntity.getId()); @@ -1922,11 +1987,13 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) || (ObjectUtil.isNotEmpty(warehouseManagementPrice) && Convert.toDouble(warehouseManagementPrice) > 0) || (ObjectUtil.isNotEmpty(warehouseSortPrice) && Convert.toDouble(warehouseSortPrice) > 0)) { + Integer pickupIsByCategory = templateEntity.getWarehouseIsCategorySubjoin(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryWarehouseEntity warehouseEntity = null; - if (warehouseAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - warehouseEntity = warehouseAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); - warehouseAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), warehouseEntity); + if(categoryFlag){ + if (warehouseAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { + warehouseEntity = warehouseAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), warehouseEntity); + } + }else{ + if (warehouseAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + warehouseEntity = warehouseAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), warehouseEntity); + } } if (ObjectUtil.isNotEmpty(priceEntity)) { warehouseEntity.setPriceId(priceEntity.getId()); @@ -1961,11 +2040,13 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) { + Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryDispatchEntity entity = null; - if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - entity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - entity = new BasicdataPriceCategoryDispatchEntity(); - dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), entity); + if(categoryFlag){ + if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { + entity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), entity); + } + }else{ + if (dispatchEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + entity = dispatchEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), entity); + } } if (ObjectUtil.isNotEmpty(priceEntity)) { entity.setPriceId(priceEntity.getId()); @@ -1993,7 +2086,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl 0) || (ObjectUtil.isNotEmpty(dispatchRelocationPrice) && Convert.toDouble(dispatchRelocationPrice) > 0) || (ObjectUtil.isNotEmpty(dispatchDeliveryPrice) && Convert.toDouble(dispatchDeliveryPrice) > 0)) { + Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); BasicdataPriceCategoryDispatchEntity entity = null; - if (dispatchAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { - entity = dispatchAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); - } else { - entity = new BasicdataPriceCategoryDispatchEntity(); - dispatchAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), entity); + if(categoryFlag){ + if (dispatchAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory())) { + entity = dispatchAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory()); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(), entity); + } + }else{ + if (dispatchAddEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { + entity = dispatchAddEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchAddEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), entity); + } } if (ObjectUtil.isNotEmpty(priceEntity)) { entity.setPriceId(priceEntity.getId()); @@ -2030,7 +2137,9 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl