diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java index cbfefd589..277852b3c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java @@ -944,9 +944,11 @@ public class DistributionStockupAppController extends BladeController { List reservationStockList = reservationStocklistEntities.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList()); if (Func.isNotEmpty(reservationStockList)) { DistributionReservationStocklistEntity oldReservationStocklistEntity = reservationStockList.get(0); + DistributionReservationStocklistEntity t0 = new DistributionReservationStocklistEntity(); + t0.setId(oldReservationStocklistEntity.getId()); //扣减计划数量 - oldReservationStocklistEntity.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1); - distributionReservationStocklistService.updateById(oldReservationStocklistEntity); + t0.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1); + distributionReservationStocklistService.updateById(t0); //维护对应的库存品包件 List stockListDetailEntities = disStockListDetailService.list(Wrappers.query().lambda() @@ -956,19 +958,26 @@ public class DistributionStockupAppController extends BladeController { ); DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(oldReservationStocklistEntity.getStocklistId()); - oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1); - distributionStockListService.updateById(oldStockListEntity); + + DistributionStockListEntity t =new DistributionStockListEntity(); + t.setId(oldStockListEntity.getId()); + t.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1); + distributionStockListService.updateById(t); //对指定库存品包件进行库存品ID修改 DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0); if (Func.isNotEmpty(disStockListDetailEntity)) { - disStockListDetailEntity.setStockListId(stockupDTO.getStockListId()); - disStockListDetailService.updateById(disStockListDetailEntity); + DisStockListDetailEntity t1 = new DisStockListDetailEntity(); + t1.setId(disStockListDetailEntity.getId()); + t1.setStockListId(stockupDTO.getStockListId()); + disStockListDetailService.updateById(t1); } //维护对应库存品的冻结数量 DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId()); - newStockListEntity.setQuantityOccupied(newStockListEntity.getQuantityOccupied() + 1); - distributionStockListService.updateById(newStockListEntity); + DistributionStockListEntity t2 = new DistributionStockListEntity(); + t2.setId(newStockListEntity.getId()); + t2.setQuantityOccupied(newStockListEntity.getQuantityOccupied() + 1); + distributionStockListService.updateById(t2); } // 增加实际扫描的包件对应的库存品信息 增加在预约库存品中间表上 DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity(); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java index 297015d77..8e95941ff 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java @@ -210,7 +210,7 @@ public class MerchantStatisticsController { return R.fail(405, "请选择正确的对账单"); } - List statisticsOrderInfoVO = statisticsOrderInfoService.findOrderDetail(reconciliationOrderId); + List statisticsOrderInfoVO = statisticsOrderInfoService.getStatisticsOrderInfoVOListByReconciliationOrderId(reconciliationOrderId); return R.data(statisticsOrderInfoVO); } catch (CustomerException e) { diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java index 8a0423f97..09f6c4e17 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java @@ -53,4 +53,6 @@ public interface StatisticsOrderInfoMapper extends BaseMapper pageList2B(IPage page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); List pageList2BNoPage( @Param("param") MerchantStatisticsDTO merchantStatisticsDTO); + + List findStatisticsOrderInfoVOByReconciliationOrderId(@Param("reconciliationOrderId") Long reconciliationOrderId); } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml index 5c22aa35e..3d156f776 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -2,7 +2,7 @@ - + where 1=1 and lsoi.create_reconciliation_order_status = 0 @@ -1048,6 +1052,17 @@ group by lsoi.id + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java index 3fe94e72f..24cd76f7f 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java @@ -18,6 +18,8 @@ public interface IStatisticsOrderInfoService extends BaseService pageList(MerchantStatisticsDTO merchantStatisticsDTO); + List getStatisticsOrderInfoVOListByReconciliationOrderId(Long reconciliationOrderId); + StatisticsReconciliationOrderInfoVO findChangesRecordList(MerchantStatisticsDTO merchantStatisticsDTO); R addChangesRecord(ChangesRecordDTO changesRecordDTO); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index 9eae78a2f..bb24aef8d 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java @@ -33,7 +33,6 @@ import com.logpm.statistics.service.*; import com.logpm.statistics.vo.*; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; -import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springblade.common.constant.DictBizConstant; @@ -268,24 +267,26 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl getStatisticsOrderInfoVOIPage2C(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { - IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); - List records = statisticsOrderInfoVOIPage.getRecords(); - if (CollUtil.isEmpty(records)) { - return statisticsOrderInfoVOIPage; - } + + @Override + public List getStatisticsOrderInfoVOListByReconciliationOrderId(Long reconciliationOrderId){ + List statisticsOrderInfoVOList = baseMapper.findStatisticsOrderInfoVOByReconciliationOrderId(reconciliationOrderId); + buildListForStatisOrderInfoVO(statisticsOrderInfoVOList); + return statisticsOrderInfoVOList; + } + + private void buildListForStatisOrderInfoVO(List statisticsOrderInfoVOList) { //把records中所有的orderInfoId放入一个集合 - List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); + List orderInfoIdList = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); // 得到运单ID集合 - Set waybillIds = records.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); + Set waybillIds = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getWaybillId).collect(Collectors.toSet()); // 查询运单明细集合 List waybillDetailByWaybillId = baseMapper.findWaybillDetailByWaybillId(waybillIds); //得到运单号 - Set orderCodeSet = records.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toSet()); + Set orderCodeSet = statisticsOrderInfoVOList.stream().map(StatisticsOrderInfoVO::getOrderCode).collect(Collectors.toSet()); // 通过运单号进行分组 @@ -307,7 +308,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl advanceDetailDTOS = baseMapper.selectAdvinceDetail(waybillIds, orderCodeSet); - records.forEach(statisticsOrderInfoVO -> { + statisticsOrderInfoVOList.forEach(statisticsOrderInfoVO -> { // Long waybillId = statisticsOrderInfoVO.getWaybillId(); @@ -405,6 +406,18 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl getStatisticsOrderInfoVOIPage2C(MerchantStatisticsDTO merchantStatisticsDTO, IPage page) { + IPage statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); + List records = statisticsOrderInfoVOIPage.getRecords(); + if (CollUtil.isEmpty(records)) { + return statisticsOrderInfoVOIPage; + } + + //把records中所有的orderInfoId放入一个集合 + buildListForStatisOrderInfoVO(records); statisticsOrderInfoVOIPage.setRecords(records); return statisticsOrderInfoVOIPage; } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java index 0ccaa76fe..5acdad946 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java @@ -119,7 +119,12 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl warehouseWaybillEntities = new ArrayList<>(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java index deb75f952..2fe057f50 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java @@ -392,6 +392,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl billladingWaybillEntities = billladingWaybillService.findNoFinishWaybillByBillladingId(billladingId); @@ -460,6 +479,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl waybillIdSet = map.keySet(); List waybillEntityList = warehouseWaybillClient.findListByWaybillIds(new ArrayList<>(waybillIdSet)); + + List list =new ArrayList<>(); + waybillEntityList.forEach(waybillEntity -> { Integer integer = map.get(waybillEntity.getId()); if(Objects.isNull(integer)){ @@ -470,8 +492,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl