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
2e3766de
Commit
2e3766de
authored
Aug 20, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草稿箱审批人详情
parent
70177008
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
112 deletions
+13
-112
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+13
-112
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
2e3766de
...
...
@@ -758,6 +758,19 @@ public class SpmkController {
}
/**
* 审批详情
*/
@GetMapping
(
value
=
"/select_drafts_detail/{id}"
)
@ApiOperation
(
value
=
"草稿箱审批详情"
,
httpMethod
=
"GET"
,
notes
=
"审批详情"
)
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectdd
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetailDto
adD
=
spmkService
.
selectDraftsDetailByAsId
(
id
);
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
return
ResultUtil
.
data
(
adD
);
}
//TODO 审批人审批
/**
* 审批人审批
...
...
@@ -1190,116 +1203,4 @@ public class SpmkController {
return
ResultUtil
.
data
(
JSON
.
toJSONString
(
detailSummary
));
}
@PostMapping
(
value
=
"/save_drafts"
)
@ApiOperation
(
value
=
"存入草稿箱"
,
httpMethod
=
"POST"
,
notes
=
"存入草稿箱"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Log
(
title
=
"审批-存入草稿箱"
,
businessType
=
BusinessType
.
INSERT
)
public
Result
<
Object
>
saveDrafts
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
try
{
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
);
if
(
ygglMainEmp
==
null
)
return
ResultUtil
.
error
(
"发起人不存在!"
);
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
// routers = RouterUtils.clearRouters(routers);
/*TODO 验证是否拥有添加审核人的权限 只用于华颐*/
QyzxEmpEntAsso
ent
=
QyzxEmpEntAsso
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
()));
if
(
ent
!=
null
)
{
/*超管和管理员不受权限控制*/
if
(
ent
.
getUserType
()
==
2
)
{
ZzglAuth
zzglAuth
=
ZzglAuth
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
ZzglAuth
>().
lambda
().
eq
(
ZzglAuth:
:
getBmgwId
,
userBean
.
getUserInfo
().
getBmgwId
())
.
eq
(
ZzglAuth:
:
getMenuId
,
"/Approvalspbutonspbuton020101"
));
/*如果没有该权限*/
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
>
listRouter
=
new
ArrayList
<
Router
>();
listRouter
.
add
(
router
);
JSONObject
jSONObject
=
spmkApproveSummaryDto
.
getRequestData
()
.
set
(
"orgCode"
,
userBean
.
getOrgCode
())
.
set
(
"initiator"
,
ygglMainEmp
.
getName
())
.
set
(
"headUrl"
,
ygglMainEmp
.
getHeadUrl
())
.
set
(
"id"
,
userBean
.
getEmpNum
());
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
String
currentApprover
=
jSONObject
.
getStr
(
"current_approver"
);
SpmkApproveDrafts
as
=
SpmkApproveDrafts
.
builder
()
.
orgCode
(
userBean
.
getOrgCode
())
.
empNum
(
userBean
.
getEmpNum
())
.
title
(
spmkApproveSummaryDto
.
getTitle
())
.
initiator
(
spmkApproveSummaryDto
.
getInitiator
())
.
approveName
(
spmkApproveSummaryDto
.
getApproveName
())
.
assoType
(
spmkApproveSummaryDto
.
getAssoType
())
.
sts
(
ApproveSummarySts
.
IN
.
ordinal
())
.
currentApprover
(
currentApprover
).
isUrgent
(
spmkApproveSummaryDto
.
getIsUrgent
())
.
build
();
if
(
spmkApproveSummaryDto
.
getId
()!=
null
){
as
.
setId
(
spmkApproveSummaryDto
.
getId
());
as
.
setUpdateTime
(
new
Date
());
}
if
(!
as
.
insertOrUpdate
())
{
throw
new
CustomException
(
"审批草稿汇总-新增异常"
);
}
// 草稿不插入执审批流程
// RouterUtils.insertogExecuteRecord(listFlowChildren, as.getId());
// 封装 审批详情
SpmkApproveDetailDrafts
adm
=
SpmkApproveDetailDrafts
.
builder
().
build
();
adm
.
setApproveSummaryId
(
as
.
getId
());
adm
.
setName
(
spmkApproveSummaryDto
.
getTitle
());
adm
.
setRequestData
(
spmkApproveSummaryDto
.
getRequestData
().
toString
());
adm
.
setFroms
(
spmkApproveSummaryDto
.
getFroms
().
toString
());
adm
.
setRouter
(
listRouter
.
get
(
0
).
toJSONString
());
adm
.
setFlowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
());
if
(
spmkApproveSummaryDto
.
getId
()!=
null
){
SpmkApproveDetailDrafts
sp
=
SpmkApproveDetailDrafts
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailDrafts
>().
lambda
().
eq
(
SpmkApproveDetailDrafts:
:
getApproveSummaryId
,
spmkApproveSummaryDto
.
getId
()));
adm
.
setId
(
sp
.
getId
());
spmkApproveDetailDraftsMapper
.
updateById
(
adm
);
}
else
{
spmkApproveDetailDraftsMapper
.
insert
(
adm
);
}
return
ResultUtil
.
data
(
as
.
getId
());
}
catch
(
Exception
e
){
// throw new CustomException("审批草稿详情-新增异常");
e
.
printStackTrace
();
}
return
ResultUtil
.
error
(
"审批草稿详情-新增异常"
);
};
@PostMapping
(
value
=
"/my_drafts"
)
@ApiOperation
(
value
=
"我的草稿箱"
,
httpMethod
=
"POST"
,
notes
=
"我的草稿箱"
)
@Log
(
title
=
"审批-我的草稿箱"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
myDrafts
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
){
IPage
<
SpmkApproveDrafts
>
page
=
new
Page
<
SpmkApproveDrafts
>(
mySummaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
mySummaryQueryDto
.
getCurrentPage
(),
mySummaryQueryDto
.
getTotalPage
()
==
null
?
10
:
mySummaryQueryDto
.
getTotalPage
());
mySummaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
mySummaryQueryDto
.
setEmpNum
(
userBean
.
getEmpNum
());
if
(
mySummaryQueryDto
.
getSts
()
==
null
)
{
mySummaryQueryDto
.
setSts
(
0
);
}
IPage
<
SpmkApproveDrafts
>
pageAs
=
spmkApproveDraftsMapper
.
selectPageByQueryForEmpNum
(
page
,
mySummaryQueryDto
);
List
<
SpmkApproveDrafts
>
listAs
=
pageAs
.
getRecords
();
return
ResultUtil
.
data
(
pageAs
,
listAs
);
}
}
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