diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java index 5ece85190..8ced3beb3 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java @@ -278,6 +278,12 @@ public class DistributionLoadscaninvnEntity extends TenantEntity { @ApiModelProperty(value = "配送表id") private Long deliveryId; + /** + * 配送表id + */ + @ApiModelProperty(value = "配送表id") + private Long inventoryPackageId; + /** * 装车数量 */ 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 2de9e1360..906fafde8 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 @@ -191,7 +191,7 @@ public interface DistributionSignforMapper extends BaseMapper selectSignImgsUrl(@Param("reservationId")Long reservationId); List exportDistributionSignforSigningOwn(@Param("param") DistributionSignforVO distributionSignforVO); + + /** + * 修改库存品签收数量 + * @param deliveryId + * @param reservationId + * @param packageNub + * @return + */ + Integer updatesignforByinvn(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 354ae69f7..6d633e40d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -57,9 +57,12 @@ UPDATE logpm_distribution_signfor lds set lds.received_quantity = ( lds.received_quantity + #{packageNub} ),lds.loaded_number = ( lds.loaded_number + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId} - + UPDATE logpm_distribution_signfor lds set lds.loadedin_number = ( lds.loadedin_number + #{packageNub} ),lds.receivedin_quantity = ( lds.receivedin_quantity + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId} + + UPDATE logpm_distribution_signfor lds set lds.receivedin_quantity = ( lds.receivedin_quantity + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId} + DELETE FROM logpm_distribution_signfor 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 490792790..0e9aa1f59 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 @@ -1651,10 +1651,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl disStockListDetailEntities = detailEntities.stream().filter(d -> d.getStockPackageCode().equals(barcode)).collect(Collectors.toList()); if (disStockListDetailEntities.size() == 1) { + DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(0); + disStockListDetailEntity.setStockLockingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + disStockListDetailService.updateById(disStockListDetailEntity); DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntities); distributionLoadscaninvnService.save(distributionLoadscaninvnEntity); //查询本车次是否第一次扫码,没有则更新上车时间 @@ -2143,7 +2149,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionAppDeliveryListVOS = new ArrayList<>(); boolean delivery = false; - String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); + String value1 = DictBizCache.getValue("role_class", "delivery_driver"); if (roleId.contains(value1)) delivery = true; 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 876bb577f..f0a121910 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 @@ -176,35 +176,36 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionSignforList = baseMapper.exportDistributionSignforOwn(distributionSignforVO); + List distributionSignforList = baseMapper.exportDistributionSignforOwn(distributionSignforVO); List list = new ArrayList<>(); distributionSignforList.forEach(d -> { // distributionSignfor.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSignfor.getType())); - DistributionSignforExcel signforExcel = new DistributionSignforExcel(); - BeanUtils.copyProperties(d,signforExcel); + DistributionSignforExcel signforExcel = new DistributionSignforExcel(); + BeanUtils.copyProperties(d, signforExcel); // signforExcel.setConsignee(); - String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); - signforExcel.setDeliveryTypeName(value); - String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); - signforExcel.setSigningStatusName(value1); - String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); - signforExcel.setDriverSigningName(value2); - String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); - signforExcel.setDeliveryWayName(value3); - list.add(signforExcel); - }); - return list; + String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); + signforExcel.setDeliveryTypeName(value); + String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); + signforExcel.setSigningStatusName(value1); + String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); + signforExcel.setDriverSigningName(value2); + String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); + signforExcel.setDeliveryWayName(value3); + list.add(signforExcel); + }); + return list; } + @Override public List exportDistributionSignforOwn(Map distributionSignfor) { Object o = distributionSignfor.get("ids"); - if(ObjectUtils.isNotNull(o)){ + if (ObjectUtils.isNotNull(o)) { distributionSignfor.remove("ids"); } // BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); @@ -218,8 +219,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionSignforList = baseMapper.exportDistributionSignforSigningOwn(distributionSignforVO); List list = new ArrayList<>(); - distributionSignforList.forEach(d ->{ - DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel(); - BeanUtils.copyProperties(d,signforExcel); - String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); - signforExcel.setDeliveryTypeName(value); - String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); - signforExcel.setSigningStatusName(value1); - String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); - signforExcel.setDriverSigningName(value2); - String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); - signforExcel.setDeliveryWayName(value3); - - list.add(signforExcel); - }); - return list; + distributionSignforList.forEach(d -> { + DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel(); + BeanUtils.copyProperties(d, signforExcel); + String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); + signforExcel.setDeliveryTypeName(value); + String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); + signforExcel.setSigningStatusName(value1); + String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); + signforExcel.setDriverSigningName(value2); + String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); + signforExcel.setDeliveryWayName(value3); + + list.add(signforExcel); + }); + return list; } @Override @@ -492,7 +493,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); - if (Func.isNotEmpty(orderIds)){ + if (Func.isNotEmpty(orderIds)) { List stockArticleEntities = distributionStockArticleService.listByIds(orderIds); List printEntities = baseMapper.selectSignImgsUrl(distributionSignforVO.getReservationId()); distributionSignforVO.setPrintVOList(printEntities); @@ -1254,9 +1255,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl deliveryStockArticleInfo = distributionDeliveryListMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); // deliveryStockArticleInfo.forEach(); List distributionReservationEntities = distributionDeliveryListMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); - distributionReservationEntities.forEach(r->{ + distributionReservationEntities.forEach(r -> { List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); - reservationStockarticleEntityList.forEach(rs->{ + reservationStockarticleEntityList.forEach(rs -> { List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda() .eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()) .eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()) @@ -1265,9 +1266,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId()); @@ -1434,108 +1435,194 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl Func.isNotEmpty(s.getStockPackageCode())); //只要库存品没有进行备货操作则不能进行一件装车操作 if (flag) { - //库存品均已备货 - List 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(); + for (DisStockListDetailEntity detailEntity : detailEntities) { + DistributionLoadscaninvnEntity loadscaninvnEntity = distributionLoadscaninvnService.getOne(Wrappers.query().lambda() + .eq(DistributionLoadscaninvnEntity::getReservationId, detailEntity.getReservationId()) + .eq(DistributionLoadscaninvnEntity::getInventoryId, detailEntity.getStockListId()) + .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode()) + .eq(DistributionLoadscaninvnEntity::getInventoryPackageId, detailEntity.getId()) + .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + if (Func.isNotEmpty(loadscaninvnEntity)) { + if (!loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){ + //存在库存品装车数据,这里进行签收状态修改 + loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); + loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); + loadscaninvnEntity.setOneClick(1); + loadscaninvnEntity.setOneQclick(2); + loadscaninvnEntity.setSigningUser(user.getNickName()); + 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 { + //不存在装车数据 这里需要进行装车数据的补录 + detailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); + detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); + disStockListDetailService.updateById(detailEntity); + DistributionLoadscaninvnEntity newLoadscaninvnEntity = new DistributionLoadscaninvnEntity(); if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { - loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + newLoadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); } if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { - loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + newLoadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); } if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { - loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + newLoadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); } if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { - loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + newLoadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); } if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { - loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + newLoadscaninvnEntity.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())); - + newLoadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); + newLoadscaninvnEntity.setOrderPackageCode(detailEntity.getStockPackageCode()); + newLoadscaninvnEntity.setInventoryId(detailEntity.getStockListId()); + newLoadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); + newLoadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId()); + newLoadscaninvnEntity.setInventoryPackageId(detailEntity.getId()); + newLoadscaninvnEntity.setScanUser(user.getNickName()); + newLoadscaninvnEntity.setScanTime(new Date()); + newLoadscaninvnEntity.setPackageNub(detailEntity.getNum()); + newLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); + newLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); + newLoadscaninvnEntity.setScanType("1"); + newLoadscaninvnEntity.setType(2); + newLoadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); + newLoadscaninvnEntity.setIsSignfor(1); + newLoadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); + newLoadscaninvnEntity.setOneClick(2); + newLoadscaninvnEntity.setOneQclick(2); + newLoadscaninvnEntity.setSigningUser(user.getNickName()); + newLoadscaninvnEntity.setSigningUserId(user.getUserId()); + newLoadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); if (distributionSignfor.getIsClerk()) { - loadscaninvnEntity.setMsg("文员一键签收数据补录"); + newLoadscaninvnEntity.setMsg("文员一键签收数据补录"); } else { - loadscaninvnEntity.setMsg("司机一键签收数据补录"); + newLoadscaninvnEntity.setMsg("司机一键签收数据补录"); } - distributionLoadscaninvnService.save(loadscaninvnEntity); + distributionLoadscaninvnService.save(newLoadscaninvnEntity); Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); //更新签收表的签收数量和装车数量 - Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); + Integer j = distributionSignforMapper.updateLoadAndsignforByinvn(newLoadscaninvnEntity.getDeliveryId(), newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.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()); + DistributionStockListEntity stockListEntity = distributionStockListService.getById(detailEntity.getStockListId()); + stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - newLoadscaninvnEntity.getPackageNub()); + stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - newLoadscaninvnEntity.getPackageNub()); + stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + newLoadscaninvnEntity.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); - } + + +// //库存品均已备货 +// List 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("一键装车失败!!!库存品都备货了!?"); @@ -2222,22 +2309,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntityList.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntityList.getReservationId())); BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); BigDecimal signingNumber = new BigDecimal(signforEntity.getReceivedQuantity()); - if (loadscanEntityList.getLoadedNub() < p.getSigningNum()){ + if (loadscanEntityList.getLoadedNub() < p.getSigningNum()) { //这里需要同时维护装车和签收数量 // loadscanEntityList.setLoadedNub(p.getSigningNum()); // loadscanEntityList.setPackageNub(p.getSigningNum()); @@ -2746,49 +2833,49 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl checkAddValuePackageList(IPage page,Map addValueDTO) { + public IPage checkAddValuePackageList(IPage page, Map addValueDTO) { String reservationId = (String) addValueDTO.get("reservationId"); - if (Func.isEmpty(reservationId)){ + if (Func.isEmpty(reservationId)) { log.error("##################无reservationId"); return null; } List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(Long.parseLong(reservationId)); List addvaluePackageVOS = new ArrayList<>(); - if (Func.isNotEmpty(reservationStockarticleEntityList)){ + if (Func.isNotEmpty(reservationStockarticleEntityList)) { List orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); LambdaQueryWrapper orderQW = Wrappers.query().lambda().in(DistributionStockArticleEntity::getId, orderIds); - if (Func.isNotEmpty(addValueDTO.get("orderCode"))){ + if (Func.isNotEmpty(addValueDTO.get("orderCode"))) { orderQW.like(DistributionStockArticleEntity::getOrderCode, addValueDTO.get("orderCode")); } List orderList = distributionStockArticleService.list(orderQW); - orderList.forEach(rs->{ - if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ - List addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); - if (Func.isNotEmpty(addvaluepackageVO)){ + orderList.forEach(rs -> { + if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) { + List addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(Long.parseLong(reservationId), rs.getId(), addValueDTO); + if (Func.isNotEmpty(addvaluepackageVO)) { addvaluePackageVOS.addAll(addvaluepackageVO); } - }else { - List addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); - if (Func.isNotEmpty(addvalueZeroPackageVO)){ + } else { + List addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(Long.parseLong(reservationId), rs.getId(), addValueDTO); + if (Func.isNotEmpty(addvalueZeroPackageVO)) { addvaluePackageVOS.addAll(addvalueZeroPackageVO); } } }); } List distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(Long.parseLong(reservationId)); - if (Func.isNotEmpty(distributionReservationStocklistEntities)){ + if (Func.isNotEmpty(distributionReservationStocklistEntities)) { List inventoryIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList()); LambdaQueryWrapper inventoryQW = Wrappers.query().lambda().in(DistributionStockListEntity::getId, inventoryIds); - if (Func.isNotEmpty(addValueDTO.get("materialName"))){ - inventoryQW.like(DistributionStockListEntity::getDescriptionGoods,addValueDTO.get("materialName")); + if (Func.isNotEmpty(addValueDTO.get("materialName"))) { + inventoryQW.like(DistributionStockListEntity::getDescriptionGoods, addValueDTO.get("materialName")); } - if (Func.isNotEmpty(addValueDTO.get("materialCode"))){ - inventoryQW.like(DistributionStockListEntity::getCargoNumber,addValueDTO.get("materialCode")); + if (Func.isNotEmpty(addValueDTO.get("materialCode"))) { + inventoryQW.like(DistributionStockListEntity::getCargoNumber, addValueDTO.get("materialCode")); } List stockListEntityList = distributionStockListService.list(inventoryQW); - stockListEntityList.forEach(inven->{ - List addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(Long.parseLong(reservationId),inven.getId(),addValueDTO); - if (Func.isNotEmpty(addvalueinventoryPackageVO)){ + stockListEntityList.forEach(inven -> { + List addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(Long.parseLong(reservationId), inven.getId(), addValueDTO); + if (Func.isNotEmpty(addvalueinventoryPackageVO)) { addvaluePackageVOS.addAll(addvalueinventoryPackageVO); } });