济菏高速数据中心代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

169 lines
6.3 KiB

package com.zc.business.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.zc.business.domain.*;
import com.zc.business.service.DcEmergencyPlansService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* 事件预案Controller
*
* @author wangjiabao
* @date 2024-02-21
*/
@Api(tags = "事件预案")
@RestController
@RequestMapping("/business/plans")
public class DcEmergencyPlansController extends BaseController {
@Autowired
private DcEmergencyPlansService dcEmergencyPlansService;
/**
* 交通事件-根据事件数据查询事件预案列表
*/
@ApiOperation("交通事件-根据事件数据查询事件预案列表")
//@PreAuthorize("@ss.hasPermi('business:plans:list')")
@PostMapping("/list/event/type")
public AjaxResult listByEventType(@RequestBody DcEvent dcEvent) {
List<DcEmergencyPlans> dcEmergencyPlansList = dcEmergencyPlansService.selectDcEmergencyPlansByEventType(dcEvent);
dcEmergencyPlansService.dispositionDeviceContent(dcEmergencyPlansList,dcEvent);
return AjaxResult.success(dcEmergencyPlansList);
}
/**
* 设备管控-确认按钮生成内容
*/
@ApiOperation("设备管控-确认按钮生成内容")
// @PreAuthorize("@ss.hasPermi('business:plans:list')")
@PostMapping("/list/event/emergencyPlans")
public AjaxResult switchIntelligentPublishingToContent(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.confirmButtonToGenerateContent(dcEventAnDcEmergencyPlans,dcEventAnDcEmergencyPlans.getDcEvent()));
}
/**
* 交通事件确定
*/
@ApiOperation("交通事件确定")
//@PreAuthorize("@ss.hasPermi('business:plans:edit')")
@PostMapping("/event/confirm")
public AjaxResult eventConfirm(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.executionEventConfirmation(dcEventAnDcEmergencyPlans));
}
/**
* 查询事件预案列表
*/
@ApiOperation("查询事件预案列表")
// @PreAuthorize("@ss.hasPermi('business:plans:list')")
@GetMapping("/list")
public TableDataInfo list(DcEmergencyPlans dcEmergencyPlans) {
startPage();
List<DcEmergencyPlans> list = dcEmergencyPlansService.selectDcEmergencyPlansList(dcEmergencyPlans);
return getDataTable(list);
}
/**
* 根据事件预案id查询事件预案列表
*/
@ApiOperation("根据事件预案id查询事件预案列表")
// @PreAuthorize("@ss.hasPermi('business:plans:list')")
@GetMapping("/list/{id}")
public AjaxResult list(@PathVariable @ApiParam(name = "id", value = "事件预案id", required = true) Integer id) {
DcEmergencyPlans dcEmergencyPlans = dcEmergencyPlansService.selectDcEmergencyPlans(id);
return AjaxResult.success(dcEmergencyPlans);
}
/**
* 根据事件id-查询预案事件关联表
*/
@ApiOperation("根据事件id-查询预案事件关联表")
@GetMapping("/event/assoc/{id}")
public AjaxResult eventConfirmByEventId(@PathVariable("id") String id) {
return AjaxResult.success(dcEmergencyPlansService.selectEventPlanAssocByEventId(id));
}
/**
* 根据id-查询预案事件关联表
*/
@ApiOperation("根据id-查询预案事件关联表")
@GetMapping("/event/assocId/{assocId}")
public AjaxResult eventConfirmById(@PathVariable("assocId") Long assocId) {
return AjaxResult.success(dcEmergencyPlansService.selectEventPlanAssocById(assocId));
}
/**
* 新增事件预案
*/
@ApiOperation("新增预案")
//@PreAuthorize("@ss.hasPermi('business:plans:add')")
@PostMapping
public AjaxResult add(@RequestBody DcEmergencyPlans dcEmergencyPlans) {
return dcEmergencyPlansService.insertDcEmergencyPlans(dcEmergencyPlans);
}
/**
* 修改事件预案
*/
@ApiOperation("修改预案")
// @PreAuthorize("@ss.hasPermi('business:plans:edit')")
@PutMapping
public AjaxResult update(@RequestBody DcEmergencyPlans dcEmergencyPlans) {
return dcEmergencyPlansService.updateDcEmergencyPlans(dcEmergencyPlans);
}
/**
* 批量删除事件预案
*/
@ApiOperation("批量删除预案")
// @PreAuthorize("@ss.hasPermi('business:plans:remove')")
@DeleteMapping("/{ids}")
public AjaxResult update(@PathVariable String[] ids) {
return toAjax(dcEmergencyPlansService.deleteDcEmergencyPlans(ids));
}
/*************************************** 以下是暂时不用,但未来可能会用的接口 ***************************/
/**
* 交通事件-情报板自动生成文字
*/
// @ApiOperation("交通事件-情报板自动生成文字")
@PostMapping("/event/automatic")
public AjaxResult eventAutomaticGeneration(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.eventAutomaticGeneration(dcEventAnDcEmergencyPlans));
}
/**
* 交通事件-情报板确认回显原始模板
*/
// @ApiOperation("交通事件-情报板确认回显原始模板")
// @PreAuthorize("@ss.hasPermi('business:plans:list')")
@PostMapping("/event/board/confirm")
public AjaxResult eventBoardConfirm(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.eventBoardConfirm(dcEventAnDcEmergencyPlans));
}
/**
* 交通事件-根据事件、单个执行操作筛选设备
*/
// @ApiOperation("交通事件-根据事件、单个执行操作筛选设备")
@PostMapping("/list/event/deviceList")
public AjaxResult selectDeviceListByEventDcExecuteAction(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.selectDeviceListByEventDcExecuteAction(dcEventAnDcEmergencyPlans));
}
}