Procházet zdrojové kódy

根据任务id获取巡检轨迹

tags/v1.0.0^2
chengwang před 1 rokem
rodič
revize
71902f8e45
7 změnil soubory, kde provedl 122 přidání a 9 odebrání
  1. +11
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java
  2. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/ResubmitInspectionCodeEnum.java
  3. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/IInspectionService.java
  4. +16
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java
  5. +84
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/execute/ExecuteInspectionService.java
  6. +0
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java
  7. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java

+ 11
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionController.java Zobrazit soubor

@@ -29,7 +29,7 @@ public class InspectionController {
* 查询巡检任务分页列表
*/
@GetMapping("/page/list")
public JsonResult list(@RequestBody QueryInspectionPageListRequest request) {
public JsonResult list(QueryInspectionPageListRequest request) {
log.info("进入查询巡检任务分页列表接口");
return iInspectionService.selectPageList(request);
}
@@ -111,11 +111,20 @@ public class InspectionController {
}

/**
* 删除巡检任务
* 重新提交巡检任务
*/
@PostMapping("/resubmit")
public JsonResult resubmit(@RequestBody EditInspectionRequest editInspectionRequest) {
log.info("进入重新提交任务接口, id={}", editInspectionRequest.getId());
return iInspectionService.resubmit(editInspectionRequest);
}

/**
* 立即执行
*/
@PostMapping("/execute/{id}")
public JsonResult execute(@PathVariable("id") String id) {
log.info("进入立即执行任务接口, id={}", id);
return iInspectionService.execute(id);
}
}

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspection/ResubmitInspectionCodeEnum.java Zobrazit soubor

@@ -27,7 +27,6 @@ public enum ResubmitInspectionCodeEnum {
END_LATITUDE_IS_NULL(1230713, "终点纬度为空"),
INSPECTION_TIME_IS_NULL(1230714, "巡检时间为空"),
INSPECTION_IS_NOT_EXIST(1230715, "任务不存在"),

FAILED_INSPECTION_CANNOT_RESUBMIT(1230716, "非失败的任务不能被重新提交"),
TYPE_IS_NOT_EDIT(1230717, "巡检类型不能被修改"),
INSPECTION_TYPE_IS_NOT_EDIT(1230718, "巡检方式不能被修改"),

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/IInspectionService.java Zobrazit soubor

@@ -85,9 +85,19 @@ public interface IInspectionService {
JsonResult resubmit(EditInspectionRequest editInspectionRequest);

/**
<<<<<<< HEAD
* 获取飞行轨迹
* @param id
* @return
*/
JsonResult findFlightData(String id);
=======
* 立即执行
*
* @param id 任务id
* @return 结果
*/
JsonResult execute(String id);

>>>>>>> 187812e997321373e2dee541777d3ca3493967dd
}

+ 16
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java Zobrazit soubor

@@ -6,6 +6,7 @@ import com.tuoheng.admin.request.inspection.AddInspectionRequest;
import com.tuoheng.admin.request.inspection.EditInspectionRequest;
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest;
import com.tuoheng.admin.service.inspection.add.AddInspectionService;
import com.tuoheng.admin.service.inspection.execute.ExecuteInspectionService;
import com.tuoheng.admin.service.inspection.resubmit.ResubmitInspectionService;
import com.tuoheng.admin.service.inspection.delete.DeleteInspectionService;
import com.tuoheng.admin.service.inspection.query.*;
@@ -58,7 +59,10 @@ public class InspectionServiceImpl implements IInspectionService {

@Autowired
private QueryFindFlightDataService queryFindFlightDataService;

@Autowired
private ExecuteInspectionService executeInspectionService;


/**
* 查询巡检任务分页分页列表
@@ -175,4 +179,15 @@ public class InspectionServiceImpl implements IInspectionService {
public JsonResult findFlightData(String id) {
return queryFindFlightDataService.findFlightData(id);
}

/**
*立即执行
* @param id 任务id
* @return 结果
*/
@Override
public JsonResult execute(String id) {
return executeInspectionService.execute(id);
}

}

+ 84
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/execute/ExecuteInspectionService.java Zobrazit soubor

@@ -0,0 +1,84 @@
package com.tuoheng.admin.service.inspection.execute;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.InspectionTypeEnum;
import com.tuoheng.admin.enums.code.inspection.ResubmitInspectionCodeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.inspection.EditInspectionRequest;
import com.tuoheng.admin.utils.ShiroUtils;
import com.tuoheng.common.core.utils.DateUtils;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 立即执行任务业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-12-01
*/
@Slf4j
@Service
public class ExecuteInspectionService {

@Autowired
private UserMapper userMapper;

@Autowired
private DeptMapper deptMapper;

@Autowired
private RoadInformationMapper roadInformationMapper;

@Autowired
private SectionMapper sectionMapper;

@Autowired
private InspectionMapper inspectionMapper;

/**
* 重新提交任务
*
* @return
*/
public JsonResult execute(String id) {
log.info("进入立即执行任务业务");
String userId = ShiroUtils.getUserId();
JsonResult result = this.check(id);
if (0 != result.getCode()) {
log.info("立即执行任务业务:校验参数失败:{}", result.getMsg());
return result;
}

Inspection inspection = (Inspection) result.getData();


log.info("立即执行任务业务:重新提交任务成功:{}", inspection);
return JsonResult.success(inspection);
}

/**
* 检查参数
* @param id
* @return
*/
private JsonResult check(String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(ResubmitInspectionCodeEnum.ID_IS_NULL.getCode(), ResubmitInspectionCodeEnum.ID_IS_NULL.getMsg());
}
Inspection inspection = inspectionMapper.selectById(id);
if (null == inspection) {
return JsonResult.error(ResubmitInspectionCodeEnum.INSPECTION_IS_NOT_EXIST.getCode(), ResubmitInspectionCodeEnum.INSPECTION_IS_NOT_EXIST.getMsg());
}
return JsonResult.success(inspection);
}


}

+ 0
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java Zobrazit soubor

@@ -1,16 +1,13 @@
package com.tuoheng.admin.service.inspection.query;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
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.enums.UserTypeEnum;
import com.tuoheng.admin.enums.code.dept.QueryDeptChildListCodeEnum;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum;
import com.tuoheng.admin.mapper.DeptMapper;
import com.tuoheng.admin.mapper.InspectionFileMapper;
@@ -25,7 +22,6 @@ import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/resubmit/ResubmitInspectionService.java Zobrazit soubor

@@ -22,7 +22,7 @@ import org.springframework.stereotype.Service;
*
* @author wanjing
* @team tuoheng
* @date 2022-12-201
* @date 2022-12-01
*/
@Slf4j
@Service

Načítá se…
Zrušit
Uložit