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
da276d5f
Commit
da276d5f
authored
Nov 03, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
e62ba5b5
cd51b868
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
238 additions
and
24 deletions
+238
-24
ClientHandler.java
.../main/java/com/yeejoin/amos/kgd/config/ClientHandler.java
+63
-7
IdxBizSyncService.java
...n/amos/boot/module/cas/api/service/IdxBizSyncService.java
+26
-0
IdxBizSyncController.java
...amos/boot/module/cas/controller/IdxBizSyncController.java
+39
-0
IdxBizSyncServiceImpl.java
...s/boot/module/cas/service/impl/IdxBizSyncServiceImpl.java
+43
-0
application-dev.properties
...ule-cas-biz/src/main/resources/application-dev.properties
+2
-2
AmosJxiopAnalyseApplication.java
...in/java/com/yeejoin/amos/AmosJxiopAnalyseApplication.java
+2
-2
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+8
-0
AlarmInfoDetailServiceImpl.java
...le/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
+38
-6
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+3
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+3
-1
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+9
-4
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+1
-1
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-kgd-api/src/main/java/com/yeejoin/amos/kgd/config/ClientHandler.java
View file @
da276d5f
...
...
@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.context.SpringContextHelper;
import
java.io.*
;
import
java.net.Socket
;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
...
...
@@ -69,6 +70,9 @@ public class ClientHandler<path> implements Runnable {
}
private
String
upload2Maas
(
InputStream
inputStream
,
String
hostAndPort
)
throws
IOException
{
InputStream
intercept
=
intercept
(
inputStream
);
AmosRequestContext
robotAuthentication
=
SpringContextHelper
.
getBean
(
AmosRequestContext
.
class
);
if
(
Objects
.
nonNull
(
robotAuthentication
))
{
String
token
=
robotAuthentication
.
getToken
();
...
...
@@ -93,16 +97,16 @@ public class ClientHandler<path> implements Runnable {
}
};
params
.
add
(
"file"
,
resource
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
requestEntity
=
new
HttpEntity
<>(
params
,
getHeader
(
token
,
product
,
appKey
,
hostAndPort
,
true
));
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
requestEntity
=
new
HttpEntity
<>(
params
,
getHeader
(
token
,
product
,
appKey
,
hostAndPort
,
true
));
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
exchange
(
uploadUrl
,
HttpMethod
.
POST
,
requestEntity
,
String
.
class
);
String
body
=
responseEntity
.
getBody
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
body
);
String
result
=
jsonObject
.
getString
(
"result"
);
String
path
=
jsonObject
.
getString
(
"path"
);
if
(
jsonObject
.
getString
(
"status"
).
equals
(
"200"
)){
log
.
info
(
"路径:"
+
path
+
"/"
+
result
);
}
else
{
if
(
jsonObject
.
getString
(
"status"
).
equals
(
"200"
))
{
log
.
info
(
"路径:"
+
path
+
"/"
+
result
);
}
else
{
throw
new
RuntimeException
(
"返回状态码错误"
);
}
...
...
@@ -152,14 +156,14 @@ public class ClientHandler<path> implements Runnable {
return
null
;
}
private
HttpHeaders
getHeader
(
String
token
,
String
product
,
String
appKey
,
String
hostAndPort
,
Boolean
isUpload
)
{
private
HttpHeaders
getHeader
(
String
token
,
String
product
,
String
appKey
,
String
hostAndPort
,
Boolean
isUpload
)
{
HttpHeaders
header
=
new
HttpHeaders
();
header
.
add
(
Constant
.
TOKEN
,
token
);
header
.
add
(
Constant
.
PRODUCT
,
product
);
header
.
add
(
Constant
.
APPKEY
,
appKey
);
if
(
isUpload
){
if
(
isUpload
)
{
header
.
setContentType
(
MediaType
.
MULTIPART_FORM_DATA
);
}
else
{
}
else
{
header
.
setContentType
(
MediaType
.
APPLICATION_JSON
);
}
return
header
;
...
...
@@ -169,6 +173,58 @@ public class ClientHandler<path> implements Runnable {
requestInfoToSocketServer
();
}
//截取文件流
public
static
InputStream
intercept
(
InputStream
is
)
{
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
is
));
StringBuilder
sb
=
new
StringBuilder
();
String
line
=
null
;
try
{
while
((
line
=
reader
.
readLine
())
!=
null
)
{
sb
.
append
(
line
+
"/n"
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
String
string1
=
sb
.
toString
();
int
startFilePath
=
string1
.
indexOf
(
"##STATITLE##"
);
int
endFilePath
=
string1
.
indexOf
(
"##ENDTITLE##"
);
int
startFile
=
string1
.
indexOf
(
"##STAFILE##"
);
int
endFile
=
string1
.
indexOf
(
"##ENDFILE##"
);
if
(
startFilePath
<
0
)
{
log
.
info
(
"不存在文件名开始标志"
);
return
null
;
}
if
(
endFilePath
<
0
)
{
log
.
info
(
"不存在文件名结束标志"
);
return
null
;
}
if
(
startFile
<
0
)
{
log
.
info
(
"不存在文件开始标志"
);
return
null
;
}
if
(
endFile
<
0
)
{
log
.
info
(
"不存在文件结束标志"
);
return
null
;
}
String
filePath
=
string1
.
substring
(
startFilePath
,
endFilePath
).
substring
(
"##STATITLE##"
.
length
());
log
.
info
(
"文件名:"
+
filePath
);
String
file
=
string1
.
substring
(
startFile
,
endFile
).
substring
(
"##STAFILE##"
.
length
());
log
.
info
(
"文件:"
+
file
);
InputStream
fileInputStream
=
new
ByteArrayInputStream
(
file
.
getBytes
());
return
fileInputStream
;
}
private
static
void
requestInfoToSocketServer
()
{
try
{
Socket
socket
=
new
Socket
(
"127.0.0.1"
,
7777
);
...
...
amos-boot-system-cas/amos-boot-module-cas-api/src/main/java/com/yeejoin/amos/boot/module/cas/api/service/IdxBizSyncService.java
0 → 100644
View file @
da276d5f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.util.List
;
import
java.sql.*
;
import
java.util.*
;
public
interface
IdxBizSyncService
extends
IService
<
IdxBizXnzs
>
{
// 多个查询(分页)
List
selectAllPageQuery
(
String
tableName
,
Map
params
,
int
current
,
int
size
);
String
getSql
(
String
tableName
,
Map
params
,
int
current
,
int
size
);
}
\ No newline at end of file
amos-boot-system-cas/amos-boot-module-cas-biz/src/main/java/com/yeejoin/amos/boot/module/cas/controller/IdxBizSyncController.java
0 → 100644
View file @
da276d5f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.cas.api.service.IdxBizSyncService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/idx-biz-sync"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
class
IdxBizSyncController
{
@Autowired
private
IdxBizSyncService
idxBizSyncService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/page/{tableName}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
@ResponseBody
public
List
listPage
(
@PathVariable
String
tableName
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestBody
Map
params
)
throws
Exception
{
List
list
=
idxBizSyncService
.
selectAllPageQuery
(
tableName
,
params
,
current
,
size
);
return
list
;
}
}
amos-boot-system-cas/amos-boot-module-cas-biz/src/main/java/com/yeejoin/amos/boot/module/cas/service/impl/IdxBizSyncServiceImpl.java
0 → 100644
View file @
da276d5f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cas
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.cas.api.dto.IdxBizXnzsDto
;
import
com.yeejoin.amos.boot.module.cas.api.entity.IdxBizXnzs
;
import
com.yeejoin.amos.boot.module.cas.api.mapper.IdxBizXnzsMapper
;
import
com.yeejoin.amos.boot.module.cas.api.service.IIdxBizXnzsService
;
import
com.yeejoin.amos.boot.module.cas.api.service.IdxBizSyncService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
IdxBizSyncServiceImpl
extends
BaseService
<
IdxBizXnzsDto
,
IdxBizXnzs
,
IdxBizXnzsMapper
>
implements
IdxBizSyncService
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Override
public
List
selectAllPageQuery
(
String
tableName
,
Map
params
,
int
current
,
int
size
)
{
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
getSql
(
tableName
,
params
,
current
,
size
));
return
list
;
}
@Override
public
String
getSql
(
String
tableName
,
Map
params
,
int
current
,
int
size
)
{
String
sql
=
"select * from "
+
tableName
;
sql
+=
" where "
;
Iterator
<
Map
.
Entry
<
String
,
Object
>>
it
=
params
.
entrySet
().
iterator
();
while
(
it
.
hasNext
())
{
Map
.
Entry
<
String
,
Object
>
entry
=
it
.
next
();
sql
=
sql
+
entry
.
getKey
()
+
" = "
+
"'"
+
entry
.
getValue
()
+
"'"
+
" AND "
;
}
sql
+=
"1 = 1 "
;
sql
+=
" limit "
+
(
current
-
1
)
*
size
+
","
+
size
;
return
sql
;
}
}
amos-boot-system-cas/amos-boot-module-cas-biz/src/main/resources/application-dev.properties
View file @
da276d5f
#DB properties:
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://
172.16.10.210:3306/amos_idx_biz
?allowMultiQueries=true&serverTimezone=GMT%2B8
\
&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://
39.98.45.134:3306/amos_idx
?allowMultiQueries=true&serverTimezone=GMT%2B8
\
&characterEncoding=utf8
&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL
spring.datasource.username
=
root
spring.datasource.password
=
Yeejoin@2020
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/AmosJxiopAnalyseApplication.java
View file @
da276d5f
...
...
@@ -58,7 +58,7 @@ public class AmosJxiopAnalyseApplication {
@Autowired
private
EmqKeeper
emqKeeper
;
//本地是否执行健康指数算法开关
@Value
(
"${openHealth:
tru
e}"
)
@Value
(
"${openHealth:
fals
e}"
)
Boolean
openHealth
;
@Autowired
private
SyncESDataToTdengineMqttListener
syncESDataToTdengineMqttListener
;
...
...
@@ -79,7 +79,7 @@ public class AmosJxiopAnalyseApplication {
@Bean
public
void
initMqtt
()
throws
Exception
{
if
(
!
openHealth
)
{
if
(
openHealth
)
{
//订阅固化周期性数据成功的消息
emqKeeper
.
subscript
(
"sync_esdata_to_tdengine_notice"
,
1
,
syncESDataToTdengineMqttListener
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
da276d5f
...
...
@@ -112,6 +112,14 @@ public class CommonConstans {
}
};
public
static
final
HashMap
<
String
,
String
>
waringPeriodTowaringCycle
=
new
HashMap
<
String
,
String
>()
{
{
put
(
"按时刻"
,
"分钟"
);
put
(
"按小时"
,
"小时"
);
put
(
"按天"
,
"天"
);
}
};
public
static
final
HashMap
<
String
,
String
>
waringPeriodDateFormate
=
new
HashMap
<
String
,
String
>()
{
{
...
...
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 @
da276d5f
...
...
@@ -166,7 +166,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
*/
public
HashMap
<
String
,
Object
>
getFanAlarmTrendAndAlarmAbnormalityList
(
IdxBizFanWarningRecord
idxBizFanWarningRecord
)
{
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
List
<
String
>>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizFanWarningRecord
.
getWarningPeriod
(),
idxBizFanWarningRecord
.
getCONTENT
(),
idxBizFanWarningRecord
.
getPointName
());
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
IdxBizFanHealthIndex
>
idxBizFanHealthIndexList
=
idxBizFanHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizFanHealthIndex
>()
.
eq
(
"GATEWAY_ID"
,
idxBizFanWarningRecord
.
getGatewayId
())
...
...
@@ -176,7 +177,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
.
orderByDesc
(
"ANALYSIS_TIME"
)
.
last
(
"limit 30"
));
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
String
>
yDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
String
startTime
=
""
;
String
endTime
=
""
;
int
idxBizFanHealthIndexListSize
=
idxBizFanHealthIndexList
.
size
();
...
...
@@ -184,7 +185,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
IdxBizFanHealthIndex
idxBizFanHealthIndex
=
idxBizFanHealthIndexList
.
get
(
i
);
xDatas
.
add
(
idxBizFanHealthIndex
.
getANALYSISTIME
());
yDatas
.
add
(
String
.
valueOf
(
idxBizFanHealthIndex
.
getHealthIndex
()
));
yDatas
.
add
(
idxBizFanHealthIndex
.
getHealthIndex
(
));
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"time"
,
idxBizFanHealthIndex
.
getANALYSISTIME
());
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getANOMALY
()).
replace
(
"null"
,
"0.0"
));
...
...
@@ -215,6 +216,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
}
alarmTrendMap
.
put
(
"xDatas"
,
xDatas
);
alarmTrendMap
.
put
(
"yDatas"
,
yDatas
);
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
maxValueAndWaringCycle
.
get
(
"warningCycle"
));
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
// 异常度 alarmAbnormality
int
alarmAbnormalitySize
=
idxBizFanHealthIndexListSize
>=
3
?
3
:
idxBizFanHealthIndexListSize
;
...
...
@@ -233,7 +236,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
*/
public
HashMap
<
String
,
Object
>
getPvAlarmTrendAndAlarmAbnormalityList
(
IdxBizPvWarningRecord
idxBizPvWarningRecord
)
{
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
List
<
String
>>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizPvWarningRecord
.
getWarningPeriod
(),
idxBizPvWarningRecord
.
getCONTENT
(),
idxBizPvWarningRecord
.
getPointName
());
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
IdxBizPvHealthIndex
>
idxBizPvHealthIndexList
=
idxBizPvHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizPvHealthIndex
>()
.
eq
(
"GATEWAY_ID"
,
idxBizPvWarningRecord
.
getGatewayId
())
...
...
@@ -243,7 +247,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
.
orderByDesc
(
"ANALYSIS_TIME"
)
.
last
(
"limit 30"
));
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
String
>
yDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
String
startTime
=
""
;
String
endTime
=
""
;
int
idxBizPvHealthIndexListSize
=
idxBizPvHealthIndexList
.
size
();
...
...
@@ -251,7 +255,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
IdxBizPvHealthIndex
idxBizPvHealthIndex
=
idxBizPvHealthIndexList
.
get
(
i
);
xDatas
.
add
(
idxBizPvHealthIndex
.
getANALYSISTIME
());
yDatas
.
add
(
String
.
valueOf
(
idxBizPvHealthIndex
.
getHealthIndex
()
));
yDatas
.
add
(
idxBizPvHealthIndex
.
getHealthIndex
(
));
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"time"
,
idxBizPvHealthIndex
.
getANALYSISTIME
());
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizPvHealthIndex
.
getANOMALY
()).
replace
(
"null"
,
"0.0"
));
...
...
@@ -282,6 +286,8 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
}
alarmTrendMap
.
put
(
"xDatas"
,
xDatas
);
alarmTrendMap
.
put
(
"yDatas"
,
yDatas
);
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
maxValueAndWaringCycle
.
get
(
"warningCycle"
));
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
// 异常度 alarmAbnormality
int
alarmAbnormalitySize
=
idxBizPvHealthIndexListSize
>=
3
?
3
:
idxBizPvHealthIndexListSize
;
...
...
@@ -608,4 +614,30 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
date
=
DateUtil
.
offsetMinute
(
date
,
offsetMinutes
);
return
DateUtil
.
format
(
date
,
DatePattern
.
NORM_DATETIME_PATTERN
);
}
/**
* 根据预预警类型获取预警周期与预警值
* @return
*/
public
HashMap
<
String
,
Object
>
getWaringCycleAndMaxValueByWaring
(
String
warningPeriod
,
String
warningContenct
,
String
pointName
){
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
warningContenct
=
warningContenct
.
replace
(
pointName
+
"连续"
,
""
);
String
spiltStr
=
CommonConstans
.
waringPeriodTowaringCycle
.
get
(
warningPeriod
);
String
[]
strings
=
warningContenct
.
split
(
spiltStr
);
Double
maxValue
=
0.0
;
Integer
warningCycle
=
0
;
if
(
strings
.
length
==
2
){
if
(
spiltStr
.
equals
(
"分钟"
)){
warningCycle
=
Integer
.
valueOf
(
strings
[
0
])/
10
;
}
else
{
warningCycle
=
Integer
.
valueOf
(
strings
[
0
]);
}
if
(
strings
[
1
].
contains
(
"<"
)){
maxValue
=
Double
.
valueOf
(
strings
[
1
].
split
(
"<"
)[
1
]);
}
}
result
.
put
(
"maxValue"
,
maxValue
);
result
.
put
(
"warningCycle"
,
warningCycle
);
return
result
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
da276d5f
...
...
@@ -1451,11 +1451,13 @@ public class CommonServiceImpl {
// @Scheduled(cron = "0 0/10 * * * ?")
@Async
(
"async"
)
public
void
healthWarningMinuteByFan
()
{
if
(!
openHealth
)
{
return
;
}
String
format
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:00"
);
Date
time
=
DateUtil
.
parse
(
format
,
"yyyy-MM-dd HH:mm:00"
);
logger
.
info
(
"风机---------------------健康指数时间----"
+
time
);
Calendar
calendar
=
Calendar
.
getInstance
();
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
.
getInfluxDBData
();
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizFanPointProcessVariableClassificationDto:
:
getGatewayId
));
...
...
@@ -1722,6 +1724,7 @@ public class CommonServiceImpl {
Calendar
calendar
=
Calendar
.
getInstance
();
String
format
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:00"
);
Date
time
=
DateUtil
.
parse
(
format
,
"yyyy-MM-dd HH:mm:00"
);
logger
.
info
(
"光伏---------------------健康指数时间----"
+
time
);
List
<
IdxBizPvPointProcessVariableClassificationDto
>
data
=
idxBizPvPointProcessVariableClassificationMapper
.
getInfluxDBData
();
Map
<
String
,
List
<
IdxBizPvPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizPvPointProcessVariableClassificationDto:
:
getGatewayId
));
// BoolQueryBuilder boolMustAll = QueryBuilders.boolQuery();
...
...
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 @
da276d5f
...
...
@@ -119,7 +119,8 @@ public class HealthStatusIndicatorServiceImpl {
if
(!
openHealth
){
return
;
}
// Calendar calendar = Calendar.getInstance();
log
.
info
(
"光伏---------------------预警时间----"
+
time
);
// Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -555,6 +556,7 @@ public class HealthStatusIndicatorServiceImpl {
return
;
}
// Calendar calendar = Calendar.getInstance();
log
.
info
(
"风机---------------------预警时间----"
+
time
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
da276d5f
...
...
@@ -749,12 +749,13 @@
SELECT a.*,
row_number() over ( ORDER BY pointName ) AS id
FROM (
SELECT ARAE AS area,
(
SELECT ARAE AS area,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
SUB_SYSTEM AS subSystem,
POINT_NAME AS pointName,
INDEX_ADDRESS AS indexAddress
INDEX_ADDRESS AS indexAddress,
KKS
FROM idx_biz_fan_point_process_variable_classification
WHERE TAG_CODE = '分析变量'
AND ARAE is not null
...
...
@@ -763,13 +764,15 @@
AND SUB_SYSTEM is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
)
UNION ALL
SELECT ARAE AS area,
(
SELECT ARAE AS area,
STATION AS station,
SUBARRAY AS equipmentName,
EQUIPMENT_NAME AS subSystem,
POINT_NAME AS pointName,
INDEX_ADDRESS AS indexAddress
INDEX_ADDRESS AS indexAddress,
KKS
FROM idx_biz_pv_point_process_variable_classification
WHERE TAG_CODE = '分析变量'
AND ARAE is not null
...
...
@@ -778,7 +781,9 @@
AND EQUIPMENT_NAME is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
)
) a
ORDER BY a.station ASC, a.equipmentName ASC, a.equipmentName asc, a.subSystem asc
</select>
<select
id=
"getStationIndexInfo"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
da276d5f
...
...
@@ -9,7 +9,7 @@
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(
now
+ #{index}
,
now,
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
da276d5f
...
...
@@ -42,7 +42,7 @@
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(
now
+ #{index}
,
now,
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, 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