Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 43fdaccb
authored
Oct 31, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:图层删除判断saas图层
1 parent
370edc8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
project-interface/src/main/java/com/dituhui/pea/enums/StatusCodeEnum.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
project-interface/src/main/java/com/dituhui/pea/enums/StatusCodeEnum.java
View file @
43fdacc
...
...
@@ -132,7 +132,9 @@ public enum StatusCodeEnum {
FENDAN_ENGINEER_UNMATCHED
(
"023"
,
"分单接口没有查到配置工程师"
,
false
),
FENDAN_IS_TRANSCEND
(
"024"
,
"分单超派"
,
false
);
FENDAN_IS_TRANSCEND
(
"024"
,
"分单超派"
,
false
),
RESOURCE_USER_EXISTS_ROLE
(
"025"
,
"用绑定用户的角色不允许删除,需要解绑后才可以删除角色"
,
false
);
/**
* 状态码
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessLayerServiceImpl.java
View file @
43fdacc
...
...
@@ -16,6 +16,7 @@ import com.dituhui.pea.order.utils.TypeUtils;
import
com.google.gson.internal.LinkedTreeMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
...
...
@@ -252,12 +253,14 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
return
Result
.
failure
(
"该图层下面还有区块"
);
}
// 同步删除saas图层
String
result
=
saasRemoteService
.
deleteLayer
(
ak
,
layer
.
getSaasLayerId
());
log
.
info
(
"deleteLayer params:{} result:{}"
,
layerId
,
result
);
Result
<
Boolean
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
if
(
StringUtils
.
isNotBlank
(
layer
.
getSaasLayerId
()))
{
// 同步删除saas图层
String
result
=
saasRemoteService
.
deleteLayer
(
ak
,
layer
.
getSaasLayerId
());
log
.
info
(
"deleteLayer params:{} result:{}"
,
layerId
,
result
);
Result
<
Boolean
>
saasResult
=
TypeUtils
.
convertResult
(
result
);
if
(!
ResultEnum
.
SUCCESS
.
getCode
().
equals
(
saasResult
.
getCode
()))
{
return
Result
.
failure
(
saasResult
.
getMessage
());
}
}
// 更新状态为删除状态
...
...
project-user/src/main/java/com/dituhui/pea/user/service/RoleService.java
View file @
43fdacc
...
...
@@ -131,6 +131,10 @@ public class RoleService {
if
(
ObjectUtil
.
isNull
(
roleEntity
))
{
throw
new
BusinessException
(
StatusCodeEnum
.
ROLE_DOES_NOT_EXIST
);
}
List
<
UserRoleEntity
>
roleEntities
=
userRoleDao
.
findByRoleId
(
roleId
);
if
(
CollectionUtils
.
isNotEmpty
(
roleEntities
))
{
throw
new
BusinessException
(
StatusCodeEnum
.
RESOURCE_USER_EXISTS_ROLE
);
}
// 删除角色
roleDao
.
deleteById
(
roleId
);
// 删除用户和角色的关系
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment