Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
3396e70d
Commit
3396e70d
authored
Sep 25, 2023
by
hongguangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EKP1.7.1-hgw-权限
parent
81f631db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
15 deletions
+36
-15
SysUserPermissionMapper.java
...ud/plus/v1/permission/mapper/SysUserPermissionMapper.java
+2
-1
SysUserPermissionServiceImpl.java
...permission/service/impl/SysUserPermissionServiceImpl.java
+18
-13
SysUserPermissionMapper.xml
...biz/src/main/resources/mapper/SysUserPermissionMapper.xml
+16
-1
No files found.
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserPermissionMapper.java
View file @
3396e70d
...
...
@@ -196,8 +196,9 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
List
<
SysUserPermission
>
getUserPermissionByAutoCreateHT
(
@Param
(
"fdId"
)
String
fdId
);
List
<
SysUserPermission
>
getUserPermissionByAutoCreateXM
(
@Param
(
"fdId"
)
String
fdId
);
List
<
SysUserPermission
>
getUserPermissionByAutoCreateXMBG
(
@Param
(
"fdId"
)
String
fdId
);
String
selectCodeByFdId
(
@Param
(
"fdId"
)
String
fdId
);
void
deleteUserPermissionByIdAndType
(
@Param
(
"
domainId"
)
String
domainId
,
@Param
(
"permissionType"
)
String
permissionType
);
void
deleteUserPermissionByIdAndType
(
@Param
(
"
code"
)
String
code
,
@Param
(
"permissionType"
)
String
permissionType
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserPermissionServiceImpl.java
View file @
3396e70d
...
...
@@ -435,35 +435,35 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
List
<
SysUserPermission
>
list
;
// 1客户;2商机;3报价单;4合同;5项目;
String
[]
deleteType
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
}
;
log
.
error
(
"EKP传过来的类型是啥0?"
+
type
)
;
log
.
error
(
"11111同步权限,EKP传过来的fdId="
+
fdId
+
",type="
+
type
)
;
String
deleteType
=
CommonConstants
.
ONE_STRING
;
switch
(
type
)
{
case
"客户"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
1
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
1
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateKH
(
fdId
);
break
;
case
"商机"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
2
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
2
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateSJ
(
fdId
);
break
;
case
"报价单"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
3
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
3
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateBJD
(
fdId
);
break
;
case
"合同"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
4
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
4
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateHT
(
fdId
);
break
;
case
"项目"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
5
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
5
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateXM
(
fdId
);
break
;
case
"项目变更"
:
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
5
])
;
deleteType
=
CommonConstants
.
dingleDigitStrArray
[
5
]
;
list
=
baseMapper
.
getUserPermissionByAutoCreateXMBG
(
fdId
);
break
;
default
:
log
.
error
(
"EKP传过来的类型是啥1?"
+
type
);
// 后面改为这个:
// list = new ArrayList<>()
list
=
baseMapper
.
getUserPermissionByAutoCreateKH
(
fdId
);
baseMapper
.
deleteUserPermissionByIdAndType
(
fdId
,
deleteType
[
1
]);
list
=
new
ArrayList
<>();
}
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
if
(
Common
.
isNotNull
(
list
.
get
(
0
).
getCode
()))
{
baseMapper
.
deleteUserPermissionByIdAndType
(
list
.
get
(
0
).
getCode
(),
deleteType
);
}
for
(
SysUserPermission
sysUserPermission
:
list
)
{
SysUserPermission
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
.
eq
(
SysUserPermission:
:
getDeleteFlag
,
CommonConstants
.
ONE_STRING
)
...
...
@@ -474,6 +474,11 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
this
.
save
(
sysUserPermission
);
}
}
}
else
{
String
code
=
baseMapper
.
selectCodeByFdId
(
fdId
);
if
(
Common
.
isNotNull
(
code
))
{
baseMapper
.
deleteUserPermissionByIdAndType
(
code
,
deleteType
);
}
}
return
R
.
ok
();
}
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserPermissionMapper.xml
View file @
3396e70d
...
...
@@ -363,10 +363,25 @@
where d.fd_id = #{fdId} GROUP BY e.fd_id
</select>
<!-- 查找fdId对应的code -->
<select
id=
"selectCodeByFdId"
resultType=
"java.lang.String"
>
select d.fd_3a9d1d4d438bfc CODE from ekp_fa3e25a1b6c472683e96 d where d.fd_id = #{fdId}
union ALL
select d.fd_3b107f1084fd96 CODE from ekp_24385b8cc934eb8a9231 d where d.fd_id = #{fdId}
union ALL
select d.fd_3b04b9dc64a9f4 CODE from ekp_fd06fd1251d4bac8cc91 d where d.fd_id = #{fdId}
union ALL
select d.fd_3ade319226ed52 CODE from ekp_4834ce2ea964f1a8cfdb d where d.fd_id = #{fdId}
union ALL
select d.fd_3a829aea0b84a4 CODE from ekp_fb3b8d0c8f148639b8e2 d where d.fd_id = #{fdId}
union ALL
select d.fd_3b879793d37afe CODE from ekp_d701e3e72794ff390ca8 d where d.fd_id = #{fdId}
limit 1
</select>
<!-- 删除EKP新建的 -->
<delete
id=
"deleteUserPermissionByIdAndType"
>
delete from sys_user_permission p
where SOURCE_TYPE = 0 and
DOMAIN_ID = #{domainId
} and PERMISSION_TYPE = #{permissionType}
where SOURCE_TYPE = 0 and
CODE = #{code
} and PERMISSION_TYPE = #{permissionType}
</delete>
</mapper>
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