Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
f0949fee
Commit
f0949fee
authored
Jun 20, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
增加一个可以设置审批人的权限
parent
c8ad6cff
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
14 deletions
+53
-14
src/main/java/cn/timer/api/controller/LoginController.java
+8
-8
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+43
-6
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
+2
-0
No files found.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
f0949fee
...
@@ -854,14 +854,14 @@ public class LoginController {
...
@@ -854,14 +854,14 @@ public class LoginController {
QyzxAdminColour
cdys
=
QyzxAdminColour
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
QyzxAdminColour
>().
lambda
().
eq
(
QyzxAdminColour:
:
getOrgCode
,
qyzxEmpLogin1
.
getOrgId
()));
QyzxAdminColour
cdys
=
QyzxAdminColour
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
QyzxAdminColour
>().
lambda
().
eq
(
QyzxAdminColour:
:
getOrgCode
,
qyzxEmpLogin1
.
getOrgId
()));
qyzxEmpLogin1
.
setZdyys
(
cdys
);
qyzxEmpLogin1
.
setZdyys
(
cdys
);
/*不知为何去掉了权限所以只能写死权限,设置审核人的权限路径为/ApprovalSummaryshenpi020102*/
//
/*不知为何去掉了权限所以只能写死权限,设置审核人的权限路径为/ApprovalSummaryshenpi020102*/
ZzglAuth
zzglAuth
=
ZzglAuth
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZzglAuth
>().
lambda
().
eq
(
ZzglAuth:
:
getMenuId
,
"/ApprovalSummaryshenpi020102"
)
//
ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getMenuId,"/ApprovalSummaryshenpi020102")
.
eq
(
ZzglAuth:
:
getOrgCode
,
qyzxEmpLogin1
.
getOrgId
()).
eq
(
ZzglAuth:
:
getBmgwId
,
qyzxEmpLogin1
.
getYgglMainEmp
().
getBmgwId
()));
//
.eq(ZzglAuth::getOrgCode,qyzxEmpLogin1.getOrgId()).eq(ZzglAuth::getBmgwId,qyzxEmpLogin1.getYgglMainEmp().getBmgwId()));
if
(
zzglAuth
!=
null
){
//
if(zzglAuth!=null){
List
menus
=
Lists
.
newArrayList
();
//
List menus = Lists.newArrayList();
menus
.
add
(
zzglAuth
.
getMenuId
());
//
menus.add(zzglAuth.getMenuId());
qyzxEmpLogin1
.
setMenus
(
menus
);
//
qyzxEmpLogin1.setMenus(menus);
}
//
}
// 可操作企业
// 可操作企业
...
...
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
f0949fee
...
@@ -2,13 +2,10 @@ package cn.timer.api.controller.spmk;
...
@@ -2,13 +2,10 @@ package cn.timer.api.controller.spmk;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.redis.RedisUtil
;
...
@@ -531,8 +528,20 @@ public class SpmkController {
...
@@ -531,8 +528,20 @@ public class SpmkController {
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
List
<
Router
>
routers
=
router
.
getChildren
();
// routers = RouterUtils.clearRouters(routers);
// routers = RouterUtils.clearRouters(routers);
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
ZzglAuth
zzglAuth
=
ZzglAuth
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZzglAuth
>().
lambda
().
eq
(
ZzglAuth:
:
getBmgwId
,
userBean
.
getUserInfo
().
getBmgwId
())
.
eq
(
ZzglAuth:
:
getMenuId
,
"/Approvalcustomshenpi020101"
));
/*如果没有该权限*/
if
(
zzglAuth
==
null
){
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
.
eq
(
SpmkCustomApproval:
:
getName
,
spmkApproveSummaryDto
.
getApproveName
()).
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()));
Router
oldRouter
=
ObjectUtil
.
deserialize
(
ca
.
getRouter
());
if
(
isTrue
(
router
.
getChildren
(),
oldRouter
.
getChildren
())){
return
ResultUtil
.
error
(
"你没有设置审批人的权限"
);
}
}
List
<
Router
>
routers
=
router
.
getChildren
();
if
(
routers
==
null
){
if
(
routers
==
null
){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
}
...
@@ -743,6 +752,14 @@ public class SpmkController {
...
@@ -743,6 +752,14 @@ public class SpmkController {
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
// @BindingResultCtrol(title = "审批人审批")
// @BindingResultCtrol(title = "审批人审批")
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
/*判断是否有权限转派*/
/*ZzglAuth zzglAuth = ZzglAuth.builder().build().selectOne(new QueryWrapper<ZzglAuth>().lambda().eq(ZzglAuth::getBmgwId,userBean.getUserInfo().getBmgwId())
.eq(ZzglAuth::getMenuId,"/Approvalcustomshenpi020101"));
if(zzglAuth==null){
return ResultUtil.error("你没有转派审批人的权限");
}*/
Integer
asId
=
approvingDto
.
getAsId
();
Integer
asId
=
approvingDto
.
getAsId
();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
...
@@ -1086,4 +1103,24 @@ public class SpmkController {
...
@@ -1086,4 +1103,24 @@ public class SpmkController {
public
String
addApproveDetail
(){
public
String
addApproveDetail
(){
return
spmkService
.
addApproveDetail
();
return
spmkService
.
addApproveDetail
();
}
}
/**
* 判断人员是否一致
* @param olist
* @param list
* @return
*/
private
boolean
isTrue
(
List
<
Router
>
olist
,
List
<
Router
>
list
){
if
(
list
.
get
(
0
).
getClassName
().
equals
(
"audit"
)&&
list
.
get
(
0
).
getName
().
equals
(
"审批人"
)){
if
(
list
.
get
(
0
).
getRelation
().
get
(
0
).
getType
().
equals
(
"executive"
)&&
list
.
get
(
0
).
getRelation
().
get
(
0
).
getName
().
equals
(
"主管"
)){
return
isTrue
(
olist
.
get
(
0
).
getChildren
(),
list
.
get
(
0
).
getChildren
());
}
if
(
list
.
get
(
0
).
getRelation
().
get
(
0
).
getUsers
().
size
()!=
olist
.
get
(
0
).
getRelation
().
get
(
0
).
getUsers
().
size
()){
return
true
;
}
else
{
return
isTrue
(
olist
.
get
(
0
).
getChildren
(),
list
.
get
(
0
).
getChildren
());
}
}
return
false
;
}
}
}
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
View file @
f0949fee
...
@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
...
@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor;
...
@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@AllArgsConstructor
public
class
SpmkApproveSummaryDto
{
public
class
SpmkApproveSummaryDto
{
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"标题 "
,
example
=
"标题"
,
required
=
true
)
@ApiModelProperty
(
value
=
"标题 "
,
example
=
"标题"
,
required
=
true
)
private
String
title
;
private
String
title
;
...
...
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