|
|
|
@ -1358,6 +1358,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
.eq(DistributionLoadscanEntity::getSignforState, 2) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
List<Long> recoverZeroPackageIds = new ArrayList<>(); |
|
|
|
|
for (DistributionParcelNumberDTO distributionParcelNumberDTO : distributionParcelNumberDTOS) { |
|
|
|
|
//判断是全部进行返回还是部分
|
|
|
|
|
if (!loadscanEntityList.isEmpty()) { |
|
|
|
@ -1365,38 +1366,63 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
List<DistributionLoadscanEntity> zeroLoading = loadscanEntityList.stream().filter(f -> f.getPackageId().equals(distributionParcelNumberDTO.getParcelListId())).collect(Collectors.toList()); |
|
|
|
|
if (!zeroLoading.isEmpty()) { |
|
|
|
|
//存在签收数据,进行部分释放
|
|
|
|
|
DistributionLoadscanEntity distributionLoadscanEntity = zeroLoading.get(0); |
|
|
|
|
Integer receivedQuantity = distributionLoadscanEntity.getReceivedQuantity(); |
|
|
|
|
if (!Objects.equals(receivedQuantity,distributionParcelNumberDTO.getReservationNum())){ |
|
|
|
|
//未签收完成,进行释放指定数量
|
|
|
|
|
int recoverNum = distributionParcelNumberDTO.getReservationNum() - receivedQuantity; |
|
|
|
|
//
|
|
|
|
|
reservationZeroPackageService.recoverZeroPackageByNum(reservationId,distributionParcelNumberDTO.getParcelListId(),recoverNum,true); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//进行全部释放
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
//查看是否存在需要进行回库的零担
|
|
|
|
|
List<Long> collect = loadscanEntityList.stream().filter(f -> packageIds.contains(f.getPackageId())).map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(collect)) { |
|
|
|
|
String orderCode = distributionParcelNumberDTOS.stream().filter(f -> collect.contains(f.getParcelListId())).map(DistributionParcelNumberDTO::getOrderCode).collect(Collectors.joining(",")); |
|
|
|
|
String orderCode = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getOrderCode).distinct().collect(Collectors.joining(",")); |
|
|
|
|
log.info(method + "维护零担订单:{}", orderCode); |
|
|
|
|
if(Func.isNotEmpty(builder)){ |
|
|
|
|
builder.append(","); |
|
|
|
|
} |
|
|
|
|
builder.append(orderCode); |
|
|
|
|
//针对未签收完成零担进行回库操作
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//这些单子就是需要进行状态回退的零担包件
|
|
|
|
|
reservationZeroPackageService.recoverZeroPackage(reservationId, collect,true); |
|
|
|
|
//计划全部释放
|
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
//计划数量全部回退
|
|
|
|
|
String orderCode = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getOrderCode).distinct().collect(Collectors.joining(",")); |
|
|
|
|
log.info(method + "维护零担订单:{}", orderCode); |
|
|
|
|
if(Func.isNotEmpty(builder)){ |
|
|
|
|
builder.append(","); |
|
|
|
|
} |
|
|
|
|
builder.append(orderCode); |
|
|
|
|
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds,true); |
|
|
|
|
//进行全部释放
|
|
|
|
|
recoverZeroPackageIds.add(distributionParcelNumberDTO.getParcelListId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!recoverZeroPackageIds.isEmpty()) { |
|
|
|
|
reservationZeroPackageService.recoverZeroPackage(reservationId, recoverZeroPackageIds,true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// if (Func.isNotEmpty(loadscanEntityList)) {
|
|
|
|
|
// //查看是否存在需要进行回库的零担
|
|
|
|
|
// List<Long> collect = loadscanEntityList.stream().filter(f -> packageIds.contains(f.getPackageId())).map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
|
|
|
|
|
// if (Func.isNotEmpty(collect)) {
|
|
|
|
|
// String orderCode = distributionParcelNumberDTOS.stream().filter(f -> collect.contains(f.getParcelListId())).map(DistributionParcelNumberDTO::getOrderCode).collect(Collectors.joining(","));
|
|
|
|
|
// log.info(method + "维护零担订单:{}", orderCode);
|
|
|
|
|
// if(Func.isNotEmpty(builder)){
|
|
|
|
|
// builder.append(",");
|
|
|
|
|
// }
|
|
|
|
|
// builder.append(orderCode);
|
|
|
|
|
// //针对未签收完成零担进行回库操作
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //这些单子就是需要进行状态回退的零担包件
|
|
|
|
|
// reservationZeroPackageService.recoverZeroPackage(reservationId, collect,true);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// //计划数量全部回退
|
|
|
|
|
// String orderCode = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getOrderCode).distinct().collect(Collectors.joining(","));
|
|
|
|
|
// log.info(method + "维护零担订单:{}", orderCode);
|
|
|
|
|
// if(Func.isNotEmpty(builder)){
|
|
|
|
|
// builder.append(",");
|
|
|
|
|
// }
|
|
|
|
|
// builder.append(orderCode);
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId()); |
|
|
|
|
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouse.getId()); |
|
|
|
|