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
ae5e44b9
Commit
ae5e44b9
authored
Sep 19, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目信息新增服务团队权限同步
parent
3c34c8b7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
3 deletions
+108
-3
TSettleDomain.java
...ifu/cloud/plus/v1/yifu/archives/entity/TSettleDomain.java
+8
-0
EmployeeContractConstants.java
...v1/yifu/archives/constants/EmployeeContractConstants.java
+1
-1
TEmployeeContractInfoServiceImpl.java
...chives/service/impl/TEmployeeContractInfoServiceImpl.java
+1
-2
TSettleDomainServiceImpl.java
.../yifu/archives/service/impl/TSettleDomainServiceImpl.java
+44
-0
UpmsDaprUtils.java
...fu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
+16
-0
AllUserNaVo.java
...com/yifu.cloud.plus.v1/yifu/admin/api/vo/AllUserNaVo.java
+12
-0
UserController.java
...u.cloud.plus.v1/yifu/admin/controller/UserController.java
+26
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/TSettleDomain.java
View file @
ae5e44b9
...
...
@@ -488,4 +488,12 @@ public class TSettleDomain extends BaseEntity {
@ExcelIgnore
private
String
bpoFlag
;
/**
* EKP的服务团队 : 存
*/
@Schema
(
description
=
"EKP的服务团队"
,
name
=
"serviceTeam"
)
@ExcelIgnore
@TableField
(
exist
=
false
)
private
String
serviceTeam
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/constants/EmployeeContractConstants.java
View file @
ae5e44b9
...
...
@@ -7,7 +7,7 @@ public class EmployeeContractConstants {
public
static
final
String
NOT_CREATE_USER
=
"不是创建人,无法删除"
;
public
static
final
String
NOT_AUDIT_STATUS
=
"不是待提交
或审核不通过
,无法删除"
;
public
static
final
String
NOT_AUDIT_STATUS
=
"不是待提交,无法删除"
;
public
static
final
String
NOT_AUDIT
=
"未审核通过,无法更新"
;
public
static
final
String
INVALID
=
"作废、终止,无法更新"
;
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeContractInfoServiceImpl.java
View file @
ae5e44b9
...
...
@@ -553,8 +553,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorVo
.
setMainName
(
contractInfo
.
getApplyNo
());
if
(!
user
.
getId
().
equals
(
contractInfo
.
getCreateBy
()))
{
errorVo
.
setErrorInfo
(
EmployeeContractConstants
.
NOT_CREATE_USER
);
}
else
if
(
contractInfo
.
getAuditStatus
()
!=
CommonConstants
.
ZERO_INT
&&
contractInfo
.
getAuditStatus
()
!=
CommonConstants
.
dingleDigitIntArray
[
3
])
{
}
else
if
(
contractInfo
.
getAuditStatus
()
!=
CommonConstants
.
ZERO_INT
)
{
errorVo
.
setErrorInfo
(
EmployeeContractConstants
.
NOT_AUDIT_STATUS
);
}
else
{
errorVo
.
setResult
(
CommonConstants
.
ONE_INT
);
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TSettleDomainServiceImpl.java
View file @
ae5e44b9
...
...
@@ -16,8 +16,10 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCutsomerDataPermisson
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
...
...
@@ -38,6 +40,7 @@ import lombok.RequiredArgsConstructor;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -141,6 +144,15 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
}
}
}
// 处理服务团队数据权限 2022-09-19 fxj
if
(
Common
.
isNotNull
(
tSettleDomain
.
getServiceTeam
())){
R
<
AllUserNaVo
>
res
=
upmsDaprUtils
.
getUserIdsByUserNames
(
tSettleDomain
.
getServiceTeam
());
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
())
&&
Common
.
isNotNull
(
res
.
getData
().
getUserIds
())){
// 先清理缓存
this
.
removeSettleCache
(
null
,
res
.
getData
().
getUserIds
());
saveForEkp
(
res
.
getData
().
getUserIds
(),
tSettleDomain
.
getId
());
}
}
tSettleDomainInfo
=
baseMapper
.
selectById
(
tSettleDomain
.
getId
());
if
(
Common
.
isNotNull
(
tSettleDomainInfo
))
{
baseMapper
.
updateById
(
tSettleDomain
);
...
...
@@ -163,4 +175,36 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
}
return
setMap
;
}
/**
* @Author fxj
* @Description 更新EKP对应MVP 项目权限,已有权限不做删除处理
* @Date 17:17 2022/9/19
* @Param
* @return
**/
public
boolean
saveForEkp
(
List
<
String
>
userIds
,
String
domainId
){
// 1. 先清除现有的这些认的项目权限
permissonMapper
.
delete
(
Wrappers
.<
TCutsomerDataPermisson
>
query
().
lambda
()
.
in
(
TCutsomerDataPermisson:
:
getBePermissonUser
,
userIds
)
.
eq
(
TCutsomerDataPermisson:
:
getSettleDomainId
,
domainId
));
// 2.新增新的项目人员权限
TCutsomerDataPermisson
pm
;
if
(
Common
.
isNotNull
(
userIds
)){
for
(
String
uId:
userIds
){
pm
=
new
TCutsomerDataPermisson
();
pm
.
setIsCustomerService
(
CommonConstants
.
ZERO_STRING
);
pm
.
setIsOwner
(
CommonConstants
.
ONE_STRING
);
pm
.
setPermissonSrc
(
"EKP服务团队"
);
pm
.
setPermissonLevel
(
CommonConstants
.
ONE_INT
);
pm
.
setBePermissonUser
(
uId
);
pm
.
setBePermissionTime
(
LocalDateTime
.
now
());
pm
.
setSettleDomainId
(
domainId
);
pm
.
setPermissionUser
(
CommonConstants
.
ONE_STRING
);
pm
.
setType
(
CommonConstants
.
TWO_STRING
);
permissonMapper
.
insert
(
pm
);
}
}
return
true
;
}
}
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/UpmsDaprUtils.java
View file @
ae5e44b9
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
dapr
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AllUserNaVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
...
...
@@ -51,4 +52,19 @@ public class UpmsDaprUtils {
}
return
allUserVoR
;
}
/**
* @Author fxj
* @Description 获取指定用户名对应用户IDs
* @Date 17:57 2022/8/16
* @Param
* @return
**/
public
R
<
AllUserNaVo
>
getUserIdsByUserNames
(
String
usernames
)
{
R
<
AllUserNaVo
>
allUserVoR
=
HttpDaprUtil
.
invokeMethodPost
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/inner/getUserIdsByUserNames"
,
usernames
,
AllUserNaVo
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
allUserVoR
)){
return
R
.
failed
(
"获取指定用户名对应用户IDs失败!"
);
}
return
allUserVoR
;
}
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/AllUserNaVo.java
View file @
ae5e44b9
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* @Author fxj
...
...
@@ -13,5 +14,16 @@ import java.util.HashMap;
*/
@Data
public
class
AllUserNaVo
implements
Serializable
{
/**
* @Author fxj
* @Description key 用户ID value 用户名称
* @Date 17:05 2022/9/19
**/
private
HashMap
<
String
,
String
>
userNames
;
/**
* @Author fxj
* @Description 用户IDS
* @Date 17:05 2022/9/19
**/
private
List
<
String
>
userIds
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/UserController.java
View file @
ae5e44b9
...
...
@@ -45,6 +45,7 @@ import org.springframework.validation.BindingResult;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -294,7 +295,32 @@ public class UserController {
}
return
naVo
;
}
/**
* @Author fxj
* @Description 获取所有用户-- 指定用户名
* @Date 18:20 2022/8/16
* @Param
* @return
**/
@Inner
@PostMapping
(
value
=
{
"/inner/getUserIdsByUserNames"
})
public
AllUserNaVo
getUserIdsByUserNames
(
@RequestBody
String
usernames
)
{
AllUserNaVo
naVo
=
new
AllUserNaVo
();
if
(
Common
.
isEmpty
(
usernames
)){
return
naVo
;
}
List
<
SysUser
>
sysUsers
=
userService
.
list
(
Wrappers
.<
SysUser
>
query
().
lambda
()
.
in
(
SysUser:
:
getUsername
,
Common
.
getList
(
usernames
)));
if
(
Common
.
isNotEmpty
(
sysUsers
)){
List
<
String
>
userIds
=
new
ArrayList
<>();
for
(
SysUser
u:
sysUsers
){
userIds
.
add
(
u
.
getUserId
());
}
naVo
.
setUserIds
(
userIds
);
}
return
naVo
;
}
/**
* @Author hgw
* @Description 获取部门下的用户id
...
...
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