diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java index ddfd812fc..8b0aa8a3a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java @@ -239,7 +239,7 @@ public class DistributionSignforAppController { if(StringUtils.isBlank(orderPackageCodes)){ orderPackageCodes = packageCode+""; }else{ - orderPackageCodes = orderPackageCodes + "," +packageCode; + orderPackageCodes = orderPackageCodes + "," + packageCode; } } BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java index 9f591fb63..73d095ac0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java @@ -153,7 +153,20 @@ public class DistributionStockListController extends BladeController { return R.fail(e.getMessage()); } return R.data(orderPackgeCodeDataVo); + } + @GetMapping("/showInventoryPackgeCode") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "返回模板和模板内容") + public R showOrderPackgeCode(@ApiIgnore @RequestParam Long id){ + + OrderPackgeCodeDataVO orderPackgeCodeDataVo= null; + try { + orderPackgeCodeDataVo = distributionStockListService.showInvnetoryPackgeCode(id); + } catch (Exception e) { + return R.fail(e.getMessage()); + } + return R.data(orderPackgeCodeDataVo); } 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 44d5cdbbe..a6beae1dc 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 @@ -121,9 +121,7 @@ FROM logpm_distribution_stockup_info AS ldsi LEFT JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id - WHERE - ldsi.reservation_id = lds.reservation_id - ) AS t ON t.reservation_id = ldsi.reservation_id + ) AS t ON t.reservation_id = lds.reservation_id lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index 1bb5d54df..943fd0bd1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -196,6 +196,12 @@ public interface IDistributionStockListService extends BaseService 这里一件签收针对的就是制定的任务下的包件和库存品 @@ -3986,16 +3991,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl> map = distributionSignfor.getMap(); -// if (Func.isEmpty(map)){ -// log.error("#############无图片信息:{}", map); -// return R.fail("无图片信息"); -// } + this.updatePicture(distributionSignfor); //2、维护状态 DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distributionSignfor.getReservationId()); if (Func.isEmpty(reservationEntity)) { - log.error("#############reservationEntity参数错误:{}", reservationEntity); + + log.error(method+"reservationEntity参数错误:{}", reservationEntity); return R.fail("服务器正忙~~"); } //查询数据 @@ -4007,7 +4009,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId()); if (detailEntities.size() > 0 && Func.isNotEmpty(detailEntities)) { + loadingInventoryNum+=detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum(); + signingInventoryNum+=detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum(); boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode())); //只要库存品没有进行备货操作则不能进行一件装车操作 if (flag) { @@ -4059,11 +4063,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl parcelNumberEntityList = distributionReservationMapper.selectZeroPackageListByReservationId(distributionSignforEntity.getReservationId()); if (Func.isNotEmpty(parcelNumberEntityList)) { + loadingPackageNum += parcelNumberEntityList.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum(); + signingPackageNum += parcelNumberEntityList.stream().mapToInt(DistributionParcelNumberDTO::getReservationNum).sum(); for (DistributionParcelNumberDTO parcelNumberEntity : parcelNumberEntityList) { DistributionLoadscanEntity distributionLoadscanEntity = distributionLoadscanService.getOne(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()).eq(DistributionLoadscanEntity::getPackageId, parcelNumberEntity.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + DistributionParcelNumberEntity parcelNumberServiceById = distributionParcelNumberService.getOne(Wrappers.query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, parcelNumberEntity.getId())); + Integer outboundQuantity = 0; + Integer signinQuantity = 0; + Integer deliveryQuantity = 0; + Integer handQuantity = 0; if (Func.isNotEmpty(distributionLoadscanEntity)) { //情况列举: // 1、装车件数未按照计划数量 @@ -4150,67 +4152,42 @@ public class DistributionSignforServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionParcelNumberEntity::getParcelListId, parcelNumberEntity.getId())); + if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { //装车数量和签收数量只会一样, - if (distributionLoadscanEntity.getReceivedQuantity() > 0) { - distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).subtract(receivedQuantity).intValue()); - distributionParcelNumberEntity.setHandQuantity(handQuantity.add(receivedQuantity).subtract(reservationNum).intValue()); - distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity.add(reservationNum).subtract(receivedQuantity).intValue()); - distributionParcelNumberEntity.setDeliveryQuantity(deliveryQuantity.add(receivedQuantity).subtract(reservationNum).intValue()); - distributionParcelNumberService.updateById(distributionParcelNumberEntity); + if (distributionLoadscanEntity.getReceivedQuantity() > 0 && distributionLoadscanEntity.getReceivedQuantity() <= parcelNumberEntity.getReservationNum()) { + outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum(); + signinQuantity = distributionParcelNumberEntity.getSigninQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberEntity.getReservationNum(); + deliveryQuantity = distributionParcelNumberEntity.getDeliveryQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum(); + handQuantity = distributionParcelNumberEntity.getHandQuantity() + distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum(); + //装车按照计划完成装车 + distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum()); + distributionLoadscanService.updateById(distributionLoadscanEntity); } else { - log.error("################扫描签收零担订单数量为0:{}", distributionLoadscanEntity); - return Resp.scanFail("服务器正忙...", "请稍后重试"); + log.error("################扫描签收零担订单数量异常:{}", distributionLoadscanEntity); + return Resp.scanFail("数量录入错误", "数量录入错误"); } } else if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.weiqianshou.getValue())) { - if (distributionLoadscanEntity.getLoadedNub().equals(parcelNumberEntity.getReservationNum())) { - //装车数量和计划数量一致,这里进行签收数量的维护 - //修改这里装车数量已经维护好了,只需要维护签收数量 - distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).intValue()); - distributionParcelNumberService.updateById(distributionParcelNumberEntity); + outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum()); + signinQuantity = distributionParcelNumberEntity.getSigninQuantity() + distributionLoadscanEntity.getReceivedQuantity(); + deliveryQuantity = distributionParcelNumberEntity.getDeliveryQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum()); + handQuantity = distributionParcelNumberEntity.getHandQuantity() + (distributionLoadscanEntity.getLoadedNub() - parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum()); + distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); + if (distributionSignfor.getIsClerk()) { + distributionLoadscanEntity.setMsg("文员一键签收数据补录"); } else { - if (distributionLoadscanEntity.getLoadedNub() > 0) { - distributionParcelNumberEntity.setSigninQuantity(signinQuantity.add(reservationNum).intValue()); - distributionParcelNumberEntity.setHandQuantity(handQuantity.add(loadedQuantity).subtract(reservationNum).intValue()); - distributionParcelNumberEntity.setOutboundQuantity(outboundQuantity.add(reservationNum).subtract(loadedQuantity).intValue()); - distributionParcelNumberEntity.setDeliveryQuantity(deliveryQuantity.add(loadedQuantity).subtract(reservationNum).intValue()); - distributionParcelNumberService.updateById(distributionParcelNumberEntity); - } + distributionLoadscanEntity.setMsg("司机一键签收数据补录"); } - } else { - log.error("##################扫描签收状态异常:{}", distributionLoadscanEntity.getId()); - throw new RuntimeException("服务器正忙..."); - } - distributionLoadscanEntity.setReceivedQuantity(parcelNumberEntity.getReservationNum()); - distributionLoadscanEntity.setLoadedNub(parcelNumberEntity.getReservationNum()); - distributionLoadscanEntity.setPackageNub(parcelNumberEntity.getReservationNum()); - distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); - if (distributionSignfor.getIsClerk()) { - distributionLoadscanEntity.setMsg("文员一键签收数据补录"); - } else { - distributionLoadscanEntity.setMsg("司机一键签收数据补录"); + distributionLoadscanService.updateById(distributionLoadscanEntity); } - distributionLoadscanService.updateById(distributionLoadscanEntity); - distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId()); - //更新签收人 - Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser()); - //维护签收数量 - DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.query().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, distributionLoadscanEntity.getReservationId())); - BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); - BigDecimal signingReceivedQuantity = new BigDecimal(signforEntity.getReceivedQuantity()); - signforEntity.setLoadedNumber(loadedNumber.subtract(loadedQuantity).add(reservationNum).intValue()); - signforEntity.setReceivedQuantity(signingReceivedQuantity.subtract(receivedQuantity).add(reservationNum).intValue()); - distributionSignforMapper.updateById(signforEntity); - } else { + }else { //不存在装车数据 DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); loadscanEntity.setPackageId(parcelNumberEntity.getParcelListId()); @@ -4221,7 +4198,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageIds = new ArrayList<>(); - List orderCodes = new ArrayList<>(); - if (Func.isNotEmpty(parcelListEntityList)) { - for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { - //查询是否进行装车 - DistributionLoadscanEntity loadscanEntities = distributionLoadscanService.getOne(Wrappers.query().lambda() - .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()) - .eq(DistributionLoadscanEntity::getDeliveryId, distributionSignforEntity.getDeliveryId()) - .eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()) - .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); - parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); - if (Func.isEmpty(loadscanEntities)) { - //没有进行过装车操作 - 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.getNickName()); - loadscanEntity.setScanTime(signingTime); - loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); - loadscanEntity.setSigningUser(user.getNickName()); - 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(signingTime); - 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()); - //扣减订单的在库数量 - Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); - //更新签收人 - Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser()); - - } else { - //存在装车数据 - if (distributionSignfor.getIsClerk()) { - loadscanEntities.setMsg("文员一键签收数据补录"); + String signingTime = simpleDateFormat.format(new Date()); + List packageIds = new ArrayList<>(); + List orderCodes = new ArrayList<>(); + if (Func.isNotEmpty(parcelListEntityList)) { + loadingPackageNum+=parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + signingPackageNum+=parcelListEntityList.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { + //查询是否进行装车 + DistributionLoadscanEntity loadscanEntities = distributionLoadscanService.getOne(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()) + .eq(DistributionLoadscanEntity::getDeliveryId, distributionSignforEntity.getDeliveryId()) + .eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId()) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); + if (Func.isEmpty(loadscanEntities)) { + //没有进行过装车操作 + 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.getNickName()); + loadscanEntity.setScanTime(signingTime); + loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); + loadscanEntity.setSigningUser(user.getNickName()); + 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(signingTime); + if (distributionSignfor.getIsClerk()) { + loadscanEntity.setMsg("文员一键签收数据补录"); + } else { + loadscanEntity.setMsg("司机一键签收数据补录"); + } + distributionLoadscanService.save(loadscanEntity); } else { - loadscanEntities.setMsg("司机一键签收数据补录"); - } - if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { - //已经进行过装车 这里不需要进行订制品订单在库数量扣减 - loadscanEntities.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); - loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity()); - loadscanEntities.setOneClick(1); - loadscanEntities.setOneQclick(2); - loadscanEntities.setSigningUser(user.getNickName()); - loadscanEntities.setSigningUserId(user.getUserId()); - loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity()); - loadscanEntities.setSigningTime(signingTime); - distributionLoadscanService.updateById(loadscanEntities); - Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); - //更新签收数量 - Integer j = distributionSignforMapper.updateSignforNum(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), loadscanEntities.getPackageNub()); - //更新签收人 - Integer m = distributionSignforMapper.updateSignUser(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), AuthUtil.getUser()); - distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(), loadscanEntities.getReservationId(), loadscanEntities.getDeliveryId()); + //存在装车数据 + if (distributionSignfor.getIsClerk()) { + loadscanEntities.setMsg("文员一键签收数据补录"); + } else { + loadscanEntities.setMsg("司机一键签收数据补录"); + } + if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { + //已经进行过装车 这里不需要进行订制品订单在库数量扣减 + loadscanEntities.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); + loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity()); + loadscanEntities.setOneClick(1); + loadscanEntities.setOneQclick(2); + loadscanEntities.setSigningUser(user.getNickName()); + loadscanEntities.setSigningUserId(user.getUserId()); + loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity()); + loadscanEntities.setSigningTime(signingTime); + distributionLoadscanService.updateById(loadscanEntities); + } } + distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); + packageIds.add(parcelListEntity.getId()); + orderCodes.add(parcelListEntity.getOrderCode()); + } + //批量维护订单信息 + if (Func.isNotEmpty(orderCodes)) { + String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(",")); + distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId()); } - distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); - packageIds.add(parcelListEntity.getId()); - orderCodes.add(parcelListEntity.getOrderCode()); - } - //批量维护订单信息 - if (Func.isNotEmpty(orderCodes)) { - String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(",")); - distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId()); - } - if (Func.isNotEmpty(packageIds)) { - distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId()); - //批量推送 - distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId()); + if (Func.isNotEmpty(packageIds)) { + distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId()); + //批量推送 + distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId()); + } } - } - - //维护客户信息状态 - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); - reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - distributionReservationMapper.updateById(reservationEntity); - //维护签收状态 -// distributionAsyncService.checkDeliverySignStatusByReservation(distributionSignforEntity.getDeliveryId()); -// distributionDeliveryListEntity.setDeliveryListLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); -// if (distributionSignfor.getIsClerk()) { -// distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); -// } else { -// distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); -// } -// distributionDeliveryListMapper.updateById(distributionDeliveryListEntity); - LambdaUpdateWrapper set = 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(DistributionSignforEntity::getDriverSigning, 2) - .set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks()) - .set(DistributionSignforEntity::getDriverSigning, 2); - boolean update = this.update(set); - //维护配送信息 - return R.status(true); - } + //维护客户信息状态 + reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); + reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); + distributionReservationMapper.updateById(reservationEntity); + //更新配送装车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); + distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); + distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); + distributionDeliveryListService.updateById(distributionDeliveryListEntity); + //更新装车人 + Integer m = distributionSignforMapper.updateSignUser(distributionDeliveryListEntity.getId(),distributionSignfor.getReservationId(), AuthUtil.getUser()); + log.info(method+"装车包件数>>>>>>>>>>>>>>:{}",loadingPackageNum); + log.info(method+"装车库存品数>>>>>>>>>>>>>>:{}",loadingInventoryNum); + log.info(method+"签收包件数>>>>>>>>>>>>>>:{}",signingPackageNum); + log.info(method+"签收库存品数>>>>>>>>>>>>>>:{}",signingPackageNum); + + LambdaUpdateWrapper set = 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( DistributionSignforEntity::getLoadedinNumber, loadingInventoryNum) + .set( DistributionSignforEntity::getLoadedNumber, loadingPackageNum) + .set( DistributionSignforEntity::getReceivedinQuantity, signingInventoryNum) + .set( DistributionSignforEntity::getReceivedQuantity, signingPackageNum) + .set(DistributionSignforEntity::getDriverSigning, 2) + .set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks()) + .set(DistributionSignforEntity::getDriverSigning, 2); + boolean update = this.update(set); + //维护配送信息 + return R.status(true); + } @Override diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 60b03b44c..c07ae37e2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -108,6 +108,9 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl map = JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class); + Map map =JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class); map.put("id",disStockListDetailEntity.getId()); map.put("customerName",distributionReservationEntity.getConsignee()); map.put("customerTelephone",distributionReservationEntity.getDeliveryPhone()); @@ -765,6 +768,66 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl data = new ArrayList<>(); + BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_11.getValue()); + if (ObjectUtil.isEmpty(template)) { + throw new ServiceException("模板内容未找到"); + } + + String html = null; + try { + html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); + orderPackgeCodeDataVO.setTemplateHtml(html); + orderPackgeCodeDataVO.setTemplateId(template.getId()); + //查询库存品包件 + DisStockListDetailEntity disStockListDetail = disStockListDetailService.getById(id); + if (Func.isEmpty(disStockListDetail)){ + log.error("##################查询库存品包件失败id:{}",id); + throw new ServiceException("库存品包件查询失败"); + } + + + //查询库存品信息 + DistributionStockListEntity stockListEntity = this.getById(disStockListDetail.getStockListId()); + if (Func.isEmpty(stockListEntity)){ + log.info("##############查询ID:{}",disStockListDetail.getStockListId()); + throw new ServiceException("查询库存品信息失败"); + } + + DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(disStockListDetail.getReservationId()); + if (Func.isEmpty(distributionReservationEntity)){ + log.info("##############查询ID:{}",distributionReservationEntity); + throw new ServiceException("查询库存品信息失败"); + } + Map map =JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class); + map.put("id",disStockListDetail.getId()); + map.put("customerName",distributionReservationEntity.getConsignee()); + map.put("customerTelephone",distributionReservationEntity.getDeliveryPhone()); + map.put("customerAddress",distributionReservationEntity.getDeliveryAddress()); + map.put("shipperName"," "); + map.put("shipperAddress"," "); + map.put("stockPackageCode",disStockListDetail.getStockPackageCode()); + String filename = QRCodeUtil.createCodeToFile(disStockListDetail.getStockPackageCode()); + map.put("img", QRCodeUtil.getEmpAutograph(filename)); + if (Func.isNotEmpty(stockListEntity.getOrderCode())){ + String fileTypeName = QRCodeUtil.createCodeToFile(stockListEntity.getOrderCode()); + map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName)); + } + data.add(map); + + orderPackgeCodeDataVO.setDataList(data); + + return orderPackgeCodeDataVO; + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + @Override public OrderPackgeCodeDataVO showInventorySourcePackageCode(String incomingBatch, Long packageIds) throws Exception { OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();