Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
3021dd21
由
张雷
编写于
2024-09-26 21:35:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
报警问题排查修改
1 个父辈
74354a37
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
37 行增加
和
18 行删除
sk-base-common/src/main/java/com/skua/modules/alarmtmp/mapper/xml/AlarmRecordHistoryMapper.xml
sk-base-common/src/main/java/com/skua/modules/alarmtmp/vo/AlarmCustomRuleConfigVO.java
sk-module-alarm/src/main/java/com/skua/modules/controller/web/AlarmCustomRecordHistoryController.java
sk-module-biz/src/main/java/com/skua/modules/threedimensional/controller/ThreeDController.java
sk-module-biz/src/main/resources/application-dev.yml
sk-base-common/src/main/java/com/skua/modules/alarmtmp/mapper/xml/AlarmRecordHistoryMapper.xml
查看文件 @
3021dd2
...
...
@@ -133,7 +133,7 @@
'${item}'
</foreach>
</if>
<!-- 联调是需要做登陆人数据权限过滤 and (d.ope_id = '用户id' or a.create_by = '登陆名')
<!-- 联调是需要做登陆人数据权限过滤 and (d.ope_id = '用户id' or a.create_by = '登陆名')
<if test="alarmRecordHistoryVO.auditState==null or alarmRecordHistoryVO.auditState==''">
and (d.ope_id = #{alarmRecordHistoryVO.createById} or (a.create_by = #{alarmRecordHistoryVO.createBy} and d.ope_id is null) )
</if>-->
...
...
@@ -705,10 +705,10 @@ FROM
<if
test=
"alarmRecordHistoryVO.startTime!=null and alarmRecordHistoryVO.startTime!=''"
>
AND
DATE_FORMAT( record_time, '%Y-%m-%d' )
>
= #{alarmRecordHistoryVO.startTime}
AND
record_time
>
= #{alarmRecordHistoryVO.startTime}
</if>
<if
test=
"alarmRecordHistoryVO.endTime!=null and alarmRecordHistoryVO.endTime!=''"
>
AND
DATE_FORMAT( record_time, '%Y-%m-%d' )
<
= #{alarmRecordHistoryVO.endTime}
AND
record_time
<
= #{alarmRecordHistoryVO.endTime}
</if>
<if
test=
"alarmRecordHistoryVO.alarmRuleLevelName!=null and alarmRecordHistoryVO.alarmRuleLevelName!=''"
>
AND arh.alarm_rule_level_name=#{alarmRecordHistoryVO.alarmRuleLevelName}
...
...
@@ -833,7 +833,7 @@ FROM
AND alarm_param_code = #{id}
and (alarm_param_type!='数据长期不变累计时长报警配置' or alarm_param_type is null)
</select>
<select
id=
"queryAlarmThresholdInfo"
resultType=
"com.skua.modules.alarmtmp.vo.AlarmRecordHistoryVO"
>
SELECT
b.alarm_rule_level_name,
...
...
@@ -846,7 +846,7 @@ FROM
alarm_param_code = #{indexCode}
AND b.sort = 1
</select>
<!-- 通过字典code获取字典数据 -->
<select
id=
"queryDictTextByKey"
parameterType=
"String"
resultType=
"String"
>
select s.item_text from sys_dict_item s
...
...
@@ -859,4 +859,4 @@ FROM
<select
id=
"queryTableDictTextByKey"
parameterType=
"String"
resultType=
"String"
>
select ${text} as "text" from ${table} where ${code}= #{key}
</select>
</mapper>
\ No newline at end of file
</mapper>
...
...
sk-base-common/src/main/java/com/skua/modules/alarmtmp/vo/AlarmCustomRuleConfigVO.java
查看文件 @
3021dd2
...
...
@@ -13,7 +13,7 @@ import com.skua.core.aspect.annotation.Dict;
@Data
@ApiModel
(
value
=
"alarm_custom_rule_config数据传输对象"
,
description
=
"报警方案库"
)
public
class
AlarmCustomRuleConfigVO
{
/**报警ID 主键*/
@ApiModelProperty
(
value
=
"报警ID 主键"
)
private
java
.
lang
.
String
id
;
...
...
@@ -79,6 +79,7 @@ public class AlarmCustomRuleConfigVO {
/**departId*/
@Excel
(
name
=
"departId"
,
width
=
15
)
@ApiModelProperty
(
value
=
"departId"
)
@Dict
(
dictTable
=
"sys_depart"
,
dicCode
=
"id"
,
dicText
=
"depart_name"
)
private
java
.
lang
.
String
departId
;
/**
* 报警级别名称
...
...
@@ -90,7 +91,7 @@ public class AlarmCustomRuleConfigVO {
*/
@ApiModelProperty
(
value
=
"alarmTemplateName"
)
private
java
.
lang
.
String
alarmTemplateName
;
@ApiModelProperty
(
value
=
"报警指标类别【0无指标/1采集指标/2设备】"
)
private
java
.
lang
.
String
alarmIndexShowTag
;
}
...
...
sk-module-alarm/src/main/java/com/skua/modules/controller/web/AlarmCustomRecordHistoryController.java
查看文件 @
3021dd2
...
...
@@ -72,7 +72,6 @@ public class AlarmCustomRecordHistoryController {
* @param alarmRecordHistoryVO
* @param pageNo
* @param pageSize
* @param req
* @return
* @author Li Yuanyuan, 2023年10月16日 下午2:39:10
* @Description: TODO(这里描述这个方法的需求变更情况)
...
...
@@ -82,13 +81,19 @@ public class AlarmCustomRecordHistoryController {
@GetMapping
(
value
=
"/list"
)
public
Result
<
IPage
<
AlarmRecordHistoryVO
>>
queryPageList
(
AlarmRecordHistoryVO
alarmRecordHistoryVO
,
@RequestParam
(
name
=
"pageNo"
,
defaultValue
=
"1"
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
,
HttpServletRequest
req
)
{
@RequestParam
(
name
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
Result
<
IPage
<
AlarmRecordHistoryVO
>>
result
=
new
Result
<>();
try
{
Page
<
AlarmRecordHistoryVO
>
pageList
=
new
Page
<>(
pageNo
,
pageSize
);
if
(
alarmRecordHistoryVO
.
getDepartId
()
==
null
)
{
alarmRecordHistoryVO
.
setDepartId
(
BaseContextHandler
.
getDeparts
());
}
if
(
alarmRecordHistoryVO
.
getStartTime
()
!=
null
)
{
alarmRecordHistoryVO
.
setStartTime
(
alarmRecordHistoryVO
.
getStartTime
()+
" 00:00:00"
);
}
if
(
alarmRecordHistoryVO
.
getEndTime
()
!=
null
)
{
alarmRecordHistoryVO
.
setEndTime
(
alarmRecordHistoryVO
.
getEndTime
()+
" 23:59:59"
);
}
pageList
=
alarmCustomRecordHistoryService
.
queryCustomPageList
(
pageList
,
alarmRecordHistoryVO
);
// 自定义查询
result
.
setSuccess
(
true
);
result
.
setResult
(
pageList
);
...
...
@@ -109,6 +114,12 @@ public class AlarmCustomRecordHistoryController {
String
departIds
=
BaseContextHandler
.
getDeparts
();
alarmRecordHistoryVO
.
setDepartId
(
departIds
);
}
if
(
alarmRecordHistoryVO
.
getStartTime
()
!=
null
)
{
alarmRecordHistoryVO
.
setStartTime
(
alarmRecordHistoryVO
.
getStartTime
()+
" 00:00:00"
);
}
if
(
alarmRecordHistoryVO
.
getEndTime
()
!=
null
)
{
alarmRecordHistoryVO
.
setEndTime
(
alarmRecordHistoryVO
.
getEndTime
()+
" 23:59:59"
);
}
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
alarmCustomRecordHistoryService
.
statistics
(
alarmRecordHistoryVO
);
result
.
setSuccess
(
true
);
result
.
setResult
(
resultMap
);
...
...
sk-module-biz/src/main/java/com/skua/modules/threedimensional/controller/ThreeDController.java
查看文件 @
3021dd2
...
...
@@ -12,6 +12,8 @@ import com.skua.core.context.SpringContextUtils;
import
com.skua.core.service.IPgQueryService
;
import
com.skua.core.util.DateUtils
;
import
com.skua.modules.alarmtmp.service.AlarmRecordHistoryService
;
import
com.skua.modules.alarmtmp.vo.AlarmRecordHistoryVO
;
import
com.skua.modules.common.service.ICommonSqlService
;
import
com.skua.modules.flow.utils.StringUtil
;
import
com.skua.modules.system.entity.SysDepart
;
...
...
@@ -63,6 +65,8 @@ public class ThreeDController {
private
IPgQueryService
pgQueryService
;
@Autowired
private
ISysDictService
sysDictService
;
@Autowired
private
AlarmRecordHistoryService
alarmRecordHistoryService
;
@CustomExceptionAnno
(
description
=
"三维-园区介绍"
)
@AutoLog
(
value
=
"三维-园区介绍"
)
...
...
@@ -413,7 +417,11 @@ public class ThreeDController {
"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 "
+
"LEFT JOIN (SELECT alarm_rule_level_name,count( 1 ) cou FROM alarm_record_history "
+
"WHERE DATE_FORMAT( record_time, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ), '%Y-%m-%d' ) "
+
"AND ( alarm_rule_type = '1' OR alarm_rule_type = '2' )"
"AND ( alarm_rule_type = 'A001A001' OR "
+
" alarm_rule_type = 'A001A002' OR "
+
" alarm_rule_type = 'A001A003' OR "
+
" alarm_rule_type = 'B001B001' OR "
+
" alarm_rule_type = 'C001C002' )"
+
condition
+
conditionFac
+
" GROUP BY alarm_rule_level_name ) t "
+
"ON t.alarm_rule_level_name = tt.item_value"
;
...
...
@@ -439,11 +447,11 @@ public class ThreeDController {
@GetMapping
(
value
=
"/getAlarmInfoByLevelName"
)
public
Result
<
List
<
JSONObject
>>
getAlarmInfoByLevelName
(
@RequestParam
(
defaultValue
=
"inside"
)
String
type
,
String
departId
,
String
levelName
)
{
Result
<
List
<
JSONObject
>>
result
=
new
Result
<>();
/*
AlarmRecordHistoryVO alarmRecordHistoryVO = new AlarmRecordHistoryVO();
alarmRecordHistoryVO.setAlarmRuleType("
1,
2");
AlarmRecordHistoryVO
alarmRecordHistoryVO
=
new
AlarmRecordHistoryVO
();
alarmRecordHistoryVO
.
setAlarmRuleType
(
"
A001A001,A001A002,A001A003,B001B001,C001C00
2"
);
String
date
=
DateUtils
.
getDate
(
"yyyy-MM-dd"
);
alarmRecordHistoryVO.setStartTime(date);
alarmRecordHistoryVO.setEndTime(date);
alarmRecordHistoryVO
.
setStartTime
(
date
+
" 00:00:00"
);
alarmRecordHistoryVO
.
setEndTime
(
date
+
" 23:59:59"
);
if
(
"outside"
.
equals
(
type
))
{
if
(
"重要报警"
.
equals
(
levelName
))
{
return
result
;
...
...
@@ -466,7 +474,7 @@ public class ThreeDController {
data
.
add
(
jsonObject
);
}
}
result.setResult(data);
*/
result
.
setResult
(
data
);
return
result
;
}
}
...
...
sk-module-biz/src/main/resources/application-dev.yml
查看文件 @
3021dd2
...
...
@@ -95,8 +95,7 @@ spring:
driver-class-name
:
com.mysql.jdbc.Driver
# 多数据源配置
pg-db
:
url
:
jdbc:postgresql://103.85.171.27:10087/postgres?useUnicode=true&characterEncoding=UTF8
# url: jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8
url
:
jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8
username
:
postgres
password
:
jkauto@123
driver-class-name
:
org.postgresql.Driver
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论