205 lines
8.9 KiB
Java
205 lines
8.9 KiB
Java
|
|
package com.rzyc.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import com.common.utils.model.SingleResult;
|
||
|
|
import com.rzyc.config.MethodAnnotation;
|
||
|
|
import com.rzyc.config.RedisUtil;
|
||
|
|
import com.rzyc.model.EntEmEquipment;
|
||
|
|
import com.rzyc.model.EntEmExpert;
|
||
|
|
import com.rzyc.model.EntEmReservePlan;
|
||
|
|
import com.rzyc.model.dto.EntEmEquipmentDto;
|
||
|
|
import com.rzyc.model.dto.EntEmExpertDto;
|
||
|
|
import com.rzyc.model.dto.EntEmRehearsalDto;
|
||
|
|
import com.rzyc.model.dto.EntEmReservePlanDto;
|
||
|
|
import com.rzyc.service.PcBusinessService;
|
||
|
|
import io.swagger.annotations.Api;
|
||
|
|
import io.swagger.annotations.ApiImplicitParam;
|
||
|
|
import io.swagger.annotations.ApiImplicitParams;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||
|
|
import org.springframework.stereotype.Controller;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.validation.Valid;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author Xuwanxin
|
||
|
|
* @date 2022/11/10
|
||
|
|
*/
|
||
|
|
@Api(tags = "企业端应急资源接口")
|
||
|
|
@CrossOrigin("*")
|
||
|
|
@RequestMapping("entEmEquipment")
|
||
|
|
@Controller
|
||
|
|
@Validated
|
||
|
|
public class EmergencyEquipmentController {
|
||
|
|
|
||
|
|
PcBusinessService pcBusinessService;
|
||
|
|
|
||
|
|
RedisUtil redisUtil;
|
||
|
|
|
||
|
|
public EmergencyEquipmentController(PcBusinessService pcBusinessService, RedisUtil redisUtil) {
|
||
|
|
this.pcBusinessService = pcBusinessService;
|
||
|
|
this.redisUtil = redisUtil;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急资源列表
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急资源列表", notes = "应急资源列表")
|
||
|
|
@GetMapping(value = "/entEmEquipmentList")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmEquipmentList','entEmEquipmentList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmEquipmentList","entEmEquipmentList:update"},name = "应急资源列表")
|
||
|
|
@ApiImplicitParams({
|
||
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "pageSize", value = "page",required = true, dataType = "string"),
|
||
|
|
})
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult<List<EntEmEquipment>> entEmEquipmentList(@RequestParam(required = true) String enterpriseId,
|
||
|
|
@RequestParam(required = true)Integer page,
|
||
|
|
@RequestParam(required = true)Integer pageSize)throws Exception{
|
||
|
|
return pcBusinessService.entEmEquipmentList(enterpriseId,page,pageSize);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急资源修改
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急资源修改", notes = "应急资源修改")
|
||
|
|
@PostMapping(value = "/entEmEquipmentUpdate")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmEquipmentList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmEquipmentList:update"},name = "应急资源修改")
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult entEmEquipmentUpdate(@RequestBody@Valid EntEmEquipmentDto entEmEquipmentDto)throws Exception{
|
||
|
|
return pcBusinessService.entEmEquipmentUpdate(entEmEquipmentDto);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急专家列表
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急专家列表", notes = "应急专家列表")
|
||
|
|
@GetMapping(value = "/entEmExpertList")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmExpertList','entEmExpertList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmExpertList","entEmExpertList:update"},name = "应急专家列表")
|
||
|
|
@ApiImplicitParams({
|
||
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "pageSize", value = "page",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "entEmExpertClass", value = "entEmExpertClass",required = false, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "entEmExpertCategory", value = "entEmExpertCategory",required = false, dataType = "string"),
|
||
|
|
})
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult<List<EntEmExpert>> entEmExpertList(@RequestParam(required = true)String enterpriseId,
|
||
|
|
@RequestParam(required = true)Integer page,
|
||
|
|
@RequestParam(required = true)Integer pageSize,
|
||
|
|
String entEmExpertClass,
|
||
|
|
String entEmExpertCategory)throws Exception{
|
||
|
|
return pcBusinessService.entEmExpertList(enterpriseId,page,pageSize,entEmExpertClass,entEmExpertCategory);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急专家修改
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急专家修改", notes = "应急专家修改")
|
||
|
|
@PostMapping(value = "/entEmExpertUpdate")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmExpertList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmExpertList:update"},name = "应急专家修改")
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult entEmExpertUpdate(@RequestBody@Valid EntEmExpertDto entEmExpertDto)throws Exception{
|
||
|
|
return pcBusinessService.entEmExpertUpdate(entEmExpertDto);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急预案
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急预案列表", notes = "应急预案列表")
|
||
|
|
@GetMapping(value = "/entEmReservePlanList")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmReservePlanList','entEmReservePlanList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmReservePlanList","entEmReservePlanList:update"},name = "应急预案列表")
|
||
|
|
@ApiImplicitParams({
|
||
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "pageSize", value = "page",required = true, dataType = "string"),
|
||
|
|
})
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult<List<EntEmReservePlan>> entEmReservePlanList(@RequestParam(required = true)String enterpriseId,
|
||
|
|
@RequestParam(required = true)Integer page,
|
||
|
|
@RequestParam(required = true)Integer pageSize)throws Exception{
|
||
|
|
return pcBusinessService.entEmReservePlanList(enterpriseId,page,pageSize);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急预案修改
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急预案修改", notes = "应急预案修改")
|
||
|
|
@PostMapping(value = "/entEmReservePlanUpdate")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmReservePlanList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmReservePlanList:update"},name = "应急预案修改")
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult entEmReservePlanUpdate(@RequestBody@Valid EntEmReservePlanDto entEmReservePlanDto)throws Exception{
|
||
|
|
return pcBusinessService.entEmReservePlanUpdate(entEmReservePlanDto);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急演练
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急演练列表", notes = "应急演练列表")
|
||
|
|
@GetMapping(value = "/entEmRehearsalList")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmRehearsalList','entEmRehearsalList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmRehearsalList","entEmRehearsalList:update"},name = "应急演练列表")
|
||
|
|
@ApiImplicitParams({
|
||
|
|
@ApiImplicitParam(name = "enterpriseId", value = "企业id",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "page", value = "page",required = true, dataType = "string"),
|
||
|
|
@ApiImplicitParam(name = "pageSize", value = "page",required = true, dataType = "string"),
|
||
|
|
})
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult<List<EntEmReservePlan>> entEmRehearsalList(@RequestParam(required = true)String enterpriseId,
|
||
|
|
@RequestParam(required = true)Integer page,
|
||
|
|
@RequestParam(required = true)Integer pageSize)throws Exception{
|
||
|
|
return pcBusinessService.entEmRehearsalList(enterpriseId,page,pageSize);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 应急演练修改
|
||
|
|
* @return list
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
@ApiOperation(value = "应急演练修改", notes = "应急演练修改")
|
||
|
|
@PostMapping(value = "/entEmRehearsalUpdate")
|
||
|
|
@PreAuthorize("hasAnyAuthority('entEmRehearsalList:update')")
|
||
|
|
@MethodAnnotation(authorizations = {"entEmRehearsalList:update"},name = "应急演练修改")
|
||
|
|
@ResponseBody
|
||
|
|
public SingleResult entEmRehearsalUpdate(@RequestBody@Valid EntEmRehearsalDto entEmRehearsalDto)throws Exception{
|
||
|
|
return pcBusinessService.entEmRehearsalUpdate(entEmRehearsalDto);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|