Browse Source

配送详情页增加订单签收数量字段

single_db
汤建军 1 year ago
parent
commit
9f921a088c
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  2. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

1
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,

26
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<Distrib
@Override
public IPage<DistributionStockArticleVO> selectDistributionDeliveryorder(IPage<DistributionStockArticleVO> page, Map<String, Object> distributionStockArticle) {
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle);
distributionDeliveryInfoVOS.forEach(s -> {
List<DistributionLoadscanEntity> loadList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId"))
);
Map<Long, List<DistributionLoadscanEntity>> 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<DistributionLoadscanEntity> 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<Distrib
break;
case "80":
s.setOrderStatusName(OrderStatusConstant.qianshou.getName());
break;
}
});

Loading…
Cancel
Save