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
756ceba6
Commit
756ceba6
authored
Jul 03, 2025
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(amos-boot-module-tcm): 优化企业信息更新逻辑- 使用流操作对 companyModels进行分组,提高查询效率
- 修复公司组织代码更新逻辑,确保正确更新 tz_base_enterprise_info 表中的数据 - 优化代码结构,提高可读性和维护性
parent
b36e9019
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+5
-3
No files found.
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/TzBaseEnterpriseInfoServiceImpl.java
View file @
756ceba6
...
...
@@ -1396,14 +1396,16 @@ public class TzBaseEnterpriseInfoServiceImpl
if
(!
ValidationUtil
.
isEmpty
(
companyBo
.
getCompanyCode
()))
{
useCodes
.
add
(
companyBo
.
getCompanyCode
());
}
Map
<
String
,
List
<
CompanyModel
>>
companyModelMap
=
companyModels
.
stream
().
collect
(
Collectors
.
groupingBy
(
CompanyModel:
:
getCompanyCode
));
List
<
TzBaseEnterpriseInfo
>
tzBaseEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
selectList
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
in
(
"use_code"
,
useCodes
));
// privilege_company 有触发器更新,只需要更新 tz_base_enterprise_info
if
(!
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfos
))
{
for
(
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
:
tzBaseEnterpriseInfos
)
{
String
oldOrgCode
=
tzBaseEnterpriseInfo
.
getOrgCode
();
// 旧的org_code
String
preOrgCode
=
companyBo
.
getOrgCode
();
// 新的org_code
String
oldOrgCode
=
tzBaseEnterpriseInfo
.
getOrgCode
();
// 旧的org_code
CompanyModel
companyModel
=
companyModelMap
.
get
(
tzBaseEnterpriseInfo
.
getUseCode
()).
get
(
0
);
String
preOrgCode
=
companyModel
.
getOrgCode
();
// 新的org_code
String
oldSuperviseOrgCode
=
tzBaseEnterpriseInfo
.
getSuperviseOrgCode
();
String
preSuperviseOrgCode
=
company
Bo
.
getOrgCode
().
replace
(
"*"
+
companyBo
.
getCompanyOrgCode
(),
""
);
String
preSuperviseOrgCode
=
company
Model
.
getOrgCode
().
replace
(
"*"
+
companyModel
.
getCompanyOrgCode
(),
""
);
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
preSuperviseOrgCode
).
getResult
();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
...
...
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