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
881f2dfe
Commit
881f2dfe
authored
Nov 10, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(tcm): 监管删除启停用企业
1.停用时不清楚2个规定数据,启用时也不马上生成数据
parent
6a36ceed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
49 deletions
+3
-49
EnterpriseManageServiceImpl.java
...ule/tcm/biz/service/impl/EnterpriseManageServiceImpl.java
+3
-49
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/EnterpriseManageServiceImpl.java
View file @
881f2dfe
...
...
@@ -3,16 +3,11 @@ package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.dto.CountDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESPlanTaskList
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESTaskDetail
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsBaseEnterpriseInfoDao
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESPlanTaskListDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESTaskDetailDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.EsBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.common.api.entity.TzsDataRefreshMessage
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.tcm.api.mapper.PatrolMapper
;
import
com.yeejoin.amos.boot.module.tcm.biz.refresh.handler.EnterpriseRefreshHandler
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
...
@@ -50,12 +45,6 @@ public class EnterpriseManageServiceImpl {
private
final
EnterpriseRefreshHandler
refreshHandler
;
private
final
ESPlanTaskList
esPlanTaskList
;
private
final
ESTaskDetail
esTaskDetail
;
private
final
PatrolMapper
patrolMapper
;
/**
* 批量删除企业
*
...
...
@@ -102,7 +91,6 @@ public class EnterpriseManageServiceImpl {
this
.
updateEnterpriseDeletedStatus
(
enterpriseInfo
,
false
);
this
.
insertEnterprise2Es
(
enterpriseInfo
);
this
.
unlockLoginAccount
(
enterpriseInfo
);
this
.
createPatrolData
(
enterpriseInfo
);
});
return
true
;
}
...
...
@@ -121,49 +109,15 @@ public class EnterpriseManageServiceImpl {
enterpriseInfos
.
forEach
(
enterpriseInfo
->
{
this
.
updateEnterpriseDeletedStatus
(
enterpriseInfo
,
true
);
this
.
deleteEnterpriseFromEs
(
enterpriseInfo
);
this
.
clearPatrolData
(
enterpriseInfo
);
this
.
lockLoginAccount
(
enterpriseInfo
);
});
return
true
;
}
private
void
clearPatrolData
(
TzBaseEnterpriseInfo
enterpriseInfo
)
{
//删除planTask
List
<
String
>
planTaskIds
=
patrolMapper
.
selectPlanTaskIdsByUseCode
(
enterpriseInfo
.
getUseCode
());
if
(!
planTaskIds
.
isEmpty
()){
if
(
planTaskIds
.
size
()
>
5000
)
{
int
index
=
5000
;
for
(
int
i
=
0
;
i
<
planTaskIds
.
size
();
i
+=
5000
)
{
if
(
i
+
5000
>
planTaskIds
.
size
())
{
index
=
planTaskIds
.
size
()
-
i
;
}
List
<
String
>
subList
=
planTaskIds
.
subList
(
i
,
i
+
index
);
List
<
ESTaskDetailDto
>
maps
=
patrolMapper
.
findAllByTaskNos
(
subList
);
esTaskDetail
.
deleteAll
(
maps
);
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
subList
.
stream
().
map
(
item
->
new
ESPlanTaskListDto
().
setId
(
item
)).
collect
(
Collectors
.
toList
());
esPlanTaskList
.
deleteAll
(
esPlanTaskListDtos
);
patrolMapper
.
deleteAllPlanTaskDetailByTaskNos
(
subList
);
patrolMapper
.
deleteAllPlanTaskById
(
subList
);
}
}
else
{
List
<
ESTaskDetailDto
>
maps
=
patrolMapper
.
findAllByTaskNos
(
planTaskIds
);
esTaskDetail
.
deleteAll
(
maps
);
List
<
ESPlanTaskListDto
>
esPlanTaskListDtos
=
planTaskIds
.
stream
().
map
(
item
->
new
ESPlanTaskListDto
().
setId
(
item
)).
collect
(
Collectors
.
toList
());
esPlanTaskList
.
deleteAll
(
esPlanTaskListDtos
);
patrolMapper
.
deleteAllPlanTaskDetailByTaskNos
(
planTaskIds
);
patrolMapper
.
deleteAllPlanTaskById
(
planTaskIds
);
}
}
}
private
void
createPatrolData
(
TzBaseEnterpriseInfo
enterpriseInfo
)
{
// todo
}
private
void
unlockLoginAccount
(
TzBaseEnterpriseInfo
enterpriseInfo
)
{
CompanyModel
companyModel
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryByCompanyCode
(
enterpriseInfo
.
getUseCode
()));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
if
(!
userModels
.
isEmpty
())
{
List
<
String
>
userIds
=
userModels
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
Privilege
.
agencyUserClient
.
unlockUsers
(
String
.
join
(
","
,
userIds
));
...
...
@@ -180,7 +134,7 @@ public class EnterpriseManageServiceImpl {
private
void
lockLoginAccount
(
TzBaseEnterpriseInfo
enterpriseInfo
)
{
CompanyModel
companyModel
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryByCompanyCode
(
enterpriseInfo
.
getUseCode
()));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
if
(!
userModels
.
isEmpty
())
{
List
<
String
>
userIds
=
userModels
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
Privilege
.
agencyUserClient
.
lockUsers
(
String
.
join
(
","
,
userIds
));
...
...
@@ -265,7 +219,7 @@ public class EnterpriseManageServiceImpl {
private
void
deleteAmosUser
(
TzBaseEnterpriseInfo
e
)
{
CompanyModel
companyModel
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryByCompanyCode
(
e
.
getUseCode
()));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
List
<
AgencyUserModel
>
userModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
agencyUserClient
.
queryByCompanyId
(
companyModel
.
getSequenceNbr
(),
null
,
null
,
false
));
if
(!
userModels
.
isEmpty
())
{
List
<
String
>
userIds
=
userModels
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
Privilege
.
agencyUserClient
.
multDeleteUser
(
String
.
join
(
","
,
userIds
),
true
);
...
...
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