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.EntEmRehearsal; 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.apache.ibatis.annotations.Param; 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 = "pageSize",required = true, dataType = "string"), @ApiImplicitParam(name = "resourceType", value = "物质类型",required = false, dataType = "string"), }) @ResponseBody public SingleResult> entEmEquipmentList(@RequestParam(required = true) String enterpriseId, @RequestParam(required = true)Integer page, @RequestParam(required = true)Integer pageSize, String resourceType)throws Exception{ return pcBusinessService.entEmEquipmentList(enterpriseId,page,pageSize,resourceType); } /** * 应急资源修改 * @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> 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 = "pageSize",required = true, dataType = "string"), @ApiImplicitParam(name = "entEmReservePlanName", value = "预案名",required = false, dataType = "string") }) @ResponseBody public SingleResult> entEmReservePlanList(@RequestParam(required = true)String enterpriseId, @RequestParam(required = true)Integer page, @RequestParam(required = true)Integer pageSize, String entEmReservePlanName)throws Exception{ return pcBusinessService.entEmReservePlanList(enterpriseId,page,pageSize,entEmReservePlanName); } /** * 应急预案修改 * @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 = "pageSize",required = true, dataType = "string"), @ApiImplicitParam(name = "entEmRehearsalProject", value = "项目",required = false, dataType = "string") }) @ResponseBody public SingleResult> entEmRehearsalList(@RequestParam(required = true)String enterpriseId, @RequestParam(required = true)Integer page, @RequestParam(required = true)Integer pageSize, String entEmRehearsalProject)throws Exception{ return pcBusinessService.entEmRehearsalList(enterpriseId,page,pageSize,entEmRehearsalProject); } /** * 应急演练修改 * @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); } /** * 应急演练删除 * @return Data * @throws Exception */ @ApiOperation(value = "应急演练删除", notes = "应急演练删除") @GetMapping(value = "/entEmRehearsalDelete") @PreAuthorize("hasAnyAuthority('entEmRehearsalList:delete')") @MethodAnnotation(authorizations = {"entEmRehearsalList:delete"},name = "应急演练删除") @ApiImplicitParams({ @ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"), }) @ResponseBody public SingleResult entEmRehearsalDelete(@RequestParam("id") String id)throws Exception{ return pcBusinessService.entEmRehearsalDelete(id); } /** * 应急预案删除 * @return Data * @throws Exception */ @ApiOperation(value = "应急预案删除", notes = "应急预案删除") @GetMapping(value = "/entEmReservePlanDelete") @PreAuthorize("hasAnyAuthority('entEmReservePlanList:delete')") @MethodAnnotation(authorizations = {"entEmReservePlanList:delete"},name = "应急预案删除") @ApiImplicitParams({ @ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"), }) @ResponseBody public SingleResult entEmReservePlanDelete(@RequestParam("id") String id)throws Exception{ return pcBusinessService.entEmReservePlanDelete(id); } /** * 应急专家删除 * @return Data * @throws Exception */ @ApiOperation(value = "应急专家删除", notes = "应急专家删除") @GetMapping(value = "/entEmExpertDelete") @PreAuthorize("hasAnyAuthority('entEmExpertList:delete')") @MethodAnnotation(authorizations = {"entEmExpertList:delete"},name = "应急专家删除") @ApiImplicitParams({ @ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"), }) @ResponseBody public SingleResult entEmExpertDelete(@RequestParam("id") String id)throws Exception{ return pcBusinessService.entEmExpertDelete(id); } /** * 应急资源删除 * @return Data * @throws Exception */ @ApiOperation(value = "应急资源删除", notes = "应急资源删除") @GetMapping(value = "/entEmEquipmentDelete") @PreAuthorize("hasAnyAuthority('entEmEquipmentList:delete')") @MethodAnnotation(authorizations = {"entEmEquipmentList:delete"},name = "应急资源删除") @ApiImplicitParams({ @ApiImplicitParam(name = "主键", value = "id",required = true, dataType = "string"), }) @ResponseBody public SingleResult entEmEquipmentDelete(@RequestParam("id") String id)throws Exception{ return pcBusinessService.entEmEquipmentDelete(id); } }