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
5a13ce49
Commit
5a13ce49
authored
Oct 29, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):人员查询报错问题处理,监察处置添加单位,综合查询导出优化1
parent
b38b8c0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
10 deletions
+77
-10
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+16
-8
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+60
-2
TzsUserInfoMapper.xml
...e-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
+1
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
5a13ce49
...
...
@@ -2241,15 +2241,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
queryByRoleId
(
String
.
join
(
","
,
JIAN_CHA_ROLE_ID
),
null
,
true
,
true
,
""
,
buildOrgCodePrefixes
(
orgCode
)).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
taskExecutor
))
{
String
companyCodes
=
taskExecutor
.
stream
()
Optional
<
String
>
companyCodeOpt
=
taskExecutor
.
stream
()
.
map
(
AgencyUserModel:
:
getCompanys
)
.
filter
(
Objects:
:
nonNull
)
.
filter
(
list
->
!
list
.
isEmpty
())
.
map
(
list
->
list
.
get
(
0
).
getCompanyCode
())
.
filter
(
Objects:
:
nonNull
)
.
distinct
()
.
collect
(
Collectors
.
joining
(
","
));
dto
.
setNextExecuteUserCompanyCode
(
companyCodes
);
.
filter
(
list
->
list
!=
null
&&
!
list
.
isEmpty
())
.
flatMap
(
List:
:
stream
)
.
filter
(
c
->
"county"
.
equalsIgnoreCase
(
c
.
getLevel
()))
.
map
(
CompanyModel:
:
getCompanyCode
)
.
findFirst
();
if
(!
companyCodeOpt
.
isPresent
())
{
companyCodeOpt
=
taskExecutor
.
stream
()
.
map
(
AgencyUserModel:
:
getCompanys
)
.
filter
(
list
->
list
!=
null
&&
!
list
.
isEmpty
())
.
flatMap
(
List:
:
stream
)
.
filter
(
c
->
"prefecture-level"
.
equalsIgnoreCase
(
c
.
getLevel
()))
.
map
(
CompanyModel:
:
getCompanyCode
)
.
findFirst
();
}
companyCodeOpt
.
ifPresent
(
dto:
:
setNextExecuteUserCompanyCode
);
}
dto
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
"9"
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
5a13ce49
...
...
@@ -2592,7 +2592,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
fluentPut
(
"time"
,
new
Date
().
getTime
()));
}
public
JSONArray
exportDataAsyncBatchSearch
(
JSONObject
filter
)
{
public
JSONArray
exportDataAsyncBatchSearch
1
(
JSONObject
filter
)
{
JSONArray
result
=
new
JSONArray
();
int
pageSize
=
1000
;
// 查询首页数据
...
...
@@ -2636,6 +2636,61 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
}
public
JSONArray
exportDataAsyncBatchSearch
(
JSONObject
filter
)
{
JSONArray
result
=
new
JSONArray
();
int
batchSize
=
5000
;
// 每页记录数,根据数据量可调大一些
// 查询第一页
filter
.
fluentPut
(
"size"
,
batchSize
).
fluentPut
(
"current"
,
1
);
JSONObject
firstPage
=
this
.
queryForPage
(
filter
);
JSONObject
pageData
=
firstPage
.
getJSONObject
(
"pageData"
);
result
.
addAll
(
pageData
.
getJSONArray
(
"records"
));
long
total
=
pageData
.
getLong
(
"total"
);
int
totalPage
=
(
int
)
Math
.
ceil
((
double
)
total
/
batchSize
);
if
(
totalPage
<=
1
)
return
result
;
// 只有一页,直接返回
RequestContextWrapper
contextWrapper
=
RequestContextWrapper
.
capture
();
// 计算批次,每批处理 N 页,减少线程压力
int
batchThreads
=
Math
.
min
(
totalPage
-
1
,
Runtime
.
getRuntime
().
availableProcessors
());
int
pagesPerThread
=
(
int
)
Math
.
ceil
((
double
)(
totalPage
-
1
)
/
batchThreads
);
List
<
CompletableFuture
<
JSONArray
>>
futures
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
batchThreads
;
i
++)
{
int
startPage
=
2
+
i
*
pagesPerThread
;
int
endPage
=
Math
.
min
(
startPage
+
pagesPerThread
-
1
,
totalPage
);
CompletableFuture
<
JSONArray
>
future
=
CompletableFuture
.
supplyAsync
(()
->
{
contextWrapper
.
apply
();
// 恢复上下文一次
JSONArray
batchResult
=
new
JSONArray
();
for
(
int
page
=
startPage
;
page
<=
endPage
;
page
++)
{
filter
.
fluentPut
(
"current"
,
page
);
JSONObject
pageJson
=
this
.
queryForPage
(
filter
);
JSONArray
records
=
pageJson
.
getJSONObject
(
"pageData"
).
getJSONArray
(
"records"
);
batchResult
.
addAll
(
records
);
}
return
batchResult
;
},
executorService
);
futures
.
add
(
future
);
}
// 等待所有线程完成
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])).
join
();
// 收集结果
for
(
CompletableFuture
<
JSONArray
>
future
:
futures
)
{
try
{
result
.
addAll
(
future
.
get
());
}
catch
(
Exception
e
)
{
log
.
error
(
"分页查询线程执行失败"
,
e
);
}
}
return
result
;
}
private
static
MultipartFile
getEquipMultipartFile
(
JSONArray
records
,
String
fileName
,
String
sheetName
)
{
MultipartFile
templateExcelFile
;
List
<
EquipInfoVo
>
exportData
=
new
ArrayList
<>();
...
...
@@ -2660,7 +2715,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
ifPresent
(
equipInfoVo:
:
setRECORD
);
// 技术参数
if
(!
equip
.
getJSONArray
(
"techParams"
).
isEmpty
())
{
JSONArray
techParams
=
equip
.
getJSONArray
(
"techParams"
);
if
(
techParams
!=
null
&&
!
techParams
.
isEmpty
())
{
JSONObject
paramsJson
=
new
JSONObject
();
equip
.
getJSONArray
(
"techParams"
).
forEach
(
techParam
->
{
ESEquipmentInfo
.
TechParam
techParamItem
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
techParam
),
ESEquipmentInfo
.
TechParam
.
class
);
...
...
@@ -4628,4 +4684,5 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 去重并返回
return
esIds
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
View file @
5a13ce49
...
...
@@ -343,6 +343,7 @@
<foreach
collection=
"postList"
item=
"item"
separator=
","
>
#{item}
</foreach>
]
</if>
<if
test=
"filter.postCode != null and filter.postCode != ''"
>
and u.new_post like concat('%',#{filter.postCode}, '%')
...
...
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