|
@@ -3,6 +3,8 @@ package com.sckw.transport.service;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
|
|
+import com.sckw.core.common.enums.enums.ErrorCodeEnum;
|
|
|
|
|
+import com.sckw.core.exception.BusinessPlatfromException;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.response.BaseResult;
|
|
import com.sckw.core.web.response.BaseResult;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
@@ -14,6 +16,7 @@ import com.sckw.product.api.dubbo.GoodsInfoService;
|
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
import com.sckw.product.api.model.KwpGoods;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
|
|
+import com.sckw.transport.model.enuma.WeighbridgeTypeEnum;
|
|
|
import com.sckw.transport.model.param.TradeOrderTransportQueryReq;
|
|
import com.sckw.transport.model.param.TradeOrderTransportQueryReq;
|
|
|
import com.sckw.transport.model.param.WaybillTransportQueryReq;
|
|
import com.sckw.transport.model.param.WaybillTransportQueryReq;
|
|
|
import com.sckw.transport.model.vo.TradeOrderTransportInfoResp;
|
|
import com.sckw.transport.model.vo.TradeOrderTransportInfoResp;
|
|
@@ -23,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -55,6 +59,7 @@ public class TradeOrderTransportInfoService {
|
|
|
private final KwtLogisticsOrderGoodsRepository logisticsOrderGoodsRepository;
|
|
private final KwtLogisticsOrderGoodsRepository logisticsOrderGoodsRepository;
|
|
|
private final KwtLogisticsOrderAddressRepository logisticsOrderAddressRepository;
|
|
private final KwtLogisticsOrderAddressRepository logisticsOrderAddressRepository;
|
|
|
private final KwtGatekeeperWaybillOrderRepository kwtGatekeeperWaybillOrderRepository;
|
|
private final KwtGatekeeperWaybillOrderRepository kwtGatekeeperWaybillOrderRepository;
|
|
|
|
|
+ private final KwtWaybillOrderWeighbridgeRepository waybillOrderWeighbridgeRepository;
|
|
|
|
|
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
private GoodsInfoService goodsInfoService;
|
|
private GoodsInfoService goodsInfoService;
|
|
@@ -210,12 +215,31 @@ public class TradeOrderTransportInfoService {
|
|
|
Collections.singletonList(waybillOrder),
|
|
Collections.singletonList(waybillOrder),
|
|
|
tradeOrder
|
|
tradeOrder
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 7. 查询运单过磅信息
|
|
|
|
|
+ KwtWaybillOrderWeighbridge waybillOrderWeighbridge = queryWeighbridge(waybillOrder);
|
|
|
|
|
+ Long weighbridgeId = waybillOrderWeighbridge.getWeighbridgeId();
|
|
|
|
|
+ resp.setWeighbridgeId(weighbridgeId);
|
|
|
|
|
+
|
|
|
log.info("根据运单号查询运输信息完成,waybillNo:{}, taskSize:{}", waybillNo,
|
|
log.info("根据运单号查询运输信息完成,waybillNo:{}, taskSize:{}", waybillNo,
|
|
|
Objects.nonNull(resp.getTasks()) ? resp.getTasks().size() : 0);
|
|
Objects.nonNull(resp.getTasks()) ? resp.getTasks().size() : 0);
|
|
|
return resp;
|
|
return resp;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询过磅信息
|
|
|
|
|
+ * @param waybillOrder
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private KwtWaybillOrderWeighbridge queryWeighbridge(KwtWaybillOrder waybillOrder) {
|
|
|
|
|
+ List<KwtWaybillOrderWeighbridge> weighbridges = waybillOrderWeighbridgeRepository
|
|
|
|
|
+ .queryWaybillOrderWeighbridgeByWOrderId(waybillOrder.getId(), WeighbridgeTypeEnum.LOADING.getCode());
|
|
|
|
|
+ if (CollectionUtils.isEmpty(weighbridges)) {
|
|
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.DATA_NOT_EXIST, "未查询到地磅信息!");
|
|
|
|
|
+ }
|
|
|
|
|
+ return weighbridges.get(0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询贸易订单详细信息。
|
|
* 查询贸易订单详细信息。
|
|
|
* <p>
|
|
* <p>
|