|
@@ -27,6 +27,7 @@ import com.sckw.core.web.context.LoginEntHolder;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.request.HttpClientUtil;
|
|
import com.sckw.core.web.request.HttpClientUtil;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
|
|
+import com.sckw.core.web.response.BaseResult;
|
|
|
import com.sckw.core.web.response.result.PageDataResult;
|
|
import com.sckw.core.web.response.result.PageDataResult;
|
|
|
import com.sckw.excel.easyexcel.ExcelImportListener;
|
|
import com.sckw.excel.easyexcel.ExcelImportListener;
|
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
@@ -44,9 +45,13 @@ import com.sckw.system.api.model.dto.res.KwsEnterpriseResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import com.sckw.transport.api.dubbo.TransportRemoteService;
|
|
import com.sckw.transport.api.dubbo.TransportRemoteService;
|
|
|
|
|
+import com.sckw.transport.api.feign.VehicleTraceClient;
|
|
|
import com.sckw.transport.api.model.dto.RWaybillOrderDto;
|
|
import com.sckw.transport.api.model.dto.RWaybillOrderDto;
|
|
|
|
|
+import com.sckw.transport.api.model.dto.VehicleDataDTO;
|
|
|
|
|
+import com.sckw.transport.api.model.dto.VehicleReturnData;
|
|
|
import com.sckw.transport.api.model.vo.RTruckMonitorVo;
|
|
import com.sckw.transport.api.model.vo.RTruckMonitorVo;
|
|
|
import com.sckw.transport.api.model.vo.RWaybillOrderVo;
|
|
import com.sckw.transport.api.model.vo.RWaybillOrderVo;
|
|
|
|
|
+import com.sckw.transport.api.model.vo.VehicleTraceResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
@@ -95,6 +100,7 @@ public class KwfTruckService {
|
|
|
private final KwfTruckAxleNumRepository truckAxleNumRepository;
|
|
private final KwfTruckAxleNumRepository truckAxleNumRepository;
|
|
|
|
|
|
|
|
private final KwfFleetTruckRepository kwfFleetTruckRepository;
|
|
private final KwfFleetTruckRepository kwfFleetTruckRepository;
|
|
|
|
|
+ private final VehicleTraceClient vehicleTraceClient;
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
|
|
|
private RemoteSystemService remoteSystemService;
|
|
private RemoteSystemService remoteSystemService;
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
|
|
@@ -1620,37 +1626,41 @@ public class KwfTruckService {
|
|
|
private VehicleReturnData getVehicleReturnDataByOrderNo(String odrderNo) {
|
|
private VehicleReturnData getVehicleReturnDataByOrderNo(String odrderNo) {
|
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
|
vehicleDataDTO.setWOrderNo(odrderNo);
|
|
vehicleDataDTO.setWOrderNo(odrderNo);
|
|
|
- String res = null;
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
- res = HttpUtil.postJson(urlConfigProperties.getApiBaseUrl()+ UrlConstants.QUERY_REAL_TIME_TRACE_URL, JSON.toJSONString(vehicleDataDTO), null);
|
|
|
|
|
|
|
+ // 使用 Feign 调用查询实时位置
|
|
|
|
|
+ BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
+
|
|
|
|
|
+ if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
|
|
|
|
|
+ log.warn("查询实时轨迹返回空数据, 运单号: {}", odrderNo);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result.getData().getData();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("查询任务轨迹异常",e);
|
|
|
|
|
- return null;
|
|
|
|
|
- // throw new BusinessException("查询任务轨迹异常");
|
|
|
|
|
- }
|
|
|
|
|
- if (org.apache.commons.lang3.StringUtils.isBlank(res)){
|
|
|
|
|
|
|
+ log.error("查询任务轨迹异常, 运单号: {}", odrderNo, e);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- JSONObject jsonObject = JSON.parseObject(res);
|
|
|
|
|
- return JSON.parseObject(JSON.toJSONString(jsonObject.get("data")), VehicleReturnData.class);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public VehicleReturnData getVehicleReturnData(String truckId) {
|
|
public VehicleReturnData getVehicleReturnData(String truckId) {
|
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
|
vehicleDataDTO.setCarNo(truckId);
|
|
vehicleDataDTO.setCarNo(truckId);
|
|
|
- String res = null;
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
- res = HttpUtil.postJson(urlConfigProperties.getApiBaseUrl()+ UrlConstants.QUERY_REAL_TIME_TRACE_URL, JSON.toJSONString(vehicleDataDTO), null);
|
|
|
|
|
|
|
+ // 使用 Feign 调用查询实时位置
|
|
|
|
|
+ BaseResult<VehicleTraceResponse> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
+
|
|
|
|
|
+ if (result == null || result.getCode() != HttpStatus.SUCCESS_CODE || result.getData() == null) {
|
|
|
|
|
+ log.warn("查询实时轨迹返回空数据, 车牌号: {}", truckId);
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return result.getData().getData();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("查询任务轨迹异常",e);
|
|
|
|
|
- return null;
|
|
|
|
|
- // throw new BusinessException("查询任务轨迹异常");
|
|
|
|
|
- }
|
|
|
|
|
- if (org.apache.commons.lang3.StringUtils.isBlank(res)){
|
|
|
|
|
|
|
+ log.error("查询任务轨迹异常, 车牌号: {}", truckId, e);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- JSONObject jsonObject = JSON.parseObject(res);
|
|
|
|
|
- return JSON.parseObject(JSON.toJSONString(jsonObject.get("data")), VehicleReturnData.class);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public PageDataResult<AppTruckInfoVo> pageAppTruckInfo(TruckInfoReq req) {
|
|
public PageDataResult<AppTruckInfoVo> pageAppTruckInfo(TruckInfoReq req) {
|