package com.tuoheng.admin.controller; | |||||
import com.alibaba.fastjson.JSON; | |||||
import com.tuoheng.admin.request.dept.AddDeptRequest; | |||||
import com.tuoheng.admin.request.dept.EditDeptRequest; | |||||
import com.tuoheng.admin.request.dept.QueryDeptChildPageListRequest; | |||||
import com.tuoheng.admin.service.airport.AirportService; | |||||
import com.tuoheng.admin.service.dept.IDeptService; | |||||
import com.tuoheng.admin.vo.AirLineVO; | |||||
import com.tuoheng.admin.vo.AirPortVO; | |||||
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.*; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
/** | |||||
* 机场前端控制器 | |||||
* | |||||
* @author wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-23 | |||||
*/ | |||||
@Slf4j | |||||
@RestController | |||||
@RequestMapping("/airport") | |||||
public class AirportController { | |||||
@Autowired | |||||
AirportService airportService; | |||||
/** | |||||
* 获取巡检机场 | |||||
*/ | |||||
@GetMapping("/airport") | |||||
public JsonResult getAirportList() { | |||||
return airportService.getAirportList(); | |||||
} | |||||
/** | |||||
* 获取巡检线路 | |||||
* @param droneId 机场列表里面的droneId | |||||
* @return | |||||
*/ | |||||
@GetMapping("/airport/line/{droneId}") | |||||
public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) { | |||||
return airportService.getAirLineList(droneId); | |||||
} | |||||
} |
package com.tuoheng.admin.controller; | package com.tuoheng.admin.controller; | ||||
import com.tuoheng.admin.entity.Inspection; | import com.tuoheng.admin.entity.Inspection; | ||||
import com.tuoheng.admin.request.QueryInspectionRequest; | |||||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||||
import com.tuoheng.admin.service.inspection.IInspectionService; | import com.tuoheng.admin.service.inspection.IInspectionService; | ||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
* @team tuoheng | * @team tuoheng | ||||
* @date 2022-11-16 | * @date 2022-11-16 | ||||
*/ | */ | ||||
@Slf4j | |||||
@RestController | @RestController | ||||
@RequestMapping("/inspection") | @RequestMapping("/inspection") | ||||
public class InspectionController { | public class InspectionController { | ||||
private IInspectionService iInspectionService; | private IInspectionService iInspectionService; | ||||
/** | /** | ||||
* 查询巡检任务列表 | |||||
* 查询巡检任务分页列表 | |||||
*/ | */ | ||||
@GetMapping("/list") | |||||
public JsonResult list(QueryInspectionRequest request) { | |||||
return iInspectionService.selectList(request); | |||||
@GetMapping("/page/list") | |||||
public JsonResult list(QueryInspectionPageListRequest request) { | |||||
log.info("进入查询巡检任务分页列表"); | |||||
return iInspectionService.selectPageList(request); | |||||
} | } | ||||
/** | /** | ||||
* 获取巡检任务详细信息 | * 获取巡检任务详细信息 | ||||
*/ | */ | ||||
@GetMapping(value = "/{id}") | @GetMapping(value = "/{id}") | ||||
public JsonResult getInfo(QueryInspectionRequest request) { | |||||
public JsonResult getInfo(QueryInspectionPageListRequest request) { | |||||
return iInspectionService.selectOneById(request); | return iInspectionService.selectOneById(request); | ||||
} | } | ||||
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; | |||||
import java.io.Serializable; | |||||
/** | |||||
* <p> | |||||
* 企业管理表 | |||||
* </p> | |||||
* | |||||
* @author 拓恒 | |||||
* @since 2022-07-15 | |||||
*/ | |||||
@Data | |||||
@EqualsAndHashCode(callSuper = true) | |||||
@Accessors(chain = true) | |||||
@TableName("th_tenant") | |||||
public class Tenant extends BaseEntity implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 租户名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 租户编号 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 租户账号 | |||||
*/ | |||||
private String username; | |||||
/** | |||||
* 租户LOGO | |||||
*/ | |||||
private String logo; | |||||
/** | |||||
* 上级ID | |||||
*/ | |||||
private Integer pid; | |||||
/** | |||||
* 租户类型:1政府 2企业 3组织 | |||||
*/ | |||||
private Integer type; | |||||
/** | |||||
* 租户电话 | |||||
*/ | |||||
private String phone; | |||||
/** | |||||
* 租户邮箱 | |||||
*/ | |||||
private String email; | |||||
/** | |||||
* 省份编号 | |||||
*/ | |||||
private String provinceCode; | |||||
/** | |||||
* 省份名称 | |||||
*/ | |||||
private String provinceName; | |||||
/** | |||||
* 市区编号 | |||||
*/ | |||||
private String cityCode; | |||||
/** | |||||
* 市区名称 | |||||
*/ | |||||
private String cityName; | |||||
/** | |||||
* 区县编号 | |||||
*/ | |||||
private String districtCode; | |||||
/** | |||||
* 区县名称 | |||||
*/ | |||||
private String districtName; | |||||
/** | |||||
* 平台名称 | |||||
*/ | |||||
private String platformName; | |||||
/** | |||||
* 机场平台url | |||||
*/ | |||||
private String airportUrl; | |||||
/** | |||||
* 详细地址 | |||||
*/ | |||||
private String address; | |||||
/** | |||||
* 租户简介 | |||||
*/ | |||||
private String intro; | |||||
/** | |||||
* 状态:1正常 2禁用 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 备注 | |||||
*/ | |||||
private String note; | |||||
/** | |||||
* 排序号 | |||||
*/ | |||||
private Integer sort; | |||||
/** | |||||
* 租户头像url | |||||
*/ | |||||
private String portraitUrl; | |||||
} |
package com.tuoheng.admin.enums; | package com.tuoheng.admin.enums; | ||||
public enum CodeEnum { | |||||
public enum AriportCodeEnum { | |||||
// 部门列表为空 | |||||
SUCCESS(0, "操作成功"); | |||||
GET_NO_TENANT(1000, "获取租户信息失败!"), | |||||
BAD_REQUEST(1000, "获取机场信息失败,请重试!"); | |||||
/** | /** | ||||
* 错误码 | * 错误码 | ||||
*/ | */ | ||||
private String msg; | private String msg; | ||||
CodeEnum(Integer code, String msg){ | |||||
AriportCodeEnum(Integer code, String msg){ | |||||
this.code = code; | this.code = code; | ||||
this.msg = msg; | this.msg = msg; | ||||
} | } |
*/ | */ | ||||
public interface DeptMapper extends BaseMapper<Dept> { | public interface DeptMapper extends BaseMapper<Dept> { | ||||
/** | |||||
* 通过部门id,查找该部门下子孙部门id | |||||
* | |||||
* @param id 部门 | |||||
* @return 结果 | |||||
*/ | |||||
List<String> selectAllChildListById(String id); | List<String> selectAllChildListById(String id); | ||||
/** | /** |
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.tuoheng.admin.entity.Inspection; | import com.tuoheng.admin.entity.Inspection; | ||||
import com.tuoheng.admin.request.QueryInspectionRequest; | |||||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||||
import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
/** | /** | ||||
* @param request 巡检任务查询实体 | * @param request 巡检任务查询实体 | ||||
* @return 巡检任务 | * @return 巡检任务 | ||||
*/ | */ | ||||
Inspection selectOneById(QueryInspectionRequest request); | |||||
Inspection selectOneById(QueryInspectionPageListRequest request); | |||||
/** | |||||
* 查询巡检任务分页列表 | |||||
* | |||||
* @param request 巡检任务查询实体 | |||||
* @return 巡检任务集合 | |||||
*/ | |||||
Page<Inspection> selectPageList(@Param("page") Page<Inspection> page, @Param("request") QueryInspectionPageListRequest request); | |||||
/** | /** | ||||
* 查询巡检任务列表 | * 查询巡检任务列表 | ||||
* | * | ||||
* @param page 分页信息 | |||||
* @param request 巡检任务查询实体 | * @param request 巡检任务查询实体 | ||||
* @return 巡检任务集合 | * @return 巡检任务集合 | ||||
*/ | */ | ||||
List<Inspection> selectList(@Param("page") Page<Inspection> page, @Param("request") QueryInspectionRequest request); | |||||
List<Inspection> selectList(QueryInspectionPageListRequest request); | |||||
/** | /** | ||||
* 新增巡检任务 | * 新增巡检任务 |
package com.tuoheng.admin.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.tuoheng.admin.entity.Tenant; | |||||
/** | |||||
* <p> | |||||
* 企业管理表 Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author 拓恒 | |||||
* @since 2022-11-23 | |||||
*/ | |||||
public interface TenantMapper extends BaseMapper<Tenant> { | |||||
} |
package com.tuoheng.admin.request; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import com.tuoheng.common.core.common.BaseQuery; | |||||
import lombok.Data; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import java.util.Date; | |||||
/** | |||||
* 查询巡检任务请求实体 | |||||
* | |||||
* @author wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-17 | |||||
*/ | |||||
@Data | |||||
public class QueryInspectionRequest extends BaseQuery { | |||||
private Integer id; | |||||
/** | |||||
* 任务名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 任务状态 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 任务编号 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 河流 | |||||
*/ | |||||
private Integer streamId; | |||||
/** | |||||
* 巡检时间 | |||||
*/ | |||||
@DateTimeFormat(pattern = "yyyy-MM-dd") | |||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | |||||
private Date inspectionTime; | |||||
/** | |||||
* 用户ID | |||||
*/ | |||||
private Integer userId; | |||||
/** | |||||
* 为1时,查询信息录入列表数据 | |||||
*/ | |||||
private Integer inputFlag; | |||||
/** | |||||
* 算法处理状态:1待处理 2处理中 3已处理 | |||||
*/ | |||||
private Integer analyseStatus; | |||||
/** | |||||
* 租户id | |||||
*/ | |||||
private Integer tenantId; | |||||
} |
package com.tuoheng.admin.request.inspection; | |||||
import com.tuoheng.common.core.common.BaseQuery; | |||||
import lombok.Data; | |||||
/** | |||||
* 查询巡检任务请求实体 | |||||
* | |||||
* @author wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-17 | |||||
*/ | |||||
@Data | |||||
public class QueryInspectionPageListRequest extends BaseQuery { | |||||
/** | |||||
* 用户ID | |||||
*/ | |||||
private Integer userId; | |||||
/** | |||||
* 租户id | |||||
*/ | |||||
private Integer tenantId; | |||||
/** | |||||
* 任务编号 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 任务名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 巡检机场id | |||||
*/ | |||||
private Integer airportId; | |||||
/** | |||||
* 巡检线路Id | |||||
*/ | |||||
private Integer inspectionLine; | |||||
/** | |||||
* 巡检任务类型: 1 临时巡检(目前只有该一种类型) | |||||
*/ | |||||
private Integer type; | |||||
/** | |||||
* 任务状态 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 巡检方式类型: 1 无人机 2机场 | |||||
*/ | |||||
private Integer inspectionType; | |||||
/** | |||||
* 部门Id | |||||
*/ | |||||
private Integer deptId; | |||||
} |
package com.tuoheng.admin.service.airport; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
public interface AirportService { | |||||
JsonResult getAirportList(); | |||||
JsonResult getAirLineList(Integer droneId); | |||||
} |
package com.tuoheng.admin.service.airport; | |||||
import cn.hutool.core.util.ObjectUtil; | |||||
import com.tuoheng.admin.entity.Tenant; | |||||
import com.tuoheng.admin.enums.AriportCodeEnum; | |||||
import com.tuoheng.admin.mapper.TenantMapper; | |||||
import com.tuoheng.admin.utils.ShiroUtils; | |||||
import com.tuoheng.admin.vo.AirLineVO; | |||||
import com.tuoheng.common.core.utils.HttpUtils; | |||||
import com.tuoheng.common.core.utils.JacksonUtil; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
import com.tuoheng.common.core.utils.StringUtils; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import java.util.Objects; | |||||
@Service | |||||
public class AirportServiceImpl implements AirportService { | |||||
@Autowired | |||||
private TenantMapper tenantMapper; | |||||
@Override | |||||
public JsonResult getAirportList() { | |||||
//读取不同租户的机场平台url | |||||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||||
if (ObjectUtil.isEmpty(tenant)) { | |||||
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); | |||||
} | |||||
if (StringUtils.isEmpty(tenant.getAirportUrl())) { | |||||
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); | |||||
} | |||||
String url = tenant.getAirportUrl() + "/api/airportInterface/airportList"; | |||||
String param = "page=1&limit=10"; | |||||
String airPortStr = HttpUtils.sendGet(url, param); | |||||
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); | |||||
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0)) { | |||||
return JsonResult.error(AriportCodeEnum.BAD_REQUEST.getCode(), AriportCodeEnum.BAD_REQUEST.getMsg()); | |||||
} | |||||
return jsonResult; | |||||
} | |||||
@Override | |||||
public JsonResult getAirLineList(Integer droneId) { | |||||
//读取不同租户的机场平台url | |||||
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); | |||||
if (ObjectUtil.isEmpty(tenant)) { | |||||
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); | |||||
} | |||||
if (StringUtils.isEmpty(tenant.getAirportUrl())) { | |||||
return JsonResult.error(AriportCodeEnum.GET_NO_TENANT.getCode(), AriportCodeEnum.GET_NO_TENANT.getMsg()); | |||||
} | |||||
String url = tenant.getAirportUrl() + "/api/airportInterface/taskByDroneId"; | |||||
String param = "page=1&limit=100&droneId=" + droneId; | |||||
String airPortStr = HttpUtils.sendGet(url, param); | |||||
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); | |||||
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) { | |||||
return JsonResult.error(AriportCodeEnum.BAD_REQUEST.getCode(), AriportCodeEnum.BAD_REQUEST.getMsg()); | |||||
} | |||||
return jsonResult; | |||||
} | |||||
} |
deptTreeVoList.add(deptTreeVo); | deptTreeVoList.add(deptTreeVo); | ||||
} else { | } else { | ||||
DeptTreeVo parent = deptVoMap.get(child.getPid()); | DeptTreeVo parent = deptVoMap.get(child.getPid()); | ||||
deptTreeVo.setPName(parent.getName()); | |||||
deptTreeVo.setPname(parent.getName()); | |||||
parent.getChildren().add(child); | parent.getChildren().add(child); | ||||
} | } | ||||
} | } |
package com.tuoheng.admin.service.inspection; | package com.tuoheng.admin.service.inspection; | ||||
import java.util.List; | |||||
import com.tuoheng.admin.entity.Inspection; | import com.tuoheng.admin.entity.Inspection; | ||||
import com.tuoheng.admin.request.QueryInspectionRequest; | |||||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
/** | /** | ||||
* @date 2022-11-16 | * @date 2022-11-16 | ||||
*/ | */ | ||||
public interface IInspectionService { | public interface IInspectionService { | ||||
/** | |||||
* 查询巡检任务列表(分页) | |||||
* | |||||
* @param queryInspectionRequest 巡检任务查询实体 | |||||
* @return 巡检任务集合 | |||||
*/ | |||||
JsonResult selectPageList(QueryInspectionPageListRequest queryInspectionRequest); | |||||
/** | /** | ||||
* 查询巡检任务 | * 查询巡检任务 | ||||
* | * | ||||
* @param queryInspectionRequest 巡检任务查询实体 | * @param queryInspectionRequest 巡检任务查询实体 | ||||
* @return 巡检任务 | * @return 巡检任务 | ||||
*/ | */ | ||||
JsonResult selectOneById(QueryInspectionRequest queryInspectionRequest); | |||||
JsonResult selectOneById(QueryInspectionPageListRequest queryInspectionRequest); | |||||
/** | /** | ||||
* 查询巡检任务列表 | * 查询巡检任务列表 | ||||
* @param queryInspectionRequest 巡检任务查询实体 | * @param queryInspectionRequest 巡检任务查询实体 | ||||
* @return 巡检任务集合 | * @return 巡检任务集合 | ||||
*/ | */ | ||||
JsonResult selectList(QueryInspectionRequest queryInspectionRequest); | |||||
JsonResult selectList(QueryInspectionPageListRequest queryInspectionRequest); | |||||
/** | /** | ||||
* 新增巡检任务 | * 新增巡检任务 |
package com.tuoheng.admin.service.inspection; | package com.tuoheng.admin.service.inspection; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.tuoheng.admin.entity.Inspection; | import com.tuoheng.admin.entity.Inspection; | ||||
import com.tuoheng.admin.mapper.InspectionMapper; | import com.tuoheng.admin.mapper.InspectionMapper; | ||||
import com.tuoheng.admin.request.QueryInspectionRequest; | |||||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||||
import com.tuoheng.admin.service.inspection.query.QueryInspectionPageListService; | |||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.List; | |||||
/** | /** | ||||
* 巡检任务Service业务层处理 | * 巡检任务Service业务层处理 | ||||
* | * | ||||
@Autowired | @Autowired | ||||
private InspectionMapper inspectionMapper; | private InspectionMapper inspectionMapper; | ||||
@Autowired | |||||
QueryInspectionPageListService queryInspectionPageListService; | |||||
/** | |||||
* 查询巡检任务分页列表 | |||||
* | |||||
* @param queryInspectionRequest 巡检任务查询实体 | |||||
* @return | |||||
*/ | |||||
@Override | |||||
public JsonResult selectPageList(QueryInspectionPageListRequest queryInspectionRequest) { | |||||
return queryInspectionPageListService.getPageList(queryInspectionRequest); | |||||
} | |||||
/** | /** | ||||
* 查询巡检任务 | * 查询巡检任务 | ||||
* | * | ||||
* @return 巡检任务 | * @return 巡检任务 | ||||
*/ | */ | ||||
@Override | @Override | ||||
public JsonResult selectOneById(QueryInspectionRequest request) { | |||||
public JsonResult selectOneById(QueryInspectionPageListRequest request) { | |||||
// request.setTenantId(ShiroUtils.getTenantId()); | // request.setTenantId(ShiroUtils.getTenantId()); | ||||
Inspection inspection = inspectionMapper.selectOneById(request); | Inspection inspection = inspectionMapper.selectOneById(request); | ||||
* @return 巡检任务 | * @return 巡检任务 | ||||
*/ | */ | ||||
@Override | @Override | ||||
public JsonResult selectList(QueryInspectionRequest request) { | |||||
public JsonResult selectList(QueryInspectionPageListRequest request) { | |||||
log.info("进入查询巡检任务列表业务"); | log.info("进入查询巡检任务列表业务"); | ||||
// Page<Inspection> page = new Page<>(request.getPage(), request.getLimit()); | // Page<Inspection> page = new Page<>(request.getPage(), request.getLimit()); | ||||
// request.setUserId(ShiroUtils.getUserId()); | // request.setUserId(ShiroUtils.getUserId()); |
package com.tuoheng.admin.service.inspection.query; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import com.tuoheng.admin.entity.Inspection; | |||||
import com.tuoheng.admin.mapper.InspectionMapper; | |||||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||||
import com.tuoheng.admin.utils.ShiroUtils; | |||||
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 wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-22 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
public class QueryInspectionPageListService { | |||||
@Autowired | |||||
private InspectionMapper inspectionMapper; | |||||
public JsonResult getPageList(QueryInspectionPageListRequest queryInspectionRequest) { | |||||
log.info("进入查询巡检任务分页列表业务"); | |||||
String tenantId = ShiroUtils.getTenantId(); | |||||
JsonResult result = this.check(tenantId, queryInspectionRequest); | |||||
if (0 != result.getCode()) { | |||||
log.info("进入查询巡检任务分页列表业务:校验失败:{}", result.getMsg()); | |||||
return result; | |||||
} | |||||
Page<Inspection> page = new Page(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||||
Page<Inspection> pageList = inspectionMapper.selectPageList(page, queryInspectionRequest); | |||||
// 查询所有有效的子部门数据 | |||||
// IPage<Inspection> page = new Page<>(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||||
// IPage<Inspection> pageData = inspectionMapper.selectList(page, queryInspectionRequest); | |||||
// List<Inspection> inspectionList = pageData.getRecords(); | |||||
// List<Inspection> list = new ArrayList<>(); | |||||
// for (Inspection inspection : inspectionList) { | |||||
// list.add(inspection); | |||||
// } | |||||
// pageData.setRecords(list); | |||||
// | |||||
// if (CollectionUtil.isEmpty(inspectionList)) { | |||||
// log.info("获取子部门列表为空"); | |||||
// return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_LIST_IS_NULL.getCode(), QueryDeptChildListCodeEnum.DEPT_LIST_IS_NULL.getMsg()); | |||||
// } | |||||
return JsonResult.success(); | |||||
} | |||||
/** | |||||
* 检查参数 | |||||
* @param tenantId | |||||
* @param queryInspectionRequest | |||||
* @return | |||||
*/ | |||||
private JsonResult check(String tenantId, QueryInspectionPageListRequest queryInspectionRequest) { | |||||
// 判断id是否为空 | |||||
// if (StringUtils.isEmpty(id)) { | |||||
// return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getCode(), QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getMsg()); | |||||
// } | |||||
return JsonResult.success(); | |||||
} | |||||
} |
package com.tuoheng.admin.vo; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | |||||
/** | |||||
* 机场线路视图Vo | |||||
* | |||||
* @author wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-23 | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
public class AirLineVO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 任务id | |||||
*/ | |||||
private Integer id; | |||||
/** | |||||
* 任务编号 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 任务名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 无人机id | |||||
*/ | |||||
private Integer droneId; | |||||
/** | |||||
* 无人机名称 | |||||
*/ | |||||
private String droneName; | |||||
/** | |||||
* 无人机直播播流地址 | |||||
*/ | |||||
private String liveUrl; | |||||
/** | |||||
* 航线id | |||||
*/ | |||||
private Integer airlineFileId; | |||||
/** | |||||
* 航线名称 | |||||
*/ | |||||
private String airlineFileName; | |||||
/** | |||||
* 航线文件地址路径 | |||||
*/ | |||||
private String airlineFileUrl; | |||||
/** | |||||
* 执行类型,1单次2每天 | |||||
*/ | |||||
private Integer type; | |||||
/** | |||||
* 单次执行时间 | |||||
*/ | |||||
private String singleTime; | |||||
/** | |||||
* 每天执行时间 | |||||
*/ | |||||
private Object everydayTime; | |||||
/** | |||||
* 任务备注 | |||||
*/ | |||||
private Object note; | |||||
/** | |||||
* 任务状态1待执行 2执行中 | |||||
*/ | |||||
private Integer status; | |||||
/** | |||||
* 创建人 | |||||
*/ | |||||
private Integer createUser; | |||||
/** | |||||
* 创建时间 | |||||
*/ | |||||
private String createTime; | |||||
/** | |||||
* 修改用户 | |||||
*/ | |||||
private Integer updateUser; | |||||
/** | |||||
* 修改时间 | |||||
*/ | |||||
private String updateTime; | |||||
} |
package com.tuoheng.admin.vo; | |||||
import lombok.Data; | |||||
import lombok.NoArgsConstructor; | |||||
import java.io.Serializable; | |||||
/** | |||||
* 机场视图Vo | |||||
* | |||||
* @author wanjing | |||||
* @team tuoheng | |||||
* @date 2022-11-23 | |||||
*/ | |||||
@Data | |||||
@NoArgsConstructor | |||||
public class AirPortVO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/** | |||||
* 机场id | |||||
*/ | |||||
private Integer id; | |||||
/** | |||||
* 机场代码 | |||||
*/ | |||||
private String code; | |||||
/** | |||||
* 机场名称 | |||||
*/ | |||||
private String name; | |||||
/** | |||||
* 机场图片 | |||||
*/ | |||||
private String image; | |||||
/** | |||||
* 机场外部监控地址 | |||||
*/ | |||||
private String externalMonitorUrl; | |||||
/** | |||||
* 机场外部监控FLV地址 | |||||
*/ | |||||
private String flvExternalMonitorUrl; | |||||
/** | |||||
* 机场内部监控地址 | |||||
*/ | |||||
private String internalMonitorUrl; | |||||
/** | |||||
* 覆盖范围(km) | |||||
*/ | |||||
private String coverage; | |||||
/** | |||||
* 排序 | |||||
*/ | |||||
private Integer sort; | |||||
/** | |||||
* 经度 | |||||
*/ | |||||
private String longitude; | |||||
/** | |||||
* 纬度 | |||||
*/ | |||||
private String latitude; | |||||
/** | |||||
* 无人机id | |||||
*/ | |||||
private Integer droneId; | |||||
/** | |||||
* 无人机名称 | |||||
*/ | |||||
private String droneName; | |||||
/** | |||||
* 设备id | |||||
*/ | |||||
private String edgeId; | |||||
/** | |||||
* 创建人 | |||||
*/ | |||||
private Integer createUser; | |||||
/** | |||||
* 创建时间 | |||||
*/ | |||||
private String createTime; | |||||
/** | |||||
* 修改人 | |||||
*/ | |||||
private Integer updateUser; | |||||
/** | |||||
* 修改时间 | |||||
*/ | |||||
private String updateTime; | |||||
} |
select id, tenant_id, dept_id, code, name, type, road_id, road_name, section_id, section_name, inspection_type, airport_id, airport_name, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, 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, start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, create_user, create_time, update_user, update_time, mark from th_inspection | select id, tenant_id, dept_id, code, name, type, road_id, road_name, section_id, section_name, inspection_type, airport_id, airport_name, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, 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, start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, create_user, create_time, update_user, update_time, mark from th_inspection | ||||
</sql> | </sql> | ||||
<select id="selectOneById" parameterType="com.tuoheng.admin.request.QueryInspectionRequest" resultMap="InspectionResult"> | |||||
<select id="selectOneById" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="InspectionResult"> | |||||
<include refid="selectInspectionVo"/> | <include refid="selectInspectionVo"/> | ||||
where id = #{id} | where id = #{id} | ||||
and mark = 1 | and mark = 1 | ||||
and tenant_id = #{tenantId} | and tenant_id = #{tenantId} | ||||
</select> | </select> | ||||
<select id="selectList" parameterType="com.tuoheng.admin.request.QueryInspectionRequest" resultMap="InspectionResult"> | |||||
<select id="selectPageList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="InspectionResult"> | |||||
<include refid="selectInspectionVo"/> | |||||
<where> | |||||
<if test="1 == 1"> and mark = 1 </if> | |||||
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if> | |||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> | |||||
</where> | |||||
</select> | |||||
<select id="selectList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="InspectionResult"> | |||||
<include refid="selectInspectionVo"/> | <include refid="selectInspectionVo"/> | ||||
<where> | <where> | ||||
<if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if> | <if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if> |