|
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
|
@@ -44,11 +45,15 @@ import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.dto.*;
|
|
|
import com.sckw.transport.model.param.ContractParam;
|
|
|
import com.sckw.transport.model.param.LogisticsOrderParam;
|
|
|
+import com.sckw.transport.model.vo.LogisticsOrderUnitResp;
|
|
|
import com.sckw.transport.model.vo.*;
|
|
|
+import com.sckw.transport.repository.KwtLogisticsOrderUnitRepository;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cloud.stream.function.StreamBridge;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -67,6 +72,7 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
public class KwtTransportCommonService {
|
|
|
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 10000)
|
|
|
@@ -136,6 +142,7 @@ public class KwtTransportCommonService {
|
|
|
@Autowired
|
|
|
private KwtLogisticsOrderLineFreightRateMapper kwtLogisticsOrderLineFreightRateMapper;
|
|
|
|
|
|
+ public final KwtLogisticsOrderUnitRepository logisticsOrderUnitRepository;
|
|
|
/**
|
|
|
* 查看订单详情
|
|
|
*
|
|
|
@@ -1878,4 +1885,37 @@ public class KwtTransportCommonService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询物流订单托运/承运企业
|
|
|
+ */
|
|
|
+ public List<LogisticsOrderUnitResp> queryOrderUnits(Long lOrderId) {
|
|
|
+ log.info("查询物流订单托运/承运企业---> lOrderId:{}", lOrderId);
|
|
|
+ if (lOrderId == null) {
|
|
|
+ throw new BusinessException("物流订单ID不能为空");
|
|
|
+ }
|
|
|
+ List<KwtLogisticsOrderUnit> units =logisticsOrderUnitRepository.queryListByLOrderId(lOrderId);
|
|
|
+ if (CollectionUtils.isEmpty(units)){
|
|
|
+ return List.of();
|
|
|
+ }
|
|
|
+ return units.stream()
|
|
|
+ .map(KwtTransportCommonService::getLogisticsOrderUnitResp).
|
|
|
+ collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ @NotNull
|
|
|
+ private static LogisticsOrderUnitResp getLogisticsOrderUnitResp(KwtLogisticsOrderUnit u) {
|
|
|
+ LogisticsOrderUnitResp resp = new LogisticsOrderUnitResp();
|
|
|
+ resp.setId(u.getId());
|
|
|
+ resp.setLOrderId(u.getLOrderId());
|
|
|
+ resp.setUnitType(u.getUnitType());
|
|
|
+ resp.setTopEntId(u.getTopEntId());
|
|
|
+ resp.setEntId(u.getEntId());
|
|
|
+ resp.setFirmName(u.getFirmName());
|
|
|
+ resp.setContactsId(u.getContactsId());
|
|
|
+ resp.setContacts(u.getContacts());
|
|
|
+ resp.setPhone(u.getPhone());
|
|
|
+ resp.setRemark(u.getRemark());
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
}
|