|
|
@@ -39,6 +39,7 @@ import com.sckw.order.api.dubbo.RemoteTradeOrderAmountService;
|
|
|
import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
|
import com.sckw.order.api.model.*;
|
|
|
import com.sckw.product.api.dubbo.GoodsInfoService;
|
|
|
+import com.sckw.product.api.model.GoodsDetails;
|
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
|
import com.sckw.redis.config.RedisLockUtil;
|
|
|
import com.sckw.redis.constant.RedisConstant;
|
|
|
@@ -82,7 +83,6 @@ import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
/**
|
|
|
* @author lfdc
|
|
|
@@ -2240,7 +2240,6 @@ public class KwtLogisticsConsignmentService {
|
|
|
private static final ExecutorService QUERY_EXECUTOR = Executors.newFixedThreadPool(10);
|
|
|
|
|
|
|
|
|
-
|
|
|
public PageDataResult<LogisticsOrderResp> queryLogisticsOrderByPage(QueryLogisticsOrderReq req) {
|
|
|
log.info("分页查询物流订单传递参数信息:{}", JSONObject.toJSONString(req));
|
|
|
|
|
|
@@ -2323,7 +2322,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
*/
|
|
|
private boolean shouldReturnEmptyResult(Set<Long> logOrderIds, Set<Long> entList, QueryLogisticsOrderReq req) {
|
|
|
return CollectionUtils.isEmpty(logOrderIds) &&
|
|
|
- (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getContractId(), req.getGoodsName(),req.getConsignCompanyId(),req.getCarriageCompanyId()));
|
|
|
+ (!org.apache.commons.lang3.StringUtils.isAllBlank(req.getContractId(), req.getGoodsName(), req.getConsignCompanyId(), req.getCarriageCompanyId()));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -2568,6 +2567,19 @@ public class KwtLogisticsConsignmentService {
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+ public List<LogisticsBaseOrderVo> queryBaseList(LogisticsOrderPara orderPara) {
|
|
|
+ UserResDto userResDto = remoteSystemService.queryUserById(orderPara.getUserId());
|
|
|
+ if (Objects.nonNull(userResDto)) {
|
|
|
+ orderPara.setType(userResDto.getType());
|
|
|
+ Integer systemType = userResDto.getSystemType();
|
|
|
+ if (!Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode())) {
|
|
|
+ orderPara.setEntId(remoteUserService.findChildEntList(userResDto.getEntId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return kwtLogisticsOrderMapper.selectBase(orderPara);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 基础查询数据
|
|
|
*/
|
|
|
@@ -2591,7 +2603,6 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public Set<Long> getEntList() {
|
|
|
return entListFuture.join();
|
|
|
}
|
|
|
@@ -2724,7 +2735,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
@NotNull
|
|
|
private Set<Long> getLogOrderIds(QueryLogisticsOrderReq req, Set<Long> entList, Long allEnt) {
|
|
|
Set<Long> logOrderIds = Sets.newHashSet();
|
|
|
- if (Objects.nonNull(allEnt)){
|
|
|
+ if (Objects.nonNull(allEnt)) {
|
|
|
entList.add(allEnt);
|
|
|
}
|
|
|
List<KwtLogisticsOrderUnit> logOrderUnits = logisticsOrderUnitRepository.queryByEntIds(entList);
|
|
|
@@ -2732,7 +2743,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
// 获取物流订单ID集合
|
|
|
Set<Long> logOrderIdList = logOrderUnits.stream()
|
|
|
- .filter(x->Objects.equals(x.getEntId(),entId))
|
|
|
+ .filter(x -> Objects.equals(x.getEntId(), entId))
|
|
|
.map(KwtLogisticsOrderUnit::getLOrderId)
|
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
@@ -2764,10 +2775,10 @@ public class KwtLogisticsConsignmentService {
|
|
|
.map(KwtLogisticsOrderContract::getLOrderId)
|
|
|
.collect(Collectors.toSet());
|
|
|
logOrderIds.addAll(logOrderIdList);
|
|
|
- logOrderIds = logOrderIds.stream()
|
|
|
- .filter(x->logOrderIdList.contains(x))
|
|
|
+ logOrderIds = logOrderIds.stream()
|
|
|
+ .filter(x -> logOrderIdList.contains(x))
|
|
|
.collect(Collectors.toSet());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
logOrderIds = Sets.newHashSet();
|
|
|
}
|
|
|
}
|
|
|
@@ -2783,7 +2794,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
// logOrderIds = logOrderIds.stream()
|
|
|
// .filter(x->logOrderFormGoodsIds.contains(x))
|
|
|
// .collect(Collectors.toSet());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
logOrderIds = Sets.newHashSet();
|
|
|
}
|
|
|
}
|
|
|
@@ -2884,9 +2895,9 @@ public class KwtLogisticsConsignmentService {
|
|
|
}
|
|
|
|
|
|
private static BigDecimal getSupAmount(Long tradeOrderId,
|
|
|
- Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
|
- Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList,
|
|
|
- Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList) {
|
|
|
+ Map<Long, OrderDetailVo> tradeIdAndOrderDetailVoMap,
|
|
|
+ Map<Long, List<KwtLogisticsOrder>> tradeIdAndLogOrderList,
|
|
|
+ Map<Long, List<KwtWaybillOrderSubtask>> logisticsOrderIdAndSubtaskList) {
|
|
|
// KwtLogisticsOrder order = logOrderMap.getOrDefault(wbOrder.getLOrderId(), new KwtLogisticsOrder());
|
|
|
OrderDetailVo detailVo = tradeIdAndOrderDetailVoMap.getOrDefault(tradeOrderId, new OrderDetailVo());
|
|
|
BigDecimal tradeAmount = Optional.ofNullable(detailVo).map(OrderDetailVo::getAmount).orElse(BigDecimal.ZERO);
|
|
|
@@ -2903,14 +2914,14 @@ public class KwtLogisticsConsignmentService {
|
|
|
.filter(Objects::nonNull)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
//logTotatalAmount = logTotatalAmount.add(loadAmountSum);
|
|
|
- if (org.apache.commons.lang3.StringUtils.equals(billingMode, DictEnum.CHARGING_TYPE_1.getValue())){
|
|
|
+ if (org.apache.commons.lang3.StringUtils.equals(billingMode, DictEnum.CHARGING_TYPE_1.getValue())) {
|
|
|
BigDecimal unloadAmountSum = waybillOrderSubtasks.stream()
|
|
|
.filter(x -> !Objects.equals(x.getStatus(), CarWaybillV1Enum.CANCELLED.getCode()))
|
|
|
.map(KwtWaybillOrderSubtask::getLoadAmount)
|
|
|
.filter(Objects::nonNull)
|
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
logTotatalAmount = logTotatalAmount.add(loadAmountSum).add(unloadAmountSum);
|
|
|
- }else if (org.apache.commons.lang3.StringUtils.equals(billingMode, DictEnum.CHARGING_TYPE_2.getValue())){
|
|
|
+ } else if (org.apache.commons.lang3.StringUtils.equals(billingMode, DictEnum.CHARGING_TYPE_2.getValue())) {
|
|
|
BigDecimal unloadAmountSum = waybillOrderSubtasks.stream()
|
|
|
.filter(x -> !Objects.equals(x.getStatus(), CarWaybillV1Enum.CANCELLED.getCode()))
|
|
|
.map(KwtWaybillOrderSubtask::getUnloadAmount)
|
|
|
@@ -3544,7 +3555,7 @@ public class KwtLogisticsConsignmentService {
|
|
|
logisticsOrderRepository.updateBatchById(logisticsOrders);
|
|
|
|
|
|
//更新贸易订单数据
|
|
|
- // updateTradeOrder(tradeIds);
|
|
|
+ // updateTradeOrder(tradeIds);
|
|
|
return Boolean.TRUE;
|
|
|
}
|
|
|
|
|
|
@@ -3664,9 +3675,14 @@ public class KwtLogisticsConsignmentService {
|
|
|
orderPara.setEntId(remoteUserService.findChildEntList(userResDto.getEntId()));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
List<LogisticsOrderVo> list = kwtLogisticsOrderMapper.selectData(orderPara);
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
list.forEach(d -> {
|
|
|
+ GoodsDetails detailById = goodsInfoService.getDetail(d.getGoodsId());
|
|
|
+ if (Objects.nonNull(detailById)) {
|
|
|
+ d.setGoodsName(d.getGoodsName() + detailById.getSpecLabel());
|
|
|
+ }
|
|
|
d.setStatusLabel(LogisticsOrderV1Enum.getDesc(d.getStatus()));
|
|
|
});
|
|
|
return list;
|