|
|
@@ -830,20 +830,13 @@ public class KwoTradeOrderService {
|
|
|
if (detail.getContractInfo() != null && DispatchWayEnums.AUTO_DISPATCH.getCode().equals(detail.getContractInfo().getDispatchWay())) {
|
|
|
//查询销售企业
|
|
|
KwoTradeOrderUnit tradeOrderUnit = units.stream().filter(unit -> String.valueOf(Global.NUMERICAL_TWO).equals(unit.getUnitType())).findFirst().orElse(null);
|
|
|
- //
|
|
|
Long goodsId = detail.getGoodsInfo().getGoodsId();
|
|
|
//查询满足自动派单的物流合同
|
|
|
List<LogisticsEntDtoVO> contractLogisticsList = remoteContractService.queryAutoContractLogOrder(tradeOrderUnit.getEntId(), Lists.newArrayList(goodsId));
|
|
|
- List<LogisticsEntDtoVO> validContractLogList = contractLogisticsList.stream().filter(Objects::nonNull)
|
|
|
- .filter(log -> log.getStartTime() != null)
|
|
|
- .filter(log -> {
|
|
|
- // 有效期:物流合同开始时间 <= 当前时间
|
|
|
- return !log.getStartTime().after(new Date());
|
|
|
- }).collect(Collectors.toList());
|
|
|
- if (CollectionUtils.isEmpty(validContractLogList)) {
|
|
|
+ if (CollectionUtils.isEmpty(contractLogisticsList)) {
|
|
|
throw new BusinessException("未找到该商品有效的自动派车物流合同,请先签订自动派车物流合同");
|
|
|
}
|
|
|
- List<ContractInfo> contractInfoList = validContractLogList.stream().map(d -> {
|
|
|
+ List<ContractInfo> contractInfoList = contractLogisticsList.stream().map(d -> {
|
|
|
ContractInfo contractInfo = new ContractInfo();
|
|
|
contractInfo.setContractId(d.getContractId());
|
|
|
contractInfo.setContractNo(d.getContractNo());
|
|
|
@@ -2444,17 +2437,11 @@ public class KwoTradeOrderService {
|
|
|
KwoTradeOrderUnit tradeOrderUnit = unitMap.get(String.valueOf(Global.NUMERICAL_TWO));
|
|
|
//查询满足自动派单的物流合同
|
|
|
List<LogisticsEntDtoVO> contractLogisticsList = remoteContractService.queryAutoContractLogOrder(tradeOrderUnit.getEntId(), Lists.newArrayList(byOrderId.getId()));
|
|
|
- List<LogisticsEntDtoVO> validContractLog = contractLogisticsList.stream().filter(Objects::nonNull)
|
|
|
- .filter(log -> log.getStartTime() != null)
|
|
|
- .filter(log -> {
|
|
|
- // 有效期:物流合同开始时间 <= 当前时间
|
|
|
- return !log.getStartTime().after(new Date());
|
|
|
- }).collect(Collectors.toList());
|
|
|
- if (CollectionUtils.isEmpty(validContractLog)) {
|
|
|
+ if (CollectionUtils.isEmpty(contractLogisticsList)) {
|
|
|
throw new BusinessException("未找到该商品有效的自动派车物流合同,请先签订自动派车物流合同");
|
|
|
}
|
|
|
//填充运输单价
|
|
|
- for (LogisticsEntDtoVO vo : validContractLog) {
|
|
|
+ for (LogisticsEntDtoVO vo : contractLogisticsList) {
|
|
|
LogisticsGoodsDto dto = remoteContractService.queryLogGoodsByContractId(vo.getContractId(), byOrderId.getGoodsId());
|
|
|
if (dto.getPrice() == null || dto.getPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
|
vo.setTransportPrice(vo.getCommonPrice());
|
|
|
@@ -2462,7 +2449,7 @@ public class KwoTradeOrderService {
|
|
|
vo.setTransportPrice(dto.getPrice());
|
|
|
}
|
|
|
}
|
|
|
- return validContractLog;
|
|
|
+ return contractLogisticsList;
|
|
|
}
|
|
|
|
|
|
/**
|