@@ -1,8 +1,10 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.service.airDataType.IAirDataTypeService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.GetMapping; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
@@ -17,4 +19,13 @@ public class AirDataTypeController { | |||
@Autowired | |||
private IAirDataTypeService airDataTypeService; | |||
/** | |||
* 获取大气类型数据 | |||
* @return | |||
*/ | |||
@GetMapping("/list") | |||
public JsonResult getList(){ | |||
return airDataTypeService.getDataTypeList(); | |||
} | |||
} |
@@ -55,11 +55,6 @@ public class Report extends BaseEntity { | |||
*/ | |||
private Integer type; | |||
/** | |||
* 航道ID | |||
*/ | |||
private String channelId; | |||
/** | |||
* 航道名称 | |||
*/ |
@@ -53,26 +53,6 @@ public class InspectionReportVo { | |||
*/ | |||
private Integer type; | |||
/** | |||
* 航道ID | |||
*/ | |||
private String channelId; | |||
/** | |||
* 航道名称 | |||
*/ | |||
private String channelName; | |||
/** | |||
* 航段ID | |||
*/ | |||
private String legId; | |||
/** | |||
* 航段名称 | |||
*/ | |||
private String legName; | |||
/** | |||
* 巡检方式类型 1 无人机 2机场巡逻 3 飞手值飞 | |||
*/ |
@@ -1,11 +1,17 @@ | |||
package com.tuoheng.admin.service.airDataType; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.domain.AirDataType; | |||
import com.tuoheng.admin.enums.MarkEnum; | |||
import com.tuoheng.admin.mapper.AirDataTypeMapper; | |||
import com.tuoheng.common.core.common.BaseServiceImpl; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2023/5/23 | |||
@@ -13,4 +19,19 @@ import org.springframework.stereotype.Service; | |||
@Service | |||
@Slf4j | |||
public class AirDataTypeServiceImpl extends BaseServiceImpl<AirDataTypeMapper, AirDataType> implements IAirDataTypeService { | |||
@Autowired | |||
private AirDataTypeMapper airDataTypeMapper; | |||
/** | |||
* 查询大气数据类型列表 | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getDataTypeList() { | |||
List<AirDataType> airDataTypeList = airDataTypeMapper.selectList(new LambdaQueryWrapper<AirDataType>() | |||
.eq(AirDataType::getMark, MarkEnum.VALID.getCode())); | |||
return JsonResult.success(airDataTypeList); | |||
} | |||
} |
@@ -3,10 +3,16 @@ package com.tuoheng.admin.service.airDataType; | |||
import com.tuoheng.admin.entity.domain.AirDataType; | |||
import com.tuoheng.common.core.common.IBaseService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2023/5/23 | |||
*/ | |||
public interface IAirDataTypeService extends IBaseService<AirDataType> { | |||
/** | |||
* 获取大气类型列表 | |||
* @return | |||
*/ | |||
JsonResult getDataTypeList(); | |||
} |
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; | |||
import com.tuoheng.admin.constant.SystemConstant; | |||
import com.tuoheng.admin.entity.domain.Inspection; | |||
import com.tuoheng.admin.entity.vo.airport.AirPortLineLocationVo; | |||
import com.tuoheng.admin.entity.vo.airport.AirPortStatusVO; | |||
import com.tuoheng.common.core.config.common.CommonConfig; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
import com.tuoheng.common.core.utils.HttpUtils; | |||
@@ -40,8 +41,8 @@ public class QueryAirportLineByAirportService { | |||
log.info("根据任务ID获取航线:校验参数失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
List<AirPortLineLocationVo> airPortLineLocationVoList = this.getAirPortLocation(inspectionLine); | |||
return JsonResult.success(airPortLineLocationVoList); | |||
JsonResult jsonResult = this.getAirPortLocation(inspectionLine); | |||
return JsonResult.success(jsonResult); | |||
} | |||
private JsonResult checkParam(Integer inspectionLine) { | |||
@@ -52,25 +53,25 @@ public class QueryAirportLineByAirportService { | |||
return JsonResult.success(); | |||
} | |||
private List<AirPortLineLocationVo> getAirPortLocation(Integer inspectionLine) { | |||
private JsonResult getAirPortLocation(Integer inspectionLine) { | |||
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_LOCATION; | |||
String param = "id=" + inspectionLine; | |||
String airPortLineLocationStr = HttpUtils.sendGet(url, param); | |||
if (StringUtils.isEmpty(airPortLineLocationStr)) { | |||
log.info("调用机场平台,查询航线:机场接口返回数据为空"); | |||
return null; | |||
log.info("调用机场平台,查询航线:机场接口返回数据为空:airPortLineLocationStr={}",airPortLineLocationStr); | |||
return JsonResult.error("调用机场平台,查询航线数据为空"); | |||
} | |||
JsonResult jsonResult = JacksonUtil.json2pojo(airPortLineLocationStr, JsonResult.class); | |||
if (0 != jsonResult.getCode()) { | |||
log.info("调用机场平台,查询航线:机场接口返回状态失败"); | |||
return null; | |||
return JsonResult.error(jsonResult.getCode(),jsonResult.getMsg()); | |||
} | |||
if (ObjectUtil.isEmpty(jsonResult.getData())) { | |||
log.info("调用机场平台,查询航线:机场接口返回数据为空"); | |||
return null; | |||
return JsonResult.error("机场平台返回数据data为空"); | |||
} | |||
List<AirPortLineLocationVo> airPortLineLocationVoList = JSONObject.parseArray(JSONObject.toJSONString(jsonResult.getData()), AirPortLineLocationVo.class); | |||
return airPortLineLocationVoList; | |||
return JsonResult.success(airPortLineLocationVoList); | |||
} | |||
} |
@@ -33,6 +33,7 @@ public class GetAirLineListService { | |||
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_LINE_LIST; | |||
String param = "page=1&limit=100&droneId=" + droneId; | |||
String airPortStr = HttpUtils.sendGet(url, param); | |||
log.info("调用机场平台,获取航线列表:airPortStr={}",airPortStr); | |||
//string----->JsonResult | |||
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); | |||
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<sql id="Base_Column_list"> | |||
id, tenant_id, code, name, type, inspection_type, | |||
airport_id, airport_name, drone_id, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, | |||
airport_id, airport_name, drone_id, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, equipment_mount_type, equipment_mount_code | |||
equipment_mount_name, cloud_box_id, cloud_box_name, box_sn, flight_hand, flight_hand_name, inspection_time, | |||
execution_start_time, execution_end_time, is_live, is_taken, is_tilt, video_url, ai_video_url, report_url, srt_url, | |||
status, analyse_status, progressbar, note, weather, fly_height, srt_name, heartbeat_time, execution_status, | |||
@@ -116,10 +116,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<if test="code != null">code = #{code},</if> | |||
<if test="name != null">name = #{name},</if> | |||
<if test="type != null">type = #{type},</if> | |||
<if test="channelId != null and channelId != ''">channel_id = #{channelId},</if> | |||
<if test="channelName != null">channel_name = #{channelName},</if> | |||
<if test="legId != null and legId != ''">leg_id = #{legId},</if> | |||
<if test="legName != null">leg_name = #{legName},</if> | |||
<if test="inspectionType != null">inspection_type = #{inspectionType},</if> | |||
<if test="airportId != null">airport_id = #{airportId},</if> | |||
<if test="airportName != null">airport_name = #{airportName},</if> | |||
@@ -129,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<if test="equipmentId != null">equipment_id = #{equipmentId},</if> | |||
<if test="equipmentName != null">equipment_name = #{equipmentName},</if> | |||
<if test="equipmentMountId != null">equipment_mount_id = #{equipmentMountId},</if> | |||
<if test="equipmentMountType != null">equipment_mount_type = #{equipmentMountType},</if> | |||
<if test="equipmentMountCode != null">equipment_mount_code = #{equipmentMountCode},</if> | |||
<if test="equipmentMountName != null">equipment_mount_name = #{equipmentMountName},</if> | |||
<if test="cloudBoxId != null">cloud_box_id = #{cloudBoxId},</if> | |||
<if test="cloudBoxName != null">cloud_box_name = #{cloudBoxName},</if> |