|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|