From 4e7a5e51432b1ee0fc7f702661448adcc0913eee Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 6 Jun 2024 15:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E6=A0=B8=E7=AD=BE=E6=94=B6=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BasicdataClientServiceImpl.java | 1 - .../service/IDistributionAsyncService.java | 2 +- .../impl/DistributionAsyncServiceImpl.java | 59 ++++++++++++++----- .../impl/DistributionSignforServiceImpl.java | 7 ++- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 18cd9e07f..109f35385 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -163,7 +163,6 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); if (Func.isNotEmpty(distributionParcelListEntities)) { + List packageIds = distributionParcelListEntities.stream() .filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) .map(DistributionParcelListEntity::getId) .collect(Collectors.toList()); + if (Func.isNotEmpty(packageIds)) { //对包件进行批量的修改 //将这些包件恢复到初始状态 @@ -1758,7 +1749,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } //维护这些进行包件对应的订单 String orderCodes = distributionParcelListEntities.stream() - .filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) + .filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) + && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) .map(DistributionParcelListEntity::getOrderCode) .distinct().collect(Collectors.joining(",")); log.info(method + "维护订制品订单:{}", orderCodes); @@ -1768,9 +1760,25 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if(!packageIds.isEmpty() && reservationId!=null){ //完成对该客户下此包件任务的取消 int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds); + + } + List aaa = new ArrayList<>(); + distributionParcelListEntities.forEach(k->{ + if (k.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()) + && k.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ + String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"完成复核,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode(); + JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CLERK_REVIEW.getCode()); + aaa.add(js); + }else { + String content = "包件在"+warehouse.getName()+"由"+user.getNickName()+"复核取消计划无操作包件,配送车次号:"+trainNumber+"预约任务号:"+reservationEntity.getReservationCode(); + JSONObject js = handleLogJSONObject(warehouse, AuthUtil.getUser(), k.getOrderPackageCode(), content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode()); + aaa.add(js); + } + }); + if (!aaa.isEmpty()) { + trunklinePackageTrackLogClient.addPackageTrackLog(aaa); } - //维护预约订单状态 } List distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(reservationId); if (Func.isNotEmpty(distributionParcelNumberDTOS)) { @@ -1799,8 +1807,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds); } } - distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouseId); - distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId); + distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId()); + distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouse.getId()); } //存在库存品信息 @@ -3011,4 +3019,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } } + + private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) { + JSONObject trunklinePackageTrackLog = new JSONObject(); + trunklinePackageTrackLog.put("tenantId",user.getTenantId()); + trunklinePackageTrackLog.put("createTime",new Date()); + trunklinePackageTrackLog.put("createUser",user.getUserId()); + trunklinePackageTrackLog.put("updateUser",user.getUserId()); + trunklinePackageTrackLog.put("updateTime",new Date()); + trunklinePackageTrackLog.put("isDeleted",0); + trunklinePackageTrackLog.put("status",1); + trunklinePackageTrackLog.put("createDept",warehouse.getDepartment()); + trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode); + trunklinePackageTrackLog.put("warehouseId",warehouse.getId()); + trunklinePackageTrackLog.put("warehouseName",warehouse.getName()); + trunklinePackageTrackLog.put("workNode",node); + trunklinePackageTrackLog.put("content",content); + trunklinePackageTrackLog.put("operator",user.getNickName()); + return trunklinePackageTrackLog; + } } 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 f84257070..3d635dbd6 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 @@ -630,6 +630,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl