|
|
@@ -1,6 +1,7 @@
|
|
|
package com.zksy.web.controller.gasbasic;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.zksy.base.service.DrillSimulationService;
|
|
|
import com.zksy.base.domain.*;
|
|
|
import com.zksy.base.mapper.*;
|
|
|
import com.zksy.common.annotation.Anonymous;
|
|
|
@@ -29,6 +30,8 @@ public class DrillSimulationController {
|
|
|
private DrillSimulationLogMapper logMapper;
|
|
|
@Autowired
|
|
|
private DrillSimulationResultMapper resultMapper;
|
|
|
+ @Autowired
|
|
|
+ private DrillSimulationService drillSimulationService;
|
|
|
|
|
|
@GetMapping("/project")
|
|
|
@Anonymous
|
|
|
@@ -50,25 +53,86 @@ public class DrillSimulationController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/scene/{projectId}") @Anonymous
|
|
|
- public AjaxResult scene(@PathVariable Long projectId) { return AjaxResult.success(sceneMapper.selectList(new LambdaQueryWrapper<DrillSimulationScene>().eq(DrillSimulationScene::getProjectId, projectId))); }
|
|
|
- @PostMapping("/scene") @Anonymous public AjaxResult saveScene(@RequestBody DrillSimulationScene s) { if (s.getId() != null) sceneMapper.updateById(s); else sceneMapper.insert(s); return AjaxResult.success(); }
|
|
|
- @DeleteMapping("/scene/{id}") @Anonymous public AjaxResult deleteScene(@PathVariable Long id) { sceneMapper.deleteById(id); return AjaxResult.success(); }
|
|
|
+ @GetMapping("/scene/{projectId}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult scene(@PathVariable Long projectId) {
|
|
|
+ return AjaxResult.success(sceneMapper.selectList(new LambdaQueryWrapper<DrillSimulationScene>().eq(DrillSimulationScene::getProjectId, projectId)));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/scene")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult saveScene(@RequestBody DrillSimulationScene s) {
|
|
|
+ if (s.getId() != null) sceneMapper.updateById(s);
|
|
|
+ else sceneMapper.insert(s);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/scene/{id}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult deleteScene(@PathVariable Long id) {
|
|
|
+ sceneMapper.deleteById(id);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/event/{projectId}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult event(@PathVariable Long projectId) {
|
|
|
+ return AjaxResult.success(eventMapper.selectList(new LambdaQueryWrapper<DrillSimulationEvent>().eq(DrillSimulationEvent::getProjectId, projectId)));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/event")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult saveEvent(@RequestBody DrillSimulationEvent e) {
|
|
|
+ eventMapper.insert(e);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/event/{id}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult deleteEvent(@PathVariable Long id) {
|
|
|
+ eventMapper.deleteById(id);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/role/{projectId}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult role(@PathVariable Long projectId) {
|
|
|
+ return AjaxResult.success(roleMapper.selectList(new LambdaQueryWrapper<DrillSimulationRole>().eq(DrillSimulationRole::getProjectId, projectId)));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/role")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult saveRole(@RequestBody DrillSimulationRole r) {
|
|
|
+ roleMapper.insert(r);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/role/{id}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult deleteRole(@PathVariable Long id) {
|
|
|
+ roleMapper.deleteById(id);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
|
|
|
- @GetMapping("/event/{projectId}") @Anonymous
|
|
|
- public AjaxResult event(@PathVariable Long projectId) { return AjaxResult.success(eventMapper.selectList(new LambdaQueryWrapper<DrillSimulationEvent>().eq(DrillSimulationEvent::getProjectId, projectId))); }
|
|
|
- @PostMapping("/event") @Anonymous public AjaxResult saveEvent(@RequestBody DrillSimulationEvent e) { eventMapper.insert(e); return AjaxResult.success(); }
|
|
|
- @DeleteMapping("/event/{id}") @Anonymous public AjaxResult deleteEvent(@PathVariable Long id) { eventMapper.deleteById(id); return AjaxResult.success(); }
|
|
|
+ @GetMapping("/task/{projectId}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult task(@PathVariable Long projectId) {
|
|
|
+ return AjaxResult.success(taskMapper.selectList(new LambdaQueryWrapper<DrillSimulationTask>().eq(DrillSimulationTask::getProjectId, projectId)));
|
|
|
+ }
|
|
|
|
|
|
- @GetMapping("/role/{projectId}") @Anonymous
|
|
|
- public AjaxResult role(@PathVariable Long projectId) { return AjaxResult.success(roleMapper.selectList(new LambdaQueryWrapper<DrillSimulationRole>().eq(DrillSimulationRole::getProjectId, projectId))); }
|
|
|
- @PostMapping("/role") @Anonymous public AjaxResult saveRole(@RequestBody DrillSimulationRole r) { roleMapper.insert(r); return AjaxResult.success(); }
|
|
|
- @DeleteMapping("/role/{id}") @Anonymous public AjaxResult deleteRole(@PathVariable Long id) { roleMapper.deleteById(id); return AjaxResult.success(); }
|
|
|
+ @PostMapping("/task")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult saveTask(@RequestBody DrillSimulationTask t) {
|
|
|
+ taskMapper.insert(t);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
|
|
|
- @GetMapping("/task/{projectId}") @Anonymous
|
|
|
- public AjaxResult task(@PathVariable Long projectId) { return AjaxResult.success(taskMapper.selectList(new LambdaQueryWrapper<DrillSimulationTask>().eq(DrillSimulationTask::getProjectId, projectId))); }
|
|
|
- @PostMapping("/task") @Anonymous public AjaxResult saveTask(@RequestBody DrillSimulationTask t) { taskMapper.insert(t); return AjaxResult.success(); }
|
|
|
- @DeleteMapping("/task/{id}") @Anonymous public AjaxResult deleteTask(@PathVariable Long id) { taskMapper.deleteById(id); return AjaxResult.success(); }
|
|
|
+ @DeleteMapping("/task/{id}")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult deleteTask(@PathVariable Long id) {
|
|
|
+ taskMapper.deleteById(id);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
|
|
|
@GetMapping("/log/{projectId}")
|
|
|
@Anonymous
|
|
|
@@ -88,4 +152,11 @@ public class DrillSimulationController {
|
|
|
public AjaxResult result(@PathVariable Long projectId) {
|
|
|
return AjaxResult.success(resultMapper.selectOne(new LambdaQueryWrapper<DrillSimulationResult>().eq(DrillSimulationResult::getProjectId, projectId)));
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/process")
|
|
|
+ @Anonymous
|
|
|
+ @ApiOperation("根据项目类型批量触发设备告警")
|
|
|
+ public AjaxResult process(@RequestParam Long projectId, @RequestParam String action, @RequestParam String category) {
|
|
|
+ return AjaxResult.success(drillSimulationService.triggerAlarm(category));
|
|
|
+ }
|
|
|
}
|