From 71e31b2e6fc49983f14271b53fe971315eef252b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 22 May 2024 18:32:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=BD=93=E7=B3=BB=E8=B7=AF=E5=BE=84=E5=92=8C=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=A4=9A=E9=87=8D=E5=85=B3=E7=B3=BB=E6=97=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataPriceServiceImpl.java | 227 +++++++++++++----- 1 file changed, 168 insertions(+), 59 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 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