diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java index 84d88d181..82b66a7e5 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java @@ -64,6 +64,18 @@ public interface IDistributionDeliveryListClient { DistributionDeliveryListVO getDeliveryDriverInfo(@RequestParam("current") Long deliveryId); + /** + * 滞留配送任务包件 + * @param deliveryId + * @param reservationId + * @param orderPackageId + * @param conditions 1-订制品 2-库存 + * @return + */ + @GetMapping(TOP+"/retentionDeliveryReservationPackage") + boolean retentionDeliveryReservationPackage(@RequestParam("deliveryId")Long deliveryId,@RequestParam("reservationId") Long reservationId,@RequestParam("orderPackageId") Long orderPackageId,@RequestParam("conditions") Integer conditions); + + // /** // * 根据配送任务ID查询配送司机信息 // * @param distributionRetentionScanVo diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java index 2fa2ae137..6dd73e6da 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java @@ -49,20 +49,4 @@ public interface IDistributionReservationClient { @GetMapping(TOP) BladePage reservationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size); - /** - * 根据配送任务ID查询配送司机信息 - * @param distributionRetentionScanVo - * @return - */ - @GetMapping(TOP+"/retentionCancelReservationPack") - boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo); - -// /** -// * 根据配送任务ID查询配送司机信息 -// * @param distributionRetentionScanVo -// * @return -// */ -// @Post(TOP+"/retentionCancelReservationPack") -// boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo); - } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java index 1fc248fae..15be4eea0 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java @@ -68,6 +68,10 @@ public class DistributionRetentionScanVo { */ private Integer conditions; + /** + * 类型 + */ + private Integer scanType; /** * 配送ID diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTrayRetentionVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTrayRetentionVO.java new file mode 100644 index 000000000..be6df5154 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTrayRetentionVO.java @@ -0,0 +1,28 @@ +package com.logpm.distribution.vo; + + +import lombok.Data; + +import java.util.List; + +@Data +public class DistributionTrayRetentionVO { + + + private Long trayTypeId; + + private String trayCode;//托盘码 + + private String trayName;//托盘名称 + + + private Long warehosueId;//仓库ID + + private String warehosueName;//仓库名称 + + + private List GoodsList;//仓库名称 + + + +} diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java index 6fafd5599..1b1988698 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java @@ -181,9 +181,52 @@ public class WarehouseRetentionScanEntity extends TenantEntity { private Long deliveryId; /** - * 配送任务ID + * 滞留任务Id */ @ApiModelProperty(value = "配送任务ID") private Long refId; + /** + * 托盘Id + */ + @ApiModelProperty(value = "托盘Id") + private Long trayId; + + + /** + * 托盘码 + */ + @ApiModelProperty(value = "托盘码") + private String trayCode; + + /** + * 托盘名称 + */ + @ApiModelProperty(value = "托盘名称") + private String trayName; + + /** + * 取消人Id + */ + @ApiModelProperty(value = "取消人Id") + private String cancelRetentionUserId; + + /** + * 取消人名称 + */ + @ApiModelProperty(value = "取消人名称") + private String cancelRetentionUserName; + + /** + * 取消时间 + */ + @ApiModelProperty(value = "取消时间") + private String cancelRetentionTime; + + /** + * 取消状态 0-否 1-是 + */ + @ApiModelProperty(value = "取消状态 0-否 1-是") + private String cancelRetentionStatus; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java index f94979462..f73a8aecf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java @@ -284,10 +284,10 @@ public class DistributionDeliveryAppController { /** * 扫描查询配送任务下的包件信息 */ - @PostMapping("/getZeroPackageInfo") + @PostMapping("/retentionTrayScan") @ApiOperationSupport(order = 11) public R getZeroPackageInfo(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { - R distributionParcelListVOS = distributionDeliveryListService.getZeroPackageInfo(distrilbutionloadingscanDTO); + R distributionParcelListVOS = distributionDeliveryListService.getTrayInfoAndPackageList(distrilbutionloadingscanDTO); return R.data(distributionParcelListVOS); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java index 179dad553..ef5fe932c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java @@ -60,6 +60,11 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList return distributionDeliveryListService.getDeliveryList(deliveryId); } + @Override + public boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions) { + return distributionDeliveryListService.retentionDeliveryReservationPackage(deliveryId,reservationId,orderPackageId,conditions); + } + // @Override // public void retentionCancelDeliveryPack(DistributionRetentionScanVo distributionRetentionScanVo) { // distributionDeliveryListService.retentionCancelDeliveryPack(distributionRetentionScanVo); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java index 1cab1eac1..7bf4d06ba 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java @@ -51,9 +51,6 @@ public class DistributionReservationClient implements IDistributionReservationCl return BladePage.of(page); } - @Override - public boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo) { - return reservationService.retentionCancelReservationPack(distributionRetentionScanVo); - } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java index bc6ce2c25..0919b15ae 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java @@ -65,4 +65,12 @@ public interface DistributionAddvaluePackageMapper extends BaseMapper DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} + + DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} And addvalue_detail_id = #{addvalueDetailId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index f778e1201..eb2330012 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1621,7 +1621,8 @@ ldsl.cargo_number AS materialNumber, ldsl.description_goods AS materialName, 2 AS conditions, - ldsl.incoming_batch AS 入库批次 + ldsl.incoming_batch AS 入库批次, + 1 AS scanType FROM logpm_distribution_delivery_list AS lddl LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id @@ -1642,7 +1643,8 @@ ldpl.id AS orderPackageId, ldpl.order_package_code AS orderPackageCode, ldpl.quantity AS retentionQuantity, - 1 AS conditions + 1 AS conditions, + 1 AS scanType FROM logpm_distribution_delivery_list AS lddl LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id @@ -1666,7 +1668,8 @@ ldrs.reservation_num AS maxRetention, ldrzp.parcel_list_id AS orderPackageId, ldpl.firsts AS materialName, - 3 AS conditions + 3 AS conditions, + 2 AS scanType FROM logpm_distribution_delivery_list AS lddl LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java index 7346e1077..c786d0944 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -187,11 +187,11 @@ public interface IDistributionAsyncService { void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException; /** - * 检查维护装车状态 + * 检查维护包件订单、预约装车状态、配送惹怒我预约状态 * @param parcelListEntity * @param deliveryId */ - void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId); + void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId,Long reservationId); /** * 托盘装车 维护装车状态 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 812a44f97..de4d7c393 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 @@ -317,6 +317,23 @@ public interface IDistributionDeliveryListService extends BaseService getDriverInfo(Long deliveryId); + /** + * 查询托盘以及托盘下的所有包件信息 + * @param distrilbutionloadingscanDTO + * @return + */ + R getTrayInfoAndPackageList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); + + /** + * 滞留取消包件标记 + * @param deliveryId + * @param reservationId + * @param orderPackageId + * @param conditions + * @return + */ + boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions); + // /** // * 滞留取消配送 // * @param distributionRetentionScanVo 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 646fd5975..847bbc7d0 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 @@ -226,10 +226,5 @@ public interface IDistributionReservationService extends BaseService page); - /** - * 滞留扫描取消包件 - * @param distributionRetentionScanVo - * @return - */ - boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java index 4448f29e6..ae7c897ef 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java @@ -639,6 +639,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl addvalueInfo = distributionAddvalueMapper.addvalueInfo(distributionAppAddvalueDTO.getReservationId()); addvalueInfo.stream().filter(a -> Func.isNotEmpty(a.getPackageListIds())).forEach(a -> { @@ -653,6 +654,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl packageEntityList = distributionAppAddvalueDTO.getPackageEntityList(); if (Func.isEmpty(packageEntityList)) { @@ -673,7 +675,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl { - distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAppAddvalueDTO.getReservationId(), id); + distributionAddvaluePackageMapper.deleteAddvaluePackageByDetailId(distributionAppAddvalueDTO.getReservationId(), id,distributionAppAddvalueDTO.getAddvalueDetailId()); }); } else { log.error("###########该包件不存在增值服务项包件列表中"); @@ -683,6 +685,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl packageEntityList = distributionAppAddvalueDTO.getPackageEntityList(); if (Func.isEmpty(packageEntityList)) { @@ -707,7 +710,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl 0) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 6f4c6b695..cc40dac8e 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 @@ -723,70 +723,89 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } @Override - public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId) { - //首先能够进入这个检测方法那么此包件就是进行装车了,这里对包件装车状态再次进行维护 - if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){ - parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); - distributionParcelListService.updateById(parcelListEntity); + @Transactional + public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId,Long reservationId) { + if (Func.isEmpty(parcelListEntity)){ + log.error("############包件信息异常:{}",parcelListEntity); + throw new RuntimeException("包件信息异常"); } + //维护包件所属订单是否均已完成装车,如果均已完成装车则订单进行装车状态的修改 + switch (parcelListEntity.getConditions()){ + case 1: + break; - //维护此包件对应的订单装车状态 - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - if (Func.isNotEmpty(stockArticleEntity)){ - //查询订单的所有包件 - List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())); - boolean orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (orderLoadingFlag){ - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - }else { - orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (!orderLoadingFlag){ - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - } - } - distributionStockArticleService.updateById(stockArticleEntity); - } - //维护预约计划 - List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); - if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){ - for (DistributionReservationEntity reservationEntity : reservationEntityList) { - List reservationParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); - if (Func.isNotEmpty(reservationParcelListEntities)&& reservationParcelListEntities.size()>0){ - boolean reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (reservationLoadingFlag){ - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); - }else { - reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (reservationLoadingFlag){ - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); - }else { - reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); - } - } - distributionReservationMapper.updateById(reservationEntity); - } - } - } - //维护配送计划 - DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); - if (Func.isNotEmpty(deliveryListEntity)){ - List deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); - if (Func.isNotEmpty(deliveryParcelListEntities) && deliveryParcelListEntities.size()>0){ - boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - if (deliveryLoadingFlag){ - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); - }else { - deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); - if (deliveryLoadingFlag){ - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); - }else { - deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); - } - } - distributionDeliveryListMapper.updateById(deliveryListEntity); - } + case 3: + break; } + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); + + +// //首先能够进入这个检测方法那么此包件就是进行装车了,这里对包件装车状态再次进行维护 +// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){ +// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); +// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); +// distributionParcelListService.updateById(parcelListEntity); +// } +// +// //维护此包件对应的订单装车状态 +// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); +// if (Func.isNotEmpty(stockArticleEntity)){ +// //查询订单的所有包件 +// List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())); +// boolean orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); +// if (orderLoadingFlag){ +// stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); +// }else { +// orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); +// if (!orderLoadingFlag){ +// stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); +// } +// } +// distributionStockArticleService.updateById(stockArticleEntity); +// } +// //维护预约计划 +// List reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); +// if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){ +// for (DistributionReservationEntity reservationEntity : reservationEntityList) { +// List reservationParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); +// if (Func.isNotEmpty(reservationParcelListEntities)&& reservationParcelListEntities.size()>0){ +// boolean reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); +// if (reservationLoadingFlag){ +// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); +// }else { +// reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); +// if (reservationLoadingFlag){ +// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); +// }else { +// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); +// } +// } +// distributionReservationMapper.updateById(reservationEntity); +// } +// } +// } +// //维护配送计划 +// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); +// if (Func.isNotEmpty(deliveryListEntity)){ +// List deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId); +// if (Func.isNotEmpty(deliveryParcelListEntities) && deliveryParcelListEntities.size()>0){ +// boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); +// if (deliveryLoadingFlag){ +// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); +// }else { +// deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())); +// if (deliveryLoadingFlag){ +// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); +// }else { +// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); +// } +// } +// distributionDeliveryListMapper.updateById(deliveryListEntity); +// } +// } + + + } 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 82fa2588f..fb1bf828f 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 @@ -282,7 +282,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()).eq(DistributionDeliverySelfEntity::getIsMaster, 2)); + DistributionDeliverySelfEntity deliverySelfServiceOne = distributionDeliverySelfService.getOne(Wrappers.query().lambda() + .eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()) + .eq(DistributionDeliverySelfEntity::getIsMaster, 2)); distributionDeliveryListVO.setDriverName(deliverySelfServiceOne.getDriverName()); distributionDeliveryListVO.setDriverPhone(deliverySelfServiceOne.getDriverPhone()); distributionDeliveryListVO.setVehicleName(deliverySelfServiceOne.getVehicleNub()); @@ -571,7 +573,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() @@ -705,6 +707,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl goodsLsit = trayTypeDataVO.getGoodsLsit(); + if (Func.isEmpty(goodsLsit)){ + log.error("#############托盘无货物,taryCode:{}",barcode); + return Resp.scanFail("该托盘无货物","该托盘无货物"); + } + + boolean isAll = goodsLsit.stream().allMatch(good -> good.getAssociationType().equals(3)); + if (isAll){ + int size = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationValue).distinct().collect(Collectors.toList()).size(); + log.error("#############托盘存在多种货物类型,货物种类:{}",size); + return Resp.scanFail("该托盘存在多种货物","该托盘存在多种货物"); + } + List parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); + if (Func.isEmpty(parcelListEntities)){ + log.error("#############配送任务不存在包件信息,配送任务ID:{}",distrilbutionloadingscanDTO.getDeliveryId()); + return Resp.scanFail("配送任务无包件信息","配送任务无包件信息"); + } + //查询托盘货物是否都属于该配送计划的包件 + boolean isExist = goodsLsit.stream() + .map(WarehouseTrayGoodsEntity::getAssociationId) + .collect(Collectors.toList()).stream() + .allMatch(goodId -> parcelListEntities.stream() + .map(DistributionParcelListEntity::getId) + .collect(Collectors.toList()).contains(goodId)); + + if (isExist){ + DistributionTrayRetentionVO distributionTrayRetentionVO = new DistributionTrayRetentionVO(); + DistributionTrayRetentionVO trayRetentionVO = Func.copy(trayTypeDataVO, DistributionTrayRetentionVO.class); + List retentionScanVos = new ArrayList<>(); + //托盘货物都存在该配送任务的包件列表 + //进行客户划分 + goodsLsit.forEach(g->{ + DistributionRetentionScanVo retentionScanVo = baseMapper.selectRetentionPackage(g.getAssociationValue(), distrilbutionloadingscanDTO.getDeliveryId()); + if (Func.isNotEmpty(retentionScanVo)){ + retentionScanVo.setScanType(3); + retentionScanVos.add(retentionScanVo); + }else { + log.error("#############查询托盘包件信息错误,包件码为:{}",g.getAssociationValue()); + } + }); + if (Func.isNotEmpty(retentionScanVos)){ + trayRetentionVO.setGoodsList(retentionScanVos); + return R.data(trayRetentionVO); + } + }else { + return Resp.scanFail("托盘存在包件不属于该配送任务","托盘存在包件不属于该配送任务"); + } + return null; + } + + @Override + @Transactional + public boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions) { + DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId); + if (Func.isEmpty(deliveryListEntity)){ + log.error("###########查询配送任务异常,deliveyId:{}",deliveryId); + return false; + } + switch (conditions){ + case 1: + //订制品 + List parcelListEntities = baseMapper.selectPackageListByDeliveryListId(deliveryId); + if (Func.isNotEmpty(parcelListEntities)){ + if (parcelListEntities.size() == deliveryListEntity.getDeliveryNumber()){ + //该配送任务下只有一个包件,那么就只会存在一个预约,此时就该进行所有的包件滞留并且进行删除 + + } + + } + break; + case 2: + //库存品 + break; + } + return false; + } public Map getDriverCar(String kind, Long deliveryListEntityId) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 9c8de5a09..f628fcba1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -3164,101 +3164,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImplquery().lambda() -// .eq(DistributionReservationPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DistributionReservationPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) -// .eq(DistributionReservationPackageEntity::getParceListId, distributionRetentionScanVo.getOrderPackageId()) -// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())); -// reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); -// distributionReservationPackageMapper.updateById(reservationPackageEntity); -// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.query().lambda() -// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) -// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue()) -// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); -// Integer reservationNum = reservationStockarticleEntity.getReservationNum(); -// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity(); -// if ((reservationNum - retentionQuantity) == 0){ -// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); -// } -// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity); -// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity); -// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity); -// this.updateById(reservationEntity); -// } -// break; -// case 2: -// if (reservationEntity.getReservationStockListNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationNum() == 0){ -// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class)); -// }else { -// DisStockListDetailEntity disStockListDetailEntity = disStockListDetailMapper.selectOne(Wrappers.query().lambda() -// .eq(DisStockListDetailEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DisStockListDetailEntity::getStockListId, distributionRetentionScanVo.getInventoryId()) -// .eq(DisStockListDetailEntity::getId, distributionRetentionScanVo.getOrderPackageId()) -// ); -// disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); -// disStockListDetailMapper.updateById(disStockListDetailEntity); -// DistributionReservationStocklistEntity reservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.query().lambda() -// .eq(DistributionReservationStocklistEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DistributionReservationStocklistEntity::getStocklistId, distributionRetentionScanVo.getInventoryId()) -// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue()) -// ); -// Integer reservationNum = reservationStocklistEntity.getReservationNum(); -// -// } -// break; -// case 3: -// if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){ -// //该预约订单只存在该包件并且没有库存品 -// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class)); -// }else { -// DistributionReservationZeroPackageEntity reservationZeroPackageEntity = distributionReservationZeroPackageMapper.selectOne(Wrappers.query().lambda() -// .eq(DistributionReservationZeroPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) -// .eq(DistributionReservationZeroPackageEntity::getParcelListId, distributionRetentionScanVo.getOrderPackageId()) -// .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); -// if (reservationZeroPackageEntity.getQuantity() == distributionRetentionScanVo.getRetentionQuantity()){ -// reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue()); -// } -// reservationZeroPackageEntity.setQuantity(reservationZeroPackageEntity.getQuantity() -distributionRetentionScanVo.getRetentionQuantity()); -// distributionReservationZeroPackageMapper.updateById(reservationZeroPackageEntity); -// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.query().lambda() -// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId()) -// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId()) -// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue()) -// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); -// Integer reservationNum = reservationStockarticleEntity.getReservationNum(); -// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity(); -// if ((reservationNum - retentionQuantity) == 0){ -// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue()); -// } -// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity); -// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity); -// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity); -// this.updateById(reservationEntity); -// } -// break; -// -// } - return false; - } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java index 06497cd3b..96f3bdc85 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java @@ -96,6 +96,9 @@ public class WarehouseRetentionApiController { + + + // @GetMapping("/initRetentionList") // @ApiOperationSupport(order = 1) // @ApiOperation(value = "初始化滞留车次信息", notes = "传入trayTypeDTO") diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java index d5ce7edac..0b6d89a64 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java @@ -66,9 +66,9 @@ public class WarehouseRetentionRecordController extends BladeController { @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入warehouseRetentionRecord") - public R detail(WarehouseRetentionRecordEntity warehouseRetentionRecord) { - WarehouseRetentionRecordEntity detail = warehouseRetentionRecordService.getOne(Condition.getQueryWrapper(warehouseRetentionRecord)); - return R.data(WarehouseRetentionRecordWrapper.build().entityVO(detail)); + public R detail(Long id) { + WarehouseRetentionRecordVO detail = warehouseRetentionRecordService.getDetail(id); + return R.data(detail); } /** * 滞留记录 分页 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java index 62120b28c..a7fb0fdc8 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java @@ -17,6 +17,7 @@ package com.logpm.warehouse.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.warehouse.dto.RetentionDTO; import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO; @@ -81,4 +82,10 @@ public interface IWarehouseRetentionRecordService extends BaseService selectWarehouseRetentionRecordPage(IPage page, WarehouseRetentionRecordVO warehouseRetentionRecord) { @@ -159,6 +162,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl{ - r.setRetentionScanTime(new Date()); - r.setRetentionScanUserId(user.getUserId()); - r.setRetentionScanUsername(user.getUserName()); - r.setRetentionQuantity(r.getRetentionQuantity()); - retentionTotal.getAndAdd(r.getRetentionQuantity()); - r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId()); - r.setRefId(warehouseRetentionRecordEntity.getId()); - warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class)); + //查询是否进行多次滞留 + WarehouseRetentionScanEntity retentionScanServiceOne = warehouseRetentionScanService.getOne(Wrappers.query().lambda() + .eq(WarehouseRetentionScanEntity::getConditions, r.getConditions()) + .eq(WarehouseRetentionScanEntity::getOrderPackageId, r.getOrderPackageId()) + .eq(WarehouseRetentionScanEntity::getReservationId, r.getReservationId()) + .eq(WarehouseRetentionScanEntity::getOrderId, r.getOrderId()) + .eq(WarehouseRetentionScanEntity::getOrderCode, r.getOrderCode()) + .eq(WarehouseRetentionScanEntity::getScanType, r.getScanType()) + .ne(WarehouseRetentionScanEntity::getCancelRetentionStatus, IsOrNoConstant.no.getValue()) + ); + //避免重复添加相同的滞留包件数据 + if (Func.isEmpty(retentionScanServiceOne)){ + r.setRetentionScanTime(new Date()); + r.setRetentionScanUserId(user.getUserId()); + r.setRetentionScanUsername(user.getNickName()); + r.setRetentionQuantity(r.getRetentionQuantity()); + retentionTotal.getAndAdd(r.getRetentionQuantity()); + r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId()); + r.setRefId(warehouseRetentionRecordEntity.getId()); + warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class)); + //进行滞留之后需要对包件进行取消配送的操作 + if (r.getConditions().equals(3)){ + //零担滞留 + }else { + //包件滞留 + distributionDeliveryListClient.retentionDeliveryReservationPackage(r.getDeliveryId(),r.getReservationId(),r.getOrderPackageId(),r.getConditions()); + + } + } //进行滞留操作的包件需要和原来订单 预约进行绑定解除 //TODO 需要一个取消配送包件的方法 // reservationClient.retentionCancelReservationPack(); @@ -280,4 +305,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl