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
2110acdb
Commit
2110acdb
authored
Sep 23, 2025
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tcm):优化appId生成异常处理逻辑
- 引入RedisUtil依赖用于记录异常信息 - 当企业主体appId生成异常时,记录详细用户信息到Redis - 当个人主体appId生成异常时,记录详细用户信息到Redis - 避免因appId生成失败导致服务中断
parent
6d6fe7d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
HistoryDataDealServiceImpl.java
...dule/tcm/biz/service/impl/HistoryDataDealServiceImpl.java
+9
-5
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/HistoryDataDealServiceImpl.java
View file @
2110acdb
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.TzsUserPermission;
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.TzsUserPermission;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum
;
import
com.yeejoin.amos.boot.module.tcm.api.enums.UnitTypeEnum
;
import
com.yeejoin.amos.boot.module.tcm.biz.utils.RedisUtil
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.tcm.flc.api.entity.RegUnitInfo
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tcm.flc.biz.service.impl.RegUnitInfoServiceImpl
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
@@ -40,11 +41,14 @@ public class HistoryDataDealServiceImpl {
...
@@ -40,11 +41,14 @@ public class HistoryDataDealServiceImpl {
private
RegUnitInfoServiceImpl
regUnitInfoService
;
private
RegUnitInfoServiceImpl
regUnitInfoService
;
public
HistoryDataDealServiceImpl
(
TzsUserInfoServiceImpl
userInfoService
,
TzsUserPermissionServiceImpl
userPermissionService
,
TzBaseEnterpriseInfoServiceImpl
baseEnterpriseInfoService
,
RegUnitInfoServiceImpl
regUnitInfoService
)
{
private
RedisUtil
redisUtil
;
public
HistoryDataDealServiceImpl
(
TzsUserInfoServiceImpl
userInfoService
,
TzsUserPermissionServiceImpl
userPermissionService
,
TzBaseEnterpriseInfoServiceImpl
baseEnterpriseInfoService
,
RegUnitInfoServiceImpl
regUnitInfoService
,
RedisUtil
redisUtil
)
{
this
.
userInfoService
=
userInfoService
;
this
.
userInfoService
=
userInfoService
;
this
.
userPermissionService
=
userPermissionService
;
this
.
userPermissionService
=
userPermissionService
;
this
.
baseEnterpriseInfoService
=
baseEnterpriseInfoService
;
this
.
baseEnterpriseInfoService
=
baseEnterpriseInfoService
;
this
.
regUnitInfoService
=
regUnitInfoService
;
this
.
regUnitInfoService
=
regUnitInfoService
;
this
.
redisUtil
=
redisUtil
;
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -186,8 +190,8 @@ public class HistoryDataDealServiceImpl {
...
@@ -186,8 +190,8 @@ public class HistoryDataDealServiceImpl {
try
{
try
{
regUnitInfo
.
setAppId
(
regUnitInfoService
.
createAppId
(
user
));
regUnitInfo
.
setAppId
(
regUnitInfoService
.
createAppId
(
user
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"为没有appId的企业生成appId异常
"
,
e
);
log
.
error
(
"为没有appId的企业生成appId异常
:{}"
,
JSON
.
toJSONString
(
user
)
);
throw
new
RuntimeException
(
e
);
redisUtil
.
set
(
"createAppIdError-unit"
+
"_"
+
System
.
currentTimeMillis
(),
JSON
.
toJSONString
(
user
)
);
}
}
}
}
companyListWithOutAppId
.
stream
().
filter
(
company
->
company
.
getUseUnitCode
().
equals
(
regUnitInfo
.
getUnitCode
())).
forEach
(
company
->
company
.
setAppId
(
regUnitInfo
.
getAppId
()));
companyListWithOutAppId
.
stream
().
filter
(
company
->
company
.
getUseUnitCode
().
equals
(
regUnitInfo
.
getUnitCode
())).
forEach
(
company
->
company
.
setAppId
(
regUnitInfo
.
getAppId
()));
...
@@ -207,8 +211,8 @@ public class HistoryDataDealServiceImpl {
...
@@ -207,8 +211,8 @@ public class HistoryDataDealServiceImpl {
try
{
try
{
map
.
put
(
"appId"
,
regUnitInfoService
.
createAppId
(
user
));
map
.
put
(
"appId"
,
regUnitInfoService
.
createAppId
(
user
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"为没有appId的
企业生成appId异常"
,
e
);
log
.
error
(
"为没有appId的
个人主体生成appId异常:{}"
,
JSON
.
toJSONString
(
user
)
);
throw
new
RuntimeException
(
e
);
redisUtil
.
set
(
"createAppIdError-individual"
+
"_"
+
System
.
currentTimeMillis
(),
JSON
.
toJSONString
(
user
)
);
}
}
});
});
}
}
...
...
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