From f90153488c8dcd76ef4da7dc90e756d8a12a426c Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 27 Dec 2023 19:06:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E7=BB=B4=E6=8A=A4=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E3=80=81=E9=A2=84=E7=BA=A6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E3=80=81=E9=85=8D=E9=80=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionDeliveryInfoVO.java | 9 + .../mapper/DistributionDeliveryInfoMapper.xml | 1 + .../IDistributionDeliveryListService.java | 6 + .../IDistributionReservationService.java | 7 + .../IDistributionStockArticleService.java | 8 + .../impl/DistributionAsyncServiceImpl.java | 2 +- .../DistributionDeliveryInfoServiceImpl.java | 48 +- .../DistributionDeliveryListServiceImpl.java | 588 +++++++----------- .../DistributionReservationServiceImpl.java | 48 ++ .../impl/DistributionSignforServiceImpl.java | 564 ++++------------- .../DistributionStockArticleServiceImpl.java | 100 +++ 11 files changed, 550 insertions(+), 831 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java index 0b4ac5f7c..738fb2c84 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java @@ -43,6 +43,12 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { @ApiModelProperty(value = "仓库") private String warehouse; + /** + * 仓库 + */ + @ApiModelProperty(value = "签收表ID") + private Long signingId; + /** * 运单号 */ @@ -344,6 +350,9 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { * 签收时间 */ private String signingTime; + + + // /** // * 配送方式 // */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index f4463ad16..3c7cef43e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -561,6 +561,7 @@ FROM SELECT ldr.reservation_num, ldr.id id, + lds.id signingId, ldr.is_urgent isUrgent, ldr.mall_name mallName, ldr.reservation_code reservationCode, diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index a5b6b9a6e..caceb3073 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -385,6 +385,12 @@ public interface IDistributionDeliveryListService extends BaseService getShippingInformation(IPage page, DistributionDeliveryListDTO distributionDeliveryInfoDTO); + /** + * 维护配送任务信息 + * @param deliveryId + */ + void maintenanceDeliveryInfo(Long deliveryId); + /** * 查询签收预约客户包件信息 * @param reservationId diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 3570843ff..f2f76a568 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -248,4 +248,11 @@ public interface IDistributionReservationService extends BaseService findZeroListByWarehouseId(Long warehouseId,Integer pageNum,Integer pageSize); + + + /** + * 维护订单信息,支持多个 + * @param orderCodes + * @param warehouseId + */ + void maintenanceOrderInfo(String orderCodes, Long warehouseId); } 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 46b36ac0b..6ab522994 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 @@ -733,7 +733,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { // } // } //维护订单状态 - distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId()); +// distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId()); warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(),parcelListEntity.getWarehouseId()); checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index cf619db62..2c6095559 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -35,6 +35,7 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; +import org.springblade.common.constant.order.OrderStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; import org.springblade.common.constant.reservation.ReservationOrderStatusConstant; import org.springblade.common.serviceConstant.ServiceConstant; @@ -148,7 +149,32 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryorder(IPage page, Map distributionStockArticle) { List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle); - + distributionDeliveryInfoVOS.forEach(s -> { + switch (s.getOrderStatus()) { + case "10": + s.setOrderStatusName(OrderStatusConstant.bufenruku.getName()); + break; + case "20": + s.setOrderStatusName(OrderStatusConstant.ruku.getName()); + + break; + case "30": + s.setOrderStatusName(OrderStatusConstant.bufenchuku.getName()); + + break; + case "40": + s.setOrderStatusName(OrderStatusConstant.chuku.getName()); + + break; + case "70": + s.setOrderStatusName(OrderStatusConstant.bufenqianshou.getName()); + break; + case "80": + s.setOrderStatusName(OrderStatusConstant.qianshou.getName()); + + break; + } + }); // for (DistributionStockArticleVO distributionDeliveryInfoVO : distributionDeliveryInfoVOS) { // //查询签收数量 // //查询装车数量 @@ -282,13 +308,13 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl0) { + if (loadNum == distributionAppStockArticleVO.getReservationNum() && distributionAppStockArticleVO.getReservationNum() > 0) { distributionAppStockArticleVO.setCompletecode(3); distributionAppStockArticleVO.setComplete("齐套"); - }else if (loadNum == 0){ + } else if (loadNum == 0) { distributionAppStockArticleVO.setCompletecode(1); distributionAppStockArticleVO.setComplete("未装"); - }else { + } else { distributionAppStockArticleVO.setCompletecode(2); distributionAppStockArticleVO.setComplete("未齐套"); } @@ -396,9 +422,9 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionAppDeliveryInventory( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { + public List selectDistributionAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { List inventoryList = distributionReservationMapper.selectInventoryListByReservation(Long.parseLong(distributionAppDeliveryListDTO.getReservationId())); - if (Func.isEmpty(inventoryList)){ + if (Func.isEmpty(inventoryList)) { log.error("##########查询该客户库存品信息为null"); return null; } @@ -406,7 +432,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl distributionStockListEntities = distributionStockListService.listByIds(stockListIds); Map stockListMap = distributionStockListEntities.stream().collect(Collectors.toMap(DistributionStockListEntity::getId, Function.identity(), (k1, k2) -> k2)); List disStockListDetailVOS = DistributionDisStockListWrapper.build().listVO(inventoryList); - disStockListDetailVOS.stream().forEach(sd->{ + disStockListDetailVOS.stream().forEach(sd -> { //查询一次装车 如果装车了那么 DistributionLoadscaninvnEntity serviceOne = distributionLoadscaninvnService.getOne(Wrappers.query().lambda() .eq(DistributionLoadscaninvnEntity::getReservationId, distributionAppDeliveryListDTO.getReservationId()) @@ -414,13 +440,13 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl implements IDistributionDeliveryListService { - private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; - private final DistributionReservationMapper distributionReservationMapper; - private final IDistributionReservationStockarticleService distributionReservationStockarticleService; - private final IDistributionReservationStocklistService distributionReservationStocklistService; - private final IDistributionReservationPackageService distributionReservationPackageService; - private final DistributionReservationPackageMapper distributionReservationPackageMapper; - private final IDistributionParcelListService distributionParcelListService; - private final DistributionLoadscanMapper distributionLoadscanMapper; - private final DistributionLoadscanServiceImpl distributionLoadscanService; - private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; - private final DistributionDeliveryListMapper distributionDeliveryListMapper; - private final DistributionSignforServiceImpl distributionSignforService; - private final DistributionSignforMapper distributionSignforMapper; - private final IDistributionSignforService distributionSignforServicer; - private final DistributionStockArticleMapper distributionStockArticleMapper; - private final IDistributionStockArticleService distributionStockArticleService; - private final DistributionSigndetailServiceImpl distributionSigndetailService; - private final DistributionPackadeliServiceImpl distributionPackadeliService; - private final DistributionDeliverySelfMapper distributionDeliverySelfMapper; - private final IDistributionDeliverySelfService distributionDeliverySelfService; - private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; - private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; - private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; - private final DistributionStockupMapper distributionStockupMapper; - private final IDistributionStockupInfoService distributionStockupInfoService; - private final DistributionStockMapper distributionStockMapper; - private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; - private final IDistributionAsyncService distributionAsyncService; - private final IDictBizClient dictBizClient; - private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient; - private final IBasicdataWarehouseClient warehouseClient; - private final IDisStockListDetailService disStockListDetailService; - private final DistributionStockListMapper distributionStockListMapper; - private final IDistributionStockListService distributionStockListService; - private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient; - private final IBasicPrintTemplateClient basicPrintTemplateClient; - private final IWarehouseTrayTypeClient warehouseTrayTypeClient; - private final IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; - private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService; - private final IDistributionParcelNumberService distributionParcelNumberService; - private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient; - private final IWarehouseWaybillClient warehouseWaybillClient; - private final BladeRedis bladeRedis; - + @Autowired + private DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; + @Autowired + private DistributionReservationMapper distributionReservationMapper; + @Autowired + private IDistributionReservationStockarticleService distributionReservationStockarticleService; + @Autowired + private IDistributionReservationStocklistService distributionReservationStocklistService; + @Autowired + private IDistributionReservationPackageService distributionReservationPackageService; + @Autowired + private DistributionReservationPackageMapper distributionReservationPackageMapper; + @Autowired + private IDistributionParcelListService distributionParcelListService; + @Autowired + private DistributionLoadscanMapper distributionLoadscanMapper; + @Autowired + private DistributionLoadscanServiceImpl distributionLoadscanService; + @Autowired + private DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; + @Autowired + private DistributionDeliveryListMapper distributionDeliveryListMapper; + @Autowired + private DistributionSignforServiceImpl distributionSignforService; + @Autowired + private DistributionSignforMapper distributionSignforMapper; + @Autowired + private IDistributionSignforService distributionSignforServicer; + private DistributionStockArticleMapper distributionStockArticleMapper; + @Autowired + private IDistributionStockArticleService distributionStockArticleService; + @Autowired + private DistributionSigndetailServiceImpl distributionSigndetailService; + @Autowired + private DistributionPackadeliServiceImpl distributionPackadeliService; + @Autowired + private DistributionDeliverySelfMapper distributionDeliverySelfMapper; + @Autowired + private IDistributionDeliverySelfService distributionDeliverySelfService; + @Autowired + private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; + @Autowired + private IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; + @Autowired + private DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; + @Autowired + private DistributionStockupMapper distributionStockupMapper; + @Autowired + private IDistributionStockupInfoService distributionStockupInfoService; + @Autowired + private DistributionStockMapper distributionStockMapper; + @Autowired + private DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; + @Autowired + private IDistributionAsyncService distributionAsyncService; + @Autowired + private IDictBizClient dictBizClient; + @Autowired + private IBasicdataDriverArteryClient iBasicdataDriverArteryClient; + @Autowired + private IBasicdataWarehouseClient warehouseClient; + @Autowired + private IDisStockListDetailService disStockListDetailService; + @Autowired + private DistributionStockListMapper distributionStockListMapper; + @Autowired + private IDistributionStockListService distributionStockListService; + @Autowired + private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; + @Autowired + private IBasicPrintTemplateClient basicPrintTemplateClient; + @Autowired + private IWarehouseTrayTypeClient warehouseTrayTypeClient; + @Autowired + private IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; + @Autowired + private IDistributionReservationZeroPackageService distributionReservationZeroPackageService; + @Autowired + private IDistributionParcelNumberService distributionParcelNumberService; + @Autowired + private IWarehouseTrayGoodsClient warehouseTrayGoodsClient; + @Autowired + private IWarehouseWaybillClient warehouseWaybillClient; + @Autowired + private BladeRedis bladeRedis; + @Autowired // 自提mapper - private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; - + private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; + @Autowired // 自提关联订单 - private final DistrilbutionBillStockMapper distrilbutionBillStockMapper; + private DistrilbutionBillStockMapper distrilbutionBillStockMapper; // 自提关联包件 - private final DistrilbutionBillPackageMapper distrilbutionBillPackageMapper; + @Autowired + private DistrilbutionBillPackageMapper distrilbutionBillPackageMapper; + @Autowired + private DistributionParcelListMapper distributionParcelListMapper; + @Autowired + private DistributionDeliveryChargeMapper distributionDeliveryChargeMapper; - private final DistributionParcelListMapper distributionParcelListMapper; + @Autowired + @Lazy + private IDistributionReservationService distributionReservationService; - private final DistributionDeliveryChargeMapper distributionDeliveryChargeMapper; + @Autowired + @Lazy + private IDistributionDeliveryListService distributionDeliveryListService; // private final IWarehouseRetentionScanClient warehouseRetentionScanClient; @@ -544,7 +596,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1) { - return Resp.scanSuccess("重复扫码", "重复扫码"); + return Resp.scanFail("重复扫码", "重复扫码"); } DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { @@ -585,23 +637,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); @@ -695,6 +745,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationLoadscanEntities = new ArrayList<>(); + List orderCodes = new ArrayList<>(); + List orderPackageCodes = new ArrayList<>(); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}", parcelListEntities); if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { @@ -718,6 +770,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl> allStockArticle = reservationStockarticleEntityList.stream().filter(f -> Func.isNotEmpty(f.getIsZero())).collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getIsZero)); DistributionDeliverySelfEntity finalDistributionDeliverySelfEntity = distributionDeliverySelfEntity; List updatePackageList = new ArrayList<>(); + List orderCodes = new ArrayList<>(); for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) { switch (reservationStockarticleEntity.getIsZero()) { case "0": @@ -1457,6 +1524,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId()); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { DistributionLoadscanEntity packageLoadingScan = distributionLoadscanService.getOne(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + //无装车数据包件进行装车 if (Func.isEmpty(packageLoadingScan)) { DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); BladeUser user = AuthUtil.getUser(); @@ -1503,26 +1571,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { List parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(reservationStockarticleEntity.getStockArticleId(), distrilbutionloadingscanDTO.getReservationId()); for (DistributionParcelNumberVO parcelNumberVO : parcelNumberVOS) { //这里需要查询是否已经存在有装车数据,如果有那么这里应该进行修改 @@ -1533,7 +1598,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { -// -// }); -// List stockListDetailEntityList = disStockListDetailService.list(Wrappers.query().lambda() -// .eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) -// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationInventoryStatusConstant.quxiao.getValue())); -// boolean inventoryLoadingFlag = stockListDetailEntityList.stream().allMatch(i -> i.getStockPackageStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())); -// boolean inventoryStockUpFlag = stockListDetailEntityList.stream().anyMatch(l -> Func.isEmpty(l.getStockPackageCode())); -// if (inventoryStockUpFlag) { -// log.error("##################库存品未备货"); -// return Resp.scanFail("操作失败","存在库存品未备货"); -//// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!"); -// } if (!inventoryLoadingFlag) { //存在库存品海为进行装车 for (DisStockListDetailEntity disStockListDetailEntity : stockListDetailEntityList) { @@ -1712,279 +1757,40 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId())); -// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub()); -// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub()); -// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub()); -// distributionStockListMapper.updateById(stockListEntity); + //扣减对应库存品在库数量 distributionStockListMapper.deductionQuantityStock(loadscaninvnEntity.getInventoryId(),loadscaninvnEntity.getLoadedNub()); } } } - //包件维护下架和装车状态 - distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId()); - + //维护配送任务装车状态 + distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); + //维护预约单装车状态 + distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId()); + //维护包件状态 + if (Func.isNotEmpty(orderCodes)){ + String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(",")); + distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId()); + } + //包件维护下架和装车状态 +// distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId()); + if (Func.isNotEmpty(updatePackageList)){ + String updownrOderPackages = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); + if (Func.isNotEmpty(orderPackages)){ + warehouseUpdownTypeClient.downPackage(updownrOderPackages,myCurrentWarehouse.getId()); + } + List packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); + if (Func.isNotEmpty(packageIds)){ + distributionParcelListMapper.updatePackageListByIds(packageIds); + } + } return Resp.scanSuccess("操作成功", "装车成功"); } -// //查询该客户下还未进行装车的包件 -// List reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.query().lambda() -// .eq(DistributionReservationPackageEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) -// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); -// List list = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList()); -// List distributionParcelListEntityList = distributionParcelListService.list(new QueryWrapper().lambda().in(DistributionParcelListEntity::getId, list)); - -// List parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); -// boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - - //判断库存品是否进行了备货任务,如果未进行备货任务无法进行一件装车 -// if (inventoryStockUpFlag) { -// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!"); -// } -// if (packageLoadingFlag && inventoryLoadingFlag) { -// return Resp.scanFail("重复操作","重复操作"); -// } -// else { -// if (!packageLoadingFlag) { -// //存在包件还未进行装车 -// for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { -// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { -// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); -// BladeUser user = AuthUtil.getUser(); -// loadscanEntity.setScanUser(user.getUserName()); -// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); -// loadscanEntity.setOneClick(2); -// loadscanEntity.setScanUser(user.getUserName()); -// loadscanEntity.setScanTime(new Date()); -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { -// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { -// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { -// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) { -// loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); -// } -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { -// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// if (Func.isNotEmpty(parcelListEntity.getQuantity())) { -// loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); -// } -// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) { -// loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId()); -// } -// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) { -// loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); -// } -// if (Func.isNotEmpty(parcelListEntity.getOrderPackageCode())) { -// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); -// } -// if (Func.isNotEmpty(parcelListEntity.getId())) { -// loadscanEntity.setPackageId(parcelListEntity.getId()); -// } -// if (Func.isNotEmpty(parcelListEntity.getId())) { -// loadscanEntity.setPackageId(parcelListEntity.getId()); -// } -// if (Func.isNotEmpty(parcelListEntity.getStockArticleId())) { -// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); -// } -// distributionLoadscanService.save(loadscanEntity); -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); -// Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); -// //异步修改包件状态 -// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId()); -// } -// } -// } -// -// } -// return R.success("成功"); -// } - - //2、查询该客户下是否存在库存品 - // 存在 --> 查询库存品是否均完成备货 - // 是 ---> 执行库存品一键装车 - // 否 ---> 提示库存品没有进行备货 - // 不存在 --> 直接进入包件的判断 - //3、数据构建 一件装车需要查询出该客户下的所有包件信息、库存品包件信息。 - //4、维护包件、订单、预约、库存品、装车字段 - //5、检查包件、订单是否和库位信息解除绑定,如果没有则进行解绑 - - -// //先查询有数据的 -// List distributionLoadscanEntities = baseMapper.selectdeliverOne(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); -// //无数据的 -// // List distributionLoadscanEntitiesno = baseMapper.selectdeliverOneNo(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); -// //查询所有的库存品(无拆包) -// //List distributionLoadscanvnEntities = baseMapper.selectdeliverOnevn(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); -// //查询所有的库存品(拆包) -// List distributionLoadscanvnEntitiesopen = baseMapper.selectdeliverOnevnopen(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); -// //将该客户所有的物品上该车辆 -// Integer flag = 0; -// Integer flag2 = 0; -// if (distributionLoadscanEntities.size() > 0) { -// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { -// //查询是否重复扫码 -// List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .ne(DistributionLoadscanEntity::getScanStatus, 1) -// ); -// -// if (distributionLoadscanEntitiesflag.size() > 0) { -// continue; -// } -// flag += 1; -// //依次插入该装车记录,设置车辆 -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { -// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); -// distributionLoadscanEntity.setOneClick(2); -// BladeUser user = AuthUtil.getUser(); -// distributionLoadscanEntity.setScanUser(user.getNickName()); -// distributionLoadscanEntity.setScanTime(new Date()); -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { -// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { -// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); -// //查询本车次是否第一次扫码,没有则更新上车时间 -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); -// //更新签收表的装车数量 -// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -// distributionLoadscanService.save(distributionLoadscanEntity); -// Long packageId = distributionLoadscanEntity.getPackageId(); -// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId); -// //TODO 这里一件装车需要进行判断 -// distributionAsyncService.changeDiscussDeliveryListStatus(parcelListEntity.getOrderPackageCode(),distrilbutionloadingscanDTO.getDeliveryId()); -// } -//// distributionLoadscanService.saveBatch(distributionLoadscanEntities); -// } -// //库存品装车 -//// if (distributionLoadscanvnEntities.size() > 0) { -//// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) { -//// //依次插入该装车记录,设置车辆 -//// if (null != distributionDeliverySelfEntity.getDriverId()) { -//// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -//// } -//// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -//// distributionLoadscanEntity.setScanStatus(2); -//// distributionLoadscanEntity.setScanType("1"); -//// distributionLoadscanEntity.setScanTime(new Date()); -//// if (null == distributionLoadscanEntity.getPackageNub()) { -//// distributionLoadscanEntity.setPackageNub(1); -//// } -//// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); -//// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -//// if (null != distributionDeliverySelfEntity.getDriverPhone()) { -//// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -//// } -//// if (null != distributionDeliverySelfEntity.getVehicleId()) { -//// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -//// } -//// //查询本车次是否第一次扫码,没有则更新上车时间 -//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); -//// //更新签收表的装车数量 -//// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -//// } -//// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities); -//// } -// if (distributionLoadscanvnEntitiesopen.size() > 0) { -// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) { -// //查询是否重复扫码 -// List distributionLoadscanEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1) -// ); -// -// if (distributionLoadscanEntitiesflag.size() > 0) { -// continue; -// } -// flag2 += 1; -// //依次插入该装车记录,设置车辆 -// if (null != distributionDeliverySelfEntity.getDriverId()) { -// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); -// distributionLoadscanEntity.setScanType("1"); -// distributionLoadscanEntity.setScanTime(new Date()); -// if (null == distributionLoadscanEntity.getPackageNub()) { -// distributionLoadscanEntity.setPackageNub(1); -// } -// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// if (null != distributionDeliverySelfEntity.getDriverPhone()) { -// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (null != distributionDeliverySelfEntity.getVehicleId()) { -// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// //查询本车次是否第一次扫码,没有则更新上车时间 -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); -// //更新签收表的装车数量 -// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -// } -// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen); -// } -// if (flag == 0 && flag2 == 0) { -// return R.fail(4002, "无数据进行装车"); -// } -// if (distributionLoadscanEntitiesno.size() > 0) { -// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntitiesno) { -// //查询是否重复扫码 -// List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId()) -// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .ne(DistributionLoadscanEntity::getScanStatus, 1) -// ); -// if (distributionLoadscanEntitiesflag.size() > 0) { -// continue; -// } -// //依次插入该装车记录,设置车辆 -// if (null != distributionDeliverySelfEntity.getDriverId()){ -// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// distributionLoadscanEntity.setScanStatus(2); -// distributionLoadscanEntity.setScanType("3"); -// distributionLoadscanEntity.setScanTime(new Date()); -// distributionLoadscanEntity.setScanState(1); -// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// if (null != distributionDeliverySelfEntity.getDriverPhone()) { -// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (null !=distributionDeliverySelfEntity.getVehicleId()){ -// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());} -// //查询本车次是否第一次扫码,没有则更新上车时间 -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); -// //更新签收表的装车数量 -// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -// } -// distributionLoadscanService.saveBatch(distributionLoadscanEntities); -// } -// return R.success("成功"); -// } @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class) @@ -2133,8 +1939,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId())); // BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock()); @@ -5237,10 +5047,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()).eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); if (Func.isNotEmpty(signforEntity)) { //标识该客户存在异常装车包件,为了后续的异常装车审核 @@ -6677,4 +6491,42 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl implements IDistributionSignforService { - - private final DistributionLoadscanServiceImpl distributionLoadscanService; - private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; - private final IDistributionParcelListService distributionParcelListService; - private final IDistributionStockArticleService distributionStockArticleService; - private final DistributionLoadscanMapper distributionLoadscanMapper; - private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; - private final DistributionDeliveryListMapper distributionDeliveryListMapper; - private final DistributionDeliverySelfMapper distributionDeliverySelfMapper; - private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; - private final DistributionSignforMapper distributionSignforMapper; - private final DistributionStockMapper distributionStockMapper; - private final IDictBizClient dictBizClient; - private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient; - private final IDistributionReservationPackageService reservationPackageService; - private final IDistributionAsyncService distributionAsyncService; - private final IBasicdataWarehouseClient basicdataWarehouseClient; - private final DistributionReservationMapper distributionReservationMapper; - private final IDisStockListDetailService disStockListDetailService; - private final IDistributionStockListService distributionStockListService; - private final DistributionStockListMapper distributionStockListMapper; - private final DistributionAddvalueMapper distributionAddvalueMapper; - private final IDistributionAddvalueService distributionAddvalueService; - private final IDistributionAddvaluePackageService distributionAddvaluePackageService; - private final IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; - private final IDistributionReservationStockarticleService distributionReservationStockarticleService; - private final IDistributionReservationPackageService distributionReservationPackageService; - private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService; - private final IDistributionSignPrintService iDistributionSignPrintService; - private final IDistributionParcelNumberService distributionParcelNumberService; - private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient; - private final DistributionStockArticleMapper distributionStockArticleMapper; - private final IBasicdataClientClient basicdataClientClient; - private final DistributionParcelListMapper distributionParcelListMapper; - - private final RabbitTemplate rabbitTemplate; - -// private final IBasicdataWarehouseClient warehouseUpdownTypeClient; + @Autowired + private DistributionLoadscanServiceImpl distributionLoadscanService; + @Autowired + private DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; + @Autowired + private IDistributionParcelListService distributionParcelListService; + @Autowired + private IDistributionStockArticleService distributionStockArticleService; + @Autowired + private DistributionLoadscanMapper distributionLoadscanMapper; + @Autowired + private DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; + @Autowired + private DistributionDeliveryListMapper distributionDeliveryListMapper; + @Autowired + private DistributionDeliverySelfMapper distributionDeliverySelfMapper; + @Autowired + private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; + @Autowired + private DistributionSignforMapper distributionSignforMapper; + @Autowired + private DistributionStockMapper distributionStockMapper; + @Autowired + private IDictBizClient dictBizClient; + @Autowired + private IBasicdataDriverArteryClient iBasicdataDriverArteryClient; + @Autowired + private IDistributionReservationPackageService reservationPackageService; + @Autowired + private IDistributionAsyncService distributionAsyncService; + @Autowired + private IBasicdataWarehouseClient basicdataWarehouseClient; + @Autowired + private DistributionReservationMapper distributionReservationMapper; + @Autowired + private IDisStockListDetailService disStockListDetailService; + @Autowired + private IDistributionStockListService distributionStockListService; + @Autowired + private DistributionStockListMapper distributionStockListMapper; + @Autowired + private DistributionAddvalueMapper distributionAddvalueMapper; + @Autowired + private IDistributionAddvalueService distributionAddvalueService; + @Autowired + private IDistributionAddvaluePackageService distributionAddvaluePackageService; + @Autowired + private IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; + @Autowired + private IDistributionReservationStockarticleService distributionReservationStockarticleService; + @Autowired + private IDistributionReservationPackageService distributionReservationPackageService; + @Autowired + private IDistributionReservationZeroPackageService distributionReservationZeroPackageService; + @Autowired + private IDistributionSignPrintService iDistributionSignPrintService; + @Autowired + private IDistributionParcelNumberService distributionParcelNumberService; + @Autowired + private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; + @Autowired + private DistributionStockArticleMapper distributionStockArticleMapper; + @Autowired + private IBasicdataClientClient basicdataClientClient; + @Autowired + private DistributionParcelListMapper distributionParcelListMapper; + @Autowired + @Lazy + private IDistributionDeliveryListService distributionDeliveryListService; + @Autowired + @Lazy + private IDistributionReservationService distributionReservationService; +@Autowired + private RabbitTemplate rabbitTemplate; + +// private IBasicdataWarehouseClient warehouseUpdownTypeClient; @Override public IPage selectDistributionSignforPage(IPage page, DistributionSignforVO distributionSignfor) { @@ -823,7 +862,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl list = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() @@ -1648,34 +1702,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper().lambda() -// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1) -// .eq(DistributionLoadscaninvnEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) -// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()) -// ); -// if (distributionLoadscaninvnEntities.size() <= 0) { -// return R.fail(3006, "该库存品并未装车处理"); -// } -// //修改装车表状态 -// boolean b = false; -// for (DistributionLoadscaninvnEntity distributionLoadscaninvnEntity : distributionLoadscaninvnEntities) { -// distributionLoadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); -// distributionLoadscaninvnEntity.setSignforState(2); -// distributionLoadscaninvnEntity.setReceivedQuantity(1); -// b = distributionLoadscaninvnService.updateById(distributionLoadscaninvnEntity); -// //修改签收表司机签收数量 -// this.update(new UpdateWrapper().lambda() -// .eq(DistributionSignforEntity::getReservationId, distributionLoadscaninvnEntity.getReservationId()) -// .setSql("receivedin_quantity = receivedin_quantity + " + 1) -// ); -// } -// -// return R.status(b); } @Override @@ -2305,114 +2337,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl unLoadingiNventoryList = detailEntities.stream().filter(i -> i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList()); -// if (Func.isNotEmpty(unLoadingiNventoryList) && unLoadingiNventoryList.size() > 0) { -// for (DisStockListDetailEntity disStockListDetailEntity : unLoadingiNventoryList) { -//// --------------------修改库存品包件装车和签收状态—————————————————————————————————————————— -// disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); -// disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); -// disStockListDetailService.updateById(disStockListDetailEntity); -// -// DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity(); -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { -// loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { -// loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { -// loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { -// loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { -// loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); -// loadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode()); -// loadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId()); -// loadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); -// loadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId()); -// loadscaninvnEntity.setScanUser(user.getNickName()); -// loadscaninvnEntity.setScanTime(new Date()); -// loadscaninvnEntity.setPackageNub(disStockListDetailEntity.getNum()); -// loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); -// loadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); -// loadscaninvnEntity.setScanType("1"); -// loadscaninvnEntity.setType(2); -// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); -// loadscaninvnEntity.setIsSignfor(1); -// loadscaninvnEntity.setReceivedQuantity(disStockListDetailEntity.getNum()); -// loadscaninvnEntity.setOneClick(2); -// loadscaninvnEntity.setOneQclick(2); -// loadscaninvnEntity.setSigningUser(user.getNickName()); -// loadscaninvnEntity.setSigningUserId(user.getUserId()); -// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); -// -// if (distributionSignfor.getIsClerk()) { -// loadscaninvnEntity.setMsg("文员一键签收数据补录"); -// } else { -// loadscaninvnEntity.setMsg("司机一键签收数据补录"); -// } -// distributionLoadscaninvnService.save(loadscaninvnEntity); -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// //更新签收表的签收数量和装车数量 -// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); -// //维护预约库存品数据 -// //扣减库存 -// DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId()); -// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub()); -// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub()); -// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub()); -// distributionStockListService.updateById(stockListEntity); -// } -// } -// //库存品扫描记录补充 -// for (DisStockListDetailEntity detailEntity : detailEntities) { -// if (detailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())) { -// detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); -// disStockListDetailService.updateById(detailEntity); -// //查询出对于的装车扫描记录 -// List list = distributionLoadscaninvnService.list(Wrappers.query().lambda() -// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionSignfor.getDeliveryId()) -// .eq(DistributionLoadscaninvnEntity::getReservationId, distributionSignfor.getReservationId()) -// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode()) -// .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); -// if (list.size() == 1) { -// //正常进行扫描记录签收修改 -// DistributionLoadscaninvnEntity loadscaninvnEntity = list.get(0); -// if (distributionSignfor.getIsClerk()) { -// loadscaninvnEntity.setMsg("文员一键签收数据补录"); -// } else { -// loadscaninvnEntity.setMsg("司机一键签收数据补录"); -// } -// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); -// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); -// loadscaninvnEntity.setOneClick(1); -// loadscaninvnEntity.setOneQclick(2); -// loadscaninvnEntity.setSigningUser(user.getUserName()); -// loadscaninvnEntity.setSigningUserId(user.getUserId()); -// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); -// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); -// distributionLoadscaninvnService.updateById(loadscaninvnEntity); -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); -// } else { -// log.error("################库存品未进行备货操作+{}" + list); -// //此时说明在同一配送任务下,同一客户出现了相同的库存品包件码 -// } -// } -// //对库存品包件上级的状态维护 -// distributionAsyncService.checkStockArticleListSigningStatus(detailEntity); -// } } else { log.error("################库存品未进行备货操作+{}" + detailEntities); return R.fail("库存品未进行备货操作"); @@ -2565,6 +2491,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageIds = new ArrayList<>(); + List orderCodes = new ArrayList<>(); if (Func.isNotEmpty(parcelListEntityList)) { for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { //查询是否进行装车 @@ -2628,9 +2555,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}", parcelListEntity.getOrderPackageCode()); -// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); } else { //存在装车数据 if (distributionSignfor.getIsClerk()) { @@ -2659,6 +2583,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl list = distributionLoadscanService.list(Wrappers.query().lambda() -// .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()) -// .eq(DistributionLoadscanEntity::getDeliveryId, distributionSignforEntity.getDeliveryId()) -// .eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()) -// .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); -// if (list.size() == 1) { -// DistributionLoadscanEntity loadscanEntity = list.get(0); -// if (distributionSignfor.getIsClerk()) { -// loadscanEntity.setMsg("文员一键签收数据补录"); -// } else { -// loadscanEntity.setMsg("司机一键签收数据补录"); -// } -// loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); -// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); -// loadscanEntity.setOneClick(1); -// loadscanEntity.setOneQclick(2); -// loadscanEntity.setSigningUser(user.getUserName()); -// loadscanEntity.setSigningUserId(user.getUserId()); -// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); -// loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); -// distributionLoadscanService.updateById(loadscanEntity); -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// } else { -// //一个配送任务下,同一个客户出现了相同的包件信息 -// log.error("#########相同的包件信息={}" + parcelListEntity.getId()); -// } -// } else { -// log.error("#########包件异常{}" + parcelListEntity.getId()); -// } -// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity); -// } -// } - - -// if (Func.isNotEmpty(noLoadingPackage) && noLoadingPackage.size() > 0) { -// //存在有未装车的包件信息 -// //统计新装车的包件数 -// for (DistributionParcelListEntity parcelListEntity : noLoadingPackage) { -// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); -// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); -// distributionParcelListService.updateById(parcelListEntity); -// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); -// loadscanEntity.setPackageId(parcelListEntity.getId()); -// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); -// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); -// loadscanEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); -// loadscanEntity.setReservationId(distributionSignforEntity.getReservationId()); -// loadscanEntity.setScanUser(user.getUserName()); -// loadscanEntity.setScanTime(new Date()); -// loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); -// loadscanEntity.setSigningUser(user.getUserName()); -// loadscanEntity.setSigningUserId(user.getUserId()); -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { -// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { -// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { -// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { -// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// } -// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { -// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); -// loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); -// loadscanEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); -// loadscanEntity.setScanType("1"); -// loadscanEntity.setType(2); -// loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); -// loadscanEntity.setIsSignfor(1); -// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity()); -// loadscanEntity.setOneClick(2); -// loadscanEntity.setOneQclick(2); -// loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); -// if (distributionSignfor.getIsClerk()) { -// loadscanEntity.setMsg("文员一键签收数据补录"); -// } else { -// loadscanEntity.setMsg("司机一键签收数据补录"); -// } -// distributionLoadscanService.save(loadscanEntity); -// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// //更新签收表的签收数量和装车数量 -// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity); -// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); -// -//// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity); -// //保存完成签收包件装车数量累加 -// } -// } //维护客户信息状态 reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); @@ -2804,171 +2633,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionLoadscanEntities = distributionDeliveryListMapper.selectdeliverOne(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId()); -// //查询所有的库存品(拆包) -// List distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper.selectdeliverOnevnopen(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId()); -// //将该客户所有的物品上该车辆 -// if (distributionLoadscanEntities.size() > 0) { -// //配送订单数据 -// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { -// //查询该包件是否扫码 -// List distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .ne(DistributionLoadscanEntity::getScanStatus, 1) -// ); -// if (distributionLoadscanEntitiesflag.size() > 0) { -// //有扫码记录 -// // 修改该记录 -// for (DistributionLoadscanEntity loadscanEntity : distributionLoadscanEntitiesflag) { -// if (loadscanEntity.getSignforState() == 2) break; -// distributionLoadscanService.update(new UpdateWrapper().lambda() -// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .set(DistributionLoadscanEntity::getSigningTime, simpleDateFormat.format(new Date())) -// .set(DistributionLoadscanEntity::getSignforState, 2) -// .set(DistributionLoadscanEntity::getReceivedQuantity, 1) -// ); -// //修改签收数量 -// distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// //更新签收表的签收数量和装车数量 -//// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// } -//// distributionLoadscanService.update() -// continue; -// }else{ -// //没有扫码数据 -// //依次插入该装车记录,设置车辆, -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { -// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); -// distributionLoadscanEntity.setReceivedQuantity(1); -// if (null == distributionLoadscanEntity.getPackageNub()) { -// distributionLoadscanEntity.setPackageNub(1); -// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub()); -// } -// distributionLoadscanEntity.setScanType("1"); -// distributionLoadscanEntity.setMsg("司机签收"); -// if (distributionSignfor.getIsClerk()) { -// distributionLoadscanEntity.setMsg("文员签收"); -// } -//// distributionLoadscanEntity.setOneClick(2); -// distributionLoadscanEntity.setSignforState(2); -// distributionLoadscanEntity.setOneQclick(2); -//// distributionLoadscanEntity.setScanTime(new Date()); -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { -// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { -// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); -// distributionLoadscanService.save(distributionLoadscanEntity); -// } -// //查询本车次是否第一次扫码,没有则更新上车时间 -//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// //更新签收表的签收数量和装车数量 -// Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -// -// } -// } -// if (distributionLoadscanvnEntitiesopen.size() > 0) { -// //库存品数据 -// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) { -// //查询是否重复扫码 -// List distributionLoadscaninvnEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1) -// .eq(DistributionLoadscaninvnEntity::getSignforState, 2) -// ); -// if (distributionLoadscaninvnEntitiesflag.size() > 0) { -// // 修改该记录 -// for (DistributionLoadscaninvnEntity loadscanEntity : distributionLoadscaninvnEntitiesflag) { -// if (loadscanEntity.getSignforState() == 2) break; -// distributionLoadscaninvnService.update(new UpdateWrapper().lambda() -// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()) -// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode()) -// .set(DistributionLoadscaninvnEntity::getSigningTime, simpleDateFormat.format(new Date())) -// .set(DistributionLoadscaninvnEntity::getSignforState, 2) -// .set(DistributionLoadscaninvnEntity::getReceivedQuantity, 1) -// ); -// //更新签收表的签收数量和装车数量 -// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); -// } -//// distributionLoadscanService.update() -// continue; -// } -// //依次插入该装车记录,设置车辆 -// if (null != distributionDeliverySelfEntity.getDriverId()) { -// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); -// } -// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue()); -// distributionLoadscanEntity.setScanType("1"); -// distributionLoadscanEntity.setReceivedQuantity(1); -//// distributionLoadscanEntity.setOneClick(2); -// distributionLoadscanEntity.setSignforState(2); -// distributionLoadscanEntity.setOneQclick(2); -// distributionLoadscanEntity.setMsg("司机签收"); -// if (distributionSignfor.getIsClerk()) { -// distributionLoadscanEntity.setMsg("文员签收"); -// } -//// distributionLoadscanEntity.setScanTime(new Date()); -// if (null == distributionLoadscanEntity.getPackageNub()) { -// distributionLoadscanEntity.setPackageNub(1); -// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub()); -// } -// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); -// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); -// if (null != distributionDeliverySelfEntity.getDriverPhone()) { -// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); -// } -// if (null != distributionDeliverySelfEntity.getVehicleId()) { -// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); -// } -// //查询本车次是否第一次扫码,没有则更新上车时间 -//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); -// //更新签收表的装车数量和签收数量 -// Integer j = distributionSignforMapper.updatesignforByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); -// } -// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen); -// } - -// boolean update = this.update(new UpdateWrapper().lambda() -// .eq(DistributionSignforEntity::getId, distributionSignforEntity.getId()) -// .set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures()) -// .set(StringUtils.isNotBlank(distributionSignfor.getSigningType()), DistributionSignforEntity::getSigningType, distributionSignfor.getSigningType()) -// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningStatus, 2) -// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date())) -// .set(distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getClerkSignRemarks()), DistributionSignforEntity::getSigningStatus, distributionSignfor.getClerkSignRemarks()) -// .set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks()) -// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2) -// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date())) -// ); -// return R.status(true); -// } @Override public R offline(String offlineJson) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 604f0ed7a..0fa281ffb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -49,7 +49,11 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.common.IsOrNoConstant; +import org.springblade.common.constant.order.OrderReservationStatusConstant; import org.springblade.common.constant.order.OrderStatusConstant; +import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant; +import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; +import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; @@ -1445,6 +1449,102 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderCode, s) + .eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()) + .eq(DistributionParcelListEntity::getWarehouseId, warehouseId) + ); + if (Func.isEmpty(parcelListEntities)) { + log.error(method + "查询包件列表空orderCode:{}", s); + throw new RuntimeException("包件列表为空"); + } + //在库数量 + int inWarehouseQuantity = 0; + //装车数量 + int loadingQuantity = 0; + //配送件数 + int deliveryQuantity = 0; + //签收件数 + int signingQuantity = 0; + //订单总件数 + int totalNumber = stockArticleEntity.getTotalNumber().intValue(); + for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { + //统计订单相关的状态节点数量 + if (parcelListEntity.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())) { + deliveryQuantity += parcelListEntity.getQuantity(); + } + if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())) { + loadingQuantity += parcelListEntity.getQuantity(); + } + if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { + signingQuantity += parcelListEntity.getQuantity(); + } + + } + inWarehouseQuantity += stockArticleEntity.getTotalNumber() - loadingQuantity; + + stockArticleEntity.setHandQuantity(inWarehouseQuantity); + stockArticleEntity.setDeliveryQuantity(deliveryQuantity); + stockArticleEntity.setSigninQuantity(signingQuantity); + if (totalNumber != 0) { + + if (totalNumber == deliveryQuantity) { + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + } else { + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + } + if (deliveryQuantity == 0) { + stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); + } + + + //未签收的情况下分析订单的装车状态,此时该订单未有包件进行其拿手 + if (signingQuantity == 0) { + if (totalNumber == loadingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + } + if (loadingQuantity == 0) { + if (totalNumber == inWarehouseQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); + } + } + } else { + //订单存在签收数据了,此时就需要进行签收状态的判断 + if (totalNumber == signingQuantity) { + stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + } else { + stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + } + } + this.updateById(stockArticleEntity); + } + } + } + + + + @Override public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) {