Bläddra i källkod

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_air_monitor into develop

tags/V1.0.1^2
chengwang 1 år sedan
förälder
incheckning
4658113389
2 ändrade filer med 34 tillägg och 22 borttagningar
  1. +34
    -19
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java
  2. +0
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airportline/add/AddAirportLineService.java

+ 34
- 19
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airData/syncdata/SyncAirDataService.java Visa fil

@@ -4,7 +4,9 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.domain.AirData;
import com.tuoheng.admin.entity.domain.Inspection;
import com.tuoheng.admin.entity.request.inspection.AirportLineRequest;
import com.tuoheng.admin.entity.third.LingXiuDataResponse;
import com.tuoheng.admin.enums.AirportLineEnum;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.AirDataMapper;
@@ -34,26 +36,17 @@ public class SyncAirDataService {

public JsonResult sync(LingXiuDataResponse response) {
log.info("收到灵嗅设备推送数据");
// if (ObjectUtil.isEmpty(response)) {
// log.info("灵嗅设备推送数据为空");
// return JsonResult.error("灵嗅设备推送数据为空");
// }
// if (StringUtils.isEmpty(response.getSerial())) {
// log.info("灵嗅设备推送数据,serial为空");
// return JsonResult.error("灵嗅设备推送数据,serial为空");
// }
// Inspection inspection = this.getInspection(response.getSerial());
// if (ObjectUtil.isNull(inspection)) {
// log.info("该灵嗅设备没有正在飞行的任务,serial={}", response.getSerial());
// return JsonResult.error("该灵嗅设备没有正在飞行的任务");
// }
//校验参数值
JsonResult jsonResult = this.check(response);
if(jsonResult.getCode() != 0){
log.info("校验失败:{}",jsonResult.getMsg());
return jsonResult;
}
Inspection inspection = (Inspection) jsonResult.getData();

AirData airData = new AirData();

// if (ObjectUtil.isNotEmpty(inspection)) {
// airData.setInspectionId(inspection.getId()); // 任务ID
// airData.setTenantId(inspection.getTenantId()); // 租户ID
// }
airData.setInspectionId(inspection.getId()); // 任务ID
airData.setTenantId(inspection.getTenantId()); // 租户ID
airData.setSateNum(response.getSateNum()); // 卫星编号
airData.setSequence(response.getSequence()); // 序号
airData.setSerial(response.getSerial()); // 序列号
@@ -120,7 +113,29 @@ public class SyncAirDataService {

Integer count = airDataMapper.insert(airData);
if (count <= 0) {
log.info("灵嗅设备推送数据插入失败");
log.info("拉取灵嗅设备推送数据,插入失败");
}
return JsonResult.success();
}

/**
*
* @param response
* @return
*/
private JsonResult check(LingXiuDataResponse response) {
if (ObjectUtil.isEmpty(response)) {
log.info("灵嗅设备推送数据为空");
return JsonResult.error("灵嗅设备推送数据为空");
}
if (StringUtils.isEmpty(response.getSerial())) {
log.info("灵嗅设备推送数据,serial为空");
return JsonResult.error("灵嗅设备推送数据,serial为空");
}
Inspection inspection = this.getInspection(response.getSerial());
if (ObjectUtil.isNull(inspection)) {
log.info("没有正在飞行的任务,serial={}", response.getSerial());
return JsonResult.error("没有正在飞行的任务");
}
return JsonResult.success();
}

+ 0
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/airportline/add/AddAirportLineService.java Visa fil

@@ -127,9 +127,6 @@ public class AddAirportLineService {
return JsonResult.success(airportLine);
}




private JsonResult check(String id, String tenantId, AirportLineRequest request) {
if(StringUtils.isEmpty(tenantId)){
return JsonResult.error(AirportLineEnum.TENANT_ID_IS_NULL.getCode(),AirportLineEnum.TENANT_ID_IS_NULL.getMsg());

Laddar…
Avbryt
Spara