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
f1eeb03d
Commit
f1eeb03d
authored
Dec 11, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.压测优化
parent
fe0d7933
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
174 additions
and
40 deletions
+174
-40
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+1
-0
CacheHelper.java
...a/com/yeejoin/amos/patrol/business/cache/CacheHelper.java
+14
-1
CheckController.java
...join/amos/patrol/business/controller/CheckController.java
+5
-3
CheckRecordDataConsumer.java
...in/amos/patrol/business/data/CheckRecordDataConsumer.java
+4
-2
EsEntity.java
...n/java/com/yeejoin/amos/patrol/business/dto/EsEntity.java
+27
-0
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+86
-30
ElasticSearchClientConfig.java
...yeejoin/amos/patrol/config/ElasticSearchClientConfig.java
+9
-0
ElasticSearchRestTemplateConfig.java
...n/amos/patrol/config/ElasticSearchRestTemplateConfig.java
+18
-0
application-dev.properties
...spatrol-biz/src/main/resources/application-dev.properties
+7
-2
application.properties
...e-tzspatrol-biz/src/main/resources/application.properties
+3
-2
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
f1eeb03d
...
@@ -116,6 +116,7 @@ public class ControllerAop {
...
@@ -116,6 +116,7 @@ public class ControllerAop {
urls
.
add
(
"/tcm/userInfo/getPersonType"
);
urls
.
add
(
"/tcm/userInfo/getPersonType"
);
// urls.add("/patrol/api/check/checkCalendarForWx");
// urls.add("/patrol/api/check/checkCalendarForWx");
urls
.
add
(
"/patrol/api/check/saveRecordAll"
);
urls
.
add
(
"/patrol/api/check/saveRecordAll"
);
urls
.
add
(
"/patrol/api/check/saveRecordAll2"
);
urls
.
add
(
"/patrol/api/planTask/queryPlanTaskNew"
);
urls
.
add
(
"/patrol/api/planTask/queryPlanTaskNew"
);
// 获取请求路径
// 获取请求路径
for
(
String
uri
:
urls
)
{
for
(
String
uri
:
urls
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/cache/CacheHelper.java
View file @
f1eeb03d
...
@@ -24,10 +24,23 @@ public class CacheHelper {
...
@@ -24,10 +24,23 @@ public class CacheHelper {
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
List
<
InputItem
>
inputItems
=
iInputItemDao
.
findAll
();
List
<
InputItem
>
inputItems
=
iInputItemDao
.
findAll
();
inputItems
.
forEach
(
inputItem
->
redisUtils
.
hset
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
String
.
valueOf
(
inputItem
.
getId
()),
inputItem
));
redisUtils
.
del
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
);
inputItems
.
forEach
(
inputItem
->
redisUtils
.
hset
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
String
.
valueOf
(
inputItem
.
getId
()),
inputItem
,
3600
));
}
}
public
InputItem
getInputItemCacheData
(
String
inputItemId
)
{
public
InputItem
getInputItemCacheData
(
String
inputItemId
)
{
if
(
redisUtils
.
hHasKey
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
)){
return
(
InputItem
)
redisUtils
.
hget
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
);
return
(
InputItem
)
redisUtils
.
hget
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
);
}
else
{
synchronized
(
this
){
if
(
redisUtils
.
hHasKey
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
)){
return
(
InputItem
)
redisUtils
.
hget
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
);
}
else
{
List
<
InputItem
>
inputItems
=
iInputItemDao
.
findAll
();
inputItems
.
forEach
(
inputItem
->
redisUtils
.
hset
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
String
.
valueOf
(
inputItem
.
getId
()),
inputItem
,
3600
));
return
(
InputItem
)
redisUtils
.
hget
(
P_INPUT_ITEM_REDIS_KEY_PREFIX
,
inputItemId
);
}
}
}
}
}
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/CheckController.java
View file @
f1eeb03d
...
@@ -230,10 +230,11 @@ public class CheckController extends AbstractBaseController {
...
@@ -230,10 +230,11 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"一键提交巡检任务"
,
notes
=
"一键提交巡检任务<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"一键提交巡检任务"
,
notes
=
"一键提交巡检任务<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/saveRecordAll"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/saveRecordAll
2
"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
Object
>
saveCheckRecordAll
(
@RequestParam
String
ids
)
{
public
ResponseModel
<
Object
>
saveCheckRecordAll
(
@RequestParam
String
ids
)
{
String
userId
=
RequestContext
.
getExeUserId
();
String
userId
=
RequestContext
.
getExeUserId
();
try
{
try
{
// 查询数据库和es 单线程串行执行
UserTransmittableUtils
.
setUser
();
UserTransmittableUtils
.
setUser
();
planTaskService
.
handleAllBatch
(
ids
,
userId
);
planTaskService
.
handleAllBatch
(
ids
,
userId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -246,10 +247,11 @@ public class CheckController extends AbstractBaseController {
...
@@ -246,10 +247,11 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"一键提交巡检任务"
,
notes
=
"一键提交巡检任务<font color='blue'>手机app</font>"
)
@ApiOperation
(
value
=
"一键提交巡检任务"
,
notes
=
"一键提交巡检任务<font color='blue'>手机app</font>"
)
@RequestMapping
(
value
=
"/saveRecordAll
2
"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/saveRecordAll"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
ResponseModel
<
Object
>
saveCheckRecordAll
1
(
@RequestParam
String
ids
)
{
public
ResponseModel
<
Object
>
saveCheckRecordAll
2
(
@RequestParam
String
ids
)
{
String
userId
=
RequestContext
.
getExeUserId
();
String
userId
=
RequestContext
.
getExeUserId
();
try
{
try
{
// 查询数据库和es 多线程并行执行
UserTransmittableUtils
.
setUser
();
UserTransmittableUtils
.
setUser
();
planTaskService
.
handleAllBatch2
(
ids
,
userId
);
planTaskService
.
handleAllBatch2
(
ids
,
userId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/data/CheckRecordDataConsumer.java
View file @
f1eeb03d
...
@@ -96,8 +96,10 @@ public class CheckRecordDataConsumer implements Runnable {
...
@@ -96,8 +96,10 @@ public class CheckRecordDataConsumer implements Runnable {
}
}
private
AgencyUserModel
getAgencyUserModel
(
RequestContextModel
requestContextModel
)
{
private
AgencyUserModel
getAgencyUserModel
(
RequestContextModel
requestContextModel
)
{
List
<
AgencyUserModel
>
agencyUserModels
=
FeignUtil
.
remoteCall
(()->
Privilege
.
agencyUserClient
.
queryByIds
(
requestContextModel
.
getExcutedUserId
(),
false
));
// 记录暂时不用 注释掉
return
agencyUserModels
.
get
(
0
);
//List<AgencyUserModel> agencyUserModels = FeignUtil.remoteCall(()->Privilege.agencyUserClient.queryByIds(requestContextModel.getExcutedUserId(),false));
// return agencyUserModels.get(0);
return
null
;
}
}
private
void
setRequestContext
(){
private
void
setRequestContext
(){
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dto/EsEntity.java
0 → 100644
View file @
f1eeb03d
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
dto
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
*
* @author LiuLin
* @date 2023年10月11日 09:31
*/
@Setter
@Getter
public
final
class
EsEntity
<
T
>
{
private
String
id
;
private
T
data
;
public
EsEntity
()
{
}
public
EsEntity
(
String
id
,
T
data
)
{
this
.
data
=
data
;
this
.
id
=
id
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/PlanTaskServiceImpl.java
View file @
f1eeb03d
...
@@ -52,20 +52,22 @@ import com.yeejoin.amos.patrol.exception.YeeException;
...
@@ -52,20 +52,22 @@ import com.yeejoin.amos.patrol.exception.YeeException;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.feign.RemoteSecurityService
;
import
com.yeejoin.amos.patrol.quartz.IJobService
;
import
com.yeejoin.amos.patrol.quartz.IJobService
;
import
com.yeejoin.amos.patrol.utils.UserTransmittableUtils
;
import
com.yeejoin.amos.patrol.utils.UserTransmittableUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.compress.utils.Lists
;
import
org.apache.commons.compress.utils.Lists
;
import
org.apache.commons.compress.utils.Sets
;
import
org.apache.commons.compress.utils.Sets
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.bulk.BulkRequest
;
import
org.elasticsearch.action.index.IndexRequest
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.common.xcontent.XContentType
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -118,8 +120,8 @@ import static com.alibaba.fastjson.JSON.toJSONString;
...
@@ -118,8 +120,8 @@ import static com.alibaba.fastjson.JSON.toJSONString;
@Service
(
"planTaskService"
)
@Service
(
"planTaskService"
)
@EnableAsync
@EnableAsync
@Slf4j
public
class
PlanTaskServiceImpl
implements
IPlanTaskService
{
public
class
PlanTaskServiceImpl
implements
IPlanTaskService
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
PlanTaskServiceImpl
.
class
);
@Resource
@Resource
private
DataSource
dataSource
;
private
DataSource
dataSource
;
...
@@ -437,7 +439,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -437,7 +439,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
throw
new
YeeException
(
"计划不存在"
);
throw
new
YeeException
(
"计划不存在"
);
}
}
// 校验计划数据是否异常
// 校验计划数据是否异常
if
(!
checkData
(
plan
.
getId
())){
if
(!
checkData
(
plan
.
getId
()))
{
throw
new
YeeException
(
"计划数据异常!"
);
throw
new
YeeException
(
"计划数据异常!"
);
}
}
//2.数据必输校验,不满足直接return,不再向下进行
//2.数据必输校验,不满足直接return,不再向下进行
...
@@ -691,6 +693,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -691,6 +693,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
/**
/**
* 校验计划数据是否异常
* 校验计划数据是否异常
*
* @return
* @return
*/
*/
private
Boolean
checkData
(
Long
planId
)
{
private
Boolean
checkData
(
Long
planId
)
{
...
@@ -699,6 +702,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -699,6 +702,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
return
false
;
return
false
;
}
}
/**
/**
* 自动任务执行
* 自动任务执行
*/
*/
...
@@ -722,7 +726,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -722,7 +726,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
for
(
Plan
plan
:
planList
)
{
for
(
Plan
plan
:
planList
)
{
// 校验计划数据是否异常
// 校验计划数据是否异常
if
(!
checkData
(
plan
.
getId
())){
if
(!
checkData
(
plan
.
getId
()))
{
continue
;
continue
;
}
}
// tzs修改为查询用户组id
// tzs修改为查询用户组id
...
@@ -1129,12 +1133,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1129,12 +1133,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
for
(
Map
<
String
,
String
>
excludeItem
:
excludeItems
)
{
for
(
Map
<
String
,
String
>
excludeItem
:
excludeItems
)
{
List
<
AppCheckInputRespone
>
appCheckInputRespones
=
collect2
.
get
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)));
List
<
AppCheckInputRespone
>
appCheckInputRespones
=
collect2
.
get
(
String
.
valueOf
(
excludeItem
.
get
(
"point_id"
)));
if
(
excludeItem
.
containsKey
(
"exclude_items"
)
&&
!
ObjectUtils
.
isEmpty
(
excludeItem
.
get
(
"exclude_items"
))){
if
(
excludeItem
.
containsKey
(
"exclude_items"
)
&&
!
ObjectUtils
.
isEmpty
(
excludeItem
.
get
(
"exclude_items"
)))
{
String
[]
exclude_items
=
excludeItem
.
get
(
"exclude_items"
).
split
(
","
);
String
[]
exclude_items
=
excludeItem
.
get
(
"exclude_items"
).
split
(
","
);
List
<
AppCheckInputRespone
>
appCheckInputRespones1
=
new
ArrayList
<>();
List
<
AppCheckInputRespone
>
appCheckInputRespones1
=
new
ArrayList
<>();
for
(
String
exclude_item
:
exclude_items
)
{
for
(
String
exclude_item
:
exclude_items
)
{
List
<
AppCheckInputRespone
>
collect
=
appCheckInputRespones
.
stream
().
filter
(
x
->
x
.
getPointInputItemId
().
equals
(
exclude_item
)).
collect
(
Collectors
.
toList
());
List
<
AppCheckInputRespone
>
collect
=
appCheckInputRespones
.
stream
().
filter
(
x
->
x
.
getPointInputItemId
().
equals
(
exclude_item
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
collect
)){
if
(
CollectionUtils
.
isEmpty
(
collect
))
{
continue
;
continue
;
}
}
appCheckInputRespones1
.
add
(
collect
.
get
(
0
));
appCheckInputRespones1
.
add
(
collect
.
get
(
0
));
...
@@ -1695,19 +1699,52 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1695,19 +1699,52 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
handleAllBatch
(
String
planTaskIds
,
String
userId
)
{
public
void
handleAllBatch
(
String
planTaskIds
,
String
userId
)
{
// StopWatch stopWatchAll = new StopWatch();
// stopWatchAll.start();
// StopWatch stopWatch1 = new StopWatch();
// stopWatch1.start();
// 1.数组准备:查询要一键提交的任务及更新状态
// 1.数组准备:查询要一键提交的任务及更新状态
List
<
PlanTask
>
planTasks
=
getPlanTasks
(
planTaskIds
);
List
<
PlanTask
>
planTasks
=
getPlanTasks
(
planTaskIds
);
if
(
planTasks
.
isEmpty
())
{
if
(
planTasks
.
isEmpty
())
{
return
;
return
;
}
}
// stopWatch1.stop();
// log.info("planTasks耗时:{}",stopWatch1.getTotalTimeSeconds());
// 2.数组准备:查询未完成状态的任务明细及更新状态
// 2.数组准备:查询未完成状态的任务明细及更新状态
// StopWatch stopWatch2 = new StopWatch();
// stopWatch2.start();
List
<
PlanTaskDetail
>
planTaskDetails
=
getWaitingDealPlanTaskDetails
(
planTasks
);
List
<
PlanTaskDetail
>
planTaskDetails
=
getWaitingDealPlanTaskDetails
(
planTasks
);
// stopWatch2.stop();
// log.info("planTaskDetails耗时:{}",stopWatch2.getTotalTimeSeconds());
// 3.数组准备: es存储数据组装
// 3.数组准备: es存储数据组装
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
this
.
buildESTaskDetailDtoData
(
planTasks
,
planTaskDetails
);
// StopWatch stopWatch3 = new StopWatch();
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
this
.
buildESPlanTaskListDtoData
(
planTasks
,
esTaskDetailDtos
,
planTaskDetails
);
// stopWatch3.start();
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
this
.
buildESTaskDetailDtoData
(
planTaskIds
,
planTaskDetails
);
// stopWatch3.stop();
// log.info("esTaskDetailDtos耗时:{}",stopWatch3.getTotalTimeSeconds());
// StopWatch stopWatch4 = new StopWatch();
// stopWatch4.start();
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
this
.
buildESPlanTaskListDtoData
(
planTaskIds
,
esTaskDetailDtos
,
planTaskDetails
);
// stopWatch4.stop();
// log.info("esPlanTaskListDtos耗时:{}",stopWatch4.getTotalTimeSeconds());
// 4.保存页面必须的数据
// 4.保存页面必须的数据
// StopWatch stopWatch5 = new StopWatch();
// stopWatch5.start();
saveMustData
(
esTaskDetailDtos
,
esPlanTaskListDtos
,
planTasks
);
saveMustData
(
esTaskDetailDtos
,
esPlanTaskListDtos
,
planTasks
);
// stopWatch5.stop();
// log.info("saveMustData耗时:{}",stopWatch5.getTotalTimeSeconds());
// StopWatch stopWatch6 = new StopWatch();
// stopWatch6.start();
this
.
sendInsertMessage
(
planTasks
,
planTaskDetails
);
this
.
sendInsertMessage
(
planTasks
,
planTaskDetails
);
// stopWatch6.stop();
// log.info("sendInsertMessage耗时:{}",stopWatch6.getTotalTimeSeconds());
// stopWatchAll.stop();
// log.info("handleAllBatch总耗时:{}",stopWatchAll.getTotalTimeSeconds());
}
}
...
@@ -1725,13 +1762,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1725,13 +1762,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
CompletableFuture
<
List
<
ESTaskDetailDto
>>
allESTaskDetailDtosFuture
=
CompletableFuture
.
supplyAsync
(()
->
this
.
queryTaskDetailEs
(
planTaskIds
),
asyncServiceExecutor
);
CompletableFuture
<
List
<
ESTaskDetailDto
>>
allESTaskDetailDtosFuture
=
CompletableFuture
.
supplyAsync
(()
->
this
.
queryTaskDetailEs
(
planTaskIds
),
asyncServiceExecutor
);
// 4.数组准备: es存储数据组装2
// 4.数组准备: es存储数据组装2
CompletableFuture
<
List
<
ESPlanTaskListDto
>>
esPlanTaskListDtosFuture
=
CompletableFuture
.
supplyAsync
(()
->
this
.
queryTaskListEs
(
planTaskIds
),
asyncServiceExecutor
);
CompletableFuture
<
List
<
ESPlanTaskListDto
>>
esPlanTaskListDtosFuture
=
CompletableFuture
.
supplyAsync
(()
->
this
.
queryTaskListEs
(
planTaskIds
),
asyncServiceExecutor
);
CompletableFuture
.
allOf
(
allESTaskDetailDtosFuture
,
esPlanTaskListDtosFuture
).
join
();
CompletableFuture
.
allOf
(
planTasksFuture
,
planTaskDetailsFuture
,
allESTaskDetailDtosFuture
,
esPlanTaskListDtosFuture
).
join
();
CompletableFuture
.
allOf
(
planTasksFuture
,
planTaskDetailsFuture
,
allESTaskDetailDtosFuture
,
esPlanTaskListDtosFuture
).
join
();
List
<
PlanTask
>
planTasks
=
planTasksFuture
.
join
();
List
<
PlanTask
>
planTasks
=
planTasksFuture
.
join
();
List
<
PlanTaskDetail
>
planTaskDetails
=
planTaskDetailsFuture
.
join
();
List
<
PlanTaskDetail
>
planTaskDetails
=
planTaskDetailsFuture
.
join
();
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
allESTaskDetailDtosFuture
.
join
();
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
allESTaskDetailDtosFuture
.
join
();
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
esPlanTaskListDtosFuture
.
join
();
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
esPlanTaskListDtosFuture
.
join
();
finshPlanTask
(
planTasks
,
planTaskDetails
);
fin
i
shPlanTask
(
planTasks
,
planTaskDetails
);
buildESTaskDetailDtoData2
(
esTaskDetailDtos
,
planTaskDetails
);
buildESTaskDetailDtoData2
(
esTaskDetailDtos
,
planTaskDetails
);
buildESPlanTaskListDtoData2
(
esPlanTaskListDtos
,
esTaskDetailDtos
,
planTaskDetails
);
buildESPlanTaskListDtoData2
(
esPlanTaskListDtos
,
esTaskDetailDtos
,
planTaskDetails
);
saveMustData
(
esTaskDetailDtos
,
esPlanTaskListDtos
,
planTasks
);
saveMustData
(
esTaskDetailDtos
,
esPlanTaskListDtos
,
planTasks
);
...
@@ -1741,7 +1777,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1741,7 +1777,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private
List
<
ESPlanTaskListDto
>
queryTaskListEs
(
String
planTaskIds
)
{
private
List
<
ESPlanTaskListDto
>
queryTaskListEs
(
String
planTaskIds
)
{
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
new
ArrayList
<>();
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
new
ArrayList
<>();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"planTaskId"
,
planTaskIds
.
split
(
","
)));
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"planTaskId"
,
planTaskIds
.
split
(
","
)));
esPlanTaskList
.
search
(
boolMust
).
forEach
(
esPlanTaskListDtos:
:
add
);
esPlanTaskList
.
search
(
boolMust
).
forEach
(
esPlanTaskListDtos:
:
add
);
return
esPlanTaskListDtos
;
return
esPlanTaskListDtos
;
}
}
...
@@ -1749,12 +1785,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1749,12 +1785,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private
List
<
ESTaskDetailDto
>
queryTaskDetailEs
(
String
planTaskIds
)
{
private
List
<
ESTaskDetailDto
>
queryTaskDetailEs
(
String
planTaskIds
)
{
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
new
ArrayList
<>();
List
<
ESTaskDetailDto
>
esTaskDetailDtos
=
new
ArrayList
<>();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"planTaskId"
,
planTaskIds
.
split
(
","
)));
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"planTaskId"
,
planTaskIds
.
split
(
","
)));
esTaskDetail
.
search
(
boolMust
).
forEach
(
esTaskDetailDtos:
:
add
);
esTaskDetail
.
search
(
boolMust
).
forEach
(
esTaskDetailDtos:
:
add
);
return
esTaskDetailDtos
;
return
esTaskDetailDtos
;
}
}
private
void
finshPlanTask
(
List
<
PlanTask
>
planTasks
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
void
fin
i
shPlanTask
(
List
<
PlanTask
>
planTasks
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
planTasks
.
forEach
(
planTask
->
{
planTasks
.
forEach
(
planTask
->
{
planTask
.
setFinishStatus
(
XJConstant
.
TASK_STATUS_FINISH
);
planTask
.
setFinishStatus
(
XJConstant
.
TASK_STATUS_FINISH
);
if
(
planTask
.
getRiskStatus
()
!=
1
)
{
if
(
planTask
.
getRiskStatus
()
!=
1
)
{
...
@@ -1767,12 +1803,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1767,12 +1803,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
private
void
sendInsertMessage
(
List
<
PlanTask
>
planTasks
,
List
<
PlanTaskDetail
>
planTaskDetails
){
private
void
sendInsertMessage
(
List
<
PlanTask
>
planTasks
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
CheckRecordDataDto
dataDto
=
new
CheckRecordDataDto
();
CheckRecordDataDto
dataDto
=
new
CheckRecordDataDto
();
dataDto
.
setPlanTasks
(
planTasks
);
dataDto
.
setPlanTasks
(
planTasks
);
dataDto
.
setPlanTaskDetails
(
planTaskDetails
);
dataDto
.
setPlanTaskDetails
(
planTaskDetails
);
dataDto
.
setRequestContextModel
(
UserTransmittableUtils
.
getUser
());
dataDto
.
setRequestContextModel
(
UserTransmittableUtils
.
getUser
());
publisher
.
publish
(
new
CheckRecordInsertEvent
(
this
,
dataDto
));
publisher
.
publish
(
new
CheckRecordInsertEvent
(
this
,
dataDto
));
}
}
private
void
saveMustData
(
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
,
List
<
PlanTask
>
planTasks
)
{
private
void
saveMustData
(
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
,
List
<
PlanTask
>
planTasks
)
{
...
@@ -1787,15 +1823,39 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1787,15 +1823,39 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private
void
saveTasks
(
List
<
ESTaskDetailDto
>
esTaskDetailDtos
)
{
private
void
saveTasks
(
List
<
ESTaskDetailDto
>
esTaskDetailDtos
)
{
try
{
try
{
esTaskDetail
.
saveAll
(
esTaskDetailDtos
);
List
<
EsEntity
<
ESTaskDetailDto
>>
batchList
=
esTaskDetailDtos
.
stream
()
.
map
(
item
->
new
EsEntity
<>(
item
.
getId
().
toString
(),
item
)).
collect
(
Collectors
.
toList
());
this
.
insertBatch
(
"web_app_task_detail"
,
batchList
);
// esTaskDetail.saveAll(esTaskDetailDtos);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
/**
* Description: 批量插入数据
*
* @param index index
* @param list 插入列表
* @author LiuLin
*/
public
<
T
>
void
insertBatch
(
String
index
,
List
<
EsEntity
<
T
>>
list
)
{
BulkRequest
request
=
new
BulkRequest
();
list
.
forEach
(
item
->
request
.
add
(
new
IndexRequest
(
index
).
id
(
item
.
getId
())
.
source
(
JSON
.
toJSONString
(
item
.
getData
()),
XContentType
.
JSON
)));
try
{
restHighLevelClient
.
bulk
(
request
,
RequestOptions
.
DEFAULT
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
private
void
savePlanTasks
(
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
)
{
private
void
savePlanTasks
(
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
)
{
try
{
try
{
esPlanTaskList
.
saveAll
(
esPlanTaskListDtos
);
// esPlanTaskList.saveAll(esPlanTaskListDtos);
List
<
EsEntity
<
ESPlanTaskListDto
>>
batchList
=
esPlanTaskListDtos
.
stream
()
.
map
(
item
->
new
EsEntity
<>(
item
.
getPlanTaskId
(),
item
)).
collect
(
Collectors
.
toList
());
this
.
insertBatch
(
"web_app_plan_task_list"
,
batchList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
}
}
...
@@ -1825,9 +1885,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1825,9 +1885,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
}
}
private
List
<
ESTaskDetailDto
>
buildESTaskDetailDtoData
(
List
<
PlanTask
>
planTask
s
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
List
<
ESTaskDetailDto
>
buildESTaskDetailDtoData
(
String
planTaskId
s
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
// 查询所有的
// 查询所有的
List
<
ESTaskDetailDto
>
allESTaskDetailDtos
=
esTaskDetail
.
findAllByPlanTaskIdIn
(
planTasks
.
stream
().
map
(
p
->
String
.
valueOf
(
p
.
getId
())).
collect
(
Collectors
.
toList
())
);
List
<
ESTaskDetailDto
>
allESTaskDetailDtos
=
this
.
queryTaskDetailEs
(
planTaskIds
);
Map
<
Long
,
ESTaskDetailDto
>
esTaskDetailDtoMap
=
allESTaskDetailDtos
.
stream
().
collect
(
Collectors
.
toMap
(
ESTaskDetailDto:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
ESTaskDetailDto
>
esTaskDetailDtoMap
=
allESTaskDetailDtos
.
stream
().
collect
(
Collectors
.
toMap
(
ESTaskDetailDto:
:
getId
,
Function
.
identity
()));
// 只更新未完成状态
// 只更新未完成状态
planTaskDetails
.
forEach
(
planTaskDetail
->
{
planTaskDetails
.
forEach
(
planTaskDetail
->
{
...
@@ -1838,7 +1898,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1838,7 +1898,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
for
(
Map
<
String
,
Object
>
map
:
mapList
.
get
(
"items"
))
{
for
(
Map
<
String
,
Object
>
map
:
mapList
.
get
(
"items"
))
{
AppCheckInputRespone
appCheckInputRespone
=
new
AppCheckInputRespone
();
AppCheckInputRespone
appCheckInputRespone
=
new
AppCheckInputRespone
();
BeanUtil
.
copyProperties
(
map
,
appCheckInputRespone
);
BeanUtil
.
copyProperties
(
map
,
appCheckInputRespone
);
InputItem
inputItem
=
cacheHelper
.
getInputItemCacheData
(
map
.
get
(
"checkInputId"
).
toString
(
));
InputItem
inputItem
=
inputItemDao
.
getOne
(
Long
.
parseLong
(
map
.
get
(
"checkInputId"
).
toString
()
));
CheckInput
checkInput
=
new
CheckInput
();
CheckInput
checkInput
=
new
CheckInput
();
String
itemType
=
String
.
valueOf
(
map
.
get
(
"itemType"
));
String
itemType
=
String
.
valueOf
(
map
.
get
(
"itemType"
));
if
(
XJConstant
.
INPUT_ITEM_SELECT
.
equals
(
itemType
))
{
if
(
XJConstant
.
INPUT_ITEM_SELECT
.
equals
(
itemType
))
{
...
@@ -1863,7 +1923,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1863,7 +1923,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
}
private
List
<
ESTaskDetailDto
>
buildESTaskDetailDtoData2
(
List
<
ESTaskDetailDto
>
allESTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
void
buildESTaskDetailDtoData2
(
List
<
ESTaskDetailDto
>
allESTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
// 查询所有的
// 查询所有的
Map
<
Long
,
ESTaskDetailDto
>
esTaskDetailDtoMap
=
allESTaskDetailDtos
.
stream
().
collect
(
Collectors
.
toMap
(
ESTaskDetailDto:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
ESTaskDetailDto
>
esTaskDetailDtoMap
=
allESTaskDetailDtos
.
stream
().
collect
(
Collectors
.
toMap
(
ESTaskDetailDto:
:
getId
,
Function
.
identity
()));
// 只更新未完成状态
// 只更新未完成状态
...
@@ -1875,7 +1935,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1875,7 +1935,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
for
(
Map
<
String
,
Object
>
map
:
mapList
.
get
(
"items"
))
{
for
(
Map
<
String
,
Object
>
map
:
mapList
.
get
(
"items"
))
{
AppCheckInputRespone
appCheckInputRespone
=
new
AppCheckInputRespone
();
AppCheckInputRespone
appCheckInputRespone
=
new
AppCheckInputRespone
();
BeanUtil
.
copyProperties
(
map
,
appCheckInputRespone
);
BeanUtil
.
copyProperties
(
map
,
appCheckInputRespone
);
InputItem
inputItem
=
cacheHelper
.
getInputItemCacheData
(
map
.
get
(
"checkInputId"
).
toString
(
));
InputItem
inputItem
=
inputItemDao
.
getOne
(
Long
.
parseLong
(
map
.
get
(
"checkInputId"
).
toString
()
));
CheckInput
checkInput
=
new
CheckInput
();
CheckInput
checkInput
=
new
CheckInput
();
String
itemType
=
String
.
valueOf
(
map
.
get
(
"itemType"
));
String
itemType
=
String
.
valueOf
(
map
.
get
(
"itemType"
));
if
(
XJConstant
.
INPUT_ITEM_SELECT
.
equals
(
itemType
))
{
if
(
XJConstant
.
INPUT_ITEM_SELECT
.
equals
(
itemType
))
{
...
@@ -1896,13 +1956,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1896,13 +1956,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
esTaskDetailDto
.
setPointStatus
(
String
.
valueOf
(
PlanTaskDetailIsFinishEnum
.
FINISHED
.
getValue
()));
esTaskDetailDto
.
setPointStatus
(
String
.
valueOf
(
PlanTaskDetailIsFinishEnum
.
FINISHED
.
getValue
()));
esTaskDetailDto
.
setPointImgUrls
(
new
ArrayList
<>());
esTaskDetailDto
.
setPointImgUrls
(
new
ArrayList
<>());
});
});
return
allESTaskDetailDtos
;
}
}
private
List
<
ESPlanTaskListDto
>
buildESPlanTaskListDtoData
(
List
<
PlanTask
>
planTasks
,
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
List
<
ESPlanTaskListDto
>
buildESPlanTaskListDtoData
(
String
planTaskIds
,
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
List
<
String
>
ids
=
planTasks
.
stream
().
map
(
p
->
String
.
valueOf
(
p
.
getId
())).
collect
(
Collectors
.
toList
());
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
this
.
queryTaskListEs
(
planTaskIds
);
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
esPlanTaskList
.
findAllByPlanTaskIdIn
(
ids
);
esPlanTaskListDtos
.
forEach
(
esPlanTaskListDto
->
{
esPlanTaskListDtos
.
forEach
(
esPlanTaskListDto
->
{
esPlanTaskListDto
.
setFinishStatus
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
()));
esPlanTaskListDto
.
setFinishStatus
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
()));
esPlanTaskListDto
.
setFinshNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
esPlanTaskListDto
.
setFinshNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
...
@@ -1915,7 +1972,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1915,7 +1972,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return
esPlanTaskListDtos
;
return
esPlanTaskListDtos
;
}
}
private
List
<
ESPlanTaskListDto
>
buildESPlanTaskListDtoData2
(
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
,
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
void
buildESPlanTaskListDtoData2
(
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
,
List
<
ESTaskDetailDto
>
esTaskDetailDtos
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
esPlanTaskListDtos
.
forEach
(
esPlanTaskListDto
->
{
esPlanTaskListDtos
.
forEach
(
esPlanTaskListDto
->
{
esPlanTaskListDto
.
setFinishStatus
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
()));
esPlanTaskListDto
.
setFinishStatus
(
String
.
valueOf
(
PlanTaskFinishStatusEnum
.
FINISHED
.
getValue
()));
esPlanTaskListDto
.
setFinshNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
esPlanTaskListDto
.
setFinshNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
...
@@ -1925,7 +1982,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1925,7 +1982,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
esPlanTaskListDto
.
setTaskPlanNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
esPlanTaskListDto
.
setTaskPlanNum
(
this
.
filterByStatus
(
"1"
,
esPlanTaskListDto
.
getPlanTaskId
(),
esTaskDetailDtos
));
esPlanTaskListDto
.
setPoints
(
this
.
buildPlanTaskPoint
(
esPlanTaskListDto
.
getPlanTaskId
(),
planTaskDetails
));
esPlanTaskListDto
.
setPoints
(
this
.
buildPlanTaskPoint
(
esPlanTaskListDto
.
getPlanTaskId
(),
planTaskDetails
));
});
});
return
esPlanTaskListDtos
;
}
}
private
List
<
PlanTaskDetail
>
buildPlanTaskPoint
(
String
planTaskId
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
private
List
<
PlanTaskDetail
>
buildPlanTaskPoint
(
String
planTaskId
,
List
<
PlanTaskDetail
>
planTaskDetails
)
{
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/config/ElasticSearchClientConfig.java
View file @
f1eeb03d
...
@@ -25,6 +25,13 @@ public class ElasticSearchClientConfig {
...
@@ -25,6 +25,13 @@ public class ElasticSearchClientConfig {
@Value
(
"${elasticsearch.password}"
)
@Value
(
"${elasticsearch.password}"
)
private
String
password
;
private
String
password
;
@Value
(
"${elasticsearch.maxConnectNum:1000}"
)
private
int
maxConnectNum
;
@Value
(
"${elasticsearch.maxConnectPerRoute:1000}"
)
private
int
maxConnectPerRoute
;
@Bean
(
destroyMethod
=
"close"
)
@Bean
(
destroyMethod
=
"close"
)
public
RestHighLevelClient
restHighLevelClient
()
{
public
RestHighLevelClient
restHighLevelClient
()
{
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
final
CredentialsProvider
credentialsProvider
=
new
BasicCredentialsProvider
();
...
@@ -36,6 +43,8 @@ public class ElasticSearchClientConfig {
...
@@ -36,6 +43,8 @@ public class ElasticSearchClientConfig {
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
RestClientBuilder
builder
=
RestClient
.
builder
(
httpHosts
);
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
builder
.
setHttpClientConfigCallback
(
httpClientBuilder
->
{
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
disableAuthCaching
();
httpClientBuilder
.
setMaxConnTotal
(
maxConnectNum
);
httpClientBuilder
.
setMaxConnPerRoute
(
maxConnectPerRoute
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
return
httpClientBuilder
.
setDefaultCredentialsProvider
(
credentialsProvider
);
});
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
...
...
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/config/ElasticSearchRestTemplateConfig.java
0 → 100644
View file @
f1eeb03d
package
com
.
yeejoin
.
amos
.
patrol
.
config
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate
;
import
org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories
;
@Configuration
@EnableElasticsearchRepositories
(
basePackages
=
{
"com.yeejoin.amos.boot.module.common.biz.dao"
,
"com.yeejoin.amos.patrol.business.dao.repository"
})
public
class
ElasticSearchRestTemplateConfig
{
@Bean
public
ElasticsearchRestTemplate
elasticsearchTemplate
(
RestHighLevelClient
restHighLevelClient
)
{
return
new
ElasticsearchRestTemplate
(
restHighLevelClient
);
}
}
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/application-dev.properties
View file @
f1eeb03d
...
@@ -26,7 +26,7 @@ spring.datasource.password=Yeejoin@2023
...
@@ -26,7 +26,7 @@ spring.datasource.password=Yeejoin@2023
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.type
=
com.zaxxer.hikari.HikariDataSource
spring.datasource.driver-class-name
=
cn.com.vastbase.Driver
spring.datasource.driver-class-name
=
cn.com.vastbase.Driver
spring.datasource.hikari.maxLifetime
=
1765000
spring.datasource.hikari.maxLifetime
=
1765000
spring.datasource.hikari.maximum-pool-size
=
1
00
spring.datasource.hikari.maximum-pool-size
=
2
00
spring.datasource.hikari.minimum-idle
=
15
spring.datasource.hikari.minimum-idle
=
15
spring.datasource.testWhileIdle
=
true
spring.datasource.testWhileIdle
=
true
spring.datasource.validationQuery
=
SELECT 1
spring.datasource.validationQuery
=
SELECT 1
...
@@ -43,7 +43,7 @@ spring.redis.database=1
...
@@ -43,7 +43,7 @@ spring.redis.database=1
spring.redis.host
=
172.16.10.243
spring.redis.host
=
172.16.10.243
spring.redis.port
=
6379
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.redis.password
=
yeejoin@2020
spring.redis.jedis.pool.max-active
=
2
00
spring.redis.jedis.pool.max-active
=
5
00
spring.redis.jedis.pool.max-wait
=
-1
spring.redis.jedis.pool.max-wait
=
-1
spring.redis.jedis.pool.max-idle
=
10
spring.redis.jedis.pool.max-idle
=
10
spring.redis.jedis.pool.min-idle
=
0
spring.redis.jedis.pool.min-idle
=
0
...
@@ -112,6 +112,8 @@ fire-rescue=1432549862557130753
...
@@ -112,6 +112,8 @@ fire-rescue=1432549862557130753
action.auto_create_index
:
true
action.auto_create_index
:
true
elasticsearch.username
=
elastic
elasticsearch.username
=
elastic
elasticsearch.password
=
a123456
elasticsearch.password
=
a123456
elasticsearch.maxConnectNum
=
1000
elasticsearch.maxConnectPerRoute
=
1000
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
spring.elasticsearch.rest.uris
=
http://172.16.10.243:9200
## unit(h)
## unit(h)
alertcall.es.synchrony.time
=
48
alertcall.es.synchrony.time
=
48
...
@@ -195,8 +197,11 @@ spring.jpa.properties.hibernate.order_updates =true
...
@@ -195,8 +197,11 @@ spring.jpa.properties.hibernate.order_updates =true
shardingsphere.create.tables.num
=
10
shardingsphere.create.tables.num
=
10
logging.level.com.zaxxer.hikari
=
DEBUG
logging.level.com.zaxxer.hikari
=
DEBUG
logging.level.org.springframework.data.elasticsearch
=
error
logging.level.org.elasticsearch
=
error
amos.system.user.user-name
=
admin_tzs
amos.system.user.user-name
=
admin_tzs
amos.system.user.password
=
a1234560
amos.system.user.password
=
a1234560
amos.system.user.app-key
=
AMOS_STUDIO
amos.system.user.app-key
=
AMOS_STUDIO
amos.system.user.product
=
AMOS_STUDIO_WEB
amos.system.user.product
=
AMOS_STUDIO_WEB
amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/resources/application.properties
View file @
f1eeb03d
spring.application.name
=
AMOS-PATROL
-LTW
spring.application.name
=
AMOS-PATROL
server.servlet.context-path
=
/patrol
server.servlet.context-path
=
/patrol
server.port
=
8082
server.port
=
8082
...
@@ -17,11 +17,12 @@ spring.jpa.show-sql = false
...
@@ -17,11 +17,12 @@ spring.jpa.show-sql = false
spring.jpa.hibernate.ddl-auto
=
none
spring.jpa.hibernate.ddl-auto
=
none
spring.jpa.hibernate.naming-strategy
=
org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.hibernate.naming-strategy
=
org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.database-platform
=
org.hibernate.dialect.MySQLDialect
spring.jpa.database-platform
=
org.hibernate.dialect.MySQLDialect
mybatis.mapper-locations
=
classpath:db/mapper/*.xml
mybatis.mapper-locations
=
classpath:db/mapper/*.xml
mybatis-plus.mapper-locations
=
classpath:db/mapper/*.xml
mybatis-plus.mapper-locations
=
classpath:db/mapper/*.xml
mybatis.type-aliases-package
=
com.yeejoin.amos.patrol.business.entity.mybatis
mybatis.type-aliases-package
=
com.yeejoin.amos.patrol.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase
=
true
mybatis.configuration.mapUnderscoreToCamelCase
=
true
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.
stdout.StdOut
Impl
mybatis-plus.configuration.log-impl
=
org.apache.ibatis.logging.
nologging.NoLogging
Impl
mybatis-plus.global-config.db-config.update-strategy
=
ignored
mybatis-plus.global-config.db-config.update-strategy
=
ignored
spring.liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
spring.liquibase.change-log
=
classpath:/db/changelog/changelog-master.xml
...
...
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