Ver Fonte

计量集抄设备和告警

lin há 3 anos atrás
pai
commit
32ed97431d

+ 2 - 2
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/BasePageDto.java

@@ -13,10 +13,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 @Data
 public class BasePageDto {
 
-    @ApiModelProperty(value = "页码")
+    @ApiModelProperty(value = "页码",example = "1")
     private int pageNum = 1;
 
-    @ApiModelProperty(value = "条数")
+    @ApiModelProperty(value = "条数",example = "15")
     private int pageSize = 15;
 
 }

+ 1 - 4
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/alarm/AlarmTypeDetailsDto.java

@@ -12,7 +12,7 @@ import lombok.Data;
  */
 @Api("报警信息")
 @Data
-public class AlarmTypeDetailsDto extends BasePageDto {
+public class AlarmTypeDetailsDto {
 
     @ApiModelProperty(value = "告警名字")
     private String alarmName;
@@ -26,9 +26,6 @@ public class AlarmTypeDetailsDto extends BasePageDto {
     @ApiModelProperty("结束时间")
     private String endTime;
 
-    @ApiModelProperty(value="场景类型SceneTypeEnum:1.水源 2.水厂 3.泵站 4.管网 ")
-    private Integer sceneType;
-
     @ApiModelProperty("0 : 历史报警 1:实时报警")
     private int state;
 

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/entity/AlarmDetailsEntity.java

@@ -44,7 +44,7 @@ public class AlarmDetailsEntity implements Serializable {
     private String sceneName;
 
     @ApiModelProperty(value = "设备信息")
-    private Integer deviceId;
+    private Long deviceId;
 
     @ApiModelProperty(value = "所属公司")
     private Integer companyOrgId;

+ 0 - 3
zoniot-rmcp/zoniot-rmcp-core/src/main/java/com/zcxk/rmcp/core/mapper/AlarmTypeDetailMapper.xml

@@ -77,9 +77,6 @@
             <if test="dto.state != null">
                 and sad.state = #{dto.state}
             </if>
-            <if test="dto.sceneType != null and dto.sceneType!=''" >
-                and sat.scene_type = #{dto.sceneType}
-            </if>
             <include refid="permissionCondition"></include>
             order by sad.date_create desc
         </where>

+ 5 - 7
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/AlarmTypeDetailsController.java

@@ -4,6 +4,7 @@ package com.zcxk.rmcp.web.controller;
 import com.bz.zoneiot.core.common.pojo.AjaxMessage;
 import com.bz.zoneiot.core.mysql.pageing.Pagination;
 import com.bz.zoneiot.core.utils.export.EasyExcelUtil;
+import com.zcxk.rmcp.api.dto.BasePageDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmDetailsRealTimeDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmTypeDetailsDto;
 import com.zcxk.rmcp.api.vo.alarm.AlarmTypeDetailsEntityVo;
@@ -12,10 +13,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
@@ -34,11 +32,11 @@ public class AlarmTypeDetailsController {
     @Autowired
     private AlarmTypeDetailsService alarmTypeDetailsService;
 
-    @RequestMapping(value="selectPage" , method = RequestMethod.POST)
+    @GetMapping(value="selectPage" )
     @ApiOperation(value = "分页查询报警详情信息")
-    public AjaxMessage selectPage(@RequestBody @Valid AlarmTypeDetailsDto dto){
+    public AjaxMessage selectPage(@Valid AlarmTypeDetailsDto dto, BasePageDto page){
 
-        return AjaxMessage.success(alarmTypeDetailsService.selectPage(dto));
+        return AjaxMessage.success(alarmTypeDetailsService.selectPage(dto,page));
     }
 
     @RequestMapping(value="export" , method = RequestMethod.GET)

+ 4 - 3
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/AlarmTypeDetailsService.java

@@ -2,6 +2,7 @@ package com.zcxk.rmcp.web.service;
 
 
 import com.bz.zoneiot.core.mysql.pageing.Pagination;
+import com.zcxk.rmcp.api.dto.BasePageDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmDetailsAddDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmTypeDetailsDto;
 import com.zcxk.rmcp.api.vo.alarm.AlarmTypeDetailsEntityVo;
@@ -39,11 +40,11 @@ public interface AlarmTypeDetailsService {
     * 分页查询
     * @author Andy
     * @date 17:54 2021/8/17
-    * @param page:
-    * @param alarmDetailsDto:
+    * @param alarmDetailsDto :
+    * @param page :
     * @return com.baomidou.mybatisplus.core.metadata.IPage<AlarmDetailsEntityVo>
     **/
-    Pagination<AlarmTypeDetailsEntityVo> selectPage(AlarmTypeDetailsDto alarmDetailsDto);
+    Pagination<AlarmTypeDetailsEntityVo> selectPage(AlarmTypeDetailsDto alarmDetailsDto, BasePageDto page);
 
 
     /**

+ 4 - 4
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/service/impl/AlarmTypeDetailsServiceImpl.java

@@ -6,8 +6,8 @@ import com.bz.zoneiot.core.common.pojo.Message;
 import com.bz.zoneiot.core.mysql.pageing.Pagination;
 import com.bz.zoneiot.core.oauth2.util.UserUtil;
 
-import com.github.pagehelper.IPage;
 import com.github.pagehelper.PageHelper;
+import com.zcxk.rmcp.api.dto.BasePageDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmDetailsAddDto;
 import com.zcxk.rmcp.api.dto.alarm.AlarmTypeDetailsDto;
 import com.zcxk.rmcp.api.enums.AlarmStateEnum;
@@ -71,9 +71,9 @@ public class AlarmTypeDetailsServiceImpl implements AlarmTypeDetailsService {
     }
 
     @Override
-    public Pagination<AlarmTypeDetailsEntityVo> selectPage(AlarmTypeDetailsDto dto) {
+    public Pagination<AlarmTypeDetailsEntityVo> selectPage(AlarmTypeDetailsDto dto, BasePageDto page) {
         dto.setState(AlarmStateEnum.REALTIME_ALARM.getCode());
-        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
+        PageHelper.startPage(page.getPageNum(),page.getPageSize());
         return new Pagination<>(alarmTypeDetailMapper.selectList(dto, UserUtil.getCurrentUser().getUserCondition()));
     }
 
@@ -183,7 +183,7 @@ public class AlarmTypeDetailsServiceImpl implements AlarmTypeDetailsService {
         alarmDetailsEntity.setTenantId(alarmType.getTenantId());
         alarmDetailsEntity.setAlarmId(Long.parseLong(alarmType.getId().toString()));
         alarmDetailsEntity.setAlarmType(alarmType.getAlarmCategory() == 1 ? "参数报警" : "状态报警");
-        alarmDetailsEntity.setDeviceId(Integer.parseInt(alarmType.getDeviceId().toString()));
+        alarmDetailsEntity.setDeviceId(Long.valueOf(dto.getDeviceId()));
 
         if (alarmType.getAttributeId() != null){
             alarmDetailsEntity.setAttributeId(Integer.parseInt(alarmType.getAttributeId().toString()));