Optimize route algorithm beforehand
This commit is contained in:
parent
85fc56541f
commit
c832425f1e
@ -13,9 +13,8 @@ import com.zhangy.skyeye.jm.dto.JmJobQueryDTO;
|
|||||||
import com.zhangy.skyeye.jm.dto.JmJobUpdDTO;
|
import com.zhangy.skyeye.jm.dto.JmJobUpdDTO;
|
||||||
import com.zhangy.skyeye.jm.entity.JmJob;
|
import com.zhangy.skyeye.jm.entity.JmJob;
|
||||||
import com.zhangy.skyeye.jm.service.JmJobService;
|
import com.zhangy.skyeye.jm.service.JmJobService;
|
||||||
import com.zhangy.skyeye.jm.service.JmJobStatusService;
|
|
||||||
import com.zhangy.skyeye.publics.consts.ExecStatusEnum;
|
import com.zhangy.skyeye.publics.consts.ExecStatusEnum;
|
||||||
import com.zhangy.skyeye.sar.service.ISarControlService;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -28,26 +27,21 @@ import java.util.Collections;
|
|||||||
@Validated
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/sar/job")
|
@RequestMapping("/sar/job")
|
||||||
|
@Slf4j
|
||||||
public class JmJobController {
|
public class JmJobController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JmJobService jobService;
|
private JmJobService jobService;
|
||||||
|
|
||||||
@Autowired
|
/**
|
||||||
private ISarControlService controlInfoService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private JmJobStatusService sarJobStatusService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/page")
|
@RequestMapping("/page")
|
||||||
public Object selectPage(@Valid @RequestBody JmJobPageDTO param) {
|
public Object selectPage(@Valid @RequestBody JmJobPageDTO param) {
|
||||||
return jobService.selectPage(param);
|
return jobService.selectPage(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表查询
|
* 列表查询
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@ -59,8 +53,8 @@ public class JmJobController {
|
|||||||
public Object selectExecJobs(@Valid @RequestBody JmJobQueryDTO param) {
|
public Object selectExecJobs(@Valid @RequestBody JmJobQueryDTO param) {
|
||||||
return jobService.selectExecJobs(param);
|
return jobService.selectExecJobs(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询详情
|
* 查询详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
@ -93,7 +87,6 @@ public class JmJobController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
|
||||||
*/
|
*/
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public Object update(@Valid @RequestBody JmJobUpdDTO param) {
|
public Object update(@Valid @RequestBody JmJobUpdDTO param) {
|
||||||
@ -119,6 +112,7 @@ public class JmJobController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始执行任务
|
* 开始执行任务
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/start")
|
@GetMapping("/start")
|
||||||
@ -126,7 +120,7 @@ public class JmJobController {
|
|||||||
// 查询执行任务的无人机
|
// 查询执行任务的无人机
|
||||||
JmJobDTO job = jobService.selectDetail(id);
|
JmJobDTO job = jobService.selectDetail(id);
|
||||||
if (job == null) {
|
if (job == null) {
|
||||||
throw ServiceException.noLog("找不到任务,id=" + job.getId());
|
throw ServiceException.noLog("找不到任务,id=" + id);
|
||||||
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) != ExecStatusEnum.NOT) {
|
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) != ExecStatusEnum.NOT) {
|
||||||
throw ServiceException.noLog("任务状态不是未执行,无法起飞");
|
throw ServiceException.noLog("任务状态不是未执行,无法起飞");
|
||||||
}
|
}
|
||||||
@ -136,6 +130,7 @@ public class JmJobController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存前清理ID,重新生成
|
* 保存前清理ID,重新生成
|
||||||
|
*
|
||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
private void clearId(JmJobDTO e) {
|
private void clearId(JmJobDTO e) {
|
||||||
@ -151,7 +146,7 @@ public class JmJobController {
|
|||||||
});
|
});
|
||||||
e.getPointList().forEach(arr -> arr.forEach(p -> p.setId(null)));
|
e.getPointList().forEach(arr -> arr.forEach(p -> p.setId(null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user