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
f5dfab98
Commit
f5dfab98
authored
Aug 08, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加es
parent
8caa8b83
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
305 additions
and
49 deletions
+305
-49
ESEquipments.java
...eejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
+87
-0
ElasticSearchClientConfig.java
...ot/module/jxiop/biz/config/ElasticSearchClientConfig.java
+67
-0
DemoController.java
...amos/boot/module/jxiop/biz/controller/DemoController.java
+121
-47
ESEquipmentsRepository.java
...t/module/jxiop/biz/repository/ESEquipmentsRepository.java
+14
-0
application.properties
...iop-monitor-biz/src/main/resources/application.properties
+16
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/ESDto/ESEquipments.java
0 → 100644
View file @
f5dfab98
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
ESDto
;
import
io.github.classgraph.json.Id
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.elasticsearch.annotations.DateFormat
;
import
org.springframework.data.elasticsearch.annotations.Document
;
import
org.springframework.data.elasticsearch.annotations.Field
;
import
org.springframework.data.elasticsearch.annotations.FieldType
;
import
java.util.Date
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/8
*/
@Data
@Accessors
(
chain
=
true
)
@Document
(
indexName
=
"jxiop_equipments"
)
public
class
ESEquipments
{
@Id
private
String
id
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
address
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
dataType
;
@Field
(
type
=
FieldType
.
Text
)
private
String
equipmentSpecificName
;
@Field
(
type
=
FieldType
.
Text
)
private
String
gatewayId
;
@Field
(
type
=
FieldType
.
Text
)
private
String
isAlarm
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
basic_date_time
,
index
=
false
)
private
Date
createdTime
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
unit
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
,
fielddata
=
true
)
private
String
value
;
@Field
(
type
=
FieldType
.
Double
,
index
=
false
,
fielddata
=
true
)
private
Double
valueDouble
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
valueLabel
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
traceId
;
@Field
(
type
=
FieldType
.
Text
)
private
String
equipmentIndexName
;
@Field
(
type
=
FieldType
.
Text
)
private
String
equipmentNumber
;
@Field
(
type
=
FieldType
.
Text
)
private
String
frontModule
;
@Field
(
type
=
FieldType
.
Text
)
private
String
systemType
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
pictureName
;
@Field
(
type
=
FieldType
.
Text
,
index
=
false
)
private
String
displayName
;
public
ESEquipments
(
Double
valueDouble
,
String
id
,
String
address
,
String
dataType
,
String
equipmentSpecificName
,
String
gatewayId
,
String
isAlarm
,
Date
createdTime
,
String
unit
,
String
value
,
String
valueLabel
,
String
traceId
,
String
equipmentIndexName
,
String
equipmentNumber
,
String
frontModule
,
String
systemType
,
String
pictureName
,
String
displayName
)
{
this
.
valueDouble
=
valueDouble
;
this
.
id
=
id
;
this
.
address
=
address
;
this
.
dataType
=
dataType
;
this
.
equipmentSpecificName
=
equipmentSpecificName
;
this
.
gatewayId
=
gatewayId
;
this
.
isAlarm
=
isAlarm
;
this
.
createdTime
=
createdTime
;
this
.
unit
=
unit
;
this
.
value
=
value
;
this
.
valueLabel
=
valueLabel
;
this
.
traceId
=
traceId
;
this
.
equipmentIndexName
=
equipmentIndexName
;
this
.
equipmentNumber
=
equipmentNumber
;
this
.
frontModule
=
frontModule
;
this
.
systemType
=
systemType
;
this
.
pictureName
=
pictureName
;
this
.
displayName
=
displayName
;
}
public
ESEquipments
()
{
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/config/ElasticSearchClientConfig.java
0 → 100644
View file @
f5dfab98
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
config
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpHost
;
import
org.apache.http.auth.AuthScope
;
import
org.apache.http.auth.Credentials
;
import
org.apache.http.auth.UsernamePasswordCredentials
;
import
org.apache.http.client.CredentialsProvider
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.impl.client.BasicCredentialsProvider
;
import
org.apache.http.impl.nio.client.HttpAsyncClientBuilder
;
import
org.apache.http.message.BasicHeader
;
import
org.apache.tomcat.util.codec.binary.Base64
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
@Bean
@Qualifier
(
"highLevelClient"
)
public
RestHighLevelClient
restHighLevelClient
()
{
try
{
String
url
=
uris
.
replace
(
"http://"
,
""
);
final
String
[]
parts
=
StringUtils
.
split
(
url
,
":"
);
HttpHost
httpHost
=
new
HttpHost
(
parts
[
0
],
Integer
.
parseInt
(
parts
[
1
]),
"http"
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHost
);
//增加安全配置,使用kibana,勿删
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
builder
.
setRequestConfigCallback
(
new
RestClientBuilder
.
RequestConfigCallback
()
{
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
@Override
public
RequestConfig
.
Builder
customizeRequestConfig
(
RequestConfig
.
Builder
requestConfigBuilder
)
{
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 连接超时(默认为1秒)
.
setSocketTimeout
(
6000
*
1000
);
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
}
});
// 调整最大重试超时时间(默认为30秒).setMaxRetryTimeoutMillis(60000);
//增加安全配置,使用kibana,勿删
builder
.
setHttpClientConfigCallback
(
new
RestClientBuilder
.
HttpClientConfigCallback
()
{
@Override
public
HttpAsyncClientBuilder
customizeHttpClient
(
HttpAsyncClientBuilder
httpClientBuilder
)
{
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
}
});
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/DemoController.java
View file @
f5dfab98
...
@@ -9,8 +9,10 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
...
@@ -9,8 +9,10 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.IndicatorsDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.Test
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.Test
;
import
com.yeejoin.amos.boot.module.jxiop.biz.repository.ESEquipmentsRepository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils
;
...
@@ -21,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -21,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
...
@@ -54,6 +57,10 @@ public class DemoController extends BaseController {
...
@@ -54,6 +57,10 @@ public class DemoController extends BaseController {
@Autowired
@Autowired
private
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
private
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
@Autowired
private
ElasticsearchRestTemplate
elasticsearchTemplate
;
@Autowired
ESEquipmentsRepository
equipmentsRepository
;
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"demo测试prodcutcion 库"
)
@ApiOperation
(
value
=
"demo测试prodcutcion 库"
)
...
@@ -84,12 +91,14 @@ public class DemoController extends BaseController {
...
@@ -84,12 +91,14 @@ public class DemoController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"初始化influxdb-风电、光伏、升压站"
)
@ApiOperation
(
value
=
"初始化influxdb-风电、光伏、升压站"
)
@GetMapping
(
"/test4"
)
@GetMapping
(
"/test4"
)
public
void
demoTest3
()
{
public
ResponseModel
<
Integer
>
demoTest3
()
{
//数据说明 夏造风电、泰和光伏、夏造升压站、泰和升压站
//数据说明 夏造风电、泰和光伏、夏造升压站、泰和升压站
String
[]
strings
=
{
"1668801435891929089"
,
"1669524885619085313"
};
String
[]
strings
=
{
"1668801435891929089"
,
"1669524885619085313"
};
// String [] strings = {"1669524885619085313"};
// String [] strings = {"1669524885619085313"};
// Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
// Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
// System.out.println(o.toString());
// System.out.println(o.toString());
elasticsearchTemplate
.
deleteIndex
(
ESEquipments
.
class
);
int
num
=
0
;
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++)
{
QueryWrapper
<
MonitorFanIndicator
>
QueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
MonitorFanIndicator
>
QueryWrapper
=
new
QueryWrapper
<>();
// 夏造风电
// 夏造风电
...
@@ -99,33 +108,61 @@ public class DemoController extends BaseController {
...
@@ -99,33 +108,61 @@ public class DemoController extends BaseController {
long
DATE
=
new
Date
().
getTime
();
long
DATE
=
new
Date
().
getTime
();
System
.
out
.
println
(
DATE
);
System
.
out
.
println
(
DATE
);
List
<
MonitorFanIndicator
>
list
=
monitorFanIndicatorregionMapper
.
selectList
(
QueryWrapper
);
List
<
MonitorFanIndicator
>
list
=
monitorFanIndicatorregionMapper
.
selectList
(
QueryWrapper
);
num
=
num
+
list
.
size
();
List
<
ESEquipments
>
listit
=
new
ArrayList
<>();
for
(
MonitorFanIndicator
monitorFanIndicator
:
list
)
{
for
(
MonitorFanIndicator
monitorFanIndicator
:
list
)
{
Map
<
String
,
String
>
tag
=
new
HashMap
<>();
Map
<
String
,
Object
>
maps2
=
new
HashMap
<>();
ESEquipments
eSEquipments
=
new
ESEquipments
(
0.33355
,
maps2
.
put
(
"address"
,
monitorFanIndicator
.
getIndexAddress
());
monitorFanIndicator
.
getAddressGateway
(),
maps2
.
put
(
"dataType"
,
monitorFanIndicator
.
getDataType
());
monitorFanIndicator
.
getIndexAddress
(),
maps2
.
put
(
"equipmentSpecificName"
,
monitorFanIndicator
.
getFanCode
());
monitorFanIndicator
.
getDataType
(),
tag
.
put
(
"equipmentsIdx"
,
monitorFanIndicator
.
getAddressGateway
());
monitorFanIndicator
.
getFanCode
(),
maps2
.
put
(
"gatewayId"
,
monitorFanIndicator
.
getGateway
());
monitorFanIndicator
.
getGateway
(),
maps2
.
put
(
"isAlarm"
,
monitorFanIndicator
.
getIsAlarm
());
monitorFanIndicator
.
getIsAlarm
(),
maps2
.
put
(
"createdTime"
,
"2023-07-05 18:30:26"
);
new
Date
(),
maps2
.
put
(
"unit"
,
monitorFanIndicator
.
getUnit
());
monitorFanIndicator
.
getUnit
(),
maps2
.
put
(
"value"
,
""
);
""
,
maps2
.
put
(
"valueLabel"
,
""
);
""
,
maps2
.
put
(
"traceId"
,
""
);
""
,
maps2
.
put
(
"equipmentIndexName"
,
monitorFanIndicator
.
getIndicator
());
monitorFanIndicator
.
getIndicator
(),
maps2
.
put
(
"equipmentNumber"
,
monitorFanIndicator
.
getEquipmentNumber
());
monitorFanIndicator
.
getEquipmentNumber
(),
maps2
.
put
(
"frontModule"
,
monitorFanIndicator
.
getFrontModule
());
monitorFanIndicator
.
getFrontModule
(),
maps2
.
put
(
"systemType"
,
monitorFanIndicator
.
getSystemType
());
monitorFanIndicator
.
getSystemType
(),
maps2
.
put
(
"pictureName"
,
monitorFanIndicator
.
getPictureName
());
monitorFanIndicator
.
getPictureName
(),
//升压站的字段显示名称
""
);
maps2
.
put
(
"displayName"
,
""
);
influxDbConnection
.
insert
(
"indicators_"
+
monitorFanIndicator
.
getGateway
(),
tag
,
maps2
,
1688558007051L
,
TimeUnit
.
MILLISECONDS
);
listit
.
add
(
eSEquipments
);
// Map<String, String> tag = new HashMap<>();
// Map<String, Object> maps2 = new HashMap<>();
//
// maps2.put("address", monitorFanIndicator.getIndexAddress());
// maps2.put("dataType", monitorFanIndicator.getDataType());
// maps2.put("equipmentSpecificName", monitorFanIndicator.getFanCode());
// tag.put("equipmentsIdx", monitorFanIndicator.getAddressGateway());
// maps2.put("gatewayId", monitorFanIndicator.getGateway());
// maps2.put("isAlarm", monitorFanIndicator.getIsAlarm());
// maps2.put("createdTime", "2023-07-05 18:30:26");
// maps2.put("unit", monitorFanIndicator.getUnit());
// maps2.put("value", "");
// maps2.put("valueLabel","" );
// maps2.put("traceId", "");
// maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator());
// maps2.put("equipmentNumber", monitorFanIndicator.getEquipmentNumber());
// maps2.put("frontModule", monitorFanIndicator.getFrontModule());
// maps2.put("systemType", monitorFanIndicator.getSystemType());
// maps2.put("pictureName", monitorFanIndicator.getPictureName());
// //升压站的字段显示名称
// maps2.put("displayName", "");
// influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS);
}
}
equipmentsRepository
.
saveAll
(
listit
);
}
}
return
ResponseHelper
.
buildResponse
(
num
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -147,12 +184,14 @@ public class DemoController extends BaseController {
...
@@ -147,12 +184,14 @@ public class DemoController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"初始化升压站"
)
@ApiOperation
(
value
=
"初始化升压站"
)
@GetMapping
(
"/test6"
)
@GetMapping
(
"/test6"
)
public
void
demoTest5
()
{
public
ResponseModel
<
Integer
>
demoTest5
()
{
//数据说明 夏造风电、泰和光伏、夏造升压站、泰和升压站
//数据说明 夏造风电、泰和光伏、夏造升压站、泰和升压站
String
[]
strings
=
{
"1668801570352926721"
,
"1669525017559306241"
};
String
[]
strings
=
{
"1668801570352926721"
,
"1669525017559306241"
};
// String [] strings = {"1669525017559306241"};
// String [] strings = {"1669525017559306241"};
// Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
// Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
// System.out.println(o.toString());
// System.out.println(o.toString());
int
num
=
0
;
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
strings
.
length
;
i
++)
{
QueryWrapper
<
MonitorFanIndicator
>
QueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
MonitorFanIndicator
>
QueryWrapper
=
new
QueryWrapper
<>();
// 夏造风电
// 夏造风电
...
@@ -162,32 +201,67 @@ public class DemoController extends BaseController {
...
@@ -162,32 +201,67 @@ public class DemoController extends BaseController {
long
DATE
=
new
Date
().
getTime
();
long
DATE
=
new
Date
().
getTime
();
System
.
out
.
println
(
DATE
);
System
.
out
.
println
(
DATE
);
List
<
MonitorFanIndicator
>
list
=
monitorFanIndicatorregionMapper
.
selectList
(
QueryWrapper
);
List
<
MonitorFanIndicator
>
list
=
monitorFanIndicatorregionMapper
.
selectList
(
QueryWrapper
);
num
=
num
+
list
.
size
();
List
<
ESEquipments
>
listit
=
new
ArrayList
<>();
for
(
MonitorFanIndicator
monitorFanIndicator
:
list
)
{
for
(
MonitorFanIndicator
monitorFanIndicator
:
list
)
{
Map
<
String
,
String
>
tag
=
new
HashMap
<>();
Map
<
String
,
Object
>
maps2
=
new
HashMap
<>();
ESEquipments
eSEquipments
=
new
ESEquipments
(
maps2
.
put
(
"address"
,
monitorFanIndicator
.
getIndexAddress
());
0.33355
,
maps2
.
put
(
"dataType"
,
monitorFanIndicator
.
getDataType
());
monitorFanIndicator
.
getAddressGateway
(),
maps2
.
put
(
"equipmentSpecificName"
,
monitorFanIndicator
.
getFanCode
());
monitorFanIndicator
.
getIndexAddress
(),
tag
.
put
(
"equipmentsIdx"
,
monitorFanIndicator
.
getAddressGateway
());
monitorFanIndicator
.
getDataType
(),
maps2
.
put
(
"gatewayId"
,
monitorFanIndicator
.
getGateway
());
monitorFanIndicator
.
getFanCode
(),
maps2
.
put
(
"isAlarm"
,
monitorFanIndicator
.
getIsAlarm
());
monitorFanIndicator
.
getGateway
(),
maps2
.
put
(
"createdTime"
,
"2023-07-05 18:30:26"
);
monitorFanIndicator
.
getIsAlarm
(),
maps2
.
put
(
"unit"
,
monitorFanIndicator
.
getUnit
());
new
Date
(),
maps2
.
put
(
"value"
,
""
);
monitorFanIndicator
.
getUnit
(),
maps2
.
put
(
"valueLabel"
,
""
);
""
,
maps2
.
put
(
"traceId"
,
""
);
""
,
maps2
.
put
(
"equipmentIndexName"
,
monitorFanIndicator
.
getIndicator
());
""
,
maps2
.
put
(
"equipmentNumber"
,
monitorFanIndicator
.
getEquipmentNumber
());
monitorFanIndicator
.
getIndicator
(),
maps2
.
put
(
"frontModule"
,
monitorFanIndicator
.
getFrontModule
());
monitorFanIndicator
.
getEquipmentNumber
(),
maps2
.
put
(
"systemType"
,
monitorFanIndicator
.
getSystemType
());
monitorFanIndicator
.
getFrontModule
(),
maps2
.
put
(
"pictureName"
,
monitorFanIndicator
.
getPictureName
());
monitorFanIndicator
.
getSystemType
(),
//升压站的字段显示名称
monitorFanIndicator
.
getPictureName
(),
maps2
.
put
(
"displayName"
,
monitorFanIndicator
.
getEquipmentNumber
());
monitorFanIndicator
.
getEquipmentNumber
()
);
influxDbConnection
.
insert
(
"indicators_"
+
monitorFanIndicator
.
getGateway
(),
tag
,
maps2
,
1688558007051L
,
TimeUnit
.
MILLISECONDS
);
listit
.
add
(
eSEquipments
);
// Map<String, String> tag = new HashMap<>();
// Map<String, Object> maps2 = new HashMap<>();
//
// maps2.put("address", monitorFanIndicator.getIndexAddress());
// maps2.put("dataType", monitorFanIndicator.getDataType());
// maps2.put("equipmentSpecificName", monitorFanIndicator.getFanCode());
// tag.put("equipmentsIdx", monitorFanIndicator.getAddressGateway());
// maps2.put("gatewayId", monitorFanIndicator.getGateway());
// maps2.put("isAlarm", monitorFanIndicator.getIsAlarm());
// maps2.put("createdTime", "2023-07-05 18:30:26");
// maps2.put("unit", monitorFanIndicator.getUnit());
// maps2.put("value", "");
// maps2.put("valueLabel","" );
// maps2.put("traceId", "");
// maps2.put("equipmentIndexName", monitorFanIndicator.getIndicator());
// maps2.put("equipmentNumber", monitorFanIndicator.getEquipmentNumber());
// maps2.put("frontModule", monitorFanIndicator.getFrontModule());
// maps2.put("systemType", monitorFanIndicator.getSystemType());
// maps2.put("pictureName", monitorFanIndicator.getPictureName());
// //升压站的字段显示名称
// maps2.put("displayName", monitorFanIndicator.getEquipmentNumber());
// influxDbConnection.insert("indicators_" + monitorFanIndicator.getGateway(), tag, maps2, 1688558007051L, TimeUnit.MILLISECONDS);
}
}
equipmentsRepository
.
saveAll
(
listit
);
}
}
return
ResponseHelper
.
buildResponse
(
num
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/repository/ESEquipmentsRepository.java
0 → 100644
View file @
f5dfab98
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
repository
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/8
*/
@Repository
public
interface
ESEquipmentsRepository
extends
PagingAndSortingRepository
<
ESEquipments
,
String
>
{
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/application.properties
View file @
f5dfab98
...
@@ -73,4 +73,18 @@ station.isok=false
...
@@ -73,4 +73,18 @@ station.isok=false
station.section
=
10
station.section
=
10
gl.sum.column
=
日发电量,月发电量,年发电量
gl.sum.column
=
日发电量,月发电量,年发电量
gl.avg.column
=
有功功率,日利用小时,瞬时风速
gl.avg.column
=
有功功率,日利用小时,瞬时风速
\ No newline at end of file
spring.elasticsearch.rest.uris
=
http://39.98.224.23:9200
spring.elasticsearch.rest.connection-timeout
=
30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
123456
spring.elasticsearch.rest.read-timeout
=
30000
#elasticsearch.username= elastic
#
elasticsearch.password
=
123456
\ No newline at end of file
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