package com.zoniot.ccrc.controller.system; import com.zoniot.ccrc.commom.model.AjaxMessage; import com.zoniot.ccrc.commom.model.Pagination; import com.zoniot.ccrc.commom.model.ResultStatus; import com.zoniot.ccrc.dto.BuildingSelectDto; import com.zoniot.ccrc.dto.WarningLogDto; import com.zoniot.ccrc.service.WarningLogService; 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.format.annotation.DateTimeFormat; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.time.LocalDateTime; import java.util.List; @Controller @ResponseBody @RequestMapping("system/warningLog") @Api(tags = "预警记录") public class WarningLogController { @Autowired private WarningLogService warningLogService; @GetMapping("getList") @ApiOperation(value = "查询预警记录列表") public AjaxMessage> getList( @ApiParam(value = "设备ID", required = false) @RequestParam(required = false) Long deviceId, @ApiParam(value = "场景ID", required = false) @RequestParam(required = false) Integer channelId, @ApiParam(value = "设备编号/电子号", required = false) @RequestParam(required = false) String deviceNo, @ApiParam(value = "预警类型 1:较上日用水量激增30% 2:连续无用水量超过7天", required = false) @RequestParam(required = false) Integer warningType, @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String clientName, @ApiParam(value = "反馈状态 0:待反馈 1:已确认无异常 2:已反馈信息", required = false) @RequestParam(required = false) Integer feedbackStatus, @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate, @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate, @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer provinceId, @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer cityId, @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer regionId, @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer communityId, @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId, @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum, @ApiParam(value = "条数,非必传,默认15条", required = false, defaultValue = "15") @RequestParam(required = false, defaultValue = "15") int pageSize ){ Pagination pageInfo = warningLogService.getList( deviceId,channelId,deviceNo,warningType,clientName,feedbackStatus,provinceId,cityId,regionId,communityId,buildingId, startDate,endDate, pageNum, pageSize); return new AjaxMessage<>(ResultStatus.OK, pageInfo); } @GetMapping("getAreaList") @ApiOperation(value = "查询预警记录区域列表") public AjaxMessage> getAreaList( @ApiParam(value = "场景ID", required = false) @RequestParam(required = false) Integer channelId, @ApiParam(value = "设备编号/电子号", required = false) @RequestParam(required = false) String deviceNo, @ApiParam(value = "预警类型 1:较上日用水量激增30% 2:连续无用水量超过7天", required = false) @RequestParam(required = false) Integer warningType, @ApiParam(value = "客户名称", required = false) @RequestParam(required = false) String clientName, @ApiParam(value = "反馈状态 0:待反馈 1:已确认无异常 2:已反馈信息", required = false) @RequestParam(required = false) Integer feedbackStatus, @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate, @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate ){ List list = warningLogService.getAreaList( channelId,deviceNo,warningType,clientName,feedbackStatus,startDate,endDate ); return new AjaxMessage<>(ResultStatus.OK, list); } }