|
@@ -18,6 +18,7 @@ import com.sckw.core.utils.DateUtils;
|
|
|
import com.sckw.core.utils.HttpUtil;
|
|
import com.sckw.core.utils.HttpUtil;
|
|
|
import com.sckw.core.web.constant.CommonConstants;
|
|
import com.sckw.core.web.constant.CommonConstants;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
|
|
+import com.sckw.core.web.response.BaseIotResult;
|
|
|
import com.sckw.core.web.response.result.PageDataResult;
|
|
import com.sckw.core.web.response.result.PageDataResult;
|
|
|
import com.sckw.core.web.response.BaseResult;
|
|
import com.sckw.core.web.response.BaseResult;
|
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
@@ -544,9 +545,9 @@ public class kwfTruckTraceService {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
// 使用 Feign 调用查询实时位置
|
|
// 使用 Feign 调用查询实时位置
|
|
|
- BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
|
|
+ BaseIotResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
|
|
|
- if (result == null || result.getCode() != 0 || result.getData() == null) {
|
|
|
|
|
|
|
+ if (result == null || result.getCode() != "0" || result.getData() == null) {
|
|
|
log.warn("查询实时轨迹返回空数据, 车牌号: {}", truckId);
|
|
log.warn("查询实时轨迹返回空数据, 车牌号: {}", truckId);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -619,9 +620,9 @@ public class kwfTruckTraceService {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
// 使用 Feign 调用上报车辆轨迹
|
|
// 使用 Feign 调用上报车辆轨迹
|
|
|
- BaseResult<Void> result = vehicleTraceClient.saveVehicleData(req);
|
|
|
|
|
|
|
+ BaseIotResult<Void> result = vehicleTraceClient.saveVehicleData(req);
|
|
|
|
|
|
|
|
- if (result == null || result.getCode() != 0) {
|
|
|
|
|
|
|
+ if (result == null || result.getCode() != "0") {
|
|
|
log.error("app上报车辆轨迹失败, 响应: {}", result);
|
|
log.error("app上报车辆轨迹失败, 响应: {}", result);
|
|
|
throw new BusinessException("app上报车辆轨迹异常");
|
|
throw new BusinessException("app上报车辆轨迹异常");
|
|
|
}
|
|
}
|
|
@@ -720,9 +721,9 @@ public class kwfTruckTraceService {
|
|
|
try {
|
|
try {
|
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
|
vehicleDataDTO.setCarNo(truckNo);
|
|
vehicleDataDTO.setCarNo(truckNo);
|
|
|
- BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
|
|
+ BaseIotResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
|
|
|
- if (result == null || result.getCode() != 0 || result.getData() == null) {
|
|
|
|
|
|
|
+ if (result == null || !Objects.equals(result.getCode(), "0") || result.getData() == null) {
|
|
|
// 无定位数据,设置为离线
|
|
// 无定位数据,设置为离线
|
|
|
truckLocationStatusMap.put(truckNo, 0);
|
|
truckLocationStatusMap.put(truckNo, 0);
|
|
|
return truckLocationStatusMap;
|
|
return truckLocationStatusMap;
|
|
@@ -1034,11 +1035,11 @@ public class kwfTruckTraceService {
|
|
|
try {
|
|
try {
|
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
VehicleDataDTO vehicleDataDTO = new VehicleDataDTO();
|
|
|
vehicleDataDTO.setCarNo(truckNo);
|
|
vehicleDataDTO.setCarNo(truckNo);
|
|
|
- BaseResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ BaseIotResult<VehicleReturnData> result = vehicleTraceClient.queryRealTimeLocation(vehicleDataDTO);
|
|
|
|
|
+ log.info("查询车辆数据中台响应定位信息:{}", JSON.toJSONString( result));
|
|
|
VehicleLocationInfo locationInfo = new VehicleLocationInfo();
|
|
VehicleLocationInfo locationInfo = new VehicleLocationInfo();
|
|
|
|
|
|
|
|
- if (result != null && result.getCode() == 0 && result.getData() != null) {
|
|
|
|
|
|
|
+ if (result != null && StringUtils.equals(result.getCode(), "0") && result.getData() != null) {
|
|
|
VehicleReturnData vehicleData = result.getData();
|
|
VehicleReturnData vehicleData = result.getData();
|
|
|
|
|
|
|
|
// 判断定位状态
|
|
// 判断定位状态
|
|
@@ -1091,10 +1092,10 @@ public class kwfTruckTraceService {
|
|
|
vehicleDataDTO.setWOrderNo(wOrderNo);
|
|
vehicleDataDTO.setWOrderNo(wOrderNo);
|
|
|
|
|
|
|
|
// 调用Feign接口查询轨迹列表
|
|
// 调用Feign接口查询轨迹列表
|
|
|
- BaseResult<List<com.sckw.transport.api.model.dto.VehicleReturnData>> result =
|
|
|
|
|
|
|
+ BaseIotResult<List<VehicleReturnData>> result =
|
|
|
vehicleTraceClient.queryVehicleDataList(vehicleDataDTO);
|
|
vehicleTraceClient.queryVehicleDataList(vehicleDataDTO);
|
|
|
-
|
|
|
|
|
- if (result != null && result.getCode() == 0 && result.getData() != null) {
|
|
|
|
|
|
|
+ log.info("查询车辆数据中台响应轨迹数据:{}", JSON.toJSONString( result));
|
|
|
|
|
+ if (result != null && StringUtils.equals(result.getCode(), "0") && result.getData() != null) {
|
|
|
List<com.sckw.transport.api.model.dto.VehicleReturnData> traceDataList = result.getData();
|
|
List<com.sckw.transport.api.model.dto.VehicleReturnData> traceDataList = result.getData();
|
|
|
|
|
|
|
|
// 统计alarmCode不为null且不为0的记录数量(表示有异常报警)
|
|
// 统计alarmCode不为null且不为0的记录数量(表示有异常报警)
|
|
@@ -1273,8 +1274,8 @@ public class kwfTruckTraceService {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
// 调用数据中台保存轨迹数据
|
|
// 调用数据中台保存轨迹数据
|
|
|
- BaseResult<Void> result = vehicleTraceClient.saveVehicleData(vehiclesTrajectoryReq);
|
|
|
|
|
- if (result.getCode() != 0) {
|
|
|
|
|
|
|
+ BaseIotResult<Void> result = vehicleTraceClient.saveVehicleData(vehiclesTrajectoryReq);
|
|
|
|
|
+ if (!Objects.equals(result.getCode(), "0")) {
|
|
|
log.error("保存车辆轨迹数据失败:{}", result.getMessage());
|
|
log.error("保存车辆轨迹数据失败:{}", result.getMessage());
|
|
|
throw new BusinessException("生成轨迹失败:" + result.getMessage());
|
|
throw new BusinessException("生成轨迹失败:" + result.getMessage());
|
|
|
}
|
|
}
|