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
3cf6a524
Commit
3cf6a524
authored
Jul 20, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.自测优化
parent
feb43acc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
31 deletions
+34
-31
RegUnitInfoServiceImpl.java
...dule/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
+34
-31
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/flc/biz/service/impl/RegUnitInfoServiceImpl.java
View file @
3cf6a524
...
...
@@ -209,27 +209,30 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
throw
new
BadRequest
(
"UGP信息同步失败"
);
}
watch
.
stop
();
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"注册总耗时:==》"
+
watch
.
getTotalTimeSeconds
());
if
(
log
ger
.
isDebugEnabled
()){
log
ger
.
debug
(
"注册总耗时:==》{}"
,
watch
.
getTotalTimeSeconds
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
// 失败后回滚:删除已经创建的企业信息
if
(
StringUtils
.
isNotEmpty
(
regUnitInfo
.
getAmosCompanySeq
()))
{
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
regUnitInfo
.
getAmosCompanySeq
()));
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
companyClient
.
deleteCompany
(
regUnitInfo
.
getAmosCompanySeq
());
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
try
{
// 失败后回滚:删除已经创建的企业信息
if
(
StringUtils
.
isNotEmpty
(
regUnitInfo
.
getAmosCompanySeq
()))
{
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
parseLong
(
regUnitInfo
.
getAmosCompanySeq
()));
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
companyClient
.
deleteCompany
(
regUnitInfo
.
getAmosCompanySeq
());
}
}
}
// 失败后回滚:删除已经创建的管理员账号
if
(
StringUtils
.
isNotEmpty
(
regUnitInfo
.
getAdminUserId
()))
{
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
regUnitInfo
.
getAdminUserId
());
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
regUnitInfo
.
getAdminUserId
());
// 失败后回滚:删除已经创建的管理员账号
if
(
StringUtils
.
isNotEmpty
(
regUnitInfo
.
getAdminUserId
()))
{
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
regUnitInfo
.
getAdminUserId
());
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getResult
()
!=
null
)
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
regUnitInfo
.
getAdminUserId
());
}
}
}
catch
(
Exception
rollbackException
)
{
logger
.
error
(
"回滚操作发生异常: {}"
,
rollbackException
.
getMessage
(),
rollbackException
);
}
throw
new
RuntimeException
(
"企业注册失败,请联系管理员!"
);
}
return
model
;
...
...
@@ -238,13 +241,13 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
@Scheduled
(
cron
=
"${async.set.qr-code.cron:0 0/1 * * * ?}"
)
public
void
asyncSetQrCode
()
{
// 给所有新注册的企业创建二维码,每次处理100个,不排序
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"新注册企业二维码生成开始"
);
if
(
log
ger
.
isDebugEnabled
())
{
log
ger
.
debug
(
"新注册企业二维码生成开始"
);
}
List
<
TzBaseEnterpriseInfo
>
noQrCodeList
=
tzBaseEnterpriseInfoMapper
.
listNoQrCode
();
if
(
noQrCodeList
.
isEmpty
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"暂无待生成二维码的企业"
);
if
(
log
ger
.
isDebugEnabled
())
{
log
ger
.
debug
(
"暂无待生成二维码的企业"
);
}
return
;
}
...
...
@@ -255,8 +258,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
tzBaseEnterpriseInfoService
.
saveOrUpdateBatch
(
noQrCodeList
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"新注册企业二维码生成结束"
);
if
(
log
ger
.
isDebugEnabled
())
{
log
ger
.
debug
(
"新注册企业二维码生成结束"
);
}
}
...
...
@@ -524,7 +527,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Privilege
.
agencyUserClient
.
multDeleteUser
(
regUnitInfo
.
getAdminUserId
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
ger
.
error
(
e
.
getMessage
(),
e
);
}
// 3.企业注册表删除
this
.
remove
(
new
LambdaQueryWrapper
<
RegUnitInfo
>().
eq
(
RegUnitInfo:
:
getUnitCode
,
unitCode
));
...
...
@@ -620,8 +623,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
watch1
.
start
();
List
<
RoleModel
>
allRoleList
=
startPlatformTokenService
.
getAllRole
();
watch1
.
stop
();
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"平台查询角色接口耗时:==》"
+
watch1
.
getTotalTimeSeconds
());
if
(
log
ger
.
isDebugEnabled
()){
log
ger
.
debug
(
"平台查询角色接口耗时:==>{}"
,
watch1
.
getTotalTimeSeconds
());
}
List
<
RoleModel
>
userRoleList
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
...
...
@@ -643,8 +646,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
watch2
.
start
();
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
create
(
companyInfo
);
watch2
.
stop
();
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"创建amos公司耗时:==》"
+
watch2
.
getTotalTimeSeconds
());
if
(
log
ger
.
isDebugEnabled
()){
log
ger
.
debug
(
"创建amos公司耗时:==>{}"
,
watch2
.
getTotalTimeSeconds
());
}
if
(
companyResult
==
null
||
companyResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"单位注册失败"
);
...
...
@@ -694,8 +697,8 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
watch3
.
start
();
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
watch3
.
stop
();
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"创建amos人员耗时:==》"
+
watch3
.
getTotalTimeSeconds
());
if
(
log
ger
.
isDebugEnabled
()){
log
ger
.
debug
(
"创建amos人员耗时:==>{}"
,
watch3
.
getTotalTimeSeconds
());
}
if
(
userResult
==
null
||
userResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"单位注册失败"
);
...
...
@@ -722,7 +725,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
}
log
.
error
(
e
.
getMessage
(),
e
);
log
ger
.
error
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
e
.
getMessage
());
}
}
...
...
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