浏览代码

Merge branch 'release' of gitadmin/tuoheng_freeway into master

master
wanjing 10 个月前
父节点
当前提交
5c55694de1
共有 34 个文件被更改,包括 759 次插入329 次删除
  1. +22
    -18
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Inspection.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/ResubmitInspectionCodeEnum.java
  3. +0
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/cycle/AddInspectionCycleRequest.java
  4. +0
    -20
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/AddInspectionRequest.java
  5. +1
    -21
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/EditInspectionRequest.java
  6. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/QueryInspectionPageListRequest.java
  7. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/cycle/add/AddInspectionCycleCheckParamService.java
  8. +6
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/cycle/update/EditInspectionCycleCheckParamService.java
  9. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java
  10. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/delete/DeleteInspectionService.java
  11. +141
    -22
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java
  12. +8
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java
  13. +10
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/UpdateInspectionService.java
  14. +45
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java
  15. +49
    -8
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java
  16. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/InspectionCycleTask.java
  17. +82
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/InspectionTimeOutTask.java
  18. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/CurrentUserUtil.java
  19. +0
    -111
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/AirLineVO.java
  20. +12
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionVo.java
  21. +1
    -0
      tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml
  22. +57
    -14
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionMapper.xml
  23. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml
  24. +2
    -2
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionFileServiceTest.java
  25. +11
    -11
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionServiceTest.java
  26. +97
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/constant/SystemConstant.java
  27. +0
    -20
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/Inspection.java
  28. +1
    -1
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/query/InspectionQuery.java
  29. +32
    -20
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java
  30. +108
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/third/airport/GetAirLineListService.java
  31. +56
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/AirportLineVo.java
  32. +1
    -3
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionInfoVo.java
  33. +1
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/logback.xml
  34. +1
    -6
      tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/InspectionMapper.xml

+ 22
- 18
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Inspection.java 查看文件

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuoheng.common.core.common.BaseEntity;
@@ -49,20 +50,10 @@ public class Inspection extends BaseEntity {
private String name;

/**
* 巡检任务类型 1:临时巡检 2:应急任务
* 巡检任务类型 1:临时巡检;2:应急巡检
*/
private Integer type;

/**
* 公路ID
*/
private String roadId;

/**
* 路段ID
*/
private String sectionId;

/**
* 巡检方式类型 1 无人机 2机场巡逻 3飞手值飞
*/
@@ -88,6 +79,15 @@ public class Inspection extends BaseEntity {
*/
private Integer droneId;

/**
* 公路ID
*/
private String roadId;

/**
* 路段ID
*/
private String sectionId;
/**
* 巡检线路id
*/
@@ -113,8 +113,6 @@ public class Inspection extends BaseEntity {
*/
private String equipmentMountName;



/**
* 5G云盒ID
*/
@@ -227,14 +225,14 @@ public class Inspection extends BaseEntity {
private String flyHeight;

/**
* 飞行总时长(秒
* 飞行总里程(米
*/
private String flytime;
private String mileage;

/**
* 飞行总里程(米
* 飞行总时长(秒
*/
private String mileage;
private String flytime;

/**
* srt文件名称
@@ -282,8 +280,14 @@ public class Inspection extends BaseEntity {
private String patrolLocation;

/**
* 应急任务关联数据任务ID
* 应急任务数据关联任务ID
*/
private String emergencyDataInspectionId;

/**
* 创建人名称
*/
@TableField(exist = false)
private String createUserName;

}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/ResubmitInspectionCodeEnum.java 查看文件

@@ -27,7 +27,7 @@ public enum ResubmitInspectionCodeEnum {
END_LATITUDE_IS_NULL(1230713, "终点纬度为空"),
INSPECTION_TIME_IS_NULL(1230714, "巡检时间为空"),
INSPECTION_IS_NOT_EXIST(1230715, "任务不存在"),
FAILED_INSPECTION_CANNOT_RESUBMIT(1230716, "非失败的任务不能被重新提交"),
FAILED_INSPECTION_CANNOT_RESUBMIT(1230716, "非失败|取消的任务不能被重新提交"),
TYPE_IS_NOT_EDIT(1230717, "巡检类型不能被修改"),
INSPECTION_TYPE_IS_NOT_EDIT(1230718, "巡检方式不能被修改"),
ROAD_IS_NOT_EXIST(1230719, "公路不存在"),

+ 0
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/cycle/AddInspectionCycleRequest.java 查看文件

@@ -50,21 +50,11 @@ public class AddInspectionCycleRequest {
*/
private Integer airportId;

/**
* 巡检机场名称
*/
private Integer airportName;

/**
* 航线id
*/
private Integer airportLineId;

/**
* 航线名称
*/
private Integer inspectionLineName;

/**
* 航线长度
*/

+ 0
- 20
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/AddInspectionRequest.java 查看文件

@@ -33,21 +33,11 @@ public class AddInspectionRequest {
*/
private Integer droneId;

/**
* 巡检机场名称
*/
private String airportName;

/**
* 巡检线路Id
*/
private Integer inspectionLine;

/**
* 巡检线路名称
*/
private String inspectionLineName;

/**
* 巡检任务类型: 1 临时巡检(目前只有该一种类型)
*/
@@ -63,21 +53,11 @@ public class AddInspectionRequest {
*/
private String roadId;

/**
* 公路名称
*/
private String roadName;

/**
* 路段Id
*/
private String sectionId;

/**
* 路段名称
*/
private String sectionName;

/**
* 是否直播,1:实时 2:离线 默认:null
*/

+ 1
- 21
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/EditInspectionRequest.java 查看文件

@@ -37,23 +37,13 @@ public class EditInspectionRequest {
*/
private Integer airportId;

/**
* 巡检机场名称
*/
private String airportName;

/**
* 巡检线路Id
*/
private Integer inspectionLine;

/**
* 巡检线路名称
*/
private String inspectionLineName;

/**
* 巡检任务类型: 1 临时巡检(目前只有该一种类型)
* 巡检任务类型: 0周期任务 1 单次任务
*/
private Integer type;

@@ -67,21 +57,11 @@ public class EditInspectionRequest {
*/
private String roadId;

/**
* 公路名称
*/
private String roadName;

/**
* 路段Id
*/
private String sectionId;

/**
* 路段名称
*/
private String sectionName;

/**
* 是否直播,1:实时 2:离线 默认:null
*/

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspection/QueryInspectionPageListRequest.java 查看文件

@@ -44,7 +44,7 @@ public class QueryInspectionPageListRequest extends BaseQuery {
/**
* 任务状态
*/
private Integer status;
private List<Integer> statusList;

/**
* 巡检方式类型: 1 无人机 2机场巡逻 3 飞手值飞

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/cycle/add/AddInspectionCycleCheckParamService.java 查看文件

@@ -34,7 +34,7 @@ public class AddInspectionCycleCheckParamService {
}

if(null == request.getAirportLineId()){
return JsonResult.error("航线id为空");
return JsonResult.error("巡检航线id为空");
}

if ((ObjectUtil.isNotNull(request.getCycleStartTime()) && ObjectUtil.isNull(request.getCycleEndTime()))

+ 6
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/cycle/update/EditInspectionCycleCheckParamService.java 查看文件

@@ -25,22 +25,23 @@ public class EditInspectionCycleCheckParamService {
return JsonResult.error("巡检公路id为空");
}

if(null == request.getSectionId()) {
return JsonResult.error("巡检路段id为空");
}

if(StringUtils.isEmpty(request.getName())){
return JsonResult.error("任务名称为空");
}

if(null == request.getSectionId()){
return JsonResult.error("巡检路段id为空");
}

if(null == request.getAirportId()){
return JsonResult.error("巡检机场id为空");
}

if(null == request.getAirportLineId()){
return JsonResult.error("航线id为空");
return JsonResult.error("巡检航线id为空");
}


/**
* 周期性计划需要判断是否在循环开始时间和结束时间内
*/

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/add/AddInspectionService.java 查看文件

@@ -107,20 +107,20 @@ public class AddInspectionService {
if (null == addInspectionRequest.getInspectionType()) {
return JsonResult.error(AddInspectionCodeEnum.INSPECTION_TYPE_IS_NULL.getCode(), AddInspectionCodeEnum.INSPECTION_TYPE_IS_NULL.getMsg());
}
if (null == addInspectionRequest.getRoadId() || StringUtils.isEmpty(addInspectionRequest.getRoadName())) {
if (null == addInspectionRequest.getRoadId()) {
return JsonResult.error(AddInspectionCodeEnum.ROAD_IS_NULL.getCode(), AddInspectionCodeEnum.ROAD_IS_NULL.getMsg());
}

if (null == addInspectionRequest.getSectionId() || StringUtils.isEmpty(addInspectionRequest.getSectionName())) {
if (null == addInspectionRequest.getSectionId()) {
return JsonResult.error(AddInspectionCodeEnum.SECTION_IS_NULL.getCode(), AddInspectionCodeEnum.SECTION_IS_NULL.getMsg());
}
if (InspectionTypeEnum.AIRPORT.getCode() == addInspectionRequest.getInspectionType()) {
// 巡检方式:机场巡逻,可选择巡检机场和巡检路线
if (null == addInspectionRequest.getAirportId() || StringUtils.isEmpty(addInspectionRequest.getAirportName())) {
if (null == addInspectionRequest.getAirportId()) {
return JsonResult.error(AddInspectionCodeEnum.AIRPORT_IS_NULL.getCode(), AddInspectionCodeEnum.AIRPORT_IS_NULL.getMsg());
}

if (null == addInspectionRequest.getInspectionLine() || StringUtils.isEmpty(addInspectionRequest.getInspectionLineName())) {
if (null == addInspectionRequest.getInspectionLine()) {
return JsonResult.error(AddInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getCode(), AddInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getMsg());
}
} else if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() == addInspectionRequest.getInspectionType()) {

+ 5
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/delete/DeleteInspectionService.java 查看文件

@@ -86,11 +86,11 @@ public class DeleteInspectionService {
}

// 判断是否有删除权限
result = this.checkPermission(tenantId, userId, inspection);
if (0 != result.getCode()) {
log.info("删除任务接口:没有权限,{}", result.getMsg());
return result;
}
// result = this.checkPermission(tenantId, userId, inspection);
// if (0 != result.getCode()) {
// log.info("删除任务接口:没有权限,{}", result.getMsg());
// return result;
// }

// 设置该删除务的操作用户,时间
inspection.setUpdateUser(userId);

+ 141
- 22
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java 查看文件

@@ -1,20 +1,23 @@
package com.tuoheng.admin.service.inspection.query;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.Dept;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.User;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.DataPermissionEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.UserMapper;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest;
import com.tuoheng.admin.service.inspection.query.handle.GenerateInspectionFieldHander;
import com.tuoheng.admin.service.third.airport.AirportService;
import com.tuoheng.admin.service.third.airport.GetAirportListByAirportIds;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.AirportInfoVo;
import com.tuoheng.admin.vo.AirportLineVo;
import com.tuoheng.admin.vo.inspection.InspectionVo;
import com.tuoheng.common.core.config.common.CommonConfig;
import com.tuoheng.common.core.utils.JsonResult;
@@ -25,9 +28,11 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
@@ -85,6 +90,18 @@ public class QueryInspectionPageListService {
@Qualifier("editHandle")
private GenerateInspectionFieldHander editHandle;

@Autowired
private RoadInformationMapper roadInformationMapper;

@Autowired
private SectionMapper sectionMapper;

@Autowired
private AirportService airportService;

@Autowired
private GetAirportListByAirportIds getAirportListByAirportIds;

@PostConstruct
public void start() {
executeHandle.setNextHandler(liveHandle);
@@ -98,14 +115,9 @@ public class QueryInspectionPageListService {
}

public JsonResult getPageList(QueryInspectionPageListRequest request) {
// log.info("进入查询巡检任务分页列表业务");
log.info("进入查询巡检任务分页列表业务");
User user = CurrentUserUtil.getUserInfo();
String userId = user.getId();
String tenantId = user.getTenantId();
request.setTenantId(tenantId);

// 不查应急任务
request.setType(1);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
@@ -113,27 +125,29 @@ public class QueryInspectionPageListService {
return result;
}

Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, user.getDeptId())
.eq(Dept::getMark, 1));

IPage<Inspection> pageData = null;
if(StringUtils.isEmpty(request.getDeptId())){
List<String> deptIdList = new ArrayList<>();
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) {
pageData = this.getAllList(request);
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
pageData = this.getListByDept(request, user);
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
} else if (DataPermissionEnum.DEPT.getCode() == user.getDataPermission()) {
pageData = this.getListByDept(request, user);
deptIdList.add(user.getDeptId());
}
request.setDeptIdList(deptIdList);
}

request.setTenantId(tenantId);

IPage<Inspection> page = new Page<>(request.getPage(), request.getLimit());
IPage<Inspection> pageData = inspectionMapper.selectPageList(page, request);

if (null == pageData || pageData.getTotal() == 0) {
log.info("获取任务分页列表为空");
return JsonResult.success(pageData);
}

// 构造返回结果对象
List<InspectionVo> inspectionVoList = this.buildIspectionVoList(user, dept, pageData.getRecords());
List<InspectionVo> inspectionVoList = this.buildIspectionVoList(user, null, pageData.getRecords());

// 重写返回结果对象
IPage<InspectionVo> inspectionVoPageData = new Page<>();
@@ -217,14 +231,57 @@ public class QueryInspectionPageListService {
*/
private List<InspectionVo> buildIspectionVoList(User user, Dept dept, List<Inspection> inspectionList) {
Map<String, String> deptMap = this.getDeptMap(inspectionList);

List<InspectionVo> inspectionVoList = InspectionConverMapper.INSTANCE.fromInspectionListToInspectionVoList(inspectionList);
Map<String, RoadInformation> roadInformationMap = this.getRoadInformationMap(inspectionList);
Map<String, Section> sectionMap = this.getSectionMap(inspectionList);
Map<Integer, AirportLineVo> airportLineMap = this.getAirportLineMap(inspectionList);
Map<String, AirportInfoVo> airportMap = this.getAirportMap(inspectionList);
Map<String, User> userMap = this.getUserMap(inspectionList);

String deptName;
RoadInformation roadInformation;
Section section;
User createUser;

for (InspectionVo inspectionVo : inspectionVoList) {
deptName = deptMap.get(inspectionVo.getDeptId());
inspectionVo.setDeptName(deptName);
if (StringUtils.isNotEmpty(inspectionVo.getAiVideoUrl())) {
inspectionVo.setAiVideoUrl(CommonConfig.videoURL + inspectionVo.getAiVideoUrl());
}
if (ObjectUtil.isNotEmpty(roadInformationMap)) {
roadInformation = roadInformationMap.get(inspectionVo.getRoadId());
if (ObjectUtil.isNotEmpty(roadInformation)) {
inspectionVo.setRoadName(roadInformation.getName());
}
}
if (ObjectUtil.isNotEmpty(sectionMap)) {
section = sectionMap.get(inspectionVo.getSectionId());
if (ObjectUtil.isNotEmpty(section)) {
inspectionVo.setSectionName(section.getSectionRange());
}
}
//机场名称
if (CollectionUtil.isNotEmpty(airportMap)) {
if (ObjectUtil.isNotEmpty(airportMap.get(String.valueOf(inspectionVo.getAirportId())))) {
inspectionVo.setAirportName(airportMap.get(String.valueOf(inspectionVo.getAirportId())).getName());
}
}
//航线名称
if (CollectionUtil.isNotEmpty(airportLineMap)) {
if (ObjectUtil.isNotEmpty(airportLineMap.get(inspectionVo.getInspectionLine()))) {
inspectionVo.setInspectionLineName(airportLineMap.get(inspectionVo.getInspectionLine()).getFileName());
}
}
//创建人名称
if (CollectionUtil.isNotEmpty(userMap)) {
createUser = userMap.get(inspectionVo.getCreateUser());
if (ObjectUtil.isNotEmpty(userMap.get(inspectionVo.getCreateUser()))) {
inspectionVo.setCreateUserName(createUser.getRealname());
}
}

executeHandle.handler(user, dept, inspectionVo);
}
return inspectionVoList;
@@ -247,4 +304,66 @@ public class QueryInspectionPageListService {
return map;
}

private Map<String, User> getUserMap(List<Inspection> inspectionList) {
List<String> userIdList = inspectionList.stream().map(o -> o.getCreateUser()).collect(Collectors.toList());
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>()
.in(User::getId, userIdList)
.eq(User::getMark, MarkEnum.VALID.getCode()));
Map<String, User> userMap = userList.stream().collect(Collectors.toMap(User::getId, Function.identity()));
return userMap;
}

/**
* 获取公路列表,放到map,减少循环次数
*
* @param inspectionList
* @return
*/
private Map<String, RoadInformation> getRoadInformationMap(List<Inspection> inspectionList) {
List<String> roadInformationIdList = inspectionList.stream().map(o -> o.getRoadId()).collect(Collectors.toList());
List<RoadInformation> roadInformationList = roadInformationMapper.selectList(new LambdaQueryWrapper<RoadInformation>()
.in(RoadInformation::getId, roadInformationIdList)
.eq(RoadInformation::getMark, MarkEnum.VALID.getCode()));
Map<String, RoadInformation> roadInformationMap = roadInformationList.stream().collect(Collectors.toMap(RoadInformation::getId, Function.identity()));
return roadInformationMap;
}

/**
* 获取路段列表,放到map,减少循环次数
*
* @param inspectionList
* @return
*/
private Map<String, Section> getSectionMap(List<Inspection> inspectionList) {
List<String> sectionIdList = inspectionList.stream().map(o -> o.getSectionId()).collect(Collectors.toList());
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>()
.in(Section::getId, sectionIdList)
.eq(Section::getMark, MarkEnum.VALID.getCode()));
Map<String, Section> sectionMap = sectionList.stream().collect(Collectors.toMap(Section::getId, Function.identity()));
return sectionMap;
}


private Map<String, AirportInfoVo> getAirportMap(List<Inspection> inspectionList) {
List<Integer> airportIdList = inspectionList.stream().map(o -> o.getAirportId()).collect(Collectors.toList());
String airportIds = airportIdList.stream().distinct().map(x -> String.valueOf(x)).collect(Collectors.joining(",", "", ""));
List<AirportInfoVo> airportInfoVoList = airportService.getAirportInfoList(airportIds);
if (CollectionUtil.isEmpty(airportInfoVoList)) {
return null;
}
Map<String, AirportInfoVo> airportMap = airportInfoVoList.stream().collect(Collectors.toMap(AirportInfoVo::getId, Function.identity()));
return airportMap;
}

private Map<Integer, AirportLineVo> getAirportLineMap(List<Inspection> inspectionList) {
List<Integer> airportLineIdList = inspectionList.stream().map(o -> o.getInspectionLine()).collect(Collectors.toList());
List<AirportLineVo> airportLineVoList = airportService.getAirportLineListByAirportIdAndLineIdList(null, airportLineIdList);
if (CollectionUtil.isEmpty(airportLineVoList)) {
return null;
}
Map<Integer, AirportLineVo> airportLineMap = airportLineVoList.stream().collect(Collectors.toMap(AirportLineVo::getId, Function.identity()));
return airportLineMap;
}


}

+ 8
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java 查看文件

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.conver.InspectionConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.InspectionTaskTypeEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.code.inspection.ResubmitInspectionCodeEnum;
@@ -106,19 +107,19 @@ public class ResubmitInspectionService {
if (null == request.getInspectionType()) {
return JsonResult.error(ResubmitInspectionCodeEnum.INSPECTION_TYPE_IS_NULL.getCode(), ResubmitInspectionCodeEnum.INSPECTION_TYPE_IS_NULL.getMsg());
}
if (null == request.getRoadId() || StringUtils.isEmpty(request.getRoadName())) {
if (null == request.getRoadId()) {
return JsonResult.error(ResubmitInspectionCodeEnum.ROAD_IS_NULL.getCode(), ResubmitInspectionCodeEnum.ROAD_IS_NULL.getMsg());
}

if (null == request.getSectionId() || StringUtils.isEmpty(request.getSectionName())) {
if (null == request.getSectionId()) {
return JsonResult.error(ResubmitInspectionCodeEnum.SECTION_IS_NULL.getCode(), ResubmitInspectionCodeEnum.SECTION_IS_NULL.getMsg());
}
if (InspectionTypeEnum.AIRPORT.getCode() == request.getInspectionType()) {
// 巡检方式:机场巡逻,可选择巡检机场和巡检路线
if (null == request.getAirportId() || StringUtils.isEmpty(request.getAirportName())) {
if (null == request.getAirportId()) {
return JsonResult.error(ResubmitInspectionCodeEnum.AIRPORT_IS_NULL.getCode(), ResubmitInspectionCodeEnum.AIRPORT_IS_NULL.getMsg());
}
if (null == request.getInspectionLine() || StringUtils.isEmpty(request.getInspectionLineName())) {
if (null == request.getInspectionLine()) {
return JsonResult.error(ResubmitInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getCode(), ResubmitInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getMsg());
}
} else if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() == request.getInspectionType()) {
@@ -149,7 +150,7 @@ public class ResubmitInspectionService {
return JsonResult.error(ResubmitInspectionCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
}

if (inspectionOld.getStatus() != InspectionStatusEnum.FLIGHT_FAILED.getCode()) {
if (inspectionOld.getStatus() != InspectionStatusEnum.FLIGHT_FAILED.getCode() && inspectionOld.getStatus() != InspectionStatusEnum.FLIGHT_CANCELED.getCode()) {
return JsonResult.error(ResubmitInspectionCodeEnum.FAILED_INSPECTION_CANNOT_RESUBMIT.getCode(), ResubmitInspectionCodeEnum.FAILED_INSPECTION_CANNOT_RESUBMIT.getMsg());
}

@@ -198,9 +199,10 @@ public class ResubmitInspectionService {
return JsonResult.error(ResubmitInspectionCodeEnum.DEPT_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}
Inspection inspection = InspectionConverMapper.INSTANCE.fromEditInspectionRequestToInspection(request);
String code = DateUtils.generateCode("XJRW");
String code = DateUtils.generateCode("GSDC");
inspection.setCode(code);
inspection.setId("");
inspection.setType(InspectionTaskTypeEnum.TEMPORARY_INSPECTION.getCode()); // 更改为“单次任务”类型
inspection.setTenantId(tenantId);
inspection.setDeptId(dept.getId());
inspection.setCreateUser(user.getId());

+ 10
- 10
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/UpdateInspectionService.java 查看文件

@@ -68,12 +68,12 @@ public class UpdateInspectionService {
log.info("修改任务业务接口:校验失败:{}", result.getMsg());
return result;
}
Inspection inspectionOld = (Inspection) result.getData();
result = checkPermissions(user, inspectionOld.getCreateUser());
if (0 != result.getCode()) {
log.info("修改任务业务接口:校验权限失败:{}", result.getMsg());
return result;
}
// Inspection inspectionOld = (Inspection) result.getData();
// result = checkPermissions(user, inspectionOld.getCreateUser());
// if (0 != result.getCode()) {
// log.info("修改任务业务接口:校验权限失败:{}", result.getMsg());
// return result;
// }

Inspection inspection = InspectionConverMapper.INSTANCE.fromEditInspectionRequestToInspection(editInspectionRequest);
inspection.setUpdateUser(user.getId());
@@ -100,19 +100,19 @@ public class UpdateInspectionService {
return JsonResult.error(EditInspectionCodeEnum.ID_IS_NULL.getCode(), EditInspectionCodeEnum.ID_IS_NULL.getMsg());
}

if (null == editInspectionRequest.getRoadId() || StringUtils.isEmpty(editInspectionRequest.getRoadName())) {
if (null == editInspectionRequest.getRoadId()) {
return JsonResult.error(EditInspectionCodeEnum.ROAD_IS_NULL.getCode(), EditInspectionCodeEnum.ROAD_IS_NULL.getMsg());
}

if (null == editInspectionRequest.getSectionId() || StringUtils.isEmpty(editInspectionRequest.getSectionName()) ) {
if (null == editInspectionRequest.getSectionId() ) {
return JsonResult.error(EditInspectionCodeEnum.SECTION_IS_NULL.getCode(), EditInspectionCodeEnum.SECTION_IS_NULL.getMsg());
}

if (null == editInspectionRequest.getAirportId() || StringUtils.isEmpty(editInspectionRequest.getAirportName())) {
if (null == editInspectionRequest.getAirportId() ) {
return JsonResult.error(EditInspectionCodeEnum.AIRPORT_IS_NULL.getCode(), EditInspectionCodeEnum.AIRPORT_IS_NULL.getMsg());
}

if (null == editInspectionRequest.getInspectionLine() || StringUtils.isEmpty(editInspectionRequest.getInspectionLineName())) {
if (null == editInspectionRequest.getInspectionLine()) {
return JsonResult.error(EditInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getCode(), EditInspectionCodeEnum.INSPECTION_LINE_IS_NULL.getMsg());
}
if (null == editInspectionRequest.getInspectionTime()) {

+ 45
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java 查看文件

@@ -1,6 +1,7 @@
package com.tuoheng.admin.service.report.query;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
@@ -10,7 +11,9 @@ import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.code.report.QueryInspectionReportCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.service.third.airport.AirportService;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.AirportInfoVo;
import com.tuoheng.admin.vo.inspection.InspectionFileHandleReportVo;
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo;
import com.tuoheng.admin.vo.inspection.InspectionReportVo;
@@ -58,6 +61,12 @@ public class QueryInspectionHandleReportService {
@Autowired
private InspectionFileHandleMapper inspectionFileHandleMapper;

@Autowired
private AirportService airportService;

@Autowired
private RoadInformationMapper roadInformationMapper;

public JsonResult getInspectionHandleReport(String id) {
log.info("进入查看巡检处理报告业务");
String tenantId = CurrentUserUtil.getTenantId();
@@ -149,13 +158,46 @@ public class QueryInspectionHandleReportService {
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList);
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList);

// 机场任务没有设备名称,暂定使用机场名称作为设备名称
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType()) {
inspectionReportVo.setEquipmentName(report.getAirportName());
//设备名称 机场任务没有设备名称,暂定使用机场名称作为设备名称
AirportInfoVo airport = this.getAirport(report);
RoadInformation road = this.getRoad(report);
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType() && ObjectUtil.isNotEmpty(airport)) {
inspectionReportVo.setEquipmentName(airport.getName());
inspectionReportVo.setAirportName(airport.getName());
inspectionReportVo.setRoadName(road.getName());
}

return inspectionReportVo;
}

/**
* 查询机场
* @param report
* @return
*/
private AirportInfoVo getAirport(Report report) {
String airportIds = String.valueOf(report.getAirportId());
List<AirportInfoVo> airportInfoVoList = airportService.getAirportInfoList(airportIds);
if (CollectionUtil.isEmpty(airportInfoVoList)) {
return null;
}
return airportInfoVoList.get(0);
}

/**
* 查询公路
* @param report
* @return
*/
private RoadInformation getRoad(Report report) {
String roadId = report.getRoadId();
RoadInformation roadInformation = roadInformationMapper.selectById(roadId);
if (ObjectUtil.isEmpty(roadInformation)) {
return null;
}
return roadInformation;
}

private List<InspectionFileHandle> getInspectionFileHandleList(List<InspectionFile> inspectionFileList) {
List<String> inspectionFileIdList = inspectionFileList.stream().map(o -> o.getId()).collect(Collectors.toList());
List<InspectionFileHandle> inspectionFileHandleList = null;

+ 49
- 8
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java 查看文件

@@ -1,18 +1,17 @@
package com.tuoheng.admin.service.report.query;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.InspectionFileConverMapper;
import com.tuoheng.admin.conver.ReportConverMapper;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.InspectionTypeEnum;
import com.tuoheng.admin.enums.code.report.QueryInspectionReportCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
import com.tuoheng.admin.mapper.QuestionTypeMapper;
import com.tuoheng.admin.mapper.ReportMapper;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.service.third.airport.AirportService;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.admin.vo.AirportInfoVo;
import com.tuoheng.admin.vo.inspection.InspectionFileReportVo;
import com.tuoheng.admin.vo.inspection.InspectionReportVo;
import com.tuoheng.admin.vo.inspection.InspectionResultVo;
@@ -49,6 +48,12 @@ public class QueryInspectionReportService {
@Autowired
private QuestionTypeMapper questionTypeMapper;

@Autowired
private AirportService airportService;

@Autowired
private RoadInformationMapper roadInformationMapper;

public JsonResult getInspectionReport(String id) {
log.info("进入查看巡检报告业务");
String tenantId = CurrentUserUtil.getTenantId();
@@ -103,6 +108,7 @@ public class QueryInspectionReportService {
.eq(InspectionFile::getMark, 1));
String deptName = this.getDeptName(report.getDeptId());
List<InspectionResultVo> inspectionResultVoList = this.buildInspectionResult(report);

List<InspectionFileReportVo> inspectionFileHandleVoList = InspectionFileConverMapper.INSTANCE.fromInspectionFileListToInspectionFileHandleVoList(inspectionFileList);
if (CollectionUtil.isNotEmpty(inspectionFileHandleVoList)) {
for (InspectionFileReportVo inspectionFileReportVo : inspectionFileHandleVoList) {
@@ -111,16 +117,51 @@ public class QueryInspectionReportService {
inspectionFileReportVo.setFileOriginal(CommonConfig.imageURL + inspectionFileReportVo.getFileOriginal());
}
}
// 机场任务没有设备名称,暂定使用机场名称作为设备名称
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType()) {
inspectionReportVo.setEquipmentName(report.getAirportName());

AirportInfoVo airport = this.getAirport(report);
RoadInformation road = this.getRoad(report);

//设备名称 机场任务没有设备名称,暂定使用机场名称作为设备名称
if (InspectionTypeEnum.AIRPORT.getCode() == report.getInspectionType() && ObjectUtil.isNotEmpty(airport)) {
inspectionReportVo.setEquipmentName(airport.getName());
inspectionReportVo.setAirportName(airport.getName());
inspectionReportVo.setRoadName(road.getName());
}

inspectionReportVo.setDeptName(deptName);
inspectionReportVo.setInspectionResultVoList(inspectionResultVoList);
inspectionReportVo.setInspectionFileReportVoList(inspectionFileHandleVoList);
return inspectionReportVo;
}

/**
* 查询机场
* @param report
* @return
*/
private AirportInfoVo getAirport(Report report) {
String airportIds = String.valueOf(report.getAirportId());
List<AirportInfoVo> airportInfoVoList = airportService.getAirportInfoList(airportIds);
if (CollectionUtil.isEmpty(airportInfoVoList)) {
return null;
}
return airportInfoVoList.get(0);
}

/**
* 查询公路
* @param report
* @return
*/
private RoadInformation getRoad(Report report) {
String roadId = report.getRoadId();
RoadInformation roadInformation = roadInformationMapper.selectById(roadId);
if (ObjectUtil.isEmpty(roadInformation)) {
return null;
}
return roadInformation;
}

/**
* 获取部门路名称
*/

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/InspectionCycleTask.java 查看文件

@@ -143,7 +143,8 @@ public class InspectionCycleTask {
inspection.setInspectionTime(inspectionCycle.getCycleNextTime());
inspection.setType(InspectionTaskTypeEnum.CYCLE_INSPECTION.getCode());
inspection.setInspectionType(InspectionTypeEnum.AIRPORT.getCode());
inspection.setCreateUser("");
inspection.setCreateUser(inspectionCycle.getCreateUser());

inspection.setCreateTime(DateUtils.now());
inspection.setStatus(InspectionStatusEnum.WAIT_FLIGHT.getCode());
Date cycleNextTime = InspectionCycleNextTimeUtil.getCycleNextTime(inspectionCycle.getType(),

+ 82
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/task/InspectionTimeOutTask.java 查看文件

@@ -0,0 +1,82 @@
package com.tuoheng.admin.task;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionHistory;
import com.tuoheng.admin.enums.AirPortTaskStatusEnum;
import com.tuoheng.admin.enums.InspectionExecutionStatusEnum;
import com.tuoheng.admin.enums.InspectionStatusEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.InspectionHistoryMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.utils.CurrentUserUtil;
import com.tuoheng.common.core.common.BaseEntity;
import com.tuoheng.common.core.utils.DateUtils;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.functions.Current;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;

@Slf4j
@Component
public class InspectionTimeOutTask {

@Resource
private InspectionMapper inspectionMapper;

@Resource
private InspectionHistoryMapper inspectionHistoryMapper;

@XxlJob("inspectionTimeOutTaskHandler")
public void inspectionExecuteHandler() {
log.info("=================================开始执行超时任务定时器任务调度=================================");
Date startTime;
String taskBeginTime = null;
try {
SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
startTime = new Date(System.currentTimeMillis());
taskBeginTime = DateUtils.addDateTimeToStr(startTime, 0, -1, 0, 0);
} catch (Exception e) {
log.error("获取开始时间异常:{}", e);
}

//以现在时间为节点 查询一小时之前的所有机场里的状态为 准备中,飞行中的已开始执行的任务
List<Inspection> newInspections = inspectionMapper.selectList(Wrappers.<Inspection>lambdaQuery()
.in(Inspection::getStatus, InspectionStatusEnum.PREPARING.getCode(), InspectionStatusEnum.IN_FLIGHT.getCode())
.eq(Inspection::getInspectionType, AirPortTaskStatusEnum.FLIGHT.getCode())
.eq(Inspection::getExecutionStatus, InspectionExecutionStatusEnum.EXECUTED.getCode())
.le(Inspection::getExecutionStartTime, taskBeginTime)
.eq(BaseEntity::getMark, MarkEnum.VALID.getCode()));
log.info("执行定时执行飞行任务:机场任务数" + newInspections.size());

for (Inspection inspection : newInspections) {
inspection.setStatus(InspectionStatusEnum.FLIGHT_FAILED.getCode());
inspectionMapper.updateById(inspection);
log.info("修改结果: 任务状态为" + inspection.getStatus());
this.insertInspectionHistory(inspection);
}
log.info("=================================结束执行超时任务定时器任务调度=================================");
}

/**
* 保存到历史记录表
* @param inspection
*/
private void insertInspectionHistory(Inspection inspection) {
InspectionHistory inspectionHistory = new InspectionHistory();
inspectionHistory.setTenantId(inspection.getTenantId());
inspectionHistory.setInspectionId(inspection.getId());
inspectionHistory.setHistoryName("任务执行超过一小时 默认失败");
inspectionHistory.setCreateUser(inspection.getCreateUser());
inspectionHistory.setCreateTime(DateUtils.now());
Integer count = inspectionHistoryMapper.insert(inspectionHistory);
if (count <= 0) {
log.info("超时任务保存到历史记录表中失败,inspectionId:{}", inspection.getId());
}
}

}

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/utils/CurrentUserUtil.java 查看文件

@@ -48,7 +48,6 @@ public class CurrentUserUtil {
* @return
*/
public static User getUserInfo() {
// String username = "admin";
String username = SecurityUserUtils.username();
User user = currentUserUtil.userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getMark, 1).eq(User::getStatus, 1).eq(User::getUsername, username));
if (null == user) {

+ 0
- 111
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/AirLineVO.java 查看文件

@@ -1,111 +0,0 @@
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;
}

+ 12
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionVo.java 查看文件

@@ -28,7 +28,7 @@ public class InspectionVo extends BaseEntity {
/**
* 部门ID
*/
private String deptId;
private String deptId;

/**
* 部门名称
@@ -212,7 +212,6 @@ public class InspectionVo extends BaseEntity {
private Integer analyseStatus;

/**
*
* ai任务分析进度
*/
private BigDecimal progressbar;
@@ -337,4 +336,14 @@ public class InspectionVo extends BaseEntity {
*/
private boolean edit;

}
/**
* 创建人名
*/
private String createUserName;

/**
* 周期性任务id
*/
private String inspectionCycleId;

}

+ 1
- 0
tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml 查看文件

@@ -30,6 +30,7 @@ spring:
url: jdbc:mysql://rm-uf6z740323e8053pj4o.mysql.rds.aliyuncs.com:3306/tuoheng_freeway?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false
username: root
password: TH22#2022
# password: idontcare
filter:
slf4j:
enabled: true

+ 57
- 14
tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionMapper.xml 查看文件

@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="roadId" column="road_id" />
<result property="sectionId" column="section_id" />
<result property="inspectionType" column="inspection_type" />
<result property="inspectionCycleId" column="inspection_cycleId_id" />
<result property="inspectionCycleId" column="inspection_cycle_id" />
<result property="airportTaskId" column="airport_task_id" />
<result property="airportId" column="airport_id" />
<result property="droneId" column="drone_id" />
@@ -62,10 +62,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="emergencyDataInspectionId" column="emergency_data_inspection_id" />
<result property="mark" column="mark" />
</resultMap>

<resultMap id="ForeignResult" type="com.tuoheng.admin.entity.Inspection" extends="InspectionResult">
<result property="createUserName" column="create_user_name" />
</resultMap>
<sql id="Base_Column_list">
id, tenant_id, dept_id, code, name, type, road_id, section_id, inspection_type,
inspectionCycleI, airport_task_id, airport_id, drone_id, inspection_line,
id, tenant_id, dept_id, code, name, type, road_id, section_id, inspection_type,
inspection_cycle_id, airport_task_id, airport_id, drone_id, inspection_line,
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,
@@ -75,8 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>

<sql id="selectInspectionVo">
select id, tenant_id, dept_id, code, name, type, road_id, section_id, inspection_type,
inspectionCycleI, airport_task_id, airport_id, drone_id, inspection_line,
select id, tenant_id, dept_id, code, name, type, road_id, road_name, section_id, section_name, inspection_type,
inspection_cycle_id, airport_task_id, airport_id, drone_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,
@@ -93,29 +95,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and tenant_id = #{tenantId}
</select>

<select id="selectPageList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="InspectionResult">
<include refid="selectInspectionVo"/>
<select id="selectPageList" parameterType="com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest" resultMap="ForeignResult">
select <include refid="Base_Column_list"/>
from th_inspection
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if>
<if test="request.code != null and request.code != ''"> and code like concat('%', #{request.code}, '%') </if>
<if test="request.name != null and request.name != ''"> and name like concat('%', #{request.name}, '%') </if>
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if>
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if>
<if test="request.inspectionLine != null and request.inspectionLine != 0"> and inspection_line = #{request.inspectionLine} </if>
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if>
<if test="request.status != null and request.status != 0"> and status = #{request.status} </if>
<if test="request.type != null and (request.type == 0 or request.type == 1)"> and type = #{request.type} </if>
<if test="request.inspectionType != null and request.inspectionType != 0"> and inspection_type = #{request.inspectionType} </if>
<if test="request.deptId != null and request.deptId != ''"> and dept_id = #{request.deptId} </if>
<if test="request.statusList != null and request.statusList.size() > 0">
and status in
<foreach item="status" collection="request.statusList" open="(" separator="," close=")">
#{status}
</foreach>
</if>
<if test="request.deptIdList != null and request.deptIdList.size() > 0">
and dept_id in
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
<if test="request.deptId != null and request.deptId !=''">
and dept_id = #{request.deptId}
</if>
<if test="request.inspectionTimeBegin != null and request.inspectionTimeBegin != ''">
and inspection_time &gt;= #{request.inspectionTimeBegin}
</if>
<if test="request.inspectionTimeEnd != null and request.inspectionTimeEnd != ''">
and inspection_time &lt;= #{request.inspectionTimeEnd}
</if>
<if test="request.executionTimeBegin != null and request.executionTimeBegin != ''">
and execution_start_time &gt;= #{request.executionTimeBegin}
</if>
<if test="request.executionTimeEnd != null and request.executionTimeEnd != ''">
and execution_start_time &lt;= #{request.executionTimeEnd}
</if>
<if test="request.inspectionCycleId != null and request.inspectionCycleId != ''">
and type = 0 and inspection_cycle_id = #{request.inspectionCycleId}
</if>
<choose>
<!-- 单次任务程序:只展示待执行(5)的单次任务 -->
<when test="request.singleTask != null and request.singleTask == 1">
and type in(0,1) and status = 5
</when>
<!-- 执行任务程序:只展示准备中(6)、飞行中(10)、飞行完成(15)、飞行失败(7)、已取消(16)的单次任务、周期任务子任务 -->
<otherwise>
and type in(0,1) and status in (6,10,15,7,16)
</otherwise>
</choose>
</where>
order by create_time desc
<choose>
<!-- 单次任务程序:按创建时间倒序排 -->
<when test="request.singleTask != null and request.singleTask == 1">
order by create_time desc
</when>
<!-- 执行任务程序:按实际巡检时间倒序排,null为后 -->
<otherwise>
order by execution_start_time desc
</otherwise>
</choose>
</select>

<!-- 根据云盒ID查询执行中的巡检任务-->
<select id="getListByBox" resultType="com.tuoheng.admin.entity.Inspection">
<include refid="selectInspectionVo"/>

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml 查看文件

@@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if>
<if test="request.inspectionCode!= null and request.inspectionCode != ''"> and inspection_code like concat('%', #{request.inspectionCode}, '%') </if>
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if>
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if>
<if test="request.type != null and (request.type == 0 or request.type == 1 or request.type == 2)"> and type = #{request.type} </if>
<if test="request.deptIdList != null and request.deptIdList.size() > 0">
and dept_id in
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")">

+ 2
- 2
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionFileServiceTest.java 查看文件

@@ -166,8 +166,8 @@ public class InspectionFileServiceTest {
inspectionFileExportExcelDto.setFileOriginal(new URL(CommonConfig.imageURL + inspectionFile.getFileOriginal()));
inspectionFileExportExcelDto.setFileImage(new URL(CommonConfig.imageURL + inspectionFile.getFileImage()));
inspectionFileExportExcelDto.setLocation(inspectionFile.getLongitude() + "," + inspectionFile.getLatitude());
inspectionFileExportExcelDto.setSectionName(inspection.getSectionName());
inspectionFileExportExcelDto.setRoadName(inspection.getRoadName());
// inspectionFileExportExcelDto.setSectionName(inspection.getSectionName());
// inspectionFileExportExcelDto.setRoadName(inspection.getRoadName());
if (InspectionFileStatusEnum.WAIT_CONFIRMED.getCode() == inspectionFile.getStatus()) {
inspectionFileExportExcelDto.setStatus("待确认");
} else if (InspectionFileStatusEnum.IGNORED.getCode() == inspectionFile.getStatus()) {

+ 11
- 11
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/InspectionServiceTest.java 查看文件

@@ -41,7 +41,7 @@ public class InspectionServiceTest {
request.setAirportId(1); // 巡检机场id
request.setInspectionLine(1); // 巡检线路Id
request.setType(1); // 巡检任务类型: 1 临时巡检(目前只有该一种类型)
request.setStatus(5); // 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成
// request.setStatus(5); // 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成
request.setInspectionType(1); // 1 无人机 2机场
request.setDeptId("");
request.setPage(1);
@@ -60,14 +60,14 @@ public class InspectionServiceTest {
request.setType(1);
request.setName("test-2022112501-11");
request.setRoadId("1");
request.setRoadName("G2");
// request.setRoadName("G2");
request.setSectionId("1");
request.setSectionName("路段1");
// request.setSectionName("路段1");
request.setInspectionType(1);
request.setAirportId(1);
request.setAirportName("禄口-2022112501");
// request.setAirportName("禄口-2022112501");
request.setInspectionLine(1);
request.setInspectionLineName("路线1");
// request.setInspectionLineName("路线1");
request.setInspectionTime(DateUtils.now());

JSONObject json = (JSONObject) JSONObject.toJSON(request);
@@ -87,9 +87,9 @@ public class InspectionServiceTest {
request.setSectionId("1");
request.setInspectionType(1);
request.setAirportId(1);
request.setAirportName("禄口1");
// request.setAirportName("禄口1");
request.setInspectionLine(1);
request.setInspectionLineName("路线11");
// request.setInspectionLineName("路线11");
request.setInspectionTime(DateUtils.now());
request.setNote("test");

@@ -113,13 +113,13 @@ public class InspectionServiceTest {
request.setInspectionType(2);
request.setName("test1");
request.setRoadId("1");
request.setRoadName("G2");
// request.setRoadName("G2");
request.setSectionId("1");
request.setSectionName("路段1");
// request.setSectionName("路段1");
request.setAirportId(1);
request.setAirportName("禄口1");
// request.setAirportName("禄口1");
request.setInspectionLine(1);
request.setInspectionLineName("路线11");
// request.setInspectionLineName("路线11");
request.setIsLive(1);
request.setStartLatitude("11");
request.setStartLongitude("11");

+ 97
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/constant/SystemConstant.java 查看文件

@@ -0,0 +1,97 @@
package com.tuoheng.miniprogram.constant;

public interface SystemConstant {

/**
* 顶级部门pid,默认为0
*/
String ROOT_DEPT_PID = "0";

String INIT_PASSWORD = "123456";

/**
* 平台code
*/
String PLATFORM_CODE = "gs";

/**
* 机场平台:获取航点文件坐标
*/
String API_AIRPORT_LOCATION = "/airportInterface/getLocationById";

/**
* 高德url地址
*/
String GAO_DE_URL = "https://restapi.amap.com/v3/geocode/regeo";

/**
* 机场平台:获取机场列表接口
*/
String API_AIRPORT_LIST = "/airportInterface/airportList";

/**
* 机场平台:获取机场路线列表接口
*/
String API_AIRPORT_LINE_LIST = "/airportInterface/taskByDroneId";

/**
* 机场平台:执行接口
*/
String API_AIRPORT_EXECUTE_TASK = "/airportInterface/executeTaskAnsy";

/**
* 机场平台:定点飞行
*/
String API_AIRPORT_POINT_FLIGH = "/airportInterface/createPointLine";

/**
* 机场平台:获取天气
*/
String API_AIRPORT_GET_WEATHER = "/airportInterface/getWeather";

/**
* 机场平台:控制无人机
*/
String API_AIRPORT_DRONE_CONTROL = "/airportInterface/droneCommand";

/**
* 机场平台:获取天气温湿度及挂载状态
*/
String API_AIRPORT_GET_WEATHER_STATUS = "/airportInterface/getAirportStatus";

/**
* 机场平台:获取机场信息
*/
String API_AIRPORT_GET_AIRPORT_MSG = "/airportInterface/getAirportMsg";

/**
* 机场平台:获取机场状态
*/
String API_AIRPORT_STATUS = "/airportInterface/getAirportStatus";

/**
* 机场平台:获取机场状态
*/
String API_AIRPORT_STATUS_BY_AIRPORT_ID = "/airportInterface/getAirportStatusByAirportId";

// 飞手平台不同接口url
/**
* 新增任务接口
*/
String ADD_PILOTTASK = "apiTask/add";

/**
* 机场平台:获取机场路线列表接口
*/
String API_AIRPORT_LINE_FILE_LIST = "/airportInterface/getAirlineFileListForThird";

/**
* 机场平台:根据id获取机场信息
*/
String API_AIRPORT_MSG_BY_AIRPORT_ID = "/airportInterface/queryAirportList";

/**
* 机场平台:周期性任务创建/修改
*/
String API_AIRPORT_INSPECTION = "/airportInterface/inspection";
}

+ 0
- 20
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/Inspection.java 查看文件

@@ -54,21 +54,11 @@ public class Inspection extends BaseEntity {
*/
private String roadId;

/**
* 公路名称
*/
private String roadName;

/**
* 路段id
*/
private String sectionId;

/**
* 路段名称
*/
private String sectionName;

/**
* 巡检方式类型 1 无人机 2机场
*/
@@ -84,21 +74,11 @@ public class Inspection extends BaseEntity {
*/
private Integer droneId;

/**
* 巡检机场名称
*/
private String airportName;

/**
* 巡检线路id
*/
private Integer inspectionLine;

/**
* 巡检线路名称
*/
private String inspectionLineName;

/**
* 飞行设备
*/

+ 1
- 1
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/query/InspectionQuery.java 查看文件

@@ -56,7 +56,7 @@ public class InspectionQuery extends BaseQuery {
private String inspectionLineName;

/**
* 巡检任务类型 1 临时巡检
* 巡检任务类型 0周期任务 1 单次任务|周期子任务 2 应急任务
*/
private Integer type;


+ 32
- 20
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionServiceImpl.java 查看文件

@@ -1,5 +1,7 @@
package com.tuoheng.miniprogram.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -18,7 +20,9 @@ import com.tuoheng.miniprogram.entity.User;
import com.tuoheng.miniprogram.entity.query.InspectionQuery;
import com.tuoheng.miniprogram.enums.DataPermissionEnum;
import com.tuoheng.miniprogram.service.IInspectionService;
import com.tuoheng.miniprogram.service.third.airport.GetAirLineListService;
import com.tuoheng.miniprogram.utils.CurrentUserUtil;
import com.tuoheng.miniprogram.vo.AirportLineVo;
import com.tuoheng.miniprogram.vo.InspectionInfoVo;
import com.tuoheng.miniprogram.vo.PlayBackInfoVo;
import lombok.extern.slf4j.Slf4j;
@@ -26,10 +30,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
@@ -55,6 +57,9 @@ public class InspectionServiceImpl implements IInspectionService {
@Autowired
private TenantMapper tenantMapper;

@Autowired
private GetAirLineListService getAirLineListService;

/**
* 任务列表(分页)
*
@@ -75,7 +80,7 @@ public class InspectionServiceImpl implements IInspectionService {
String tenantId = user.getTenantId();

query.setTenantId(tenantId);
query.setType(1);
// query.setType(1);

//初始部门id
String deptIdInt = query.getDeptId();
@@ -163,6 +168,19 @@ public class InspectionServiceImpl implements IInspectionService {
}
}
}
Map<Integer, AirportLineVo> airportLineMap = this.getAirportLineMap(inspectionInfoVoList);
for (InspectionInfoVo inspectionInfoVo : inspectionInfoVoList) {
//航线名称
if (CollectionUtil.isNotEmpty(airportLineMap)) {
if (ObjectUtil.isNotEmpty(airportLineMap.get(inspectionInfoVo.getInspectionLine()))) {
inspectionInfoVo.setInspectionLineName(airportLineMap.get(inspectionInfoVo.getInspectionLine()).getFileName());
} else {
inspectionInfoVo.setInspectionLineName("");
}
} else {
inspectionInfoVo.setInspectionLineName("");
}
}
pageDataVo.setRecords(inspectionInfoVoList);
return JsonResult.success(pageDataVo);
}
@@ -219,23 +237,17 @@ public class InspectionServiceImpl implements IInspectionService {
if (count <= 0 && num != inspectionFiles.size()) {
return JsonResult.error();
}

return JsonResult.success("删除成功");

}

/**
* 递归获取部门的子集
*
* @author zhu_zishuang
* @date 3/13/21
*/
private List<Dept> getChildren(Dept rootDept, List<Dept> list) {
return list.stream().filter(dept ->
dept.getPid().equals(rootDept.getId())
).peek(dept -> {
// 设置子集
dept.setItemList(getChildren(dept, list));
}).sorted(Comparator.comparingInt(dept -> (dept.getSort() == null ? 0 : dept.getSort()))).collect(Collectors.toList());
private Map<Integer, AirportLineVo> getAirportLineMap(List<InspectionInfoVo> inspectionInfoVoList) {
List<Integer> airportLineIdList = inspectionInfoVoList.stream().map(o -> o.getInspectionLine()).collect(Collectors.toList());
// airportLineIdList = airportLineIdList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(x->x))), ArrayList::new));
List<AirportLineVo> airportLineVoList = getAirLineListService.getList(null, airportLineIdList);
if (CollectionUtil.isEmpty(airportLineVoList)) {
return null;
}
Map<Integer, AirportLineVo> airportLineMap = airportLineVoList.stream().collect(Collectors.toMap(AirportLineVo::getId, Function.identity()));
return airportLineMap;
}
}

+ 108
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/third/airport/GetAirLineListService.java 查看文件

@@ -0,0 +1,108 @@
package com.tuoheng.miniprogram.service.third.airport;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.tuoheng.common.core.config.common.CommonConfig;
import com.tuoheng.common.core.exception.ServiceException;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.miniprogram.constant.SystemConstant;
import com.tuoheng.miniprogram.dao.TenantMapper;
import com.tuoheng.miniprogram.entity.Tenant;
import com.tuoheng.miniprogram.utils.CurrentUserUtil;
import com.tuoheng.miniprogram.vo.AirportLineVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import java.util.List;
import java.util.Objects;

@Slf4j
@Service
public class GetAirLineListService {

@Autowired
private TenantMapper tenantMapper;

@Autowired
@Qualifier("restTemplate")
private RestTemplate restTemplate;

public JsonResult getAirLineList(Integer droneId) {
//读取不同租户的机场平台url
Tenant tenant = tenantMapper.selectById(CurrentUserUtil.getTenantId());
if (ObjectUtil.isEmpty(tenant)) {
log.info("租户不存在, tenantId:{}", CurrentUserUtil.getTenantId());
throw new ServiceException("租户不存在");
}
String url = UriComponentsBuilder.fromHttpUrl(CommonConfig.airportURL + SystemConstant.API_AIRPORT_LINE_LIST)
.queryParam("page", 1)
.queryParam("limit", 100)
.queryParam("droneId", droneId)
.toUriString();

JsonResult jsonResult;
try {
jsonResult = restTemplate.getForObject(url, JsonResult.class);
} catch (Exception e) {
log.info("获机航线列表接口异常, url:{}", url);
throw new ServiceException("获机航线列表接口异常");
}
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
log.info("获机航线列表接口返回为空");
throw new ServiceException("获机航线列表接口返回为空");
}
return jsonResult;
}

public List<AirportLineVo> getList(String airportId, List<Integer> airportLineIdList) {
//读取不同租户的机场平台url
Tenant tenant = tenantMapper.selectById(CurrentUserUtil.getTenantId());
if (ObjectUtil.isEmpty(tenant)) {
return null;
}
String url = CommonConfig.airportURL + SystemConstant.API_AIRPORT_LINE_FILE_LIST;

JSONObject jsonObject = new JSONObject();
jsonObject.put("tenantCode", tenant.getCode());
jsonObject.put("airportId", airportId);
jsonObject.put("airlineFileIds", airportLineIdList);

log.info("调用机场平台,获取航线列表,url:{}", url);
log.info("调用机场平台,获取航线列表,jsonObject:{}", jsonObject);

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity httpEntity = new HttpEntity(jsonObject, headers);
ResponseEntity<JsonResult> response;
try {
response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, JsonResult.class);
} catch (Exception e) {
log.info("调用机场平台,获取航线列表接口异常,url:{}", url);
log.info("调用机场平台,获取航线列表接口异常,jsonObject:{}", jsonObject);
return null;
}
if (ObjectUtil.isEmpty(response)) {
log.info("调用机场平台,获取航线列表接口返回为空,url:{}", url);
log.info("调用机场平台,获取航线列表接口返回为空,jsonObject:{}", jsonObject);
return null;
}
JsonResult jsonResult = response.getBody();
if (0 != jsonResult.getCode()) {
log.info("调用机场平台,获取航线列表,失败,url:{}", url);
log.info("调用机场平台,获取航线列表,失败,jsonObject:{}", jsonObject);
log.info("调用机场平台,获取航线列表,失败,jsonResult:{}", jsonResult.getMsg());
return null;
}
List<AirportLineVo> airportLineVoList = JSONObject.parseArray(JSONObject.toJSONString(jsonResult.getData()), AirportLineVo.class);
if (CollectionUtil.isEmpty(airportLineVoList)) {
log.info("调用机场平台,获取航线列表,数据为空");
}
return airportLineVoList;
}
}

+ 56
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/AirportLineVo.java 查看文件

@@ -0,0 +1,56 @@
package com.tuoheng.miniprogram.vo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
* 机场线路视图Vo
*
* @author wanjing
* @team tuoheng
* @date 2022-11-23
*/
@Data
@NoArgsConstructor
public class AirportLineVo implements Serializable {

private static final long serialVersionUID = 1L;

/**
* 航线id
*/
private Integer id;

/**
* 航线名称
*/
private String fileName;

/**
* 航线地址
*/
private String fileUrl;

/**
* 机场ID
*/
private String airportId;

/**
* 机场名称
*/
private String airportName;

/**
* 航线类型:1,航点航线;2,指点航线;3,指面航线
*/
private String type;

/**
* 备注
*/
private String note;

}

+ 1
- 3
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionInfoVo.java 查看文件

@@ -34,7 +34,7 @@ public class InspectionInfoVo {
private Integer type;

/**
*任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成
* 任务状态 5任务待飞行 7飞行失败 10任务飞行中 15任务飞行完成
*/
private Integer status;

@@ -85,6 +85,4 @@ public class InspectionInfoVo {
*/
private String aiVideoUrl;



}

+ 1
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/logback.xml 查看文件

@@ -53,6 +53,7 @@
</appender>

<logger name="com.tuoheng" level="DEBUG" additivity="false">
<appender-ref ref="console" />
<appender-ref ref="file.async" />
</logger>
<!--log4jdbc -->

+ 1
- 6
tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/InspectionMapper.xml 查看文件

@@ -11,14 +11,10 @@
<result property="name" column="name" />
<result property="type" column="type" />
<result property="roadId" column="road_id" />
<result property="roadName" column="road_name" />
<result property="sectionId" column="section_id" />
<result property="sectionName" column="section_name" />
<result property="inspectionType" column="inspection_type" />
<result property="airportId" column="airport_id" />
<result property="airportName" column="airport_name" />
<result property="inspectionLine" column="inspection_line" />
<result property="inspectionLineName" column="inspection_line_name" />
<result property="equipmentId" column="equipment_id" />
<result property="equipmentName" column="equipment_name" />
<result property="equipmentMountId" column="equipment_mount_id" />
@@ -71,7 +67,6 @@
ti.status,
ti.inspection_type as inspectionType,
ti.inspection_line as inspectionLine,
ti.inspection_line_name as inspectionLineName,
ti.create_user as createUser,
ti.execution_start_time as executionStartTime,
ti.ai_video_url as aiVideoUrl
@@ -87,7 +82,7 @@
<if test="request.inspectionType !=null">
and ti.inspection_type = #{request.inspectionType}
</if>
<if test="request.type !=null">
<if test="request.type !=null and (request.type == 0 or request.type == 1)">
and ti.type = #{request.type}
</if>
<if test="request.startTimeDate !=null and request.endTimeDate !=null">

正在加载...
取消
保存