报警问题排查修改
正在显示
5 个修改的文件
包含
31 行增加
和
12 行删除
... | @@ -705,10 +705,10 @@ FROM | ... | @@ -705,10 +705,10 @@ FROM |
705 | 705 | ||
706 | 706 | ||
707 | <if test="alarmRecordHistoryVO.startTime!=null and alarmRecordHistoryVO.startTime!=''"> | 707 | <if test="alarmRecordHistoryVO.startTime!=null and alarmRecordHistoryVO.startTime!=''"> |
708 | AND DATE_FORMAT( record_time, '%Y-%m-%d' ) >= #{alarmRecordHistoryVO.startTime} | 708 | AND record_time >= #{alarmRecordHistoryVO.startTime} |
709 | </if> | 709 | </if> |
710 | <if test="alarmRecordHistoryVO.endTime!=null and alarmRecordHistoryVO.endTime!=''"> | 710 | <if test="alarmRecordHistoryVO.endTime!=null and alarmRecordHistoryVO.endTime!=''"> |
711 | AND DATE_FORMAT( record_time, '%Y-%m-%d' ) <= #{alarmRecordHistoryVO.endTime} | 711 | AND record_time <= #{alarmRecordHistoryVO.endTime} |
712 | </if> | 712 | </if> |
713 | <if test="alarmRecordHistoryVO.alarmRuleLevelName!=null and alarmRecordHistoryVO.alarmRuleLevelName!=''"> | 713 | <if test="alarmRecordHistoryVO.alarmRuleLevelName!=null and alarmRecordHistoryVO.alarmRuleLevelName!=''"> |
714 | AND arh.alarm_rule_level_name=#{alarmRecordHistoryVO.alarmRuleLevelName} | 714 | AND arh.alarm_rule_level_name=#{alarmRecordHistoryVO.alarmRuleLevelName} | ... | ... |
... | @@ -79,6 +79,7 @@ public class AlarmCustomRuleConfigVO { | ... | @@ -79,6 +79,7 @@ public class AlarmCustomRuleConfigVO { |
79 | /**departId*/ | 79 | /**departId*/ |
80 | @Excel(name = "departId", width = 15) | 80 | @Excel(name = "departId", width = 15) |
81 | @ApiModelProperty(value = "departId") | 81 | @ApiModelProperty(value = "departId") |
82 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") | ||
82 | private java.lang.String departId; | 83 | private java.lang.String departId; |
83 | /** | 84 | /** |
84 | * 报警级别名称 | 85 | * 报警级别名称 | ... | ... |
... | @@ -72,7 +72,6 @@ public class AlarmCustomRecordHistoryController { | ... | @@ -72,7 +72,6 @@ public class AlarmCustomRecordHistoryController { |
72 | * @param alarmRecordHistoryVO | 72 | * @param alarmRecordHistoryVO |
73 | * @param pageNo | 73 | * @param pageNo |
74 | * @param pageSize | 74 | * @param pageSize |
75 | * @param req | ||
76 | * @return | 75 | * @return |
77 | * @author Li Yuanyuan, 2023年10月16日 下午2:39:10 | 76 | * @author Li Yuanyuan, 2023年10月16日 下午2:39:10 |
78 | * @Description: TODO(这里描述这个方法的需求变更情况) | 77 | * @Description: TODO(这里描述这个方法的需求变更情况) |
... | @@ -82,13 +81,19 @@ public class AlarmCustomRecordHistoryController { | ... | @@ -82,13 +81,19 @@ public class AlarmCustomRecordHistoryController { |
82 | @GetMapping(value = "/list") | 81 | @GetMapping(value = "/list") |
83 | public Result<IPage<AlarmRecordHistoryVO>> queryPageList(AlarmRecordHistoryVO alarmRecordHistoryVO, | 82 | public Result<IPage<AlarmRecordHistoryVO>> queryPageList(AlarmRecordHistoryVO alarmRecordHistoryVO, |
84 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 83 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
85 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | 84 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
86 | Result<IPage<AlarmRecordHistoryVO>> result = new Result<>(); | 85 | Result<IPage<AlarmRecordHistoryVO>> result = new Result<>(); |
87 | try { | 86 | try { |
88 | Page<AlarmRecordHistoryVO> pageList = new Page<>(pageNo, pageSize); | 87 | Page<AlarmRecordHistoryVO> pageList = new Page<>(pageNo, pageSize); |
89 | if (alarmRecordHistoryVO.getDepartId() == null) { | 88 | if (alarmRecordHistoryVO.getDepartId() == null) { |
90 | alarmRecordHistoryVO.setDepartId(BaseContextHandler.getDeparts()); | 89 | alarmRecordHistoryVO.setDepartId(BaseContextHandler.getDeparts()); |
91 | } | 90 | } |
91 | if (alarmRecordHistoryVO.getStartTime() != null) { | ||
92 | alarmRecordHistoryVO.setStartTime(alarmRecordHistoryVO.getStartTime()+" 00:00:00"); | ||
93 | } | ||
94 | if (alarmRecordHistoryVO.getEndTime() != null) { | ||
95 | alarmRecordHistoryVO.setEndTime(alarmRecordHistoryVO.getEndTime()+" 23:59:59"); | ||
96 | } | ||
92 | pageList = alarmCustomRecordHistoryService.queryCustomPageList(pageList, alarmRecordHistoryVO);// 自定义查询 | 97 | pageList = alarmCustomRecordHistoryService.queryCustomPageList(pageList, alarmRecordHistoryVO);// 自定义查询 |
93 | result.setSuccess(true); | 98 | result.setSuccess(true); |
94 | result.setResult(pageList); | 99 | result.setResult(pageList); |
... | @@ -109,6 +114,12 @@ public class AlarmCustomRecordHistoryController { | ... | @@ -109,6 +114,12 @@ public class AlarmCustomRecordHistoryController { |
109 | String departIds = BaseContextHandler.getDeparts(); | 114 | String departIds = BaseContextHandler.getDeparts(); |
110 | alarmRecordHistoryVO.setDepartId(departIds); | 115 | alarmRecordHistoryVO.setDepartId(departIds); |
111 | } | 116 | } |
117 | if (alarmRecordHistoryVO.getStartTime() != null) { | ||
118 | alarmRecordHistoryVO.setStartTime(alarmRecordHistoryVO.getStartTime()+" 00:00:00"); | ||
119 | } | ||
120 | if (alarmRecordHistoryVO.getEndTime() != null) { | ||
121 | alarmRecordHistoryVO.setEndTime(alarmRecordHistoryVO.getEndTime()+" 23:59:59"); | ||
122 | } | ||
112 | Map<String,Map<String,Object>> resultMap = alarmCustomRecordHistoryService.statistics(alarmRecordHistoryVO); | 123 | Map<String,Map<String,Object>> resultMap = alarmCustomRecordHistoryService.statistics(alarmRecordHistoryVO); |
113 | result.setSuccess(true); | 124 | result.setSuccess(true); |
114 | result.setResult(resultMap); | 125 | result.setResult(resultMap); | ... | ... |
... | @@ -12,6 +12,8 @@ import com.skua.core.context.SpringContextUtils; | ... | @@ -12,6 +12,8 @@ import com.skua.core.context.SpringContextUtils; |
12 | import com.skua.core.service.IPgQueryService; | 12 | import com.skua.core.service.IPgQueryService; |
13 | import com.skua.core.util.DateUtils; | 13 | import com.skua.core.util.DateUtils; |
14 | 14 | ||
15 | import com.skua.modules.alarmtmp.service.AlarmRecordHistoryService; | ||
16 | import com.skua.modules.alarmtmp.vo.AlarmRecordHistoryVO; | ||
15 | import com.skua.modules.common.service.ICommonSqlService; | 17 | import com.skua.modules.common.service.ICommonSqlService; |
16 | import com.skua.modules.flow.utils.StringUtil; | 18 | import com.skua.modules.flow.utils.StringUtil; |
17 | import com.skua.modules.system.entity.SysDepart; | 19 | import com.skua.modules.system.entity.SysDepart; |
... | @@ -63,6 +65,8 @@ public class ThreeDController { | ... | @@ -63,6 +65,8 @@ public class ThreeDController { |
63 | private IPgQueryService pgQueryService; | 65 | private IPgQueryService pgQueryService; |
64 | @Autowired | 66 | @Autowired |
65 | private ISysDictService sysDictService; | 67 | private ISysDictService sysDictService; |
68 | @Autowired | ||
69 | private AlarmRecordHistoryService alarmRecordHistoryService; | ||
66 | 70 | ||
67 | @CustomExceptionAnno(description = "三维-园区介绍") | 71 | @CustomExceptionAnno(description = "三维-园区介绍") |
68 | @AutoLog(value = "三维-园区介绍") | 72 | @AutoLog(value = "三维-园区介绍") |
... | @@ -413,7 +417,11 @@ public class ThreeDController { | ... | @@ -413,7 +417,11 @@ public class ThreeDController { |
413 | "SELECT item_text, item_value FROM sys_dict_item b LEFT JOIN sys_dict a ON a.id = b.dict_id WHERE a.dict_code = 'alarm_level' ) tt " + | 417 | "SELECT item_text, item_value FROM sys_dict_item b LEFT JOIN sys_dict a ON a.id = b.dict_id WHERE a.dict_code = 'alarm_level' ) tt " + |
414 | "LEFT JOIN (SELECT alarm_rule_level_name,count( 1 ) cou FROM alarm_record_history " + | 418 | "LEFT JOIN (SELECT alarm_rule_level_name,count( 1 ) cou FROM alarm_record_history " + |
415 | "WHERE DATE_FORMAT( record_time, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ), '%Y-%m-%d' ) " + | 419 | "WHERE DATE_FORMAT( record_time, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ), '%Y-%m-%d' ) " + |
416 | "AND ( alarm_rule_type = '1' OR alarm_rule_type = '2' )" | 420 | "AND ( alarm_rule_type = 'A001A001' OR " + |
421 | " alarm_rule_type = 'A001A002' OR " + | ||
422 | " alarm_rule_type = 'A001A003' OR " + | ||
423 | " alarm_rule_type = 'B001B001' OR " + | ||
424 | " alarm_rule_type = 'C001C002' )" | ||
417 | + condition + conditionFac + | 425 | + condition + conditionFac + |
418 | " GROUP BY alarm_rule_level_name ) t " + | 426 | " GROUP BY alarm_rule_level_name ) t " + |
419 | "ON t.alarm_rule_level_name = tt.item_value"; | 427 | "ON t.alarm_rule_level_name = tt.item_value"; |
... | @@ -439,11 +447,11 @@ public class ThreeDController { | ... | @@ -439,11 +447,11 @@ public class ThreeDController { |
439 | @GetMapping(value = "/getAlarmInfoByLevelName") | 447 | @GetMapping(value = "/getAlarmInfoByLevelName") |
440 | public Result<List<JSONObject>> getAlarmInfoByLevelName(@RequestParam(defaultValue = "inside") String type, String departId, String levelName) { | 448 | public Result<List<JSONObject>> getAlarmInfoByLevelName(@RequestParam(defaultValue = "inside") String type, String departId, String levelName) { |
441 | Result<List<JSONObject>> result = new Result<>(); | 449 | Result<List<JSONObject>> result = new Result<>(); |
442 | /*AlarmRecordHistoryVO alarmRecordHistoryVO = new AlarmRecordHistoryVO(); | 450 | AlarmRecordHistoryVO alarmRecordHistoryVO = new AlarmRecordHistoryVO(); |
443 | alarmRecordHistoryVO.setAlarmRuleType("1,2"); | 451 | alarmRecordHistoryVO.setAlarmRuleType("A001A001,A001A002,A001A003,B001B001,C001C002"); |
444 | String date = DateUtils.getDate("yyyy-MM-dd"); | 452 | String date = DateUtils.getDate("yyyy-MM-dd"); |
445 | alarmRecordHistoryVO.setStartTime(date); | 453 | alarmRecordHistoryVO.setStartTime(date + " 00:00:00"); |
446 | alarmRecordHistoryVO.setEndTime(date); | 454 | alarmRecordHistoryVO.setEndTime(date + " 23:59:59"); |
447 | if ("outside".equals(type)) { | 455 | if ("outside".equals(type)) { |
448 | if ("重要报警".equals(levelName)) { | 456 | if ("重要报警".equals(levelName)) { |
449 | return result; | 457 | return result; |
... | @@ -466,7 +474,7 @@ public class ThreeDController { | ... | @@ -466,7 +474,7 @@ public class ThreeDController { |
466 | data.add(jsonObject); | 474 | data.add(jsonObject); |
467 | } | 475 | } |
468 | } | 476 | } |
469 | result.setResult(data);*/ | 477 | result.setResult(data); |
470 | return result; | 478 | return result; |
471 | } | 479 | } |
472 | } | 480 | } | ... | ... |
... | @@ -95,8 +95,7 @@ spring: | ... | @@ -95,8 +95,7 @@ spring: |
95 | driver-class-name: com.mysql.jdbc.Driver | 95 | driver-class-name: com.mysql.jdbc.Driver |
96 | # 多数据源配置 | 96 | # 多数据源配置 |
97 | pg-db: | 97 | pg-db: |
98 | url: jdbc:postgresql://103.85.171.27:10087/postgres?useUnicode=true&characterEncoding=UTF8 | 98 | url: jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8 |
99 | # url: jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8 | ||
100 | username: postgres | 99 | username: postgres |
101 | password: jkauto@123 | 100 | password: jkauto@123 |
102 | driver-class-name: org.postgresql.Driver | 101 | driver-class-name: org.postgresql.Driver | ... | ... |
-
请 注册 或 登录 后发表评论