diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index 8203a8be3..e0a6b5a38 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -137,7 +137,7 @@ public interface DistributionReservationMapper extends BaseMapper selectPackageByReservationAndStockArticle(@Param("reservationId") Long reservationId,@Param("stockArticleId") Long stockArticleId); + List selectPackageByReservationAndStockArticle(@Param("reservationId") Long reservationId,@Param("stockArticleId") Long stockArticleId,@Param("warehourseId") Long warehourseId); /** * 查询预约的订单中间表 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index c65ffe26d..c94a24761 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -805,7 +805,7 @@ ldpl.order_package_delivery_status FROM logpm_distribution_reservation_package AS ldrp - LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id + LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.order_package_code = ldrp.packet_bar_code and ldpl.warehouse_id=#{warehourseId} LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.id = lwtg.association_id and lwtg.association_type = 3 LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.id = lwug.association_id and lwug.association_type = 3 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 24a6e44e6..553cc272f 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 @@ -1238,6 +1238,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { @Override @Transactional public void checkRetentionReservationAndDeliveryInfo(Long reservationId, Long deliveryId) { + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId); if (Func.isNotEmpty(distributionReservationEntity)) { //重新统计预约单包件数量 @@ -1245,7 +1246,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (Func.isNotEmpty(distributionReservationStockarticleEntities)) { for (DistributionReservationStockarticleEntity distributionReservationStockarticleEntity : distributionReservationStockarticleEntities) { if (distributionReservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { - List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionReservationStockarticleEntity.getStockArticleId()); + List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionReservationStockarticleEntity.getStockArticleId(),myCurrentWarehouse.getId()); if (Func.isNotEmpty(distributionParcelListEntities)) { if (distributionParcelListEntities.size() != distributionReservationStockarticleEntity.getReservationNum()) { distributionReservationStockarticleEntity.setReservationNum(distributionParcelListEntities.size()); @@ -1486,7 +1487,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (k.equals(s)){ List mtReceiveContentDTOS = new ArrayList<>(); for (DistributionStockArticleEntity distributionStockArticleEntity : v) { - List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionStockArticleEntity.getId()); + List distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionStockArticleEntity.getId(),warehouseId); for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { if (distributionParcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ String signingTime = distributionLoadscanMapper.selectPackageSigningTime(distributionParcelListEntity.getId()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index 5ae1567d6..3b69294d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -19,6 +19,8 @@ package com.logpm.distribution.service.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.dto.DistributionDeliveryInfoDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.entity.*; @@ -80,6 +82,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryInfoPage(IPage page, DistributionDeliveryInfoVO distributionDeliveryInfo) { List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryInfoPage(page, distributionDeliveryInfo); @@ -226,6 +229,8 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl stockArticleVOS = distributionReservationMapper.selectOrderInfoByReservationId(reservationId); // List packageListByReservationId = distributionReservationMapper.selectPackageListByReservationId(Long.parseLong(distributionAppDeliveryListDTO.getReservationId())); @@ -250,7 +255,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl k2)); } if (ord.getIsZero().equals(IsOrNoConstant.no.getValue())) { - List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId()); + List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId(),myCurrentWarehouse.getId()); List ks = new ArrayList<>(); AtomicInteger atomicInteger = new AtomicInteger(); // 装车数量 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index ee3da8a78..eebf03560 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -1522,9 +1522,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId()); + List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId(),myCurrentWarehouse.getId()); for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { - DistributionLoadscanEntity packageLoadingScan = distributionLoadscanService.getOne(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + List packageLoadingScans = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + DistributionLoadscanEntity packageLoadingScan=null; + if(packageLoadingScans!=null&&!packageLoadingScans.isEmpty()){ + log.info(">>>>>>>>> 包件查询 的装车件数:{}",packageLoadingScans.size()); + packageLoadingScan = packageLoadingScans.get(0); + } //无装车数据包件进行装车 if (Func.isEmpty(packageLoadingScan)) { DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); @@ -2439,6 +2444,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl getAppDeliveryreservationListPage( DistributionAppDeliveryListDTO distributionDeliveryList) { //查询客户 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); List customList = distributionDeliveryInfoMapper.selectAppcustomListPage(distributionDeliveryList.getId()); for (DistributionAppReservationVO distributionAppReservationVO : customList) { List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(distributionAppReservationVO.getId()); @@ -2454,7 +2460,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId()); + List parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId(),myCurrentWarehouse.getId()); parcelListEntities.forEach(p -> { WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = new WarehouseTrayGoodsEntity(); warehouseTrayGoodsEntity.setAssociationId(p.getId()); @@ -3723,6 +3729,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl=distributionAppStockArticleVO.getReservationNum()) {ordCount +=1;} // } + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + DistributionDeliveryListEntity distributionDeliveryListEntity = baseMapper.selectById(distributionAppDeliveryListDTO.getId()); DistributionAppDeliveryListVO distributionAppDeliveryListVO = Func.copy(distributionDeliveryListEntity, DistributionAppDeliveryListVO.class); //查询该配送所有包条 @@ -3754,7 +3762,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) { - List parcelListEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(rs.getReservationId(), rs.getStockArticleId()); + List parcelListEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(rs.getReservationId(), rs.getStockArticleId(),myCurrentWarehouse.getId()); List packageLoadingList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListDTO.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).in(DistributionLoadscanEntity::getPackageId, parcelListEntityList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()))); if (Func.isNotEmpty(packageLoadingList)) { signNubSr.getAndAdd(packageLoadingList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 503006f54..25a8511d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -2660,6 +2660,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl signforPackageList(Long signforId) { + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); //查询出该签收的客户信息 DistributionSignforEntity signforEntity = this.getById(signforId); List parcelListEntities = baseMapper.getSignforPackageList(signforEntity.getReservationId()); @@ -2670,7 +2671,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl { if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) { - List parcelListEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(rs.getReservationId(), rs.getStockArticleId()); + List parcelListEntityList = distributionReservationMapper.selectPackageByReservationAndStockArticle(rs.getReservationId(), rs.getStockArticleId(),myCurrentWarehouse.getId()); List parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList); parcelListVOList.forEach(p -> { p.setReservationNum(p.getQuantity());