Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
dcc774a0
Commit
dcc774a0
authored
Aug 14, 2024
by
lilongyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz
into developer
parents
4d5cd900
1659ce82
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
141 additions
and
27 deletions
+141
-27
EquipmentSpecificIndex.java
...yeejoin/amos/api/alarm/entity/EquipmentSpecificIndex.java
+6
-0
PointSystem.java
...n/java/com/yeejoin/amos/api/alarm/entity/PointSystem.java
+6
-0
PointSystemServiceImpl.java
...n/amos/api/alarm/service/impl/PointSystemServiceImpl.java
+92
-5
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+17
-17
IdxBizFanWarningRuleSet.java
...boot/module/jxiop/biz/entity/IdxBizFanWarningRuleSet.java
+3
-0
IdxBizPvWarningRuleSet.java
.../boot/module/jxiop/biz/entity/IdxBizPvWarningRuleSet.java
+5
-0
AlarmInfoDetailServiceImpl.java
...le/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
+1
-1
PvHealthIndexMapper.java
.../boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
+3
-1
application-kingbase8.properties
...e-biz/src/main/resources/application-kingbase8.properties
+1
-1
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+7
-2
No files found.
amos-boot-data/amos-boot-data-alarm/src/main/java/com/yeejoin/amos/api/alarm/entity/EquipmentSpecificIndex.java
View file @
dcc774a0
...
@@ -81,4 +81,10 @@ public class EquipmentSpecificIndex {
...
@@ -81,4 +81,10 @@ public class EquipmentSpecificIndex {
@TableField
(
"unit"
)
@TableField
(
"unit"
)
private
String
unit
;
private
String
unit
;
@TableField
(
"topic"
)
private
String
topic
;
@TableField
(
"group"
)
private
String
group
;
}
}
amos-boot-data/amos-boot-data-alarm/src/main/java/com/yeejoin/amos/api/alarm/entity/PointSystem.java
View file @
dcc774a0
...
@@ -59,4 +59,10 @@ public class PointSystem extends BaseEntity {
...
@@ -59,4 +59,10 @@ public class PointSystem extends BaseEntity {
@ApiModelProperty
(
value
=
"场站缩写"
)
@ApiModelProperty
(
value
=
"场站缩写"
)
@TableField
(
"station_abbr"
)
@TableField
(
"station_abbr"
)
private
String
stationAbbr
;
private
String
stationAbbr
;
@TableField
(
"topic"
)
private
String
topic
;
@TableField
(
"group"
)
private
String
group
;
}
}
amos-boot-data/amos-boot-data-alarm/src/main/java/com/yeejoin/amos/api/alarm/service/impl/PointSystemServiceImpl.java
View file @
dcc774a0
...
@@ -6,10 +6,9 @@ import java.util.Arrays;
...
@@ -6,10 +6,9 @@ import java.util.Arrays;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -20,8 +19,8 @@ import org.springframework.stereotype.Service;
...
@@ -20,8 +19,8 @@ import org.springframework.stereotype.Service;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yeejoin.amos.api.alarm.dto.DynamicDetails
;
import
com.yeejoin.amos.api.alarm.dto.DynamicDetails
;
...
@@ -267,8 +266,8 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -267,8 +266,8 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
if
(
"SYZ"
.
equals
(
pointSystem
.
getNumber
()))
{
if
(
"SYZ"
.
equals
(
pointSystem
.
getNumber
()))
{
// 如果开启升压站预警
// 如果开启升压站预警
if
(
warnSYZ
)
{
if
(
warnSYZ
)
{
indexKey
=
new
StringBuilder
(
"WL-"
).
append
(
pointSystem
.
getStation
()).
append
(
"#"
).
append
(
pointSystem
.
getNumber
()
)
indexKey
=
new
StringBuilder
(
"WL-"
).
append
(
pointSystem
.
getStation
()).
append
(
"#"
)
.
append
(
"#"
).
append
(
pointSystem
.
getFunctionNum
());
.
append
(
pointSystem
.
getNumber
()).
append
(
"#"
).
append
(
pointSystem
.
getFunctionNum
());
}
else
{
}
else
{
System
.
out
.
println
(
"升压站预警不发送: "
+
warningObjectCode
+
" , "
+
indexValue
);
System
.
out
.
println
(
"升压站预警不发送: "
+
warningObjectCode
+
" , "
+
indexValue
);
return
null
;
return
null
;
...
@@ -289,4 +288,91 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
...
@@ -289,4 +288,91 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
return
WarningDto
;
return
WarningDto
;
}
}
}
}
@Async
(
"equipAsyncExecutor"
)
public
void
sendWarningMqttAsync
(
String
topic
,
String
msg
)
{
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
msg
);
String
group
=
jsonObject
.
getString
(
"group"
);
JSONObject
valueObj
=
jsonObject
.
getJSONObject
(
"value"
);
Set
<
String
>
keys
=
valueObj
.
keySet
();
String
address
=
null
;
String
value
=
null
;
for
(
String
key
:
keys
)
{
address
=
key
;
value
=
valueObj
.
getString
(
key
);
break
;
}
this
.
sendWarningMqtt
(
address
,
value
,
topic
,
group
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
sendWarningMqtt
(
String
address
,
String
value
,
String
topic
,
String
group
)
{
QueryWrapper
<
EquipmentSpecificIndex
>
indexWrapper
=
new
QueryWrapper
<>();
indexWrapper
.
lambda
().
eq
(
EquipmentSpecificIndex:
:
getIndexAddress
,
address
);
indexWrapper
.
lambda
().
eq
(
EquipmentSpecificIndex:
:
getTopic
,
topic
);
indexWrapper
.
lambda
().
eq
(
EquipmentSpecificIndex:
:
getGroup
,
group
);
EquipmentSpecificIndex
esi
=
equipmentSpecificIndexMapper
.
selectOne
(
indexWrapper
);
String
isAlarm
=
String
.
valueOf
(
esi
.
getIsAlarm
().
intValue
());
// 对应 equipment库的wl_equipment_specific_index_alarm_dic表
String
[]
s
=
{
"1"
,
"7"
,
"9"
};
// 如果不满足择返回
if
(!
Arrays
.
asList
(
s
).
contains
(
isAlarm
))
{
System
.
out
.
println
(
"不满足告警类型: "
+
isAlarm
);
return
;
}
System
.
out
.
println
(
"满足告警消息address: "
+
address
+
",topic: "
+
topic
+
" ,value:"
+
value
+
" ,group: "
+
group
+
" ,isAlarm: "
+
isAlarm
);
logger
.
info
(
"满足告警消息address: "
+
address
+
",topic: "
+
topic
+
" ,value:"
+
value
+
" ,group: "
+
group
+
" ,isAlarm: "
+
isAlarm
);
LambdaQueryWrapper
<
PointSystem
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
PointSystem:
:
getTopic
,
topic
);
wrapper
.
eq
(
PointSystem:
:
getGroup
,
group
);
wrapper
.
eq
(
PointSystem:
:
getAddress
,
address
);
PointSystem
pointSystem
=
pointSystemMapper
.
selectOne
(
wrapper
);
String
valueLabe
=
null
;
JSONObject
eqdata
=
new
JSONObject
();
// 调用获取设备相关信息
QueryWrapper
<
KKSData
>
KKSDataWrapper
=
new
QueryWrapper
<>();
KKSDataWrapper
.
lambda
().
eq
(
KKSData:
:
getKKSBM
,
pointSystem
.
getKks
());
KKSData
KKSData
=
kksDataMapper
.
selectOne
(
KKSDataWrapper
);
if
(
KKSData
==
null
)
{
// throw new RuntimeException("kks码查询热工院表不存在:" + pointSystem.getKks());
System
.
out
.
println
(
"kks码查询热工院表不存在:"
+
pointSystem
.
getKks
());
return
;
}
eqdata
.
put
(
"kksms"
,
KKSData
.
getKKSMS
());
QueryWrapper
<
StationBasic
>
stationWrapper
=
new
QueryWrapper
<>();
stationWrapper
.
lambda
().
eq
(
StationBasic:
:
getStationNumber
,
pointSystem
.
getStation
());
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
stationWrapper
);
if
(
stationBasic
!=
null
)
{
eqdata
.
put
(
"sourceAttribution"
,
stationBasic
.
getProjectOrgCode
());
eqdata
.
put
(
"sourceAttributionDesc"
,
stationBasic
.
getStationName
());
}
else
{
// throw new RuntimeException("获取场站失败: " + pointSystem.getStation());
System
.
out
.
println
(
"获取场站失败: "
+
pointSystem
.
getStation
());
return
;
}
try
{
// 组装数据,发送预警
WarningDto
warningDto
=
setWarningDto
(
pointSystem
,
eqdata
,
valueLabe
);
if
(
warningDto
!=
null
)
{
emqKeeper
.
getMqttClient
().
publish
(
STATIONWARNING
,
JSON
.
toJSONString
(
warningDto
).
getBytes
(),
0
,
false
);
System
.
out
.
println
(
"发送预警成功: "
+
JSON
.
toJSONString
(
warningDto
));
// logger.info("发送预警成功: " + JSON.toJSONString(warningDto));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TdInfoQueryController.java
View file @
dcc774a0
...
@@ -198,17 +198,17 @@ public class TdInfoQueryController extends BaseController {
...
@@ -198,17 +198,17 @@ public class TdInfoQueryController extends BaseController {
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
startDate
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"fan_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"fan_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"fan_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
{
}
else
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"fan_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
}
}
}
...
@@ -221,20 +221,20 @@ public class TdInfoQueryController extends BaseController {
...
@@ -221,20 +221,20 @@ public class TdInfoQueryController extends BaseController {
endDate
=
formatter
.
format
(
date
);
endDate
=
formatter
.
format
(
date
);
}
}
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
endDate
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"fan_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_day"
);
dto
.
setTableName
(
"fan_health_index_day"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"fan_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_hour"
);
dto
.
setTableName
(
"fan_health_index_hour"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"fan_health_index_moment"
,
nextWholeMinute
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_moment"
);
dto
.
setTableName
(
"fan_health_index_moment"
);
}
else
{
}
else
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"fan_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_data"
);
dto
.
setTableName
(
"fan_health_index_data"
);
}
}
...
@@ -320,17 +320,17 @@ public class TdInfoQueryController extends BaseController {
...
@@ -320,17 +320,17 @@ public class TdInfoQueryController extends BaseController {
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
startDate
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"pv_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"pv_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"pv_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
else
{
}
else
{
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
Long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
GT
(
"pv_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDateTs
(
startTs
);
dto
.
setStartDateTs
(
startTs
);
}
}
}
}
...
@@ -338,25 +338,25 @@ public class TdInfoQueryController extends BaseController {
...
@@ -338,25 +338,25 @@ public class TdInfoQueryController extends BaseController {
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
String
dateNowShortStr
=
DateUtils
.
getDateNowShortStr
();
String
endDate
=
dto
.
getEndDate
();
String
endDate
=
dto
.
getEndDate
();
if
(
dateNowShortStr
.
equals
(
endDate
)){
if
(
dateNowShortStr
.
equals
(
endDate
)){
Date
date
=
DateUtils
.
dateAddDays
(
null
,
-
1
);
Date
date
=
DateUtils
.
dateAddDays
(
null
,
0
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtils
.
DATE_PATTERN
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtils
.
DATE_PATTERN
);
endDate
=
formatter
.
format
(
date
);
endDate
=
formatter
.
format
(
date
);
}
}
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
endDate
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"pv_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_day"
);
dto
.
setTableName
(
"pv_health_index_day"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"pv_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_hour"
);
dto
.
setTableName
(
"pv_health_index_hour"
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"pv_health_index_moment"
,
nextWholeMinute
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_moment"
);
dto
.
setTableName
(
"pv_health_index_moment"
);
}
else
{
}
else
{
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
Long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
LT
(
"pv_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_data"
);
dto
.
setTableName
(
"pv_health_index_data"
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanWarningRuleSet.java
View file @
dcc774a0
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -124,4 +125,6 @@ public class IdxBizFanWarningRuleSet {
...
@@ -124,4 +125,6 @@ public class IdxBizFanWarningRuleSet {
@TableField
(
"GATEWAY_ID"
)
@TableField
(
"GATEWAY_ID"
)
private
String
gatewayId
;
private
String
gatewayId
;
@TableField
(
"ORG_CODE"
)
private
String
orgCode
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvWarningRuleSet.java
View file @
dcc774a0
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -140,4 +141,8 @@ public class IdxBizPvWarningRuleSet{
...
@@ -140,4 +141,8 @@ public class IdxBizPvWarningRuleSet{
*/
*/
@TableField
(
"GATEWAY_ID"
)
@TableField
(
"GATEWAY_ID"
)
private
String
gatewayId
;
private
String
gatewayId
;
@TableField
(
"ORG_CODE"
)
private
String
orgCode
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
View file @
dcc774a0
...
@@ -619,7 +619,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -619,7 +619,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
processValue1
=
0.0
;
processValue1
=
0.0
;
}
}
currentValueMap
.
put
(
"processValue1"
,
keepOneKeepDecimalPlace
(
processValue1
));
currentValueMap
.
put
(
"processValue1"
,
keepOneKeepDecimalPlace
(
processValue1
));
if
(
ObjectUtils
.
isEmpty
(
analyseValue
)){
if
(
ObjectUtils
.
isEmpty
(
processValue2
)){
processValue2
=
0.0
;
processValue2
=
0.0
;
}
}
currentValueMap
.
put
(
"processValue2"
,
keepOneKeepDecimalPlace
(
processValue2
));
currentValueMap
.
put
(
"processValue2"
,
keepOneKeepDecimalPlace
(
processValue2
));
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexMapper.java
View file @
dcc774a0
...
@@ -62,7 +62,9 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
...
@@ -62,7 +62,9 @@ public interface PvHealthIndexMapper extends BaseMapper<PvHealthIndex> {
List
<
PvHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
List
<
PvHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
Long
getTsByRecDate
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"sort"
)
String
sort
);
Long
getTsByRecDateGT
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"sort"
)
String
sort
);
Long
getTsByRecDateLT
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"sort"
)
String
sort
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
PvHealthIndexDto
dto
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/application-kingbase8.properties
View file @
dcc774a0
...
@@ -34,7 +34,7 @@ spring.redis.host=10.20.1.210
...
@@ -34,7 +34,7 @@ spring.redis.host=10.20.1.210
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.redis.password
=
yeejoin@2020
openHealth
=
tru
e
openHealth
=
fals
e
spring.cache.type
=
GENERIC
spring.cache.type
=
GENERIC
j2cache.open-spring-cache
=
true
j2cache.open-spring-cache
=
true
j2cache.cache-clean-mode
=
passive
j2cache.cache-clean-mode
=
passive
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
dcc774a0
...
@@ -228,9 +228,14 @@
...
@@ -228,9 +228,14 @@
limit #{dto.current}, #{dto.size}
limit #{dto.current}, #{dto.size}
</select>
</select>
<select
id=
"getTsByRecDate"
resultType=
"long"
>
<select
id=
"getTsByRecDate
GT
"
resultType=
"long"
>
SELECT ts FROM analysis_data.${tableName}
SELECT ts FROM analysis_data.${tableName}
where rec_date = #{recDate} order by ts ${sort} limit 1 ;
where rec_date
>
= #{recDate} order by ts ${sort} limit 1 ;
</select>
<select
id=
"getTsByRecDateLT"
resultType=
"long"
>
SELECT ts FROM analysis_data.${tableName}
where rec_date
<
= #{recDate} order by ts ${sort} limit 1 ;
</select>
</select>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment