Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
d8349475
Commit
d8349475
authored
Nov 07, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警存入 td相关
parent
7c0f50b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
40 deletions
+45
-40
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+22
-16
PvWarningRecord.java
.../amos/boot/module/jxiop/biz/tdengine/PvWarningRecord.java
+1
-1
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+22
-23
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
d8349475
...
@@ -30,9 +30,13 @@ import org.springframework.util.ObjectUtils;
...
@@ -30,9 +30,13 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_TIME_PATTERN
;
@EnableScheduling
@EnableScheduling
@Service
@Service
@Slf4j
@Slf4j
...
@@ -318,10 +322,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -318,10 +322,10 @@ public class HealthStatusIndicatorServiceImpl {
return
;
return
;
}
}
Date
time
=
new
Date
();
Date
time
=
new
Date
();
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
8
);
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
13
);
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
//
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
//
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
...
@@ -480,11 +484,12 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -480,11 +484,12 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
openHealth
){
if
(!
openHealth
){
return
;
return
;
}
}
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
Date
time
=
new
Date
();
Date
time
=
new
Date
();
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
8
);
//三天 + 8小时
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
80
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:mm:00"
);
LambdaQueryWrapper
<
PvHealthIndexDay
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PvHealthIndexDay
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -815,10 +820,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -815,10 +820,10 @@ public class HealthStatusIndicatorServiceImpl {
}
}
Date
time
=
new
Date
();
Date
time
=
new
Date
();
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:00:00"
);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd HH:00:00"
);
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
8
);
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
13
);
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
//
calendar.set(Calendar.HOUR_OF_DAY,calendar.get(Calendar.HOUR_OF_DAY)-5);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
//
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
LambdaQueryWrapper
<
FanHealthIndexHour
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
FanHealthIndexHour
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FanHealthIndexHour:
:
getAnalysisObjType
,
"测点"
);
wrapper
.
eq
(
FanHealthIndexHour:
:
getAnalysisObjType
,
"测点"
);
...
@@ -976,10 +981,11 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -976,10 +981,11 @@ public class HealthStatusIndicatorServiceImpl {
}
}
Date
time
=
new
Date
();
Date
time
=
new
Date
();
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd 00:00:00"
);
String
format
=
DateUtil
.
format
(
time
,
"yyyy-MM-dd 00:00:00"
);
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
8
);
//三天 + 8小时
Calendar
calendar
=
Calendar
.
getInstance
();
Date
date
=
DateUtils
.
dateAddHours
(
time
,
-
80
);
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
// Calendar calendar = Calendar.getInstance();
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)-3);
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
LambdaQueryWrapper
<
FanHealthIndexDay
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
FanHealthIndexDay
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
ne
(
FanHealthIndexDay:
:
getHealthLevel
,
"安全"
);
wrapper
.
ne
(
FanHealthIndexDay:
:
getHealthLevel
,
"安全"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdengine/PvWarningRecord.java
View file @
d8349475
...
@@ -12,7 +12,7 @@ public class PvWarningRecord implements Serializable {
...
@@ -12,7 +12,7 @@ public class PvWarningRecord implements Serializable {
private
Long
ts
;
private
Long
ts
;
private
String
recDate
;
private
String
recDate
;
private
String
disposotionState
;
private
String
disposotionState
;
private
String
healthIndex
Seq
;
private
String
healthIndex
;
private
String
analysisPointId
;
private
String
analysisPointId
;
private
String
warningName
;
private
String
warningName
;
private
String
arae
;
private
String
arae
;
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
d8349475
...
@@ -6,34 +6,33 @@
...
@@ -6,34 +6,33 @@
insert
insert
into
into
pv_warning_record
pv_warning_record
(ts,
<!-- (ts,-->
rec_date,
<!-- rec_date,-->
disposotion_state,
<!-- disposotion_state,-->
health_index_seq,
<!-- health_index_seq,-->
health_index,
<!-- health_index,-->
analysis_point_id,
<!-- analysis_point_id,-->
warning_name,
<!-- warning_name,-->
arae,
<!-- arae,-->
station,
<!-- station,-->
subarray,
<!-- subarray,-->
manufacturer,
<!-- manufacturer,-->
device_type,
<!-- device_type,-->
equipment_name,
<!-- equipment_name,-->
gateway_id,
<!-- gateway_id,-->
index_address,
<!-- index_address,-->
content,
<!-- content,-->
point_name,
<!-- point_name,-->
health_level,
<!-- health_level,-->
disposotion_date,
<!-- disposotion_date,-->
kks,
<!-- kks,-->
warning_period,
<!-- warning_period,-->
status)
<!-- status)-->
values
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(#{item.ts, jdbcType=TIMESTAMP},
(#{item.ts, jdbcType=TIMESTAMP},
#{item.recDate, jdbcType=VARCHAR},
#{item.recDate, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
#{item.disposotionState, jdbcType=VARCHAR},
#{item.healthIndexSeq, jdbcType=VARCHAR},
#{item.healthIndex, jdbcType=VARCHAR},
#{item.healthIndex, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.analysisPointId, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
#{item.warningName, jdbcType=VARCHAR},
...
...
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