|
|
|
@ -403,51 +403,51 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
|
|
|
|
|
return warehouseRetentionScanVOS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// public R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) {
|
|
|
|
|
// AtomicBoolean saveFlah = new AtomicBoolean(false);
|
|
|
|
|
// if (!warehouseRetentionScanEntities.isEmpty()) {
|
|
|
|
|
// List<Long> deliveryIds = warehouseRetentionScanEntities.stream().map(WarehouseRetentionScanEntity::getDeliveryId).distinct().collect(Collectors.toList());
|
|
|
|
|
// //查询出该滞留任务是否存在
|
|
|
|
|
// List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
|
|
|
|
|
// .in(WarehouseRetentionScanEntity::getDeliveryId, deliveryIds)
|
|
|
|
|
// );
|
|
|
|
|
// if (!retentionScanEntityList.isEmpty()) {
|
|
|
|
|
// String collect = retentionScanEntityList.stream().filter(f ->
|
|
|
|
|
// warehouseRetentionScanEntities.stream().map(w -> w.getOrderPackageCode())
|
|
|
|
|
// .collect(Collectors.toList())
|
|
|
|
|
// .contains(f.getOrderPackageCode()))
|
|
|
|
|
// .map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(","));
|
|
|
|
|
// if (Objects.isNull(collect)) {
|
|
|
|
|
// return R.fail(collect + "重复滞留");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) {
|
|
|
|
|
//
|
|
|
|
|
// //进行滞留逻辑处理
|
|
|
|
|
// switch (warehouseRetentionScanEntity.getConditions()) {
|
|
|
|
|
// case 1:
|
|
|
|
|
// //订制品
|
|
|
|
|
// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions()));
|
|
|
|
|
// break;
|
|
|
|
|
// case 2:
|
|
|
|
|
// //库存品
|
|
|
|
|
// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId()));
|
|
|
|
|
// break;
|
|
|
|
|
// case 3:
|
|
|
|
|
// //零担
|
|
|
|
|
// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId()));
|
|
|
|
|
// break;
|
|
|
|
|
// default:
|
|
|
|
|
// log.error(">>>>> rs.getConditions()={}", warehouseRetentionScanEntity.getConditions());
|
|
|
|
|
// }
|
|
|
|
|
// //进行滞留信息的保存
|
|
|
|
|
// warehouseRetentionScanService.save(Func.copy(warehouseRetentionScanEntity, WarehouseRetentionScanEntity.class));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return R.success("操作成功");
|
|
|
|
|
// }
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) { |
|
|
|
|
AtomicBoolean saveFlah = new AtomicBoolean(false); |
|
|
|
|
if (!warehouseRetentionScanEntities.isEmpty()) { |
|
|
|
|
List<Long> deliveryIds = warehouseRetentionScanEntities.stream().map(WarehouseRetentionScanEntity::getDeliveryId).distinct().collect(Collectors.toList()); |
|
|
|
|
//查询出该滞留任务是否存在
|
|
|
|
|
List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda() |
|
|
|
|
.in(WarehouseRetentionScanEntity::getDeliveryId, deliveryIds) |
|
|
|
|
); |
|
|
|
|
if (!retentionScanEntityList.isEmpty()) { |
|
|
|
|
String collect = retentionScanEntityList.stream().filter(f -> |
|
|
|
|
warehouseRetentionScanEntities.stream().map(w -> w.getOrderPackageCode()) |
|
|
|
|
.collect(Collectors.toList()) |
|
|
|
|
.contains(f.getOrderPackageCode())) |
|
|
|
|
.map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(",")); |
|
|
|
|
if (Objects.isNull(collect)) { |
|
|
|
|
return R.fail(collect + "重复滞留"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) { |
|
|
|
|
|
|
|
|
|
//进行滞留逻辑处理
|
|
|
|
|
switch (warehouseRetentionScanEntity.getConditions()) { |
|
|
|
|
case 1: |
|
|
|
|
//订制品
|
|
|
|
|
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions(),warehouseRetentionScanEntity.getRetentionType())); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
//库存品
|
|
|
|
|
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId())); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
//零担
|
|
|
|
|
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId())); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
log.error(">>>>> rs.getConditions()={}", warehouseRetentionScanEntity.getConditions()); |
|
|
|
|
} |
|
|
|
|
//进行滞留信息的保存
|
|
|
|
|
warehouseRetentionScanService.save(Func.copy(warehouseRetentionScanEntity, WarehouseRetentionScanEntity.class)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.success("操作成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R scanRetention(WarehouseRetentionScanDTO warehouseRetentionScanDTO) { |
|
|
|
|