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
c8aaee3a
Commit
c8aaee3a
authored
Aug 06, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据
parent
cccc4d3d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
11 deletions
+96
-11
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+4
-3
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+71
-8
SuperviseInfoMapper.java
.../amos/boot/module/ymt/api/mapper/SuperviseInfoMapper.java
+2
-0
SupervisionInfoMapper.xml
...t-api/src/main/resources/mapper/SupervisionInfoMapper.xml
+19
-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/controller/DataHandlerController.java
View file @
c8aaee3a
...
...
@@ -315,8 +315,8 @@ public class DataHandlerController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据"
,
notes
=
"修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据"
)
@PutMapping
(
value
=
"/equip/
deleteEquipExistDB
"
)
public
ResponseModel
<
Integer
>
deleteEquipExistDB2
(
@RequestParam
(
value
=
"isDelete"
,
defaultValue
=
"false"
)
boolean
isDelete
)
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
deleteEquipExistDB
(
isDelete
));
@PutMapping
(
value
=
"/equip/
modifySupervisionOrgBranchCode
"
)
public
ResponseModel
<
Integer
>
modifySupervisionOrgBranchCode
(
@RequestParam
(
value
=
"isModify"
,
defaultValue
=
"false"
)
boolean
isModify
)
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
modifySupervisionOrgBranchCode
(
isModify
));
}
}
\ No newline at end of file
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/DataHandlerServiceImpl.java
View file @
c8aaee3a
...
...
@@ -1864,12 +1864,12 @@ public class DataHandlerServiceImpl {
List
<
String
>
successDeleteList
=
Collections
.
synchronizedList
(
new
ArrayList
<>());
List
<
List
<
String
>>
allDataList
=
Lists
.
partition
(
records
,
BATCH_SIZE
);
ExecutorService
executor
=
new
ThreadPoolExecutor
(
10
,
// 核心线程数
20
,
// 最大线程数
10
,
20
,
60L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
1000
),
// 队列最多允许1000个任务
new
LinkedBlockingQueue
<>(
1000
),
Executors
.
defaultThreadFactory
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
()
// 拒绝策略(可换成其他)
new
ThreadPoolExecutor
.
CallerRunsPolicy
()
);
CountDownLatch
latch
=
new
CountDownLatch
(
allDataList
.
size
());
...
...
@@ -1967,10 +1967,10 @@ public class DataHandlerServiceImpl {
wrapper
.
select
(
IdxBizJgOtherInfo:
:
getRecord
)
.
notIn
(
IdxBizJgOtherInfo:
:
getClaimStatus
,
"已认领"
,
""
);
List
<
IdxBizJgOtherInfo
>
jgOtherInfos
=
otherInfoMapper
.
selectList
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
jgOtherInfos
))
{
return
0
;
}
List
<
String
>
records
=
jgOtherInfos
.
stream
(
)
List
<
String
>
records
=
Optional
.
ofNullable
(
jgOtherInfos
)
.
orElse
(
Collections
.
emptyList
())
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
IdxBizJgOtherInfo:
:
getRecord
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
...
...
@@ -1979,4 +1979,67 @@ public class DataHandlerServiceImpl {
}
return
records
.
size
();
}
public
Integer
modifySupervisionOrgBranchCode
(
boolean
isModify
)
{
// 1. 查询 SuperviseInfo 中 orgBranchCode like "50*X" 的记录
List
<
SuperviseInfo
>
supervisionInfos
=
superviseInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
SuperviseInfo
>()
.
select
(
SuperviseInfo:
:
getRecord
)
.
like
(
SuperviseInfo:
:
getOrgBranchCode
,
"50*X"
)
);
Set
<
String
>
records
=
supervisionInfos
.
stream
()
.
map
(
SuperviseInfo:
:
getRecord
)
.
filter
(
StringUtils:
:
isNotEmpty
)
.
collect
(
Collectors
.
toSet
());
if
(
records
.
isEmpty
())
{
return
0
;
}
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
()
.
must
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
records
));
List
<
ESEquipmentCategoryDto
>
esResults
;
try
{
esResults
=
registrationManageService
.
searchResponse
(
IDX_BIZ_VIEW_JG_ALL
,
boolQuery
,
hit
->
JSONObject
.
parseObject
(
hit
.
getSourceAsString
(),
ESEquipmentCategoryDto
.
class
)
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"ES 查询异常: {}"
,
ex
.
getMessage
(),
ex
);
throw
new
RuntimeException
(
"ES 查询失败"
,
ex
);
}
List
<
Map
<
String
,
Object
>>
updateList
=
esResults
.
stream
()
.
filter
(
dto
->
StringUtils
.
isNotEmpty
(
dto
.
getORG_BRANCH_CODE
())
&&
StringUtils
.
isNotEmpty
(
dto
.
getSEQUENCE_NBR
())
)
.
map
(
this
::
buildUpdateMap
)
.
collect
(
Collectors
.
toList
());
if
(
updateList
.
isEmpty
())
{
return
0
;
}
int
updateCount
=
0
;
List
<
List
<
Map
<
String
,
Object
>>>
partitions
=
Lists
.
partition
(
updateList
,
BATCH_SIZE
);
for
(
List
<
Map
<
String
,
Object
>>
batch
:
partitions
)
{
if
(
isModify
)
{
int
count
=
superviseInfoMapper
.
batchUpdateOrgBranch
(
batch
);
updateCount
+=
count
;
log
.
info
(
"更新批次:{}, 成功记录数:{}"
,
batch
.
size
(),
count
);
}
}
return
updateList
.
size
();
}
private
Map
<
String
,
Object
>
buildUpdateMap
(
ESEquipmentCategoryDto
dto
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"record"
,
dto
.
getSEQUENCE_NBR
());
map
.
put
(
"orgBranchCode"
,
dto
.
getORG_BRANCH_CODE
());
map
.
put
(
"orgBranchName"
,
dto
.
getORG_BRANCH_NAME
());
return
map
;
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/SuperviseInfoMapper.java
View file @
c8aaee3a
...
...
@@ -20,6 +20,8 @@ public interface SuperviseInfoMapper extends BaseMapper<SuperviseInfo> {
void
batchUpdateRecordOrgBranch
(
@Param
(
"recordList"
)
List
<
String
>
recordList
);
int
batchUpdateOrgBranch
(
@Param
(
"list"
)
List
<
Map
<
String
,
Object
>>
list
);
List
<
Map
<
String
,
Object
>>
selectUnitCodeList
(
@Param
(
"records"
)
List
<
String
>
records
);
List
<
String
>
selectSuperviseCodeList
(
@Param
(
"records"
)
List
<
String
>
records
);
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/SupervisionInfoMapper.xml
View file @
c8aaee3a
...
...
@@ -17,6 +17,25 @@
</foreach>
</update>
<update
id=
"batchUpdateOrgBranch"
>
UPDATE idx_biz_jg_supervision_info
SET
ORG_BRANCH_CODE = CASE RECORD
<foreach
collection=
"list"
item=
"item"
>
WHEN #{item.record} THEN #{item.orgBranchCode}
</foreach>
END,
ORG_BRANCH_NAME = CASE RECORD
<foreach
collection=
"list"
item=
"item"
>
WHEN #{item.record} THEN #{item.orgBranchName}
</foreach>
END
WHERE RECORD IN
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item.record}
</foreach>
</update>
<update
id=
"updateEsRecordBatch"
>
UPDATE idx_biz_jg_use_info SET "IS_NOT_ES" = 1 WHERE "RECORD" IN
<foreach
collection=
"recordList"
separator=
","
item=
"record"
open=
"("
close=
")"
>
...
...
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