diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java index 5f2cde2a1..cfa938169 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java @@ -96,5 +96,12 @@ public class DistributionReservationPackageEntity extends TenantEntity { private Integer cancelStatus; + /** + * 包件任务取消备注 + */ + @ApiModelProperty(value = "包件任务取消备注") + private String cancelRemark; + + } 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 32efcc3ac..fbabb69a4 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 @@ -367,4 +367,12 @@ public interface DistributionSignforMapper extends BaseMapper getDistributionSignforInventoryList(@Param("id")Long id); + + /** + * + * @param reservationId + * @param stockArticleId + * @param parceListId + */ + Integer cancelOld(@Param("reservationId") Long reservationId,@Param("stockArticleId") Long stockArticleId,@Param("packageId") Long parceListId); } 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 425083738..1e6e413e2 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 @@ -83,6 +83,17 @@ + + UPDATE logpm_distribution_reservation_package SET packet_bar_status = 2 ,cancel_remark = '异常审核取消原计划' WHERE parce_list_id = #{packageId} ; + + UPDATE logpm_distribution_reservation_stockarticle SET reservation_num = (SELECT count(id) FROM logpm_distribution_reservation_package WHERE packet_bar_status != 2 AND reservation_id = #{reservaionId} AND stock_article_id = #{stockArticleId} AND is_deleted = 0) WHERE reservation_id = #{reservaionId} AND stock_article_id = #{stockArticleId}; + + UPDATE logpm_distribution_reservation_stockarticle SET stock_article_status = 2 WHERE reservation_num = 0 AND reservation_id = #{reservaionId} AND stock_article_id = #{stockArticleId}; + + UPDATE logpm_distribution_reservation SET reservation_num = (SELECT count(id) FROM logpm_distribution_reservation_package WHERE packet_bar_status != 2 AND reservation_id = #{reservaionId} AND is_deleted =0 ) WHERE id = #{reservaionId}; + + UPDATE logpm_distribution_reservation SET reservation_status = '40',cancel_reason = '异常审核判定判定取消预约计划' WHERE id = #{reservaionId} AND (reservation_num + reservation_stock_list_num) = 0; + 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 640e01669..8acad053e 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 @@ -5454,6 +5454,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageIds = distributionLoadscanAbnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getPackageId).distinct().collect(Collectors.toList()); + + //查询审核的是否存在计划 + List packageEntityList = distributionReservationPackageService.list(Wrappers.query().lambda() + .eq(DistributionReservationPackageEntity::getParceListId, packageIds) + .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) + ); + if (!packageEntityList.isEmpty()) { + //找出审核的包件中存在计划的包件 + for (DistributionReservationPackageEntity distributionReservationPackageEntity : packageEntityList) { + log.info("异常审核取消原计划包件"); + log.info("异常审核取消原计划包件参数>>>>>>>>>reservationId:{},orderId:{},packageId:{}",distributionReservationPackageEntity.getReservationId(),distributionReservationPackageEntity.getStockArticleId(),distributionReservationPackageEntity.getParceListId()); + Integer a = baseMapper.cancelOld(distributionReservationPackageEntity.getReservationId(),distributionReservationPackageEntity.getStockArticleId(),distributionReservationPackageEntity.getParceListId()); + log.info("异常审核取消原计划包件执行条数row:{}",a); + } + } + List reservationId = distributionLoadscanAbnormalEntities.stream().distinct().map(DistributionLoadscanAbnormalEntity::getReservationId).collect(Collectors.toList()); if (distributionLoadscanAbnormalEntities.size() == 1) { DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = distributionLoadscanAbnormalEntities.get(0);