| New file | 
 |  |  | 
 |  |  | package com.dy.pipIrrRemote.records.controllerAlarmState; | 
 |  |  |  | 
 |  |  | import com.dy.common.aop.SsoAop; | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
 |  |  | import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoActiveCard; | 
 |  |  | import io.swagger.v3.oas.annotations.Operation; | 
 |  |  | import io.swagger.v3.oas.annotations.media.Content; | 
 |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
 |  |  | import io.swagger.v3.oas.annotations.responses.ApiResponse; | 
 |  |  | import io.swagger.v3.oas.annotations.responses.ApiResponses; | 
 |  |  | import io.swagger.v3.oas.annotations.tags.Tag; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.http.MediaType; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @author :WuZeYu | 
 |  |  |  * @Date :2024/7/24  14:22 | 
 |  |  |  * @LastEditTime :2024/7/24  14:22 | 
 |  |  |  * @Description | 
 |  |  |  */ | 
 |  |  | @Slf4j | 
 |  |  | @Tag(name = "控制器报警与状态查询", description = "控制器报警与状态查询") | 
 |  |  | @RestController | 
 |  |  | @RequestMapping(path = "controllerAlarmState") | 
 |  |  | public class ControllerAlarmStateCtrl { | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ControllerAlarmStateSv controllerAlarmStateSv; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据指定条件获取控制器报警与状态列表(历史) | 
 |  |  |      * | 
 |  |  |      * @param vo 查询条件 | 
 |  |  |      * @return 符合条件的控制器报警与状态列表(历史) | 
 |  |  |      */ | 
 |  |  |     @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据") | 
 |  |  |     @ApiResponses(value = { | 
 |  |  |             @ApiResponse( | 
 |  |  |                     responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, | 
 |  |  |                     description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", | 
 |  |  |                     content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, | 
 |  |  |                             schema = @Schema(implementation = VoActiveCard.class))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @GetMapping(path = "/getControllerAlarmStateHistory") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory( ControllerAlarmStateQueryVo vo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateHistory(vo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取控制器报警与状态记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取指定取水口报警与状态列表(历史) | 
 |  |  |      * | 
 |  |  |      * @param vo 相询条件,其中必须赋值取水口ID | 
 |  |  |      * @return 符合条件的控制器报警与状态列表(历史) | 
 |  |  |      */ | 
 |  |  |     @Operation(summary = "获得一页获取指定取水口报警与状态记录", description = "返回一页获取指定取水口报警与状态数据") | 
 |  |  |     @ApiResponses(value = { | 
 |  |  |             @ApiResponse( | 
 |  |  |                     responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, | 
 |  |  |                     description = "返回一页获取指定取水口报警与状态(BaseResponse.content:QueryResultVo[{}])", | 
 |  |  |                     content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, | 
 |  |  |                             schema = @Schema(implementation = VoActiveCard.class))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @GetMapping(path = "/getOneControllerAlarmStateHistory") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getOneControllerAlarmStateHistory(ControllerAlarmStateQueryVo vo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getOneControllerAlarmStateHistory(vo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取获取指定取水口报警与状态记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据指定条件获取控制器报警与状态列表(最新) | 
 |  |  |      * | 
 |  |  |      * @param vo 查询条件 | 
 |  |  |      * @return 符合条件的控制器报警与状态列表(最新) | 
 |  |  |      */ | 
 |  |  |     @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据") | 
 |  |  |     @ApiResponses(value = { | 
 |  |  |             @ApiResponse( | 
 |  |  |                     responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, | 
 |  |  |                     description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])", | 
 |  |  |                     content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, | 
 |  |  |                             schema = @Schema(implementation = VoActiveCard.class))} | 
 |  |  |             ) | 
 |  |  |     }) | 
 |  |  |     @GetMapping(path = "/getControllerAlarmStateLast") | 
 |  |  |     @SsoAop() | 
 |  |  |     public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast( ControllerAlarmStateQueryVo vo) { | 
 |  |  |         try { | 
 |  |  |             QueryResultVo<List<VoControllerAlarmState>> res = controllerAlarmStateSv.getControllerAlarmStateLast(vo); | 
 |  |  |             return BaseResponseUtils.buildSuccess(res); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("获取控制器记录异常", e); | 
 |  |  |             return BaseResponseUtils.buildException(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  | } |