diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java index a6d58ebf7..7346e1077 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -133,13 +133,13 @@ public interface IDistributionAsyncService { * 商 市的扫描修改 部分状态 * @param stockupDTO */ - void stockupUpdateState(StockupDTO stockupDTO); + void stockupUpdateState(StockupDTO stockupDTO,int num); /** * 自提的扫描修改 部分状态 * @param stockupDTO */ - void stockupSelfUpdateState(StockupDTO stockupDTO); + void stockupSelfUpdateState(StockupDTO stockupDTO,int num); /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index ddd591c61..6f4c6b695 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -1418,7 +1418,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { */ @Override @Transactional(rollbackFor = Exception.class) - public void stockupUpdateState(StockupDTO stockupDTO) { + public void stockupUpdateState(StockupDTO stockupDTO,int num) { BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(stockupDTO.getScanType().equals(1)){ @@ -1492,7 +1492,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { }); //判断数量 - int i = (nu.get() + ku.get()) - (nuy.get() + 1); + int i = (nu.get() + ku.get()) - (nuy.get() + num); //查询备货状态 DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId()); DistributionStockupEntity distributionStockup = new DistributionStockupEntity(); @@ -1544,7 +1544,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { * @param stockupDTO */ @Override - public void stockupSelfUpdateState(StockupDTO stockupDTO) { + public void stockupSelfUpdateState(StockupDTO stockupDTO,int num) { //查询全部订单数据 List distrilbutionBillStockEntities = distrilbutionBillStockMapper.selectList(Wrappers.query().lambda() @@ -1612,7 +1612,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { .apply("inventory_status in (1,2)") ); int sum = detailsEntities.stream().mapToInt(DistributionDeliveryDetailsEntity::getQuantity).sum(); //库存品数据 - int i = (sum + nu.get()) - (sum1 + 1); + int i = (sum + nu.get()) - (sum1 + num); /* detailsEntities.forEach( r -> { if(r.getConditions().equals("1") && Objects.equals(r.getQuantity(), r.getRealityQuantity())){ //修改当前备货状态已完成 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 09911c2c4..803eaf2b4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -37,6 +37,7 @@ import com.logpm.distribution.excel.DistributionCityExcel; import com.logpm.distribution.excel.DistributionMarketExcel; import com.logpm.distribution.excel.DistributionSelfExcel; import com.logpm.distribution.mapper.DistributionStockupMapper; +import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.app.StockupZeroVO; @@ -109,6 +110,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list1 = new ArrayList<>(); + String collect = voList.stream().map(DistributionStockPackageVO::getPacketBarCode).collect(Collectors.joining(",")); + Long warehouseId ; + if(one.getStockUpType().equals("3")){ + DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = distrilbutionBillLadingMapper.selectById(stockupDTO.getReservationId()); + warehouseId = distrilbutionBillLadingEntity.getWarehouseId(); + }else{ + DistributionReservationEntity byId1 = distributionReservationService.getById(stockupDTO.getReservationId()); + warehouseId = byId1.getWarehouseId(); + } + if(ObjectUtils.isNull(warehouseId)){ + throw new ServiceException("预约信息不存在,无法备货!"); + } + //货位下架 + R r = warehouseUpdownTypeClient.downPackage(collect,warehouseId ); + if(r.getCode() != 200){ + throw new ServiceException("下架失败!!"); + } voList.forEach(i -> { //查询是否已备货 DistributionParcelListEntity byId = distributionParcelListService.getById(i.getParcelListId()); @@ -1763,18 +1785,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl