提交 ac7dfed1 authored 作者: 刘海泉's avatar 刘海泉

merge

上级 29ad97d4
...@@ -110,4 +110,6 @@ public interface OrderChildService { ...@@ -110,4 +110,6 @@ public interface OrderChildService {
UpdateCarrierBatchCancelVO updateCarrierBatchCancel(OrderChildCarrierBatchCancelParam param); UpdateCarrierBatchCancelVO updateCarrierBatchCancel(OrderChildCarrierBatchCancelParam param);
List<HistoryLineTranVolumeChartVO> getHistoryLineTransportVolume(String orderNo);
} }
...@@ -3142,47 +3142,6 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -3142,47 +3142,6 @@ public class OrderChildServiceImpl implements OrderChildService {
} }
} }
@Override
public List<HistoryLineTranVolumeChartVO> getHistoryLineTransportVolume(String orderNo) {
//查询近一个月与该订单收发货地线路一致的订单
Optional<List<String>> result = orderService.getMonthSameLineOrderList(orderNo);
if(!result.isPresent()){
log.warn("通过订单号:{} 查找相同线路的订单列列表,返回结果:{}",orderNo,result);
throw new ServiceSystemException(ResultEnum.DATA_ERROR,"获取相同线路的订单列表失败");
}
List<BigDecimal> priceList = orderGoodsAdjustmentPriceService.getNoRepeatAdjustmentPriceRecord(result.get());
List<HistoryLineTranVolumeChartVO> charts = new ArrayList<>();
if(CollectionUtils.isEmpty(priceList)){
return charts;
}
//查询相同路线的订单下的所有运单
List<OrderChild> childs = orderChildDao.listCompleteByOrderNos(result.get());
if(CollectionUtils.isEmpty(childs)){
priceList.forEach(item-> charts.add(HistoryLineTranVolumeChartVO.builder()
.pendingOrderFreight(item).number(0).build()));
return charts;
}
LinkedHashMap<BigDecimal,Integer> priceMap =
priceList.stream().collect(Collectors.toMap(item->item,item->0,
(existing, replacement) -> existing, // 如果有冲突的键,则保留现有的键
LinkedHashMap::new));
//进行相同路线运费拉运单数统计
childs.forEach(item->{
if(priceMap.containsKey(item.getFreightPrice())){
priceMap.put(item.getFreightPrice(),priceMap.get(item.getFreightPrice()) + 1);
}
});
for (Map.Entry<BigDecimal, Integer> entry : priceMap.entrySet()) {
charts.add(HistoryLineTranVolumeChartVO.builder().pendingOrderFreight(entry.getKey()).number(
entry.getValue()).build());
}
return charts;
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public UpdateCarrierBatchCancelVO updateCarrierBatchCancel(OrderChildCarrierBatchCancelParam param) { public UpdateCarrierBatchCancelVO updateCarrierBatchCancel(OrderChildCarrierBatchCancelParam param) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论