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

Merge remote-tracking branch 'origin/v29.7_pending_freight_20241017' into test_jdk17

Former-commit-id: 4987dbb3
......@@ -99,16 +99,6 @@ public class PendingFreightServiceImpl implements PendingFreightService {
pendingFreight.setOrderDistance(calcOrderDistance(sendAddress,receiveAddress,data.getOrderNo()));
}
//计算线路历史挂单运费
BigDecimal historyFreight = this.queryLinePendingFreight(data.getSendAddressId(),
data.getReveiveAddressId());
//计算线路历史平均挂单运费
BigDecimal historyAvgFreight = this.queryLineAvgPendingFreight(data.getSendAddressId(),
data.getReveiveAddressId());
pendingFreight.setHistoryFreight(historyFreight);
pendingFreight.setHistoryAvgFreight(historyAvgFreight);
pendingFreightDao.updateEntityByKey(pendingFreight);
}else{
item.setOrderNo(data.getOrderNo());
......@@ -121,6 +111,16 @@ public class PendingFreightServiceImpl implements PendingFreightService {
sendAddress.getCity(),sendAddress.getCounty(),sendAddress.getAddress()));
//计算重车运距
item.setOrderDistance(calcOrderDistance(sendAddress,receiveAddress,data.getOrderNo()));
//计算线路历史挂单运费
BigDecimal historyFreight = this.queryLinePendingFreight(data.getSendAddressId(),
data.getReveiveAddressId());
//计算线路历史平均挂单运费
BigDecimal historyAvgFreight = this.queryLineAvgPendingFreight(data.getSendAddressId(),
data.getReveiveAddressId());
item.setHistoryFreight(historyFreight);
item.setHistoryAvgFreight(historyAvgFreight);
pendingFreightDao.saveEntity(item);
}
}
......@@ -159,7 +159,11 @@ public class PendingFreightServiceImpl implements PendingFreightService {
//查询该线路最新的历史运费
public BigDecimal queryLinePendingFreight(Integer sendAddressId,Integer receiveAddressId){
OrderGoods orderGoods = orderGoodsDao.queryLineNewestPendingFreight(sendAddressId,receiveAddressId);
return orderGoods.getPendingOrderFreight();
if(Objects.nonNull(orderGoods)){
return orderGoods.getPendingOrderFreight();
}
return BigDecimal.ZERO;
}
......@@ -170,7 +174,7 @@ public class PendingFreightServiceImpl implements PendingFreightService {
List<OrderGoods> list = orderGoodsDao.queryLineAvgPendingFreight(sendAddressId,receiveAddressId,monthAgo,now);
if(CollectionUtils.isEmpty(list)){
return null;
return BigDecimal.ZERO;
}
BigDecimal total = BigDecimal.ZERO;
for (OrderGoods orderGoods : list) {
......@@ -309,9 +313,9 @@ public class PendingFreightServiceImpl implements PendingFreightService {
rowData.add(new ExcelData(vo.getOrderDistance(), "-"));
rowData.add(new ExcelData(vo.getSendAddressExpenses(), "-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getHistoryFreight())?vo.getHistoryFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getHistoryAvgFreight())?vo.getHistoryFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getPredictionFreightPrice())?vo.getHistoryFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getLogisticsFreight())?vo.getHistoryFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getHistoryAvgFreight())?vo.getHistoryAvgFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getPredictionFreightPrice())?vo.getPredictionFreightPrice().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(Objects.nonNull(vo.getLogisticsFreight())?vo.getLogisticsFreight().movePointLeft(2):null,"-"));
rowData.add(new ExcelData(""));
dataList.add(rowData);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论