Browse Source

1、新增查询任务列表接口;2、新增查询应急任务列表接口;3、新增机场飞行类型枚举;

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
892f89157d
9 changed files with 288 additions and 6 deletions
  1. +19
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java
  2. +6
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/ThMission.java
  3. +29
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryEmergencyListRequest.java
  4. +23
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryMissionListRequest.java
  5. +29
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/enums/AirportFlyTypeEnum.java
  6. +16
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/IMissionService.java
  7. +25
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java
  8. +75
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java
  9. +66
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryMissionListService.java

+ 19
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java View File

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.MissionQuery;
import com.tuoheng.admin.entity.request.MissionRequest;
import com.tuoheng.admin.entity.request.emergency.QueryEmergencyListRequest;
import com.tuoheng.admin.entity.request.emergency.QueryMissionListRequest;
import com.tuoheng.admin.entity.vo.MissionLiveVO;
import com.tuoheng.admin.entity.vo.MissionVO;
import com.tuoheng.admin.service.IMissionService;
@@ -137,4 +139,21 @@ public class MissionController {
return missionService.getVideoById(id);
}

/**
* 查询巡检任务列表
*/
@GetMapping("/list")
@ApiOperation(value = "查询应急任务列表", notes = "查询任务列表")
public JsonResult getList(QueryMissionListRequest request) {
return missionService.getList(request);
}

/**
* 查询巡检任务列表
*/
@GetMapping("/emergency/list")
@ApiOperation(value = "查询应急任务列表", notes = "查询应急任务列表")
public JsonResult getEmergencyList(QueryEmergencyListRequest request) {
return missionService.getEmergencyList(request);
}
}

+ 6
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/ThMission.java View File

@@ -192,4 +192,10 @@ public class ThMission extends BaseEntity implements Serializable {
* DSP交互ID
*/
private String requestId;

/**
* 机场飞行类型 0默认 1机场巡逻 2指点飞行
*/
private Integer airportFlyType;

}

+ 29
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryEmergencyListRequest.java View File

@@ -0,0 +1,29 @@
package com.tuoheng.admin.entity.request.emergency;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
* 查询应急列表请求实体
*
* @author wanjing
* @team tuoheng
* @date 2023-02-13
*/
@Data
public class QueryEmergencyListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id",hidden = true)
private Integer tenantId;

@ApiModelProperty(value = "机场飞行类型 0默认 1机场巡逻 2指点飞行")
private Integer airportFlyType;

@ApiModelProperty(value = "任务状态:1任务待飞行 2任务飞行中 3任务执行失败 4任务飞行完成")
private List<String> statusList;
}

+ 23
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/emergency/QueryMissionListRequest.java View File

@@ -0,0 +1,23 @@
package com.tuoheng.admin.entity.request.emergency;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
* 查询应急列表请求实体
* @author: qiujinyang
*/
@Data
public class QueryMissionListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id",hidden = true)
private Integer tenantId;

@ApiModelProperty(value = "任务状态:1任务待飞行 2任务飞行中 3任务执行失败 4任务飞行完成")
private List<String> statusList;
}

+ 29
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/enums/AirportFlyTypeEnum.java View File

@@ -0,0 +1,29 @@
package com.tuoheng.admin.enums;

import lombok.Getter;

/**
* 机场飞行类型 0默认 1机场巡逻 2指点飞行
*
* @author wanjing
* @team tuoheng
* @date 2023-02-13
*/

public enum AirportFlyTypeEnum {

NULL(0, "无"),
AIRPORT_PATROL(1,"机场巡逻"),
POINTING_FLIGHT(2,"指点飞行");

AirportFlyTypeEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 16
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/IMissionService.java View File

@@ -6,10 +6,11 @@ import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.MissionQuery;
import com.tuoheng.admin.entity.request.MissionRequest;
import com.tuoheng.admin.entity.request.MissionStatusRequest;
import com.tuoheng.admin.entity.request.emergency.QueryEmergencyListRequest;
import com.tuoheng.admin.entity.request.emergency.QueryMissionListRequest;
import com.tuoheng.admin.entity.vo.MissionLiveVO;
import com.tuoheng.admin.entity.vo.MissionVO;
import com.tuoheng.common.common.IBaseService;
import com.tuoheng.common.common.OperationEnum;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.JsonResult;

@@ -62,4 +63,18 @@ public interface IMissionService extends IBaseService<ThMission> {
MissionLiveVO live(Integer id);

JsonResult getVideoById(String id);

/**
* 查询任务列表
*
* @return
*/
JsonResult getList(QueryMissionListRequest request);

/**
* 查询应急任务列表
*
* @return
*/
JsonResult getEmergencyList(QueryEmergencyListRequest request);
}

+ 25
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java View File

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

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -13,6 +12,8 @@ import com.tuoheng.admin.entity.domain.*;
import com.tuoheng.admin.entity.request.MissionRequest;
import com.tuoheng.admin.entity.request.MissionQuery;
import com.tuoheng.admin.entity.request.MissionStatusRequest;
import com.tuoheng.admin.entity.request.emergency.QueryEmergencyListRequest;
import com.tuoheng.admin.entity.request.emergency.QueryMissionListRequest;
import com.tuoheng.admin.entity.vo.AirWeatherVO;
import com.tuoheng.admin.entity.vo.LiveChannelVO;
import com.tuoheng.admin.entity.vo.MissionLiveVO;
@@ -22,18 +23,17 @@ import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.service.IDspService;
import com.tuoheng.admin.service.IMissionService;
import com.tuoheng.admin.service.IThInspectionService;
import com.tuoheng.admin.service.mission.query.QueryEmergencyListService;
import com.tuoheng.admin.service.mission.query.QueryMissionListService;
import com.tuoheng.admin.utils.CodeUtil;
import com.tuoheng.admin.utils.TimeUtil;
import com.tuoheng.admin.utils.WeatherUtil;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.common.OperationEnum;
import com.tuoheng.common.config.CommonConfig;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.*;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.mapper.UserMapper;
import com.tuoheng.system.utils.ShiroUtils;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -41,7 +41,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import javax.annotation.Resource;
@@ -79,6 +78,12 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi
@Lazy
private IThInspectionService inspectionService;

@Resource
private QueryMissionListService queryMissionListService;

@Resource
private QueryEmergencyListService queryEmergencyListService;

@Value("${tuoheng.dsp-callback-url:}")
private String dspCallbackUrl;

@@ -406,4 +411,19 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi
return JsonResult.success(liveChannelVo);
}

/**
* 查询任务列表
*
* @return
*/
@Override
public JsonResult getList(QueryMissionListRequest request) {
return queryMissionListService.getList(request);
}

@Override
public JsonResult getEmergencyList(QueryEmergencyListRequest request) {
return queryEmergencyListService.getList(request);
}

}

+ 75
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java View File

@@ -0,0 +1,75 @@
package com.tuoheng.admin.service.mission.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.entity.domain.Camera;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.entity.request.emergency.QueryEmergencyListRequest;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.enums.MissionEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.mapper.CameraMapper;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* 查询应急任务列表业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-13
*/
@Slf4j
@Service
public class QueryEmergencyListService {

@Autowired
private ThMissionMapper thMissionMapper;

public JsonResult getList(QueryEmergencyListRequest request) {
// log.info("进入查询应急任务列表业务");
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();

Integer tenantId = 1;
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询应急任务列表业务:校验失败:{}", result.getMsg());
return result;
}

List<ThMission> missionList = thMissionMapper.selectList(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getMark, MarkEnum.VALID.getCode())
.eq(ThMission::getTenantId, tenantId)
.eq(ObjectUtil.isNotEmpty(request.getAirportFlyType()), ThMission::getAirportFlyType, request.getAirportFlyType())
.in(CollectionUtil.isNotEmpty(request.getStatusList()), ThMission::getStatus, request.getStatusList()));

if (CollectionUtil.isEmpty(missionList)) {
log.info("应急任务列表数据为空");
}
return JsonResult.success(missionList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryEmergencyListRequest request) {
return JsonResult.success();
}

}

+ 66
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryMissionListService.java View File

@@ -0,0 +1,66 @@
package com.tuoheng.admin.service.mission.query;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.request.emergency.QueryMissionListRequest;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.common.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询任务列表业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-13
*/
@Slf4j
@Service
public class QueryMissionListService {

@Autowired
private ThMissionMapper thMissionMapper;

public JsonResult getList(QueryMissionListRequest request) {
// log.info("进入查询任务列表业务");
// User user = ShiroUtils.getUserInfo();
// Integer tenantId = user.getTenantId();

Integer tenantId = 1;
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询任务列表业务:校验失败:{}", result.getMsg());
return result;
}
List<ThMission> missionList = thMissionMapper.selectList(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getMark, MarkEnum.VALID.getCode())
.eq(ThMission::getTenantId, tenantId)
.in(CollectionUtil.isNotEmpty(request.getStatusList()), ThMission::getStatus, request.getStatusList()));

if (CollectionUtil.isEmpty(missionList)) {
log.info("任务列表数据为空");
}
return JsonResult.success(missionList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryMissionListRequest request) {
return JsonResult.success();
}

}

Loading…
Cancel
Save