*/ | */ | ||||
String PLATFORM_CODE = "gs"; | String PLATFORM_CODE = "gs"; | ||||
/** | |||||
* 机场平台:获取航点文件坐标 | |||||
*/ | |||||
String API_AIRPORT_LOCATION = "/airportInterface/getLocationById"; | |||||
/** | /** | ||||
* 高德url地址 | * 高德url地址 | ||||
*/ | */ |
package com.tuoheng.admin.controller; | |||||
import com.tuoheng.admin.service.airportline.IAirportLineService; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.PathVariable; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.web.bind.annotation.RestController; | |||||
/** | |||||
* 航线前端控制器 | |||||
* | |||||
* @Author ChengWang | |||||
* @Date 2023/3/2 | |||||
*/ | |||||
@RestController | |||||
@RequestMapping("/airportLine") | |||||
public class AirportLineController { | |||||
@Autowired | |||||
private IAirportLineService airportLineService; | |||||
/** | |||||
* 航线预览 | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@GetMapping("/{id}") | |||||
public JsonResult getInfoById(@PathVariable("id") Integer id) { | |||||
return airportLineService.getInfoById(id); | |||||
} | |||||
} |
package com.tuoheng.admin.entity; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.tuoheng.common.core.common.BaseEntity; | |||||
import lombok.Data; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
/** | |||||
* @Author ChengWang | |||||
* @Date 2023/3/2 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@Accessors(chain = true) | |||||
@TableName("th_airport_line") | |||||
public class AirportLine extends BaseEntity { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 租户id | |||||
*/ | |||||
private String tenantId; | |||||
/** | |||||
* 事故ID | |||||
*/ | |||||
private String accidentId; | |||||
/** | |||||
* 巡检任务ID | |||||
*/ | |||||
private String inspectionId; | |||||
/** | |||||
* 事故范围 | |||||
*/ | |||||
private String accidentRegion; | |||||
/** | |||||
* 航线 | |||||
*/ | |||||
private String coordinates; | |||||
/** | |||||
* 航线类型:1:点;2:线;3:面 | |||||
*/ | |||||
private Integer lineType; | |||||
/** | |||||
* oss文件地址 | |||||
*/ | |||||
private String ossUrl; | |||||
} |
package com.tuoheng.admin.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.tuoheng.admin.entity.AirportLine; | |||||
/** | |||||
* @Author ChengWang | |||||
* @Date 2023/3/2 | |||||
*/ | |||||
public interface AirportLineMapper extends BaseMapper<AirportLine> { | |||||
} |
package com.tuoheng.admin.service.airportline; | |||||
import com.tuoheng.admin.entity.AirportLine; | |||||
import com.tuoheng.admin.mapper.AirportLineMapper; | |||||
import com.tuoheng.admin.service.airportline.info.QueryAirportLineInfoService; | |||||
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; | |||||
/** | |||||
* @Author suqin | |||||
* @Date 2023/12/13 | |||||
*/ | |||||
@Service | |||||
@Slf4j | |||||
public class AirportLineServiceImpl extends BaseServiceImpl<AirportLineMapper, AirportLine> implements IAirportLineService { | |||||
@Autowired | |||||
private QueryAirportLineInfoService queryAirportLineInfoService; | |||||
/** | |||||
* 查询航线信息 | |||||
* | |||||
* @param id 航线Id | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public JsonResult getInfoById(Integer id) { | |||||
return queryAirportLineInfoService.getInfo(id); | |||||
} | |||||
} |
package com.tuoheng.admin.service.airportline; | |||||
import com.tuoheng.admin.entity.AirportLine; | |||||
import com.tuoheng.common.core.common.IBaseService; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
/** | |||||
* @Author ChengWang | |||||
* @Date 2022/11/17 | |||||
*/ | |||||
public interface IAirportLineService extends IBaseService<AirportLine> { | |||||
/** | |||||
* 查询航线信息 | |||||
* | |||||
* @param id 航线Id | |||||
* @return | |||||
*/ | |||||
JsonResult getInfoById(Integer id); | |||||
} |
package com.tuoheng.admin.service.airportline.info; | |||||
import cn.hutool.core.collection.CollectionUtil; | |||||
import cn.hutool.core.util.ObjectUtil; | |||||
import com.tuoheng.admin.service.third.airport.AirportService; | |||||
import com.tuoheng.admin.vo.AirportLineVo; | |||||
import com.tuoheng.common.core.exception.ServiceException; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.http.HttpStatus; | |||||
import org.springframework.stereotype.Service; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
@Slf4j | |||||
@Service | |||||
public class QueryAirportLineInfoService { | |||||
@Autowired | |||||
private AirportService airportService; | |||||
public JsonResult getInfo(Integer id) { | |||||
JsonResult result = this.check(id); | |||||
if (0 != result.getCode()) { | |||||
log.info("根据id查询航线信息:校验失败:{}", result.getMsg()); | |||||
return result; | |||||
} | |||||
List<Integer> airportLineIdList = new ArrayList<>(); | |||||
airportLineIdList.add(id); | |||||
List<AirportLineVo> airportLineVoList = airportService.getAirportLineListByAirportIdAndLineIdList(null, airportLineIdList); | |||||
if (CollectionUtil.isEmpty(airportLineVoList)) { | |||||
log.info("该航线不存在,id={}", id); | |||||
return JsonResult.success(); | |||||
} | |||||
AirportLineVo airportLineVo = airportLineVoList.get(0); | |||||
return JsonResult.success(airportLineVo); | |||||
} | |||||
/** | |||||
* 检查参数 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
private JsonResult check(Integer id) { | |||||
if (ObjectUtil.isEmpty(id)) { | |||||
log.info("参数ID为空"); | |||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "参数ID为空"); | |||||
} | |||||
return JsonResult.success(); | |||||
} | |||||
} |
JsonResult getListByTenantId(); | JsonResult getListByTenantId(); | ||||
} | |||||
} |
// 查询所有有效的部门数据 | // 查询所有有效的部门数据 | ||||
List<Dept> deptList = deptMapper.selectList(new LambdaQueryWrapper<Dept>() | List<Dept> deptList = deptMapper.selectList(new LambdaQueryWrapper<Dept>() | ||||
.eq(Dept::getTenantId, tenantId) | |||||
.eq(Dept::getMark, 1)); | |||||
.eq(Dept::getTenantId, tenantId) | |||||
.eq(Dept::getMark, 1)); | |||||
if (CollectionUtil.isEmpty(deptList)) { | if (CollectionUtil.isEmpty(deptList)) { | ||||
log.info("获取部门列表为空"); | log.info("获取部门列表为空"); | ||||
return JsonResult.success(deptTreeVoList); | return JsonResult.success(deptTreeVoList); | ||||
} | } | ||||
} | |||||
} |
@Autowired | @Autowired | ||||
@Qualifier("restTemplate") | @Qualifier("restTemplate") | ||||
private RestTemplate restTemplate; | private RestTemplate restTemplate; | ||||
public JsonResult getAirportList() { | public JsonResult getAirportList() { | ||||
//读取不同租户的机场平台url | //读取不同租户的机场平台url | ||||
Tenant tenant = tenantMapper.selectById(CurrentUserUtil.getTenantId()); | Tenant tenant = tenantMapper.selectById(CurrentUserUtil.getTenantId()); |
/** | /** | ||||
* 周期任务 | * 周期任务 | ||||
* | * | ||||
* @author wanjing | |||||
* @author suqin | |||||
* @team tuoheng | * @team tuoheng | ||||
* @date 2023-08-25 | * @date 2023-08-25 | ||||
*/ | */ | ||||
*/ | */ | ||||
private String name; | private String name; | ||||
/** | |||||
* 巡检公路id | |||||
*/ | |||||
private String roadId; | |||||
/** | |||||
* 巡检路段id | |||||
*/ | |||||
private String sectionId; | |||||
/** | /** | ||||
* 巡检机场id | * 巡检机场id | ||||
*/ | */ |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.tuoheng.admin.mapper.AirportLineMapper"> | |||||
</mapper> |
<result property="code" column="code" /> | <result property="code" column="code" /> | ||||
<result property="name" column="name" /> | <result property="name" column="name" /> | ||||
<result property="type" column="type" /> | <result property="type" column="type" /> | ||||
<result property="roadId" column="road_id" /> | |||||
<result property="sectionId" column="section_id" /> | |||||
<result property="airportId" column="airport_id" /> | <result property="airportId" column="airport_id" /> | ||||
<result property="droneId" column="drone_id" /> | <result property="droneId" column="drone_id" /> | ||||
<result property="airportLineId" column="airport_line_id" /> | <result property="airportLineId" column="airport_line_id" /> | ||||
</resultMap> | </resultMap> | ||||
<sql id="Base_Column_List"> | <sql id="Base_Column_List"> | ||||
t.id, t.tenant_id, t.dept_id, t.code, t.name, t.airport_id, t.airport_line_id, t.airport_line_length, t.drone_id, t.type, | |||||
t.id, t.tenant_id, t.dept_id, t.code, t.name, t.road_id, t.section_id, t.airport_id, t.airport_line_id, t.airport_line_length, t.drone_id, t.type, | |||||
t.single_time, t.everyday_time, t.cycle_time, t.cycle_next_time, t.cycle_frequency, t.cycle_start_time, t.cycle_end_time, | t.single_time, t.everyday_time, t.cycle_time, t.cycle_next_time, t.cycle_frequency, t.cycle_start_time, t.cycle_end_time, | ||||
t.is_enable, t.note, t.create_user, t.create_time, t.update_user, t.update_time, t.mark | t.is_enable, t.note, t.create_user, t.create_time, t.update_user, t.update_time, t.mark | ||||
</sql> | </sql> |