diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index c6f206e14..4af7ccd8a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -226,6 +226,7 @@ SELECT distinct ldsa.order_code orderCode, ldsa.consignee_unit, + ldsa.id, ldsa.consignee_person, ldsa.consignee_address, ldsa.consignee_mobile, 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 2c6095559..4e20bf389 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 @@ -44,10 +44,7 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; @@ -149,7 +146,25 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl selectDistributionDeliveryorder(IPage page, Map distributionStockArticle) { List distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle); - distributionDeliveryInfoVOS.forEach(s -> { + List loadList = distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId")) + ); + Map> orderLoadMap; + if (!Objects.isNull(loadList)){ + orderLoadMap = loadList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId)); + } else { + orderLoadMap = null; + } + distributionDeliveryInfoVOS.forEach(s -> { + //匹配当前配送任务签收数量 + s.setSigningNumber(0); + if (Func.isNotEmpty(orderLoadMap)){ + List orderLoading = orderLoadMap.get(s.getId()); + if (Func.isNotEmpty(orderLoading)){ + int signingNum = orderLoading.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); + s.setSigningNumber(signingNum); + } + } switch (s.getOrderStatus()) { case "10": s.setOrderStatusName(OrderStatusConstant.bufenruku.getName()); @@ -171,7 +186,6 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl