From eec956d198f261cc37bba0c2de1d5acb3a68431b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 22 May 2024 21:32:49 +0800 Subject: [PATCH 01/34] =?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=E5=AF=BC=E5=85=A5=E6=9C=AA=E6=8C=89?= =?UTF-8?q?=E8=AE=A1=E8=B4=B9=E6=96=B9=E5=BC=8F=E5=8C=BA=E5=88=86=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataPriceServiceImpl.java | 738 ++++++++++-------- 1 file changed, 406 insertions(+), 332 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 a61b61e53..6d624f5c8 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 @@ -1800,160 +1800,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) { - 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)) { - routeId = routeEntity.getId(); - } - } else { - log.error("价格体系导入CategoryBasic数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); - continue; - } - } - if (b && categoryFlag) { - // 有路径按品类计费 一个客户一条路径一个品类一个价格 - if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory())) { - basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory(), basicEntity); - } - } else if (b && !categoryFlag) { - // 有路径不按品类计费,一个客户一条路径一个价格 - if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + routeId)) { - basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + routeId); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + routeId, basicEntity); - } - } else if (!b && categoryFlag) { - // 没路径 按品类计费 一个客户一个品类一个价格 - 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); - } - } else { - // 没路径 不按品类计费 一个客户一个价格 - if (pickupEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = pickupEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - pickupEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); - } - } - // 按区域计费 - if (b) { - basicEntity.setBoId(routeId); - } else { - basicEntity.setBoId(priceEntity.getId()); - } - basicEntity.setServiceType(ServiceTypeEnums.PICK_UP.getCode()); - // 计费类型 - if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) { - basicEntity.setType(IDict.getCodeByText(PickupPricingTypeEnums.class, basicExcel.getPickupUnit())); - } - basicEntity.setPriceId(priceEntity.getId()); - // 品类 - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - if (ObjectUtil.isNotEmpty(categoryEntityMap.get(basicExcel.getCategory()))) { - if (categoryFlag) { - basicEntity.setCategoryId(categoryEntityMap.get(basicExcel.getCategory()).getId()); - } - } - } - // 价格 - basicEntity.setPrice(Convert.toDouble(pickupPrice)); + buildSaveBasicExcel(categoryEntityMap, routeEntityMap, pickupEntityMap, basicExcel, priceEntity, templateEntity, pickupIsUnifyAreaBill, pickupPrice); } if (StrUtil.isNotEmpty(trunkLinePrice) && Convert.toDouble(trunkLinePrice) > 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) { - 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)) { - routeId = routeEntity.getId(); - } - } else { - log.error("价格体系导入CategoryBasic数据无法处理,模板配置的按区域计费,数据不满足路径条件:{}", JSONUtil.toJsonStr(basicExcel)); - continue; - } - } - if (b && categoryFlag) { - // 有路径按品类计费 - if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory())) { - basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory(), basicEntity); - } - } else if (b && !categoryFlag) { - // 有路径不按品类计费,一个客户一条路径一个价格 - if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand() + routeId)) { - basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand() + routeId); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand() + routeId, basicEntity); - } - } else if (!b && categoryFlag) { - // 没路径 按品类计费 一个客户一个品类一个价格 - 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); - } - } else { - // 没路径 不按品类计费 一个客户一个价格 - if (trunkLineEntityMap.containsKey(basicExcel.getClient() + basicExcel.getBrand())) { - basicEntity = trunkLineEntityMap.get(basicExcel.getClient() + basicExcel.getBrand()); - } else { - basicEntity = new BasicdataPriceCategoryBasicEntity(); - trunkLineEntityMap.put(basicExcel.getClient() + basicExcel.getBrand(), basicEntity); - } - } - // 按区域计费 - if (b) { - basicEntity.setBoId(routeId); - } else { - basicEntity.setBoId(priceEntity.getId()); - } - basicEntity.setServiceType(ServiceTypeEnums.TRUNK_LINE.getCode()); - // 计费类型 - if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) { - basicEntity.setType(IDict.getCodeByText(TrunkLinePricingTypeEnums.class, basicExcel.getTrunkLineUnit())); - } - basicEntity.setPriceId(priceEntity.getId()); - // 品类 - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - if (ObjectUtil.isNotEmpty(categoryEntityMap.get(basicExcel.getCategory()))) { - if (categoryFlag) { - basicEntity.setCategoryId(categoryEntityMap.get(basicExcel.getCategory()).getId()); - } - } - } - // 价格 - basicEntity.setPrice(Convert.toDouble(trunkLinePrice)); + buildSaveTrunkLineExcel(categoryEntityMap, routeEntityMap, trunkLineEntityMap, basicExcel, priceEntity, templateEntity, trunklineIsUnifyAreaBill, trunkLinePrice); } String withinThirtyPrice = basicExcel.getWithinThirtyPrice(); String betweenThirtySixtyPrice = basicExcel.getBetweenThirtySixtyPrice(); @@ -1964,53 +1814,7 @@ 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(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()); - } - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); - if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { - if (categoryFlag) { - warehouseEntity.setCategoryId(basicdataCategoryEntity.getId()); - } - } - } - warehouseEntity.setCostType(CostTypeEnums.NOMAL.getCode()); - warehouseEntity.setType(Convert.toInt(templateEntity.getWarehousePricingType())); - warehouseEntity.setServiceType(1); - if (StrUtil.isNotEmpty(basicExcel.getWithinThirtyPrice())) { - warehouseEntity.setWithinThirtyPrice(Convert.toDouble(basicExcel.getWithinThirtyPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getBetweenThirtySixtyPrice())) { - warehouseEntity.setBetweenThirtySixtyPrice(Convert.toDouble(basicExcel.getBetweenThirtySixtyPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getBeyondSixtyPrice())) { - warehouseEntity.setBeyondSixtyPrice(Convert.toDouble(basicExcel.getBeyondSixtyPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getBeyondNinetyPrice())) { - warehouseEntity.setBeyondNinetyPrice(Convert.toDouble(basicExcel.getBeyondNinetyPrice())); - } + buildSaveWarehouseExcel(categoryEntityMap, warehouseEntityMap, basicExcel, priceEntity, templateEntity); } String warehouseOperatePrice = basicExcel.getWarehouseOperatePrice(); String warehouseManagementPrice = basicExcel.getWarehouseManagementPrice(); @@ -2018,94 +1822,11 @@ 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(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()); - warehouseEntity.setBoId(priceEntity.getId()); - } - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); - if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { - if (categoryFlag) { - warehouseEntity.setCategoryId(basicdataCategoryEntity.getId()); - } - } - } - warehouseEntity.setCostType(CostTypeEnums.ADD.getCode()); - warehouseEntity.setType(Convert.toInt(templateEntity.getWarehousePricingType())); - warehouseEntity.setServiceType(1); - if (StrUtil.isNotEmpty(basicExcel.getWarehouseOperatePrice())) { - warehouseEntity.setOperatePrice(Convert.toDouble(basicExcel.getWarehouseOperatePrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getWarehouseManagementPrice())) { - warehouseEntity.setWarehouseManagementPrice(Convert.toDouble(basicExcel.getWarehouseManagementPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getWarehouseSortPrice())) { - warehouseEntity.setWarehouseSortPrice(Convert.toDouble(basicExcel.getWarehouseSortPrice())); - } + buildSaveWarehouseAddExcel(categoryEntityMap, warehouseAddEntityMap, basicExcel, priceEntity, templateEntity); } String dispatchPrice = basicExcel.getDispatchPrice(); if (StrUtil.isNotEmpty(dispatchPrice) && Convert.toDouble(dispatchPrice) > 0) { - Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); - // 按品类计费 - boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); - BasicdataPriceCategoryDispatchEntity entity = null; - 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()); - entity.setBoId(priceEntity.getId()); - } - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); - if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { - if (categoryFlag) { - entity.setCategoryId(basicdataCategoryEntity.getId()); - } - } - } - entity.setCostType(CostTypeEnums.NOMAL.getCode()); - if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { - entity.setType(IDict.getCodeByText(DispatchPricingTypeEnums.class, basicExcel.getDispatchUnit())); - } - entity.setServiceType(1); - if (StrUtil.isNotEmpty(basicExcel.getDispatchPrice())) { - entity.setPrice(Convert.toDouble(basicExcel.getDispatchPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindPrice())) { - entity.setLeaveBehindPrice(Convert.toDouble(basicExcel.getDispatchLeaveBehindPrice())); - } + buildSaveDispatchExcel(categoryEntityMap, dispatchEntityMap, basicExcel, priceEntity, templateEntity); } String dispatchSortPrice = basicExcel.getDispatchSortPrice(); String dispatchHandlingPrice = basicExcel.getDispatchHandlingPrice(); @@ -2115,54 +1836,7 @@ 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(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()); - entity.setBoId(priceEntity.getId()); - } - if (StrUtil.isNotEmpty(basicExcel.getCategory())) { - BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); - if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { - if (categoryFlag) { - entity.setCategoryId(basicdataCategoryEntity.getId()); - } - } - } - entity.setCostType(CostTypeEnums.ADD.getCode()); - if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { - entity.setType(IDict.getCodeByText(DispatchPricingTypeEnums.class, basicExcel.getDispatchUnit())); - } - entity.setServiceType(1); - if (StrUtil.isNotEmpty(basicExcel.getDispatchSortPrice())) { - entity.setSortPrice(Convert.toDouble(basicExcel.getDispatchSortPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getDispatchHandlingPrice())) { - entity.setHandlingPrice(Convert.toDouble(basicExcel.getDispatchHandlingPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getDispatchRelocationPrice())) { - entity.setRelocationPrice(Convert.toDouble(basicExcel.getDispatchRelocationPrice())); - } - if (StrUtil.isNotEmpty(basicExcel.getDispatchDeliveryPrice())) { - entity.setUpstairsDeliveryPrice(Convert.toDouble(basicExcel.getDispatchDeliveryPrice())); - } + buildSaveDispatchAddExcel(categoryEntityMap, dispatchAddEntityMap, basicExcel, priceEntity, templateEntity); } String dispatchStairsCarryingCharge = basicExcel.getDispatchStairsCarryingCharge(); if (StrUtil.isNotEmpty(dispatchStairsCarryingCharge)) { @@ -2190,6 +1864,406 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntityMap, Map dispatchAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + BasicdataPriceCategoryDispatchEntity entity = null; + if(categoryFlag){ + String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (dispatchAddEntityMap.containsKey(key)) { + entity = dispatchAddEntityMap.get(key); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchAddEntityMap.put(key, entity); + } + }else{ + String key = basicExcel.getClient() + basicExcel.getBrand(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (dispatchAddEntityMap.containsKey(key)) { + entity = dispatchAddEntityMap.get(key); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchAddEntityMap.put(key, entity); + } + } + if (ObjectUtil.isNotEmpty(priceEntity)) { + entity.setPriceId(priceEntity.getId()); + entity.setBoId(priceEntity.getId()); + } + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); + if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { + if (categoryFlag) { + entity.setCategoryId(basicdataCategoryEntity.getId()); + } + } + } + entity.setCostType(CostTypeEnums.ADD.getCode()); + if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { + entity.setType(IDict.getCodeByText(DispatchPricingTypeEnums.class, basicExcel.getDispatchUnit())); + } + entity.setServiceType(1); + if (StrUtil.isNotEmpty(basicExcel.getDispatchSortPrice())) { + entity.setSortPrice(Convert.toDouble(basicExcel.getDispatchSortPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getDispatchHandlingPrice())) { + entity.setHandlingPrice(Convert.toDouble(basicExcel.getDispatchHandlingPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getDispatchRelocationPrice())) { + entity.setRelocationPrice(Convert.toDouble(basicExcel.getDispatchRelocationPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getDispatchDeliveryPrice())) { + entity.setUpstairsDeliveryPrice(Convert.toDouble(basicExcel.getDispatchDeliveryPrice())); + } + } + + private void buildSaveDispatchExcel(Map categoryEntityMap, Map dispatchEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + BasicdataPriceCategoryDispatchEntity entity = null; + if(categoryFlag){ + String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (dispatchEntityMap.containsKey(key)) { + entity = dispatchEntityMap.get(key); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchEntityMap.put(key, entity); + } + }else{ + String key = basicExcel.getClient() + basicExcel.getBrand(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (dispatchEntityMap.containsKey(key)) { + entity = dispatchEntityMap.get(key); + } else { + entity = new BasicdataPriceCategoryDispatchEntity(); + dispatchEntityMap.put(key, entity); + } + } + if (ObjectUtil.isNotEmpty(priceEntity)) { + entity.setPriceId(priceEntity.getId()); + entity.setBoId(priceEntity.getId()); + } + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); + if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { + if (categoryFlag) { + entity.setCategoryId(basicdataCategoryEntity.getId()); + } + } + } + entity.setCostType(CostTypeEnums.NOMAL.getCode()); + if (StrUtil.isNotEmpty(basicExcel.getDispatchUnit())) { + entity.setType(IDict.getCodeByText(DispatchPricingTypeEnums.class, basicExcel.getDispatchUnit())); + } + entity.setServiceType(1); + if (StrUtil.isNotEmpty(basicExcel.getDispatchPrice())) { + entity.setPrice(Convert.toDouble(basicExcel.getDispatchPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getDispatchLeaveBehindPrice())) { + entity.setLeaveBehindPrice(Convert.toDouble(basicExcel.getDispatchLeaveBehindPrice())); + } + } + + private void buildSaveWarehouseAddExcel(Map categoryEntityMap, Map warehouseAddEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + Integer pickupIsByCategory = templateEntity.getWarehouseIsCategorySubjoin(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + BasicdataPriceCategoryWarehouseEntity warehouseEntity = null; + if(categoryFlag){ + String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (warehouseAddEntityMap.containsKey(key)) { + warehouseEntity = warehouseAddEntityMap.get(key); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseAddEntityMap.put(key, warehouseEntity); + } + }else{ + String key = basicExcel.getClient() + basicExcel.getBrand(); + if(StrUtil.isNotEmpty(basicExcel.getDispatchUnit())){ + key = key + basicExcel.getDispatchUnit(); + } + if (warehouseAddEntityMap.containsKey(key)) { + warehouseEntity = warehouseAddEntityMap.get(key); + } else { + warehouseEntity = new BasicdataPriceCategoryWarehouseEntity(); + warehouseAddEntityMap.put(key, warehouseEntity); + } + } + if (ObjectUtil.isNotEmpty(priceEntity)) { + warehouseEntity.setPriceId(priceEntity.getId()); + warehouseEntity.setBoId(priceEntity.getId()); + } + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); + if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { + if (categoryFlag) { + warehouseEntity.setCategoryId(basicdataCategoryEntity.getId()); + } + } + } + warehouseEntity.setCostType(CostTypeEnums.ADD.getCode()); + warehouseEntity.setType(Convert.toInt(templateEntity.getWarehousePricingType())); + warehouseEntity.setServiceType(1); + if (StrUtil.isNotEmpty(basicExcel.getWarehouseOperatePrice())) { + warehouseEntity.setOperatePrice(Convert.toDouble(basicExcel.getWarehouseOperatePrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getWarehouseManagementPrice())) { + warehouseEntity.setWarehouseManagementPrice(Convert.toDouble(basicExcel.getWarehouseManagementPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getWarehouseSortPrice())) { + warehouseEntity.setWarehouseSortPrice(Convert.toDouble(basicExcel.getWarehouseSortPrice())); + } + } + + private void buildSaveWarehouseExcel(Map categoryEntityMap, Map warehouseEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity) { + Integer pickupIsByCategory = templateEntity.getWarehouseIsByCategory(); + // 按品类计费 + boolean categoryFlag = ObjectUtil.isNotEmpty(pickupIsByCategory) && ObjectUtil.equal(pickupIsByCategory, BooleanZeroOneEnums.YES.getCode()); + BasicdataPriceCategoryWarehouseEntity warehouseEntity = null; + 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()); + } + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + BasicdataCategoryEntity basicdataCategoryEntity = categoryEntityMap.get(basicExcel.getCategory()); + if (ObjectUtil.isNotEmpty(basicdataCategoryEntity)) { + if (categoryFlag) { + warehouseEntity.setCategoryId(basicdataCategoryEntity.getId()); + } + } + } + warehouseEntity.setCostType(CostTypeEnums.NOMAL.getCode()); + warehouseEntity.setType(Convert.toInt(templateEntity.getWarehousePricingType())); + warehouseEntity.setServiceType(1); + if (StrUtil.isNotEmpty(basicExcel.getWithinThirtyPrice())) { + warehouseEntity.setWithinThirtyPrice(Convert.toDouble(basicExcel.getWithinThirtyPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getBetweenThirtySixtyPrice())) { + warehouseEntity.setBetweenThirtySixtyPrice(Convert.toDouble(basicExcel.getBetweenThirtySixtyPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getBeyondSixtyPrice())) { + warehouseEntity.setBeyondSixtyPrice(Convert.toDouble(basicExcel.getBeyondSixtyPrice())); + } + if (StrUtil.isNotEmpty(basicExcel.getBeyondNinetyPrice())) { + warehouseEntity.setBeyondNinetyPrice(Convert.toDouble(basicExcel.getBeyondNinetyPrice())); + } + } + + private void buildSaveTrunkLineExcel(Map categoryEntityMap, Map routeEntityMap, Map trunkLineEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity, Integer trunklineIsUnifyAreaBill, String trunkLinePrice) { + 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) { + 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)) { + routeId = routeEntity.getId(); + } + } + } + if (b && categoryFlag) { + // 有路径按品类计费 + String key = basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){ + key = key + basicExcel.getTrunkLineUnit(); + } + if (trunkLineEntityMap.containsKey(key)) { + basicEntity = trunkLineEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + trunkLineEntityMap.put(key, basicEntity); + } + } else if (b && !categoryFlag) { + // 有路径不按品类计费,一个客户一条路径一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand() + routeId; + if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){ + key = key + basicExcel.getTrunkLineUnit(); + } + if (trunkLineEntityMap.containsKey(key)) { + basicEntity = trunkLineEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + trunkLineEntityMap.put(key, basicEntity); + } + } else if (!b && categoryFlag) { + // 没路径 按品类计费 一个客户一个品类一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){ + key = key + basicExcel.getTrunkLineUnit(); + } + if (trunkLineEntityMap.containsKey(key)) { + basicEntity = trunkLineEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + trunkLineEntityMap.put(key, basicEntity); + } + } else { + // 没路径 不按品类计费 一个客户一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand(); + if(StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())){ + key = key + basicExcel.getTrunkLineUnit(); + } + if (trunkLineEntityMap.containsKey(key)) { + basicEntity = trunkLineEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + trunkLineEntityMap.put(key, basicEntity); + } + } + // 按区域计费 + if (b) { + basicEntity.setBoId(routeId); + } else { + basicEntity.setBoId(priceEntity.getId()); + } + basicEntity.setServiceType(ServiceTypeEnums.TRUNK_LINE.getCode()); + // 计费类型 + if (StrUtil.isNotEmpty(basicExcel.getTrunkLineUnit())) { + basicEntity.setType(IDict.getCodeByText(TrunkLinePricingTypeEnums.class, basicExcel.getTrunkLineUnit())); + } + basicEntity.setPriceId(priceEntity.getId()); + // 品类 + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + if (ObjectUtil.isNotEmpty(categoryEntityMap.get(basicExcel.getCategory()))) { + if (categoryFlag) { + basicEntity.setCategoryId(categoryEntityMap.get(basicExcel.getCategory()).getId()); + } + } + } + // 价格 + basicEntity.setPrice(Convert.toDouble(trunkLinePrice)); + } + + private void buildSaveBasicExcel(Map categoryEntityMap, Map routeEntityMap, Map pickupEntityMap, BasicdataPriceCategoryV2Excel basicExcel, BasicdataPriceEntity priceEntity, BasicdataPriceTemplateEntity templateEntity, Integer pickupIsUnifyAreaBill, String pickupPrice) { + 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) { + 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)) { + routeId = routeEntity.getId(); + } + } + } + if (b && categoryFlag) { + // 有路径按品类计费 一个客户一条路径一个品类一种计价方式一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand() + routeId + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){ + key = key + basicExcel.getPickupUnit(); + } + if (pickupEntityMap.containsKey(key)) { + basicEntity = pickupEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + pickupEntityMap.put(key, basicEntity); + } + } else if (b && !categoryFlag) { + // 有路径不按品类计费,一个客户一条路径一种计价方式一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand() + routeId; + if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){ + key = key + basicExcel.getPickupUnit(); + } + if (pickupEntityMap.containsKey(key)) { + basicEntity = pickupEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + pickupEntityMap.put(key, basicEntity); + } + } else if (!b && categoryFlag) { + // 没路径 按品类计费 一个客户一个品类一种计价方式一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand() + basicExcel.getCategory(); + if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){ + key = key + basicExcel.getPickupUnit(); + } + if (pickupEntityMap.containsKey(key)) { + basicEntity = pickupEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + pickupEntityMap.put(key, basicEntity); + } + } else { + // 没路径 不按品类计费 一个客户一个计价方式一个价格 + String key = basicExcel.getClient() + basicExcel.getBrand(); + if(StrUtil.isNotEmpty(basicExcel.getPickupUnit())){ + key = key + basicExcel.getPickupUnit(); + } + if (pickupEntityMap.containsKey(key)) { + basicEntity = pickupEntityMap.get(key); + } else { + basicEntity = new BasicdataPriceCategoryBasicEntity(); + pickupEntityMap.put(key, basicEntity); + } + } + // 按区域计费 + if (b) { + basicEntity.setBoId(routeId); + } else { + basicEntity.setBoId(priceEntity.getId()); + } + basicEntity.setServiceType(ServiceTypeEnums.PICK_UP.getCode()); + // 计费类型 + if (StrUtil.isNotEmpty(basicExcel.getPickupUnit())) { + basicEntity.setType(IDict.getCodeByText(PickupPricingTypeEnums.class, basicExcel.getPickupUnit())); + } + basicEntity.setPriceId(priceEntity.getId()); + // 品类 + if (StrUtil.isNotEmpty(basicExcel.getCategory())) { + if (ObjectUtil.isNotEmpty(categoryEntityMap.get(basicExcel.getCategory()))) { + if (categoryFlag) { + basicEntity.setCategoryId(categoryEntityMap.get(basicExcel.getCategory()).getId()); + } + } + } + // 价格 + basicEntity.setPrice(Convert.toDouble(pickupPrice)); + } + private void setStarProvinceExcel(Map provinceMap, BasicdataPriceRouteEntity routeEntity, String province) { if (StrUtil.isNotEmpty(provinceMap.get(province))) { routeEntity.setStartProvinceId(Convert.toLong(provinceMap.get(province))); From b779684db519df118250e45328ef889a8df8a692 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 22 May 2024 21:54:01 +0800 Subject: [PATCH 02/34] =?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=E6=8F=90=E8=B4=A7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=95=B0=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 --- .../logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6d624f5c8..67a8f3779 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 @@ -3819,7 +3819,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryBasicEntityList = categoryBasicMap.get(PickupPricingTypeEnums.PIECE.getCode()); if (CollUtil.isNotEmpty(categoryBasicEntityList)) { - List basicVOS = categoryBasicEntities.stream().map(item -> { + List basicVOS = categoryBasicEntityList.stream().map(item -> { PriceBasicVO basicVO = new PriceBasicVO(); BeanUtil.copyProperties(item, basicVO); return basicVO; From daf3b4d88613d12938edf314798af5c706fcdb69 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 22 May 2024 22:34:48 +0800 Subject: [PATCH 03/34] =?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 Date: Wed, 22 May 2024 23:52:42 +0800 Subject: [PATCH 04/34] =?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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 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 a2792c54b..0aff8b488 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 @@ -1893,7 +1893,7 @@ 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())){ + if (ObjectUtil.isEmpty(dispatchIsAddFee) || ObjectUtil.equal(dispatchIsAddFee, BooleanZeroOneEnums.NO.getCode())) { return; } Integer pickupIsByCategory = templateEntity.getDispatchIsByCategory(); @@ -2010,7 +2010,7 @@ 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())){ + if (ObjectUtil.isEmpty(warehouseIsAddFee) || ObjectUtil.equal(warehouseIsAddFee, BooleanZeroOneEnums.NO.getCode())) { return; } Integer pickupIsByCategory = templateEntity.getWarehouseIsCategorySubjoin(); @@ -2822,7 +2822,13 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl categoryEntityMap, StringBuilder rowMessage, String category) { if (StrUtil.isNotEmpty(category)) { if (!categoryEntityMap.containsKey(category)) { From 4acbd24a83bcc933e8a2ac82fb03ad2e2f6f5cf7 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 23 May 2024 10:15:43 +0800 Subject: [PATCH 05/34] =?UTF-8?q?1.=E9=87=8D=E6=96=B0=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA1=E7=9A=84=E8=80=81=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/comfac/service/impl/FactoryCommonServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java index 32bd182a2..cb7a207a7 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java @@ -129,7 +129,7 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService { @Override public void extracted(String status, String unitNo, String currentWarehouseId, String operationTime, Integer trayId) { log.info("#############extracted: 当前处理的数据为 status={} unitNo={} currentWarehouseId={} operationTime={} trayId={}",status,unitNo,currentWarehouseId,operationTime,trayId); - if ("4".equals(status) || "2".equals(status)) { + if ("4".equals(status) || "2".equals(status) || "1".equals(status)) { //继续判断是否到达目的仓 //查询destinationWarehouse logiBillNo plantId数据 From fbe3fcf489217f6c123a5a2d5efcfa6b156fb65d Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 23 May 2024 10:20:58 +0800 Subject: [PATCH 06/34] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6=E5=BA=93=E5=AD=98=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IDistributionBusinessPreOrderServiceImpl.java | 2 ++ .../service/impl/WarehouseWarehousingEntryServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java index 22b391ddd..a5b2cb24e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java @@ -205,6 +205,8 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl Date: Thu, 23 May 2024 10:37:47 +0800 Subject: [PATCH 07/34] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E5=85=A5=E5=BA=93=E5=AD=98=E6=94=BE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WarehouseWarehousingEntryServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java index 2e4051c9a..fde7aa094 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java @@ -394,6 +394,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl Date: Thu, 23 May 2024 10:57:59 +0800 Subject: [PATCH 08/34] =?UTF-8?q?=E9=85=8D=E9=80=81=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receiver/BusinessPreOrderDataQueueHandler.java | 1 - .../service/impl/DistributionDeliveryListServiceImpl.java | 2 +- .../service/impl/IDistributionBusinessPreOrderServiceImpl.java | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java index fa0e8408b..ac9664e50 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BusinessPreOrderDataQueueHandler.java @@ -43,7 +43,6 @@ public class BusinessPreOrderDataQueueHandler { private final IDistributionParcelListService distributionParcelListService; private final IDistributionBusinessPreOrderService distributionBusinessPreOrderService; private final ISysClient sysClient; - @RabbitHandler public void businessPreOrderDataHandler(Map map, Message message, Channel channel) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index b14a86a74..b6b8bb8e6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -6696,7 +6696,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Integer.parseInt(map1.get("数量").toString())).sum()); - + log.info(">>>>>>>>>>>>>>>>>>预约打印模板查看备货信息》》》》》》》》》》》》:{}"distributionReservationEntity.getRemarks()); map.put("备注", distributionReservationEntity.getRemarks()); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java index a5b2cb24e..931ce53bc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/IDistributionBusinessPreOrderServiceImpl.java @@ -207,6 +207,9 @@ public class IDistributionBusinessPreOrderServiceImpl extends BaseServiceImpl Date: Thu, 23 May 2024 11:02:26 +0800 Subject: [PATCH 09/34] =?UTF-8?q?=E9=85=8D=E9=80=81=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index b6b8bb8e6..35a9fc745 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -6696,7 +6696,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl Integer.parseInt(map1.get("数量").toString())).sum()); - log.info(">>>>>>>>>>>>>>>>>>预约打印模板查看备货信息》》》》》》》》》》》》:{}"distributionReservationEntity.getRemarks()); + log.info(">>>>>>>>>>>>>>>>>>预约打印模板查看备货信息》》》》》》》》》》》》:{}",distributionReservationEntity.getRemarks()); map.put("备注", distributionReservationEntity.getRemarks()); } From f6c8d951fb6643ca9a22897a7a2cd032fef307d4 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 23 May 2024 14:23:30 +0800 Subject: [PATCH 10/34] =?UTF-8?q?1.=E7=BB=93=E7=AE=97=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/broadcast/FanoutConstants.java | 13 + .../statistics/dto/MerchantStatisticsDTO.java | 17 + .../StatisticsDistributionPackageEntity.java | 132 +++++++ .../entity/StatisticsOrderInfoEntity.java | 6 + ... => StatisticsTrunklinePackageEntity.java} | 39 +- .../StatisticsWarehousePackageEntity.java | 130 +++++++ .../entity/StatisticsWaybillInfoEntity.java | 48 +++ .../vo/StatisticsWaybillInfoVO.java | 117 ++++++ .../vo/TrunklineAdvanceDetailVO.java | 1 + .../MerchantStatisticsController.java | 48 +++ .../listener/mq/PackageFanoutListener.java | 114 ++++++ .../listener/mq/WaybillFanoutListener.java | 357 +++++++++++++----- .../StatisticsDistributionPackageMapper.java | 9 + .../mapper/StatisticsOrderInfoMapper.java | 9 + .../mapper/StatisticsPackageInfoMapper.java | 9 - .../mapper/StatisticsPackageInfoMapper.xml | 6 - .../StatisticsTrunklinePackageMapper.java | 11 + .../StatisticsTrunklinePackageMapper.xml | 10 + .../StatisticsWarehousePackageMapper.java | 9 + .../mapper/StatisticsWaybillInfoMapper.java | 9 + ...IStatisticsDistributionPackageService.java | 13 + .../service/IStatisticsOrderInfoService.java | 13 + .../IStatisticsPackageInfoService.java | 7 - .../IStatisticsTrunklinePackageService.java | 8 + .../IStatisticsWarehousePackageService.java | 7 + .../IStatisticsWaybillInfoService.java | 7 + ...tisticsDistributionPackageServiceImpl.java | 34 ++ .../impl/StatisticsOrderInfoServiceImpl.java | 32 ++ .../StatisticsPackageInfoServiceImpl.java | 15 - ...StatisticsTrunklinePackageServiceImpl.java | 19 + ...StatisticsWarehousePackageServiceImpl.java | 15 + .../StatisticsWaybillInfoServiceImpl.java | 15 + .../mapper/TrunklineAdvanceDetailMapper.xml | 3 +- .../mapper/TrunklineCarsLoadScanMapper.xml | 2 +- .../service/IOpenOrderAsyncService.java | 2 + .../service/IPackageTrackLogAsyncService.java | 3 + .../impl/OpenOrderAsyncServiceImpl.java | 238 +++++++++++- .../service/impl/OpenOrderServiceImpl.java | 14 +- .../impl/PackageTrackLogAsyncServiceImpl.java | 19 +- .../TrunklineWaybillPackageServiceImpl.java | 3 +- 40 files changed, 1397 insertions(+), 166 deletions(-) create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java rename blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/{StatisticsPackageInfoEntity.java => StatisticsTrunklinePackageEntity.java} (66%) create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWaybillInfoEntity.java create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsDistributionPackageMapper.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java delete mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.java delete mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.xml create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.xml create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWarehousePackageMapper.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsDistributionPackageService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java delete mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsPackageInfoService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsTrunklinePackageService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWarehousePackageService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsDistributionPackageServiceImpl.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java delete mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsPackageInfoServiceImpl.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsTrunklinePackageServiceImpl.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWarehousePackageServiceImpl.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java index 214083578..49789924d 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java @@ -38,6 +38,19 @@ public abstract class FanoutConstants { } + //包件日志 + interface PACKAGNODE{ + + //交换机 + String EXCHANGE = "fanout.trunkline.packagenode" + ModuleNameConstant.DEVAUTH; + + interface QUEUE { + + String PACKAGE_SIGN = "fanout.trunkline.packagenode.statisticsdata.packagesign" + ModuleNameConstant.DEVAUTH; + + } + + } } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java new file mode 100644 index 000000000..f07a72b21 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java @@ -0,0 +1,17 @@ +package com.logpm.statistics.dto; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MerchantStatisticsDTO implements Serializable { + + private Integer pageSize; + private Integer pageNum; + + private Long waybillInfoId; + + private Long orderInfoId; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java new file mode 100644 index 000000000..f86ed09d1 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java @@ -0,0 +1,132 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; + +@Data +@TableName("logpm_statistics_distribution_package") +@ApiModel(value = "StatisticsDistributionPackage对象", description = "结算配送包件明细表") +@EqualsAndHashCode(callSuper = true) +public class StatisticsDistributionPackageEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + /** + * 仓库id + */ + @ApiModelProperty(value = "仓库id") + private Long warehouseId; + + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + + /** + * 运单id + */ + @ApiModelProperty(value = "运单id") + private Long waybillId; + + /** + * 运单号 + */ + @ApiModelProperty(value = "运单号") + private String waybillNo; + + /** + * 订单号 + */ + @ApiModelProperty(value = "订单号") + private String orderCode; + + /** + * 包件码 + */ + @ApiModelProperty(value = "包件码") + private String orderPackageCode; + + /** + * 品类名称 + */ + @ApiModelProperty(value = "品类名称") + private String productName; + + /** + * 件数 + */ + @ApiModelProperty(value = "件数") + private Integer totalNum; + + /** + * 重量 + */ + @ApiModelProperty(value = "重量") + private BigDecimal totalWeight; + + @ApiModelProperty(value = "体积") + private BigDecimal totalVolume; + + private BigDecimal openPrice; + private BigDecimal totalPrice; + private BigDecimal deliveryServiceFee; + private BigDecimal deliveryFee; + private BigDecimal deliveryLoadingFee; + private BigDecimal deliverySortingFee; + private BigDecimal deliveryUpfloorFee; + private BigDecimal deliveryMoveFee; + private BigDecimal deliveryDistance; + private BigDecimal deliveryCrossingFee; + private Integer isAftersales; + private BigDecimal aftersalesPrice; + private Integer hasStatement; + private Long statementCreateTime; + private String statementCreateUser; + private Integer isZero; + private BigDecimal realDeliveryServiceFee; + private BigDecimal realDeliveryFee; + private BigDecimal realDeliveryLoadingFee; + private BigDecimal realDeliverySortingFee; + private BigDecimal realDeliveryUpfloorFee; + private BigDecimal realDeliveryMoveFee; + private BigDecimal realDeliveryDistance; + private BigDecimal realDeliveryCrossingFee; + private Integer goodsType; //1 订制品 2零担 3库存品 + private String typeService; //1 商配 2市配 3自提 4三方中转 + + private Long orderInfoId; + + private Integer isSign;//是否签收 0否 1是 + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java index 0569f6671..1436a4dd8 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsOrderInfoEntity.java @@ -43,6 +43,12 @@ public class StatisticsOrderInfoEntity extends TenantEntity { private String orderCode; private Long waybillId; private String waybillNo; + private String typeService; + private Integer signStatus;// 签收状态 0未签收 1部分签收 2已签收 + private Integer confirmStatisticsOrder;//0未确认 1已确认 + + private Long waybillInfoId;//运单维度id + private Long statisticsOrderId;//结算单id } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsPackageInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsTrunklinePackageEntity.java similarity index 66% rename from blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsPackageInfoEntity.java rename to blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsTrunklinePackageEntity.java index 6a45b3241..47090521e 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsPackageInfoEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsTrunklinePackageEntity.java @@ -8,13 +8,12 @@ import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; import java.math.BigDecimal; -import java.util.Date; @Data -@TableName("logpm_statistics_package_info") -@ApiModel(value = "StatisticsPackageInfo对象", description = "结算包件明细表") +@TableName("logpm_statistics_trunkline_package") +@ApiModel(value = "StatisticsTrunklinePackage对象", description = "结算干线包件明细表") @EqualsAndHashCode(callSuper = true) -public class StatisticsPackageInfoEntity extends TenantEntity { +public class StatisticsTrunklinePackageEntity extends TenantEntity { /** * 预留1 @@ -103,22 +102,6 @@ public class StatisticsPackageInfoEntity extends TenantEntity { private BigDecimal totalPrice; private BigDecimal pickupFee; private BigDecimal freightFee; - private Date incomingTime; - private Date outingTime; - private String warehouseFeeInterval; - private BigDecimal warehouseServiceFee; - private BigDecimal warehouseFee; - private BigDecimal warehouseManageFee; - private BigDecimal warehouseSortingFee; - private BigDecimal warehouseOperatingFee; - private BigDecimal deliveryServiceFee; - private BigDecimal deliveryFee; - private BigDecimal deliveryLoadingFee; - private BigDecimal deliverySortingFee; - private BigDecimal deliveryUpfloorFee; - private BigDecimal deliveryMoveFee; - private BigDecimal deliveryDistance; - private BigDecimal deliveryCrossingFee; private BigDecimal installFee; private BigDecimal quotationFee; private BigDecimal claimingValue; @@ -137,20 +120,6 @@ public class StatisticsPackageInfoEntity extends TenantEntity { private Integer isZero; private BigDecimal realPickupFee; private BigDecimal realFreightFee; - private String realWarehouseFeeInterval; - private BigDecimal realWarehouseServiceFee; - private BigDecimal realWarehouseFee; - private BigDecimal realWarehouseManageFee; - private BigDecimal realWarehouseSortingFee; - private BigDecimal realWarehouseOperatingFee; - private BigDecimal realDeliveryServiceFee; - private BigDecimal realDeliveryFee; - private BigDecimal realDeliveryLoadingFee; - private BigDecimal realDeliverySortingFee; - private BigDecimal realDeliveryUpfloorFee; - private BigDecimal realDeliveryMoveFee; - private BigDecimal realDeliveryDistance; - private BigDecimal realDeliveryCrossingFee; private BigDecimal realInstallFee; private BigDecimal realQuotationFee; private BigDecimal realClaimingValue; @@ -165,4 +134,6 @@ public class StatisticsPackageInfoEntity extends TenantEntity { private Integer goodsType; //1 订制品 2零担 3库存品 private String typeService; //1 商配 2市配 3自提 4三方中转 + private Long orderInfoId; + } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java new file mode 100644 index 000000000..72af3167a --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWarehousePackageEntity.java @@ -0,0 +1,130 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("logpm_statistics_warehouse_package") +@ApiModel(value = "StatisticsWarehousePackage对象", description = "结算仓库包件明细表") +@EqualsAndHashCode(callSuper = true) +public class StatisticsWarehousePackageEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + /** + * 仓库id + */ + @ApiModelProperty(value = "仓库id") + private Long warehouseId; + + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + + /** + * 运单id + */ + @ApiModelProperty(value = "运单id") + private Long waybillId; + + /** + * 运单号 + */ + @ApiModelProperty(value = "运单号") + private String waybillNo; + + /** + * 订单号 + */ + @ApiModelProperty(value = "订单号") + private String orderCode; + + /** + * 包件码 + */ + @ApiModelProperty(value = "包件码") + private String orderPackageCode; + + /** + * 品类名称 + */ + @ApiModelProperty(value = "品类名称") + private String productName; + + /** + * 件数 + */ + @ApiModelProperty(value = "件数") + private Integer totalNum; + + /** + * 重量 + */ + @ApiModelProperty(value = "重量") + private BigDecimal totalWeight; + + @ApiModelProperty(value = "体积") + private BigDecimal totalVolume; + + private BigDecimal openPrice; + private BigDecimal totalPrice; + private Date incomingTime; + private Date outingTime; + private String warehouseFeeInterval; + private BigDecimal warehouseServiceFee; + private BigDecimal warehouseFee; + private BigDecimal warehouseManageFee; + private BigDecimal warehouseSortingFee; + private BigDecimal warehouseOperatingFee; + private Integer isAftersales; + private BigDecimal aftersalesPrice; + private Integer hasStatement; + private Long statementCreateTime; + private String statementCreateUser; + private Integer isZero; + private String realWarehouseFeeInterval; + private BigDecimal realWarehouseServiceFee; + private BigDecimal realWarehouseFee; + private BigDecimal realWarehouseManageFee; + private BigDecimal realWarehouseSortingFee; + private BigDecimal realWarehouseOperatingFee; + + private Integer goodsType; //1 订制品 2零担 3库存品 + private String typeService; //1 商配 2市配 3自提 4三方中转 + + private Long orderInfoId; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWaybillInfoEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWaybillInfoEntity.java new file mode 100644 index 000000000..40a2e0246 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsWaybillInfoEntity.java @@ -0,0 +1,48 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +@Data +@TableName("logpm_statistics_waybill_info") +@ApiModel(value = "StatisticsWaybillInfo对象", description = "结算运单明细表") +@EqualsAndHashCode(callSuper = true) +public class StatisticsWaybillInfoEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + private Long waybillId; + private String waybillNo; + private String typeService; + + private Integer confirmStatisticsOrder;//0未确认 1部分确认 2已确认 + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java new file mode 100644 index 000000000..1fa7beb73 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/StatisticsWaybillInfoVO.java @@ -0,0 +1,117 @@ +package com.logpm.statistics.vo; + +import com.logpm.statistics.entity.StatisticsWaybillInfoEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class StatisticsWaybillInfoVO extends StatisticsWaybillInfoEntity { + + private String brand; + private String orderNo; + private String shipper; + private String shipperPerson; + private String shipperMobile; + private String shipperAddress; + private String consignee; + private String consigneePerson; + private String consigneeMobile; + private String consigneeAddress; + private String departure; + private String destination; + private String departureWarehouseName; + private String destinationWarehouseName; + private String deliveryMethod; + private String customerTrain; + private String receiptStatus; + private String waybillRemark; + private String statisticsFang; + private String payType; + private String payWay; + private String isAftersales; + private BigDecimal aftersalesFee; + private BigDecimal totalStatementFee; + private String statementStatus; + private BigDecimal hasStatementFee; + private String statementCreateUser; + private Integer isChanges; + private BigDecimal changesFee; + private String changesItems; + private String changesRemark; + private String changesTime;//最晚一条 + private Integer signNum; + private Date signTime;//最晚一条 + private String statisticsStatus;//结算状态 +// private String statisticsStatus;//结算状态 + + private String storeBusiness; + private String waybillStatus; + private Integer isEdit; + private Integer isCheck; + private Date openTime; + private String goodsName; + private String goodsTypeNum; + private Integer productTypeNum; + private Integer totalcount; + private BigDecimal totalWeight; + private BigDecimal totalVolume; + private BigDecimal totalFee; + private BigDecimal openFee; + private BigDecimal pickupFee; + private BigDecimal realPickupFee; + private BigDecimal freightFee; + private BigDecimal realFreightFee; + private BigDecimal installFee; + private BigDecimal realInstallFee; + private BigDecimal quotationFee; + private BigDecimal realQuotationFee; + private BigDecimal claimingValue; + private BigDecimal realClaimingValue; + private BigDecimal otherFee; + private BigDecimal realOtherFee; + private BigDecimal returnFee; + private BigDecimal realReturnFee; + private BigDecimal thirdOprationFee; + private BigDecimal realThirdOprationFee; + private BigDecimal xPay; + private BigDecimal realXPay; + private BigDecimal dPay; + private BigDecimal realDPay; + private BigDecimal hPay; + private BigDecimal realHPay; + private BigDecimal yPay; + private BigDecimal realYPay; + private Date incomingTime; + private Date outingTime; + private String warehouseFeeInterval; + private BigDecimal warehouseServiceFee; + private BigDecimal realWarehouseServiceFee; + private BigDecimal warehouseFee; + private BigDecimal realWarehouseFee; + private BigDecimal warehouseManageFee; + private BigDecimal realWarehouseManageFee; + private BigDecimal warehouseSortingFee; + private BigDecimal realWarehouseSortingFee; + private BigDecimal warehouseOperatingFee; + private BigDecimal realWarehouseOperatingFee; + private BigDecimal deliveryServiceFee; + private BigDecimal realDeliveryServiceFee; + private BigDecimal deliveryFee; + private BigDecimal realDeliveryFee; + private BigDecimal deliveryLoadingFee; + private BigDecimal realDeliveryLoadingFee; + private BigDecimal deliverySortingFee; + private BigDecimal realDeliverySortingFee; + private BigDecimal deliveryUpfloorFee; + private BigDecimal realDeliveryUpfloorFee; + private BigDecimal deliveryMoveFee; + private BigDecimal realDeliveryMoveFee; + private BigDecimal deliveryDistance; + private BigDecimal realDeliveryDistance; + private BigDecimal deliveryCrossingFee; + private BigDecimal realDeliveryCrossingFee; + + +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java index 0804e05a1..f5b0cca4d 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceDetailVO.java @@ -12,5 +12,6 @@ public class TrunklineAdvanceDetailVO extends TrunklineAdvanceDetailEntity { private String trayName; private String goodsName; + private Long goodsId; } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java new file mode 100644 index 000000000..93ecfa04f --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java @@ -0,0 +1,48 @@ +package com.logpm.statistics.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.statistics.dto.MerchantStatisticsDTO; +import com.logpm.statistics.service.IStatisticsOrderInfoService; +import com.logpm.statistics.service.IStatisticsWaybillInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.exception.CustomerException; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.*; + +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/merchantStatistics") +@Api(value = "商户结算控制类", tags = "珊瑚结算接口") +public class MerchantStatisticsController { + + private final IStatisticsOrderInfoService statisticsOrderInfoService; + private final IStatisticsWaybillInfoService statisticsWaybillInfoService; + + @ResponseBody + @PostMapping("/pageToBussesList") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "运单维度对账单", notes = "传入waybillDTO") + public R pageToBussesList(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) { + String method = "############pageToBussesList: "; + log.info(method+"请求参数{}",merchantStatisticsDTO); + try{ + +// IPage pages = statisticsWaybillInfoService.pageToBussesList(merchantStatisticsDTO); +// +// return R.data(pages); + return R.data(null); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############sendOrders: 系统异常",e); + return R.fail(500,"############sendOrders: 系统异常"); + } + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java new file mode 100644 index 000000000..764d1ffe3 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java @@ -0,0 +1,114 @@ +package com.logpm.statistics.listener.mq; + +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.logpm.statistics.entity.StatisticsDistributionPackageEntity; +import com.logpm.statistics.entity.StatisticsOrderInfoEntity; +import com.logpm.statistics.service.IStatisticsDistributionPackageService; +import com.logpm.statistics.service.IStatisticsOrderInfoService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.WorkNodeEnums; +import org.springblade.common.constant.broadcast.FanoutConstants; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Component +@AllArgsConstructor +public class PackageFanoutListener { + + private final IStatisticsDistributionPackageService statisticsDistributionPackageService; + private final IStatisticsOrderInfoService statisticsOrderInfoService; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FanoutConstants.trunkline.PACKAGNODE.QUEUE.PACKAGE_SIGN), + exchange = @Exchange(name = FanoutConstants.trunkline.PACKAGNODE.EXCHANGE, type = ExchangeTypes.FANOUT) + )) + @Transactional(rollbackFor = Exception.class) + public void packageSignFanout(String msg) { + JSONObject jsonObject = JSONUtil.parseObj(msg); + Integer workNode = jsonObject.getInt("workNode"); + if(WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode().equals(workNode) + || WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode().equals(workNode) + || WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode().equals(workNode)){ + + JSONArray orderPackageCodes = jsonObject.getJSONArray("orderPackageCodes"); + List orderPackageCodeList = orderPackageCodes.toList(String.class); + + //如果是签收 + List statisticsDistributionList = statisticsDistributionPackageService.findListByOrderPackageCodes(orderPackageCodeList); + //修改statisticsDistributionList中所有元素的isSign为1 + Set orderInfoSet = new HashSet<>(); + statisticsDistributionList.forEach(statisticsDistributionPackageEntity -> { + statisticsDistributionPackageEntity.setIsSign(1); + String typeService = statisticsDistributionPackageEntity.getTypeService(); + if("3".equals(typeService)){ + statisticsDistributionPackageEntity.setRealDeliveryFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryDistance(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryCrossingFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryLoadingFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryMoveFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryServiceFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliverySortingFee(BigDecimal.ZERO); + statisticsDistributionPackageEntity.setRealDeliveryUpfloorFee(BigDecimal.ZERO); + } + orderInfoSet.add(statisticsDistributionPackageEntity.getOrderInfoId()); + }); + statisticsDistributionPackageService.updateBatchById(statisticsDistributionList); + + List statisticsList = statisticsDistributionPackageService.findListByOrderInfoSet(orderInfoSet); + //把statisticsList通过元素的orderInfoId进行map分组 + Map> groupedStatisticsList = statisticsList.stream() + .collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getOrderInfoId)); + + List orderInfoList = statisticsOrderInfoService.findListByOrderInfoIdsSet(orderInfoSet); + //把orderInfoList转成以id为key的map + Map orderInfoMap = orderInfoList.stream() + .collect(Collectors.toMap(StatisticsOrderInfoEntity::getId, statisticsOrderInfoEntity -> statisticsOrderInfoEntity)); + + List updateOrderInfoList = new ArrayList<>(); + groupedStatisticsList.keySet().forEach(orderInfoId -> { + StatisticsOrderInfoEntity statisticsOrderInfoEntity = orderInfoMap.get(orderInfoId); + Integer signStatus = statisticsOrderInfoEntity.getSignStatus(); + List statisticsDistributionPackageEntities = groupedStatisticsList.get(orderInfoId); + int allSize = statisticsDistributionPackageEntities.size(); + + //过滤出statisticsDistributionPackageEntities中isSign等于0的元素 + List unSignStatisticsDistributionPackageEntities = statisticsDistributionPackageEntities.stream() + .filter(statisticsDistributionPackageEntity -> !statisticsDistributionPackageEntity.getIsSign().equals(1)) + .collect(Collectors.toList()); + + int unSignSize = unSignStatisticsDistributionPackageEntities.size(); + + if(unSignSize == 0){ + if(signStatus != 2){ + statisticsOrderInfoEntity.setSignStatus(2); + } + }else{ + if(unSignSize != allSize){ + if(signStatus != 1){ + statisticsOrderInfoEntity.setSignStatus(1); + } + } + } + updateOrderInfoList.add(statisticsOrderInfoEntity); + }); + + statisticsOrderInfoService.updateBatchById(updateOrderInfoList); + + } + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java index f942d90b0..c958044f6 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java @@ -3,8 +3,8 @@ package com.logpm.statistics.listener.mq; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import com.logpm.statistics.entity.StatisticsPackageInfoEntity; -import com.logpm.statistics.service.IStatisticsPackageInfoService; +import com.logpm.statistics.entity.*; +import com.logpm.statistics.service.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.broadcast.FanoutConstants; @@ -18,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; @Slf4j @@ -25,7 +27,11 @@ import java.util.stream.Collectors; @AllArgsConstructor public class WaybillFanoutListener { - private final IStatisticsPackageInfoService statisticsPackageInfoService; + private final IStatisticsTrunklinePackageService statisticsTrunklinePackageService; + private final IStatisticsWarehousePackageService statisticsWarehousePackageService; + private final IStatisticsDistributionPackageService statisticsDistributionPackageService; + private final IStatisticsOrderInfoService statisticsOrderInfoService; + private final IStatisticsWaybillInfoService statisticsWaybillInfoService; @RabbitListener(bindings = @QueueBinding( value = @Queue(name = FanoutConstants.trunkline.OPENWAYBILL.QUEUE.STATISTICSDATA_CREATEPACKAGEINFO), @@ -34,113 +40,216 @@ public class WaybillFanoutListener { @Transactional(rollbackFor = Exception.class) public void createPackageInfo(String msg) { -// if(StringUtil.isBlank(msg)){ -// log.warn("############createPackageInfo: 接收参数为空 msg={}",msg); -// -// } - JSONObject jsonObject = JSONUtil.parseObj(msg); Long warehouseId = jsonObject.getLong("warehouseId"); String warehouseName = jsonObject.getStr("warehouseName"); Long waybillId = jsonObject.getLong("waybillId"); String waybillNo = jsonObject.getStr("waybillNo"); + String typeService = jsonObject.getStr("typeService");//服务类型 + + List statisticsTrunklinePackageEntities = new ArrayList<>(); + List statisticsWarehousePackageEntities = new ArrayList<>(); + List statisticsDistributionPackageEntities = new ArrayList<>(); - List ls = new ArrayList<>(); JSONArray orderPackageCodes = jsonObject.getJSONArray("orderPackageCodes"); for (int i = 0; i < orderPackageCodes.size(); i++) { JSONObject json = orderPackageCodes.getJSONObject(i); - StatisticsPackageInfoEntity statisticsPackageInfoEntity = new StatisticsPackageInfoEntity(); - statisticsPackageInfoEntity.setWarehouseId(warehouseId); - statisticsPackageInfoEntity.setWarehouseName(warehouseName); - statisticsPackageInfoEntity.setTypeService(json.getStr("typeService")); - statisticsPackageInfoEntity.setWaybillId(waybillId); - statisticsPackageInfoEntity.setWaybillNo(waybillNo); + + //干线 + StatisticsTrunklinePackageEntity statisticsTrunklinePackageEntity = new StatisticsTrunklinePackageEntity(); + statisticsTrunklinePackageEntity.setWarehouseId(warehouseId); + statisticsTrunklinePackageEntity.setWarehouseName(warehouseName); + statisticsTrunklinePackageEntity.setTypeService(typeService); + statisticsTrunklinePackageEntity.setWaybillId(waybillId); + statisticsTrunklinePackageEntity.setWaybillNo(waybillNo); Integer waybillType = json.getInt("waybillType"); if(waybillType.equals(1)){ - statisticsPackageInfoEntity.setGoodsType(1); + statisticsTrunklinePackageEntity.setGoodsType(1); + }else if (waybillType.equals(2)){ + statisticsTrunklinePackageEntity.setGoodsType(2); + }else{ + statisticsTrunklinePackageEntity.setGoodsType(3); + } + statisticsTrunklinePackageEntity.setOrderCode(json.getStr("orderCode")); + statisticsTrunklinePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode")); + statisticsTrunklinePackageEntity.setProductName(json.getStr("productName")); + statisticsTrunklinePackageEntity.setTotalNum(json.getInt("totalNum")); + statisticsTrunklinePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight")); + statisticsTrunklinePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume")); + statisticsTrunklinePackageEntity.setOpenPrice(json.getBigDecimal("openPrice")); + statisticsTrunklinePackageEntity.setTotalPrice(json.getBigDecimal("openPrice")); + statisticsTrunklinePackageEntity.setPickupFee(json.getBigDecimal("pickupFee")); + statisticsTrunklinePackageEntity.setRealPickupFee(json.getBigDecimal("pickupFee")); + statisticsTrunklinePackageEntity.setFreightFee(json.getBigDecimal("freightFee")); + statisticsTrunklinePackageEntity.setRealFreightFee(json.getBigDecimal("freightFee")); + statisticsTrunklinePackageEntity.setInstallFee(json.getBigDecimal("installFee")); + statisticsTrunklinePackageEntity.setRealInstallFee(json.getBigDecimal("installFee")); + statisticsTrunklinePackageEntity.setQuotationFee(json.getBigDecimal("quotationFee")); + statisticsTrunklinePackageEntity.setRealQuotationFee(json.getBigDecimal("quotationFee")); + statisticsTrunklinePackageEntity.setClaimingValue(json.getBigDecimal("claimingValue")); + statisticsTrunklinePackageEntity.setRealClaimingValue(json.getBigDecimal("claimingValue")); + statisticsTrunklinePackageEntity.setOtherFee(json.getBigDecimal("otherFee")); + statisticsTrunklinePackageEntity.setRealOtherFee(json.getBigDecimal("otherFee")); + statisticsTrunklinePackageEntity.setReturnFee(json.getBigDecimal("returnFee")); + statisticsTrunklinePackageEntity.setRealReturnFee(json.getBigDecimal("returnFee")); + statisticsTrunklinePackageEntity.setThirdOprationFee(json.getBigDecimal("thirdOprationFee")); + statisticsTrunklinePackageEntity.setRealThirdOprationFee(json.getBigDecimal("thirdOprationFee")); + statisticsTrunklinePackageEntity.setXPay(json.getBigDecimal("xPay")); + statisticsTrunklinePackageEntity.setRealXPay(json.getBigDecimal("xPay")); + statisticsTrunklinePackageEntity.setDPay(json.getBigDecimal("dPay")); + statisticsTrunklinePackageEntity.setRealDPay(json.getBigDecimal("dPay")); + statisticsTrunklinePackageEntity.setHPay(json.getBigDecimal("hPay")); + statisticsTrunklinePackageEntity.setRealHPay(json.getBigDecimal("hPay")); + statisticsTrunklinePackageEntity.setYPay(json.getBigDecimal("yPay")); + statisticsTrunklinePackageEntity.setRealYPay(json.getBigDecimal("yPay")); + statisticsTrunklinePackageEntities.add(statisticsTrunklinePackageEntity); + + //仓库 + StatisticsWarehousePackageEntity statisticsWarehousePackageEntity = new StatisticsWarehousePackageEntity(); + statisticsWarehousePackageEntity.setWarehouseId(warehouseId); + statisticsWarehousePackageEntity.setWarehouseName(warehouseName); + statisticsWarehousePackageEntity.setTypeService(typeService); + statisticsWarehousePackageEntity.setWaybillId(waybillId); + statisticsWarehousePackageEntity.setWaybillNo(waybillNo); + if(waybillType.equals(1)){ + statisticsWarehousePackageEntity.setGoodsType(1); + }else if (waybillType.equals(2)){ + statisticsWarehousePackageEntity.setGoodsType(2); + }else{ + statisticsWarehousePackageEntity.setGoodsType(3); + } + statisticsWarehousePackageEntity.setOrderCode(json.getStr("orderCode")); + statisticsWarehousePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode")); + statisticsWarehousePackageEntity.setProductName(json.getStr("productName")); + statisticsWarehousePackageEntity.setTotalNum(json.getInt("totalNum")); + statisticsWarehousePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight")); + statisticsWarehousePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume")); + statisticsWarehousePackageEntity.setWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee")); + statisticsWarehousePackageEntity.setRealWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee")); + statisticsWarehousePackageEntity.setWarehouseFee(json.getBigDecimal("warehouseFee")); + statisticsWarehousePackageEntity.setRealWarehouseFee(json.getBigDecimal("warehouseFee")); + statisticsWarehousePackageEntity.setWarehouseManageFee(json.getBigDecimal("warehouseManageFee")); + statisticsWarehousePackageEntity.setRealWarehouseManageFee(json.getBigDecimal("warehouseManageFee")); + statisticsWarehousePackageEntity.setWarehouseSortingFee(json.getBigDecimal("warehouseSortingFee")); + statisticsWarehousePackageEntity.setRealWarehouseSortingFee(json.getBigDecimal("warehouseSortingFee")); + statisticsWarehousePackageEntity.setWarehouseOperatingFee(json.getBigDecimal("warehouseOperatingFee")); + statisticsWarehousePackageEntity.setRealWarehouseOperatingFee(json.getBigDecimal("warehouseOperatingFee")); + statisticsWarehousePackageEntities.add(statisticsWarehousePackageEntity); + + + //配送 + StatisticsDistributionPackageEntity statisticsDistributionPackageEntity = new StatisticsDistributionPackageEntity(); + statisticsDistributionPackageEntity.setWarehouseId(warehouseId); + statisticsDistributionPackageEntity.setWarehouseName(warehouseName); + statisticsDistributionPackageEntity.setTypeService(typeService); + statisticsDistributionPackageEntity.setWaybillId(waybillId); + statisticsDistributionPackageEntity.setWaybillNo(waybillNo); + if(waybillType.equals(1)){ + statisticsDistributionPackageEntity.setGoodsType(1); }else if (waybillType.equals(2)){ - statisticsPackageInfoEntity.setGoodsType(2); + statisticsDistributionPackageEntity.setGoodsType(2); }else{ - statisticsPackageInfoEntity.setGoodsType(3); + statisticsDistributionPackageEntity.setGoodsType(3); } - statisticsPackageInfoEntity.setOrderCode(json.getStr("orderCode")); - statisticsPackageInfoEntity.setOrderPackageCode(json.getStr("orderPackageCode")); - statisticsPackageInfoEntity.setProductName(json.getStr("productName")); - statisticsPackageInfoEntity.setTotalNum(json.getInt("totalNum")); - statisticsPackageInfoEntity.setTotalWeight(json.getBigDecimal("totalWeight")); - statisticsPackageInfoEntity.setTotalVolume(json.getBigDecimal("totalVolume")); - statisticsPackageInfoEntity.setOpenPrice(json.getBigDecimal("openPrice")); - statisticsPackageInfoEntity.setTotalPrice(json.getBigDecimal("openPrice")); - statisticsPackageInfoEntity.setPickupFee(json.getBigDecimal("pickupFee")); - statisticsPackageInfoEntity.setRealPickupFee(json.getBigDecimal("pickupFee")); - statisticsPackageInfoEntity.setFreightFee(json.getBigDecimal("freightFee")); - statisticsPackageInfoEntity.setRealFreightFee(json.getBigDecimal("freightFee")); - statisticsPackageInfoEntity.setWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee")); - statisticsPackageInfoEntity.setRealWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee")); - statisticsPackageInfoEntity.setWarehouseFee(json.getBigDecimal("warehouseFee")); - statisticsPackageInfoEntity.setRealWarehouseFee(json.getBigDecimal("warehouseFee")); - statisticsPackageInfoEntity.setWarehouseManageFee(json.getBigDecimal("warehouseManageFee")); - statisticsPackageInfoEntity.setRealWarehouseManageFee(json.getBigDecimal("warehouseManageFee")); - statisticsPackageInfoEntity.setWarehouseSortingFee(json.getBigDecimal("warehouseSortingFee")); - statisticsPackageInfoEntity.setRealWarehouseSortingFee(json.getBigDecimal("warehouseSortingFee")); - statisticsPackageInfoEntity.setWarehouseOperatingFee(json.getBigDecimal("warehouseOperatingFee")); - statisticsPackageInfoEntity.setRealWarehouseOperatingFee(json.getBigDecimal("warehouseOperatingFee")); - statisticsPackageInfoEntity.setDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee")); - statisticsPackageInfoEntity.setRealDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee")); - statisticsPackageInfoEntity.setDeliveryFee(json.getBigDecimal("deliveryFee")); - statisticsPackageInfoEntity.setRealDeliveryFee(json.getBigDecimal("deliveryFee")); - statisticsPackageInfoEntity.setDeliveryLoadingFee(json.getBigDecimal("deliveryLoadingFee")); - statisticsPackageInfoEntity.setRealDeliveryLoadingFee(json.getBigDecimal("deliveryLoadingFee")); - statisticsPackageInfoEntity.setDeliverySortingFee(json.getBigDecimal("deliverySortingFee")); - statisticsPackageInfoEntity.setRealDeliverySortingFee(json.getBigDecimal("deliverySortingFee")); - statisticsPackageInfoEntity.setDeliveryUpfloorFee(json.getBigDecimal("deliveryUpfloorFee")); - statisticsPackageInfoEntity.setRealDeliveryUpfloorFee(json.getBigDecimal("deliveryUpfloorFee")); - statisticsPackageInfoEntity.setDeliveryMoveFee(json.getBigDecimal("deliveryMoveFee")); - statisticsPackageInfoEntity.setRealDeliveryMoveFee(json.getBigDecimal("deliveryMoveFee")); - statisticsPackageInfoEntity.setDeliveryDistance(json.getBigDecimal("deliveryDistance")); - statisticsPackageInfoEntity.setRealDeliveryDistance(json.getBigDecimal("deliveryDistance")); - statisticsPackageInfoEntity.setDeliveryCrossingFee(json.getBigDecimal("deliveryCrossingFee")); - statisticsPackageInfoEntity.setRealDeliveryCrossingFee(json.getBigDecimal("deliveryCrossingFee")); - statisticsPackageInfoEntity.setInstallFee(json.getBigDecimal("installFee")); - statisticsPackageInfoEntity.setRealInstallFee(json.getBigDecimal("installFee")); - statisticsPackageInfoEntity.setQuotationFee(json.getBigDecimal("quotationFee")); - statisticsPackageInfoEntity.setRealQuotationFee(json.getBigDecimal("quotationFee")); - statisticsPackageInfoEntity.setClaimingValue(json.getBigDecimal("claimingValue")); - statisticsPackageInfoEntity.setRealClaimingValue(json.getBigDecimal("claimingValue")); - statisticsPackageInfoEntity.setOtherFee(json.getBigDecimal("otherFee")); - statisticsPackageInfoEntity.setRealOtherFee(json.getBigDecimal("otherFee")); - statisticsPackageInfoEntity.setReturnFee(json.getBigDecimal("returnFee")); - statisticsPackageInfoEntity.setRealReturnFee(json.getBigDecimal("returnFee")); - statisticsPackageInfoEntity.setThirdOprationFee(json.getBigDecimal("thirdOprationFee")); - statisticsPackageInfoEntity.setRealThirdOprationFee(json.getBigDecimal("thirdOprationFee")); - statisticsPackageInfoEntity.setXPay(json.getBigDecimal("xPay")); - statisticsPackageInfoEntity.setRealXPay(json.getBigDecimal("xPay")); - statisticsPackageInfoEntity.setDPay(json.getBigDecimal("dPay")); - statisticsPackageInfoEntity.setRealDPay(json.getBigDecimal("dPay")); - statisticsPackageInfoEntity.setHPay(json.getBigDecimal("hPay")); - statisticsPackageInfoEntity.setRealHPay(json.getBigDecimal("hPay")); - statisticsPackageInfoEntity.setYPay(json.getBigDecimal("yPay")); - statisticsPackageInfoEntity.setRealYPay(json.getBigDecimal("yPay")); - statisticsPackageInfoEntity.setIsAftersales(0); - statisticsPackageInfoEntity.setHasStatement(0); - ls.add(statisticsPackageInfoEntity); + statisticsDistributionPackageEntity.setOrderCode(json.getStr("orderCode")); + statisticsDistributionPackageEntity.setOrderPackageCode(json.getStr("orderPackageCode")); + statisticsDistributionPackageEntity.setProductName(json.getStr("productName")); + statisticsDistributionPackageEntity.setTotalNum(json.getInt("totalNum")); + statisticsDistributionPackageEntity.setTotalWeight(json.getBigDecimal("totalWeight")); + statisticsDistributionPackageEntity.setTotalVolume(json.getBigDecimal("totalVolume")); + statisticsDistributionPackageEntity.setDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee")); + statisticsDistributionPackageEntity.setRealDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee")); + statisticsDistributionPackageEntity.setDeliveryFee(json.getBigDecimal("deliveryFee")); + statisticsDistributionPackageEntity.setRealDeliveryFee(json.getBigDecimal("deliveryFee")); + statisticsDistributionPackageEntity.setDeliveryLoadingFee(json.getBigDecimal("deliveryLoadingFee")); + statisticsDistributionPackageEntity.setRealDeliveryLoadingFee(json.getBigDecimal("deliveryLoadingFee")); + statisticsDistributionPackageEntity.setDeliverySortingFee(json.getBigDecimal("deliverySortingFee")); + statisticsDistributionPackageEntity.setRealDeliverySortingFee(json.getBigDecimal("deliverySortingFee")); + statisticsDistributionPackageEntity.setDeliveryUpfloorFee(json.getBigDecimal("deliveryUpfloorFee")); + statisticsDistributionPackageEntity.setRealDeliveryUpfloorFee(json.getBigDecimal("deliveryUpfloorFee")); + statisticsDistributionPackageEntity.setDeliveryMoveFee(json.getBigDecimal("deliveryMoveFee")); + statisticsDistributionPackageEntity.setRealDeliveryMoveFee(json.getBigDecimal("deliveryMoveFee")); + statisticsDistributionPackageEntity.setDeliveryDistance(json.getBigDecimal("deliveryDistance")); + statisticsDistributionPackageEntity.setRealDeliveryDistance(json.getBigDecimal("deliveryDistance")); + statisticsDistributionPackageEntity.setDeliveryCrossingFee(json.getBigDecimal("deliveryCrossingFee")); + statisticsDistributionPackageEntity.setRealDeliveryCrossingFee(json.getBigDecimal("deliveryCrossingFee")); + statisticsDistributionPackageEntities.add(statisticsDistributionPackageEntity); + + } + + Long waybillInfoId = null; + //生成运单维度 + if(!"2".equals(typeService)){ + StatisticsWaybillInfoEntity statisticsWaybillInfoEntity = new StatisticsWaybillInfoEntity(); + statisticsWaybillInfoEntity.setWaybillNo(waybillNo); + statisticsWaybillInfoEntity.setWaybillId(waybillId); + statisticsWaybillInfoEntity.setTypeService(typeService); + statisticsWaybillInfoEntity.setConfirmStatisticsOrder(0); + statisticsWaybillInfoService.save(statisticsWaybillInfoEntity); + waybillInfoId = statisticsWaybillInfoEntity.getId(); } - statisticsPackageInfoService.saveBatch(ls); - //把ls通过typeService=2过滤为一个新的list - List shipeiList = ls.stream().filter(item -> item.getTypeService().equals("2")).collect(Collectors.toList()); - //toC维度 + //把statisticsPackageInfoEntities的orderCode作为key进行分组 + Map> trunklineMap = statisticsTrunklinePackageEntities.stream().collect(Collectors.groupingBy(StatisticsTrunklinePackageEntity::getOrderCode)); + Map> warehouseMap = statisticsWarehousePackageEntities.stream().collect(Collectors.groupingBy(StatisticsWarehousePackageEntity::getOrderCode)); + Map> distributionMap = statisticsDistributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getOrderCode)); + List orderInfoEntities = new ArrayList<>(); + Long finalWaybillInfoId = waybillInfoId; + trunklineMap.keySet().forEach(key -> { + StatisticsOrderInfoEntity statisticsOrderInfoEntity = new StatisticsOrderInfoEntity(); + statisticsOrderInfoEntity.setWaybillId(waybillId); + statisticsOrderInfoEntity.setWaybillNo(waybillNo); + statisticsOrderInfoEntity.setOrderCode(key); + statisticsOrderInfoEntity.setTypeService(typeService); + if(!Objects.isNull(finalWaybillInfoId)){ + statisticsOrderInfoEntity.setWaybillInfoId(finalWaybillInfoId); + } +// statisticsOrderInfoEntity.setConfirmStatus(0); + orderInfoEntities.add(statisticsOrderInfoEntity); + }); + statisticsOrderInfoService.saveBatch(orderInfoEntities); - List otherList = ls.stream().filter(item -> !item.getTypeService().equals("2")).collect(Collectors.toList()); - //toB维度 + List statisticsTrunklinePackageSaveList = new ArrayList<>(); + List statisticsWarehousePackageSaveList = new ArrayList<>(); + List statisticsDistributionPackageSaveList = new ArrayList<>(); + orderInfoEntities.forEach(statisticsOrderInfoEntity -> { + String orderCode = statisticsOrderInfoEntity.getOrderCode(); + Long orderInfoId = statisticsOrderInfoEntity.getId(); + List statisticsTrunklinePackageEntityList= trunklineMap.get(orderCode); + statisticsTrunklinePackageEntityList.forEach(statisticsTrunklinePackageEntity -> { + statisticsTrunklinePackageEntity.setOrderInfoId(orderInfoId); + }); + statisticsTrunklinePackageSaveList.addAll(statisticsTrunklinePackageEntityList); + }); + statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageSaveList); + orderInfoEntities.forEach(statisticsOrderInfoEntity -> { + String orderCode = statisticsOrderInfoEntity.getOrderCode(); + Long orderInfoId = statisticsOrderInfoEntity.getId(); + List statisticsWarehousePackageEntityList= warehouseMap.get(orderCode); + statisticsWarehousePackageEntityList.forEach(statisticsWarehousePackageEntity -> { + statisticsWarehousePackageEntity.setOrderInfoId(orderInfoId); + }); + statisticsWarehousePackageSaveList.addAll(statisticsWarehousePackageEntityList); + }); + statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList); + orderInfoEntities.forEach(statisticsOrderInfoEntity -> { + String orderCode = statisticsOrderInfoEntity.getOrderCode(); + Long orderInfoId = statisticsOrderInfoEntity.getId(); + List statisticsDistributionPackageEntityList= distributionMap.get(orderCode); + statisticsDistributionPackageEntityList.forEach(statisticsDistributionPackageEntity -> { + statisticsDistributionPackageEntity.setOrderInfoId(orderInfoId); + }); + statisticsDistributionPackageSaveList.addAll(statisticsDistributionPackageEntityList); + }); + statisticsDistributionPackageService.saveBatch(statisticsDistributionPackageSaveList); log.info("处理完成:{}", msg); @@ -155,6 +264,84 @@ public class WaybillFanoutListener { @Transactional(rollbackFor = Exception.class) public void updateWaybillData(String msg) { log.info("接收到消息:{}", msg); + + JSONObject jsonObject = JSONUtil.parseObj(msg); + Long warehouseId = jsonObject.getLong("warehouseId"); + String warehouseName = jsonObject.getStr("warehouseName"); + Long waybillId = jsonObject.getLong("waybillId"); + String waybillNo = jsonObject.getStr("waybillNo"); + String typeService = jsonObject.getStr("typeService");//服务类型 + + statisticsTrunklinePackageService.deleteListByWaybillId(waybillId); + + List orderInfoEntities = statisticsOrderInfoService.findListByWaybillId(waybillId); + //把orderInfoEntities以orderCode未key,元素本身为value转成Map + Map orderInfoMap = orderInfoEntities.stream() + .collect(Collectors.toMap( + StatisticsOrderInfoEntity::getOrderCode, + entity -> entity + )); + List statisticsTrunklinePackageEntities = new ArrayList<>(); + + JSONArray orderPackageCodes = jsonObject.getJSONArray("orderPackageCodes"); + for (int i = 0; i < orderPackageCodes.size(); i++) { + JSONObject json = orderPackageCodes.getJSONObject(i); + + //干线 + StatisticsTrunklinePackageEntity statisticsTrunklinePackageEntity = new StatisticsTrunklinePackageEntity(); + statisticsTrunklinePackageEntity.setWarehouseId(warehouseId); + statisticsTrunklinePackageEntity.setWarehouseName(warehouseName); + statisticsTrunklinePackageEntity.setTypeService(typeService); + statisticsTrunklinePackageEntity.setWaybillId(waybillId); + statisticsTrunklinePackageEntity.setWaybillNo(waybillNo); + Integer waybillType = json.getInt("waybillType"); + if(waybillType.equals(1)){ + statisticsTrunklinePackageEntity.setGoodsType(1); + }else if (waybillType.equals(2)){ + statisticsTrunklinePackageEntity.setGoodsType(2); + }else{ + statisticsTrunklinePackageEntity.setGoodsType(3); + } + String orderCode = json.getStr("orderCode"); + StatisticsOrderInfoEntity statisticsOrderInfoEntity = orderInfoMap.get(orderCode); + statisticsTrunklinePackageEntity.setOrderInfoId(statisticsOrderInfoEntity.getId()); + statisticsTrunklinePackageEntity.setOrderCode(orderCode); + statisticsTrunklinePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode")); + statisticsTrunklinePackageEntity.setProductName(json.getStr("productName")); + statisticsTrunklinePackageEntity.setTotalNum(json.getInt("totalNum")); + statisticsTrunklinePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight")); + statisticsTrunklinePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume")); + statisticsTrunklinePackageEntity.setOpenPrice(json.getBigDecimal("openPrice")); + statisticsTrunklinePackageEntity.setTotalPrice(json.getBigDecimal("openPrice")); + statisticsTrunklinePackageEntity.setPickupFee(json.getBigDecimal("pickupFee")); + statisticsTrunklinePackageEntity.setRealPickupFee(json.getBigDecimal("pickupFee")); + statisticsTrunklinePackageEntity.setFreightFee(json.getBigDecimal("freightFee")); + statisticsTrunklinePackageEntity.setRealFreightFee(json.getBigDecimal("freightFee")); + statisticsTrunklinePackageEntity.setInstallFee(json.getBigDecimal("installFee")); + statisticsTrunklinePackageEntity.setRealInstallFee(json.getBigDecimal("installFee")); + statisticsTrunklinePackageEntity.setQuotationFee(json.getBigDecimal("quotationFee")); + statisticsTrunklinePackageEntity.setRealQuotationFee(json.getBigDecimal("quotationFee")); + statisticsTrunklinePackageEntity.setClaimingValue(json.getBigDecimal("claimingValue")); + statisticsTrunklinePackageEntity.setRealClaimingValue(json.getBigDecimal("claimingValue")); + statisticsTrunklinePackageEntity.setOtherFee(json.getBigDecimal("otherFee")); + statisticsTrunklinePackageEntity.setRealOtherFee(json.getBigDecimal("otherFee")); + statisticsTrunklinePackageEntity.setReturnFee(json.getBigDecimal("returnFee")); + statisticsTrunklinePackageEntity.setRealReturnFee(json.getBigDecimal("returnFee")); + statisticsTrunklinePackageEntity.setThirdOprationFee(json.getBigDecimal("thirdOprationFee")); + statisticsTrunklinePackageEntity.setRealThirdOprationFee(json.getBigDecimal("thirdOprationFee")); + statisticsTrunklinePackageEntity.setXPay(json.getBigDecimal("xPay")); + statisticsTrunklinePackageEntity.setRealXPay(json.getBigDecimal("xPay")); + statisticsTrunklinePackageEntity.setDPay(json.getBigDecimal("dPay")); + statisticsTrunklinePackageEntity.setRealDPay(json.getBigDecimal("dPay")); + statisticsTrunklinePackageEntity.setHPay(json.getBigDecimal("hPay")); + statisticsTrunklinePackageEntity.setRealHPay(json.getBigDecimal("hPay")); + statisticsTrunklinePackageEntity.setYPay(json.getBigDecimal("yPay")); + statisticsTrunklinePackageEntity.setRealYPay(json.getBigDecimal("yPay")); + statisticsTrunklinePackageEntities.add(statisticsTrunklinePackageEntity); + + } + statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageEntities); + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsDistributionPackageMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsDistributionPackageMapper.java new file mode 100644 index 000000000..d77df8e77 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsDistributionPackageMapper.java @@ -0,0 +1,9 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.StatisticsDistributionPackageEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StatisticsDistributionPackageMapper extends BaseMapper { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java new file mode 100644 index 000000000..29b17b8ab --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java @@ -0,0 +1,9 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.StatisticsOrderInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StatisticsOrderInfoMapper extends BaseMapper { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.java deleted file mode 100644 index bebba398d..000000000 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.logpm.statistics.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.logpm.statistics.entity.StatisticsPackageInfoEntity; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface StatisticsPackageInfoMapper extends BaseMapper { -} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.xml deleted file mode 100644 index 4950ecfc9..000000000 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsPackageInfoMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.java new file mode 100644 index 000000000..bcfb01986 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.java @@ -0,0 +1,11 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.StatisticsTrunklinePackageEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface StatisticsTrunklinePackageMapper extends BaseMapper { + void deleteListByWaybillId(@Param("waybillId") Long waybillId); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.xml new file mode 100644 index 000000000..608fa792e --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsTrunklinePackageMapper.xml @@ -0,0 +1,10 @@ + + + + + + delete from logpm_statistics_trunkline_package + where waybill_id = #{waybillId} + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWarehousePackageMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWarehousePackageMapper.java new file mode 100644 index 000000000..ea64a49fd --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWarehousePackageMapper.java @@ -0,0 +1,9 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.StatisticsWarehousePackageEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StatisticsWarehousePackageMapper extends BaseMapper { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java new file mode 100644 index 000000000..2c48810fe --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsWaybillInfoMapper.java @@ -0,0 +1,9 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.StatisticsWaybillInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface StatisticsWaybillInfoMapper extends BaseMapper { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsDistributionPackageService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsDistributionPackageService.java new file mode 100644 index 000000000..bd1091536 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsDistributionPackageService.java @@ -0,0 +1,13 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.StatisticsDistributionPackageEntity; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Set; + +public interface IStatisticsDistributionPackageService extends BaseService { + List findListByOrderPackageCodes(List orderPackageCodeList); + + List findListByOrderInfoSet(Set orderInfoSet); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java new file mode 100644 index 000000000..2f9daae0c --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java @@ -0,0 +1,13 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.StatisticsOrderInfoEntity; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; +import java.util.Set; + +public interface IStatisticsOrderInfoService extends BaseService { + List findListByWaybillId(Long waybillId); + + List findListByOrderInfoIdsSet(Set orderInfoSet); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsPackageInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsPackageInfoService.java deleted file mode 100644 index 1d612ff60..000000000 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsPackageInfoService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.logpm.statistics.service; - -import com.logpm.statistics.entity.StatisticsPackageInfoEntity; -import org.springblade.core.mp.base.BaseService; - -public interface IStatisticsPackageInfoService extends BaseService { -} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsTrunklinePackageService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsTrunklinePackageService.java new file mode 100644 index 000000000..48e4c63d1 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsTrunklinePackageService.java @@ -0,0 +1,8 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.StatisticsTrunklinePackageEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IStatisticsTrunklinePackageService extends BaseService { + void deleteListByWaybillId(Long waybillId); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWarehousePackageService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWarehousePackageService.java new file mode 100644 index 000000000..548822224 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWarehousePackageService.java @@ -0,0 +1,7 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.StatisticsWarehousePackageEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IStatisticsWarehousePackageService extends BaseService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java new file mode 100644 index 000000000..4b0f40e44 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsWaybillInfoService.java @@ -0,0 +1,7 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.StatisticsWaybillInfoEntity; +import org.springblade.core.mp.base.BaseService; + +public interface IStatisticsWaybillInfoService extends BaseService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsDistributionPackageServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsDistributionPackageServiceImpl.java new file mode 100644 index 000000000..fad19ef2b --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsDistributionPackageServiceImpl.java @@ -0,0 +1,34 @@ +package com.logpm.statistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.statistics.entity.StatisticsDistributionPackageEntity; +import com.logpm.statistics.mapper.StatisticsDistributionPackageMapper; +import com.logpm.statistics.service.IStatisticsDistributionPackageService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +@Slf4j +@Service +@AllArgsConstructor +public class StatisticsDistributionPackageServiceImpl extends BaseServiceImpl implements IStatisticsDistributionPackageService { + @Override + public List findListByOrderPackageCodes(List orderPackageCodeList) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("order_package_code", orderPackageCodeList); + + return baseMapper.selectList(queryWrapper); + } + + @Override + public List findListByOrderInfoSet(Set orderInfoSet) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("order_info_id", orderInfoSet); + + return baseMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java new file mode 100644 index 000000000..49fffbd4c --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java @@ -0,0 +1,32 @@ +package com.logpm.statistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.statistics.entity.StatisticsOrderInfoEntity; +import com.logpm.statistics.mapper.StatisticsOrderInfoMapper; +import com.logpm.statistics.service.IStatisticsOrderInfoService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Set; + +@Slf4j +@Service +@AllArgsConstructor +public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl implements IStatisticsOrderInfoService { + @Override + public List findListByWaybillId(Long waybillId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("waybill_id",waybillId); + return baseMapper.selectList(queryWrapper); + } + + @Override + public List findListByOrderInfoIdsSet(Set orderInfoSet) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("id",orderInfoSet); + return baseMapper.selectList(queryWrapper); + } +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsPackageInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsPackageInfoServiceImpl.java deleted file mode 100644 index a03fffd56..000000000 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsPackageInfoServiceImpl.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.logpm.statistics.service.impl; - -import com.logpm.statistics.entity.StatisticsPackageInfoEntity; -import com.logpm.statistics.mapper.StatisticsPackageInfoMapper; -import com.logpm.statistics.service.IStatisticsPackageInfoService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springframework.stereotype.Service; - -@Service -@AllArgsConstructor -@Slf4j -public class StatisticsPackageInfoServiceImpl extends BaseServiceImpl implements IStatisticsPackageInfoService { -} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsTrunklinePackageServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsTrunklinePackageServiceImpl.java new file mode 100644 index 000000000..35fad7f45 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsTrunklinePackageServiceImpl.java @@ -0,0 +1,19 @@ +package com.logpm.statistics.service.impl; + +import com.logpm.statistics.entity.StatisticsTrunklinePackageEntity; +import com.logpm.statistics.mapper.StatisticsTrunklinePackageMapper; +import com.logpm.statistics.service.IStatisticsTrunklinePackageService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class StatisticsTrunklinePackageServiceImpl extends BaseServiceImpl implements IStatisticsTrunklinePackageService { + @Override + public void deleteListByWaybillId(Long waybillId) { + baseMapper.deleteListByWaybillId(waybillId); + } +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWarehousePackageServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWarehousePackageServiceImpl.java new file mode 100644 index 000000000..47d6198f0 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWarehousePackageServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.statistics.service.impl; + +import com.logpm.statistics.entity.StatisticsWarehousePackageEntity; +import com.logpm.statistics.mapper.StatisticsWarehousePackageMapper; +import com.logpm.statistics.service.IStatisticsWarehousePackageService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@AllArgsConstructor +public class StatisticsWarehousePackageServiceImpl extends BaseServiceImpl implements IStatisticsWarehousePackageService { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java new file mode 100644 index 000000000..31777f266 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsWaybillInfoServiceImpl.java @@ -0,0 +1,15 @@ +package com.logpm.statistics.service.impl; + +import com.logpm.statistics.entity.StatisticsWaybillInfoEntity; +import com.logpm.statistics.mapper.StatisticsWaybillInfoMapper; +import com.logpm.statistics.service.IStatisticsWaybillInfoService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +@AllArgsConstructor +public class StatisticsWaybillInfoServiceImpl extends BaseServiceImpl implements IStatisticsWaybillInfoService { +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index 6653c1724..aa9887ef1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml @@ -358,7 +358,8 @@ + delete from logpm_distribution_parcel_list diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index eab24d0a8..d1d2757c3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -195,4 +195,6 @@ public interface DistributionStockArticleMapper extends BaseMapper> selectAdvance(@Param("orderCode")String orderCode); + + void updateCustomerAllByOrderCode(@Param("data") cn.hutool.json.JSONObject data); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index be1ad87da..fe6ef1260 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -52,36 +52,44 @@ - update logpm_distribution_stock_article set hand_quantity = hand_quantity + #{num} where id = #{id} + update logpm_distribution_stock_article + set hand_quantity = hand_quantity + #{num} + where id = #{id} - update logpm_distribution_stock_article set hand_quantity = hand_quantity - #{allNum} where id = #{articleId} and hand_quantity - #{allNum} >= 0 + update logpm_distribution_stock_article + set hand_quantity = hand_quantity - #{allNum} + where id = #{articleId} + and hand_quantity - #{allNum} >= 0 - select ldsa.waybill_number waybillNo, - ldsa.order_code orderCode, - lww.create_time createTime, - lww.destination destination, - lww.destination_warehouse_name destinationWarehouseName, - lww.shipper shipper, - lww.shipper_name shipperName, - lww.consignee consignee, - lww.consignee_name consigneeName, - lww.goods_name goodsName, - lww.total_count totalNum, - lww.total_weight weight, - lww.total_volume volume, - ldsa.hand_quantity stockNum, - lww.customer_train customerTrain, + select ldsa.waybill_number waybillNo, + ldsa.order_code orderCode, + lww.create_time createTime, + lww.destination destination, + lww.destination_warehouse_name destinationWarehouseName, + lww.shipper shipper, + lww.shipper_name shipperName, + lww.consignee consignee, + lww.consignee_name consigneeName, + lww.goods_name goodsName, + lww.total_count totalNum, + lww.total_weight weight, + lww.total_volume volume, + ldsa.hand_quantity stockNum, + lww.customer_train customerTrain, lww.total_freight, lww.total_count, - lww.remark remark, - ROUND(lww.total_freight/lww.total_count,2) price + lww.remark remark, + ROUND(lww.total_freight / lww.total_count, 2) price from logpm_distribution_stock_article ldsa left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.waybill_number where ldsa.is_zero = 1 - and ldsa.warehouse_id = #{warehouseId} + and ldsa.warehouse_id = #{warehouseId} - - select sum(( + select sum(( select COUNT(ldl.id) from logpm_distribution_loadscan ldl - where ldl.package_id = ldpl.id and ldl.signfor_state = 2 - ) ) signinQuantity, - sum(( - select COUNT(ldl.id) - from logpm_distribution_loadscan ldl - where ldl.package_id = ldpl.id and ldl.signfor_state = 1 - )) deliveryQuantity - from logpm_distribution_parcel_list ldpl + where ldl.package_id = ldpl.id + and ldl.signfor_state = 2 + )) signinQuantity, + sum(( + select COUNT(ldl.id) + from logpm_distribution_loadscan ldl + where ldl.package_id = ldpl.id + and ldl.signfor_state = 1 + )) deliveryQuantity + from logpm_distribution_parcel_list ldpl where ldpl.stock_article_id = #{id} - + update logpm_distribution_stock_article - set total_number = total_number - #{subNum}, + set total_number = total_number - #{subNum}, hand_quantity = hand_quantity - #{subNum}, - incoming_num = incoming_num - #{subNum} + incoming_num = incoming_num - #{subNum} where id = #{articleId} @@ -1145,7 +1189,7 @@ ELSE '未知' END orderStatusName, - CASE ldsa.is_zero + CASE ldsa.is_zero WHEN 0 THEN '否' WHEN 1 THEN '是' ELSE @@ -1157,8 +1201,10 @@ WHEN 30 THEN '已预约' END orderReservationStatusName, CASE ldsa.is_zero - WHEN 0 THEN IF(ldsa.total_number =(SELECT SUM(quantity) FROM logpm_distribution_parcel_list WHERE stock_article_id = ldsa.id),'是','否') - WHEN 1 THEN IF(ldsa.total_number =(SELECT SUM(quantity) FROM logpm_distribution_parcel_number WHERE stock_article_id = ldsa.id),'是','否') + WHEN 0 THEN IF(ldsa.total_number =(SELECT SUM(quantity) FROM logpm_distribution_parcel_list WHERE + stock_article_id = ldsa.id),'是','否') + WHEN 1 THEN IF(ldsa.total_number =(SELECT SUM(quantity) FROM logpm_distribution_parcel_number WHERE + stock_article_id = ldsa.id),'是','否') END isCompleteSet, CASE ldsa.type_service WHEN 1 THEN '商配' @@ -1166,10 +1212,14 @@ WHEN 3 THEN '自提' WHEN 4 THEN '三方中转' END typeServiceName, - IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE order_id = ldsa.id AND scan_status != 1 ), 0 ) AS deliveryNumber, - IFNULL(( SELECT SUM( received_quantity ) FROM logpm_distribution_loadscan WHERE order_id = ldsa.id AND scan_status != 1 ), 0 ) AS signForNumber, - IFNULL(( SELECT SUM( stock_quantity ) FROM logpm_distribution_stock WHERE stock_article = ldsa.id ), 0 ) AS stockUpNumber, - IFNULL(( SELECT SUM( reservation_num ) FROM logpm_distribution_reservation_stockarticle WHERE stock_article_id = ldsa.id AND stock_article_status!= 2), 0 ) AS reservationNumber, + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE order_id = ldsa.id AND scan_status != 1 + ), 0 ) AS deliveryNumber, + IFNULL(( SELECT SUM( received_quantity ) FROM logpm_distribution_loadscan WHERE order_id = ldsa.id AND + scan_status != 1 ), 0 ) AS signForNumber, + IFNULL(( SELECT SUM( stock_quantity ) FROM logpm_distribution_stock WHERE stock_article = ldsa.id ), 0 ) AS + stockUpNumber, + IFNULL(( SELECT SUM( reservation_num ) FROM logpm_distribution_reservation_stockarticle WHERE stock_article_id = + ldsa.id AND stock_article_status!= 2), 0 ) AS reservationNumber, IF(GROUP_CONCAT(t.msg) is not null,GROUP_CONCAT(t.msg),IFNULL(GROUP_CONCAT(y.msg),null)) AS reservationInfo, GROUP_CONCAT(DISTINCT IFNULL( m.mssg,'')) AS deliveryListInfo, ldsa.create_time As createTime, @@ -1177,7 +1227,7 @@ m.signing_time AS signinTime, GROUP_CONCAT(DISTINCT IFNULL( m.driverName,'')) AS driverName, GROUP_CONCAT(DISTINCT IFNULL( m.vehicleName,'')) AS vehicleName, - GROUP_CONCAT(DISTINCT IFNULL( m.examine_user_name,'')) AS examineUserNames, + GROUP_CONCAT(DISTINCT IFNULL( m.examine_user_name,'')) AS examineUserNames, k.earliestWarehouseEntryTime AS earliestWarehouseEntryTime, GROUP_CONCAT(t.reservation_id) AS reservationIds, j.scanSigningTime AS scanSigningTime @@ -1224,18 +1274,20 @@ LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id GROUP BY ldr.id ) AS m ON ldsa.id = m.stock_article_id AND t.reservation_id = m.reservation_id - LEFT JOIN ( SELECT stock_article_id, min( create_time ) AS earliestWarehouseEntryTime FROM logpm_distribution_parcel_list GROUP BY stock_article_id) AS k ON k.stock_article_id = ldsa.id - LEFT JOIN ( SELECT order_id, max( signing_time ) AS scanSigningTime FROM logpm_distribution_loadscan WHERE scan_status != 1 AND signfor_state = 2 GROUP BY order_id ) AS j ON j.order_id = ldsa.id + LEFT JOIN ( SELECT stock_article_id, min( create_time ) AS earliestWarehouseEntryTime FROM + logpm_distribution_parcel_list GROUP BY stock_article_id) AS k ON k.stock_article_id = ldsa.id + LEFT JOIN ( SELECT order_id, max( signing_time ) AS scanSigningTime FROM logpm_distribution_loadscan WHERE + scan_status != 1 AND signfor_state = 2 GROUP BY order_id ) AS j ON j.order_id = ldsa.id ldsa.order_status in ('70','80') - AND ldsa.waybill_number like concat(#{param.waybillNumber},"%") + AND ldsa.waybill_number like concat(#{param.waybillNumber},"%") AND ldsa.service_number like concat(#{param.serviceNumber},"%") - AND ldsa.order_code like concat(#{param.orderCode},"%") + AND ldsa.order_code like concat(#{param.orderCode},"%") AND ldsa.warehouse like concat(#{param.warehouseName},"%") @@ -1269,7 +1321,7 @@ AND ldsa.warehouse_id = #{param.warehouseId} - AND ldsa.warehouse_id IN + AND ldsa.warehouse_id IN #{item} @@ -1327,7 +1379,9 @@ ldsa.id @@ -1335,5 +1389,16 @@ set total_number = #{total} where order_code = #{orderCode} + + update logpm_distribution_stock_article + set + customer_name = #{data.customerName}, + customer_telephone=#{data.customerPhone}, + customer_address=#{data.customerAddress} + where reservation_status = '10' + + and order_code = #{data.orderCode} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index 4224e98d2..d39754577 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -235,4 +235,11 @@ public interface IDistributionParcelListService extends BaseService findAllOrderCodesByAdvanceIds(List advanceIds, Long warehouseId); void removePakcageByAdvanceIds(List advanceIds, Long warehouseId); + + /** + * 根据包件码查询包件 + * @param keySet + * @return + */ + Map> findPackageCodeByCodes(Set keySet); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 83c68309b..c935b13c8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -282,4 +282,10 @@ public interface IDistributionStockArticleService extends BaseService> findPackageCodeByCodes(Set keySet) { + Map> resultMap = new HashMap<>(); + List> map = baseMapper.findPackageCodeByCodes(keySet); + if(CollUtil.isNotEmpty(map)){ + for (Map stringStringMap : map) { + String code = stringStringMap.get("code"); + String id = stringStringMap.get("id"); + if(resultMap.containsKey(code)){ + resultMap.get(code).add(id); + }else{ + Set set = new HashSet<>(); + set.add(id); + resultMap.put(code,set); + } + } + } + return resultMap; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 9f66ece6f..b24b5e045 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.service.impl; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -2668,7 +2669,13 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java index 9ddd2a182..28f005ece 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java @@ -275,19 +275,15 @@ public class ZbomFactoryOrderListener { advanceEntity.setCustomerName(orderPackageDTO.getReceiverName()); advanceEntity.setCustomerPhone(orderPackageDTO.getReceiverMobile()); advanceEntity.setCustomerAddress(orderPackageDTO.getReceiverAddress()); - - // 封装包件 - TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity(); - advanceDetailEntity.setWarehouseId(startWarehouseId); - advanceDetailEntity.setWarehouseName(startWarehouseName); -// advanceDetailEntity.setIncomingWarehouseId(0L); -// advanceDetailEntity.setIncomingWarehouseName(""); // 根据志邦的一流单标识赋值 advanceEntity.setLegacyStatus("0"); if (ObjectUtil.equal(orderPackageDTO.getLegacyFlag(), "Y")) { advanceEntity.setLegacyStatus("1"); } - + // 封装包件 + TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity(); + advanceDetailEntity.setWarehouseId(startWarehouseId); + advanceDetailEntity.setWarehouseName(startWarehouseName); advanceDetailEntity.setOrderCode(orderPackageDTO.getPlatformOrderCode()); advanceDetailEntity.setBrand(zbReceiptDTO.getSenderName()); advanceDetailEntity.setSystemType("线上"); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java index 81e594af5..8101d6b3f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java @@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; import java.util.Set; @Mapper @@ -55,7 +56,7 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper类型的集合,包含与输入订单包裹代码相匹配的包裹编码。 * 如果没有找到匹配的包裹编码,则返回一个空集合。 */ - List findPackageCodeByCodes(@Param("orderPackageCodes") Set orderPackageCodes); + List> findPackageCodeByCodes(@Param("orderPackageCodes") Set orderPackageCodes); IPage findOrderDetails(IPage page, @Param("param") OrderDetailsDTO orderDetailsDTO); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index aa9887ef1..91e2a84fc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml @@ -198,8 +198,8 @@ and package_status = #{packageStatus} and is_deleted = 0 - + select t.order_package_code code,t.id id from logpm_trunkline_advance_detail t where exists( select 1 from ( diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java index 234c08ff6..4e192983a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java @@ -1,6 +1,7 @@ package com.logpm.trunkline.mq; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; @@ -9,6 +10,9 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.feign.IDistributionParcelListClient; +import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.factorydata.enums.BrandEnums; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; @@ -29,8 +33,10 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -48,6 +54,8 @@ public class AdvanceOrderListener { private final ITrunklineAdvanceDetailService advanceDetailService; private final ITrunklineDetailProductService detailProductService; private final ITrunklineCarsLoadService trunklineCarsLoadService; + private final IDistributionStockArticleClient stockArticleClient; + private final IDistributionParcelListClient parcelListClient; @RabbitListener(bindings = @QueueBinding( value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER), @@ -76,7 +84,7 @@ public class AdvanceOrderListener { TrunklineAdvanceEntity entity = advanceEntities.get(0); if (ObjectUtil.isNotEmpty(entity)) { advanceEntity.setId(entity.getId()); - advanceEntity.setTrainNumber(entity.getTrainNumber() + advanceEntity.getTotalNum()); +// advanceEntity.setTotalNum(entity.getTotalNum() + advanceEntity.getTotalNum()); } } Set packageCodeSet = new HashSet<>(); @@ -99,9 +107,9 @@ public class AdvanceOrderListener { }); // 查询数据库,校验订单包件编码是否重复 if (CollUtil.isNotEmpty(orderPackageCodes)) { - List codes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes); - if (CollUtil.isNotEmpty(codes)) { - packageCodeSet.addAll(codes); + Map packageCodeByCodes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes); + if (CollUtil.isNotEmpty(packageCodeByCodes)) { + packageCodeSet.addAll(packageCodeByCodes.keySet()); } } } @@ -172,4 +180,192 @@ public class AdvanceOrderListener { } } + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_OUPAI), + exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER_OUPAI, type = ExchangeTypes.TOPIC), + key = FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER + )) + @Transactional(rollbackFor = Exception.class) + public void advanceOrderOuPai(String msg) { + // 新增暂存单 + if (StrUtil.isNotBlank(msg)) { + log.info("收到欧派工厂数据暂存单消息:{}", msg); + JSONObject entries = JSONUtil.parseObj(msg); + JSONArray details = entries.getJSONArray("details"); + TrunklineAdvanceEntity advanceEntity = JSONUtil.toBean(entries, TrunklineAdvanceEntity.class); + LambdaQueryWrapper eq = Wrappers.lambdaQuery() + .eq(TrunklineAdvanceEntity::getOrderCode, advanceEntity.getOrderCode()); + if (StrUtil.isNotEmpty(advanceEntity.getTrainNumber())) { + eq.eq(TrunklineAdvanceEntity::getTrainNumber, advanceEntity.getTrainNumber()); + } + // 暂存单 订单自编号 + 车次号 唯一 + List advanceEntities = advanceService.list(eq); + + // 暂存单存在 并且未开单 则将新数据添加到原来的暂存单上 + // 如果已开单则新增暂存单 + // 订单 修改最终客户信息 + if (CollUtil.isNotEmpty(advanceEntities)) { + TrunklineAdvanceEntity entity = advanceEntities.get(0); + if (ObjectUtil.isNotEmpty(entity)) { + // 如果存在则只修改客户信息 + if (StrUtil.isNotEmpty(advanceEntity.getCustomerName())) { + entity.setCustomerName(advanceEntity.getCustomerName()); + } + if (StrUtil.isNotEmpty(advanceEntity.getCustomerAddress())) { + entity.setCustomerAddress(advanceEntity.getCustomerAddress()); + } + if (StrUtil.isNotEmpty(advanceEntity.getCustomerPhone())) { + entity.setCustomerPhone(advanceEntity.getCustomerPhone()); + } + advanceService.updateById(entity); + // 修改在库订单信息 未预约的数据 reservation_status = 10 才更新 + if (ObjectUtil.isAllNotEmpty(entity.getOrderCode(), advanceEntity.getCustomerName(), advanceEntity.getCustomerAddress(), advanceEntity.getCustomerPhone())) { + try { + JSONObject jsonObject = new JSONObject(); + jsonObject.set("orderCode", entity.getOrderCode()); + jsonObject.set("customerName", advanceEntity.getCustomerName()); + jsonObject.set("customerAddress", advanceEntity.getCustomerAddress()); + jsonObject.set("customerPhone", advanceEntity.getCustomerPhone()); + stockArticleClient.updateCustomerAllByOrderCode(JSONUtil.toJsonStr(jsonObject)); + } catch (Exception e) { + log.error("更新在库订单失败"); + } + } + } + } + if (ObjectUtil.isNotNull(advanceEntity)) { + String orderCode = advanceEntity.getOrderCode(); + if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) { + advanceEntity.setLegacyStatus("1"); + } + // 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加 + if (ObjectUtil.isEmpty(advanceEntity.getId())) { + advanceService.save(advanceEntity); + } + } + Map packageCodeMap = new HashMap<>(); + Map> parcelListMap = new HashMap<>(); + if (CollUtil.isNotEmpty(details)) { + // 使用HashSet代替ArrayList以优化内存使用和检查重复值 + Set orderPackageCodes = new HashSet<>(); + details.forEach(detail -> { + try { + // 更具描述性的变量命名 + JSONObject jsonObject = JSONUtil.parseObj(detail); + TrunklineAdvanceDetailEntity entity = JSONUtil.toBean(jsonObject, TrunklineAdvanceDetailEntity.class); + // 检查转换后的实体不为null,且其orderPackageCode非null + if (!ObjectUtil.isAllEmpty(entity, entity.getOrderPackageCode())) { + orderPackageCodes.add(entity.getOrderPackageCode()); + } + } catch (Exception e) { + // 异常处理,可根据实际情况记录日志或进行其他处理 + log.error("暂存单转换时发生异常: " + detail + ",异常:" + e.getMessage()); + } + }); + // 查询数据库,校验订单包件编码是否重复 + if (CollUtil.isNotEmpty(orderPackageCodes)) { + packageCodeMap = advanceDetailService.findPackageCodeByCodes(orderPackageCodes); + try { + if(CollUtil.isNotEmpty(packageCodeMap)){ + parcelListMap = parcelListClient.findPackageCodeByCodes(packageCodeMap.keySet()); + } + }catch (Exception e){ + log.error("查询包件表失败"); + } + } + } + + // 包件 修改 品类信息 物料名称 + if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) { + List advanceDetailEntityList = new ArrayList<>(); + List parcelListEntityList = new ArrayList<>(); + List detailProductEntityList = new ArrayList<>(); + Set productCodes = new HashSet<>(); + for (Object detailObj : details) { + JSONObject detail = JSONUtil.parseObj(detailObj); + TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class); + if (ObjectUtil.isNotNull(advanceDetailEntity)) { + if (CollUtil.isNotEmpty(packageCodeMap) && StrUtil.isNotEmpty(advanceDetailEntity.getOrderPackageCode()) + && packageCodeMap.containsKey(advanceDetailEntity.getOrderPackageCode())) { + if(!ObjectUtil.isAllEmpty(advanceDetailEntity.getFirstPackName(),advanceDetailEntity.getSecondPackName(), + advanceDetailEntity.getThirdPackName(),advanceDetailEntity.getMaterialName())){ + TrunklineAdvanceDetailEntity updatedetailEntity = new TrunklineAdvanceDetailEntity(); + updatedetailEntity.setId(Convert.toLong(packageCodeMap.get(advanceDetailEntity.getOrderPackageCode()))); + updatedetailEntity.setFirstPackName(advanceDetailEntity.getFirstPackName()); + updatedetailEntity.setFirstPackCode(advanceDetailEntity.getFirstPackCode()); + updatedetailEntity.setSecondPackName(advanceDetailEntity.getSecondPackName()); + updatedetailEntity.setSecondPackCode(advanceDetailEntity.getSecondPackCode()); + updatedetailEntity.setThirdPackName(advanceDetailEntity.getThirdPackName()); + updatedetailEntity.setThirdPackCode(advanceDetailEntity.getThirdPackCode()); + updatedetailEntity.setMaterialName(advanceDetailEntity.getMaterialName()); + updatedetailEntity.setMaterialCode(advanceDetailEntity.getMaterialCode()); + advanceDetailEntityList.add(updatedetailEntity); + } + if(CollUtil.isNotEmpty(parcelListMap) && parcelListMap.containsKey(advanceDetailEntity.getOrderPackageCode())){ + Set strings = parcelListMap.get(advanceDetailEntity.getOrderPackageCode()); + for (String string : strings) { + DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); + parcelListEntity.setId(Convert.toLong(string)); + parcelListEntity.setFirsts(advanceDetailEntity.getFirstPackName()); + parcelListEntity.setSecond(advanceDetailEntity.getSecondPackName()); + parcelListEntity.setThirdProduct(advanceDetailEntity.getThirdPackName()); + parcelListEntity.setMaterialName(advanceDetailEntity.getMaterialName()); + parcelListEntity.setMaterialCode(advanceDetailEntity.getMaterialCode()); + parcelListEntityList.add(parcelListEntity); + } + + } + } else { + advanceDetailEntity.setAdvanceId(advanceEntity.getId()); + // 设置发货时间为当前时间 + if (StrUtil.isEmpty(advanceDetailEntity.getSendDateStr())) { + advanceDetailEntity.setSendDateStr(DateUtil.today()); + } + advanceDetailEntityList.add(advanceDetailEntity); + } + + JSONArray items = detail.getJSONArray("items"); + if (CollUtil.isNotEmpty(items)) { + for (Object itemObj : items) { + JSONObject item = JSONUtil.parseObj(itemObj); + TrunklineDetailProductEntity detailProductEntity = JSONUtil.toBean(item, TrunklineDetailProductEntity.class); + if (ObjectUtil.isNotNull(detailProductEntity)) { + productCodes.add(detailProductEntity.getProductCode()); + detailProductEntityList.add(detailProductEntity); + } + } + } + } + + } + if(CollUtil.isNotEmpty(parcelListEntityList)){ + parcelListClient.saveorUpdateBatchByOP(parcelListEntityList); + } + if(CollUtil.isNotEmpty(advanceDetailEntityList)){ + advanceDetailService.saveOrUpdateBatch(advanceDetailEntityList); + } + //发送入库包件处理无数据装车数据 + trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity)); + if(CollUtil.isNotEmpty(detailProductEntityList)){ + if(ObjectUtil.isAllNotEmpty(packageCodeMap,productCodes)){ + List list = detailProductService.list(Wrappers.lambdaQuery() + .in(TrunklineDetailProductEntity::getUnitNo, packageCodeMap.keySet()) + .in(TrunklineDetailProductEntity::getProductCode, productCodes) + ); + if(CollUtil.isNotEmpty(list)){ + for (TrunklineDetailProductEntity productEntity : detailProductEntityList) { + for (TrunklineDetailProductEntity detailProductEntity : list) { + if(ObjectUtil.equal(productEntity.getProductCode(),detailProductEntity.getProductCode())){ + productEntity.setId(detailProductEntity.getId()); + } + } + } + } + } + detailProductService.saveOrUpdateBatch(detailProductEntityList); + } + } + } + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java index 9490d3dc3..3050def3b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java @@ -69,7 +69,7 @@ public interface ITrunklineAdvanceDetailService extends BaseService类型的列表,包含与输入的订单包裹代码相匹配的所有包裹编码。 * 如果没有找到匹配的包裹编码,则返回空列表。 */ - List findPackageCodeByCodes(Set orderPackageCodes); + Map findPackageCodeByCodes(Set orderPackageCodes); R findOrderDetails(OrderDetailsDTO orderDetailsDTO); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index 1b425ee64..5d2ebce3e 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -1,6 +1,7 @@ package com.logpm.trunkline.service.impl; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; @@ -16,7 +17,11 @@ import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper; import com.logpm.trunkline.mapper.TrunklineAdvanceMapper; import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; -import com.logpm.trunkline.vo.*; +import com.logpm.trunkline.vo.AdvanceDetailGoodsVO; +import com.logpm.trunkline.vo.AdvanceDetailStockNumVO; +import com.logpm.trunkline.vo.BillladingPackageVO; +import com.logpm.trunkline.vo.OrderDetailInfoVO; +import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; @@ -31,7 +36,12 @@ import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; @Slf4j @Service @@ -266,8 +276,12 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl findPackageCodeByCodes(Set orderPackageCodes) { - return baseMapper.findPackageCodeByCodes(orderPackageCodes); + public Map findPackageCodeByCodes(Set orderPackageCodes) { + List> packageCodeByCodes = baseMapper.findPackageCodeByCodes(orderPackageCodes); + if(CollUtil.isNotEmpty(packageCodeByCodes)){ + return packageCodeByCodes.stream().collect(Collectors.toMap(map -> map.get("code"), map -> map.get("id"))); + } + return null; } @Override From e61e257bd018c009a183e62201a139dcd0dc84fe Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 23 May 2024 16:28:42 +0800 Subject: [PATCH 17/34] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=AD=98?= =?UTF-8?q?=E6=94=BE=E8=87=B3=E6=89=98=E7=9B=98BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WarehouseWarehousingEntryServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java index 831ba3885..036a88712 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java @@ -205,6 +205,14 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl i.getCreateInventory()) { detailEntity.setConditions("3"); num.updateAndGet(v -> v + 1); @@ -216,6 +224,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl Date: Thu, 23 May 2024 17:39:28 +0800 Subject: [PATCH 18/34] =?UTF-8?q?=E6=9C=AA=E7=9B=98=E7=82=B9=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E3=80=81=E7=9B=98=E7=82=B9=E6=98=8E=E7=BB=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TaskQuestController.java | 2 +- .../warehouse/mapper/TaskQuestMapper.java | 2 +- .../logpm/warehouse/mapper/TaskQuestMapper.xml | 18 ++++++++++++------ .../service/impl/TaskQuestServiceImpl.java | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java index 99d75f204..fbd284ab7 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java @@ -172,7 +172,7 @@ public class TaskQuestController extends BladeController { @GetMapping("/exportContrastStockInfo") @ApiOperationSupport(order = 1) @ApiOperation(value = "盘点任务 未盘点数据导出", notes = "传入id") - public void exportContrastStockInfo( HttpServletResponse response,QuestDetailDTO questDetailDTO,Query query){ + public void exportContrastStockInfo( HttpServletResponse response,QuestDetailDTO questDetailDTO){ // IPage page = taskQuestService.selectTaskDataInfo(questDetailDTO,Condition.getPage(query)); List data =taskQuestService.exportContrastStockInfo(questDetailDTO); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java index c2f5bde8b..b860c9ac5 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java @@ -189,7 +189,7 @@ public interface TaskQuestMapper extends BaseMapper { List findStockList(@Param("param") TaskSearchDTO taskSearchDTO); - List selectContrastStockInfo(@Param("questNum") String questNum); + List selectContrastStockInfo(@Param("questNum") String questNum,@Param("questStatus")Integer questStatus); QuestDetailEntity findEntityById(@Param("questNum") String questNum,@Param("taskID") Long taskId); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml index 4fd2f582e..3ab2f39d1 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml @@ -657,22 +657,28 @@ From e6a087b2b96f24b6ea223b93a04bbaae01ecff1e Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Thu, 23 May 2024 23:22:59 +0800 Subject: [PATCH 20/34] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E6=A2=A6?= =?UTF-8?q?=E5=A4=A9=E6=9C=AB=E7=AB=AF=E4=BB=93=E5=8D=B8=E8=BD=A6=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E8=8A=82=E7=82=B9=E5=9B=9E=E6=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/RabbitConstant.java | 3 + .../service/impl/AsyncDataServiceImpl.java | 149 ++++++++++++++- .../factory/config/RabbitMqConfiguration.java | 16 ++ .../factory/jobhandler/FactoryXxlJob.java | 4 +- .../controller/MtFactoryDataController.java | 42 +++- .../service/impl/OuPaiFactoryServiceImpl.java | 2 +- .../controller/PanFactoryDataController.java | 4 +- .../receiver/HwyUnloadCarComHandler.java | 179 ++++++++++++++++++ .../impl/TrunklineCarsLoadServiceImpl.java | 169 +++++++++-------- 9 files changed, 478 insertions(+), 90 deletions(-) create mode 100644 blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java index ab7ff219e..822cc8771 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java @@ -42,6 +42,9 @@ public interface RabbitConstant { String UNLOAD_CAR_COM_INFO_QUEUE = "unload_car_com_info_quere"; String UNLOAD_CAR_COM_INFO_EXCHANGE = "unload_car_com_info_exchange" + ModuleNameConstant.DEVAUTH; String UNLOAD_CAR_COM_INFO_ROUTING = "unload_car_com_info_routing "; + String HWY_UNLOAD_CAR_COM_INFO_QUEUE = "hwy_unload_car_com_info_quere"; + String HWY_UNLOAD_CAR_COM_INFO_EXCHANGE = "hwy_unload_car_com_info_exchange" + ModuleNameConstant.DEVAUTH; + String HWY_UNLOAD_CAR_COM_INFO_ROUTING = "hwy_unload_car_com_info_routing "; String WAYBILL_DATA_QUEUE = "waybill_data_queue" + ModuleNameConstant.DEVAUTH; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index 75ec8e9f7..58da45406 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -770,9 +770,9 @@ public class AsyncDataServiceImpl implements IAsyncDataService { List factoryOrderEntities = factoryOrderService.lambdaQuery().eq(FactoryOrderEntity::getReceivingId, receivingOrderEntity.getId()).eq(FactoryOrderEntity::getTurnStatus, 0).list(); log.info(">>>>>>>>>>>>>>>>>>>>>handlerOuPaiDataToHt 派车单 {} 派车单下面订单集合长度 {}", receivingOrderEntity.getCode(), factoryOrderEntities.size()); - addAdvanceEntityBtOuPai(receivingOrderEntity, factoryOrderEntities); - // TODO 走新系统暂存单,暂时不写后面再写 -// addAdvanceEntityBtOuPaiNew(receivingOrderEntity, factoryOrderEntities); +// addAdvanceEntityBtOuPai(receivingOrderEntity, factoryOrderEntities); + // 走新系统暂存单 + addAdvanceEntityBtOuPaiNew(receivingOrderEntity, factoryOrderEntities); receivingOrderEntity.setTurnStatus(1); log.info(">>>>>>>>>>>>>>>>>>>>>handlerOuPaiDataToHt 更新收货单状态 收货单号 {}", receivingOrderEntity.getCode()); receivingOrderService.updateById(receivingOrderEntity); @@ -781,6 +781,149 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } + private void addAdvanceEntityBtOuPaiNew(ReceivingOrderEntity receivingOrderEntity, List factoryOrderEntities) { + log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>> addAdvanceEntityBtOuPai 派车单数据推送到新系统,更新物料信息 单号{}", receivingOrderEntity.getCode()); + String carNumber = receivingOrderEntity.getCarNumber(); + // 欧派只更新物料信息 不管暂存单信息 + String fromWarehouseName = receivingOrderEntity.getFromWarehouseName(); + // 只处理 已配置的基地的数据 其他基地无法确认,暂时不处理 + Long startWarehouseId = null; + String startWarehouseName = null; + String tenantId = null; + // 获取工厂基地绑定的始发仓信息 + R warehouseByBrandAndSiteName = factoryDataBaseClient.getWarehouseByBrandAndSiteName(BrandEnums.OP.getValue(), fromWarehouseName); + if (cn.hutool.core.util.ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, warehouseByBrandAndSiteName.getCode())) { + FactoryWarehouseBindVO data = warehouseByBrandAndSiteName.getData(); + if (cn.hutool.core.util.ObjectUtil.isNotNull(data)) { + startWarehouseId = data.getWarehouseId(); + startWarehouseName = data.getWarehouseName(); + tenantId = data.getTenantId(); + } + } + if (cn.hutool.core.util.ObjectUtil.isAllNotEmpty(startWarehouseId, startWarehouseName, tenantId)) { + // 订单 + List advances = new ArrayList<>(); + for (FactoryOrderEntity factoryOrderEntity : factoryOrderEntities) { + factoryOrderEntity.setTurnStatus(1); + + TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity(); + advanceEntity.setTenantId(tenantId); + advanceEntity.setStatus(0); + advanceEntity.setIsDeleted(0); + advanceEntity.setOrderType(factoryOrderEntity.getOrderType()); + advanceEntity.setBrand(BrandEnums.OP.getValue()); + advanceEntity.setSiteName(fromWarehouseName); + advanceEntity.setArea(""); + advanceEntity.setPackName(""); + advanceEntity.setPackCode(""); + advanceEntity.setWarehouseId(startWarehouseId); + advanceEntity.setWarehouseName(startWarehouseName); + advanceEntity.setIsGcp(0); + advanceEntity.setCarrierName("汇通物流"); + advanceEntity.setSystemType("线上"); + advanceEntity.setMatingType("1"); + advanceEntity.setWaybillStatus("0"); + advanceEntity.setWaybillNo(""); + advanceEntity.setTrainNumber(receivingOrderEntity.getCarNumber()); + advanceEntity.setFreezeStatus("0"); + + advanceEntity.setSenderFactory(""); + advanceEntity.setOrderCode(factoryOrderEntity.getSelfCode()); + advanceEntity.setDealerCode(factoryOrderEntity.getShopCode()); + advanceEntity.setDealerName(factoryOrderEntity.getShopName()); + advanceEntity.setStoreCode(factoryOrderEntity.getShopCode()); + advanceEntity.setStoreName(factoryOrderEntity.getShopName()); + advanceEntity.setServiceNum(factoryOrderEntity.getServiceNumber()); + advanceEntity.setCustomerName(factoryOrderEntity.getCustomer()); + advanceEntity.setCustomerPhone(factoryOrderEntity.getCustomerPhone()); + advanceEntity.setCustomerAddress(factoryOrderEntity.getCustomerAddress()); + advanceEntity.setConsigneePerson(factoryOrderEntity.getShopReceiver()); + // 处理订单下面的包件数据 + List list = factoryPackageService.lambdaQuery() + .eq(FactoryPackageEntity::getOrderId, factoryOrderEntity.getId()).eq(FactoryPackageEntity::getTurnStatus, 0).list(); + advanceEntity.setHasPackage(CollUtil.isNotEmpty(list) ? 1 : 0); + advanceEntity.setTotalNum(CollUtil.isNotEmpty(list) ? list.size() : 0); + List packageList = new ArrayList<>(); + for (FactoryPackageEntity factoryPackageEntity : list) { + TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity(); + advanceDetailEntity.setWarehouseId(startWarehouseId); + advanceDetailEntity.setWarehouseName(startWarehouseName); + advanceDetailEntity.setOrderCode(factoryOrderEntity.getSelfCode()); + advanceDetailEntity.setBrand(BrandEnums.OP.getValue()); + advanceDetailEntity.setSystemType("线上"); + advanceDetailEntity.setFirstPackName(factoryPackageEntity.getFirstClassName()); + advanceDetailEntity.setFirstPackCode(factoryPackageEntity.getFirstClassCode()); + advanceDetailEntity.setSecondPackName(factoryPackageEntity.getSecondClassName());//二级品类名称 + advanceDetailEntity.setSecondPackCode(factoryPackageEntity.getSecondClassCode());//二级品类 + advanceDetailEntity.setThirdPackName(factoryPackageEntity.getThirdClassName());//三级品类名称 + advanceDetailEntity.setThirdPackCode(factoryPackageEntity.getThirdClassCode());//三级品类 + advanceDetailEntity.setMaterialName(factoryPackageEntity.getPackageDetailNames()); + advanceDetailEntity.setSiteName(fromWarehouseName); + advanceDetailEntity.setSiteCode(""); + advanceDetailEntity.setQuantity(1); + advanceDetailEntity.setOrderPackageCode(factoryPackageEntity.getCode()); + advanceDetailEntity.setTrainNumber(receivingOrderEntity.getCarNumber()); + advanceDetailEntity.setServiceNum(factoryOrderEntity.getServiceNumber()); + advanceDetailEntity.setWaybillNo(""); + advanceDetailEntity.setPackageStatus("0"); + advanceDetailEntity.setWeight(factoryPackageEntity.getWeight()); + if (cn.hutool.core.util.ObjectUtil.isAllNotEmpty(factoryPackageEntity.getHeight(), factoryPackageEntity.getWidth(), factoryPackageEntity.getLength())) { + advanceDetailEntity.setVolume(factoryPackageEntity.getHeight().multiply(factoryPackageEntity.getWidth()).multiply(factoryPackageEntity.getLength())); + } + advanceDetailEntity.setSupple(""); + advanceDetailEntity.setManifest(""); + advanceDetailEntity.setReturnNum(""); + advanceDetailEntity.setSendDateStr(DateUtil.formatLocalDateTime(LocalDateTime.now())); + advanceDetailEntity.setCarNumber(""); + advanceDetailEntity.setGoodsMan(""); + advanceDetailEntity.setTenantId(tenantId); + advanceDetailEntity.setStatus(0); + advanceDetailEntity.setIsDeleted(0); + // 物料 + List factoryPackageDetailEntities = factoryPackageDetailService.lambdaQuery() + .eq(FactoryPackageDetailEntity::getPackageId, factoryPackageEntity.getId()).list(); + List itemJsons = new ArrayList<>(); + if (CollUtil.isNotEmpty(factoryPackageDetailEntities)) { + for (FactoryPackageDetailEntity factoryPackageDetailEntity : factoryPackageDetailEntities) { + if(cn.hutool.core.util.ObjectUtil.equal(factoryPackageEntity.getPackageDetailNames(),factoryPackageDetailEntity.getName())){ + advanceDetailEntity.setMaterialCode(factoryPackageDetailEntity.getCode()); + } + TrunklineDetailProductEntity detailProductEntity = new TrunklineDetailProductEntity(); + detailProductEntity.setTenantId(tenantId); + detailProductEntity.setWarehouseId(startWarehouseId); + detailProductEntity.setWarehouseName(startWarehouseName); + detailProductEntity.setUnitNo(factoryPackageEntity.getCode()); + detailProductEntity.setProductCode(factoryPackageDetailEntity.getCode()); + detailProductEntity.setProductName(factoryPackageDetailEntity.getName()); + detailProductEntity.setReserve1(factoryPackageDetailEntity.getType()); + detailProductEntity.setReserve2(factoryPackageDetailEntity.getUnit()); + detailProductEntity.setQuantity(1); + detailProductEntity.setStatus(0); + detailProductEntity.setIsDeleted(0); + itemJsons.add(JSONUtil.parseObj(detailProductEntity)); + } + } + JSONObject entries = JSONUtil.parseObj(advanceDetailEntity); + entries.set("items", itemJsons); + packageList.add(entries); + } + JSONObject entries = JSONUtil.parseObj(advanceEntity); + entries.set("details", JSONUtil.toJsonStr(packageList)); + advances.add(entries); + } + factoryOrderService.updateBatchById(factoryOrderEntities); + // 发送消息 + if (CollUtil.isNotEmpty(advances)) { + for (JSONObject advance : advances) { + SendMsg sendMsg = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER_OUPAI) + .routingKey(FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER).message(JSONUtil.toJsonStr(advance)).build(); + factoryDataClient.sendMessage(sendMsg); + } + } + } + + } + /** * 欧派数据保存到老系统 * diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java index 8171a6d3c..d979f2111 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java @@ -222,6 +222,22 @@ public class RabbitMqConfiguration { public Binding unloadCarNumBinding(Queue unloadCarNumQueue, CustomExchange unloadCarNumExchange) { return BindingBuilder.bind(unloadCarNumQueue).to(unloadCarNumExchange).with(RabbitConstant.UNLOAD_CAR_COM_INFO_ROUTING).noargs(); } + @Bean + public Queue hwyUnloadCarNumQueue() { + return new Queue(RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_QUEUE, true); + } + + @Bean + public CustomExchange hwyUnloadCarNumExchange() { + Map args = Maps.newHashMap(); + args.put("x-delayed-type", "direct"); + return new CustomExchange(RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_EXCHANGE, "x-delayed-message", true, false, args); + } + + @Bean + public Binding hwyUnloadCarNumBinding(Queue hwyUnloadCarNumQueue, CustomExchange hwyUnloadCarNumExchange) { + return BindingBuilder.bind(hwyUnloadCarNumQueue).to(hwyUnloadCarNumExchange).with(RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_ROUTING).noargs(); + } @Bean diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java index a3b5ed937..c4bc88834 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java @@ -194,9 +194,9 @@ public class FactoryXxlJob { }); // 调用接口写入到老系统的数据库 - resoveFactoryData(); +// resoveFactoryData(); // 走新系统暂存单 -// resoveFactoryDataNew(); + resoveFactoryDataNew(); return ReturnT.SUCCESS; } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java index 24963ea7c..e65bebdb1 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java @@ -16,6 +16,8 @@ */ package com.logpm.factory.mt.controller; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.EnumUtil; import com.alibaba.fastjson.JSONObject; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.factory.comfac.service.IAsyncDataService; @@ -23,13 +25,19 @@ import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.logpm.factory.mt.dto.MtFactoryDataDTO; import com.logpm.factory.mt.service.IMtFactoryDataService; import com.logpm.factory.snm.entity.OrderStatusLog; +import com.logpm.factorydata.enums.BrandEnums; +import com.logpm.factorydata.vo.NodePushMsg; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.constant.WorkNodeEnums; import org.springblade.common.exception.CustomerException; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -38,6 +46,9 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -58,6 +69,33 @@ public class MtFactoryDataController extends BladeController { private final IMtFactoryDataService mtFactoryDataService; private final IAsyncDataService asyncDataService; + private final RabbitTemplate rabbitTemplate; + + @ResponseBody + @PostMapping("/sendMsg") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "发送消息", notes = "传入factoryOrderDTO") + public R sendMsg(@Validated @RequestBody cn.hutool.json.JSONObject mtFactoryDataDTO, HttpServletRequest request) { + log.info("############data:{} ", mtFactoryDataDTO); + String corpId = request.getHeader("corpId"); + NodePushMsg msg = new NodePushMsg(); + msg.setNode(EnumUtil.fromString(WorkNodeEnums.class, mtFactoryDataDTO.getStr("node"))); + msg.setBrand(BrandEnums.MTMM); + msg.setOperator(AuthUtil.getUser().getNickName()); + msg.setOperatorTime(new Date()); + List contents = new ArrayList<>(); + ArrayList codes = CollUtil.newArrayList(mtFactoryDataDTO.getStr("packageCode").split(",")); + if (CollUtil.isNotEmpty(codes)) { + for (String code : codes) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("packageCode", code); + contents.add(jsonObject); + } + } + msg.setContent(contents); + rabbitTemplate.convertAndSend(RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_EXCHANGE, RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_ROUTING, msg); + return R.success("1"); + } /** * 工厂数据推送接口 @@ -91,9 +129,9 @@ public class MtFactoryDataController extends BladeController { orderStatusLog.setStatus(0); //开启异步线程处理数据 if (!Objects.isNull(mainId)) { - asyncDataService.handlerMtDataToHt(map.get("mainId")); +// asyncDataService.handlerMtDataToHt(map.get("mainId")); // 走新系统暂存单 -// asyncDataService.handlerMtDataToHtNew(map.get("mainId")); + asyncDataService.handlerMtDataToHtNew(map.get("mainId")); } } else { orderStatusLog.setStatus(2); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index 674a74f4a..6da9a880d 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -111,7 +111,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { handleData(code); if (ObjectUtils.isNotNull(code)) { // 暂停推送 -// asyncDataService.handlerOuPaiDataToHt(code); + asyncDataService.handlerOuPaiDataToHt(code); } return code; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java index 0839dad5c..510f5f9df 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -124,9 +124,9 @@ public class PanFactoryDataController extends BladeController { //开启异步线程处理数据 if(!Objects.isNull(orderId)){ - syncDataService.handlerPanDataToHt(orderId); +// syncDataService.handlerPanDataToHt(orderId); // 走新系统暂存单 -// syncDataService.handlerPanDataToHtNew(orderId); + syncDataService.handlerPanDataToHtNew(orderId); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java new file mode 100644 index 000000000..8e40199b2 --- /dev/null +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java @@ -0,0 +1,179 @@ +package com.logpm.factory.receiver; + + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.EnumUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.logpm.factory.comfac.dto.UnloadCarDTO; +import com.logpm.factory.mt.entity.MtPushData; +import com.logpm.factory.mt.service.IMtFactoryDataService; +import com.logpm.factory.mt.service.IMtFactoryOrderMainService; +import com.logpm.factory.mt.service.IMtPushDataService; +import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; +import com.logpm.factorydata.enums.BrandEnums; +import com.logpm.factorydata.vo.NodePushMsg; +import com.logpm.factorydata.vo.SendMsg; +import com.logpm.oldproject.feign.IAdvanceDetailClient; +import com.rabbitmq.client.Channel; +import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.Nullable; +import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.constant.WorkNodeEnums; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.amqp.core.Message; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.security.NoSuchAlgorithmException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 卸车完成处理队列 + */ +@Slf4j +@RabbitListener(queues = RabbitConstant.HWY_UNLOAD_CAR_COM_INFO_QUEUE) +@Component +public class HwyUnloadCarComHandler { + + @Autowired + private IAdvanceDetailClient advanceDetailClient; + + + @Autowired + private IMtFactoryOrderMainService mtFactoryOrderMainService; + + @Autowired + private IMtFactoryDataService mtFactoryDataService; + + @Autowired + private IMtPushDataService mtPushDataService; + + + @RabbitHandler + public void unloadCarComDataHandler(NodePushMsg nodePushMsg, Message message, Channel channel) { +// NodePushMsg nodePushMsg = JSONUtil.toBean(msg, NodePushMsg.class); + BrandEnums brand = nodePushMsg.getBrand(); + switch (brand) { + case MTMM: + pushMentTian(nodePushMsg); + break; + } + } + + private void pushMentTian(NodePushMsg nodePushMsg) { + + // 根据包件获取车次 + List content = nodePushMsg.getContent(); + List carNumList = new ArrayList<>(); + if(CollUtil.isNotEmpty(content)){ + for (Object s : content) { + JSONObject jsonObject = JSONUtil.parseObj(s); + String packageCode = (String) jsonObject.get("packageCode"); + carNumList.add(packageCode); + } + } + + try { + + List allMtData = mtFactoryOrderMainService.mtOrderPackageRelation(); + // 对这个集合内进行分组 + Map> stringListMap = allMtData.stream().collect(Collectors.groupingBy(MTOrderPackageRelationVO::getInvoiceOrderCode)); + Set set = stringListMap.keySet(); + String carNum = null; + + Set r = new HashSet<>(); + for (String s : set) { + // 得到某个工厂运输批次的集合 + List t = stringListMap.get(s); + //得到这个批次下面所有的包件 + List strs = t.stream().map(MTOrderPackageRelationVO::getPackageCode).collect(Collectors.toList()); + // 当前批次的包件 在 这个配载计划中存在一个 则进行通知 + for (String mtStr : carNumList) { + if (strs.contains(mtStr)) { + carNum = s; + break; + } + } + if (StringUtil.isNoneBlank(carNum)) { + r.add(carNum); + } + } + + r.forEach(t->{ + sendDataCarNum(t, DateUtil.formatDateTime(nodePushMsg.getOperatorTime())); + }); + + + } catch (Exception e) { + log.error("##################unloadCarComDataHandler 解析数据出错:{}", e.getMessage()); + } + } + + /** + * 根基匹配到的发货单编号 推送梦天 + * + * @param carNum 车次号 + * @param completeDate 完成时间 + * @throws ParseException + * @throws NoSuchAlgorithmException + * @throws JsonProcessingException + */ + private void sendDataCarNum(String carNum, String completeDate) { + log.info("##################sendDataCarNum carNum:{},completeDate{}", carNum, completeDate); + + // 需要判断这个发货单编号是否推送过 + QueryWrapper lambdaQueryChainWrapper = new QueryWrapper(); + lambdaQueryChainWrapper.eq("ref_code", carNum); + MtPushData ms = mtPushDataService.getOne(lambdaQueryChainWrapper); + if (ObjectUtils.isNotNull(ms)) { + log.info("##################{} 车次已经推送过", carNum); + return; + } + try{ + + R r = mtFactoryDataService.sendUnloadCarNum(carNum, completeDate); + + log.info("MT 数据卸车推送 {}",r.getMsg()); + }catch (Exception e){ + + + log.error(">>>> 梦天数据卸车推送异常",e); + } + log.info("##################{} 梦天确认签收数据推送1", carNum); + + } + + @Nullable + private List getBizData(JSONObject entries) { + List content = entries.getBeanList("content", JSONObject.class); + List packageCodeList = null; + if (CollUtil.isNotEmpty(content)) { + // 查询这次操作的所有包件和运单号 + packageCodeList = new ArrayList<>(); + for (JSONObject obj : content) { + String packageCode = obj.getStr("packageCode"); + if (StrUtil.isNotBlank(packageCode)) { + packageCodeList.add(packageCode); + } + } + } + return packageCodeList; + } + + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index da85017c3..c338e5da9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -27,8 +27,10 @@ import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionParcelNumberClient; import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.factorydata.enums.BrandEnums; +import com.logpm.factorydata.feign.IFactoryDataClient; import com.logpm.factorydata.util.FactoryDataMessageSender; import com.logpm.factorydata.vo.NodePushMsg; +import com.logpm.factorydata.vo.SendMsg; import com.logpm.trunkline.bean.Resp; import com.logpm.trunkline.dto.*; import com.logpm.trunkline.entity.*; @@ -104,6 +106,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl waybillNos = lineCarsOrderList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList()); List freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos); - if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){ + if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) { log.warn("##########saveNew: 运单有变动,请重新做计划"); throw new CustomerException(400, "运单有变动,请重新做计划"); } @@ -1436,7 +1446,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl waybillNos = addList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList()); List freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos); - if(!CollUtil.isEmpty(freezeOrAbolishWaybillList)){ + if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) { log.warn("##########saveNew: 运单有变动,请重新做计划"); throw new CustomerException(400, "运单有变动,请重新做计划"); } @@ -2009,7 +2019,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId); @@ -2308,7 +2318,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(); orderPackageCodes.add(orderPackageCode); - String content = "包件在 " + warehouseName + " "+(StringUtil.isBlank(trayName)?"扫码": "托盘("+trayName+")")+" 装车,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName; + String content = "包件在 " + warehouseName + " " + (StringUtil.isBlank(trayName) ? "扫码" : "托盘(" + trayName + ")") + " 装车,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName; packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode(), content); trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1, @@ -3077,8 +3087,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadScanEntityList = trunklineCarsLoadScanService.findListByIdsNoPackage(carsLoadScanIds,warehouseId); + List loadScanEntityList = trunklineCarsLoadScanService.findListByIdsNoPackage(carsLoadScanIds, warehouseId); List parcelListEntities = trunklineCarsLoadScanService.findParceListByCarsLoadScanIds(carsLoadScanIds); //把parcelListEntities转成orderPackageCode为键值的map - Map parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, e -> e)); + Map parcelListMap = parcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, e -> e)); List stockArticleEntities = trunklineCarsLoadScanService.findOrderListByCarsLoadScanIds(carsLoadScanIds); //把stockArticleEntities转成orderCode为键值的map - Map stockArticleMap = stockArticleEntities.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, e -> e)); + Map stockArticleMap = stockArticleEntities.stream().collect(Collectors.toMap(DistributionStockArticleEntity::getOrderCode, e -> e)); // List waybillEntities = trunklineCarsLoadScanService.findWaybillListByCarsLoadScanIds(carsLoadScanIds); // //把waybillEntities转成WaybillNo为键值的map // Map waybillMap = waybillEntities.stream().collect(Collectors.toMap(WarehouseWaybillEntity::getWaybillNo, e -> e)); List unloadLogList = new ArrayList<>(); - List orderCodeList = trunklineCarsLoadScanService.findIncomingOrdeCodesByCarsLoadScanIds(carsLoadScanIds,warehouseId); - Map orderCodes = new HashMap<>(); - if(!Objects.isNull(orderCodeList)){ + List orderCodeList = trunklineCarsLoadScanService.findIncomingOrdeCodesByCarsLoadScanIds(carsLoadScanIds, warehouseId); + Map orderCodes = new HashMap<>(); + if (!Objects.isNull(orderCodeList)) { Map finalOrderCodes2 = orderCodes; orderCodeList.forEach(e -> { String[] split = e.split("----"); - finalOrderCodes2.put(split[0],Long.valueOf(split[1])); + finalOrderCodes2.put(split[0], Long.valueOf(split[1])); }); orderCodes = finalOrderCodes2; } @@ -3540,7 +3550,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl> unbingTrayAndDelAllocationPackages = new HashMap<>(); + Map> unbingTrayAndDelAllocationPackages = new HashMap<>(); //直接新增的包件 List newParcelListEntities = new ArrayList<>(); //需要修改仓库信息的打托数据 @@ -3595,17 +3605,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { //判断是否有已经有order了 Long orderId = null; - if(!finalOrderCodes.isEmpty()){ + if (!finalOrderCodes.isEmpty()) { orderId = finalOrderCodes.get(e); } List carsLoadScanEntities = loadScanEntityListHasDataNoTrayMap.get(e); - if(ObjectUtil.isNull(orderId)){ + if (ObjectUtil.isNull(orderId)) { //没有id DistributionStockArticleEntity stockArticleEntity = stockArticleMap.get(e); DistributionStockArticleEntity newStockArticleEntity = new DistributionStockArticleEntity(); - BeanUtil.copy(stockArticleEntity,newStockArticleEntity); + BeanUtil.copy(stockArticleEntity, newStockArticleEntity); newStockArticleEntity.setId(null); newStockArticleEntity.setCreateUser(userId); newStockArticleEntity.setUpdateUser(userId); @@ -3621,18 +3631,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { Long fromWarehouseId = p.getFromWarehouseId(); DistributionParcelListEntity parcelListEntity = parcelListMap.get(p.getScanCode()); Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId(); DistributionParcelListEntity newNoOrderPackage = new DistributionParcelListEntity(); - BeanUtil.copy(parcelListEntity,newNoOrderPackage); + BeanUtil.copy(parcelListEntity, newNoOrderPackage); newNoOrderPackage.setId(null); newNoOrderPackage.setCreateUser(userId); newNoOrderPackage.setUpdateUser(userId); @@ -3645,22 +3654,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl list = unbingTrayAndDelAllocationPackages.get(fromWarehouseId); - if(Objects.isNull(list)){ + if (Objects.isNull(list)) { list = new ArrayList<>(); list.add(p.getScanCode()); - }else{ + } else { list.add(p.getScanCode()); } - unbingTrayAndDelAllocationPackages.put(fromWarehouseId,list); + unbingTrayAndDelAllocationPackages.put(fromWarehouseId, list); Integer isAbnormal = 0; String remark = "正常卸车"; @@ -3668,7 +3677,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl map = new HashMap<>(); map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO)); rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map); - }catch (Exception e){ - log.error("推送卸车失败{}",e); + } catch (Exception e) { + log.error("推送卸车失败{}", e); } } } @@ -3848,16 +3857,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { List list = unbingTrayAndDelAllocationPackages.get(w); - updownTypeClient.downPackageOrDelTray(StringUtil.join(list),w,"批量入库解托下架"); + updownTypeClient.downPackageOrDelTray(StringUtil.join(list), w, "批量入库解托下架"); }); //需要修改仓库信息的打托数据 trayCodes.forEach(trayCode -> { - trayTypeClient.changeTrayWarehouseInfo(trayCode,warehouseId); + trayTypeClient.changeTrayWarehouseInfo(trayCode, warehouseId); }); newParcelListEntities.forEach(e -> { - carsLoadAsyncService.dealwithAfterAbnormalPackage(e.getOrderPackageCode(),warehouseId,warehouseName,carsLoadEntity.getCarsNo(),userId, deptId, nickName); + carsLoadAsyncService.dealwithAfterAbnormalPackage(e.getOrderPackageCode(), warehouseId, warehouseName, carsLoadEntity.getCarsNo(), userId, deptId, nickName); }); String content = "包件在 " + warehouseName + "卸车,卸车方式:" + IncomingTypeEnum.getValue(incomingType); @@ -4316,7 +4325,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl !"1".equals(e.getScanStatus())).collect(Collectors.toList()); @@ -4327,18 +4336,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl> map = list.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getSignOrderId)); map.keySet().forEach(e -> { List trunklineCarsLoadScanVOS = map.get(e);//该签收单对应的包件 - trunklineCarsLoadScanVOS.forEach(t ->{ + trunklineCarsLoadScanVOS.forEach(t -> { TrunklineCarsLoadScanEntity entity = new TrunklineCarsLoadScanEntity(); - BeanUtil.copy(t,entity); + BeanUtil.copy(t, entity); entity.setScanStatus("3"); entity.setUnloadNum(t.getNum()); entity.setSignTime(date); entity.setUnloadTime(date); - if(entity.getType().equals(1)){ + if (entity.getType().equals(1)) { String scanCode = entity.getScanCode(); List parcelList = parcelListMap.get(scanCode); - if(!Objects.isNull(parcelList)){ - parcelList.forEach(p ->{ + if (!Objects.isNull(parcelList)) { + parcelList.forEach(p -> { p.setOrderPackageStatus("70"); updateParcelList.add(p); }); @@ -4474,12 +4483,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20",waybillNo); + List entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20", waybillNo); int size = entityListByOrderCode.size(); - if(planNum.equals(size + realNum)){ + if (planNum.equals(size + realNum)) { for (DistributionParcelListEntity parcelListEntity : entityListByOrderCode) { String orderPackageCode = parcelListEntity.getOrderPackageCode(); TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity(); @@ -4531,7 +4540,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds); //通过loadId查询是否所有包件都签收了 Integer num = trunklineCarsLoadScanService.findSignNumByLoadId(loadId); - if(realLoadingNumber.equals(num)){ + if (realLoadingNumber.equals(num)) { carsLoadEntity.setSignTime(date); carsLoadEntity.setLoadStatus("90"); - }else{ - if(num == 1){ + } else { + if (num == 1) { carsLoadEntity.setSignTime(date); carsLoadEntity.setLoadStatus("91"); } @@ -4691,9 +4700,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl map = new HashMap<>(); - map.put("one",carsLoadLineEntity.getReportOne()); - map.put("two",carsLoadLineEntity.getReportTwo()); + Map map = new HashMap<>(); + map.put("one", carsLoadLineEntity.getReportOne()); + map.put("two", carsLoadLineEntity.getReportTwo()); - JSONObject abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo,warehouseId); + JSONObject abnormalRecord = abnormalRecordClient.findListByCarsNoAndUpWarehouseId(carsNo, warehouseId); - map.put("three","当前待处理异常 "+abnormalRecord.getInteger("dealwithNum")+" 条、已处理异常 "+abnormalRecord.getInteger("noDealwithNum")+" 条"); + map.put("three", "当前待处理异常 " + abnormalRecord.getInteger("dealwithNum") + " 条、已处理异常 " + abnormalRecord.getInteger("noDealwithNum") + " 条"); return R.data(map); } @@ -5343,10 +5352,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(); @@ -5851,7 +5860,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Thu, 23 May 2024 23:35:39 +0800 Subject: [PATCH 21/34] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E6=A2=A6?= =?UTF-8?q?=E5=A4=A9=E6=8C=87=E5=AE=9A=E8=8A=82=E7=82=B9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receiver/HwyUnloadCarComHandler.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java index 8e40199b2..cdf04f883 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/HwyUnloadCarComHandler.java @@ -3,14 +3,13 @@ package com.logpm.factory.receiver; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.EnumUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.fasterxml.jackson.core.JsonProcessingException; -import com.logpm.factory.comfac.dto.UnloadCarDTO; import com.logpm.factory.mt.entity.MtPushData; import com.logpm.factory.mt.service.IMtFactoryDataService; import com.logpm.factory.mt.service.IMtFactoryOrderMainService; @@ -18,7 +17,6 @@ import com.logpm.factory.mt.service.IMtPushDataService; import com.logpm.factory.snm.vo.MTOrderPackageRelationVO; import com.logpm.factorydata.enums.BrandEnums; import com.logpm.factorydata.vo.NodePushMsg; -import com.logpm.factorydata.vo.SendMsg; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.rabbitmq.client.Channel; import lombok.extern.slf4j.Slf4j; @@ -76,11 +74,13 @@ public class HwyUnloadCarComHandler { } private void pushMentTian(NodePushMsg nodePushMsg) { - + if (!ObjectUtil.equals(WorkNodeEnums.END_WAREHOUSE_UNLOADING, nodePushMsg.getNode())) { + return; + } // 根据包件获取车次 List content = nodePushMsg.getContent(); List carNumList = new ArrayList<>(); - if(CollUtil.isNotEmpty(content)){ + if (CollUtil.isNotEmpty(content)) { for (Object s : content) { JSONObject jsonObject = JSONUtil.parseObj(s); String packageCode = (String) jsonObject.get("packageCode"); @@ -114,7 +114,7 @@ public class HwyUnloadCarComHandler { } } - r.forEach(t->{ + r.forEach(t -> { sendDataCarNum(t, DateUtil.formatDateTime(nodePushMsg.getOperatorTime())); }); @@ -127,13 +127,13 @@ public class HwyUnloadCarComHandler { /** * 根基匹配到的发货单编号 推送梦天 * - * @param carNum 车次号 + * @param carNum 车次号 * @param completeDate 完成时间 * @throws ParseException * @throws NoSuchAlgorithmException * @throws JsonProcessingException */ - private void sendDataCarNum(String carNum, String completeDate) { + private void sendDataCarNum(String carNum, String completeDate) { log.info("##################sendDataCarNum carNum:{},completeDate{}", carNum, completeDate); // 需要判断这个发货单编号是否推送过 @@ -144,15 +144,15 @@ public class HwyUnloadCarComHandler { log.info("##################{} 车次已经推送过", carNum); return; } - try{ + try { R r = mtFactoryDataService.sendUnloadCarNum(carNum, completeDate); - log.info("MT 数据卸车推送 {}",r.getMsg()); - }catch (Exception e){ + log.info("MT 数据卸车推送 {}", r.getMsg()); + } catch (Exception e) { - log.error(">>>> 梦天数据卸车推送异常",e); + log.error(">>>> 梦天数据卸车推送异常", e); } log.info("##################{} 梦天确认签收数据推送1", carNum); From 7ccc9ef75b132a1557545e374f4530fd59a5f37b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Fri, 24 May 2024 00:30:21 +0800 Subject: [PATCH 22/34] =?UTF-8?q?feat(all)=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9E=97=E6=B0=8F=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/factorydata/FactoryDataConstants.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java index 71a8416d1..bb8f7f507 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/factorydata/FactoryDataConstants.java @@ -76,6 +76,7 @@ public abstract class FactoryDataConstants { /** * 林氏工厂订单 */ + String LINSY_NODE_DATA_PUSH = "factory.data.queue.linsy.nodeDataPush" + DEVAUTH; String LINSY_FACTORY_ORDER = "factory.data.queue.linsy.factoryOrder" + DEVAUTH; /** * 金牌工厂订单 @@ -119,6 +120,7 @@ public abstract class FactoryDataConstants { /** * 林氏工厂订单 */ + String LINSY_NODE_DATA_PUSH = "linsy.nodeDataPush" + DEVAUTH; String LINSY_FACTORY_ORDER = "linsy.factoryOrder" + DEVAUTH; /** * 金牌工厂订单 From e99789cfd3a8221ad5cc809d7abc41c16d0cad11 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 24 May 2024 10:10:27 +0800 Subject: [PATCH 23/34] =?UTF-8?q?=E6=89=98=E7=9B=98=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=93=81BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicdata/mapper/BasicdataTrayMapper.xml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml index a1eedfaeb..a6100efd3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml @@ -172,23 +172,23 @@