From 57d44cb5fac5dbc3d9e87670dc860dfa1c36bb18 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sat, 18 Jan 2025 11:29:08 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../largeScreen/httpImpl/BillingDataServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java index 8ef679eb4..5dd46f80f 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -34,7 +34,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public BillingDataVO getBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("limit 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -43,7 +43,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getWarehouseBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("limit 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -58,7 +58,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getMonthBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("limit1")); if (largeScreenDataEntity == null) { return new ArrayList<>(); From f2e6e4c12c9e1109206f44b77d8b3766308d3f18 Mon Sep 17 00:00:00 2001 From: chenlong Date: Sat, 18 Jan 2025 13:51:53 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/logpm/report/job/LargeScreenQueryXxlJob.java | 2 +- .../largeScreen/httpImpl/BillingDataServiceImpl.java | 6 +++--- .../largeScreen/httpImpl/BinLocationServiceImpl.java | 2 +- .../largeScreen/httpImpl/BusinessRationServiceImpl.java | 2 +- .../largeScreen/httpImpl/CarsLoadDataServiceImpl.java | 2 +- .../largeScreen/httpImpl/DeliveryDataServiceImpl.java | 2 +- .../largeScreen/httpImpl/MapWarehouseServiceImpl.java | 2 +- .../service/largeScreen/httpImpl/NodeDataServiceImpl.java | 2 +- .../service/largeScreen/httpImpl/TrunkDataServiceImpl.java | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java index 4ecac78f4..c4c0e0bbc 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java @@ -38,7 +38,7 @@ public class LargeScreenQueryXxlJob { /** * 数据查询 */ - @XxlJob("largeScreenexExcute") +// @XxlJob("largeScreenexExcute") public ReturnT largeScreenexExcute(String param) { XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO(); xxlJobQueryVO.setMapWarehouse(mapWarehouseService.list()); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java index 8ef679eb4..f5c0eba60 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -34,7 +34,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public BillingDataVO getBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -43,7 +43,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getWarehouseBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -58,7 +58,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getMonthBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); if (largeScreenDataEntity == null) { return new ArrayList<>(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java index d17540caf..d8a89ab86 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java @@ -21,7 +21,7 @@ public class BinLocationServiceImpl implements IBinLocationService { public BinLocationDataVO getBinLocationData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new BinLocationDataVO(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java index 72a479800..b57a36c52 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java @@ -24,7 +24,7 @@ public class BusinessRationServiceImpl implements IBusinessRationService { @Override public BusinessRatioDataVO getBusinessRatioData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new BusinessRatioDataVO(); } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java index 9f12a2688..e04545adb 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java @@ -34,7 +34,7 @@ public class CarsLoadDataServiceImpl implements ICarsLoadDataService { @Override public List getCareerLineData(Integer isDelivery) { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new ArrayList<>(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java index f69f4b7e1..c9d34abcc 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java @@ -24,7 +24,7 @@ public class DeliveryDataServiceImpl implements IDeliveryDataService { @Override public DeliveryDataVO getDeliveryAllData(Integer isYear) { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new DeliveryDataVO(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java index f7ca72970..d43a1a882 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java @@ -31,7 +31,7 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService { @Override public List list() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new ArrayList<>(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java index 1c77d8e43..9c6b25961 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java @@ -21,7 +21,7 @@ public class NodeDataServiceImpl implements INodeDataService { @Override public NodeDataVO getNodeData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new NodeDataVO(); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java index 4bc3357b3..706e8d907 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java @@ -25,7 +25,7 @@ public class TrunkDataServiceImpl implements ITrunkDataService { @Override public TrunkDataVO getTrunkData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime)); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new TrunkDataVO(); From 06e2ffe6be27ba59b909a625f650190f48030d8e Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sat, 18 Jan 2025 17:28:55 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E6=89=98=E7=9B=98=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/DistributionSignforAppController.java | 17 +++++ .../mapper/DistributionReservationMapper.xml | 6 ++ .../mapper/DistributionSignforMapper.java | 3 +- .../mapper/DistributionSignforMapper.xml | 4 + .../impl/DistributionAsyncServiceImpl.java | 48 ++++++++---- .../DistributionDeliveryListServiceImpl.java | 20 +++-- .../DistributionReservationServiceImpl.java | 4 + .../impl/DistributionSignforServiceImpl.java | 75 ++++++++++--------- .../DistributionStockArticleServiceImpl.java | 35 ++++----- .../impl/DistributionStockupServiceImpl.java | 14 ++-- .../httpImpl/BillingDataServiceImpl.java | 6 +- .../mapper/WarehouseWaybillMapper.xml | 3 + 12 files changed, 149 insertions(+), 86 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java index 1a56e5809..c7fc1b17f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java @@ -53,6 +53,7 @@ public class DistributionSignforAppController { private final IBasicdataWarehouseClient warehouseClient; + /** * 签收管理 列表 */ @@ -209,6 +210,22 @@ public class DistributionSignforAppController { public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { try { R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO); + + if(r.getData()!=null){ + String orderPackageCodes = null; + List packageCodes= (List) r.getData(); + for (String packageCode : packageCodes) { + if (StringUtils.isBlank(orderPackageCodes)) { + orderPackageCodes = packageCode; + } else { + orderPackageCodes = orderPackageCodes + "," + packageCode; + } + } + // 执行下架解托盘代码 + String remark="签收下架解托"; + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), remark); + } return r; } catch (CustomerException e) { log.error("#############signfor:签收报错", e); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 2b567acbc..aeb9d669d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -755,6 +755,12 @@ and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%') + + and ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus} + + + and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus} + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index 424d97e50..6f0e4164a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -479,8 +479,9 @@ public interface DistributionSignforMapper extends BaseMapper + lds.signee_name=#{user.nickName}, + lds.signee_id=#{user.userId}, + lds.received_quantity = ( SELECT IFNULL( sum( received_quantity ), 0 ) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index ec37eecd7..dcc58e7a6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -376,33 +376,45 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private void checkReservationAndDeliveryLoadingStatus(Long deliveryId, Long reservationId) { //判断客户是否完成装车 DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId); + if(Func.isEmpty(distributionReservationEntity)){ + log.error("##########查询客户配送对象为null"); + return ; + } + DistributionReservationEntity updateReservation =new DistributionReservationEntity(); + updateReservation.setId(distributionReservationEntity.getId()); + int reservationPackageTotal = distributionReservationEntity.getReservationNum() + distributionReservationEntity.getReservationStockListNum(); if (reservationPackageTotal != 0) { DistributionLoadingNumDTO reservationLoadingNum = distributionReservationMapper.selectReservationLoadingNum(distributionReservationEntity.getId()); if (Func.isNotEmpty(reservationLoadingNum)) { int reservationLoadingQuantity = reservationLoadingNum.getPackageLoadingQuantity() + reservationLoadingNum.getInventoryLoadingQuantity(); if (reservationLoadingQuantity == reservationPackageTotal) { - distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); + updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); } else { - distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); + updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); } - distributionReservationMapper.updateById(distributionReservationEntity); + distributionReservationMapper.updateById(updateReservation); } } else { log.error("##########查询客户配送数量为0"); } DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); + if(distributionDeliveryListEntity==null){ + return ; + } + DistributionDeliveryListEntity update = new DistributionDeliveryListEntity(); + update.setId(distributionDeliveryListEntity.getId()); int deliveryPackageTotal = distributionDeliveryListEntity.getDeliveryNumber(); if (deliveryPackageTotal != 0) { DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(distributionDeliveryListEntity.getId()); if (Func.isNotEmpty(deliveryLoadingNum)) { int deliveryLoadingQuantity = deliveryLoadingNum.getPackageLoadingQuantity() + deliveryLoadingNum.getInventoryLoadingQuantity(); if (deliveryPackageTotal == deliveryLoadingQuantity) { - distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); + update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); } else { - distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); + update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); } - distributionDeliveryListMapper.updateById(distributionDeliveryListEntity); + distributionDeliveryListMapper.updateById(update); } } else { log.error("##########查询客户配送数量为0"); @@ -764,6 +776,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { return; } DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberEntity.getStockArticleId()); + if(Func.isEmpty(stockArticleEntity)){ + log.error("#################stockArticleEntity参数错误:{}", stockArticleEntity); + return ; + } + DistributionStockArticleEntity updateById = new DistributionStockArticleEntity(); + updateById.setId(stockArticleEntity.getId()); if (Func.equals(stockArticleEntity.getIsZero(), IsOrNoConstant.no.getValue())) { log.error("#################查询订单异常,订单ID为:{}", parcelNumberEntity.getStockArticleId()); return; @@ -776,12 +794,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } parcelNumberEntities.forEach(p -> { DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParcelListId()); + DistributionParcelListEntity update = new DistributionParcelListEntity(); + update.setId(parcelListEntity.getId()); if (Objects.equals(p.getOutboundQuantity(), p.getQuantity())) { - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); } else { - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); + update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); } - distributionParcelListService.updateById(parcelListEntity); + distributionParcelListService.updateById(update); }); List parcelListEntityList = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())); @@ -791,14 +811,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } int outboundQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getOutboundQuantity).sum(); if (outboundQuantity > 0 && outboundQuantity < stockArticleEntity.getTotalNumber()) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - stockArticleEntity.setDeliveryQuantity( outboundQuantity); + updateById.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + updateById.setDeliveryQuantity( outboundQuantity); } if (stockArticleEntity.getTotalNumber() == outboundQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - stockArticleEntity.setDeliveryQuantity(outboundQuantity); + updateById.setOrderStatus(OrderStatusConstant.chuku.getValue()); + updateById.setDeliveryQuantity(outboundQuantity); } - distributionStockArticleService.updateById(stockArticleEntity); + distributionStockArticleService.updateById(updateById); //维护预约客户和配送任务装车状态 checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); } 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 b11d4c9db..ccf31b393 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 @@ -8985,7 +8985,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl info = new HashMap<>(); info.put("orderPackageCode", parcelListEntity.getOrderPackageCode()); @@ -8995,7 +8995,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionSignforEntity::getReservationId, reservationId) ); + + DistributionSignforEntity update = new DistributionSignforEntity(); + update.setId(signforEntity.getId()); + if (Func.isEmpty(signforEntity)) { log.error("维护签收异常是否存在异常包件失败"); return; @@ -1193,9 +1197,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl p.getAuditingStatus().equals(LoadingAbnormalAuditingStatusConstant.yishenhe.getValue())); if (flag) { - signforEntity.setIsHaveAbnormalPackage(1); + update.setIsHaveAbnormalPackage(1); } else { - signforEntity.setIsHaveAbnormalPackage(2); + update.setIsHaveAbnormalPackage(2); } } //统计客户装车数 @@ -1208,8 +1212,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl().lambda() .eq(DistributionLoadscanEntity::getReservationId, signforEntity.getReservationId()) @@ -1219,9 +1223,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN, signforTime); @@ -6123,10 +6126,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds = new ArrayList<>(); List orderCodes = new ArrayList<>(); + // 签收下架的包条码 + List orderPackageCodesByUnTray = new ArrayList<>(); List pushList = new ArrayList<>(); List pushInventoryList = new ArrayList<>(); //配置项 @@ -8087,10 +8092,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:" + packageLockIds); if (Func.isNotEmpty(a)) { - boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); + boolean flag = a.stream().anyMatch(packageLockIds::contains); if (flag) { //正在操作,请稍后重试 throw new CustomerException("该包件正在被操作,请稍后再试!!!"); @@ -8584,11 +8589,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() @@ -2141,46 +2142,46 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl loadingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); } if ((loadingQuantity + deliveryQuantity) == 0) { if (stockArticleEntity.getTotalNumber() == inWarehouseQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); } else if (inWarehouseQuantity > 0) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); } } else { if ((loadingQuantity + deliveryQuantity) == stockArticleEntity.getTotalNumber()) { //无在库数量则无法进行预约 - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); } else if ((loadingQuantity + deliveryQuantity) > 0) { - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); } } if (signingQuantity == 0) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); } else { if (stockArticleEntity.getTotalNumber() == signingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + t.setOrderStatus(OrderStatusConstant.qianshou.getValue()); } else if (stockArticleEntity.getTotalNumber() > signingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); } } //维护订单的在库件数 - stockArticleEntity.setHandQuantity(inWarehouseQuantity); + t.setHandQuantity(inWarehouseQuantity); //维护订单的配送件数 - stockArticleEntity.setDeliveryQuantity(loadingQuantity); - stockArticleEntity.setSigninQuantity(signingQuantity); + t.setDeliveryQuantity(loadingQuantity); + t.setSigninQuantity(signingQuantity); if (inWarehouseQuantity > 0) { - stockArticleEntity.setGenre(1); + t.setGenre(1); } - this.updateById(stockArticleEntity); + this.updateById(t); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 971d537d5..0a29b6279 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -5633,22 +5633,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Objects.isNull(a))) { + if (!packageEntityList.stream().allMatch(Objects::isNull)) { //订制品 - if (!packageEntityList.isEmpty() && packageEntityList.size() > 0) { - packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); - }else { - packageFlag = true; - } - } + packageFlag = packageEntityList.stream().allMatch(a -> OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); + } //库存品 - if (!inventoryList.isEmpty() && inventoryList.size() > 0) { + if (!inventoryList.isEmpty()) { inventoryFlag = inventoryList.stream().allMatch(b -> InventoryStockUpStatusConstant.yibeihuo.getValue().equals(b.getStockStatus())); }else { inventoryFlag = true; } //零担 - if (!zeroEntityList.isEmpty() && zeroEntityList.size() > 0) { + if (!zeroEntityList.isEmpty()) { //零担核对备货数量是否完成 int planNum = zeroEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); List orderId = zeroEntityList.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList()); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java index f5c0eba60..301910418 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -34,7 +34,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public BillingDataVO getBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -43,7 +43,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getWarehouseBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -58,7 +58,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getMonthBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new ArrayList<>(); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index 169fb17a3..4ffe10b73 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -671,6 +671,9 @@ and lww.pay_status = #{param.payStatus} + + and lww.sign_user_name = #{param.signUserName} + and lww.settlement_status = #{param.settlementStatus} From 71e1f0729e61bbe88dfd8793d13cb07ed264f019 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 18 Jan 2025 17:57:22 +0800 Subject: [PATCH 04/19] =?UTF-8?q?1.=E6=8A=A5=E9=94=99bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CarsLoadAsyncServiceImpl.java | 8 ++- .../impl/TrunklineAdvanceServiceImpl.java | 66 ++++++++++--------- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index 40cdc4598..1f4401dd1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -289,9 +289,11 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { trunklineCostShareRecordEntity.setLoadingWarehouseId(warehouseId); trunklineCostShareRecordEntity.setLoadingWarehouseName(warehouseName); trunklineCostShareRecordEntity.setPlanUnloadWarehouseId(finalNodeId); - BasicdataWarehouseEntity finalWarehouse = warehouseClient.getEntityWarehouseId(finalNodeId); - if (!Objects.isNull(finalWarehouse)) { - trunklineCostShareRecordEntity.setPlanUnloadWarehouseName(finalWarehouse.getName()); + if(Objects.isNull(finalNodeId)){ + BasicdataWarehouseEntity finalWarehouse = warehouseClient.getEntityWarehouseId(finalNodeId); + if (!Objects.isNull(finalWarehouse)) { + trunklineCostShareRecordEntity.setPlanUnloadWarehouseName(finalWarehouse.getName()); + } } trunklineCostShareRecordEntity.setRealUnloadWarehouseId(unloadNodeId); trunklineCostShareRecordEntity.setRealUnloadWarehouseName(unloadNodeName); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java index 631f6e4cd..bab6b7217 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java @@ -884,42 +884,48 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl Date: Mon, 20 Jan 2025 10:11:53 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E3=80=81=E5=A4=87=E8=B4=A7BUG=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/AftersalesWorkOrderAllPageVO.java | 0 .../vo/AftersalesWorkOrderAppealPageVO.java | 0 ...AftersalesWorkOrderCompensationPageVO.java | 0 .../vo/AftersalesWorkOrderEndPageVO.java | 0 .../vo/AftersalesWorkOrderExaminePageVO.java | 0 ...AftersalesWorkOrderInterventionPageVO.java | 0 .../vo/AftersalesWorkOrderProcessPageVO.java | 0 .../vo/AftersalesWorkOrderReplyPageVO.java | 0 .../vo/AftersalesWorkOrderTimeOutPageVO.java | 0 .../AftersalesWorkOrderController.java | 77 +- .../excel/AftersalesWorkOrderAllExcel.java | 0 .../excel/AftersalesWorkOrderAppealExcel.java | 0 ...ersalesWorkOrderCompensationPageExcel.java | 0 .../AftersalesWorkOrderCompleteExcel.java | 0 .../excel/AftersalesWorkOrderEndExcel.java | 0 .../AftersalesWorkOrderExamineExcel.java | 0 .../AftersalesWorkOrderInterventionExcel.java | 0 .../AftersalesWorkOrderProcessExcel.java | 0 .../excel/AftersalesWorkOrderReplyExcel.java | 0 .../AftersalesWorkOrderTimeOutExcel.java | 0 .../mapper/AftersalesWorkOrderMapper.java | 133 +- .../mapper/AftersalesWorkOrderMapper.xml | 3556 ++++++++++++++++- .../service/IAftersalesWorkOrderService.java | 41 +- .../impl/AftersalesWorkOrderServiceImpl.java | 1192 ++++-- .../mapper/DistributionStockupMapper.xml | 3 +- .../impl/DistributionStockupServiceImpl.java | 10 + 26 files changed, 4409 insertions(+), 603 deletions(-) create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java index 94c76b04d..6251bfe3d 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java @@ -41,6 +41,7 @@ import com.logpm.aftersales.service.IAftersalesCompletionRecipientService; import com.logpm.aftersales.service.IAftersalesCompletionRecordService; import com.logpm.aftersales.service.IAftersalesPersonResponsibleService; import com.logpm.aftersales.service.IAftersalesWorkOrderService; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; import com.logpm.aftersales.vo.AftersalesWorkOrderVO; import com.logpm.aftersales.wrapper.AftersalesWorkOrderWrapper; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; @@ -160,21 +161,7 @@ public class AftersalesWorkOrderController extends BladeController { } - /** - * 客服异常工单 查询异常工单完整数据集合 - */ - @PostMapping("/pageAllList") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "查询异常工单完整数据集合", notes = "传入aftersalesWorkOrder") - public R ageAllList(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query) { - try { - R r = aftersalesWorkOrderService.ageAllList(workOrderQueryDTO, Condition.getPage(query)); - return r; - } catch (Exception e) { - log.error("工单查询系统异常》》》{}", e.getMessage()); - return R.fail("系统异常!"); - } - } + @@ -297,7 +284,7 @@ public class AftersalesWorkOrderController extends BladeController { if (ObjectUtils.isNull(aftersalesWorkOrderDTO.getSurveyRecordDTO().getContent())) { throw new ServiceException("内容不能为空!!"); } - return R.status(aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO)); + return aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO); } catch (ServiceException s) { return R.fail(s.getMessage()); } catch (Exception e) { @@ -676,7 +663,6 @@ public class AftersalesWorkOrderController extends BladeController { log.error("填写钉钉流程号异常》》{}", e.getMessage()); return R.fail("系统异常!!!"); } - } /** @@ -695,14 +681,13 @@ public class AftersalesWorkOrderController extends BladeController { } try { aftersalesWorkOrder.setInitiationIdentification("PC"); - return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder)); + return aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder); } catch (ServiceException s) { return R.fail(s.getMessage()); } catch (Exception e) { log.error("工单提交异常》》》{}", e.getMessage()); return R.fail(e.getMessage()); } - } @@ -1413,6 +1398,26 @@ public class AftersalesWorkOrderController extends BladeController { return R.success("操作成功"); } + /** + * 修改内部责任信息 + */ + @PostMapping("/updatePersonResponsible") + @ApiOperationSupport(order = 13) + @ApiOperation(value = "写入财务入账时间", notes = "传入aftersalesWorkOrder") + public R updatePersonResponsible(@Valid @RequestBody AftersalesWorkOrderVO aftersalesWorkOrderVO) { + + if (Objects.isNull(aftersalesWorkOrderVO.getPersonResponsibleVOS())){ + return R.fail("参数缺失,请联系管理员"); + } + if (Objects.isNull(aftersalesWorkOrderVO.getId())){ + return R.fail("参数缺失,请联系管理员"); + } + List personResponsibleVOS = aftersalesWorkOrderVO.getPersonResponsibleVOS(); + Long id = aftersalesWorkOrderVO.getId(); + return aftersalesWorkOrderService.updatePersonResponsible(id, personResponsibleVOS); + } + + /** * 写入财务入账时间 */ @@ -1431,4 +1436,38 @@ public class AftersalesWorkOrderController extends BladeController { } + + + + /** + * 客服异常工单 查询异常工单完整数据集合 + */ + @PostMapping("/newPage") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询", notes = "传入aftersalesWorkOrder") + public R newPage(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,@RequestParam Integer pageType) { + try { + R r = aftersalesWorkOrderService.newPage(workOrderQueryDTO,query,pageType); + return r; + } catch (Exception e) { + log.error("工单查询系统异常》》》{}", e.getMessage()); + return R.fail("系统异常!"); + } + } + + + + /** + * 客服异常工单 查询异常工单完整数据集合 + */ + @PostMapping("/newExport") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查询", notes = "传入aftersalesWorkOrder") + public void newExport(@ApiIgnore @RequestBody AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,@RequestParam Integer pageType,HttpServletResponse response) { + try { + aftersalesWorkOrderService.newExport(workOrderQueryDTO,query,pageType,response); + } catch (Exception e) { + log.error("工单查询系统异常》》》{}", e.getMessage()); + } + } } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java new file mode 100644 index 000000000..e69de29bb diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java index 91e8b8901..f904c81b6 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java @@ -21,17 +21,14 @@ import com.logpm.aftersales.dto.AftersalesWorkOrderQueryDTO; import com.logpm.aftersales.entity.AftersalesProcessorEntity; import com.logpm.aftersales.entity.AftersalesSettlementEntity; import com.logpm.aftersales.entity.AftersalesWorkOrderEntity; -import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; -import com.logpm.aftersales.vo.AftersalesWorkOrderVO; -import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; +import com.logpm.aftersales.excel.*; +import com.logpm.aftersales.vo.*; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; -import java.util.Map; /** * 客服异常工单 Mapper 接口 @@ -135,12 +132,134 @@ public interface AftersalesWorkOrderMapper extends BaseMapper overTimeAfterSalesList(); + /** - * 工单查询列表 + * 查询工单全部列表 * @param page * @param workOrderQueryDTO + * @return + */ + IPage selectAllWorkOrderPage(IPage page, @Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + IPage selectReplyWorkOrderPage(IPage page2,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询处理中工单 + * @param page3 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + IPage selectProcessWorkOrderPage(IPage page3,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds,@Param("isWait") Integer isWait); + + /** + * 查询理赔金未出 + * @param page5 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + IPage selectCompensationWorkOrderPage(IPage page5,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + IPage selectCompleteWorkOrderPage(IPage page6,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询客服介入列表 + * @param page7 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + IPage selectInterventioWorkOrderPage(IPage page7,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds")List warehouseIds); + + IPage selectExamineWorkOrderPage(IPage page7,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + IPage selectEndWorkOrderPage(IPage page8,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + + IPage selectAppealWorkOrderPage(IPage page9, @Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + IPage selectTimeOutWorkOrderPage(IPage page10,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询所有列表导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectAllWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 待回复导出 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectReplyWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询待处理和处理中的导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @param i + * @return + */ + List selectProcessWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds,@Param("isWait") int isWait); + + /** + * 查询理赔金未出导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectCompensationWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 处理完毕导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectCompleteWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询待审核导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectExamineWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO, @Param("warehouseIds")List warehouseIds); + + /** + * 查询完结导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectEndWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询申述列表导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectAppealWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + /** + * 查询超时导出数据 + * @param workOrderQueryDTO + * @param warehouseIds + * @return + */ + List selectTimeOutWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + + + /** + * 客服介入导出 + * @param workOrderQueryDTO * @param warehouseIds * @return */ - IPage pageAllList(IPage page,@Param("param") AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseId") List warehouseIds); + List selectInterventioWorkOrderExcelDta(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 4e6eff028..c77671792 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -90,7 +90,7 @@ lawo.person_responsible, lawo.process_number, lawo.customer_service_name customerServiceName, - lawo.warehouse_id warehouseId, + lap.business_id warehouseId, lawo.investigation_process investigationProcess, lawo.customer_service_id customerServiceId, lawo.compensation_money totalAmountNum, @@ -295,8 +295,8 @@ FROM logpm_aftersales_work_order lawo LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) + AND lap.is_deleted = 0 + AND lap.conditions IN ( 1, 3 ) LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = '0' LEFT JOIN (SELECT @@ -442,13 +442,12 @@ FROM logpm_aftersales_work_order lawo LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id + AND lap.is_deleted = 0 + AND lap.conditions IN ( 1, 3 ) + LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = '0' LEFT JOIN logpm_aftersales_abnormal_package AS laap ON laap.work_order_id = lawo.id lawo.is_deleted = 0 - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) - AND lacr.is_deleted = '0' and lawo.id IN @@ -803,14 +802,15 @@ FROM logpm_aftersales_work_order lawo LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) + AND lacr.is_deleted = 0 + AND lap.conditions IN ( 1, 3 ) LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = '0' left join logpm_aftersales_abnormal_package laap on lawo.id = laap.work_order_id + lawo.is_deleted = 0 - lawo.warehouse_id in + lap.business_id in #{item} @@ -956,8 +956,8 @@ FROM logpm_aftersales_work_order lawo LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) + AND lap.is_deleted = 0 + AND lap.conditions IN ( 1, 3 ) LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = '0' LEFT JOIN (SELECT @@ -1131,8 +1131,7 @@ FROM logpm_aftersales_work_order lawo LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id - AND lap.types_of = '2' - AND lap.conditions IN ( 1, 2 ) + AND lap.conditions IN ( 1, 3) AND lap.is_deleted = 0 LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id AND lacr.is_deleted = 0 @@ -1249,158 +1248,3447 @@ FROM logpm_aftersales_processor AS lbp WHERE - lbp.types_of != 3 - AND lbp.processing_status = 1 + lbp.types_of = 2 + AND lbp.processing_status IN ('1','3') AND lbp.is_deleted = 0 - AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT('2025-01-01','%y%m%d')) <= -3 - AND DATE_FORMAT(lbp.create_time,'%y%m%d') >= DATE_FORMAT( '2025-01-01', '%y%m%d' ) + AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(now(),'%y%m%d')) <= -3 + - + SELECT + t.* FROM - logpm_aftersales_work_order lawo - LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id - AND lacr.is_deleted = '0' - LEFT JOIN ( + ( SELECT - a.id, - group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`, - group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary, - group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name, - group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code, - group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number + lawo.id AS id, + lawo.work_order_type AS workOrderType, + CASE + lawo.work_order_type + WHEN 1 THEN + '货损' + WHEN 2 THEN + '少货' + WHEN 3 THEN + '窜货' + WHEN 4 THEN + '加急' + WHEN 5 THEN + '其他' ELSE '未知类型' + END workOrderTypeName, + lawo.discovery_node AS discoveryNode, + CASE + lawo.discovery_node + WHEN 1 THEN + '提货环节' + WHEN 2 THEN + '发货环节' + WHEN 3 THEN + '干线卸车环节' + WHEN 4 THEN + '库内作业环节' + WHEN 5 THEN + '配送装车环节' + WHEN 6 THEN + '配送签收环节' + WHEN 7 THEN + '安装环节' + WHEN 7 THEN + '其他' ELSE '未知节点' + END discoveryNodeName, + lawo.warehouse_name AS warehouseName, + lawo.work_order_number AS workOrderNumber, + GROUP_CONCAT( DISTINCT laap.waybill_number ) AS waybillNumber, + GROUP_CONCAT( DISTINCT laap.order_code ) AS orderCode, + GROUP_CONCAT( DISTINCT laap.package_code ) AS packageCode , + GROUP_CONCAT( DISTINCT laap.brand_name ) AS brandName , + lawo.waybill_mall AS waybillMall, + GROUP_CONCAT( DISTINCT laap.`first` ) AS first, + GROUP_CONCAT( DISTINCT laap.secondary ) AS secondary, + GROUP_CONCAT( DISTINCT laap.third_product ) AS thirdProduct, + lawo.work_order_status AS workOrderStatus, + CASE + lawo.work_order_status + WHEN '10' THEN + '待处理' + WHEN '20' THEN + '处理中' + WHEN '30' THEN + '已处理' + WHEN '40' THEN + '待审核' + WHEN '50' THEN + '已审核' + WHEN '60' THEN + '超时未处理' + WHEN '70' THEN + '客服介入中' + WHEN '80' THEN + '仲裁中' + WHEN '90' THEN + '理赔金额未出' + WHEN '21' THEN + '处理结果已提交' + WHEN '100' THEN + '申述中' + WHEN '110' THEN + '已结束' ELSE '未知状态' + END workOrderStatusName, + lawo.processed_by AS processedBy, + lawo.responsible_person AS responsiblePerson, + lawo.create_time AS createTime , + ( lawo.create_time + INTERVAL 3 DAY ) AS endCreateTime, + lawo.update_time AS updateTime, + GROUP_CONCAT( lapr.result_type ) AS resultType, + IFNULL( SUM( lapr.money ), 0 ) AS money, + lawo.warehouse_service_name AS warehouseServiceName, + lawo.headquarters_name AS headquartersName, + lawo.over_time AS overTime, + IF + ( + count( laa.id ) > 1, + '是', + IF + ( count( laa.id ) IS NOT NULL, '', '否' )) AS isAppeal, + laa.types_of AS appealStatus, + CASE + laa.types_of + WHEN 0 THEN '待处理' + WHEN 1 THEN '成立' + WHEN 2 THEN '驳回' ELSE NULL + END AS appealStatusName, + lawo.process_number AS processNumber, + lawo.entry_time AS entryTime, + DATE_FORMAT( lawo.entry_time, '%Y-%m' ) AS entryMonthTime FROM - logpm_aftersales_work_order AS a - LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id - WHERE - a.is_deleted = 0 - AND b.is_deleted = 0 - GROUP BY - a.id - ) AS t ON t.id = lawo.id - LEFT JOIN logpm_aftersales_processor AS lap ON lawo.id = lap.work_order_id - AND lap.is_deleted = 0 + logpm_aftersales_work_order AS lawo + LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id + AND lap.conditions IN ( 1, 3 ) + LEFT JOIN logpm_aftersales_abnormal_package AS laap ON laap.work_order_id = lawo.id + AND laap.is_deleted = 0 LEFT JOIN logpm_aftersales_processing_results AS lapr ON lapr.work_order_id = lawo.id AND lapr.is_deleted = 0 - AND lap.types_of != '3' - AND lap.types_of != '3' + LEFT JOIN logpm_aftersales_appeal AS laa ON laa.work_order_id = lawo.id + AND laa.is_deleted = 0 + AND laa.types_of != 2 + WHERE + lawo.is_deleted = 0 + + AND lap.business_id IN + + #{warehouseId} + + + + AND lawo.work_order_number in + + #{workOrderNumber} + + + + AND laap.order_code in + + #{orderCode} + + + + AND DATE_FORMAT(lawo.create_time,'%y%m%d') between DATE_FORMAT(#{param.startCreateTime},'%y%m%d') and DATE_FORMAT(#{param.endCreateTime},'%y%m%d') + + + AND DATE_FORMAT(lawo.create_time,'%y%m%d') = DATE_FORMAT(#{param.createTime},'%y%m%d') + + + AND DATE_FORMAT(lawo.update_time,'%y%m%d') = DATE_FORMAT(#{param.updateTime},'%y%m%d') + + GROUP BY + lawo.id + ORDER BY + lawo.create_time DESC + ) AS t - lawo.is_deleted = 0 - - and lawo.work_order_number in - - #{workOrderNumber} - + + t.workOrderType = #{param.workOrderType} - - and lawo.order_code in - - #{orderCode} - + + AND t.discoveryNode = #{param.discoveryNode} - - and lawo.create_time between #{param.startCreateTime} and #{param.endCreateTime} + + AND t.workOrderNumber LIKE CONCAT('%',#{param.workOrderNumber},'%') - - and lawo.ceator like concat('%', #{param.ceator },'%') + + AND t.waybillNumber LIKE CONCAT('%',#{param.waybillNumber},'%') - - and lap.business_id IN - - #{warehouseId} - + + AND t.orderCode LIKE CONCAT('%',#{param.orderCode},'%') - - and lawo.workOrder_type = #{param.ceator } + + AND t.packageCode LIKE CONCAT('%',#{param.packageCode},'%') - - and lawo.discovery_node = #{param.discoveryNode } + + AND t.brandName LIKE CONCAT('%',#{param.brandName},'%') - - and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') + + AND t.waybillMall LIKE CONCAT('%',#{param.waybillMall},'%') - - and lawo.waybill_number like concat('%',#{param.waybillNumber },'%') + + AND t.waybillMall LIKE CONCAT('%',#{param.first},'%') - - and lawo.order_code like concat('%',#{param.orderCode },'%') + + + AND t.workOrderStatus =#{param.workOrderStatus} - - and lawo.order_code like concat('%',#{param.orderCode },'%') + + AND t.processedBy LIKE CONCAT('%',#{param.processedBy},'%') - - and lawo.package_code like concat('%',#{param.packageCode },'%') + + AND t.responsiblePerson LIKE CONCAT('%',#{param.responsiblePerson},'%') - - and lawo.brand_name like concat('%',#{param.brandName },'%') + + AND t.resultType LIKE CONCAT('%',#{param.resultType},'%') - - and lawo.waybill_mall like concat('%',#{param.waybillMall },'%') + + AND t.warehouseServiceName LIKE CONCAT('%',#{param.warehouseServiceName},'%') - - and lawo.first like concat('%',#{param.first },'%') + + AND t.headquartersName LIKE CONCAT('%',#{param.headquartersName},'%') - - and lawo.work_order_status = #{param.workOrderStatus } + + AND t.first LIKE CONCAT('%',#{param.first},'%') - - and lawo.processed_by like concat('%',#{param.processedBy },'%') + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java index f58fb41f2..7ac2418de 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java @@ -24,15 +24,18 @@ import com.logpm.aftersales.entity.AftersalesAppealEntity; import com.logpm.aftersales.entity.AftersalesSettlementEntity; import com.logpm.aftersales.entity.AftersalesWorkOrderEntity; import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; import com.logpm.aftersales.vo.AftersalesWorkOrderVO; import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; import org.springblade.core.tool.api.R; import org.springblade.system.entity.User; +import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; import java.util.Map; @@ -66,9 +69,9 @@ public interface IAftersalesWorkOrderService extends BaseService page); + R newPage(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query,Integer pageType); + + + /** + * 导出 + * @param workOrderQueryDTO + * @param query + * @param pageType + * @param response + */ + void newExport(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query, Integer pageType, HttpServletResponse response); + + + R updatePersonResponsible(Long id, List personResponsibleVOS); + } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 1fb826a4f..53c90c3da 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -29,7 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.aftersales.bean.Resp; import com.logpm.aftersales.dto.*; import com.logpm.aftersales.entity.*; -import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; +import com.logpm.aftersales.excel.*; import com.logpm.aftersales.mapper.AftersalesAbnormalPackageMapper; import com.logpm.aftersales.mapper.AftersalesAppealMapper; import com.logpm.aftersales.mapper.AftersalesCustomerMallMapper; @@ -53,9 +53,13 @@ import org.springblade.common.constant.DictTimeoutEnum; import org.springblade.common.constant.aftersales.*; import org.springblade.common.constant.basiccode.BasicCodeShowConstant; import org.springblade.common.constant.basiccode.BasicCodeTypeConstant; +import org.springblade.common.constant.common.RoleConstant; import org.springblade.common.exception.CustomerException; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; @@ -66,10 +70,12 @@ import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.DictBiz; import org.springblade.system.entity.User; import org.springblade.system.feign.ISysClient; +import org.springblade.system.feign.IUserClient; import org.springblade.system.feign.IUserSearchClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.time.Duration; @@ -110,7 +116,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl { - if ("1".equals(k)) { - //责任人 - String collect = v.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); - aftersalesWorkOrder.setResponsiblePerson(collect); - } else { - String collect = v.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); - aftersalesWorkOrder.setProcessedBy(collect); - } - - }); - } - - if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())) { - if (aftersalesWorkOrder.getVehicleRoute().indexOf(">") > 0) { - String string = aftersalesWorkOrder.getVehicleRoute().replaceAll(">", ">"); - aftersalesWorkOrder.setVehicleRoute(string); + public R extractedSaveAndUpdate(AftersalesWorkOrderDTO aftersalesWorkOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) { + + String method = "#########################AftersalesWorkOrderServiceImpl.newAftersalesWorkOrderSave"; + //根据工单类型进行参数校验 + if (Objects.isNull(aftersalesWorkOrder.getDiscoveryNode())) { + log.info(method + "aftersalesWorkOrder.getDiscoveryNode()参数缺失"); + return R.fail("参数缺失,请联系管理"); + } + if (Objects.isNull(aftersalesWorkOrder.getWorkOrderType())) { + log.info(method + "aftersalesWorkOrder.getWorkOrderType()参数缺失"); + return R.fail("参数缺失,请联系管理"); + } + if (Objects.isNull(aftersalesWorkOrder.getPackageEntityList())) { + log.info(method + "aftersalesWorkOrder.getPackageEntityList()参数缺失"); + return R.fail("参数缺失,请联系管理"); + } + if (Objects.isNull(aftersalesWorkOrder.getProcessorEntityList())) { + log.info(method + "aftersalesWorkOrder.getProcessorEntityList()参数缺失"); + return R.fail("请选择工单处理方"); + } + //基础信息数据校验 + //运单商场 + if (Objects.isNull(aftersalesWorkOrder.getWaybillMall())) { + log.info(method + "aftersalesWorkOrder.getWaybillMall()参数缺失"); + return R.fail("请填写运单商场信息"); + } + //调查经过 + if (Objects.isNull(aftersalesWorkOrder.getInvestigationProcess())) { + log.info(method + "aftersalesWorkOrder.getInvestigationProcess()参数缺失"); + return R.fail("请填写调查经过"); + } + if (Objects.isNull(AuthUtil.getUser())) { + log.info(method + "AuthUtil.getUser()获取当前登录人信息错误"); + return R.fail("当前登录人信息错误,请重新登陆"); + } + //判断是否为仓库客服 + boolean isWarehouseCustomerService = judgeIsWarehouseCustomerService(user); + if (!isWarehouseCustomerService) { + return R.fail("当前登录人无此操作权限"); + } + String discoveryNode = aftersalesWorkOrder.getDiscoveryNode(); + String workOrderType = aftersalesWorkOrder.getWorkOrderType(); + String investigationProcess = aftersalesWorkOrder.getInvestigationProcess(); + //进行处理结果处理 + List processorEntityList = aftersalesWorkOrder.getProcessorEntityList(); + //进行处理方的保存 + //公共参数校验 + String waybillMall = aftersalesWorkOrder.getWaybillMall(); + AftersalesWorkOrderEntity workOrderEntity = generateBasicAftersalesWorkOrderEntity(myCurrentWarehouse, + user, + discoveryNode, + workOrderType, + investigationProcess); + workOrderEntity.setWaybillMall(waybillMall); + switch (discoveryNode) { + //指定参数校验 + case "1": + case "6": + break; + case "2": + //需要校验发货时间 + if (Objects.isNull(aftersalesWorkOrder.getDeliverGoodsTime())) { + return R.fail("请选择发货时间"); } - } - baseMapper.insert(aftersalesWorkOrder); - //保存一个自己的处理方数据 - AftersalesProcessorEntity aftersalesProcessorEntity = new AftersalesProcessorEntity(); - aftersalesProcessorEntity.setConditions("1"); - aftersalesProcessorEntity.setTypesOf("3"); - aftersalesProcessorEntity.setBusinessId(myCurrentWarehouse.getId()); - aftersalesProcessorEntity.setBusinessName(myCurrentWarehouse.getName()); - aftersalesProcessorEntity.setWarehouseId(myCurrentWarehouse.getId()); - aftersalesProcessorEntity.setWorkOrderId(aftersalesWorkOrder.getId()); - aftersalesProcessorEntity.setProcessingStatus("5"); - aftersalesProcessorService.save(aftersalesProcessorEntity); - } else { - //修改 -// if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnPpackageEntityList())) { - //删除修改包件 -// aftersalesAbnormalPackageService.deleteLogic(aftersalesWorkOrder.getUnPpackageEntityList()); -// } - LambdaUpdateWrapper updateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesAbnormalPackageEntity::getIsDeleted, 1) - .eq(AftersalesAbnormalPackageEntity::getWorkOrderId, aftersalesWorkOrder.getId()); - aftersalesAbnormalPackageService.update(updateWrapper); -// if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnProcessorEntityList())) { -// //责任方 处理方 -//// List list = new ArrayList<>(); -// aftersalesWorkOrder.getUnProcessorEntityList().forEach(i -> { -// AftersalesProcessorEntity processorEntity = new AftersalesProcessorEntity(); -// processorEntity.setId(i); -// processorEntity.setConditions("3"); -// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getProcessorEntityList())) { -// aftersalesWorkOrder.getProcessorEntityList().stream().collect(Collectors.groupingBy(AftersalesProcessorEntity::getTypesOf)) -// .forEach((k, v) -> { -// if ("1".equals(k)) { -// //责任人 -// String collect = v.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); -// aftersalesWorkOrder.setResponsiblePerson(collect); -// } else { -// String collect = v.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); -// aftersalesWorkOrder.setProcessedBy(collect); -// } -// -// }); -// } -// aftersalesProcessorService.updateById(processorEntity); -//// list.add(processorEntity); -// }); -//// if(!list.isEmpty()){ -//// aftersalesProcessorService.saveOrUpdateBatch(list); -//// } -// } - LambdaUpdateWrapper processorEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesProcessorEntity::getIsDeleted, 1) - .eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrder.getId()); - aftersalesProcessorService.update(processorEntityLambdaUpdateWrapper); -// if (ObjectUtil.isNotNull(aftersalesWorkOrder.getUnDecreaseImageEntityList()) && !aftersalesWorkOrder.getUnDecreaseImageEntityList().isEmpty()) { -// //图片修改 -// aftersalesDecreaseImageService.deleteLogic(aftersalesWorkOrder.getUnDecreaseImageEntityList()); -// } - LambdaUpdateWrapper imageEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesDecreaseImageEntity::getIsDeleted, 1) - .eq(AftersalesDecreaseImageEntity::getWorkOrderId, aftersalesWorkOrder.getId()); - aftersalesDecreaseImageService.update(imageEntityLambdaUpdateWrapper); - //修改调查经过 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())) { - aftersalesWorkOrder.setInvestigationProcess(aftersalesWorkOrder.getSurveyRecordDTO().getContent()); - } - //修改责任方 -// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnPersonResponsibleDTO())) { -// aftersalesPersonResponsibleService.deleteLogic(aftersalesWorkOrder.getUnPersonResponsibleDTO()); -// } - LambdaUpdateWrapper personResponsibleEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesPersonResponsibleEntity::getIsDeleted, 1) - .eq(AftersalesPersonResponsibleEntity::getWordOrderId, aftersalesWorkOrder.getId()); - aftersalesPersonResponsibleService.update(personResponsibleEntityLambdaUpdateWrapper); - //修改赔款方 -// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecordEntities())) { -// completionRecordService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecordEntities()); -// } - LambdaUpdateWrapper completionRecordEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesCompletionRecordEntity::getIsDeleted, 1) - .eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId()); - completionRecordService.update(completionRecordEntityLambdaUpdateWrapper); - //修改收款方 -// if (ObjectUtils.isNotNull(aftersalesWorkOrder.getUnCompletionRecipientEntities())) { -// completionRecipientService.deleteLogic(aftersalesWorkOrder.getUnCompletionRecipientEntities()); -// } - LambdaUpdateWrapper completionRecipientEntityLambdaUpdateWrapper = Wrappers.lambdaUpdate() - .set(AftersalesCompletionRecipientEntity::getIsDeleted, 1) - .eq(AftersalesCompletionRecipientEntity::getWorkOrderId, aftersalesWorkOrder.getId()); - completionRecipientService.update(completionRecipientEntityLambdaUpdateWrapper); - // - baseMapper.updateById(aftersalesWorkOrder); - } - //添加包件信息 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getPackageEntityList())) { - List packageEntityList = aftersalesWorkOrder.getPackageEntityList(); - if (!packageEntityList.isEmpty()) { - List collect = packageEntityList.stream().filter(f -> Objects.isNull(f.getFirst())).map(AftersalesAbnormalPackageEntity::getPackageCode).collect(Collectors.toList()); - if (!collect.isEmpty()) { - throw new RuntimeException(collect.stream().collect(Collectors.joining(",")) + "无一级品信息"); + workOrderEntity.setDeliverGoodsTime(aftersalesWorkOrder.getDeliverGoodsTime()); + break; + case "3": + //车次号、车辆线路、责任方 + if (Objects.isNull(aftersalesWorkOrder.getTrainNumber())) { + return R.fail("请填写车次信息"); } - } - //包件信息 - List list = new ArrayList<>(); - aftersalesWorkOrder.getPackageEntityList().forEach(i -> { - if (ObjectUtils.isNotNull(i.getId())) { - //修改包件信息 -// AftersalesAbnormalPackageEntity abnormalPackage = new AftersalesAbnormalPackageEntity(); - aftersalesAbnormalPackageService.updateById(i); - } else { - //添加 - AftersalesAbnormalPackageEntity packageEntity = new AftersalesAbnormalPackageEntity(); - BeanUtil.copyProperties(i, packageEntity); - packageEntity.setWorkOrderId(aftersalesWorkOrder.getId()); - packageEntity.setWarehouseId(myCurrentWarehouse.getId()); - list.add(packageEntity); + if (Objects.isNull(aftersalesWorkOrder.getVehicleRoute())) { + return R.fail("请填写线路信息"); } - }); - if (!list.isEmpty()) { - aftersalesAbnormalPackageService.saveBatch(list); - } - } - AftersaleSurveyRecordEntity aftersaleSurveyRecord = new AftersaleSurveyRecordEntity(); - //添加调查记录 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getSurveyRecordDTO())) { - AftersaleSurveyRecordDTO surveyRecordDTO = changName(aftersalesWorkOrder, user); - BeanUtil.copyProperties(surveyRecordDTO, aftersaleSurveyRecord); - aftersaleSurveyRecord.setTypesOf("1"); - aftersaleSurveyRecord.setDifference("1"); - aftersaleSurveyRecord.setWorkOrderId(aftersalesWorkOrder.getId()); - aftersaleSurveyRecord.setProcessingResults(surveyRecordDTO.getContent()); - aftersaleSurveyRecordService.save(aftersaleSurveyRecord); - } - //添加责任方 处理方 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getProcessorEntityList())) { - //责任方 处理方 - List list = new ArrayList<>(); - aftersalesWorkOrder.getProcessorEntityList().forEach(i -> { - AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrder, myCurrentWarehouse, i); -// list.add(processor); - //添加指派记录 - if (ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getTypesOf())) { - //处理方 - addSurveRecord(aftersalesWorkOrder, user, i); - processor.setAssignTime(new Date()); - list.add(processor); - } else { - list.add(processor); + workOrderEntity.setTrainNumber(aftersalesWorkOrder.getTrainNumber()); + if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())) { + if (aftersalesWorkOrder.getVehicleRoute().indexOf(">") > 0) { + String string = aftersalesWorkOrder.getVehicleRoute().replaceAll(">", ">"); + workOrderEntity.setVehicleRoute(string); + } } - aftersalesProcessorService.save(processor); - if (ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getTypesOf())) { - AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrder, processor, aftersaleSurveyRecord); - //添加待回复信息 - aftersalesReplyingPartyService.save(replyingPartyEntity); + break; + case "4": + //入库时间、发现时间 + if (Objects.isNull(aftersalesWorkOrder.getDiscoveryTime())) { + return R.fail("请填写发现时间"); } - }); - - } - //添加图片信息 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getDecreaseImageEntityList())) { - //货损图片 - List list = new ArrayList<>(); - aftersalesWorkOrder.getDecreaseImageEntityList().forEach(i -> { - AftersalesDecreaseImageEntity packageEntity = new AftersalesDecreaseImageEntity(); - BeanUtil.copyProperties(i, packageEntity); - packageEntity.setWorkOrderId(aftersalesWorkOrder.getId()); - packageEntity.setWarehouseId(myCurrentWarehouse.getId()); - list.add(packageEntity); - }); - if (!list.isEmpty()) { - aftersalesDecreaseImageService.saveBatch(list); + if (Objects.isNull(aftersalesWorkOrder.getWarehousingTime())) { + return R.fail("请填写入库时间"); + } + workOrderEntity.setDiscoveryTime(aftersalesWorkOrder.getDiscoveryTime()); + workOrderEntity.setWarehousingTime(aftersalesWorkOrder.getWarehousingTime()); + break; + case "5": + //车次号、配送时间、配送司机、发现时间 + if (Objects.isNull(aftersalesWorkOrder.getTrainNumber())) { + return R.fail("请填写车次信息"); + } + if (Objects.isNull(aftersalesWorkOrder.getDeliveryTime())) { + return R.fail("请填写配送时间"); + } + if (Objects.isNull(aftersalesWorkOrder.getDeliveryDriver())) { + return R.fail("请填写司机信息"); + } + if (Objects.isNull(aftersalesWorkOrder.getDiscoveryTime())) { + return R.fail("请填写发现时间"); + } + workOrderEntity.setTrainNumber(aftersalesWorkOrder.getTrainNumber()); + workOrderEntity.setDeliveryTime(aftersalesWorkOrder.getDeliveryTime()); + workOrderEntity.setDeliveryDriver(aftersalesWorkOrder.getDeliveryDriver()); + workOrderEntity.setDiscoveryTime(aftersalesWorkOrder.getDiscoveryTime()); + break; + case "7": + case "8": + break; + default: + log.info("未知的发现节点>>>>>>>>>>>>>>discoveryNode:{}", discoveryNode); + return R.fail("未知的发现节点"); + } + Map> processorEntityMap = processorEntityList.stream().collect(Collectors.groupingBy(AftersalesProcessorEntity::getTypesOf)); + if (!processorEntityMap.isEmpty()) { + if (!Objects.isNull(processorEntityMap.get("1"))) { + List processorEntityList1 = processorEntityMap.get("1"); + String businessName1 = processorEntityList1.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); + workOrderEntity.setResponsiblePerson(businessName1); } - - } - //添加责任人信息 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getPersonResponsibleDTO()) && !aftersalesWorkOrder.getPersonResponsibleDTO().isEmpty()) { - List personResponsibleList = getAftersalesPersonResponsibleEntities(aftersalesWorkOrder); - if (!personResponsibleList.isEmpty()) { - aftersalesPersonResponsibleService.saveBatch(personResponsibleList); + if (!Objects.isNull(processorEntityMap.get("2"))) { + List processorEntityList2 = processorEntityMap.get("2"); + String businessName2 = processorEntityList2.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); + workOrderEntity.setProcessedBy(businessName2); } } - //添加完结受款方数据 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecipientEntities())) { - List collect = aftersalesWorkOrder.getCompletionRecipientEntities().stream().filter(i -> ObjectUtils.isNotNull(i.getId())).collect(Collectors.toList()); - List collect1 = aftersalesWorkOrder.getCompletionRecipientEntities().stream().filter(i -> ObjectUtils.isNull(i.getId())).collect(Collectors.toList()); - if (!collect.isEmpty()) { - //修改 - collect.forEach(i -> { - completionRecipientService.updateById(i); - }); + workOrderEntity.setWarehouseServiceName(user.getNickName()); + this.save(workOrderEntity); + //添加提交记录 + AftersaleSurveyRecordEntity aftersaleSurveyRecord = new AftersaleSurveyRecordEntity(); + aftersaleSurveyRecord.setTypesOf("1"); + aftersaleSurveyRecord.setDifference("3"); + aftersaleSurveyRecord.setWorkOrderId(workOrderEntity.getId()); + aftersaleSurveyRecord.setAddPeople(user.getAccount()); + aftersaleSurveyRecord.setProcessorName(user.getNickName()); + aftersaleSurveyRecord.setProcessorId(user.getUserId()); + aftersaleSurveyRecord.setAddDepartment(myCurrentWarehouse.getDepartmentName()); + aftersaleSurveyRecord.setContent("提交工单,处理方:" + workOrderEntity.getProcessedBy()); + aftersaleSurveyRecord.setProcessingResults("提交工单,处理方:" + workOrderEntity.getProcessedBy()); + aftersaleSurveyRecordService.save(aftersaleSurveyRecord); + + //进行工单包件保存 + List packageEntityList = aftersalesWorkOrder.getPackageEntityList(); + packageEntityList.stream().forEach(p -> p.setWorkOrderId(workOrderEntity.getId())); + aftersalesAbnormalPackageService.saveBatch(packageEntityList); + if (!Objects.isNull(aftersalesWorkOrder.getPersonResponsibleDTO())) { + //进行内部责任处理 + List personResponsibleDTO = aftersalesWorkOrder.getPersonResponsibleDTO(); + List aftersalesPersonResponsibleEntityList = handleAftersalesPersonResponsibleDTO(personResponsibleDTO, workOrderEntity); + if (!aftersalesPersonResponsibleEntityList.isEmpty()) { + String personResponsibleName = aftersalesPersonResponsibleEntityList.stream().map(AftersalesPersonResponsibleEntity::getPersonResponsibleName).collect(Collectors.joining(",")); + aftersalesPersonResponsibleService.saveBatch(aftersalesPersonResponsibleEntityList); + workOrderEntity.setPersonResponsible(personResponsibleName); } - if (!collect1.isEmpty()) { - //添加 - completionRecipientService.saveBatch(collect1); - } - } - //添加完结赔款方数据 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecordEntities())) { - - List collect = aftersalesWorkOrder.getCompletionRecordEntities().stream().filter(i -> ObjectUtils.isNotNull(i.getId())).collect(Collectors.toList()); - List collect1 = aftersalesWorkOrder.getCompletionRecordEntities().stream().filter(i -> ObjectUtils.isNull(i.getId())).collect(Collectors.toList()); - if (!collect.isEmpty()) { - //修改 - collect.forEach(i -> { - completionRecordService.updateById(i); - }); + //是否需要进行标记处理方的处理结果提交 + boolean isResult; + if (!Objects.isNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO())) { + //进行处理结果处理 + AftersalesProcessingResultsDTO aftersalesProcessingResultsDTO = aftersalesWorkOrder.getAftersalesProcessingResultsDTO(); + List processingMoneyEntityList = aftersalesProcessingResultsDTO.getProcessingMoneyEntityList(); + workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue()); + AftersalesProcessingResultsEntity aftersalesProcessingResults = generateAftersalesProcessingResultsEntity(processingMoneyEntityList, workOrderEntity, aftersalesProcessingResultsDTO.getResultDescription()); + AftersaleSurveyRecordEntity aftersaleSurveyRecord1 = new AftersaleSurveyRecordEntity(); + aftersaleSurveyRecord1.setTypesOf("1"); + aftersaleSurveyRecord1.setDifference("3"); + aftersaleSurveyRecord1.setWorkOrderId(workOrderEntity.getId()); + aftersaleSurveyRecord1.setAddPeople(user.getAccount()); + aftersaleSurveyRecord1.setProcessorName(user.getNickName()); + aftersaleSurveyRecord.setProcessorId(user.getUserId()); + aftersaleSurveyRecord1.setAddDepartment(myCurrentWarehouse.getDepartmentName()); + aftersaleSurveyRecord1.setContent("提交处理结果,提交方式:创建工单提交;处理结果:" + aftersalesProcessingResults.getResultType() + ";金额:" + aftersalesProcessingResults.getMoney()); + aftersaleSurveyRecord1.setProcessingResults("提交处理结果,提交方式:创建工单提交;处理结果:" + aftersalesProcessingResults.getResultType() + ";金额:" + aftersalesProcessingResults.getMoney()); + aftersaleSurveyRecordService.save(aftersaleSurveyRecord1); + workOrderEntity.setCompensationMoney(aftersalesProcessingResults.getMoney()); + aftersalesProcessingResultsService.save(aftersalesProcessingResults); + processingMoneyEntityList.stream().forEach(p -> { + p.setWorkOrderId(workOrderEntity.getId()); + p.setProcessingResultsId(aftersalesProcessingResults.getId()); + }); + aftersalesProcessingMoneyService.saveBatch(processingMoneyEntityList); + workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue()); + if (!Objects.isNull(aftersalesProcessingResultsDTO.getResultType())) { + workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue()); } - if (!collect1.isEmpty()) { - //添加 - completionRecordService.saveBatch(collect1); + workOrderEntity.setWarehouseServiceName(user.getNickName()); + isResult = true; + } else { + isResult = false; + } + //对处理方和责任方进行记录 + processorEntityList.stream().forEach(p -> { + p.setWorkOrderId(workOrderEntity.getId()); + p.setWarehouseId(workOrderEntity.getWarehouseId()); + p.setProcessingStatus(ProcessorProcessingStatusStatusConstant.daichuli.getValue()); + if (isResult) { + //存在处理结果提交方 + if (p.getBusinessId().equals(myCurrentWarehouse.getId()) && "2".equals(p.getTypesOf())) { + p.setProcessingStatus(ProcessorProcessingStatusStatusConstant.tijiaofang.getValue()); + } } -// completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); + }); + //添加创建方 + AftersalesProcessorEntity aftersalesProcessorEntity = new AftersalesProcessorEntity(); + aftersalesProcessorEntity.setWorkOrderId(workOrderEntity.getId()); + aftersalesProcessorEntity.setWarehouseId(workOrderEntity.getWarehouseId()); + aftersalesProcessorEntity.setProcessingStatus(ProcessorProcessingStatusStatusConstant.qitachuli.getValue()); + aftersalesProcessorEntity.setTypesOf(ProcessorTypesOfStatusConstant.ziji.getValue()); + aftersalesProcessorEntity.setBusinessName(myCurrentWarehouse.getName()); + aftersalesProcessorEntity.setBusinessId(myCurrentWarehouse.getId()); + aftersalesProcessorService.saveBatch(processorEntityList); + + switch (workOrderType) { + case "1": + case "3": + //需要校验图片decreaseImageEntityList + if (Objects.isNull(aftersalesWorkOrder.getDecreaseImageEntityList())) { + log.info(method + "aftersalesWorkOrder.getProcessorEntityList()参数缺失"); + return R.fail("参数缺失,请联系管理"); + //对图片进行保存 + } + List decreaseImageEntityList = aftersalesWorkOrder.getDecreaseImageEntityList(); + decreaseImageEntityList.stream().forEach(d -> { + d.setWorkOrderId(workOrderEntity.getId()); + d.setWarehouseId(myCurrentWarehouse.getId()); + }); + aftersalesDecreaseImageService.saveBatch(decreaseImageEntityList); + break; + case "2": + case "4": + case "5": + //公共参数无需校验 + break; + default: + log.info("未知的异常类型>>>>>>>>>>>>>>workOrderType:{}", workOrderType); + return R.fail("未知的异常类型"); } - //添加处理结果 - if (ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO())) { - addProcessingResults(aftersalesWorkOrder); + //判断是否进行处理结果提交 如果存在则需要对工单进行状态变更并保存处理结果 + return R.status(this.updateById(workOrderEntity)); + + } + + private boolean judgeIsWarehouseCustomerService(BladeUser user) { + R> roleNames = sysClient.getRoleNames(user.getRoleId()); + if (!roleNames.isSuccess()) { + return false; } + return roleNames.getData().contains(RoleConstant.WAREHOUSE_CUSTOMER_SERVICE.getName()); + } - return true; + private AftersalesProcessingResultsEntity generateAftersalesProcessingResultsEntity(List processingMoneyEntityList, AftersalesWorkOrderEntity workOrderEntity, String resultDescription) { + AftersalesProcessingResultsEntity aftersalesProcessingResultsEntity = new AftersalesProcessingResultsEntity(); + aftersalesProcessingResultsEntity.setWorkOrderId(workOrderEntity.getId()); + aftersalesProcessingResultsEntity.setWarehouseId(workOrderEntity.getWarehouseId()); + aftersalesProcessingResultsEntity.setResultDescription(resultDescription); + String resultType = processingMoneyEntityList.stream().map(AftersalesProcessingMoneyEntity::getResultName).collect(Collectors.joining(",")); + aftersalesProcessingResultsEntity.setResultType(resultType); + String compensationMethod = processingMoneyEntityList.stream().map(AftersalesProcessingMoneyEntity::getCompensationMethodName).collect(Collectors.joining(",")); + aftersalesProcessingResultsEntity.setCompensationMethod(compensationMethod); + String paymentUnit = processingMoneyEntityList.stream().map(AftersalesProcessingMoneyEntity::getPaymentUnit).collect(Collectors.joining(",")); + aftersalesProcessingResultsEntity.setPaymentUnit(paymentUnit); + BigDecimal totalMoney = processingMoneyEntityList.stream().map(AftersalesProcessingMoneyEntity::getMoney).collect(Collectors.toList()).stream().reduce(BigDecimal.ZERO, BigDecimal::add); + aftersalesProcessingResultsEntity.setMoney(totalMoney); + return aftersalesProcessingResultsEntity; } /** @@ -755,10 +769,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl aftersalesWorkOrder) { +// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); +// if (ObjectUtils.isNull(myCurrentWarehouse)) { +// throw new ServiceException("请选择仓库!!"); +// } BladeUser user = AuthUtil.getUser(); if (ObjectUtil.isNull(aftersalesWorkOrder)) { return false; } + R deptName = sysClient.getDeptName(Func.firstLong(user.getDeptId())); + aftersalesWorkOrder.forEach(v -> { if (ObjectUtils.isNull(v.getId())) { throw new ServiceException("异常工单ID不能为空!"); @@ -783,6 +803,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl>>>myCurrentWarehouse {}", myCurrentWarehouse); } @@ -1486,7 +1501,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list4 = completionRecordService.list(Wrappers.query().lambda() .eq(AftersalesCompletionRecordEntity::getWorkOrderId, aftersalesWorkOrder.getId()) ); @@ -1544,17 +1556,6 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl packageList = aftersalesWorkOrderDTO.getPackageList(); - if (Func.isEmpty(packageList)) { - return Resp.scanFail("请扫描包件信息", "请扫描包件信息"); - } - List aftersalesAbnormalPackageEntities = new ArrayList<>(); - for (AftersalesAbnormalPackageVO abnormalPackageVO : packageList) { - AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity = Func.copy(abnormalPackageVO, AftersalesAbnormalPackageEntity.class); - aftersalesAbnormalPackageEntities.add(aftersalesAbnormalPackageEntity); - } - //工单关联包件信息 - saveAftersalesWorkOrderDTO.setPackageEntityList(aftersalesAbnormalPackageEntities); - //保存工单所需责任人 - saveAftersalesWorkOrderDTO.setProcessorEntityList(aftersalesWorkOrderDTO.getProcessorEntityList()); - //工单图片 - saveAftersalesWorkOrderDTO.setDecreaseImageEntityList(aftersalesWorkOrderDTO.getDecreaseImageEntityList()); - //设置工单提交标识 - saveAftersalesWorkOrderDTO.setInitiationIdentification("PDA"); - //保存工单 - boolean b = saveOrUpdateOwn(saveAftersalesWorkOrderDTO); - - return Resp.scanSuccess("提交成功", "提交成功"); - } - /** * 查询客服信息 * @@ -1705,7 +1674,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list = aftersalesProcessorService.list(Wrappers.query().lambda() .eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) .eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) ); - Optional one = null; - //判断是不是客服 - AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); + List processorList = null; + if (!list.isEmpty()) { + processorList = list.stream().map(AftersalesProcessorEntity::getBusinessId).collect(Collectors.toList()); + } + if (processorList.isEmpty()) { + return R.fail("工单处理方查询错误"); + } + + StringBuffer stringBuffer = new StringBuffer(); AftersaleSurveyRecordDTO surveyRecordDTO = aftersalesWorkOrderDTO.getSurveyRecordDTO(); - BeanUtil.copyProperties(surveyRecordDTO, surveyRecordEntity); + //添加回复信息 + AftersaleSurveyRecordEntity surveyRecordEntity1 = new AftersaleSurveyRecordEntity(); + AftersaleSurveyRecordEntity surveyRecordEntity2 = new AftersaleSurveyRecordEntity(); + surveyRecordEntity1.setProcessorId(user.getUserId()); + surveyRecordEntity1.setProcessorName(user.getNickName()); + surveyRecordEntity1.setDifference("1"); + surveyRecordEntity1.setTypesOf("1"); + surveyRecordEntity1.setContent(surveyRecordDTO.getContent()); + surveyRecordEntity1.setWorkOrderId(workOrderEntity.getId()); + surveyRecordEntity1.setAddPeople(user.getUserName()); + surveyRecordEntity2.setProcessorId(user.getUserId()); + surveyRecordEntity2.setProcessorName(user.getNickName()); + surveyRecordEntity2.setDifference("1"); + surveyRecordEntity2.setTypesOf("1"); + surveyRecordEntity2.setContent(surveyRecordDTO.getContent()); + surveyRecordEntity2.setWorkOrderId(workOrderEntity.getId()); + surveyRecordEntity2.setAddPeople(user.getUserName()); + List processorEntityList = aftersalesWorkOrderDTO.getProcessorEntityList(); + boolean flag = false; if (ObjectUtils.isNotNull(myCurrentWarehouse)) { - one = list.stream().filter(i -> i.getBusinessId().equals(myCurrentWarehouse.getId()) && i.getBusinessName().equals(myCurrentWarehouse.getName())).findFirst(); - one.ifPresent(aftersalesProcessorEntity -> surveyRecordEntity.setProcessorId(aftersalesProcessorEntity.getId())); - surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getDepartmentName()); - surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent()); + surveyRecordEntity1.setAddDepartment(myCurrentWarehouse.getDepartmentName()); + surveyRecordEntity2.setAddDepartment(myCurrentWarehouse.getDepartmentName()); if (!Objects.isNull(surveyRecordDTO.getPictureUrl())) { - surveyRecordEntity.setPictureUrl(surveyRecordDTO.getPictureUrl()); + surveyRecordEntity1.setPictureUrl(surveyRecordDTO.getPictureUrl()); } + flag = processorEntityList.stream().anyMatch(a -> a.getBusinessId().equals(myCurrentWarehouse.getId())); } else { log.info("客服回复!!!{}", user.getUserName()); R deptName = sysClient.getDeptName(Func.firstLong(user.getDeptId())); - surveyRecordEntity.setAddDepartment(deptName.getData()); - surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent()); + surveyRecordEntity1.setAddDepartment(deptName.getData()); + surveyRecordEntity2.setAddDepartment(deptName.getData()); + } + + if (flag) { + //进行处理标记 + aftersalesProcessorService.update(Wrappers.update().lambda() + .eq(AftersalesProcessorEntity::getBusinessId, myCurrentWarehouse.getId()) + .eq(AftersalesProcessorEntity::getWorkOrderId, workOrderEntity.getId()) + .eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) + .eq(AftersalesProcessorEntity::getProcessingStatus, ProcessorProcessingStatusStatusConstant.daichuli.getValue()) + .set(AftersalesProcessorEntity::getProcessingStatus, ProcessorProcessingStatusStatusConstant.yichuli.getValue()) + ); } - //添加回复信息 - surveyRecordEntity.setProcessorId(user.getUserId()); - surveyRecordEntity.setProcessorName(user.getNickName()); - surveyRecordEntity.setDifference("1"); - surveyRecordEntity.setTypesOf("1"); - surveyRecordEntity.setAddPeople(user.getUserName()); - aftersaleSurveyRecordService.save(surveyRecordEntity); - //是否处理 - if (ObjectUtils.isNull(one) || !one.isPresent()) { - - //不是处理方 - if (aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()) { - //没有 全部 -// List collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList()); - //添加待回复信息 - list.forEach(i -> { - //没有处理方,修改已回复的处理方为待回复 - if (ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(i.getProcessingStatus())) { - //已处理 - AftersalesProcessorEntity processor = new AftersalesProcessorEntity(); - processor.setId(i.getId()); - processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.daichuli.getValue()); - aftersalesProcessorService.updateById(processor); - } - if (ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(i.getProcessingStatus())) { - AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO, i, surveyRecordEntity); - //添加待回复信息 - aftersalesReplyingPartyService.save(replyingPartyEntity); - } - }); - } else { - //添加或修改新的处理方 - surveyRecordDTO.setId(surveyRecordEntity.getId()); - surveyRecordDTO.setFollowWarehouseName(surveyRecordEntity.getFollowWarehouseName()); - surveyRecordDTO.setFollowWarehouseId(surveyRecordEntity.getFollowWarehouseId()); - chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO); + //进行比对是否存在有新增处理方 + List aaa = new ArrayList<>(); + for (int i = 0; i < processorEntityList.size(); i++) { + if (!processorList.contains(processorEntityList.get(i).getBusinessId())) { + //进行新增 + AftersalesProcessorEntity aftersalesProcessorEntity = processorEntityList.get(i); + aftersalesProcessorEntity.setWarehouseId(workOrderEntity.getWarehouseId()); + aftersalesProcessorEntity.setProcessingStatus(ProcessorProcessingStatusStatusConstant.daichuli.getValue()); + aftersalesProcessorService.save(aftersalesProcessorEntity); + aaa.add(aftersalesProcessorEntity.getBusinessName()); + } + if (processorList.indexOf(processorEntityList.get(i).getBusinessId()) >= 0){ + processorList.remove(processorList.indexOf(processorEntityList.get(i).getBusinessId())); } - } else { - AftersalesProcessorEntity processor1 = one.get(); - //修改处理方 处理状态 - updateProcessor(ProcessorProcessingStatusStatusConstant.yichuli.getValue(), processor1); - //修改回复信息 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("work_order_id", aftersalesWorkOrderDTO.getId()); - updateWrapper.eq("processor_id", processor1.getId()); - updateWrapper.eq("difference", "1"); - updateWrapper.set("difference", "2"); - updateWrapper.set("processed_by_id", user.getUserId()); - updateWrapper.set("processed_by_name", user.getUserName()); - aftersalesReplyingPartyService.update(updateWrapper); - //修改工单状态 - AftersalesWorkOrderEntity workOrderEntity1 = baseMapper.selectById(aftersalesWorkOrderDTO.getId()); - AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity(); - workOrderEntity.setId(aftersalesWorkOrderDTO.getId()); - workOrderEntity.setUpdateTime(new Date()); - workOrderEntity.setWarehouseServiceName(AuthUtil.getNickName()); - workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulizhong.getValue()); - baseMapper.updateById(workOrderEntity); - //添加或修改新的处理方 - chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO); - //修改处理方待回复信息 - List list1 = aftersalesReplyingPartyService.list(Wrappers.query().lambda() - .eq(AftersalesReplyingPartyEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) - .eq(AftersalesReplyingPartyEntity::getFollowWarehouseId, myCurrentWarehouse.getId()) - .eq(AftersalesReplyingPartyEntity::getDifference, '1') + } + if (!aaa.isEmpty()) { + stringBuffer.append("增加处理方-->[" + aaa.stream().collect(Collectors.joining(","))+"]").append(","); + } + if (!processorList.isEmpty()) { + //进行删除处理方 + aftersalesProcessorService.remove(Wrappers.query().lambda() + .eq(AftersalesProcessorEntity::getWorkOrderId, workOrderEntity.getId()) + .eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) + .in(AftersalesProcessorEntity::getBusinessId, processorList) ); - list1.forEach(i -> { - AftersalesReplyingPartyEntity replyingPartyEntity = new AftersalesReplyingPartyEntity(); - replyingPartyEntity.setId(i.getId()); - replyingPartyEntity.setDifference("2"); - replyingPartyEntity.setProcessedById(user.getUserId()); - replyingPartyEntity.setProcessedByName(user.getUserName()); - aftersalesReplyingPartyService.updateById(replyingPartyEntity); - }); + List warehousesByIds = warehouseClient.findWarehousesByIds(processorList); + if (!warehousesByIds.isEmpty()) { + //增加操作日志 + stringBuffer.append("取消处理方-->[" + warehousesByIds.stream().map(BasicdataWarehouseEntity::getName).collect(Collectors.joining(","))+"]").append(","); + } } - return true; + AftersalesWorkOrderEntity aftersalesWorkOrderEntity = new AftersalesWorkOrderEntity(); + aftersalesWorkOrderEntity.setId(workOrderEntity.getId()); + //维护工单状态和处理方信息 + if (WorkOrderStatusConstant.daichuli.getValue().equals(workOrderEntity.getWorkOrderStatus())){ + aftersalesWorkOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulizhong.getValue()); + } + String processedBy = processorEntityList.stream().map(AftersalesProcessorEntity::getBusinessName).collect(Collectors.joining(",")); + aftersalesWorkOrderEntity.setProcessedBy(processedBy); + this.updateById(aftersalesWorkOrderEntity); + if (!Objects.isNull(stringBuffer)){ + String string = stringBuffer.deleteCharAt(stringBuffer.lastIndexOf(",")).toString(); + surveyRecordEntity2.setContent(string); + surveyRecordEntity2.setProcessingResults(string); + aftersaleSurveyRecordService.save(surveyRecordEntity2); + } + surveyRecordEntity1.setContent(surveyRecordDTO.getContent()); + surveyRecordEntity1.setProcessingResults(surveyRecordDTO.getContent()); + aftersaleSurveyRecordService.save(surveyRecordEntity1); + return R.success("操作成功"); + + +// Optional one = null; +// //判断是不是客服 +// AftersaleSurveyRecordDTO surveyRecordDTO = aftersalesWorkOrderDTO.getSurveyRecordDTO(); +// BeanUtil.copyProperties(surveyRecordDTO, surveyRecordEntity); +// if (ObjectUtils.isNotNull(myCurrentWarehouse)) { +// one = list.stream().filter(i -> i.getBusinessId().equals(myCurrentWarehouse.getId()) && i.getBusinessName().equals(myCurrentWarehouse.getName())).findFirst(); +// one.ifPresent(aftersalesProcessorEntity -> surveyRecordEntity.setProcessorId(aftersalesProcessorEntity.getId())); +// surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getDepartmentName()); +// surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent()); +// if (!Objects.isNull(surveyRecordDTO.getPictureUrl())) { +// surveyRecordEntity.setPictureUrl(surveyRecordDTO.getPictureUrl()); +// } +// } else { +// log.info("客服回复!!!{}", user.getUserName()); +// R deptName = sysClient.getDeptName(Func.firstLong(user.getDeptId())); +// surveyRecordEntity.setAddDepartment(deptName.getData()); +// surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent()); +// } +// //添加回复信息 +// surveyRecordEntity.setProcessorId(user.getUserId()); +// surveyRecordEntity.setProcessorName(user.getNickName()); +// surveyRecordEntity.setDifference("1"); +// surveyRecordEntity.setTypesOf("1"); +// surveyRecordEntity.setAddPeople(user.getUserName()); +// aftersaleSurveyRecordService.save(surveyRecordEntity); +// //是否处理 +// if (ObjectUtils.isNull(one) || !one.isPresent()) { +// +// //不是处理方 +// if (aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()) { +// //没有 全部 +//// List collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList()); +// //添加待回复信息 +// list.forEach(i -> { +// //没有处理方,修改已回复的处理方为待回复 +// if (ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(i.getProcessingStatus())) { +// //已处理 +// AftersalesProcessorEntity processor = new AftersalesProcessorEntity(); +// processor.setId(i.getId()); +// processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.daichuli.getValue()); +// aftersalesProcessorService.updateById(processor); +// } +// if (ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(i.getProcessingStatus())) { +// AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO, i, surveyRecordEntity); +// //添加待回复信息 +// aftersalesReplyingPartyService.save(replyingPartyEntity); +// } +// }); +// } else { +// //添加或修改新的处理方 +// surveyRecordDTO.setId(surveyRecordEntity.getId()); +// surveyRecordDTO.setFollowWarehouseName(surveyRecordEntity.getFollowWarehouseName()); +// surveyRecordDTO.setFollowWarehouseId(surveyRecordEntity.getFollowWarehouseId()); +// chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO); +// } +// } else { +// AftersalesProcessorEntity processor1 = one.get(); +// //修改处理方 处理状态 +// updateProcessor(ProcessorProcessingStatusStatusConstant.yichuli.getValue(), processor1); +// //修改回复信息 +// UpdateWrapper updateWrapper = new UpdateWrapper<>(); +// updateWrapper.eq("work_order_id", aftersalesWorkOrderDTO.getId()); +// updateWrapper.eq("processor_id", processor1.getId()); +// updateWrapper.eq("difference", "1"); +// updateWrapper.set("difference", "2"); +// updateWrapper.set("processed_by_id", user.getUserId()); +// updateWrapper.set("processed_by_name", user.getUserName()); +// aftersalesReplyingPartyService.update(updateWrapper); +// //修改工单状态 +// AftersalesWorkOrderEntity workOrderEntity1 = baseMapper.selectById(aftersalesWorkOrderDTO.getId()); +// +// AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity(); +// workOrderEntity.setId(aftersalesWorkOrderDTO.getId()); +// workOrderEntity.setWarehouseServiceName(AuthUtil.getNickName()); +// if (WorkOrderStatusConstant.daichuli.getValue().equals(workOrderEntity1.getWorkOrderStatus())){ +// workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulizhong.getValue()); +// } +// this.updateById(workOrderEntity); +// //添加或修改新的处理方 +// chuLiFang(aftersalesWorkOrderDTO, myCurrentWarehouse, user, list, surveyRecordDTO); +// //修改处理方待回复信息 +// List list1 = aftersalesReplyingPartyService.list(Wrappers.query().lambda() +// .eq(AftersalesReplyingPartyEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) +// .eq(AftersalesReplyingPartyEntity::getFollowWarehouseId, myCurrentWarehouse.getId()) +// .eq(AftersalesReplyingPartyEntity::getDifference, '1') +// ); +// list1.forEach(i -> { +// AftersalesReplyingPartyEntity replyingPartyEntity = new AftersalesReplyingPartyEntity(); +// replyingPartyEntity.setId(i.getId()); +// replyingPartyEntity.setDifference("2"); +// replyingPartyEntity.setProcessedById(user.getUserId()); +// replyingPartyEntity.setProcessedByName(user.getUserName()); +// aftersalesReplyingPartyService.updateById(replyingPartyEntity); +// }); +// +// } +// return true; } /** @@ -2025,9 +2118,12 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl { AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity(); workOrderEntity.setId(i); @@ -2471,6 +2585,17 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl" + "确认处理结果:"); + aftersaleSurveyRecord1.setProcessingResults("确认处理结果:" + list.stream().map(AftersalesProcessingResultsEntity::getResultType).collect(Collectors.joining(","))); + aftersaleSurveyRecordService.save(aftersaleSurveyRecord1); }); return true; } @@ -2530,6 +2655,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl exportData = baseMapper.getBasicExportData(workOrderDTO, ids, warehouseIds); return exportData; @@ -2904,7 +3032,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list1 = Arrays.asList(strings); //查询所有的超时列表,包括已经超时的 List processorEntityList = baseMapper.overTimeAfterSalesList(); @@ -2913,17 +3041,17 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list = aftersalesOvertimeFineService.list(Wrappers.query().lambda() .eq(AftersalesOvertimeFineEntity::getBusinessId, processorEntity.getBusinessId()) @@ -2933,7 +3061,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl page) { + public R newPage(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query, Integer pageType) { if (ObjectUtil.isNotEmpty(workOrderQueryDTO.getStartCreateTime()) || ObjectUtil.isNotEmpty(workOrderQueryDTO.getEndCreateTime())) { boolean withinOneMonth = DateUtil.between(workOrderQueryDTO.getStartCreateTime(), workOrderQueryDTO.getEndCreateTime(), DateUnit.DAY) <= 60; if (!withinOneMonth) { throw new ServiceException("日期范伟不能超过两个月"); } - } else { - throw new ServiceException("导出时日期必填"); } - //查询当前登录人 - List warehouseList = warehouseClient.getMyWatchWarehouse(); - List warehouseIds = new ArrayList<>(); - if (!warehouseList.isEmpty()) { - warehouseIds.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList())) ; +// else { +// throw new ServiceException("搜索日期必填"); +// } + List myWatchWarehouse = warehouseClient.getMyWatchWarehouse(); + if (myWatchWarehouse.isEmpty()) { + return R.fail("当前登录人仓库信息获取错误"); + } + List warehouseIds = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + switch (pageType) { + case 1: + //全部 + IPage page1 = Condition.getPage(query); + IPage aftersalesWorkOrderAllPageVOIPage = baseMapper.selectAllWorkOrderPage(page1, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderAllPageVOIPage); + case 2: + //待回复 + if (warehouseIds.size() != 1) { + return R.fail("待回复列表需选择仓库进行查看"); + } + IPage page2 = Condition.getPage(query); + IPage aftersalesWorkOrderReplyPageVOIPage = baseMapper.selectReplyWorkOrderPage(page2, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderReplyPageVOIPage); + case 3: + //待处理 + IPage page3 = Condition.getPage(query); + IPage aftersalesWorkOrderWaitProcessPageVOIPage = baseMapper.selectProcessWorkOrderPage(page3, workOrderQueryDTO, warehouseIds, 0); + return R.data(aftersalesWorkOrderWaitProcessPageVOIPage); + case 4: + //处理中 + IPage page4 = Condition.getPage(query); + IPage aftersalesWorkOrderProcessPageVOIPage = baseMapper.selectProcessWorkOrderPage(page4, workOrderQueryDTO, warehouseIds, 1); + return R.data(aftersalesWorkOrderProcessPageVOIPage); + case 5: + //理赔金未出 + IPage page5 = Condition.getPage(query); + IPage aftersalesWorkOrderCompensationPageVOIPage = baseMapper.selectCompensationWorkOrderPage(page5, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderCompensationPageVOIPage); + case 6: + //处理完毕 + IPage page6 = Condition.getPage(query); + IPage aftersalesWorkOrderCompletePageVOIPage = baseMapper.selectCompleteWorkOrderPage(page6, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderCompletePageVOIPage); + case 7: + IPage page7 = Condition.getPage(query); + IPage selectCompleteWorkOrderPage = baseMapper.selectInterventioWorkOrderPage(page7, workOrderQueryDTO, warehouseIds); + return R.data(selectCompleteWorkOrderPage); + case 8: + //待审核 + IPage page8 = Condition.getPage(query); + IPage aftersalesWorkOrderExaminePageVOIPage = baseMapper.selectExamineWorkOrderPage(page8, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderExaminePageVOIPage); + case 9: + //完结 + IPage page9 = Condition.getPage(query); + IPage aftersalesWorkOrderEndPageVOIPage = baseMapper.selectEndWorkOrderPage(page9, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderEndPageVOIPage); + case 10: + //申述列表 + IPage page10 = Condition.getPage(query); + IPage aftersalesWorkOrderAppealPageVOIPage = baseMapper.selectAppealWorkOrderPage(page10, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderAppealPageVOIPage); + case 11: + //超时 + IPage page11 = Condition.getPage(query); + IPage aftersalesWorkOrderTimeOutPageVOIPage = baseMapper.selectTimeOutWorkOrderPage(page11, workOrderQueryDTO, warehouseIds); + return R.data(aftersalesWorkOrderTimeOutPageVOIPage); + } + + + return null; + } + + @Override + public void newExport(AftersalesWorkOrderQueryDTO workOrderQueryDTO, Query query, Integer pageType, HttpServletResponse response) { + if (ObjectUtil.isNotEmpty(workOrderQueryDTO.getStartCreateTime()) || ObjectUtil.isNotEmpty(workOrderQueryDTO.getEndCreateTime())) { + boolean withinOneMonth = DateUtil.between(workOrderQueryDTO.getStartCreateTime(), workOrderQueryDTO.getEndCreateTime(), DateUnit.DAY) <= 60; + if (!withinOneMonth) { + throw new ServiceException("日期范伟不能超过两个月"); + } } - IPage iPage = baseMapper.pageAllList(page, workOrderQueryDTO, warehouseIds); - return R.data(iPage); + List myWatchWarehouse = warehouseClient.getMyWatchWarehouse(); + if (myWatchWarehouse.isEmpty()) { + throw new ServiceException("当前登录人仓库信息获取错误"); + } + List warehouseIds = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + switch (pageType) { + case 1: + //全部 + List aftersalesWorkOrderAllExcelList = baseMapper.selectAllWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "全部异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "全部异常工单数据", aftersalesWorkOrderAllExcelList, AftersalesWorkOrderAllExcel.class); + break; + case 2: + //待回复 + if (warehouseIds.size() != 1) { + throw new ServiceException("待回复列表需选择仓库进行查看"); + } + List aftersalesWorkOrderReplyExcelList = baseMapper.selectReplyWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "待回复异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "待回复异常工单数据", aftersalesWorkOrderReplyExcelList, AftersalesWorkOrderReplyExcel.class); + break; + case 3: + //待处理 + List aftersalesWorkOrderProcessExcelList1 = baseMapper.selectProcessWorkOrderExcelData(workOrderQueryDTO, warehouseIds, 0); + ExcelUtil.export(response, "待处理异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "待处理异常工单数据", aftersalesWorkOrderProcessExcelList1, AftersalesWorkOrderProcessExcel.class); + break; + case 4: + //处理中 + List aftersalesWorkOrderProcessExcelList2 = baseMapper.selectProcessWorkOrderExcelData(workOrderQueryDTO, warehouseIds, 1); + ExcelUtil.export(response, "处理中异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "处理中异常工单数据", aftersalesWorkOrderProcessExcelList2, AftersalesWorkOrderProcessExcel.class); + break; + case 5: + //理赔金未出 + List aftersalesWorkOrderCompensationPageExcelList = baseMapper.selectCompensationWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "理赔金未出异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "理赔金未出异常工单数据", aftersalesWorkOrderCompensationPageExcelList, AftersalesWorkOrderCompensationPageExcel.class); + break; + case 6: + //处理完毕 + List aftersalesWorkOrderCompleteExcelList = baseMapper.selectCompleteWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "处理完毕异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "处理完毕异常工单数据", aftersalesWorkOrderCompleteExcelList, AftersalesWorkOrderCompleteExcel.class); + break; + case 7: + List aftersalesWorkOrderInterventionExcelList = baseMapper.selectInterventioWorkOrderExcelDta(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "客服介入异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "客服介入异常工单数据", aftersalesWorkOrderInterventionExcelList, AftersalesWorkOrderInterventionExcel.class); + break; + case 8: + //待审核 + List aftersalesWorkOrderExamineExcelList = baseMapper.selectExamineWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "待审核异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "待审核异常工单数据", aftersalesWorkOrderExamineExcelList, AftersalesWorkOrderExamineExcel.class); + break; + case 9: + //完结 + List aftersalesWorkOrderEndExcelList = baseMapper.selectEndWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "完结异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "完结异常工单数据", aftersalesWorkOrderEndExcelList, AftersalesWorkOrderEndExcel.class); + break; + case 10: + //申述列表 + List aftersalesWorkOrderAppealExcelList = baseMapper.selectAppealWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "申述列表异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "申述列表异常工单数据", aftersalesWorkOrderAppealExcelList, AftersalesWorkOrderAppealExcel.class); + break; + case 11: + //超时 + List aftersalesWorkOrderTimeOutExcelList = baseMapper.selectTimeOutWorkOrderExcelData(workOrderQueryDTO, warehouseIds); + ExcelUtil.export(response, "超时异常工单数据" + org.springblade.core.tool.utils.DateUtil.time(), "超时异常工单数据", aftersalesWorkOrderTimeOutExcelList, AftersalesWorkOrderTimeOutExcel.class); + break; + } + } + + @Override + public R updatePersonResponsible(Long id, List personResponsibleVOS) { + AftersalesWorkOrderEntity byId = this.getById(id); + if (Objects.isNull(byId)) { + return R.fail("查询异常工单计划错误"); + } + + //查询所有的责任人 + List entityList = aftersalesPersonResponsibleService.list(Wrappers.query().lambda().eq(AftersalesPersonResponsibleEntity::getWordOrderId, id)); + Map map = null; + if (!entityList.isEmpty()) { + map = entityList.stream().collect(Collectors.toMap(AftersalesPersonResponsibleEntity::getId, AftersalesPersonResponsibleEntity::getResponsibilityRatio)); + } + List saveData = personResponsibleVOS.stream().filter(f -> Objects.isNull(f.getId())).collect(Collectors.toList()); + if (!saveData.isEmpty()) { + List aftersalesPersonResponsibleEntityList = new ArrayList<>(); + for (AftersalesPersonResponsibleVO saveDatum : saveData) { + AftersalesPersonResponsibleEntity aftersalesPersonResponsibleEntity = BeanUtil.copyProperties(saveDatum, AftersalesPersonResponsibleEntity.class); + aftersalesPersonResponsibleEntityList.add(aftersalesPersonResponsibleEntity); + } + if (!aftersalesPersonResponsibleEntityList.isEmpty()) { + aftersalesPersonResponsibleService.saveBatch(aftersalesPersonResponsibleEntityList); + } + } + + List updateData = personResponsibleVOS.stream().filter(f -> !Objects.isNull(f.getId())).collect(Collectors.toList()); + if (!updateData.isEmpty()) { + for (AftersalesPersonResponsibleVO updateDatum : updateData) { + if (!Objects.isNull(map.get(updateDatum.getId()))) { + String string = map.get(updateDatum.getId()); + if (!updateDatum.getResponsibilityRatio().equals(string)) { + //需要进行修改 + AftersalesPersonResponsibleEntity aftersalesPersonResponsibleEntity = new AftersalesPersonResponsibleEntity(); + aftersalesPersonResponsibleEntity.setId(updateDatum.getId()); + aftersalesPersonResponsibleEntity.setResponsibilityRatio(updateDatum.getResponsibilityRatio()); + aftersalesPersonResponsibleService.updateById(aftersalesPersonResponsibleEntity); + } + } + } + } + + return R.success("操作成功"); + } + + + private List handleAftersalesPersonResponsibleDTO(List personResponsibleDTO, AftersalesWorkOrderEntity workOrderEntity) { + List aftersalesPersonResponsibleEntityList = new ArrayList<>(); + for (AftersalesPersonResponsibleDTO aftersalesPersonResponsibleDTO : personResponsibleDTO) { + AftersalesPersonResponsibleEntity aftersalesPersonResponsibleEntity = BeanUtil.copyProperties(aftersalesPersonResponsibleDTO, AftersalesPersonResponsibleEntity.class); + aftersalesPersonResponsibleEntity.setWordOrderId(workOrderEntity.getId()); + aftersalesPersonResponsibleEntityList.add(aftersalesPersonResponsibleEntity); + + } + return aftersalesPersonResponsibleEntityList; + } + + + /** + * 生成基础工单信息进行保存 + * + * @param myCurrentWarehouse + * @return + */ + private AftersalesWorkOrderEntity generateBasicAftersalesWorkOrderEntity(BasicdataWarehouseEntity myCurrentWarehouse, + BladeUser user, + String discoveryNode, + String workOrderType, + String investigationProcess) { + AftersalesWorkOrderEntity aftersalesWorkOrderEntity = new AftersalesWorkOrderEntity(); + aftersalesWorkOrderEntity.setWorkOrderNumber(afterMa()); + aftersalesWorkOrderEntity.setWarehouseId(myCurrentWarehouse.getId()); + aftersalesWorkOrderEntity.setWarehouseName(myCurrentWarehouse.getName()); + aftersalesWorkOrderEntity.setCeator(user.getNickName()); + aftersalesWorkOrderEntity.setDiscoveryNode(discoveryNode); + aftersalesWorkOrderEntity.setWorkOrderType(workOrderType); + aftersalesWorkOrderEntity.setInitiationIdentification("PC"); + aftersalesWorkOrderEntity.setInvestigationProcess(investigationProcess); + aftersalesWorkOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.daichuli.getValue()); + return aftersalesWorkOrderEntity; + } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index a42b23730..b0845cb23 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -1412,7 +1412,7 @@ AND ldrs.stock_article_status != 2 ) AS orderNum, SUM(ldr.reservation_num + ldr.reservation_stock_list_num) AS planNum, - (SELECT IFNULL(SUM(ldss.stock_quantity),0) FROM logpm_distribution_stock AS ldss WHERE ldss.is_deleted = 0 AND ldss.stockup_id = lds.id) AS scanNum, + (SELECT IFNULL(SUM(ldss.stock_quantity),0) FROM logpm_distribution_stock AS ldss WHERE ldss.is_deleted = 0 AND ldss.stockup_id = lds.id AND ldss.cancel_status != 1) AS scanNum, IFNULL(SUM(ldr.reservation_stock_list_num),0) AS inventoryNum FROM logpm_distribution_stockup AS lds @@ -1655,6 +1655,7 @@ logpm_distribution_stock AS ldss WHERE ldss.is_deleted = 0 + ldss.cancel_status != 1 AND ldss.reservation_id = ldbl.id ) AS scanNum, ( diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 0a29b6279..e4d3d9ded 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -5985,6 +5985,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl "1".equals(a.getType())); + if (anyMatch) { + List packageIds = updateData.stream().filter(a -> "1".equals(a.getType())).map(DistributionStockEntity::getParcelListId).collect(Collectors.toList()); + distributionParcelListService.update(Wrappers.update().lambda() + .in(DistributionParcelListEntity::getId,packageIds) + .set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.daibeihuo.getValue()) + ); + } + } } From ba76f5f997b630c75ce4132a8da87e0f5e5a9270 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 20 Jan 2025 15:02:41 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E9=80=81?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E6=89=98=E7=9B=98=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=A7=A3=E8=84=B1=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LogpmDataSearchServiceImpl.java | 5 ++- .../api/DistributionSignforAppController.java | 42 +++++++++--------- .../impl/DistributionSignforServiceImpl.java | 43 ++++++++++++++----- 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java index 6de6a265c..0609bc7de 100644 --- a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/LogpmDataSearchServiceImpl.java @@ -221,10 +221,11 @@ public class LogpmDataSearchServiceImpl implements ILogpmDataSearchService { } - + } + if(!nodeInfoVOList.isEmpty()){ + nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed()); } //对nodeInfoVOList集合中的作业时间 按照 时间倒序排序 - nodeInfoVOList.sort(Comparator.comparing(NodeInfoVO::getOperateTime).reversed()); result.setNodeInfoVOList(nodeInfoVOList); // 配送签收 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java index c7fc1b17f..fd95d0d0a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java @@ -322,27 +322,27 @@ public class DistributionSignforAppController { public R oneclick(@Valid @RequestBody DistributionSignforDTO distributionSignfor) { distributionSignfor.setIsClerk(false); R r = distributionSignforService.oneclickPDA(distributionSignfor); -// List packageCodes = (List) r.getData(); -// try { -// String orderPackageCodes = null; -// for (String packageCode : packageCodes) { -// if (StringUtils.isBlank(orderPackageCodes)) { -// orderPackageCodes = packageCode; -// } else { -// orderPackageCodes = orderPackageCodes + "," + packageCode; -// } -// } -// log.info("##############oneclick: 开始执行下架:{}", packageCodes); -// -// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); -// if(orderPackageCodes!=null){ -// updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托"); -// } -// log.info("##############oneclick: 结束执行下架:{}", packageCodes); -// -// } catch (Exception e) { -// log.warn("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes); -// } + List packageCodes = (List) r.getData(); + try { + String orderPackageCodes = null; + for (String packageCode : packageCodes) { + if (StringUtils.isBlank(orderPackageCodes)) { + orderPackageCodes = packageCode; + } else { + orderPackageCodes = orderPackageCodes + "," + packageCode; + } + } + log.info("##############oneclick: 开始执行下架:{}", packageCodes); + + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(orderPackageCodes!=null){ + updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托"); + } + log.info("##############oneclick: 结束执行下架:{}", packageCodes); + + } catch (Exception e) { + log.warn("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes); + } return r; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 4a621c137..c6fc16c05 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -6057,6 +6057,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl map = new HashMap<>(); - map.put("orderPackageCode", collected); - map.put("warehouseId", myCurrentWarehouse.getId()); - warehouseUpdownTypeClient.downDeliveryPackage(map); - trunklinePackageTrackLogClient.addPackageTrackLog(aaa); - } +// String collected = packageCodes.stream().distinct().collect(Collectors.joining(",")); +// log.info(method + "司机批量签收进行包件下架:{}", collected); +// Map map = new HashMap<>(); +// map.put("orderPackageCode", collected); +// map.put("warehouseId", myCurrentWarehouse.getId()); +// warehouseUpdownTypeClient.downDeliveryPackage(map); +// trunklinePackageTrackLogClient.addPackageTrackLog(aaa); +// } } //维护客户信息状态 // reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); @@ -6154,7 +6158,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildNodeFanoutMsgByOneClick(distributionDeliveryListEntity, reservationEntity, distributionLoadscaninvnEntityLists, distributionLoadscanEntityLists); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); Integer num = baseMapper.signforNum(distributionSignforEntity.getReservationId()); - return Resp.scanSuccess(num + "件", num + "件"); + return Resp.scanSuccessWithData(num + "件", num + "件",packageCodes); + } + + @NotNull + private static DistributionLoadscanEntity getDistributionLoadscanEntity(DistributionLoadscanEntity loadscanEntities) { + DistributionLoadscanEntity update = new DistributionLoadscanEntity(); + update.setId(loadscanEntities.getId()); + update.setSignforState(loadscanEntities.getSignforState()); + update.setReceivedQuantity(loadscanEntities.getReceivedQuantity()); + update.setOneClick(loadscanEntities.getOneClick()); + update.setOneQclick(loadscanEntities.getOneQclick()); + update.setSignforType(loadscanEntities.getSignforType()); + update.setSigningUser(loadscanEntities.getSigningUser()); + update.setSigningUserId(loadscanEntities.getSigningUserId()); + update.setReceivedQuantity(loadscanEntities.getReceivedQuantity()); + update.setSigningTime(loadscanEntities.getSigningTime()); + update.setMsg(loadscanEntities.getMsg()); + return update; } private DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user,boolean isDriverFlag) { From fd4878fc1c85764f172833af28ba01d18e8d2cbb Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 20 Jan 2025 15:49:48 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesProcessingMoneyEntity.java | 6 + .../entity/AftersalesWorkOrderEntity.java | 7 + .../vo/AftersalesWorkOrderAllPageVO.java | 49 ++++ .../vo/AftersalesWorkOrderAppealPageVO.java | 28 +++ ...AftersalesWorkOrderCompensationPageVO.java | 64 +++++ .../vo/AftersalesWorkOrderEndPageVO.java | 76 ++++++ .../vo/AftersalesWorkOrderExaminePageVO.java | 65 +++++ ...AftersalesWorkOrderInterventionPageVO.java | 65 +++++ .../vo/AftersalesWorkOrderProcessPageVO.java | 44 ++++ .../vo/AftersalesWorkOrderReplyPageVO.java | 44 ++++ .../vo/AftersalesWorkOrderTimeOutPageVO.java | 26 ++ .../AftersalesWorkOrderAppController.java | 42 ++-- .../dto/AftersalesWorkOrderQueryDTO.java | 4 + .../excel/AftersalesWorkOrderAllExcel.java | 190 +++++++++++++++ .../excel/AftersalesWorkOrderAppealExcel.java | 62 +++++ .../AftersalesWorkOrderCompensationExcel.java | 166 +++++++++++++ ...ersalesWorkOrderCompensationPageExcel.java | 0 .../AftersalesWorkOrderCompleteExcel.java | 166 +++++++++++++ .../excel/AftersalesWorkOrderEndExcel.java | 227 ++++++++++++++++++ .../AftersalesWorkOrderExamineExcel.java | 172 +++++++++++++ .../AftersalesWorkOrderInterventionExcel.java | 172 +++++++++++++ .../AftersalesWorkOrderProcessExcel.java | 159 ++++++++++++ .../excel/AftersalesWorkOrderReplyExcel.java | 159 ++++++++++++ .../AftersalesWorkOrderTimeOutExcel.java | 58 +++++ .../jobhandler/AftersalesXxlJob.java | 2 +- .../mapper/AftersalesWorkOrderMapper.java | 4 +- .../mapper/AftersalesWorkOrderMapper.xml | 20 +- .../service/IAftersalesWorkOrderService.java | 2 +- .../impl/AftersalesWorkOrderServiceImpl.java | 28 +-- .../DistributionDeliveryListServiceImpl.java | 2 + .../DistrilbutionBillLadingServiceImpl.java | 3 + 31 files changed, 2069 insertions(+), 43 deletions(-) create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java delete mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java index 5d00dfc93..7b52724f9 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java @@ -103,6 +103,12 @@ public class AftersalesProcessingMoneyEntity extends TenantEntity { */ @ApiModelProperty(value = "支付单位") private String paymentUnit; + + /** + * 工单Id + */ + @ApiModelProperty(value = "工单Id") + private Long workOrderId; /** * 类型 */ diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java index 49f386c39..03c8669eb 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java @@ -244,6 +244,13 @@ public class AftersalesWorkOrderEntity extends TenantEntity { @ApiModelProperty(value = "审核时间") @JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") private Date auditTime; + + /** + * 审核时间 + */ + @ApiModelProperty(value = "审核时间") + @JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + private Date commitTime; /** * 财务入账时间 */ diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java index e69de29bb..9583a03b6 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java @@ -0,0 +1,49 @@ +package com.logpm.aftersales.vo; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderAllPageVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String workOrderType; + private String workOrderTypeName; + private String discoveryNode; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatus; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date endCreateTime; + private Date updateTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String headquartersName; + private String overTime; + private String isAppeal; + private String appealStatus; + private String appealStatusName; + private String processNumber; + private Date entryTime; + private Date entryMonthTime; + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java index e69de29bb..e1dfbb0cd 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAppealPageVO.java @@ -0,0 +1,28 @@ +package com.logpm.aftersales.vo; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderAppealPageVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private Long workOrderId; + private String workOrderNumber; + private String workOrderStatus; + private String workOrderType; + private String warehouseName; + private String waybillNumber; + private String orderCode; + private String discoveryNode; + private String workOrderTypeName; + private String discoveryNodeName; + private String appealStatus; + private String appealStatusName; +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java index e69de29bb..80b042f4a 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompensationPageVO.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.vo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 客服异常工单 视图实体类 + * + * @author BladeX + * @since 2023-11-17 + */ +@Data +public class AftersalesWorkOrderCompensationPageVO { + + private Long id; + private String workOrderType; + private String discoveryNode; + private String workOrderStatus; + private String workOrderTypeName; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date updateTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String headquartersName; + private String businessName; + private String personResponsibleName; + private BigDecimal responsibilityRatio; + private String content; + + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java index e69de29bb..9f3e5d8e6 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.vo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 客服异常工单 视图实体类 + * + * @author BladeX + * @since 2023-11-17 + */ +@Data +public class AftersalesWorkOrderEndPageVO { + + private Long id; + private String workOrderType; + private String discoveryNode; + private String workOrderStatus; + private String workOrderTypeName; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date commitTime; + private Date arbitrationTime; + private Date auditTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String headquartersName; + private String indemnitorInfo; + private BigDecimal indemnitorMoney; + private String responsibleInfo; + private BigDecimal responsibleMoney; + private String businessName; + private String personResponsibleName; + private BigDecimal responsibilityRatio; + private String reasonArbitration; + private String isAppeal; + private String appealStatus; + private String appealStatusName; + private String processNumber; + private Date entryTime; + private Date entryMonthTime; + + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java index e69de29bb..df32ba643 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderExaminePageVO.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.vo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 客服异常工单 视图实体类 + * + * @author BladeX + * @since 2023-11-17 + */ +@Data +public class AftersalesWorkOrderExaminePageVO { + + private Long id; + private String workOrderType; + private String discoveryNode; + private String workOrderStatus; + private String workOrderTypeName; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date commitTime; + private Date overTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String headquartersName; + private String businessName; + private String personResponsibleName; + private BigDecimal responsibilityRatio; + private String content; + + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java index e69de29bb..fd7103dba 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderInterventionPageVO.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.vo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 客服异常工单 视图实体类 + * + * @author BladeX + * @since 2023-11-17 + */ +@Data +public class AftersalesWorkOrderInterventionPageVO { + + private Long id; + private String workOrderType; + private String discoveryNode; + private String workOrderStatus; + private String workOrderTypeName; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date endCreateTime; + private Date updateTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String businessName; + private String personResponsibleName; + private BigDecimal responsibilityRatio; + private String content; + private String isTimedOut; + + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java index e69de29bb..1aa5e4f72 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderProcessPageVO.java @@ -0,0 +1,44 @@ +package com.logpm.aftersales.vo; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderProcessPageVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String workOrderType; + private String workOrderTypeName; + private String discoveryNode; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatus; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date endCreateTime; + private Date updateTime; + private String resultType; + private String warehouseServiceName; + private String businessName; + private String personResponsibleName; + private String responsibilityRatio; + private String content; + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java index e69de29bb..720ee14f2 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderReplyPageVO.java @@ -0,0 +1,44 @@ +package com.logpm.aftersales.vo; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderReplyPageVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String workOrderType; + private String workOrderTypeName; + private String discoveryNode; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatus; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date endCreateTime; + private Date updateTime; + private String isTimedOut; + private String warehouseServiceName; + private String businessName; + private String personResponsibleName; + private String responsibilityRatio; + private String content; + +} diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java index e69de29bb..28e73d6c6 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderTimeOutPageVO.java @@ -0,0 +1,26 @@ +package com.logpm.aftersales.vo; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderTimeOutPageVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private Long workOrderId; + private String workOrderNumber; + private String workOrderType; + private String workOrderTypeName; + private String discoveryNode; + private String discoveryNodeName; + private BigDecimal money; + private String timeout; + private String processedBy; + private String remarks; +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java index bbee62746..9fbad0966 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java @@ -22,27 +22,27 @@ public class AftersalesWorkOrderAppController { private final IAftersalesWorkOrderService aftersalesWorkOrderService; - @PostMapping("/addWorkOrder") - public R addWorkOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ - aftersalesWorkOrderDTO.setInitiationIdentification("PDA"); - return R.data(aftersalesWorkOrderService.addWorkOrder(aftersalesWorkOrderDTO)); - } - - - @PostMapping("/aftersalesPackageScan") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "工单包件扫描", notes = "传入aftersalesAppeal") - public R> aftersalesPackageScan(@RequestBody AftersalesPackageScanDTO aftersalesPackageScanDTO){ - return R.data(aftersalesWorkOrderService.aftersalesPackageScan(aftersalesPackageScanDTO)); - } - - - @PostMapping("/saveAfterSalesOrder") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "PDA保存异常工单", notes = "传入aftersalesAppeal") - public R saveAfterSalesOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ - return aftersalesWorkOrderService.saveAfterSalesOrder(aftersalesWorkOrderDTO); - } +// @PostMapping("/addWorkOrder") +// public R addWorkOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ +// aftersalesWorkOrderDTO.setInitiationIdentification("PDA"); +// return R.data(aftersalesWorkOrderService.addWorkOrder(aftersalesWorkOrderDTO)); +// } + + +// @PostMapping("/aftersalesPackageScan") +// @ApiOperationSupport(order = 1) +// @ApiOperation(value = "工单包件扫描", notes = "传入aftersalesAppeal") +// public R> aftersalesPackageScan(@RequestBody AftersalesPackageScanDTO aftersalesPackageScanDTO){ +// return R.data(aftersalesWorkOrderService.aftersalesPackageScan(aftersalesPackageScanDTO)); +// } + + +// @PostMapping("/saveAfterSalesOrder") +// @ApiOperationSupport(order = 1) +// @ApiOperation(value = "PDA保存异常工单", notes = "传入aftersalesAppeal") +// public R saveAfterSalesOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ +// return aftersalesWorkOrderService.saveAfterSalesOrder(aftersalesWorkOrderDTO); +// } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java index 3bfcc834e..9ae8c14c7 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderQueryDTO.java @@ -36,6 +36,9 @@ public class AftersalesWorkOrderQueryDTO extends AftersalesWorkOrderEntity { private String workOrderType; private String discoveryNode; + private String resultType; + private String businessName; + private String personResponsibleName; private String workOrderNumber; private String waybillNumber; private String orderCode; @@ -46,6 +49,7 @@ public class AftersalesWorkOrderQueryDTO extends AftersalesWorkOrderEntity { private String workOrderStatus; private String processedBy; private String ceator; + private String exportIds; private Date startCreateTime; private Date endCreateTime; private Date createTime; diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java index e69de29bb..bdd0801d8 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAllExcel.java @@ -0,0 +1,190 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class AftersalesWorkOrderAllExcel implements Serializable { + private static final long serialVersionUID = 1L; + + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 最晚处理时间 + */ + @ColumnWidth(20) + @ExcelProperty("最晚处理时间") + private Date endCreateTime; + /** + * 最新操作时间 + */ + @ColumnWidth(20) + @ExcelProperty("最新操作时间") + private Date updateTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 总部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("总部处理客服") + private String headquartersName; + /** + * 完结时间 + */ + @ColumnWidth(20) + @ExcelProperty("完结时间") + private String overTime; + /** + * 是否申诉 + */ + @ColumnWidth(20) + @ExcelProperty("是否申诉") + private String isAppeal; + /** + * 申诉状态 + */ + @ColumnWidth(20) + @ExcelProperty("申诉状态") + private String appealStatusName; + /** + * 钉钉号 + */ + @ColumnWidth(20) + @ExcelProperty("钉钉号") + private String processNumber; + /** + * 财务入账时间 + */ + @ColumnWidth(20) + @ExcelProperty("财务入账时间") + private Date entryTime; + /** + * 财务入账月份 + */ + @ColumnWidth(20) + @ExcelProperty("财务入账月份") + private Date entryMonthTime; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java index e69de29bb..f7a91bc17 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java @@ -0,0 +1,62 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class AftersalesWorkOrderAppealExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("申诉状态") + private String appealStatusName; +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java new file mode 100644 index 000000000..53f4af0d2 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationExcel.java @@ -0,0 +1,166 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderCompensationExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 最新操作时间 + */ + @ColumnWidth(20) + @ExcelProperty("最新操作时间") + private Date updateTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 总部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("总部处理客服") + private String headquartersName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompensationPageExcel.java deleted file mode 100644 index e69de29bb..000000000 diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java index e69de29bb..22512ba07 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderCompleteExcel.java @@ -0,0 +1,166 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderCompleteExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 工单提交时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单提交时间") + private Date commitTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 总部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("总部处理客服") + private String headquartersName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 金额/占比 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java index e69de29bb..3b0ce0908 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java @@ -0,0 +1,227 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderEndExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 工单提交时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单提交时间") + private Date commitTime; + private Date arbitrationTime; + /** + * 工单提交时间 + */ + @ColumnWidth(20) + @ExcelProperty("审核时间") + private Date auditTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 总部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("总部处理客服") + private String headquartersName; + /** + * 赔款方信息 + */ + @ColumnWidth(20) + @ExcelProperty("赔款方信息") + private String indemnitorInfo; + /** + * 赔款方总金额 + */ + @ColumnWidth(20) + @ExcelProperty("赔款方总金额") + private BigDecimal indemnitorMoney; + /** + * 受款方信息 + */ + @ColumnWidth(20) + @ExcelProperty("受款方信息") + private String responsibleInfo; + /** + * 受款方总金额 + */ + @ColumnWidth(20) + @ExcelProperty("受款方总金额") + private BigDecimal responsibleMoney; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 金额/占比 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比222") + private String reasonArbitration; + /** + * 是否申诉 + */ + @ColumnWidth(20) + @ExcelProperty("是否申诉") + private String isAppeal; + /** + * 是否申诉 + */ + @ColumnWidth(20) + @ExcelProperty("申诉状态") + private String appealStatusName; + /** + * 钉钉号 + */ + @ColumnWidth(20) + @ExcelProperty("钉钉号") + private String processNumber; + /** + * 财务入账时间 + */ + @ColumnWidth(20) + @ExcelProperty("财务入账时间") + private Date entryTime; + /** + * 财务入账月份 + */ + @ColumnWidth(20) + @ExcelProperty("财务入账月份") + private Date entryMonthTime; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java index e69de29bb..1fc8162e2 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderExamineExcel.java @@ -0,0 +1,172 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderExamineExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 工单提交时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单提交时间") + private Date commitTime; + /** + * 完结时间 + */ + @ColumnWidth(20) + @ExcelProperty("完结时间") + private Date overTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 总部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("总部处理客服") + private String headquartersName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java index e69de29bb..880067cbd 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderInterventionExcel.java @@ -0,0 +1,172 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderInterventionExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 最晚处理时间 + */ + @ColumnWidth(20) + @ExcelProperty("最晚处理时间") + private Date endCreateTime; + /** + * 最新操作时间 + */ + @ColumnWidth(20) + @ExcelProperty("最新操作时间") + private Date updateTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果--理赔金额") + private BigDecimal money; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("是否超时") + private String isTimedOut; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java index e69de29bb..0248773ad 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderProcessExcel.java @@ -0,0 +1,159 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class AftersalesWorkOrderProcessExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 最晚处理时间 + */ + @ColumnWidth(20) + @ExcelProperty("最晚处理时间") + private Date endCreateTime; + /** + * 最新操作时间 + */ + @ColumnWidth(20) + @ExcelProperty("最新操作时间") + private Date updateTime; + /** + * 处理结果 + */ + @ColumnWidth(20) + @ExcelProperty("处理结果") + private String resultType; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java index e69de29bb..c72e21284 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderReplyExcel.java @@ -0,0 +1,159 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class AftersalesWorkOrderReplyExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 工单创建仓 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建仓") + private String warehouseName; + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 运单号 + */ + @ColumnWidth(20) + @ExcelProperty("运单号") + private String waybillNumber; + /** + * 订单自编号 + */ + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; + /** + * 包条码 + */ + @ColumnWidth(20) + @ExcelProperty("包条码") + private String packageCode; + /** + * 品牌 + */ + @ColumnWidth(20) + @ExcelProperty("品牌") + private String brandName; + /** + * 商场名称 + */ + @ColumnWidth(20) + @ExcelProperty("商场名称") + private String waybillMall; + /** + * 一级品 + */ + @ColumnWidth(20) + @ExcelProperty("一级品") + private String first; + /** + * 二级品 + */ + @ColumnWidth(20) + @ExcelProperty("二级品") + private String secondary; + /** + * 三级品 + */ + @ColumnWidth(20) + @ExcelProperty("三级品") + private String thirdProduct; + /** + * 工单状态 + */ + @ColumnWidth(20) + @ExcelProperty("工单状态") + private String workOrderStatusName; + /** + * 工单处理方 + */ + @ColumnWidth(20) + @ExcelProperty("工单处理方") + private String processedBy; + /** + * 责任方 + */ + @ColumnWidth(20) + @ExcelProperty("责任方") + private String responsiblePerson; + /** + * 工单创建时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单创建时间") + private Date createTime; + /** + * 最晚处理时间 + */ + @ColumnWidth(20) + @ExcelProperty("最晚处理时间") + private Date endCreateTime; + /** + * 最新操作时间 + */ + @ColumnWidth(20) + @ExcelProperty("最新操作时间") + private Date updateTime;; + /** + * 是否超时 + */ + @ColumnWidth(20) + @ExcelProperty("是否超时") + private String isTimedOut; + /** + * 营业部处理客服 + */ + @ColumnWidth(20) + @ExcelProperty("营业部处理客服") + private String warehouseServiceName; + /** + * 内部责任方 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任方") + private String businessName; + /** + * 内部责任人 + */ + @ColumnWidth(20) + @ExcelProperty("内部责任人") + private String personResponsibleName; + /** + * 金额/占比 + */ + @ColumnWidth(20) + @ExcelProperty("金额/占比") + private String responsibilityRatio; + /** + * 最新回复内容 + */ + @ColumnWidth(20) + @ExcelProperty("最新回复内容") + private String content; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java index e69de29bb..b24d2c23a 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderTimeOutExcel.java @@ -0,0 +1,58 @@ +package com.logpm.aftersales.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class AftersalesWorkOrderTimeOutExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 异常工单号 + */ + @ColumnWidth(20) + @ExcelProperty("异常工单号") + private String workOrderNumber; + /** + * 异常类型 + */ + @ColumnWidth(20) + @ExcelProperty("异常类型") + private String workOrderTypeName; + /** + * 发现节点 + */ + @ColumnWidth(20) + @ExcelProperty("发现节点") + private String discoveryNodeName; + /** + * 金额 + */ + @ColumnWidth(20) + @ExcelProperty("金额") + private BigDecimal money; + /** + * 超时时间 + */ + @ColumnWidth(20) + @ExcelProperty("超时时间") + private String timeout; + /** + * 处理方 + */ + @ColumnWidth(20) + @ExcelProperty("处理方") + private String processedBy; + /** + * 备注 + */ + @ColumnWidth(20) + @ExcelProperty("备注") + private String remarks; + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java index ef6634f46..74cecb66e 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/jobhandler/AftersalesXxlJob.java @@ -75,7 +75,7 @@ public class AftersalesXxlJob { @XxlJob("overTimeAfterSales") public ReturnT overTimeAfterSales(String param) throws Exception { logger.info("修改预账单工单是否可以申述>>>>>>>>{}", param); - aftersalesWorkOrderService.overTimeAfterSales(); + aftersalesWorkOrderService.overTimeAfterSales(param); return ReturnT.SUCCESS; } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java index f904c81b6..278ff7a97 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java @@ -130,7 +130,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper overTimeAfterSalesList(); + List overTimeAfterSalesList(@Param("timeout") String timeout); /** @@ -212,7 +212,7 @@ public interface AftersalesWorkOrderMapper extends BaseMapper selectCompensationWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); + List selectCompensationWorkOrderExcelData(@Param("param")AftersalesWorkOrderQueryDTO workOrderQueryDTO,@Param("warehouseIds") List warehouseIds); /** * 处理完毕导出数据 diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index c77671792..f9e8f037f 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -1251,7 +1251,7 @@ lbp.types_of = 2 AND lbp.processing_status IN ('1','3') AND lbp.is_deleted = 0 - AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(now(),'%y%m%d')) <= -3 + AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(now(),'%y%m%d')) <= #{timeout} + select + logistics_code, + app_key, + tenant_code, + login_account, + authorization_header + from jp_factory_auth + where + company_code = #{companyCode} + + diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java index cfd8921b0..d660f759c 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/mq/FactoryOrderListener.java @@ -1,53 +1,20 @@ package com.logpm.factorydata.jinpai.mq; -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.CharsetUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.core.util.URLUtil; -import cn.hutool.json.JSONArray; -import cn.hutool.json.JSONUtil; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.logpm.factorydata.base.feign.IFactoryDataBaseClient; -import com.logpm.factorydata.enums.SaxStatusEnums; -import com.logpm.factorydata.feign.IFactoryDataClient; -import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity; -import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; -import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; -import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; -import com.logpm.factorydata.jinpai.entity.PushOrderDetailEntity; -import com.logpm.factorydata.jinpai.entity.PushOrderEntity; -import com.logpm.factorydata.jinpai.enums.DimensionEnums; -import com.logpm.factorydata.jinpai.service.DeliveryNoteService; -import com.logpm.factorydata.jinpai.service.FactoryOrderLogService; -import com.logpm.factorydata.jinpai.service.OrderInfoService; -import com.logpm.factorydata.jinpai.service.PackageInfoService; -import com.logpm.factorydata.jinpai.service.PushOrderDetailService; -import com.logpm.factorydata.jinpai.service.PushOrderService; -import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; -import com.logpm.factorydata.jinpai.vo.OrderInfoVO; -import com.logpm.factorydata.jinpai.vo.PackageCategoryVO; -import com.logpm.factorydata.jinpai.vo.PackageInfoVO; -import com.logpm.factorydata.jinpai.vo.PushOrderDetailVO; -import com.logpm.factorydata.jinpai.vo.PushOrderVO; +import com.logpm.factorydata.jinpai.service.MqWorkerService; +import com.rabbitmq.client.Channel; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.factorydata.FactoryDataConstants; -import org.springblade.core.redis.cache.BladeRedis; 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.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.io.IOException; /** * 监听索菲亚订单数据 @@ -60,216 +27,46 @@ import java.util.Map; @AllArgsConstructor public class FactoryOrderListener { - private final PushOrderService pushOrderService; - private final PushOrderDetailService pushOrderDetailService; - private final DeliveryNoteService deliveryNoteService; - private final OrderInfoService orderInfoService; - private final PackageInfoService packageInfoService; - private final FactoryOrderLogService logService; - - private final BladeRedis bladeRedis; - private final IFactoryDataBaseClient baseClient; - private final IFactoryDataClient factoryDataClient; + private final MqWorkerService mqWorkerService; @RabbitListener(bindings = @QueueBinding( - value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_ORDER), + value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_SHIPMENT), exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC), - key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_ORDER - )) - @Transactional(rollbackFor = Exception.class) - public void factoryOrder(String msg) { - log.info("处理金牌订单:{}", msg); - if (StrUtil.isEmpty(msg)) { - log.error("消息内容为空"); - return; - } - FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class); - if (ObjectUtil.isEmpty(logEntity)) { - log.error("消息内容为空"); - return; + key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_SHIPMENT + ), ackMode = "MANUAL") + public void factoryShipment(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) { + log.info("处理金牌工厂订单:{}", msg); + try { + mqWorkerService.factoryShipment(msg); + } catch (Exception e) { + e.printStackTrace(); + log.error("处理金牌工厂订单失败: {}", e.getMessage()); } - // 去 minio 下载文件到本地,然后解析文件内容为实体对象 - List deliveryNoteVOS = null; - List orderInfoVOS = null; - List packageInfoVOS = null; - PushOrderVO pushOrderVO = null; - Long logId = logEntity.getId(); - String logUrl = logEntity.getLogUrl(); - // 1 订单 2 订单明细 3 包件 - Integer dimension = logEntity.getDimension(); - if (StrUtil.isNotEmpty(logUrl)) { - List res = new ArrayList<>(); - FileUtil.readLines(URLUtil.url(logUrl), CharsetUtil.CHARSET_UTF_8, res); - if (CollUtil.isNotEmpty(res)) { - String content = res.get(0); - if (StrUtil.isNotEmpty(content)) { - // 拉取的数据 - if (ObjectUtil.equal(logEntity.getType(), 1)) { - if (ObjectUtil.equal(dimension, DimensionEnums.ORDER.getCode())) { - deliveryNoteVOS = new JSONArray(content).toList(DeliveryNoteVO.class); - } - if (ObjectUtil.equal(dimension, DimensionEnums.ORDER_DETAIL.getCode())) { - orderInfoVOS = new JSONArray(content).toList(OrderInfoVO.class); - } - if (ObjectUtil.equal(dimension, DimensionEnums.PACKAGE.getCode())) { - packageInfoVOS = new JSONArray(content).toList(PackageInfoVO.class); - } - } else if (ObjectUtil.equal(logEntity.getType(), 2)) { - // 推送的数据 - pushOrderVO = JSONUtil.toBean(content, PushOrderVO.class); - } - } - } + try { + channel.basicAck(tag, false); + } catch (IOException e) { + throw new RuntimeException(e); } - if (ObjectUtil.equal(logEntity.getType(), 1)) { - pullData(deliveryNoteVOS, orderInfoVOS, packageInfoVOS, logEntity); - } else if (ObjectUtil.equal(logEntity.getType(), 2)) { - pushData(pushOrderVO, logEntity); - } - } - private void pushData(PushOrderVO vo, FactoryOrderLogEntity logEntity) { - if (ObjectUtil.isNotEmpty(vo)) { - // 1 解析数据保存入库 - // 装车单号唯一 - Long logId = logEntity.getId(); - String truckNo = vo.getTransportNo(); - List list = pushOrderService.list(Wrappers.lambdaQuery().eq(PushOrderEntity::getTransportNo, truckNo)); - if (CollUtil.isNotEmpty(list)) { - log.error("装车单号{} 数据已经处理过了, logId: {}", truckNo, logId); - return; - } - vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); - pushOrderService.save(vo); - List orderInfos = vo.getItems(); - if (CollUtil.isNotEmpty(orderInfos)) { - List infoEntities = new ArrayList<>(); - for (PushOrderDetailVO orderInfo : orderInfos) { - PushOrderDetailEntity orderInfoEntity = new PushOrderDetailEntity(); - BeanUtil.copyProperties(orderInfo, orderInfoEntity); - orderInfoEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); - orderInfoEntity.setOrderId(vo.getId().toString()); - List boxCodes = orderInfo.getBoxCodes(); - if (CollUtil.isNotEmpty(boxCodes)) { - orderInfoEntity.setBoxCodeList(JSONUtil.toJsonStr(boxCodes)); - } - List boxDetails = orderInfo.getBoxDetails(); - if (CollUtil.isNotEmpty(boxDetails)) { - orderInfoEntity.setBoxDetailList(JSONUtil.toJsonStr(boxDetails)); - } - infoEntities.add(orderInfoEntity); - } - pushOrderDetailService.saveBatch(infoEntities); - } - // 2 构建暂存单,发送 mq 消息 - FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity(); - logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode()); - logEntity1.setId(logId); - logService.saveOrUpdate(logEntity1); - // 处理暂存单 - deliveryNoteService.buildAdvance(vo); - } - } - - private void pullData(List deliveryNoteVOS, List orderInfoVOS, List packageInfoVOS, FactoryOrderLogEntity logEntity) { - if (CollUtil.isNotEmpty(deliveryNoteVOS)) { - List entities = new ArrayList<>(); - List orderCodes = new ArrayList<>(); - for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) { - orderCodes.add(deliveryNoteVO.getOrderId()); - } - List list = deliveryNoteService.list(Wrappers.lambdaQuery() - .in(DeliveryNoteEntity::getOrderId, orderCodes)); - Map map = new HashMap<>(); - if (CollUtil.isNotEmpty(list)) { - // 将list中的数据封装到map中 - list.forEach(item -> { - map.put(item.getOrderId(), item.getOrderId()); - }); - } - for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) { - if (map.containsKey(deliveryNoteVO.getOrderId())) { - log.error("订单号:{},已推送过了", deliveryNoteVO.getOrderId()); - continue; - } - DeliveryNoteEntity deliveryNoteEntity = new DeliveryNoteEntity(); - BeanUtil.copyProperties(deliveryNoteVO, deliveryNoteEntity); - deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); - entities.add(deliveryNoteEntity); - } - if (CollUtil.isNotEmpty(entities)) { - deliveryNoteService.saveBatch(entities); - } - } - if (CollUtil.isNotEmpty(orderInfoVOS)) { - List entities = new ArrayList<>(); - List orderCodes = new ArrayList<>(); - for (OrderInfoVO orderInfoVO : orderInfoVOS) { - orderCodes.add(orderInfoVO.getOrderId()); - } - List list = orderInfoService.list(Wrappers.lambdaQuery() - .in(OrderInfoEntity::getOmsExtOrderNo, orderCodes)); - Map map = new HashMap<>(); - if (CollUtil.isNotEmpty(list)) { - // 将list中的数据封装到map中 - list.forEach(item -> { - map.put(item.getOmsExtOrderNo(), item.getOmsExtOrderNo()); - }); - } - for (OrderInfoVO vo : orderInfoVOS) { - if (map.containsKey(vo.getOmsExtOrderNo())) { - log.error("DD单号:{},已推送过了", vo.getOmsExtOrderNo()); - continue; - } - OrderInfoEntity deliveryNoteEntity = new OrderInfoEntity(); - BeanUtil.copyProperties(vo, deliveryNoteEntity); - deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); - entities.add(deliveryNoteEntity); - } - if (CollUtil.isNotEmpty(entities)) { - orderInfoService.saveBatch(entities); - } + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FactoryDataConstants.Mq.Queues.JP_FACTORY_ORDER), + exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER, type = ExchangeTypes.TOPIC), + key = FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_ORDER + ), ackMode = "MANUAL") + public void factoryOrder(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) { + log.info("处理金牌订单:{}", msg); + try { + mqWorkerService.factoryOrder(msg); + } catch (Exception e) { + e.printStackTrace(); + log.error("处理金牌订单失败: {}", e.getMessage()); } - if (CollUtil.isNotEmpty(packageInfoVOS)) { - List entities = new ArrayList<>(); - List orderCodes = new ArrayList<>(); - List packageCodes = new ArrayList<>(); - for (PackageInfoVO orderInfoVO : packageInfoVOS) { - orderCodes.add(orderInfoVO.getOmsExtOrderNo()); - packageCodes.add(orderInfoVO.getExtBoxCode()); - } - List list = packageInfoService.list(Wrappers.lambdaQuery() - .in(PackageInfoEntity::getOmsExtOrderNo, orderCodes) - .in(PackageInfoEntity::getExtBoxCode, packageCodes) - ); - Map map = new HashMap<>(); - if (CollUtil.isNotEmpty(list)) { - // 将list中的数据封装到map中 - list.forEach(item -> { - map.put(item.getOmsExtOrderNo() + item.getExtBoxCode(), item.getOmsExtOrderNo()); - }); - } - for (PackageInfoVO vo : packageInfoVOS) { - if (map.containsKey(vo.getOmsExtOrderNo() + vo.getExtBoxCode())) { - log.error("DD单号:{} + 箱码:{},已推送过了", vo.getOmsExtOrderNo(), vo.getExtBoxCode()); - continue; - } - PackageInfoEntity entity = new PackageInfoEntity(); - BeanUtil.copyProperties(vo, entity); - entity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); - entities.add(entity); - } - if (CollUtil.isNotEmpty(entities)) { - packageInfoService.saveBatch(entities); - } + try { + channel.basicAck(tag, false); + } catch (IOException e) { + throw new RuntimeException(e); } - // 处理暂存单 通过定时任务扫描的方式判定是否齐套 然后创建暂存单 - FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity(); - logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode()); - logEntity1.setId(logEntity.getId()); - logService.saveOrUpdate(logEntity1); } - } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java index 85ffbdd70..cbb3d258d 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java @@ -69,4 +69,10 @@ public class JinPaiProperties { private Map warehouse; + /** auth过期时间 */ + private Long authTime; + + /** key */ + private String auth; + } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java index 5aa41fb2b..3e40650f9 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/DeliveryNoteService.java @@ -4,6 +4,7 @@ import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity; import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO; import com.logpm.factorydata.jinpai.vo.OrderInfoVO; import com.logpm.factorydata.jinpai.vo.PackageInfoVO; import com.logpm.factorydata.jinpai.vo.PushOrderVO; @@ -34,4 +35,6 @@ public interface DeliveryNoteService extends BaseService { void buildAdvance(PushOrderVO vo); void buildAdvancePull(Map> packageInfoEntityMap, Map deliveryNoteEntityMap, Map orderInfoEntityMap); + + void buildFactoryAdvance(JpFactoryShipmentVO vo); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryOrderService.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryOrderService.java new file mode 100644 index 000000000..3cfdf9980 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryOrderService.java @@ -0,0 +1,14 @@ +package com.logpm.factorydata.jinpai.service; + +import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * 金牌工厂订单 服务类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +public interface JpFactoryOrderService extends BaseService { + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryPackageService.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryPackageService.java new file mode 100644 index 000000000..9607e26f6 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryPackageService.java @@ -0,0 +1,14 @@ +package com.logpm.factorydata.jinpai.service; + +import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * 金牌工厂包件 服务类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +public interface JpFactoryPackageService extends BaseService { + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryShipmentService.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryShipmentService.java new file mode 100644 index 000000000..87774a1fb --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/JpFactoryShipmentService.java @@ -0,0 +1,19 @@ +package com.logpm.factorydata.jinpai.service; + +import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity; +import com.logpm.factorydata.jinpai.vo.FactoryAuthVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO; +import org.springblade.core.mp.base.BaseService; + +/** + * 金牌工厂发货单 服务类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +public interface JpFactoryShipmentService extends BaseService { + + FactoryAuthVO findFactoryAuth(String companyCode); + + String shipment(JpFactoryShipmentVO bean); +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/MqWorkerService.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/MqWorkerService.java new file mode 100644 index 000000000..be137519d --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/MqWorkerService.java @@ -0,0 +1,14 @@ +package com.logpm.factorydata.jinpai.service; + +/** + * 消息队列工作类 服务类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +public interface MqWorkerService { + + void factoryShipment(String msg); + + void factoryOrder(String msg); +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java index da9d8851b..ed57fe6c5 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java @@ -24,6 +24,9 @@ import com.logpm.factorydata.jinpai.mapper.DeliveryNoteMapper; import com.logpm.factorydata.jinpai.service.DeliveryNoteService; import com.logpm.factorydata.jinpai.service.FactoryOrderLogService; import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryOrderVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryPackageVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO; import com.logpm.factorydata.jinpai.vo.OrderInfoVO; import com.logpm.factorydata.jinpai.vo.PackageCategoryVO; import com.logpm.factorydata.jinpai.vo.PackageInfoVO; @@ -33,7 +36,6 @@ import com.logpm.factorydata.jinpai.vo.ThirdPlWarehouseMappingVO; import com.logpm.factorydata.vo.SendMsg; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; -import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; @@ -54,6 +56,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; +import javax.annotation.Resource; import java.io.File; import java.io.InputStream; import java.io.OutputStream; @@ -74,14 +77,16 @@ import java.util.Map; **/ @Slf4j @Service -@AllArgsConstructor public class DeliveryNoteServiceImpl extends BaseServiceImpl implements DeliveryNoteService { - private final IFactoryDataClient factoryDataClient; - private final FactoryOrderLogService factoryOrderLogService; - private final IOssClient ossClient; - - private final IFactoryDataBaseClient baseClient; + @Resource + private IFactoryDataClient factoryDataClient; + @Resource + private FactoryOrderLogService factoryOrderLogService; + @Resource + private IOssClient ossClient; + @Resource + private IFactoryDataBaseClient baseClient; @Override public String order(List vo) { @@ -165,7 +170,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl details = vo.getOrderList(); + if (CollUtil.isEmpty(details)) { + return; + } + R warehouseByBrandAndSiteName = baseClient.getWarehouseByBrandAndSiteName(BrandEnums.JP.getValue(), vo.getShipmentHub()); + if (ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, warehouseByBrandAndSiteName.getCode())) { + FactoryWarehouseBindVO data = warehouseByBrandAndSiteName.getData(); + if (ObjectUtil.isNotNull(data)) { + startWarehouseId = data.getWarehouseId(); + startWarehouseName = data.getWarehouseName(); + tenantId = data.getTenantId(); + } + } + Map> advanceMap = new HashMap<>(); + // 一个dd单号 一个暂存单 + // 组装暂存单数据 + List advances = new ArrayList<>(); + for (JpFactoryOrderVO orderInfoVO : details) { + List packageList = new ArrayList<>(); + TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity(); + Boolean checked = vo.getChecked(); + if (checked) { + advanceEntity.setReserve2("1"); + } else { + advanceEntity.setReserve2("0"); + } + advanceEntity.setTenantId(tenantId); + advanceEntity.setStatus(0); + advanceEntity.setIsDeleted(0); + advanceEntity.setHasPackage(1); + advanceEntity.setOrderType(""); + advanceEntity.setBrand(BrandEnums.JP.getValue()); + advanceEntity.setSiteName(vo.getShipmentHub()); + advanceEntity.setArea(""); + advanceEntity.setTotalNum(CollUtil.isNotEmpty(orderInfoVO.getPackageList()) ? orderInfoVO.getPackageList().size() : 0); + advanceEntity.setPackName(""); + advanceEntity.setPackCode(""); + advanceEntity.setWarehouseId(startWarehouseId); + advanceEntity.setWarehouseName(startWarehouseName); + + advanceEntity.setIsGcp(0); + advanceEntity.setCarrierName(""); + advanceEntity.setSystemType("线上"); + advanceEntity.setMatingType("1"); + advanceEntity.setSenderName(""); + advanceEntity.setSenderPhone(""); + advanceEntity.setSenderAddress(""); + advanceEntity.setWaybillStatus("0"); + advanceEntity.setWaybillNo(""); + advanceEntity.setTrainNumber(vo.getShipmentId()); + advanceEntity.setFreezeStatus("0"); + advanceEntity.setOrderCode(orderInfoVO.getOrderCode()); + advanceEntity.setServiceNum(orderInfoVO.getServiceNum()); + advanceEntity.setSenderFactory("金牌"); + // 门店是商场 + // advanceEntity.setDealerCode(orderInfoVO.getShopCode()); + advanceEntity.setDealerName(orderInfoVO.getMallName()); + // advanceEntity.setStoreCode(orderInfoVO.getShopCode()); + advanceEntity.setStoreName(orderInfoVO.getStoreName()); + // 安装是客户 + advanceEntity.setCustomerName(orderInfoVO.getReceiverName()); + advanceEntity.setCustomerPhone(orderInfoVO.getReceiverMobile()); + advanceEntity.setCustomerAddress(orderInfoVO.getReceiverAddress()); + // 收货人就是商场收货人 + advanceEntity.setConsigneePerson(orderInfoVO.getMallConsignee()); + advanceEntity.setConsigneeMobile(orderInfoVO.getMallConsigneeMobile()); + advanceEntity.setConsigneeAddress(orderInfoVO.getMallAddress()); + + // 封装包件品类信息 + for (JpFactoryPackageVO packageInfoVO : orderInfoVO.getPackageList()) { + // 封装包件 + TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity(); + advanceDetailEntity.setWarehouseId(startWarehouseId); + advanceDetailEntity.setWarehouseName(startWarehouseName); + + advanceDetailEntity.setOrderCode(orderInfoVO.getOrderCode()); + advanceDetailEntity.setBrand(BrandEnums.JP.getValue()); + advanceDetailEntity.setSystemType("线上"); + // 获取映射品类信息 + advanceDetailEntity.setFirstPackName(packageInfoVO.getFirstPackName()); + advanceDetailEntity.setFirstPackCode(packageInfoVO.getFirstPackCode()); + advanceDetailEntity.setSecondPackName(packageInfoVO.getSecondPackName()); + advanceDetailEntity.setSecondPackCode(packageInfoVO.getSecondPackCode()); + advanceDetailEntity.setThirdPackName(packageInfoVO.getThirdPackName()); + advanceDetailEntity.setThirdPackCode(packageInfoVO.getThirdPackCode()); + + advanceDetailEntity.setSiteName(vo.getShipmentHub()); + advanceDetailEntity.setSiteCode(""); + advanceDetailEntity.setQuantity(1); + advanceDetailEntity.setOrderPackageCode(packageInfoVO.getUnitNo()); + advanceDetailEntity.setTrainNumber(vo.getShipmentId()); + advanceDetailEntity.setServiceNum(orderInfoVO.getServiceNum()); + advanceDetailEntity.setWaybillNo(""); + advanceDetailEntity.setPackageStatus("0"); + advanceDetailEntity.setWeight(NumberUtil.toBigDecimal(packageInfoVO.getWeight())); + advanceDetailEntity.setVolume(NumberUtil.toBigDecimal(packageInfoVO.getVolume())); +// advanceDetailEntity.setChargeType(0); + 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); + JSONObject entries = JSONUtil.parseObj(advanceDetailEntity); + packageList.add(entries); + } + // 转成json对象,然后将包件明细放到detail中 + JSONObject entries = JSONUtil.parseObj(advanceEntity); + entries.set("details", JSONUtil.toJsonStr(packageList)); + advances.add(entries); + } + // 将组装好的暂存单发送到 MQ ,由暂存单服务统一消费SendMsg. + if (CollUtil.isNotEmpty(advances)) { + for (JSONObject advance : advances) { + SendMsg sendMsg = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER) + .routingKey(FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER_JP).message(JSONUtil.toJsonStr(advance)).build(); + factoryDataClient.sendMessage(sendMsg); + } + } + } + private String uploadFile(String body) { // 文本内容和保存为本地文件 并上传 String logPath = FileLogsUtil.saveFileLogs(body); diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryOrderServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryOrderServiceImpl.java new file mode 100644 index 000000000..9af48ea89 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryOrderServiceImpl.java @@ -0,0 +1,22 @@ +package com.logpm.factorydata.jinpai.service.impl; + +import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity; +import com.logpm.factorydata.jinpai.mapper.JpFactoryOrderMapper; +import com.logpm.factorydata.jinpai.service.JpFactoryOrderService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 金牌工厂订单 业务实现类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +@Slf4j +@Service +@AllArgsConstructor +public class JpFactoryOrderServiceImpl extends BaseServiceImpl implements JpFactoryOrderService { + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryPackageServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryPackageServiceImpl.java new file mode 100644 index 000000000..f59e6ecfb --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryPackageServiceImpl.java @@ -0,0 +1,22 @@ +package com.logpm.factorydata.jinpai.service.impl; + +import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity; +import com.logpm.factorydata.jinpai.mapper.JpFactoryPackageMapper; +import com.logpm.factorydata.jinpai.service.JpFactoryPackageService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 金牌工厂包件 业务实现类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +@Slf4j +@Service +@AllArgsConstructor +public class JpFactoryPackageServiceImpl extends BaseServiceImpl implements JpFactoryPackageService { + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryShipmentServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryShipmentServiceImpl.java new file mode 100644 index 000000000..34aca1553 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/JpFactoryShipmentServiceImpl.java @@ -0,0 +1,137 @@ +package com.logpm.factorydata.jinpai.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.logpm.factorydata.enums.SaxStatusEnums; +import com.logpm.factorydata.feign.IFactoryDataClient; +import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; +import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity; +import com.logpm.factorydata.jinpai.mapper.JpFactoryShipmentMapper; +import com.logpm.factorydata.jinpai.service.FactoryOrderLogService; +import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService; +import com.logpm.factorydata.jinpai.vo.FactoryAuthVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO; +import com.logpm.factorydata.vo.SendMsg; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.io.IOUtils; +import org.jetbrains.annotations.NotNull; +import org.springblade.common.constant.factorydata.FactoryDataConstants; +import org.springblade.common.utils.FileLogsUtil; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.oss.model.BladeFile; +import org.springblade.core.redis.cache.BladeRedis; +import org.springblade.core.tool.api.R; +import org.springblade.resource.feign.IOssClient; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.commons.CommonsMultipartFile; + +import javax.annotation.Resource; +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.time.Duration; +import java.util.List; + +/** + * 金牌工厂发货单 业务实现类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +@Slf4j +@Service +public class JpFactoryShipmentServiceImpl extends BaseServiceImpl implements JpFactoryShipmentService { + + @Resource + private BladeRedis bladeRedis; + @Resource + private IOssClient ossClient; + @Resource + private IFactoryDataClient factoryDataClient; + @Resource + private FactoryOrderLogService factoryOrderLogService; + + @Override + public FactoryAuthVO findFactoryAuth(String companyCode) { + // redis 缓存数据 缓存时间 1天 + if (StrUtil.isNotBlank(companyCode)) { + String key = "factory-data:jinpai:" + companyCode; + String json = bladeRedis.get(key); + if (StrUtil.isNotBlank(json)) { + return JSONUtil.toBean(json, FactoryAuthVO.class); + } else { + List factoryAuth = baseMapper.findFactoryAuth(companyCode); + if(CollUtil.isNotEmpty(factoryAuth)){ + FactoryAuthVO authVO = factoryAuth.get(0); + bladeRedis.setEx(key, JSONUtil.toJsonStr(authVO), Duration.ofDays(1)); + return authVO; + } + } + } + return null; + + } + + @Override + public String shipment(JpFactoryShipmentVO vo) { + // 1 上传数据到 minio 获取到地址 + String url = uploadFile(JSONUtil.toJsonStr(vo)); + // 2 保存地址到数据库 + FactoryOrderLogEntity logEntity = new FactoryOrderLogEntity(); + logEntity.setType(2); + logEntity.setSaxStatus(SaxStatusEnums.NOMAL.getCode()); + logEntity.setLogUrl(url); + factoryOrderLogService.save(logEntity); + // 3 将消息发送给 mq,解析保存 + SendMsg build = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.FACTORY_ORDER) + .routingKey(FactoryDataConstants.Mq.RoutingKeys.JP_FACTORY_SHIPMENT).message(JSONUtil.toJsonStr(logEntity)).build(); + factoryDataClient.sendMessage(build); + return "成功"; + + } + + private String uploadFile(String body) { + // 文本内容和保存为本地文件 并上传 + String logPath = FileLogsUtil.saveFileLogs(body); + log.info(">>> 文件路径 {}", logPath); + + MultipartFile multi = getMultipartFile(logPath); + // 上传到服务器 + R r = ossClient.fileUpload(multi, "jp-order-logs"); + if (r.isSuccess()) { + BladeFile data = (BladeFile) r.getData(); + // 删除本地文件 + FileUtil.del(logPath); + return data.getLink(); + } + return null; + } + + @NotNull + private MultipartFile getMultipartFile(String logPath) { + File file = new File(logPath); + + // File 转 MultipartFile + FileItem item = new DiskFileItemFactory().createItem("file" + , MediaType.MULTIPART_FORM_DATA_VALUE + , true + , file.getName()); + try ( + InputStream input = Files.newInputStream(file.toPath()); + OutputStream os = item.getOutputStream()) { + // 流转移 + IOUtils.copy(input, os); + } catch (Exception e) { + throw new IllegalArgumentException("Invalid file: " + e, e); + } + + return new CommonsMultipartFile(item); + } +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java new file mode 100644 index 000000000..135a76c19 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/MqWorkerServiceImpl.java @@ -0,0 +1,356 @@ +package com.logpm.factorydata.jinpai.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.URLUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.factorydata.enums.SaxStatusEnums; +import com.logpm.factorydata.jinpai.entity.DeliveryNoteEntity; +import com.logpm.factorydata.jinpai.entity.FactoryOrderLogEntity; +import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity; +import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity; +import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity; +import com.logpm.factorydata.jinpai.entity.OrderInfoEntity; +import com.logpm.factorydata.jinpai.entity.PackageInfoEntity; +import com.logpm.factorydata.jinpai.entity.PushOrderDetailEntity; +import com.logpm.factorydata.jinpai.entity.PushOrderEntity; +import com.logpm.factorydata.jinpai.enums.DimensionEnums; +import com.logpm.factorydata.jinpai.service.DeliveryNoteService; +import com.logpm.factorydata.jinpai.service.FactoryOrderLogService; +import com.logpm.factorydata.jinpai.service.JpFactoryOrderService; +import com.logpm.factorydata.jinpai.service.JpFactoryPackageService; +import com.logpm.factorydata.jinpai.service.JpFactoryShipmentService; +import com.logpm.factorydata.jinpai.service.MqWorkerService; +import com.logpm.factorydata.jinpai.service.OrderInfoService; +import com.logpm.factorydata.jinpai.service.PackageInfoService; +import com.logpm.factorydata.jinpai.service.PushOrderDetailService; +import com.logpm.factorydata.jinpai.service.PushOrderService; +import com.logpm.factorydata.jinpai.vo.DeliveryNoteVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryOrderVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryPackageVO; +import com.logpm.factorydata.jinpai.vo.JpFactoryShipmentVO; +import com.logpm.factorydata.jinpai.vo.OrderInfoVO; +import com.logpm.factorydata.jinpai.vo.PackageCategoryVO; +import com.logpm.factorydata.jinpai.vo.PackageInfoVO; +import com.logpm.factorydata.jinpai.vo.PushOrderDetailVO; +import com.logpm.factorydata.jinpai.vo.PushOrderVO; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.secure.utils.AuthUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 消息队列工作类 业务实现类 + * + * @Author zqb + * @Date 2024/4/26 + **/ +@Slf4j +@Service +@AllArgsConstructor +public class MqWorkerServiceImpl implements MqWorkerService { + + private final PushOrderService pushOrderService; + private final PushOrderDetailService pushOrderDetailService; + private final DeliveryNoteService deliveryNoteService; + private final OrderInfoService orderInfoService; + private final PackageInfoService packageInfoService; + private final FactoryOrderLogService logService; + private final JpFactoryShipmentService jpFactoryShipmentService; + private final JpFactoryOrderService jpFactoryOrderService; + private final JpFactoryPackageService jpFactoryPackageService; + + @Override + @Transactional(rollbackFor = Exception.class) + public void factoryShipment(String msg) { + if (StrUtil.isEmpty(msg)) { + log.error("消息内容为空"); + return; + } + FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class); + if (ObjectUtil.isEmpty(logEntity)) { + log.error("消息内容为空"); + return; + } + // 去 minio 下载文件到本地,然后解析文件内容为实体对象 + JpFactoryShipmentVO pushOrderVO = null; + String logUrl = logEntity.getLogUrl(); + if (StrUtil.isNotEmpty(logUrl)) { + List res = new ArrayList<>(); + FileUtil.readLines(URLUtil.url(logUrl), CharsetUtil.CHARSET_UTF_8, res); + if (CollUtil.isNotEmpty(res)) { + String content = res.get(0); + if (StrUtil.isNotEmpty(content)) { + pushOrderVO = JSONUtil.toBean(content, JpFactoryShipmentVO.class); + } + } + } + shipmentData(pushOrderVO, logEntity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void factoryOrder(String msg) { + if (StrUtil.isEmpty(msg)) { + log.error("消息内容为空"); + return; + } + FactoryOrderLogEntity logEntity = JSONUtil.toBean(msg, FactoryOrderLogEntity.class); + if (ObjectUtil.isEmpty(logEntity)) { + log.error("消息内容为空"); + return; + } + // 去 minio 下载文件到本地,然后解析文件内容为实体对象 + List deliveryNoteVOS = null; + List orderInfoVOS = null; + List packageInfoVOS = null; + PushOrderVO pushOrderVO = null; + Long logId = logEntity.getId(); + String logUrl = logEntity.getLogUrl(); + // 1 订单 2 订单明细 3 包件 + Integer dimension = logEntity.getDimension(); + if (StrUtil.isNotEmpty(logUrl)) { + List res = new ArrayList<>(); + FileUtil.readLines(URLUtil.url(logUrl), CharsetUtil.CHARSET_UTF_8, res); + if (CollUtil.isNotEmpty(res)) { + String content = res.get(0); + if (StrUtil.isNotEmpty(content)) { + // 拉取的数据 + if (ObjectUtil.equal(logEntity.getType(), 1)) { + if (ObjectUtil.equal(dimension, DimensionEnums.ORDER.getCode())) { + deliveryNoteVOS = new JSONArray(content).toList(DeliveryNoteVO.class); + } + if (ObjectUtil.equal(dimension, DimensionEnums.ORDER_DETAIL.getCode())) { + orderInfoVOS = new JSONArray(content).toList(OrderInfoVO.class); + } + if (ObjectUtil.equal(dimension, DimensionEnums.PACKAGE.getCode())) { + packageInfoVOS = new JSONArray(content).toList(PackageInfoVO.class); + } + } else if (ObjectUtil.equal(logEntity.getType(), 2)) { + // 推送的数据 + pushOrderVO = JSONUtil.toBean(content, PushOrderVO.class); + } + } + } + } + if (ObjectUtil.equal(logEntity.getType(), 1)) { + pullData(deliveryNoteVOS, orderInfoVOS, packageInfoVOS, logEntity); + } else if (ObjectUtil.equal(logEntity.getType(), 2)) { + pushData(pushOrderVO, logEntity); + } + } + + private void shipmentData(JpFactoryShipmentVO vo, FactoryOrderLogEntity logEntity) { + if (ObjectUtil.isNotEmpty(vo)) { + // 1 解析数据保存入库 + // 装车单号唯一 + Long logId = logEntity.getId(); + String truckNo = vo.getShipmentId(); + if (StrUtil.isEmpty(truckNo)) { + return; + } + List list = jpFactoryShipmentService.list(Wrappers.lambdaQuery().eq(JpFactoryShipmentEntity::getShipmentId, truckNo)); + Boolean checked = Boolean.FALSE; + if (CollUtil.isNotEmpty(list)) { + if (list.size() > 1) { + return; + } + checked = Boolean.TRUE; + } + vo.setChecked(checked); + vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); + vo.setTenantCode(AuthUtil.getTenantId()); + jpFactoryShipmentService.save(vo); + List orderVOS = vo.getOrderList(); + if (CollUtil.isNotEmpty(orderVOS)) { + List packageEntities = new ArrayList<>(); + for (JpFactoryOrderVO orderVO : orderVOS) { + JpFactoryOrderEntity orderEntity = new JpFactoryOrderEntity(); + BeanUtil.copyProperties(orderVO, orderEntity); + orderEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); + orderEntity.setShipmentId(vo.getId()); + orderEntity.setChecked(checked); + orderEntity.setTenantCode(AuthUtil.getTenantId()); + jpFactoryOrderService.save(orderEntity); + List packageList = orderVO.getPackageList(); + if (CollUtil.isNotEmpty(packageList)) { + for (JpFactoryPackageVO jpFactoryPackageVO : packageList) { + JpFactoryPackageEntity packageEntity = new JpFactoryPackageEntity(); + BeanUtil.copyProperties(jpFactoryPackageVO, packageEntity); + packageEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); + packageEntity.setOrderId(orderEntity.getId()); + packageEntity.setChecked(checked); + packageEntity.setTenantCode(AuthUtil.getTenantId()); + packageEntities.add(packageEntity); + } + } + } + if (CollUtil.isNotEmpty(packageEntities)) { + jpFactoryPackageService.saveBatch(packageEntities); + } + } + // 2 构建暂存单,发送 mq 消息 + FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity(); + logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode()); + logEntity1.setId(logId); + logService.saveOrUpdate(logEntity1); + // 处理暂存单 + deliveryNoteService.buildFactoryAdvance(vo); + } + } + + private void pushData(PushOrderVO vo, FactoryOrderLogEntity logEntity) { + if (ObjectUtil.isNotEmpty(vo)) { + // 1 解析数据保存入库 + // 装车单号唯一 + Long logId = logEntity.getId(); + String truckNo = vo.getTransportNo(); + List list = pushOrderService.list(Wrappers.lambdaQuery().eq(PushOrderEntity::getTransportNo, truckNo)); + if (CollUtil.isNotEmpty(list)) { + log.error("装车单号{} 数据已经处理过了, logId: {}", truckNo, logId); + return; + } + vo.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); + pushOrderService.save(vo); + List orderInfos = vo.getItems(); + if (CollUtil.isNotEmpty(orderInfos)) { + List infoEntities = new ArrayList<>(); + for (PushOrderDetailVO orderInfo : orderInfos) { + PushOrderDetailEntity orderInfoEntity = new PushOrderDetailEntity(); + BeanUtil.copyProperties(orderInfo, orderInfoEntity); + orderInfoEntity.setLogId(ObjectUtil.isNotEmpty(logId) ? logId.toString() : null); + orderInfoEntity.setOrderId(vo.getId().toString()); + List boxCodes = orderInfo.getBoxCodes(); + if (CollUtil.isNotEmpty(boxCodes)) { + orderInfoEntity.setBoxCodeList(JSONUtil.toJsonStr(boxCodes)); + } + List boxDetails = orderInfo.getBoxDetails(); + if (CollUtil.isNotEmpty(boxDetails)) { + orderInfoEntity.setBoxDetailList(JSONUtil.toJsonStr(boxDetails)); + } + infoEntities.add(orderInfoEntity); + } + pushOrderDetailService.saveBatch(infoEntities); + } + // 2 构建暂存单,发送 mq 消息 + FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity(); + logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode()); + logEntity1.setId(logId); + logService.saveOrUpdate(logEntity1); + // 处理暂存单 + deliveryNoteService.buildAdvance(vo); + } + } + + private void pullData(List deliveryNoteVOS, List orderInfoVOS, List packageInfoVOS, FactoryOrderLogEntity logEntity) { + if (CollUtil.isNotEmpty(deliveryNoteVOS)) { + List entities = new ArrayList<>(); + List orderCodes = new ArrayList<>(); + for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) { + orderCodes.add(deliveryNoteVO.getOrderId()); + } + List list = deliveryNoteService.list(Wrappers.lambdaQuery() + .in(DeliveryNoteEntity::getOrderId, orderCodes)); + Map map = new HashMap<>(); + if (CollUtil.isNotEmpty(list)) { + // 将list中的数据封装到map中 + list.forEach(item -> { + map.put(item.getOrderId(), item.getOrderId()); + }); + } + for (DeliveryNoteVO deliveryNoteVO : deliveryNoteVOS) { + if (map.containsKey(deliveryNoteVO.getOrderId())) { + log.error("订单号:{},已推送过了", deliveryNoteVO.getOrderId()); + continue; + } + DeliveryNoteEntity deliveryNoteEntity = new DeliveryNoteEntity(); + BeanUtil.copyProperties(deliveryNoteVO, deliveryNoteEntity); + deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); + entities.add(deliveryNoteEntity); + } + if (CollUtil.isNotEmpty(entities)) { + deliveryNoteService.saveBatch(entities); + } + } + if (CollUtil.isNotEmpty(orderInfoVOS)) { + List entities = new ArrayList<>(); + List orderCodes = new ArrayList<>(); + for (OrderInfoVO orderInfoVO : orderInfoVOS) { + orderCodes.add(orderInfoVO.getOrderId()); + } + List list = orderInfoService.list(Wrappers.lambdaQuery() + .in(OrderInfoEntity::getOmsExtOrderNo, orderCodes)); + Map map = new HashMap<>(); + if (CollUtil.isNotEmpty(list)) { + // 将list中的数据封装到map中 + list.forEach(item -> { + map.put(item.getOmsExtOrderNo(), item.getOmsExtOrderNo()); + }); + } + for (OrderInfoVO vo : orderInfoVOS) { + if (map.containsKey(vo.getOmsExtOrderNo())) { + log.error("DD单号:{},已推送过了", vo.getOmsExtOrderNo()); + continue; + } + OrderInfoEntity deliveryNoteEntity = new OrderInfoEntity(); + BeanUtil.copyProperties(vo, deliveryNoteEntity); + deliveryNoteEntity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); + entities.add(deliveryNoteEntity); + } + if (CollUtil.isNotEmpty(entities)) { + orderInfoService.saveBatch(entities); + } + } + if (CollUtil.isNotEmpty(packageInfoVOS)) { + List entities = new ArrayList<>(); + List orderCodes = new ArrayList<>(); + List packageCodes = new ArrayList<>(); + for (PackageInfoVO orderInfoVO : packageInfoVOS) { + orderCodes.add(orderInfoVO.getOmsExtOrderNo()); + packageCodes.add(orderInfoVO.getExtBoxCode()); + } + List list = packageInfoService.list(Wrappers.lambdaQuery() + .in(PackageInfoEntity::getOmsExtOrderNo, orderCodes) + .in(PackageInfoEntity::getExtBoxCode, packageCodes) + ); + Map map = new HashMap<>(); + if (CollUtil.isNotEmpty(list)) { + // 将list中的数据封装到map中 + list.forEach(item -> { + map.put(item.getOmsExtOrderNo() + item.getExtBoxCode(), item.getOmsExtOrderNo()); + }); + } + for (PackageInfoVO vo : packageInfoVOS) { + if (map.containsKey(vo.getOmsExtOrderNo() + vo.getExtBoxCode())) { + log.error("DD单号:{} + 箱码:{},已推送过了", vo.getOmsExtOrderNo(), vo.getExtBoxCode()); + continue; + } + PackageInfoEntity entity = new PackageInfoEntity(); + BeanUtil.copyProperties(vo, entity); + entity.setLogId(ObjectUtil.isNotEmpty(logEntity.getId()) ? logEntity.getId().toString() : null); + entities.add(entity); + } + if (CollUtil.isNotEmpty(entities)) { + packageInfoService.saveBatch(entities); + } + } + // 处理暂存单 通过定时任务扫描的方式判定是否齐套 然后创建暂存单 + FactoryOrderLogEntity logEntity1 = new FactoryOrderLogEntity(); + logEntity1.setSaxStatus(SaxStatusEnums.SUCCESS.getCode()); + logEntity1.setId(logEntity.getId()); + logService.saveOrUpdate(logEntity1); + } + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryAuthVO.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryAuthVO.java new file mode 100644 index 000000000..e4efba09b --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryAuthVO.java @@ -0,0 +1,28 @@ +package com.logpm.factorydata.jinpai.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 物流商认证 + * + * @author zhaoqiaobo + * @create 2024-04-26 + */ +@Data +public class FactoryAuthVO { + + @ApiModelProperty(name = "物流编码") + private String logisticsCode; + @ApiModelProperty(name = "秘钥") + private String appKey; + @ApiModelProperty(name = "物流公司") + private String companyCode; + @ApiModelProperty(name = "租户") + private String tenantCode; + @ApiModelProperty(name = "登录账号") + private String loginAccount; + @ApiModelProperty(name = "Authorization头") + private String authorizationHeader; + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryOrderDataVO.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryOrderDataVO.java new file mode 100644 index 000000000..2aca7b4c6 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/FactoryOrderDataVO.java @@ -0,0 +1,27 @@ +package com.logpm.factorydata.jinpai.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 送货单 实体类 + * + * @author zhaoqiaobo + * @create 2024-04-26 + */ +@Data +@ApiModel(value = "发货单", description = "发货单") +public class FactoryOrderDataVO { + + @ApiModelProperty("加密后的密文") + private String digest; + @ApiModelProperty("时间戳 毫秒") + private Long timestamp; + @ApiModelProperty("公司编码") + private String companyCode; + + @ApiModelProperty("订单信息") + private String params; + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryOrderVO.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryOrderVO.java new file mode 100644 index 000000000..a44cfb782 --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryOrderVO.java @@ -0,0 +1,25 @@ +package com.logpm.factorydata.jinpai.vo; + +import com.logpm.factorydata.jinpai.entity.JpFactoryOrderEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 送货单 实体类 + * + * @author zhaoqiaobo + * @create 2024-04-26 + */ +@Data +@ApiModel(value = "发货单", description = "发货单") +@EqualsAndHashCode(callSuper = true) +public class JpFactoryOrderVO extends JpFactoryOrderEntity { + + @ApiModelProperty(name = "包件明细") + private List packageList; + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryPackageVO.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryPackageVO.java new file mode 100644 index 000000000..3b7f432be --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryPackageVO.java @@ -0,0 +1,21 @@ +package com.logpm.factorydata.jinpai.vo; + +import com.logpm.factorydata.jinpai.entity.JpFactoryPackageEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 送货单 实体类 + * + * @author zhaoqiaobo + * @create 2024-04-26 + */ +@Data +@ApiModel(value = "发货单", description = "发货单") +@EqualsAndHashCode(callSuper = true) +public class JpFactoryPackageVO extends JpFactoryPackageEntity { + + + +} diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryShipmentVO.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryShipmentVO.java new file mode 100644 index 000000000..e1f1ada2c --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/vo/JpFactoryShipmentVO.java @@ -0,0 +1,25 @@ +package com.logpm.factorydata.jinpai.vo; + +import com.logpm.factorydata.jinpai.entity.JpFactoryShipmentEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + * 送货单 实体类 + * + * @author zhaoqiaobo + * @create 2024-04-26 + */ +@Data +@ApiModel(value = "发货单", description = "发货单") +@EqualsAndHashCode(callSuper = true) +public class JpFactoryShipmentVO extends JpFactoryShipmentEntity { + + @ApiModelProperty(name = "订单明细") + private List orderList; + +} 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 f84943c94..76ba1b3e5 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 @@ -49,6 +49,26 @@ public class AdvanceOrderListener { throw new RuntimeException(e); } } + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_JP), + exchange = @Exchange(name = FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER, type = ExchangeTypes.TOPIC), + key = FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER_JP + ), ackMode = "MANUAL") + public void advanceOrderJp(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) { + // 新增暂存单 + log.info("收到金牌工厂数据暂存单消息:{}", msg); + try { + advanceOrderMqService.advanceOrderJp(msg); + } catch (Exception e) { + e.printStackTrace(); + log.error("收到金牌工厂数据暂存单消息失败: {}", e.getMessage()); + } + try { + channel.basicAck(tag, false); + } catch (IOException e) { + throw new RuntimeException(e); + } + } @RabbitListener(bindings = @QueueBinding( value = @Queue(name = FactoryDataConstants.Mq.Queues.ADVANCE_ORDER_OUPAI), diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java index 4f35bb9ca..3efec9bd1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAdvanceOrderMqService.java @@ -3,6 +3,7 @@ package com.logpm.trunkline.service; public interface IAdvanceOrderMqService { void advanceOrder(String msg); + void advanceOrderJp(String msg); void advanceOrderOuPai(String msg); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java index dc3f75a02..acbfa76d9 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AdvanceOrderMqServiceImpl.java @@ -175,6 +175,144 @@ public class AdvanceOrderMqServiceImpl implements IAdvanceOrderMqService { } } } + @Override + @Transactional(rollbackFor = Exception.class) + public void advanceOrderJp(String msg) { + if (StrUtil.isNotBlank(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) && ObjectUtil.equal(advanceEntity.getWaybillStatus(), "0")) { + TrunklineAdvanceEntity entity = advanceEntities.get(0); + if (ObjectUtil.isNotEmpty(entity)) { + advanceEntity.setId(entity.getId()); +// advanceEntity.setTotalNum(entity.getTotalNum() + advanceEntity.getTotalNum()); + } + } + Set packageCodeSet = new HashSet<>(); + 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)) { + Map packageCodeByCodes = advanceDetailService.findPackageCodeByCodes(orderPackageCodes); + if (CollUtil.isNotEmpty(packageCodeByCodes)) { + packageCodeSet.addAll(packageCodeByCodes.keySet()); + } + } + } + if (ObjectUtil.isNotNull(advanceEntity)) { + String orderCode = advanceEntity.getOrderCode(); + if (StrUtil.isNotEmpty(orderCode) && orderCode.contains("遗")) { + advanceEntity.setLegacyStatus("1"); + } + // 暂存单不存在则新增,暂存单存在则将暂存单明细往原暂存单中添加 + if (ObjectUtil.isEmpty(advanceEntity.getId())) { + advanceEntity.setCreateUserName(AuthUtil.getNickName()); + advanceService.save(advanceEntity); + } else { + advanceEntity.setWaybillStatus(null); + advanceEntity.setWaybillNo(null); + advanceService.updateById(advanceEntity); + // 查询出当前暂存单明细 + List advanceDetailEntityList = advanceDetailService.list(Wrappers.lambdaQuery() + .eq(TrunklineAdvanceDetailEntity::getAdvanceId, advanceEntity.getId())); + // 如果 packageCodeSet 不存在 则删除 + if (CollUtil.isNotEmpty(advanceDetailEntityList)) { + advanceDetailEntityList.forEach(advanceDetailEntity -> { + if (!packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) { + advanceDetailService.removeById(advanceDetailEntity.getId()); + } + }); + } + } + } + if (ObjectUtil.isNotEmpty(advanceEntity) && CollUtil.isNotEmpty(details)) { + List advanceDetailEntityList = new ArrayList<>(); + List detailProductEntityList = new ArrayList<>(); + for (Object detailObj : details) { + JSONObject detail = JSONUtil.parseObj(detailObj); + TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class); + if (ObjectUtil.isNotNull(advanceDetailEntity)) { + if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) { + // 金牌如果是重复包条,则单独处理 + if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) { + // 金牌按DD单号+包条确定唯一值 + List list = advanceDetailService.list(Wrappers.lambdaQuery() + .eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode()) + .eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode()) + ); + if (CollUtil.isNotEmpty(list)) { + // 订单+包件重复则不处理这条数据 + log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode()); + continue; + } else { + // 包件码重复,订单+包件不重复,设置预留字段1 为 1 + advanceDetailEntity.setReserve1("1"); + } + } else { + log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode()); + continue; + } + } + 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)) { + detailProductEntityList.add(detailProductEntity); + } + } + } + } + + } + advanceDetailService.saveBatch(advanceDetailEntityList); + // 发送入库包件处理无数据装车数据 + trunklineCarsLoadService.sendRabbitMessageLoadScanData(JSONUtil.toJsonStr(advanceEntity)); + detailProductService.saveBatch(detailProductEntityList); + + // 发送报表数据广播 + Long warehouseId = advanceEntity.getWarehouseId(); + String warehouseName = advanceEntity.getWarehouseName(); + String dealerCode = advanceEntity.getDealerCode(); + String dealerName = advanceEntity.getDealerName(); + advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName, new Date(), advanceDetailEntityList, dealerCode, dealerName); + + } + } + } @Override @Transactional(rollbackFor = Exception.class) From 1f6252afc567ce22094fdcc30ea148b267fe84fc Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 20 Jan 2025 16:01:57 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/excel/AftersalesWorkOrderAppealExcel.java | 6 ------ .../aftersales/excel/AftersalesWorkOrderEndExcel.java | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java index f7a91bc17..478496673 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderAppealExcel.java @@ -35,12 +35,6 @@ public class AftersalesWorkOrderAppealExcel implements Serializable { @ColumnWidth(20) @ExcelProperty("发现节点") private String discoveryNodeName; - /** - * 工单创建仓 - */ - @ColumnWidth(20) - @ExcelProperty("工单创建仓") - private String warehouseName; /** * 运单号 */ diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java index 3b0ce0908..f9f404785 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/excel/AftersalesWorkOrderEndExcel.java @@ -114,6 +114,11 @@ public class AftersalesWorkOrderEndExcel implements Serializable { @ColumnWidth(20) @ExcelProperty("工单提交时间") private Date commitTime; + /** + * 工单提交时间 + */ + @ColumnWidth(20) + @ExcelProperty("工单仲裁时间") private Date arbitrationTime; /** * 工单提交时间 @@ -191,7 +196,7 @@ public class AftersalesWorkOrderEndExcel implements Serializable { * 内部责任人 */ @ColumnWidth(20) - @ExcelProperty("金额/占比222") + @ExcelProperty("仲裁原因") private String reasonArbitration; /** * 是否申诉 From 821aed74e905b1d1d22ab0b4ef11ed44e085a31e Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 20 Jan 2025 16:04:33 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/AftersalesWorkOrderCompletePageVO.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java new file mode 100644 index 000000000..07414254b --- /dev/null +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderCompletePageVO.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.vo; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 客服异常工单 视图实体类 + * + * @author BladeX + * @since 2023-11-17 + */ +@Data +public class AftersalesWorkOrderCompletePageVO { + + private Long id; + private String workOrderType; + private String discoveryNode; + private String workOrderStatus; + private String workOrderTypeName; + private String discoveryNodeName; + private String warehouseName; + private String workOrderNumber; + private String waybillNumber; + private String orderCode; + private String packageCode; + private String brandName; + private String waybillMall; + private String first; + private String secondary; + private String thirdProduct; + private String workOrderStatusName; + private String processedBy; + private String responsiblePerson; + private Date createTime; + private Date commitTime; + private String resultType; + private BigDecimal money; + private String warehouseServiceName; + private String headquartersName; + private String businessName; + private String personResponsibleName; + private BigDecimal responsibilityRatio; + private String content; + + +} From cff14f68e367eabbe6b9a22e4aa4300de380553d Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Mon, 20 Jan 2025 16:23:30 +0800 Subject: [PATCH 11/19] =?UTF-8?q?feat(all):=20=E9=87=91=E7=89=8C=E5=B7=A5?= =?UTF-8?q?=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 增加金牌工厂圣都运输单数据同步 --- .../com/logpm/factorydata/jinpai/pros/JinPaiProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java index cbb3d258d..99c307325 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/pros/JinPaiProperties.java @@ -70,7 +70,7 @@ public class JinPaiProperties { private Map warehouse; /** auth过期时间 */ - private Long authTime; + private Long authTime = 30000L; /** key */ private String auth; From a10baa6150e8444fc0a399e18374196527333f6d Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 20 Jan 2025 17:13:39 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E5=B7=A5=E5=8D=95BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java | 2 +- .../logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java | 2 +- .../service/impl/AftersalesWorkOrderServiceImpl.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java index 9583a03b6..f00c794db 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderAllPageVO.java @@ -44,6 +44,6 @@ public class AftersalesWorkOrderAllPageVO implements Serializable { private String appealStatusName; private String processNumber; private Date entryTime; - private Date entryMonthTime; + private String entryMonthTime; } diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java index 9f3e5d8e6..d2aec3406 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesWorkOrderEndPageVO.java @@ -70,7 +70,7 @@ public class AftersalesWorkOrderEndPageVO { private String appealStatusName; private String processNumber; private Date entryTime; - private Date entryMonthTime; + private String entryMonthTime; } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index d274878a9..a89160c42 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -1423,7 +1423,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list = aftersalesProcessorService.list(Wrappers.query().lambda() .eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrder.getId()) .ne(AftersalesProcessorEntity::getTypesOf, "3") - .apply("conditions in (1,2)") + .apply("conditions in (1,3)") ); //需要待回复的处理方 @@ -1861,6 +1861,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl0){ String string = stringBuffer.deleteCharAt(stringBuffer.lastIndexOf(",")).toString(); surveyRecordEntity2.setContent(string); surveyRecordEntity2.setProcessingResults(string); From a5f73c64be0ac3b17ae097af96f7ccf5a8dfb35e Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 20 Jan 2025 17:45:52 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=95=86=E9=85=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=B9=BF=E6=92=AD=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionReservationMapper.xml | 1 + .../DistributionDeliveryListServiceImpl.java | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index aeb9d669d..37d62d633 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -512,6 +512,7 @@ left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0 where ldr.id = #{reservationId} and ldr.is_deleted = 0 + and ldr.reservation_status != 40