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
20d83c89
Commit
20d83c89
authored
Jul 29, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.升级适配redisxinttiao
parent
fab8e387
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
172 additions
and
251 deletions
+172
-251
ElasticSearchClientConfig.java
...module/elevator/biz/config/ElasticSearchClientConfig.java
+31
-33
EquipmentCategoryServiceImpl.java
...evator/biz/service/impl/EquipmentCategoryServiceImpl.java
+0
-6
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+0
-6
CylinderInfoServiceImpl.java
...levator/flc/biz/service/impl/CylinderInfoServiceImpl.java
+0
-6
application-dev.properties
...e-96333-biz/src/main/resources/application-dev.properties
+1
-1
ElasticSearchClientConfig.java
...module/cylinder/biz/config/ElasticSearchClientConfig.java
+32
-32
EquipmentCategoryServiceImpl.java
...linder/biz/service/impl/EquipmentCategoryServiceImpl.java
+0
-6
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+0
-6
CylinderInfoServiceImpl.java
...ylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
+0
-6
application-dev.properties
...ylinder-biz/src/main/resources/application-dev.properties
+1
-1
ElasticSearchClientConfig.java
...oot/module/jczs/biz/config/ElasticSearchClientConfig.java
+31
-32
EquipmentCategoryServiceImpl.java
...e/jczs/biz/service/impl/EquipmentCategoryServiceImpl.java
+0
-6
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+0
-6
CylinderInfoServiceImpl.java
...le/jczs/flc/biz/service/impl/CylinderInfoServiceImpl.java
+0
-6
application-dev.properties
...le-jczs-biz/src/main/resources/application-dev.properties
+1
-1
ElasticSearchClientConfig.java
...boot/module/tcm/biz/config/ElasticSearchClientConfig.java
+32
-32
EquipmentCategoryServiceImpl.java
...le/tcm/biz/service/impl/EquipmentCategoryServiceImpl.java
+0
-6
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+0
-6
CylinderInfoServiceImpl.java
...ule/tcm/flc/biz/service/impl/CylinderInfoServiceImpl.java
+0
-6
application-dev.properties
...ule-tcm-biz/src/main/resources/application-dev.properties
+2
-1
ElasticSearchClientConfig.java
...boot/module/ymt/biz/config/ElasticSearchClientConfig.java
+31
-33
CylinderFillingRecordServiceImpl.java
...lc/biz/service/impl/CylinderFillingRecordServiceImpl.java
+0
-6
CylinderInfoServiceImpl.java
...ule/ymt/flc/biz/service/impl/CylinderInfoServiceImpl.java
+0
-6
application-dev.properties
...ule-ymt-biz/src/main/resources/application-dev.properties
+1
-1
pom.xml
amos-boot-system-tzs/pom.xml
+9
-0
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/config/ElasticSearchClientConfig.java
View file @
20d83c89
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -17,40 +16,39 @@ import java.util.Arrays;
...
@@ -17,40 +16,39 @@ import java.util.Arrays;
@Configuration
@Configuration
public
class
ElasticSearchClientConfig
{
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Bean
@Bean
(
destroyMethod
=
"close"
)
@Qualifier
(
"highLevelClient"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
try
{
try
{
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
// 连接超时(默认为1秒)
// 连接超时(默认为1秒)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.
setSocketTimeout
(
6000
*
1000
);
.
setSocketTimeout
(
6000
*
1000
);
});
});
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
20d83c89
...
@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
20d83c89
...
@@ -312,12 +312,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
...
@@ -312,12 +312,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
20d83c89
...
@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/resources/application-dev.properties
View file @
20d83c89
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http:/172.16.10.230:9200
spring.elasticsearch.rest.uris
=
http:/
/
172.16.10.230:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
#redis properties:
#redis properties:
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/config/ElasticSearchClientConfig.java
View file @
20d83c89
...
@@ -17,40 +17,40 @@ import java.util.Arrays;
...
@@ -17,40 +17,40 @@ import java.util.Arrays;
@Configuration
@Configuration
public
class
ElasticSearchClientConfig
{
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Bean
@Bean
(
destroyMethod
=
"close"
)
@Qualifier
(
"highLevelClient"
)
@Qualifier
(
"highLevelClient"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
try
{
try
{
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
// 连接超时(默认为1秒)
// 连接超时(默认为1秒)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.
setSocketTimeout
(
6000
*
1000
);
.
setSocketTimeout
(
6000
*
1000
);
});
});
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
20d83c89
...
@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
20d83c89
...
@@ -315,12 +315,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
...
@@ -315,12 +315,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
20d83c89
...
@@ -947,12 +947,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -947,12 +947,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/resources/application-dev.properties
View file @
20d83c89
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http:/172.16.10.230:9200
spring.elasticsearch.rest.uris
=
http:/
/
172.16.10.230:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
#redis properties:
#redis properties:
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/config/ElasticSearchClientConfig.java
View file @
20d83c89
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -17,39 +16,39 @@ import java.util.Arrays;
...
@@ -17,39 +16,39 @@ import java.util.Arrays;
@Configuration
@Configuration
public
class
ElasticSearchClientConfig
{
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Bean
@Bean
(
destroyMethod
=
"close"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
try
{
try
{
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
// 连接超时(默认为1秒)
// 连接超时(默认为1秒)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.
setSocketTimeout
(
6000
*
1000
);
.
setSocketTimeout
(
6000
*
1000
);
});
});
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
20d83c89
...
@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1323,12 +1323,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
20d83c89
...
@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
...
@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/java/com/yeejoin/amos/boot/module/jczs/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
20d83c89
...
@@ -878,12 +878,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -878,12 +878,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-jczs/amos-boot-module-jczs-biz/src/main/resources/application-dev.properties
View file @
20d83c89
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
...
@@ -14,7 +14,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http:/172.16.10.230:9200
spring.elasticsearch.rest.uris
=
http:/
/
172.16.10.230:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
#redis properties:
#redis properties:
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/config/ElasticSearchClientConfig.java
View file @
20d83c89
...
@@ -8,47 +8,47 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
...
@@ -8,47 +8,47 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.Arrays
;
import
java.util.Arrays
;
@Configuration
@Configuration
public
class
ElasticSearchClientConfig
{
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Bean
@Bean
(
destroyMethod
=
"close"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
try
{
try
{
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
// 连接超时(默认为1秒)
// 连接超时(默认为1秒)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.
setSocketTimeout
(
6000
*
1000
);
.
setSocketTimeout
(
6000
*
1000
);
});
});
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
20d83c89
...
@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1324,12 +1324,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
}
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
20d83c89
...
@@ -314,12 +314,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
...
@@ -314,12 +314,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
20d83c89
...
@@ -876,12 +876,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -876,12 +876,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/resources/application-dev.properties
View file @
20d83c89
...
@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
...
@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http:/172.16.10.230:9200
spring.elasticsearch.rest.uris
=
http:/
/
172.16.10.230:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
#redis properties:
#redis properties:
...
@@ -27,6 +27,7 @@ spring.redis.lettuce.pool.max-active=200
...
@@ -27,6 +27,7 @@ spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-wait
=
-1
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.max-idle
=
10
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.lettuce.pool.min-idle
=
0
spring.redis.mode
=
cluster
## emqx properties:
## emqx properties:
emqx.clean-session
=
false
emqx.clean-session
=
false
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/config/ElasticSearchClientConfig.java
View file @
20d83c89
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
...
@@ -8,7 +8,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -17,40 +16,39 @@ import java.util.Arrays;
...
@@ -17,40 +16,39 @@ import java.util.Arrays;
@Configuration
@Configuration
public
class
ElasticSearchClientConfig
{
public
class
ElasticSearchClientConfig
{
@Value
(
"${spring.elasticsearch.rest.uris}"
)
@Value
(
"${spring.elasticsearch.rest.uris}"
)
private
String
uris
;
private
String
uris
;
@Value
(
"${elasticsearch.username}"
)
@Value
(
"${elasticsearch.username}"
)
private
String
username
;
private
String
username
;
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Bean
@Bean
(
destroyMethod
=
"close"
)
@Qualifier
(
"highLevelClient"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
credentialsProvider
.
setCredentials
(
AuthScope
.
ANY
,
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
try
{
try
{
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
HttpHost
[]
httpHosts
=
Arrays
.
stream
(
uris
.
split
(
","
)).
map
(
HttpHost:
:
create
).
toArray
(
HttpHost
[]::
new
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
builder
.
setRequestConfigCallback
(
requestConfigBuilder
->
{
// 连接超时(默认为1秒)
// 连接超时(默认为1秒)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
return
requestConfigBuilder
.
setConnectTimeout
(
5000
*
1000
)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.
setSocketTimeout
(
6000
*
1000
);
.
setSocketTimeout
(
6000
*
1000
);
});
});
return
new
RestHighLevelClient
(
builder
);
return
new
RestHighLevelClient
(
builder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
throw
new
IllegalStateException
(
"Invalid ES nodes "
+
"property '"
+
uris
+
"'"
,
e
);
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/flc/biz/service/impl/CylinderFillingRecordServiceImpl.java
View file @
20d83c89
...
@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
...
@@ -313,12 +313,6 @@ public class CylinderFillingRecordServiceImpl extends BaseService<CylinderFillin
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
20d83c89
...
@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
...
@@ -877,12 +877,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
result
.
setTotal
(
totle
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
restHighLevelClient
.
close
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
return
result
;
return
result
;
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/resources/application-dev.properties
View file @
20d83c89
...
@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
...
@@ -15,7 +15,7 @@ eureka.instance.ip-address=172.16.3.34
## ES properties:
## ES properties:
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
spring.elasticsearch.rest.uris
=
http:/172.16.10.230:9200
spring.elasticsearch.rest.uris
=
http:/
/
172.16.10.230:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
#redis properties:
#redis properties:
...
...
amos-boot-system-tzs/pom.xml
View file @
20d83c89
...
@@ -28,6 +28,10 @@
...
@@ -28,6 +28,10 @@
<artifactId>
poi-ooxml
</artifactId>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusion>
<exclusion>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-security
</artifactId>
</exclusion>
</exclusions>
</exclusions>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -65,6 +69,11 @@
...
@@ -65,6 +69,11 @@
<artifactId>
logstash-logback-encoder
</artifactId>
<artifactId>
logstash-logback-encoder
</artifactId>
<version>
6.3
</version>
<version>
6.3
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-security
</artifactId>
<version>
${amos.version.tzs}
</version>
</dependency>
</dependencies>
</dependencies>
...
...
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