|
|
@@ -2637,38 +2637,17 @@ public class KwtLogisticsConsignmentService {
|
|
|
addLogisticOrderDTO.setOrderType(1);
|
|
|
List<LogisticsEntDto> logisticsContractList = addLogisticsOrderParam.getLogisticsContractList();
|
|
|
Long goodsId = addLogisticsOrderParam.getGoodsId();
|
|
|
- List<LogisticData> collect = logisticsContractList.stream().map(d -> {
|
|
|
- LogisticData logisticInfo = new LogisticData();
|
|
|
- logisticInfo.setContractId(d.getContractId());
|
|
|
- logisticInfo.setContractNo(d.getContractNo());
|
|
|
- logisticInfo.setContractName("");
|
|
|
- logisticInfo.setAcceptCompanyId(d.getEntId());
|
|
|
- logisticInfo.setAcceptContactPhone("");
|
|
|
- logisticInfo.setAcceptContacts(d.getContacts());
|
|
|
- logisticInfo.setAcceptContactsId(d.getContactsId());
|
|
|
- logisticInfo.setAcceptCompany("");
|
|
|
- logisticInfo.setPrice(d.getTransportPrice());
|
|
|
- logisticInfo.setPriceType(0L);
|
|
|
- logisticInfo.setAmount(addLogisticsOrderParam.getAmount());
|
|
|
- logisticInfo.setAmountUnit("");//默认是吨 todo
|
|
|
- logisticInfo.setLoss(new BigDecimal("0"));
|
|
|
- logisticInfo.setPayment(0L);
|
|
|
- logisticInfo.setSigningWay(0);
|
|
|
- logisticInfo.setLossUnit("");
|
|
|
- logisticInfo.setRemark("");
|
|
|
- logisticInfo.setType(0);
|
|
|
-
|
|
|
- return logisticInfo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- addLogisticOrderDTO.setLogisticInfo(collect);
|
|
|
+ Long contractId = logisticsContractList.get(0).getContractId();
|
|
|
+
|
|
|
+ List<TradeContractUnitDto> tradeContractUnitDtos = contractService.queryLogContractUnitByContractId(contractId);
|
|
|
+
|
|
|
+
|
|
|
addLogisticOrderDTO.setEntId(LoginUserHolder.getEntId());
|
|
|
addLogisticOrderDTO.setUserId(LoginUserHolder.getUserId());
|
|
|
//todo 获取不到的参数
|
|
|
addLogisticOrderDTO.setTradeOrderId(0L);
|
|
|
addLogisticOrderDTO.setTradeOrderNo("");
|
|
|
|
|
|
- Long contractId = logisticsContractList.get(0).getContractId();
|
|
|
- List<TradeContractUnitDto> tradeContractUnitDtos = contractService.queryLogContractUnitByContractId(contractId);
|
|
|
for (TradeContractUnitDto tradeContractUnitDto : tradeContractUnitDtos) {
|
|
|
if(StrUtil.equals(tradeContractUnitDto.getUnitType(),"3")){
|
|
|
addLogisticOrderDTO.setConsignCompany(tradeContractUnitDto.getFirmName());
|
|
|
@@ -2677,7 +2656,30 @@ public class KwtLogisticsConsignmentService {
|
|
|
addLogisticOrderDTO.setConsignContacts(tradeContractUnitDto.getContacts());
|
|
|
addLogisticOrderDTO.setConsignContactsId(tradeContractUnitDto.getContactsId());
|
|
|
}else if(StrUtil.equals(tradeContractUnitDto.getUnitType(),"4")){
|
|
|
-
|
|
|
+ List<LogisticData> collect = logisticsContractList.stream().map(d -> {
|
|
|
+ LogisticData logisticInfo = new LogisticData();
|
|
|
+ logisticInfo.setContractId(d.getContractId());
|
|
|
+ logisticInfo.setContractNo(d.getContractNo());
|
|
|
+ logisticInfo.setContractName("");
|
|
|
+ logisticInfo.setAcceptCompanyId(tradeContractUnitDto.getEntId());
|
|
|
+ logisticInfo.setAcceptContactPhone(tradeContractUnitDto.getPhone());
|
|
|
+ logisticInfo.setAcceptContacts(tradeContractUnitDto.getContacts());
|
|
|
+ logisticInfo.setAcceptContactsId(tradeContractUnitDto.getContactsId());
|
|
|
+ logisticInfo.setAcceptCompany("");
|
|
|
+ logisticInfo.setPrice(d.getTransportPrice());
|
|
|
+ logisticInfo.setPriceType(0L);
|
|
|
+ logisticInfo.setAmount(addLogisticsOrderParam.getAmount());
|
|
|
+ logisticInfo.setAmountUnit("");//默认是吨 todo
|
|
|
+ logisticInfo.setLoss(new BigDecimal("0"));
|
|
|
+ logisticInfo.setPayment(0L);
|
|
|
+ logisticInfo.setSigningWay(0);
|
|
|
+ logisticInfo.setLossUnit("");
|
|
|
+ logisticInfo.setRemark("");
|
|
|
+ logisticInfo.setType(0);
|
|
|
+
|
|
|
+ return logisticInfo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ addLogisticOrderDTO.setLogisticInfo(collect);
|
|
|
addLogisticOrderDTO.setNonConsignCompany(tradeContractUnitDto.getFirmName());
|
|
|
addLogisticOrderDTO.setNonConsignCompanyId(tradeContractUnitDto.getEntId());
|
|
|
addLogisticOrderDTO.setNonConsignContactPhone(tradeContractUnitDto.getPhone());
|
|
|
@@ -3314,7 +3316,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
Long logOrderId = kwtLogisticsOrder.getId();
|
|
|
// 获取当前物流订单下的所有子运单
|
|
|
List<KwtWaybillOrderSubtask> waybillOrderSubtasks = logisticsOrderIdAndSubtaskList.getOrDefault(logOrderId, Collections.emptyList());
|
|
|
-
|
|
|
+
|
|
|
if (CollectionUtils.isEmpty(waybillOrderSubtasks)) {
|
|
|
log.debug("物流订单 {} 下无子运单,跳过", logOrderId);
|
|
|
continue;
|
|
|
@@ -3364,8 +3366,8 @@ public class KwtLogisticsConsignmentService {
|
|
|
// 累加当前物流订单的已使用量
|
|
|
BigDecimal currentUsed = entrustAmount.add(ticketAmount);
|
|
|
usedAmount = usedAmount.add(currentUsed);
|
|
|
-
|
|
|
- log.debug("物流订单 {} 计算详情: 委托量={}, 磅单量={}, 计费类型={}",
|
|
|
+
|
|
|
+ log.debug("物流订单 {} 计算详情: 委托量={}, 磅单量={}, 计费类型={}",
|
|
|
logOrderId, entrustAmount, ticketAmount, ticketType);
|
|
|
}
|
|
|
}
|