Browse Source

异常审核取消原计划包件

master
汤建军 8 months ago
parent
commit
dd0e545419
  1. 7
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java
  2. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  3. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

7
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;
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java

@ -367,4 +367,12 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
List<DistributionSignforInventoryExcel> 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);
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -83,6 +83,17 @@
</if>
</where>
</delete>
<delete id="cancelOld">
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;
</delete>
<!-- <select id="selectDistributionSignforPage" resultType="com.logpm.distribution.vo.DistributionSignforVO">-->

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -5454,6 +5454,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("#############异常包件信息异常:{}", distributionLoadscanAbnormalEntities);
return R.fail(3000, "审核失败");
}
List<Long> packageIds = distributionLoadscanAbnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getPackageId).distinct().collect(Collectors.toList());
//查询审核的是否存在计划
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>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<Long> reservationId = distributionLoadscanAbnormalEntities.stream().distinct().map(DistributionLoadscanAbnormalEntity::getReservationId).collect(Collectors.toList());
if (distributionLoadscanAbnormalEntities.size() == 1) {
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = distributionLoadscanAbnormalEntities.get(0);

Loading…
Cancel
Save