Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
e15a7269
Commit
e15a7269
authored
Jul 01, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
27301 经销商管理员不能对经销商账号进行删除操作
parent
cbec0fa5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
PersonnelBusinessMapper.java
.../boot/module/hygf/api/mapper/PersonnelBusinessMapper.java
+5
-0
PersonnelBusinessMapper.xml
...c/main/resources/mapper/mysql/PersonnelBusinessMapper.xml
+10
-0
PersonnelBusinessServiceImpl.java
...e/hygf/biz/service/impl/PersonnelBusinessServiceImpl.java
+13
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/PersonnelBusinessMapper.java
View file @
e15a7269
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness;
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -43,4 +44,8 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
...
@@ -43,4 +44,8 @@ public interface PersonnelBusinessMapper extends BaseMapper<PersonnelBusiness> {
void
deleteSueByUserId
(
String
userId
);
void
deleteSueByUserId
(
String
userId
);
void
deleteAliByUserId
(
String
userId
);
void
deleteAliByUserId
(
String
userId
);
List
<
String
>
selectHygfTableName
();
int
countByUserId
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"userId"
)
String
userId
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/PersonnelBusinessMapper.xml
View file @
e15a7269
...
@@ -148,4 +148,14 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN
...
@@ -148,4 +148,14 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN
DELETE FROM auth_login_info WHERE USER_ID=#{userId}
DELETE FROM auth_login_info WHERE USER_ID=#{userId}
</select>
</select>
<select
id=
"selectHygfTableName"
resultType=
"java.lang.String"
>
SELECT table_name
FROM information_schema.tables
WHERE table_schema=DATABASE() and table_name LIKE 'hygf_%';
</select>
<select
id=
"countByUserId"
resultType=
"int"
>
select count(1) from ${tableName} where rec_user_id =#{userId}
</select>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PersonnelBusinessServiceImpl.java
View file @
e15a7269
...
@@ -498,10 +498,21 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
...
@@ -498,10 +498,21 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteAllBySequenceNbr
(
Long
sequenceNbr
)
{
public
Boolean
deleteAllBySequenceNbr
(
Long
sequenceNbr
)
{
// 根据sequenceNbr查询用户userId
String
userId
=
personnelBusinessMapper
.
selectUserInfo
(
sequenceNbr
);
//添加校验,如果业务表里面有相关的用户id不能删除
List
<
String
>
tableName
=
personnelBusinessMapper
.
selectHygfTableName
();
if
(
CollectionUtil
.
isNotEmpty
(
tableName
))
{
for
(
String
table
:
tableName
)
{
int
count
=
personnelBusinessMapper
.
countByUserId
(
table
,
userId
);
if
(
count
>
0
)
{
throw
new
BadRequest
(
"该用户有操作记录无法删除!"
);
}
}
}
try
{
try
{
// 根据sequenceNbr查询用户userId
String
userId
=
personnelBusinessMapper
.
selectUserInfo
(
sequenceNbr
);
// 删除privilege_agency_user表中数据
// 删除privilege_agency_user表中数据
personnelBusinessMapper
.
deletePauByUserId
(
userId
);
personnelBusinessMapper
.
deletePauByUserId
(
userId
);
// 删除privilege_group_user表中数据
// 删除privilege_group_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