Browse Source

BUG修复

dist.1.3.0
汤建军 4 months ago
parent
commit
e6e7f338cd
  1. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  2. 90
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java

@ -100,12 +100,12 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
*/
List<WarehouseRetentionScanVO> getRetentionPackageByType(@Param("retentionId") Long retentionId,@Param("type") Integer type);
// /**
// * 后台批量进行滞留
// * @param warehouseRetentionScanEntities
// * @return
// */
// R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
/**
* 后台批量进行滞留
* @param warehouseRetentionScanEntities
* @return
*/
R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
/**
* 进行回库扫描

90
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -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) {

Loading…
Cancel
Save