Procházet zdrojové kódy

宁夏分公司代码修改

shilin před 4 měsíci
rodič
revize
d27cc1740f

+ 26 - 0
alarm-web/src/main/java/com/gyee/alarm/controller/AlarmHistoryController.java

@@ -91,6 +91,32 @@ public class AlarmHistoryController {
 
     }
 
+
+    @GetMapping(value = "/history/selectByWtIsNotClose")
+    @ApiOperation(value = "未完成报警信息查询", notes = "未完成报警信息查询")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "begin", value = "开始时间", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "end", value = "结束时间", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "alarmType", value = "报警类型 booststation:升压站报警,windturbine:设备报警,custom:自定义报警", required = true, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "stationid", value = "场站编号", required = true, dataType = "string", paramType = "query")
+           })
+    public AjaxResult selectByWtIsNotClose(
+            @RequestParam(value = "begin", required = true) String begin,
+            @RequestParam(value = "end", required = true) String end,
+            @RequestParam(value = "alarmType", required = false) String alarmType,
+            @RequestParam(value = "stationid", required = false) String stationid
+    ) throws Exception {
+
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date beginDate = df.parse(begin);
+        Date endDate = df.parse(end);
+
+        List<String> ls = alarmHistoryService.selectByWtIsNotClose(beginDate.getTime(), endDate.getTime(), alarmType, stationid);
+        return AjaxResult.successData(AjaxStatus.success.code, ls);
+
+    }
+
     @GetMapping(value = "/history/findAlarmByTypelist")
     @ApiOperation(value = "获取升压站、设备、自定义报警报警信息查询", notes = "报警信息查询")
     @ApiImplicitParams({

+ 6 - 5
alarm-web/src/main/java/com/gyee/alarm/controller/ProEconShutdownEvent2Controller.java

@@ -9,6 +9,7 @@ import com.gyee.alarm.model.auto.ProBasicEquipmentPoint;
 import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
 import com.gyee.alarm.model.vo.AjaxResult;
 import com.gyee.alarm.model.vo.AjaxStatus;
+import com.gyee.alarm.model.vo.ShutdownEventVo;
 import com.gyee.alarm.service.auto.IProEconShutdownEvent2Service;
 import com.gyee.alarm.util.StringUtils;
 import io.swagger.annotations.ApiImplicitParam;
@@ -94,7 +95,7 @@ public class ProEconShutdownEvent2Controller {
     })
     public AjaxResult queryShutdownEvent2ByType(String wpId, String modelId,String begin,String end) throws ParseException {
 
-        List<ProEconShutdownEvent2> vos=new ArrayList();
+        List<ShutdownEventVo> vos=new ArrayList();
 
 
         if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
@@ -127,7 +128,7 @@ public class ProEconShutdownEvent2Controller {
     })
     public AjaxResult queryShutdownEvent2ByDay(String wpId, String modelId,String begin,String end) throws ParseException {
 
-        List<ProEconShutdownEvent2> vos=new ArrayList();
+        List<ShutdownEventVo> vos=new ArrayList();
 
 
         if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
@@ -160,7 +161,7 @@ public class ProEconShutdownEvent2Controller {
     })
     public AjaxResult queryShutdownEvent2ByMonth(String wpId, String modelId,String begin,String end) throws ParseException {
 
-        List<ProEconShutdownEvent2> vos=new ArrayList();
+        List<ShutdownEventVo> vos=new ArrayList();
 
 
         if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
@@ -195,13 +196,13 @@ public class ProEconShutdownEvent2Controller {
 
 
 
-        Map<String,List<ProEconShutdownEvent2>> map=new HashMap<>();
+        Map<String,List<ShutdownEventVo>> map=new HashMap<>();
 
         if (StringUtils.notEmp(begin) && StringUtils.notEmp(end) ) {
 
             Date beginDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin);
             Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(end);
-            List<ProEconShutdownEvent2> vos=new ArrayList();
+            List<ShutdownEventVo> vos=new ArrayList();
 
             vos=proEconShutdownEvent2Service.queryShutdownEvent2ByJX(wpId, modelId,beginDate, endDate);
             map.put("机械故障",vos);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/AlarmTsMapper.java


+ 28 - 30
alarm-web/src/main/java/com/gyee/alarm/mapper/auto/ProEconShutdownEvent2Mapper.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.alarm.model.vo.AlarmTsVo;
+import com.gyee.alarm.model.vo.ShutdownEventVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -26,10 +27,10 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
 
 
     @Select({"<script>",
-            "SELECT UPPER(t.name),count(*) FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
-                    "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code)  " ,
+            "SELECT UPPER(t.name) as name,count(*)  as times FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
+                    "pro_econ_alarm_type as t   " ,
             "<where>" ,
-
+            "  s.warning_id=a.id and s.warning_id is not null  and UPPER(a.components)=UPPER(t.nem_code) ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -42,13 +43,13 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "</where>",
             " GROUP BY t.name ",
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByType(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByType(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
 
     @Select({"<script>",
-            "SELECT  DATE(stop_time) AS stop_day, count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
-                    "pro_econ_alarm_type as t where s.warning_id=a.id  " ,
+            "SELECT  DATE(stop_time) AS stoptime, count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
+                    "pro_econ_alarm_type as t    " ,
             "<where>" ,
-
+            "  s.warning_id=a.id and s.warning_id is not null ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -59,18 +60,18 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "and s.stop_time &lt;= #{end}",
 
             "</where>",
-            " GROUP BY stop_day ",
+            " GROUP BY stoptime ",
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByDay(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
 
 
     @Select({"<script>",
-            "SELECT TO_CHAR(s.stop_time, 'YYYY-MM') AS year_month, count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s," +
+            "SELECT TO_CHAR(s.stop_time, 'YYYY-MM') AS stoptime, count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s," +
                     "pro_econ_alarm_configuration as a,pro_econ_alarm_type as t " +
-                    "where s.warning_id=a.id and s.warning_id is not null  " +
 
-            "<where>" ,
 
+            "<where>" ,
+            " s.warning_id=a.id and s.warning_id is not null ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -81,16 +82,15 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "and s.stop_time &lt;= #{end}",
 
             "</where>",
-            " GROUP BY year_month ",
+            " GROUP BY stoptime ",
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByMonth(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
 
     @Select({"<script>",
-            "SELECT '机械故障' AS 故障类型  ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
-                    "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
-                    "s.warning_id is not null  " ,
+            "SELECT '机械故障' AS name  ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
+                    "pro_econ_alarm_type as t  " ,
             "<where>" ,
-
+            " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null  ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -103,14 +103,13 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "</where>",
 
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByJX(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
 
     @Select({"<script>",
-            "SELECT '电气故障' AS 故障类型  ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
-                    "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
-                    "s.warning_id is not null  " ,
+            "SELECT '电气故障' AS name  ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours  FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
+                    "pro_econ_alarm_type as t  " ,
             "<where>" ,
-
+            " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -123,15 +122,14 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "</where>",
 
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByDQ(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
 
 
     @Select({"<script>",
-            "SELECT '其它故障' AS 故障类型 ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
-                    "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
-                    "s.warning_id is not null  " ,
+            "SELECT '其它故障' AS name ,count(*) as times,COALESCE(SUM(s.stop_hours), 0)  hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
+                    "pro_econ_alarm_type as t  " ,
             "<where>" ,
-
+            " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null ",
             "<if test='wpId != null'>",
             "and a.station_id like #{wpId}",
             "</if>",
@@ -140,10 +138,10 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
             "</if>",
             "and s.stop_time &gt;= #{begin}",
             "and s.stop_time &lt;= #{end}",
-            "and (t.nem_code=!='FDJ' and t.nem_code!='BPQ' and t.nem_code!='KZXT' and t.nem_code!='YP' and t.nem_code!='LG' and t.nem_code!='PHXT' and t.nem_code!='BJXT' )",
+            "and (t.nem_code!='FDJ' and t.nem_code!='BPQ' and t.nem_code!='KZXT' and t.nem_code!='YP' and t.nem_code!='LG' and t.nem_code!='PHXT' and t.nem_code!='BJXT' )",
             "</where>",
 
             "</script>"})
-    List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
+    List<ShutdownEventVo> queryShutdownEvent2ByOther(@Param("wpId") String wpId, @Param("modelId") String modelId, @Param("begin")Date begin, @Param("end") Date end);
 
 }

+ 16 - 0
alarm-web/src/main/java/com/gyee/alarm/model/vo/ShutdownEventVo.java

@@ -0,0 +1,16 @@
+package com.gyee.alarm.model.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ShutdownEventVo {
+
+    public String name;
+    public String stoptime;
+    public Long times;
+    public Long hours;
+}

+ 58 - 1
alarm-web/src/main/java/com/gyee/alarm/service/AlarmHistoryService.java

@@ -390,6 +390,63 @@ public class AlarmHistoryService   {
 
 
 
+    /**
+     * 查询报警信息接口
+     * @param begin 开始时间
+     * @param end 结束时间
+     * @param alarmType 报警类型
+     * @param stationid 场站
+
+     * @return
+     */
+    public List<String> selectByWtIsNotClose( long begin,long end ,String alarmType,String stationid) {
+
+        Map<String,Object> map=new HashMap<>();
+
+        List<String> vos =new ArrayList<>();
+        String superTableName= null;
+        StringBuilder descriptionSql=new StringBuilder();
+        if(StringUtils.notEmp(alarmType) && StringUtils.notEmp(begin) && StringUtils.notEmp(end) )
+        {
+
+
+
+            if(AlarmTypeValue.BT.getCode().equals(alarmType))
+            {
+                superTableName= AlarmSuperTalbeType.BT.getCode();
+
+            }else if(AlarmTypeValue.WT.getCode().equals(alarmType))
+            {
+                superTableName= AlarmSuperTalbeType.WT.getCode();
+
+            }
+            else if(AlarmTypeValue.IN.getCode().equals(alarmType))
+            {
+                superTableName= AlarmSuperTalbeType.WT.getCode();
+
+            }else if(AlarmTypeValue.CT.getCode().equals(alarmType))
+            {
+                superTableName= AlarmSuperTalbeType.CT.getCode();
+
+            }
+        }
+
+
+
+
+        if(StringUtils.empty(stationid)  )
+        {
+            stationid=null;
+        }
+
+        vos = alarmTsMapper.selectByWtIsNotClose(begin,end,stationid,superTableName);
+
+
+        return vos;
+    }
+
+
+
     public List<AlarmVo> findAlarmByTypelist(String type) {
 
 
@@ -629,7 +686,7 @@ public class AlarmHistoryService   {
             }
             fs.setAlarmid(at.getId());
             fs.setDescription(at.getDescription());
-            fs.setTotal(0l);
+            fs.setTotal(0L);
             fs.setAvgSeconds(0.0);
             fs.setMaxSeconds(0.0);
             fs.setMinSeconds(0.0);

+ 7 - 6
alarm-web/src/main/java/com/gyee/alarm/service/auto/IProEconShutdownEvent2Service.java

@@ -3,6 +3,7 @@ package com.gyee.alarm.service.auto;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.alarm.model.vo.ShutdownEventVo;
 
 import java.util.Date;
 import java.util.List;
@@ -19,18 +20,18 @@ public interface IProEconShutdownEvent2Service extends IService<ProEconShutdownE
 
     public IPage<ProEconShutdownEvent2> queryShutdownEvent2(String wpId, String wtId, String description, String begin, String end, Integer pageNum, Integer pageSize,String type) ;
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByType(String wpId, String modelId, Date begin, Date end);
+    public List<ShutdownEventVo> queryShutdownEvent2ByType(String wpId, String modelId, Date begin, Date end);
 
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end);
+    public List<ShutdownEventVo> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end);
 
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end);
+    public List<ShutdownEventVo> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end);
 
 
-    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end);
+    public  List<ShutdownEventVo> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end);
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end);
+    public List<ShutdownEventVo> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end);
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end);
+    public List<ShutdownEventVo> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end);
 }

+ 7 - 6
alarm-web/src/main/java/com/gyee/alarm/service/auto/impl/ProEconShutdownEvent2ServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.alarm.mapper.auto.ProEconShutdownEvent2Mapper;
 import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
+import com.gyee.alarm.model.vo.ShutdownEventVo;
 import com.gyee.alarm.service.auto.IProEconShutdownEvent2Service;
 import com.gyee.common.model.StringUtils;
 import org.apache.ibatis.annotations.Param;
@@ -68,35 +69,35 @@ public class ProEconShutdownEvent2ServiceImpl extends ServiceImpl<ProEconShutdow
 
 
 
-    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByType(String wpId,String modelId,Date begin, Date end)
+    public  List<ShutdownEventVo> queryShutdownEvent2ByType(String wpId, String modelId, Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByType(wpId, modelId, begin,  end);
     }
 
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end)
+    public List<ShutdownEventVo> queryShutdownEvent2ByDay(String wpId,String modelId,Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByDay(wpId, modelId, begin,  end);
     }
 
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end)
+    public List<ShutdownEventVo> queryShutdownEvent2ByMonth(String wpId,String modelId,Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByMonth(wpId, modelId, begin,  end);
     }
 
 
-    public  List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end)
+    public  List<ShutdownEventVo> queryShutdownEvent2ByJX(String wpId,String modelId,Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByJX(wpId, modelId, begin,  end);
     }
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end)
+    public List<ShutdownEventVo> queryShutdownEvent2ByDQ(String wpId,String modelId,Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByDQ(wpId, modelId, begin,  end);
     }
 
-    public List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end)
+    public List<ShutdownEventVo> queryShutdownEvent2ByOther(String wpId,String modelId,Date begin, Date end)
     {
         return proEconShutdownEvent2Mapper.queryShutdownEvent2ByOther(wpId, modelId, begin,  end);
     }