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
ac386e79
Commit
ac386e79
authored
Sep 07, 2021
by
陶湘宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防止重复提交审批
parent
182d832f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1070 additions
and
1055 deletions
+1070
-1055
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+1070
-1055
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
ac386e79
package
cn
.
timer
.
api
.
controller
.
spmk
;
package
cn
.
timer
.
api
.
controller
.
spmk
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.spmk.*
;
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
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
net.sf.json.JSONArray
;
import
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
net.sf.json.JSONArray
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.kqgl.PunchRecord
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveRules
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.bean.yggl.YgglMainEmp
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.bean.zzgl.ZzglBmgwM
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.config.validation.Insert
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.config.validation.Ranks
;
import
cn.timer.api.config.validation.Insert
;
import
cn.timer.api.config.validation.Update
;
import
cn.timer.api.config.validation.Ranks
;
import
cn.timer.api.config.validation.ValidList
;
import
cn.timer.api.config.validation.Update
;
import
cn.timer.api.controller.spmk.service.SpmkService
;
import
cn.timer.api.config.validation.ValidList
;
import
cn.timer.api.controller.yggl.service.YgglService
;
import
cn.timer.api.controller.spmk.service.SpmkService
;
import
cn.timer.api.controller.zzgl.service.ZzglBmgwMService
;
import
cn.timer.api.controller.yggl.service.YgglService
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.controller.zzgl.service.ZzglBmgwMService
;
import
cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper
;
import
cn.timer.api.dao.kqgl.PunchRecordMapper
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.router.RouterUtils
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.router.business.SpmkAssoBusiness
;
import
cn.timer.api.utils.router.RouterUtils
;
import
cn.timer.api.utils.router.business.SpmkAssoBusinessFactory
;
import
cn.timer.api.utils.router.business.SpmkAssoBusiness
;
import
cn.timer.api.utils.router.enums.ApproveEnum
;
import
cn.timer.api.utils.router.business.SpmkAssoBusinessFactory
;
import
io.swagger.annotations.Api
;
import
cn.timer.api.utils.router.enums.ApproveEnum
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
=
"3.0审批模块"
)
@RestController
import
javax.annotation.Resource
;
@Transactional
@RequestMapping
(
value
=
"/spmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
@Api
(
tags
=
"3.0审批模块"
)
public
class
SpmkController
{
@RestController
@Transactional
@Autowired
@RequestMapping
(
value
=
"/spmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
private
SpmkService
spmkService
;
public
class
SpmkController
{
@Autowired
private
ZzglBmgwMService
zzglBmgwMService
;
@Autowired
private
SpmkService
spmkService
;
@Autowired
@Autowired
private
QyzxEmpEntAssoMapper
qyzxEmpEntAssoMapper
;
private
ZzglBmgwMService
zzglBmgwMService
;
@Autowired
private
SpmkApprovalTemplateGMapper
spmkApprovalTemplateGMapper
;
@Autowired
@Autowired
private
QyzxEmpEntAssoMapper
qyzxEmpEntAssoMapper
;
private
SpmkApprovalTemplateMapper
spmkApprovalTemplateMapper
;
@Autowired
@Autowired
private
SpmkApprovalTemplateGMapper
spmkApprovalTemplateGMapper
;
private
SpmkApprovalGMapper
spmkApprovalGMapper
;
@Autowired
@Autowired
private
SpmkApprovalTemplateMapper
spmkApprovalTemplateMapper
;
private
SpmkCustomApprovalMapper
spmkCustomApprovalMapper
;
@Autowired
@Autowired
private
SpmkApprovalGMapper
spmkApprovalGMapper
;
private
SpmkApproveSummaryMapper
spmkApproveSummaryMapper
;
@Autowired
@Autowired
private
SpmkCustomApprovalMapper
spmkCustomApprovalMapper
;
private
SpmkApproveExecuteRecordMapper
spmkApproveExecuteRecordMapper
;
@Autowired
@Autowired
private
SpmkApproveSummaryMapper
spmkApproveSummaryMapper
;
private
SpmkExecutorMapper
spmkExecutorMapper
;
@Autowired
@Autowired
private
SpmkApproveExecuteRecordMapper
spmkApproveExecuteRecordMapper
;
private
SpmkInitiatorConfigMapper
spmkInitiatorConfigMapper
;
@Autowired
@Autowired
private
SpmkExecutorMapper
spmkExecutorMapper
;
private
SpmkApproveDetailSummaryMapper
spmkApproveDetailSummaryMapper
;
@Autowired
private
SpmkInitiatorConfigMapper
spmkInitiatorConfigMapper
;
@Autowired
@Autowired
private
SpmkAssoBusinessFactory
spmkAssoBusinessFactory
;
private
SpmkApproveDetailSummaryMapper
spmkApproveDetailSummaryMapper
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
@Autowired
private
SpmkAssoBusinessFactory
spmkAssoBusinessFactory
;
private
boolean
ISFIRST
=
true
;
// 第一次启动审批流程
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
private
boolean
ISFIRST
=
true
;
// 第一次启动审批流程
//TODO 审批模板组
@Resource
/**
private
RedisUtil
redisUtil
;
* 新增或编辑-审批模板组
*/
@PostMapping
(
value
=
"/save_approval_template_g"
)
//TODO 审批模板组
@ApiOperation
(
value
=
"1.新增或编辑-审批模板组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板组"
)
/**
@ApiOperationSupport
(
order
=
1
)
* 新增或编辑-审批模板组
public
Result
<
Object
>
saveAtg
(
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
){
*/
@PostMapping
(
value
=
"/save_approval_template_g"
)
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
@ApiOperation
(
value
=
"1.新增或编辑-审批模板组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板组"
)
.
ne
(
spmkApprovalTemplateG
.
getId
()
!=
null
,
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
@ApiOperationSupport
(
order
=
1
)
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
public
Result
<
Object
>
saveAtg
(
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
){
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
.
ne
(
spmkApprovalTemplateG
.
getId
()
!=
null
,
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
return
spmkApprovalTemplateG
.
insertOrUpdate
()
?
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
ResultUtil
.
data
(
spmkApprovalTemplateG
)
:
ResultUtil
.
error
();
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
}
/**
return
spmkApprovalTemplateG
.
insertOrUpdate
()
?
* 删除-审批模板组
ResultUtil
.
data
(
spmkApprovalTemplateG
)
:
ResultUtil
.
error
();
*/
}
@DeleteMapping
(
value
=
"/delete_approval_template_g/{id}"
)
@ApiOperation
(
value
=
"2.删除-审批模板组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板组"
)
/**
@ApiOperationSupport
(
order
=
2
)
* 删除-审批模板组
public
Result
<
Object
>
deleteAtgById
(
@PathVariable
int
id
){
*/
@DeleteMapping
(
value
=
"/delete_approval_template_g/{id}"
)
if
(
spmkApprovalTemplateMapper
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
().
eq
(
SpmkApprovalTemplate:
:
getApprovalTemplateGId
,
id
))
>
0
)
@ApiOperation
(
value
=
"2.删除-审批模板组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板组"
)
return
ResultUtil
.
error
(
"审批模板组存在 模板,不可直接删除!"
);
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
deleteAtgById
(
@PathVariable
int
id
){
return
SpmkApprovalTemplateG
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
if
(
spmkApprovalTemplateMapper
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
().
eq
(
SpmkApprovalTemplate:
:
getApprovalTemplateGId
,
id
))
>
0
)
}
return
ResultUtil
.
error
(
"审批模板组存在 模板,不可直接删除!"
);
/**
return
SpmkApprovalTemplateG
.
builder
().
id
(
id
).
build
().
deleteById
()
?
* 查询列表-审批模板组
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
*/
}
@GetMapping
(
value
=
"/list_approval_template_g"
)
@ApiOperation
(
value
=
"3.查询列表-审批模板组"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批模板组"
)
/**
@ApiOperationSupport
(
order
=
3
)
* 查询列表-审批模板组
public
Result
<
Object
>
selectListAtg
(){
*/
@GetMapping
(
value
=
"/list_approval_template_g"
)
return
ResultUtil
.
data
(
spmkApprovalTemplateGMapper
.
selectListAtInAtg
());
@ApiOperation
(
value
=
"3.查询列表-审批模板组"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批模板组"
)
}
@ApiOperationSupport
(
order
=
3
)
public
Result
<
Object
>
selectListAtg
(){
/**
* 排序-审批模板组
return
ResultUtil
.
data
(
spmkApprovalTemplateGMapper
.
selectListAtInAtg
());
*/
}
@PutMapping
(
value
=
"/update_approval_template_g"
)
@ApiOperation
(
value
=
"4.排序-审批模板组"
,
httpMethod
=
"PUT"
,
notes
=
"排序-审批模板组"
)
/**
@ApiOperationSupport
(
order
=
4
)
* 排序-审批模板组
public
Result
<
Object
>
ranksAtg
(
@Validated
(
Ranks
.
class
)
@RequestBody
ValidList
<
SpmkApprovalTemplateG
>
list
){
*/
@PutMapping
(
value
=
"/update_approval_template_g"
)
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
@ApiOperation
(
value
=
"4.排序-审批模板组"
,
httpMethod
=
"PUT"
,
notes
=
"排序-审批模板组"
)
return
ResultUtil
.
success
();
@ApiOperationSupport
(
order
=
4
)
}
public
Result
<
Object
>
ranksAtg
(
@Validated
(
Ranks
.
class
)
@RequestBody
ValidList
<
SpmkApprovalTemplateG
>
list
){
return
spmkApprovalTemplateGMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
}
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
return
ResultUtil
.
success
();
//TODO 审批模板
}
/**
return
spmkApprovalTemplateGMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
* 新增或编辑-审批模板
}
*/
@PostMapping
(
value
=
"/save_approval_template"
)
//TODO 审批模板
@ApiOperation
(
value
=
"5.新增或编辑-审批模板"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板"
)
/**
@ApiOperationSupport
(
order
=
5
)
* 新增或编辑-审批模板
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
){
*/
@PostMapping
(
value
=
"/save_approval_template"
)
Integer
approvalTemplateGId
=
spmkApprovalTemplateDto
.
getApprovalTemplateGId
();
@ApiOperation
(
value
=
"5.新增或编辑-审批模板"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板"
)
if
(
ObjectUtil
.
isNull
(
approvalTemplateGId
))
@ApiOperationSupport
(
order
=
5
)
return
ResultUtil
.
error
(
"审批模板ID不为空"
);
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
){
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
build
();
Integer
approvalTemplateGId
=
spmkApprovalTemplateDto
.
getApprovalTemplateGId
();
if
(
ObjectUtil
.
isNull
(
approvalTemplateGId
))
// 克隆 SpmkApprovalTemplateDto对象 到 SpmkApprovalTemplate对象,排除属性froms,router
return
ResultUtil
.
error
(
"审批模板ID不为空"
);
BeanUtil
.
copyProperties
(
spmkApprovalTemplateDto
,
at
,
"froms"
,
"router"
);
// 序列化 后 写入 SpmkApprovalTemplate对象
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
build
();
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
// 克隆 SpmkApprovalTemplateDto对象 到 SpmkApprovalTemplate对象,排除属性froms,router
BeanUtil
.
copyProperties
(
spmkApprovalTemplateDto
,
at
,
"froms"
,
"router"
);
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
// 序列化 后 写入 SpmkApprovalTemplate对象
.
ne
(
at
.
getId
()
!=
null
,
SpmkApprovalTemplate:
:
getId
,
at
.
getId
())
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
.
eq
(
SpmkApprovalTemplate:
:
getName
,
at
.
getName
()))
>
0
)
{
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
return
ResultUtil
.
error
(
"审批模板名重复!"
);
}
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
.
ne
(
at
.
getId
()
!=
null
,
SpmkApprovalTemplate:
:
getId
,
at
.
getId
())
if
(!
at
.
insertOrUpdate
())
.
eq
(
SpmkApprovalTemplate:
:
getName
,
at
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"数据库操作失败"
);
return
ResultUtil
.
error
(
"审批模板名重复!"
);
}
// 清空前端不需要的字段再返回,节省流量
at
.
setFroms
(
null
);
if
(!
at
.
insertOrUpdate
())
at
.
setRouter
(
null
);
return
ResultUtil
.
error
(
"数据库操作失败"
);
return
ResultUtil
.
data
(
at
);
// 清空前端不需要的字段再返回,节省流量
}
at
.
setFroms
(
null
);
at
.
setRouter
(
null
);
/**
return
ResultUtil
.
data
(
at
);
* 删除-审批模板
*/
}
@DeleteMapping
(
value
=
"/delete_approval_template/{id}"
)
@ApiOperation
(
value
=
"6.删除-审批模板"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板"
)
/**
@ApiOperationSupport
(
order
=
6
)
* 删除-审批模板
public
Result
<
Object
>
deleteAtById
(
@PathVariable
int
id
){
*/
@DeleteMapping
(
value
=
"/delete_approval_template/{id}"
)
return
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
@ApiOperation
(
value
=
"6.删除-审批模板"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板"
)
@ApiOperationSupport
(
order
=
6
)
}
public
Result
<
Object
>
deleteAtById
(
@PathVariable
int
id
){
/**
return
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
* id查询-审批模板
*/
}
@GetMapping
(
value
=
"/select_approval_template/{id}"
)
@ApiOperation
(
value
=
"7.id查询-审批模板"
,
httpMethod
=
"GET"
,
notes
=
"id查询-审批模板"
)
/**
@ApiOperationSupport
(
order
=
7
)
* id查询-审批模板
public
Result
<
Object
>
selectAtById
(
@PathVariable
int
id
){
*/
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
selectById
();
@GetMapping
(
value
=
"/select_approval_template/{id}"
)
@ApiOperation
(
value
=
"7.id查询-审批模板"
,
httpMethod
=
"GET"
,
notes
=
"id查询-审批模板"
)
SpmkApprovalTemplateDto
atd
=
SpmkApprovalTemplateDto
.
builder
().
build
();
@ApiOperationSupport
(
order
=
7
)
BeanUtil
.
copyProperties
(
at
,
atd
,
"froms"
,
"router"
);
public
Result
<
Object
>
selectAtById
(
@PathVariable
int
id
){
atd
.
setFroms
(
ObjectUtil
.
deserialize
(
at
.
getFroms
()));
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
selectById
();
atd
.
setRouter
(
ObjectUtil
.
deserialize
(
at
.
getRouter
()));
return
ResultUtil
.
data
(
atd
);
SpmkApprovalTemplateDto
atd
=
SpmkApprovalTemplateDto
.
builder
().
build
();
BeanUtil
.
copyProperties
(
at
,
atd
,
"froms"
,
"router"
);
}
atd
.
setFroms
(
ObjectUtil
.
deserialize
(
at
.
getFroms
()));
atd
.
setRouter
(
ObjectUtil
.
deserialize
(
at
.
getRouter
()));
/**
return
ResultUtil
.
data
(
atd
);
* 排序-审批模板
*/
}
@PutMapping
(
value
=
"/update_approval_template"
)
@ApiOperation
(
value
=
"8.排序-审批模板"
,
httpMethod
=
"PUT"
,
notes
=
"查询列表-审批模板组"
)
/**
@ApiOperationSupport
(
order
=
8
)
* 排序-审批模板
public
Result
<
Object
>
ranksAt
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalTemplate
>
list
){
*/
@PutMapping
(
value
=
"/update_approval_template"
)
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
@ApiOperation
(
value
=
"8.排序-审批模板"
,
httpMethod
=
"PUT"
,
notes
=
"查询列表-审批模板组"
)
return
ResultUtil
.
success
();
@ApiOperationSupport
(
order
=
8
)
}
public
Result
<
Object
>
ranksAt
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalTemplate
>
list
){
return
spmkApprovalTemplateMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
return
ResultUtil
.
success
();
}
}
return
spmkApprovalTemplateMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
//TODO 审批组
}
/**
* 新增或编辑-审批组
*/
@PostMapping
(
value
=
"/save_approval_g"
)
//TODO 审批组
@ApiOperation
(
value
=
"9.新增或编辑-审批组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批组"
)
/**
@ApiOperationSupport
(
order
=
9
)
* 新增或编辑-审批组
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalG
spmkApprovalG
){
*/
@PostMapping
(
value
=
"/save_approval_g"
)
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
@ApiOperation
(
value
=
"9.新增或编辑-审批组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批组"
)
.
ne
(
spmkApprovalG
.
getId
()
!=
null
,
SpmkApprovalG:
:
getId
,
spmkApprovalG
.
getId
())
@ApiOperationSupport
(
order
=
9
)
.
eq
(
SpmkApprovalG:
:
getName
,
spmkApprovalG
.
getName
())
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalG
spmkApprovalG
){
.
eq
(
SpmkApprovalG:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批组名重复!"
);
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
}
.
ne
(
spmkApprovalG
.
getId
()
!=
null
,
SpmkApprovalG:
:
getId
,
spmkApprovalG
.
getId
())
.
eq
(
SpmkApprovalG:
:
getName
,
spmkApprovalG
.
getName
())
spmkApprovalG
.
setOrgCode
(
userBean
.
getOrgCode
());
.
eq
(
SpmkApprovalG:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
spmkApprovalG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalG
)
:
ResultUtil
.
error
();
return
ResultUtil
.
error
(
"审批组名重复!"
);
}
}
spmkApprovalG
.
setOrgCode
(
userBean
.
getOrgCode
());
/**
return
spmkApprovalG
.
insertOrUpdate
()
?
ResultUtil
.
data
(
spmkApprovalG
)
:
ResultUtil
.
error
();
* 删除-审批组
*/
}
@DeleteMapping
(
value
=
"/delete_approval_g/{id}"
)
@ApiOperation
(
value
=
"10.删除-审批组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批组"
)
/**
@ApiOperationSupport
(
order
=
10
)
* 删除-审批组
public
Result
<
Object
>
deleteAgById
(
@PathVariable
int
id
){
*/
@DeleteMapping
(
value
=
"/delete_approval_g/{id}"
)
// if (spmkCustomApprovalMapper.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda().eq(SpmkCustomApproval::getApprovalGId, id)) > 0 )
@ApiOperation
(
value
=
"10.删除-审批组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批组"
)
// return ResultUtil.error("审批组存在 自定义审批,不可直接删除!");
@ApiOperationSupport
(
order
=
10
)
public
Result
<
Object
>
deleteAgById
(
@PathVariable
int
id
){
SpmkCustomApproval
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
().
eq
(
SpmkCustomApproval:
:
getApprovalGId
,
id
));
return
SpmkApprovalG
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
// if (spmkCustomApprovalMapper.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda().eq(SpmkCustomApproval::getApprovalGId, id)) > 0 )
// return ResultUtil.error("审批组存在 自定义审批,不可直接删除!");
}
SpmkCustomApproval
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
().
eq
(
SpmkCustomApproval:
:
getApprovalGId
,
id
));
/**
return
SpmkApprovalG
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
* 查询列表-审批组-审批管理
*/
}
@GetMapping
(
value
=
"/all_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-审批管理"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-审批管理"
)
/**
@ApiOperationSupport
(
order
=
11
)
* 查询列表-审批组-审批管理
public
Result
<
Object
>
selectListAgByAdmin
(
@CurrentUser
UserBean
userBean
){
*/
@GetMapping
(
value
=
"/all_approval_g"
)
List
<
Integer
>
depts
=
zzglBmgwMService
.
empNumupGetDepts
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
());
@ApiOperation
(
value
=
"11.查询列表-审批组-审批管理"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-审批管理"
)
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCaByAdmin
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
));
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAgByAdmin
(
@CurrentUser
UserBean
userBean
){
}
List
<
Integer
>
depts
=
zzglBmgwMService
.
empNumupGetDepts
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
());
/**
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCaByAdmin
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
));
* 查询列表-审批组-个人审批
*/
}
@GetMapping
(
value
=
"/list_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-个人审批"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-个人审批"
)
/**
@ApiOperationSupport
(
order
=
11
)
* 查询列表-审批组-个人审批
public
Result
<
Object
>
selectListAg
(
@CurrentUser
UserBean
userBean
){
*/
@GetMapping
(
value
=
"/list_approval_g"
)
return
ResultUtil
.
data
(
spmkService
.
selectListAg
(
userBean
));
@ApiOperation
(
value
=
"11.查询列表-审批组-个人审批"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-个人审批"
)
}
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAg
(
@CurrentUser
UserBean
userBean
){
/**
* 排序-审批组
return
ResultUtil
.
data
(
spmkService
.
selectListAg
(
userBean
));
*/
}
@PutMapping
(
value
=
"/update_approval_g"
)
@ApiOperation
(
value
=
"12.排序-审批组"
,
httpMethod
=
"PUT"
,
notes
=
"排序-审批组"
)
/**
@ApiOperationSupport
(
order
=
12
)
* 排序-审批组
public
Result
<
Object
>
ranksAg
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalG
>
list
){
*/
@PutMapping
(
value
=
"/update_approval_g"
)
if
(
list
==
null
||
list
.
size
()
<=
0
)
{
@ApiOperation
(
value
=
"12.排序-审批组"
,
httpMethod
=
"PUT"
,
notes
=
"排序-审批组"
)
return
ResultUtil
.
success
();
@ApiOperationSupport
(
order
=
12
)
}
public
Result
<
Object
>
ranksAg
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalG
>
list
){
return
spmkApprovalGMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
if
(
list
==
null
||
list
.
size
()
<=
0
)
{
}
return
ResultUtil
.
success
();
}
//TODO 自定义审批
return
spmkApprovalGMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
/**
}
* 新增或编辑-自定义审批
*/
//TODO 自定义审批
@PostMapping
(
value
=
"/save_custom_approval"
)
@ApiOperation
(
value
=
"13.新增或编辑-自定义审批"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-自定义审批"
)
/**
@ApiOperationSupport
(
order
=
13
)
* 新增或编辑-自定义审批
@Transactional
(
rollbackFor
=
Exception
.
class
)
*/
public
Result
<
Object
>
saveCa
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
@PostMapping
(
value
=
"/save_custom_approval"
)
@ApiOperation
(
value
=
"13.新增或编辑-自定义审批"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-自定义审批"
)
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
();
@ApiOperationSupport
(
order
=
13
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
public
Result
<
Object
>
saveCa
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
();
.
ne
(
ca
.
getId
()
!=
null
,
SpmkCustomApproval:
:
getId
,
ca
.
getId
())
.
eq
(
SpmkCustomApproval:
:
getName
,
ca
.
getName
())
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
.
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
return
ResultUtil
.
error
(
"自定义审批名重复!"
);
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
}
.
ne
(
ca
.
getId
()
!=
null
,
SpmkCustomApproval:
:
getId
,
ca
.
getId
())
ca
.
setOrgCode
(
userBean
.
getOrgCode
());
.
eq
(
SpmkCustomApproval:
:
getName
,
ca
.
getName
())
ca
.
setFroms
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getFroms
()));
.
eq
(
SpmkCustomApproval:
:
getOrgCode
,
userBean
.
getOrgCode
()))
>
0
)
{
ca
.
setRouter
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getRouter
()));
return
ResultUtil
.
error
(
"自定义审批名重复!"
);
ca
.
setUpdateTime
(
new
Date
());
}
ca
.
setOrgCode
(
userBean
.
getOrgCode
());
//1.新增 SpmkCustomApproval-自定义审批
ca
.
setFroms
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getFroms
()));
if
(!
ca
.
insertOrUpdate
())
ca
.
setRouter
(
ObjectUtil
.
serialize
(
spmkCustomApprovalDto
.
getRouter
()));
return
ResultUtil
.
error
(
"新增自定义审批 失败!"
);
ca
.
setUpdateTime
(
new
Date
());
//1.新增 SpmkCustomApproval-自定义审批
Integer
id
=
ca
.
getId
();
if
(!
ca
.
insertOrUpdate
())
// 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置,
return
ResultUtil
.
error
(
"新增自定义审批 失败!"
);
SpmkInitiatorConfig
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
Console
.
log
(
"自定义审批id: "
+
id
);
List
<
SpmkInitiatorConfig
>
listIc
=
spmkCustomApprovalDto
.
getInitiatorConfigs
();
Integer
id
=
ca
.
getId
();
// 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置,
if
(
listIc
!=
null
&&
listIc
.
size
()
>
0
)
{
SpmkInitiatorConfig
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
for
(
int
i
=
0
,
n
=
listIc
.
size
();
i
<
n
;
i
++)
{
Console
.
log
(
"自定义审批id: "
+
id
);
listIc
.
get
(
i
).
setCustomApprovalId
(
id
);
List
<
SpmkInitiatorConfig
>
listIc
=
spmkCustomApprovalDto
.
getInitiatorConfigs
();
}
// 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置,
if
(
listIc
!=
null
&&
listIc
.
size
()
>
0
)
{
if
(!
spmkInitiatorConfigMapper
.
insertList
(
listIc
))
{
for
(
int
i
=
0
,
n
=
listIc
.
size
();
i
<
n
;
i
++)
{
// 手动抛出异常,事务回滚
listIc
.
get
(
i
).
setCustomApprovalId
(
id
);
throw
new
Exception
();
}
}
// 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置,
if
(!
spmkInitiatorConfigMapper
.
insertList
(
listIc
))
{
}
// 手动抛出异常,事务回滚
throw
new
Exception
();
//
}
/**
* 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class))
}
* 1.新增 SpmkCustomApproval-自定义审批
* 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置,
//
* 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置,
/**
*/
* 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class))
* 1.新增 SpmkCustomApproval-自定义审批
// 清空前端不需要的字段再返回,节省流量
* 2.删除 历史的 SpmkInitiatorConfig-审批发起人配置,
ca
.
setFroms
(
null
);
* 3.新增 最新的 SpmkInitiatorConfig-审批发起人配置,
ca
.
setRouter
(
null
);
*/
return
ResultUtil
.
data
(
ca
);
// 清空前端不需要的字段再返回,节省流量
}
ca
.
setFroms
(
null
);
ca
.
setRouter
(
null
);
/**
return
ResultUtil
.
data
(
ca
);
* 删除-自定义审批
* @throws Exception
}
*/
@DeleteMapping
(
value
=
"/delete_custom_approval/{id}"
)
/**
@ApiOperation
(
value
=
"14.删除-自定义审批"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-自定义审批"
)
* 删除-自定义审批
@Transactional
(
rollbackFor
=
Exception
.
class
)
* @throws Exception
@ApiOperationSupport
(
order
=
14
)
*/
public
Result
<
Object
>
deleteCaById
(
@PathVariable
int
id
)
throws
Exception
{
@DeleteMapping
(
value
=
"/delete_custom_approval/{id}"
)
SpmkInitiatorConfig
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
@ApiOperation
(
value
=
"14.删除-自定义审批"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-自定义审批"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
if
(!
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
deleteById
())
{
@ApiOperationSupport
(
order
=
14
)
throw
new
Exception
();
public
Result
<
Object
>
deleteCaById
(
@PathVariable
int
id
)
throws
Exception
{
}
SpmkInitiatorConfig
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
return
ResultUtil
.
success
();
if
(!
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
deleteById
())
{
}
throw
new
Exception
();
}
/**
* id查询-自定义审批
return
ResultUtil
.
success
();
*/
}
@GetMapping
(
value
=
"/select_custom_approval/{id}"
)
@ApiOperation
(
value
=
"15.id查询-自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"id查询-自定义审批"
)
/**
@ApiOperationSupport
(
order
=
15
)
* id查询-自定义审批
public
Result
<
Object
>
selectCaById
(
@PathVariable
int
id
){
*/
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
selectById
();
@GetMapping
(
value
=
"/select_custom_approval/{id}"
)
List
<
SpmkInitiatorConfig
>
listIc
=
SpmkInitiatorConfig
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
@ApiOperation
(
value
=
"15.id查询-自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"id查询-自定义审批"
)
SpmkCustomApprovalDto
caD
=
SpmkCustomApprovalDto
.
builder
()
@ApiOperationSupport
(
order
=
15
)
.
froms
(
ObjectUtil
.
deserialize
(
ca
.
getFroms
()))
public
Result
<
Object
>
selectCaById
(
@PathVariable
int
id
){
.
router
(
ObjectUtil
.
deserialize
(
ca
.
getRouter
()))
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
selectById
();
.
build
();
List
<
SpmkInitiatorConfig
>
listIc
=
SpmkInitiatorConfig
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
BeanUtil
.
copyProperties
(
ca
,
caD
,
"froms"
,
"router"
);
SpmkCustomApprovalDto
caD
=
SpmkCustomApprovalDto
.
builder
()
caD
.
setInitiatorConfigs
(
listIc
);
.
froms
(
ObjectUtil
.
deserialize
(
ca
.
getFroms
()))
return
ResultUtil
.
data
(
caD
);
.
router
(
ObjectUtil
.
deserialize
(
ca
.
getRouter
()))
}
.
build
();
BeanUtil
.
copyProperties
(
ca
,
caD
,
"froms"
,
"router"
);
/**
caD
.
setInitiatorConfigs
(
listIc
);
* 排序-自定义审批
return
ResultUtil
.
data
(
caD
);
*/
}
@PutMapping
(
value
=
"/update_custom_approval"
)
@ApiOperation
(
value
=
"16.排序-自定义审批"
,
httpMethod
=
"PUT"
,
notes
=
"排序-自定义审批"
)
/**
@ApiOperationSupport
(
order
=
16
)
* 排序-自定义审批
public
Result
<
Object
>
ranksCa
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
){
*/
@PutMapping
(
value
=
"/update_custom_approval"
)
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
@ApiOperation
(
value
=
"16.排序-自定义审批"
,
httpMethod
=
"PUT"
,
notes
=
"排序-自定义审批"
)
return
ResultUtil
.
success
();
@ApiOperationSupport
(
order
=
16
)
}
public
Result
<
Object
>
ranksCa
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
){
return
spmkCustomApprovalMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
}
return
ResultUtil
.
success
();
}
@Autowired
YgglService
ygglService
;
return
spmkCustomApprovalMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
}
/**
* 排序-自定义审批
@Autowired
*/
YgglService
ygglService
;
@PutMapping
(
value
=
"/test_spmk"
)
@ApiOperation
(
value
=
"16.测试"
,
httpMethod
=
"PUT"
,
notes
=
"排序-自定义审批"
)
/**
@ApiOperationSupport
(
order
=
16
)
* 排序-自定义审批
public
Result
<
Object
>
test222
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
){
*/
@PutMapping
(
value
=
"/test_spmk"
)
Set
<
Integer
>
lanzi
=
new
HashSet
<
Integer
>();
@ApiOperation
(
value
=
"16.测试"
,
httpMethod
=
"PUT"
,
notes
=
"排序-自定义审批"
)
//所有部门岗位
@ApiOperationSupport
(
order
=
16
)
List
<
ZzglBmgwM
>
bmgws
=
ZzglBmgwM
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
ZzglBmgwM
>().
lambda
().
eq
(
ZzglBmgwM:
:
getOrgCode
,
311
));
public
Result
<
Object
>
test222
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
){
//个人岗位
YgglMainEmp
one
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
()
Set
<
Integer
>
lanzi
=
new
HashSet
<
Integer
>();
.
select
(
YgglMainEmp:
:
getBmgwId
)
//所有部门岗位
.
eq
(
YgglMainEmp:
:
getOrgCode
,
311
).
eq
(
YgglMainEmp:
:
getEmpNum
,
12512
));
List
<
ZzglBmgwM
>
bmgws
=
ZzglBmgwM
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
ZzglBmgwM
>().
lambda
().
eq
(
ZzglBmgwM:
:
getOrgCode
,
311
));
//个人岗位
Integer
getId
=
one
!=
null
?
one
.
getBmgwId
()
:
null
;
YgglMainEmp
one
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
()
Set
<
Integer
>
all
=
getId
!=
null
?
empNumupdept2
(
lanzi
,
bmgws
,
getId
)
:
new
HashSet
<
Integer
>();
.
select
(
YgglMainEmp:
:
getBmgwId
)
all
.
add
(
getId
);
.
eq
(
YgglMainEmp:
:
getOrgCode
,
311
).
eq
(
YgglMainEmp:
:
getEmpNum
,
12512
));
return
spmkCustomApprovalMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
}
Integer
getId
=
one
!=
null
?
one
.
getBmgwId
()
:
null
;
Set
<
Integer
>
all
=
getId
!=
null
?
empNumupdept2
(
lanzi
,
bmgws
,
getId
)
:
new
HashSet
<
Integer
>();
//遍历
all
.
add
(
getId
);
public
static
Set
<
Integer
>
empNumupdept2
(
Set
<
Integer
>
lanzi
,
List
<
ZzglBmgwM
>
bmgws
,
Integer
getId
)
{
return
spmkCustomApprovalMapper
.
updateListRandsById
(
list
)
?
ResultUtil
.
success
()
:
ResultUtil
.
error
();
for
(
ZzglBmgwM
z
:
bmgws
)
{
}
if
(
getId
.
equals
(
z
.
getId
()))
{
lanzi
.
add
(
getId
);
//遍历
if
(
z
.
getUpId
()==
null
||
z
.
getUpId
()
==
0
)
{
public
static
Set
<
Integer
>
empNumupdept2
(
Set
<
Integer
>
lanzi
,
List
<
ZzglBmgwM
>
bmgws
,
Integer
getId
)
{
return
lanzi
;
for
(
ZzglBmgwM
z
:
bmgws
)
{
}
if
(
getId
.
equals
(
z
.
getId
()))
{
getId
=
z
.
getUpId
();
lanzi
.
add
(
getId
);
empNumupdept2
(
lanzi
,
bmgws
,
getId
);
if
(
z
.
getUpId
()==
null
||
z
.
getUpId
()
==
0
)
{
}
return
lanzi
;
}
}
return
lanzi
;
getId
=
z
.
getUpId
();
}
empNumupdept2
(
lanzi
,
bmgws
,
getId
);
}
// TODO 审批汇总(发起审批)
}
/**
return
lanzi
;
* 发起审批
}
* @throws Exception
*/
// TODO 审批汇总(发起审批)
@PostMapping
(
value
=
"/start_approval"
)
/**
@ApiOperation
(
value
=
"17.发起审批"
,
httpMethod
=
"POST"
,
notes
=
"发起审批"
)
* 发起审批
@ApiOperationSupport
(
order
=
17
)
* @throws Exception
@Transactional
(
rollbackFor
=
Exception
.
class
)
*/
@Log
(
title
=
"审批-发起审批"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
value
=
"/start_approval"
)
public
Result
<
Object
>
saveA
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
@ApiOperation
(
value
=
"17.发起审批"
,
httpMethod
=
"POST"
,
notes
=
"发起审批"
)
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
@ApiOperationSupport
(
order
=
17
)
.
lambda
()
@Transactional
(
rollbackFor
=
Exception
.
class
)
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
@Log
(
title
=
"审批-发起审批"
,
businessType
=
BusinessType
.
INSERT
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
())
public
Result
<
Object
>
saveA
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
.
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
);
.
lambda
()
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
if
(
ygglMainEmp
==
null
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
())
return
ResultUtil
.
error
(
"发起人不存在!"
);
.
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
);
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
if
(
ygglMainEmp
==
null
)
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
return
ResultUtil
.
error
(
"发起人不存在!"
);
List
<
Router
>
routers
=
router
.
getChildren
();
// routers = RouterUtils.clearRouters(routers);
// List<SpmkApprovalG> saG = spmkService.selectListAg(userBean);
if
(
routers
==
null
){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
}
List
<
Router
>
routers
=
router
.
getChildren
();
if
(
CollectionUtil
.
isNotEmpty
(
routers
))
{
// routers = RouterUtils.clearRouters(routers);
// boolean hasAudit=false;
if
(
routers
==
null
){
// if(routers.size()>0){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
// for (Relation relation:routers.get(0).getRelation()) {
}
// if(relation.getUsers().size()>0){
if
(
CollectionUtil
.
isNotEmpty
(
routers
))
{
// hasAudit=true;
// boolean hasAudit=false;
// }
// if(routers.size()>0){
// }
// for (Relation relation:routers.get(0).getRelation()) {
// }
// if(relation.getUsers().size()>0){
//// List<Relation> relations = routers.get(0).getRelation();
// hasAudit=true;
//// if (relations == null || relations.size() < 1) {
// }
//// return ResultUtil.error("无法发起,请完善审批流程");
// }
//// }
// }
//// List<User> users = relations.get(0).getUsers();
//// List<Relation> relations = routers.get(0).getRelation();
//// if (CollectionUtil.isEmpty(users)) {
//// if (relations == null || relations.size() < 1) {
//// return ResultUtil.error("无法发起,请完善审批流程");
//// return ResultUtil.error("无法发起,请完善审批流程");
//// }
//// }
// if(!hasAudit){
//// List<User> users = relations.get(0).getUsers();
// return ResultUtil.error("请选择审批人!");
//// if (CollectionUtil.isEmpty(users)) {
// }
//// return ResultUtil.error("无法发起,请完善审批流程");
}
else
{
//// }
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
// if(!hasAudit){
}
// return ResultUtil.error("请选择审批人!");
// }
List
<
Router
>
listRouter
=
new
ArrayList
<
Router
>();
}
else
{
listRouter
.
add
(
router
);
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
JSONObject
jSONObject
=
spmkApproveSummaryDto
.
getRequestData
()
.
set
(
"orgCode"
,
userBean
.
getOrgCode
())
List
<
Router
>
listRouter
=
new
ArrayList
<
Router
>();
.
set
(
"initiator"
,
ygglMainEmp
.
getName
())
listRouter
.
add
(
router
);
.
set
(
"headUrl"
,
ygglMainEmp
.
getHeadUrl
())
.
set
(
"id"
,
userBean
.
getEmpNum
());
JSONObject
jSONObject
=
spmkApproveSummaryDto
.
getRequestData
()
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
.
set
(
"orgCode"
,
userBean
.
getOrgCode
())
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
.
set
(
"initiator"
,
ygglMainEmp
.
getName
())
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
.
set
(
"headUrl"
,
ygglMainEmp
.
getHeadUrl
())
.
set
(
"id"
,
userBean
.
getEmpNum
());
if
(
listFlowChildren
.
isEmpty
()){
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
}
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
List
<
FlowChildren
>
listFlowChildren1
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren
);
List
<
String
>
uidlist
=
new
ArrayList
<>();
if
(
listFlowChildren
.
isEmpty
()){
int
i
=
0
;
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
int
fsize
=
listFlowChildren
.
size
();
}
int
f
=
0
;
//listFlowChildren删除次数
List
<
FlowChildren
>
listFlowChildren1
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren
);
for
(
FlowChildren
flowChildrenItem:
listFlowChildren
)
{
List
<
String
>
uidlist
=
new
ArrayList
<>();
if
(
"audit"
.
equals
(
flowChildrenItem
.
getClassName
()))
{
int
i
=
0
;
boolean
hasAudit
=
false
;
int
fsize
=
listFlowChildren
.
size
();
int
f
=
0
;
//listFlowChildren删除次数
for
(
Relation
relation
:
flowChildrenItem
.
getRelation
())
{
for
(
FlowChildren
flowChildrenItem:
listFlowChildren
)
{
if
(
relation
.
getUsers
().
size
()
>
0
)
{
if
(
"audit"
.
equals
(
flowChildrenItem
.
getClassName
()))
{
hasAudit
=
true
;
boolean
hasAudit
=
false
;
//审批人去重
if
(
relation
.
getUsers
().
size
()
>
1
){
for
(
Relation
relation
:
flowChildrenItem
.
getRelation
())
{
int
j
=
0
;
if
(
relation
.
getUsers
().
size
()
>
0
)
{
int
usize
=
relation
.
getUsers
().
size
();
//
hasAudit
=
true
;
int
r
=
0
;
//user list删除次数
//审批人去重
for
(
User
user:
relation
.
getUsers
()
if
(
relation
.
getUsers
().
size
()
>
1
){
)
{
int
j
=
0
;
if
(!
uidlist
.
contains
(
user
.
getId
()))
{
int
usize
=
relation
.
getUsers
().
size
();
//
uidlist
.
add
(
user
.
getId
());
int
r
=
0
;
//user list删除次数
}
else
{
for
(
User
user:
relation
.
getUsers
()
listFlowChildren1
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
remove
(
j
-
r
);
)
{
r
++;
if
(!
uidlist
.
contains
(
user
.
getId
()))
{
}
uidlist
.
add
(
user
.
getId
());
j
++;
}
else
{
}
listFlowChildren1
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
remove
(
j
-
r
);
if
(
usize
==
r
){
r
++;
listFlowChildren1
.
remove
(
i
-
f
);
}
f
++;
j
++;
}
}
}
else
{
if
(
usize
==
r
){
if
(!
uidlist
.
contains
(
relation
.
getUsers
().
get
(
0
).
getId
()))
{
listFlowChildren1
.
remove
(
i
-
f
);
uidlist
.
add
(
relation
.
getUsers
().
get
(
0
).
getId
());
f
++;
}
else
{
}
listFlowChildren1
.
remove
(
i
-
f
);
}
else
{
f
++;
if
(!
uidlist
.
contains
(
relation
.
getUsers
().
get
(
0
).
getId
()))
{
}
uidlist
.
add
(
relation
.
getUsers
().
get
(
0
).
getId
());
}
}
else
{
}
listFlowChildren1
.
remove
(
i
-
f
);
}
f
++;
if
(!
hasAudit
)
{
}
return
ResultUtil
.
error
(
"审批流程设置审批人为空无法发起!"
);
}
}
}
}
}
i
++;
if
(!
hasAudit
)
{
}
return
ResultUtil
.
error
(
"审批流程设置审批人为空无法发起!"
);
listFlowChildren
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren1
);
}
}
/*for (FlowChildren flowChildrenItem: listFlowChildren) {
i
++;
if("audit".equals(flowChildrenItem.getClassName())){
}
boolean hasAudit=false;
listFlowChildren
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren1
);
for (Relation relation:flowChildrenItem.getRelation()) {
if(relation.getUsers().size()>0){
/*for (FlowChildren flowChildrenItem: listFlowChildren) {
hasAudit=true;
if("audit".equals(flowChildrenItem.getClassName())){
}
boolean hasAudit=false;
}
for (Relation relation:flowChildrenItem.getRelation()) {
if(!hasAudit){
if(relation.getUsers().size()>0){
return ResultUtil.error("审批流程设置审批人为空无法发起!");
hasAudit=true;
}
}
}
}
}*/
if(!hasAudit){
return ResultUtil.error("审批流程设置审批人为空无法发起!");
Logoutput
(
"listFlowChildren"
);
}
}
// 当前审批人
}*/
String
currentApprover
=
jSONObject
.
getStr
(
"current_approver"
);
// 封装 审批汇总
Logoutput
(
"listFlowChildren"
);
SpmkApproveSummary
as
=
SpmkApproveSummary
.
builder
()
// 当前审批人
.
orgCode
(
userBean
.
getOrgCode
())
String
currentApprover
=
jSONObject
.
getStr
(
"current_approver"
);
.
empNum
(
userBean
.
getEmpNum
())
// 封装 审批汇总
.
title
(
spmkApproveSummaryDto
.
getTitle
())
SpmkApproveSummary
as
=
SpmkApproveSummary
.
initiator
(
spmkApproveSummaryDto
.
getInitiator
())
.
builder
()
.
approveName
(
spmkApproveSummaryDto
.
getApproveName
())
.
orgCode
(
userBean
.
getOrgCode
())
.
assoType
(
spmkApproveSummaryDto
.
getAssoType
())
.
empNum
(
userBean
.
getEmpNum
())
.
sts
(
ApproveSummarySts
.
IN
.
ordinal
())
.
title
(
spmkApproveSummaryDto
.
getTitle
())
.
currentApprover
(
currentApprover
).
build
();
.
initiator
(
spmkApproveSummaryDto
.
getInitiator
())
.
approveName
(
spmkApproveSummaryDto
.
getApproveName
())
if
(!
as
.
insert
())
{
.
assoType
(
spmkApproveSummaryDto
.
getAssoType
())
throw
new
CustomException
(
"审批汇总-新增异常"
);
.
sts
(
ApproveSummarySts
.
IN
.
ordinal
())
}
.
currentApprover
(
currentApprover
).
build
();
// 插入记录- 审批执行记录 - 执行人记录
if
(!
as
.
insert
())
{
RouterUtils
.
insertogExecuteRecord
(
listFlowChildren
,
as
.
getId
());
throw
new
CustomException
(
"审批汇总-新增异常"
);
}
// 封装 审批详情
SpmkApproveDetailSummary
adm
=
SpmkApproveDetailSummary
.
builder
().
build
();
// 插入记录- 审批执行记录 - 执行人记录
adm
.
setApproveSummaryId
(
as
.
getId
());
RouterUtils
.
insertogExecuteRecord
(
listFlowChildren
,
as
.
getId
());
adm
.
setName
(
spmkApproveSummaryDto
.
getTitle
());
adm
.
setRequestData
(
spmkApproveSummaryDto
.
getRequestData
().
toString
());
// 封装 审批详情
adm
.
setFroms
(
spmkApproveSummaryDto
.
getFroms
().
toString
());
SpmkApproveDetailSummary
adm
=
SpmkApproveDetailSummary
.
builder
().
build
();
adm
.
setRouter
(
listRouter
.
get
(
0
).
toJSONString
());
adm
.
setApproveSummaryId
(
as
.
getId
());
adm
.
setFlowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
());
adm
.
setName
(
spmkApproveSummaryDto
.
getTitle
());
try
{
adm
.
setRequestData
(
spmkApproveSummaryDto
.
getRequestData
().
toString
());
spmkApproveDetailSummaryMapper
.
insert
(
adm
);
adm
.
setFroms
(
spmkApproveSummaryDto
.
getFroms
().
toString
());
}
catch
(
Exception
e
){
adm
.
setRouter
(
listRouter
.
get
(
0
).
toJSONString
());
throw
new
CustomException
(
"审批详情-新增异常"
);
adm
.
setFlowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
());
}
try
{
spmkApproveDetailSummaryMapper
.
insert
(
adm
);
return
ResultUtil
.
success
();
}
catch
(
Exception
e
){
}
throw
new
CustomException
(
"审批详情-新增异常"
);
}
//TODO 审批汇总
/**
return
ResultUtil
.
success
();
* 审批汇总
}
* @param summaryQueryDto
* @return
//TODO 审批汇总
* @throws
/**
*/
* 审批汇总
@PostMapping
(
value
=
"/select_approve_summary"
)
* @param summaryQueryDto
@ApiOperation
(
value
=
"18.审批汇总"
,
httpMethod
=
"POST"
,
notes
=
"审批汇总"
)
* @return
@ApiOperationSupport
(
order
=
18
)
* @throws
@Log
(
title
=
"审批-审批汇总"
,
businessType
=
BusinessType
.
OTHER
)
*/
public
Result
<
Object
>
selectAs
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SummaryQueryDto
summaryQueryDto
)
{
@PostMapping
(
value
=
"/select_approve_summary"
)
@ApiOperation
(
value
=
"18.审批汇总"
,
httpMethod
=
"POST"
,
notes
=
"审批汇总"
)
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
@ApiOperationSupport
(
order
=
18
)
summaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
summaryQueryDto
.
getCurrentPage
(),
@Log
(
title
=
"审批-审批汇总"
,
businessType
=
BusinessType
.
OTHER
)
summaryQueryDto
.
getTotalPage
()
==
null
?
10
:
summaryQueryDto
.
getTotalPage
());
public
Result
<
Object
>
selectAs
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SummaryQueryDto
summaryQueryDto
)
{
summaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
Integer
deptId
=
summaryQueryDto
.
getDeptId
();
summaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
summaryQueryDto
.
getCurrentPage
(),
List
<
YgglMainEmp
>
listYgglMainEmp
=
zzglBmgwMService
.
selectOtherlistent
(
userBean
.
getOrgCode
(),
deptId
);
summaryQueryDto
.
getTotalPage
()
==
null
?
10
:
summaryQueryDto
.
getTotalPage
());
summaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
if
(
deptId
!=
null
&&
(
listYgglMainEmp
==
null
||
listYgglMainEmp
.
size
()
==
0
))
{
return
ResultUtil
.
data
(
new
ArrayList
<
SpmkApproveSummary
>());
Integer
deptId
=
summaryQueryDto
.
getDeptId
();
}
List
<
YgglMainEmp
>
listYgglMainEmp
=
zzglBmgwMService
.
selectOtherlistent
(
userBean
.
getOrgCode
(),
deptId
);
List
<
Integer
>
empNums
=
new
ArrayList
<
Integer
>();
if
(
deptId
!=
null
&&
(
listYgglMainEmp
==
null
||
listYgglMainEmp
.
size
()
==
0
))
{
for
(
YgglMainEmp
ygglMainEmp
:
listYgglMainEmp
)
{
return
ResultUtil
.
data
(
new
ArrayList
<
SpmkApproveSummary
>());
empNums
.
add
(
ygglMainEmp
.
getEmpNum
());
}
}
summaryQueryDto
.
setEmpNums
(
empNums
);
List
<
Integer
>
empNums
=
new
ArrayList
<
Integer
>();
for
(
YgglMainEmp
ygglMainEmp
:
listYgglMainEmp
)
{
// 缺-部门id 搜索
empNums
.
add
(
ygglMainEmp
.
getEmpNum
());
IPage
<
SpmkApproveSummary
>
pageAs
=
spmkApproveSummaryMapper
.
selectPageByQuery
(
page
,
summaryQueryDto
);
}
summaryQueryDto
.
setEmpNums
(
empNums
);
List
<
SpmkApproveSummary
>
listAs
=
pageAs
.
getRecords
();
// 缺-部门id 搜索
return
ResultUtil
.
data
(
pageAs
,
listAs
);
IPage
<
SpmkApproveSummary
>
pageAs
=
spmkApproveSummaryMapper
.
selectPageByQuery
(
page
,
summaryQueryDto
);
}
List
<
SpmkApproveSummary
>
listAs
=
pageAs
.
getRecords
();
//TODO 审批详情
/**
return
ResultUtil
.
data
(
pageAs
,
listAs
);
* 审批详情
}
*/
@GetMapping
(
value
=
"/select_approve_detail/{id}"
)
//TODO 审批详情
@ApiOperation
(
value
=
"19.审批详情"
,
httpMethod
=
"GET"
,
notes
=
"审批详情"
)
/**
@ApiOperationSupport
(
order
=
19
)
* 审批详情
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
*/
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
@GetMapping
(
value
=
"/select_approve_detail/{id}"
)
@ApiOperation
(
value
=
"19.审批详情"
,
httpMethod
=
"GET"
,
notes
=
"审批详情"
)
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
@ApiOperationSupport
(
order
=
19
)
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
return
ResultUtil
.
data
(
adD
);
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
}
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
//TODO 审批人审批
return
ResultUtil
.
data
(
adD
);
/**
* 审批人审批
}
*/
@PostMapping
(
value
=
"/approving"
)
//TODO 审批人审批
@ApiOperation
(
value
=
"20.审批人审批"
,
httpMethod
=
"POST"
,
notes
=
"审批人审批"
)
/**
@Transactional
(
rollbackFor
=
Exception
.
class
)
* 审批人审批
@ApiOperationSupport
(
order
=
20
)
*/
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/approving"
)
// @BindingResultCtrol(title = "审批人审批")
@ApiOperation
(
value
=
"20.审批人审批"
,
httpMethod
=
"POST"
,
notes
=
"审批人审批"
)
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ApiOperationSupport
(
order
=
20
)
Integer
asId
=
approvingDto
.
getAsId
();
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
// @BindingResultCtrol(title = "审批人审批")
.
lambda
()
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
ApprovingDto
approvingDto
)
throws
Exception
{
.
select
(
SpmkApproveDetailSummary:
:
getId
,
Integer
asId
=
approvingDto
.
getAsId
();
SpmkApproveDetailSummary:
:
getRequestData
,
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
SpmkApproveDetailSummary:
:
getFlowChildren
)
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
if
(
approStatus
==
1
){
return
ResultUtil
.
error
(
"该审批已在审批中!"
);
// 查询 SpmkApproveSummary 状态
}
else
{
SpmkApproveSummary
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
redisUtil
.
set
(
asId
.
toString
(),
1
,
5000
);
.
select
(
SpmkApproveSummary:
:
getSts
)
}
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
()
if
(
aSummary
.
getSts
()
>
SpmkEnumInterface
.
ApproveSummarySts
.
IN
.
ordinal
())
{
.
select
(
SpmkApproveDetailSummary:
:
getId
,
return
ResultUtil
.
error
(
"该审批已结束!"
);
SpmkApproveDetailSummary:
:
getRequestData
,
}
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
// 查询该 审批的状态 是否为 1 审批中
Integer
count
=
SpmkExecutor
.
builder
().
build
().
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
// 查询 SpmkApproveSummary 状态,
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
SpmkApproveSummary
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()));
.
select
(
SpmkApproveSummary:
:
getSts
)
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
if
(
count
==
0
)
{
return
ResultUtil
.
error
(
"您已审批过!"
);
if
(
aSummary
.
getSts
()
>
ApproveSummarySts
.
IN
.
ordinal
())
{
}
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"该审批已结束!"
);
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
}
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
// 查询该 审批的状态 是否为 1 审批中
.
eq
(
SpmkExecutor:
:
getSts
,
SpmkEnumInterface
.
ExecutorSts
.
IN_EXECUTION
.
ordinal
()))
==
0
)
{
Integer
count
=
SpmkExecutor
.
builder
().
build
().
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
Integer
adminNum
=
new
LambdaQueryChainWrapper
<
QyzxEmpEntAsso
>(
qyzxEmpEntAssoMapper
)
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()));
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
if
(
count
==
0
)
{
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
SysRoleType
.
U_TYPE_ADMIN
,
SysRoleType
.
U_TYPE_C_ADMIN
)
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
.
count
();
return
ResultUtil
.
error
(
"您已审批过!"
);
}
if
(
adminNum
<=
0
)
{
return
ResultUtil
.
error
(
"非当前审批人 或 管理员,无法操作!"
);
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
}
.
eq
(
SpmkExecutor:
:
getId
,
approvingDto
.
getExecutorId
())
.
eq
(
SpmkExecutor:
:
getEmpNum
,
userBean
.
getEmpNum
())
}
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()))
==
0
)
{
if
(
aSummary
.
getSts
()
==
0
)
{
Integer
adminNum
=
new
LambdaQueryChainWrapper
<
QyzxEmpEntAsso
>(
qyzxEmpEntAssoMapper
)
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
())
// 审批逻辑
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
RouterUtils
.
approving
(
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
SysRoleType
.
U_TYPE_ADMIN
,
SysRoleType
.
U_TYPE_C_ADMIN
)
listFlowChildren
,
.
count
();
asId
,
approvingDto
.
getExecuteRecordId
(),
if
(
adminNum
<=
0
)
{
approvingDto
.
getExecutorId
(),
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
approvingDto
.
getOpinion
(),
return
ResultUtil
.
error
(
"非当前审批人 或 管理员,无法操作!"
);
approvingDto
.
getSts
(),
}
approvingDto
.
getUser
()
);
}
// 更新 flowChildren
if
(
aSummary
.
getSts
()
==
0
)
{
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
// 审批逻辑
if
(
fc
.
getExecute
()
==
"2"
)
{
RouterUtils
.
approving
(
// 查询 SpmkApproveSummary 状态
listFlowChildren
,
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
asId
,
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
approvingDto
.
getExecuteRecordId
(),
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
approvingDto
.
getExecutorId
(),
approvingDto
.
getOpinion
(),
if
(
aSummary
.
getSts
()
!=
SpmkEnumInterface
.
ApproveSummarySts
.
REFUSE
.
ordinal
())
{
approvingDto
.
getSts
(),
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
FINISH
.
ordinal
()).
build
().
updateById
();
approvingDto
.
getUser
()
);
JSONObject
jSONObject
=
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
);
jSONObject
.
set
(
"approveId"
,
FromData
.
builder
().
value
(
String
.
valueOf
(
asId
)).
build
());
// 更新 flowChildren
jSONObject
.
set
(
"orgCode"
,
userBean
.
getOrgCode
());
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
//审批完成后 业务
if
(
fc
.
getExecute
()
==
"2"
)
{
SpmkAssoBusiness
sab
=
spmkAssoBusinessFactory
.
createSpmkService
(
ApproveEnum
.
getEnums
(
aSummary
.
getAssoType
()));
// 查询 SpmkApproveSummary 状态
if
(
sab
!=
null
)
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
Logoutput
(
"1----------"
+
sab
);
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
Logoutput
(
"2----------"
+
jSONObject
);
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
sab
.
handleApprove
(
jSONObject
);
}
if
(
aSummary
.
getSts
()
!=
ApproveSummarySts
.
REFUSE
.
ordinal
())
{
}
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
FINISH
.
ordinal
()).
build
().
updateById
();
}
else
{
JSONObject
jSONObject
=
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
);
return
ResultUtil
.
error
(
"该审批已结束!"
);
jSONObject
.
set
(
"approveId"
,
FromData
.
builder
().
value
(
String
.
valueOf
(
asId
)).
build
());
}
jSONObject
.
set
(
"orgCode"
,
userBean
.
getOrgCode
());
return
ResultUtil
.
success
();
}
//审批完成后 业务
SpmkAssoBusiness
sab
=
spmkAssoBusinessFactory
.
createSpmkService
(
ApproveEnum
.
getEnums
(
aSummary
.
getAssoType
()));
@Autowired
if
(
sab
!=
null
)
private
PunchRecordMapper
punchrecordmapper
;
Logoutput
(
"1----------"
+
sab
);
//TODO 我发起的/我审批的/抄送我的
Logoutput
(
"2----------"
+
jSONObject
);
/**
sab
.
handleApprove
(
jSONObject
);
* 查询列表-我发起的/我审批的/抄送我的-分页
}
*/
}
@PostMapping
(
value
=
"/select_my_approve"
)
@ApiOperation
(
value
=
"21.查询列表-我发起的/我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
}
else
{
@ApiOperationSupport
(
order
=
21
)
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
@Log
(
title
=
"审批-我发起的/我审批的/抄送我的"
,
businessType
=
BusinessType
.
OTHER
)
return
ResultUtil
.
error
(
"该审批已结束!"
);
public
Result
<
Object
>
selectMyAs
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
)
throws
MethodArgumentNotValidException
{
}
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
mySummaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
mySummaryQueryDto
.
getCurrentPage
(),
return
ResultUtil
.
success
();
mySummaryQueryDto
.
getTotalPage
()
==
null
?
10
:
mySummaryQueryDto
.
getTotalPage
());
}
mySummaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
mySummaryQueryDto
.
setEmpNum
(
userBean
.
getEmpNum
());
@Autowired
if
(
mySummaryQueryDto
.
getSts
()
==
null
)
{
private
PunchRecordMapper
punchrecordmapper
;
mySummaryQueryDto
.
setSts
(
0
);
//TODO 我发起的/我审批的/抄送我的
}
/**
//我发起的
* 查询列表-我发起的/我审批的/抄送我的-分页
if
(
mySummaryQueryDto
.
getType
()
==
0
)
{
*/
// mySummaryQueryDto.setSts(null);
@PostMapping
(
value
=
"/select_my_approve"
)
}
@ApiOperation
(
value
=
"21.查询列表-我发起的/我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
// 缺-部门id 搜索
@ApiOperationSupport
(
order
=
21
)
IPage
<
SpmkApproveSummary
>
pageAs
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
page
,
mySummaryQueryDto
);
@Log
(
title
=
"审批-我发起的/我审批的/抄送我的"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectMyAs
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
)
throws
MethodArgumentNotValidException
{
List
<
SpmkApproveSummary
>
listAs
=
pageAs
.
getRecords
();
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
mySummaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
mySummaryQueryDto
.
getCurrentPage
(),
for
(
SpmkApproveSummary
sp
:
listAs
)
{
mySummaryQueryDto
.
getTotalPage
()
==
null
?
10
:
mySummaryQueryDto
.
getTotalPage
());
mySummaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
String
requerstr
=
""
;
mySummaryQueryDto
.
setEmpNum
(
userBean
.
getEmpNum
());
try
{
if
(
mySummaryQueryDto
.
getSts
()
==
null
)
{
SpmkApproveDetailSummary
ad
=
spmkApproveDetailSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
sp
.
getId
()));
mySummaryQueryDto
.
setSts
(
0
);
}
JSONObject
as
=
jsonObject
.
parseObject
(
ad
.
getRequestData
().
toString
(),
JSONObject
.
class
);
//我发起的
// Logoutput(as);
if
(
mySummaryQueryDto
.
getType
()
==
0
)
{
// Logoutput(sp.getId()+"==========================================="+sp.getAssoType());
// mySummaryQueryDto.setSts(null);
requerstr
=
""
;
}
//assoType : 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡
// 缺-部门id 搜索
switch
(
sp
.
getAssoType
())
{
IPage
<
SpmkApproveSummary
>
pageAs
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
page
,
mySummaryQueryDto
);
case
1
:
requerstr
=
"转正时间:"
+
as
.
getJSONObject
(
"__newConfirmationTime"
).
getStr
(
"value"
);
break
;
case
2
:
requerstr
=
"离职时间:"
+
as
.
getJSONObject
(
"__terminationDate"
).
getStr
(
"value"
);
break
;
List
<
SpmkApproveSummary
>
listAs
=
pageAs
.
getRecords
();
case
3
:
String
namepos
=
""
;
for
(
SpmkApproveSummary
sp
:
listAs
)
{
PunchRecord
pu
=
punchrecordmapper
.
organizationalStructure
(
Integer
.
valueOf
(
as
.
getJSONObject
(
"__TransferInDepartment"
).
getStr
(
"value"
)));
if
(
pu
!=
null
)
{
String
requerstr
=
""
;
namepos
=
pu
.
getPost
();
try
{
}
SpmkApproveDetailSummary
ad
=
spmkApproveDetailSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
sp
.
getId
()));
requerstr
=
"调入岗位:"
+
namepos
;
break
;
JSONObject
as
=
jsonObject
.
parseObject
(
ad
.
getRequestData
().
toString
(),
JSONObject
.
class
);
case
5
:
requerstr
=
"加班时长:"
+
as
.
getJSONObject
(
"__timeLong"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
// Logoutput(as);
case
6
:
// Logoutput(sp.getId()+"==========================================="+sp.getAssoType());
String
name
=
""
;
requerstr
=
""
;
KqglAssoLeaveRules
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectById
(
as
.
getJSONObject
(
"__LeaveType"
).
getStr
(
"value"
));
//assoType : 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡
if
(
rul
!=
null
)
{
switch
(
sp
.
getAssoType
())
{
name
=
rul
.
getName
();
case
1
:
requerstr
=
"转正时间:"
+
as
.
getJSONObject
(
"__newConfirmationTime"
).
getStr
(
"value"
);
break
;
}
case
2
:
requerstr
=
"离职时间:"
+
as
.
getJSONObject
(
"__terminationDate"
).
getStr
(
"value"
);
break
;
requerstr
=
"请假类型:"
+
name
;
case
3
:
break
;
String
namepos
=
""
;
case
7
:
requerstr
=
"出差时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
PunchRecord
pu
=
punchrecordmapper
.
organizationalStructure
(
Integer
.
valueOf
(
as
.
getJSONObject
(
"__TransferInDepartment"
).
getStr
(
"value"
)));
case
8
:
requerstr
=
"外出时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
if
(
pu
!=
null
)
{
case
9
:
requerstr
=
"补卡时间:"
+
as
.
getJSONObject
(
"__PatchCardTime"
).
getStr
(
"value"
);
break
;
namepos
=
pu
.
getPost
();
default
:
}
break
;
requerstr
=
"调入岗位:"
+
namepos
;
}
break
;
}
catch
(
Exception
e
)
{
case
5
:
requerstr
=
"加班时长:"
+
as
.
getJSONObject
(
"__timeLong"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
e
.
printStackTrace
();
case
6
:
}
String
name
=
""
;
// Logoutput(requerstr);
KqglAssoLeaveRules
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectById
(
as
.
getJSONObject
(
"__LeaveType"
).
getStr
(
"value"
));
sp
.
setDigest
(
requerstr
);
if
(
rul
!=
null
)
{
}
name
=
rul
.
getName
();
}
return
ResultUtil
.
data
(
pageAs
,
listAs
);
requerstr
=
"请假类型:"
+
name
;
}
break
;
case
7
:
requerstr
=
"出差时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
//TODO 撤销审批
case
8
:
requerstr
=
"外出时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
/**
case
9
:
requerstr
=
"补卡时间:"
+
as
.
getJSONObject
(
"__PatchCardTime"
).
getStr
(
"value"
);
break
;
* 撤销审批
default
:
*/
break
;
@PutMapping
(
value
=
"/revoke_approval/{id}"
)
}
@ApiOperation
(
value
=
"22.撤销审批"
,
httpMethod
=
"PUT"
,
notes
=
"撤销审批"
)
}
catch
(
Exception
e
)
{
@Transactional
(
rollbackFor
=
Exception
.
class
)
e
.
printStackTrace
();
@ApiOperationSupport
(
order
=
22
)
}
@Log
(
title
=
"审批-撤销审批"
,
businessType
=
BusinessType
.
UPDATE
)
// Logoutput(requerstr);
public
Result
<
Object
>
revokeApproval
(
@PathVariable
Integer
id
)
throws
Exception
{
sp
.
setDigest
(
requerstr
);
}
SpmkApproveSummary
as
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>()
.
lambda
()
return
ResultUtil
.
data
(
pageAs
,
listAs
);
.
select
(
SpmkApproveSummary:
:
getSts
)
}
.
eq
(
SpmkApproveSummary:
:
getId
,
id
));
//TODO 撤销审批
return
as
!=
null
&&
as
.
getSts
()
!=
ApproveSummarySts
.
FINISH
.
ordinal
()
?
(
SpmkApproveSummary
.
builder
().
id
(
id
).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
UNDONE
.
ordinal
()).
build
().
updateById
()
?
/**
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"撤销异常"
))
:
ResultUtil
.
error
(
"审批已结束,无法撤销!"
);
* 撤销审批
}
*/
@PutMapping
(
value
=
"/revoke_approval/{id}"
)
/**
@ApiOperation
(
value
=
"22.撤销审批"
,
httpMethod
=
"PUT"
,
notes
=
"撤销审批"
)
* 删除-审批(发起的审批)-根据审批汇总id
@Transactional
(
rollbackFor
=
Exception
.
class
)
*/
@ApiOperationSupport
(
order
=
22
)
@DeleteMapping
(
value
=
"/delete_approval/{id}"
)
@Log
(
title
=
"审批-撤销审批"
,
businessType
=
BusinessType
.
UPDATE
)
@ApiOperation
(
value
=
"23.删除-审批(发起的审批)-根据审批汇总id"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批(发起的审批)-根据审批汇总id"
)
public
Result
<
Object
>
revokeApproval
(
@PathVariable
Integer
id
)
throws
Exception
{
@ApiOperationSupport
(
order
=
23
)
@Log
(
title
=
"审批-删除审批"
,
businessType
=
BusinessType
.
DELETE
)
SpmkApproveSummary
as
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>()
public
Result
<
Object
>
deleteApprovalData
(
@PathVariable
Integer
id
){
.
lambda
()
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectList
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>()
.
select
(
SpmkApproveSummary:
:
getSts
)
.
lambda
()
.
eq
(
SpmkApproveSummary:
:
getId
,
id
));
.
select
(
SpmkApproveExecuteRecord:
:
getId
)
.
eq
(
SpmkApproveExecuteRecord:
:
getApproveSummaryId
,
id
));
return
as
!=
null
&&
as
.
getSts
()
!=
ApproveSummarySts
.
FINISH
.
ordinal
()
?
(
SpmkApproveSummary
.
builder
().
id
(
id
).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
UNDONE
.
ordinal
()).
build
().
updateById
()
?
if
(
listAer
!=
null
&&
listAer
.
size
()
>
0
)
{
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"撤销异常"
))
:
ResultUtil
.
error
(
"审批已结束,无法撤销!"
);
for
(
SpmkApproveExecuteRecord
aer
:
listAer
)
{
}
spmkExecutorMapper
.
delete
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
().
eq
(
SpmkExecutor:
:
getApproveExecuteRecordId
,
aer
.
getId
()));
}
/**
}
* 删除-审批(发起的审批)-根据审批汇总id
*/
spmkApproveExecuteRecordMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>().
lambda
().
eq
(
SpmkApproveExecuteRecord:
:
getApproveSummaryId
,
id
));
@DeleteMapping
(
value
=
"/delete_approval/{id}"
)
//新审核表删除
@ApiOperation
(
value
=
"23.删除-审批(发起的审批)-根据审批汇总id"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批(发起的审批)-根据审批汇总id"
)
spmkApproveDetailSummaryMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
id
));
@ApiOperationSupport
(
order
=
23
)
@Log
(
title
=
"审批-删除审批"
,
businessType
=
BusinessType
.
DELETE
)
spmkApproveSummaryMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
().
eq
(
SpmkApproveSummary:
:
getId
,
id
));
public
Result
<
Object
>
deleteApprovalData
(
@PathVariable
Integer
id
){
List
<
SpmkApproveExecuteRecord
>
listAer
=
spmkApproveExecuteRecordMapper
.
selectList
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>()
return
ResultUtil
.
success
();
.
lambda
()
}
.
select
(
SpmkApproveExecuteRecord:
:
getId
)
.
eq
(
SpmkApproveExecuteRecord:
:
getApproveSummaryId
,
id
));
/**
if
(
listAer
!=
null
&&
listAer
.
size
()
>
0
)
{
* 删除-审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据
for
(
SpmkApproveExecuteRecord
aer
:
listAer
)
{
*/
spmkExecutorMapper
.
delete
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
().
eq
(
SpmkExecutor:
:
getApproveExecuteRecordId
,
aer
.
getId
()));
@DeleteMapping
(
value
=
"/delete_approval_data"
)
}
@ApiOperation
(
value
=
"90.(开发使用)删除-审批数据"
,
httpMethod
=
"DELETE"
,
notes
=
"审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据"
)
}
@ApiOperationSupport
(
order
=
90
)
public
Result
<
Object
>
deleteApprovalData
(
@CurrentUser
UserBean
userBean
){
spmkApproveExecuteRecordMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>().
lambda
().
eq
(
SpmkApproveExecuteRecord:
:
getApproveSummaryId
,
id
));
spmkApprovalGMapper
.
delete
(
null
);
//新审核表删除
spmkCustomApprovalMapper
.
delete
(
null
);
spmkApproveDetailSummaryMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
id
));
spmkApproveSummaryMapper
.
delete
(
null
);
spmkApproveDetailSummaryMapper
.
delete
(
null
);
spmkApproveSummaryMapper
.
delete
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
().
eq
(
SpmkApproveSummary:
:
getId
,
id
));
spmkApproveExecuteRecordMapper
.
delete
(
null
);
spmkExecutorMapper
.
delete
(
null
);
return
ResultUtil
.
success
();
Logoutput
(
"删除-审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据 完成!"
);
}
return
ResultUtil
.
success
();
}
/**
* 删除-审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据
//TODO 审批图标列表
*/
@GetMapping
(
value
=
"/icon"
)
@DeleteMapping
(
value
=
"/delete_approval_data"
)
@ApiOperation
(
value
=
"99.图标列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"90.(开发使用)删除-审批数据"
,
httpMethod
=
"DELETE"
,
notes
=
"审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据"
)
@ApiOperationSupport
(
order
=
99
)
@ApiOperationSupport
(
order
=
90
)
public
Result
<
List
<
SpmkIcon
>>
selectListIcon
(
@CurrentUser
UserBean
userBean
){
public
Result
<
Object
>
deleteApprovalData
(
@CurrentUser
UserBean
userBean
){
spmkApprovalGMapper
.
delete
(
null
);
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
spmkCustomApprovalMapper
.
delete
(
null
);
spmkApproveSummaryMapper
.
delete
(
null
);
return
ResultUtil
.
data
(
spmkIcons
,
"获取图标列表成功"
);
spmkApproveDetailSummaryMapper
.
delete
(
null
);
}
spmkApproveExecuteRecordMapper
.
delete
(
null
);
spmkExecutorMapper
.
delete
(
null
);
//TODO 测试-生成 审批组 和 自定义审批
Logoutput
(
"删除-审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据 完成!"
);
@GetMapping
(
value
=
"/test"
)
return
ResultUtil
.
success
();
@ApiOperation
(
value
=
"98.测试-生成 审批组 和 自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"测试-生成 审批组 和 自定义审批"
)
}
@ApiOperationSupport
(
order
=
98
)
public
Result
<
List
<
SpmkIcon
>>
createCustomApproval
(
@RequestParam
Integer
orgCode
){
//TODO 审批图标列表
@GetMapping
(
value
=
"/icon"
)
spmkService
.
createCustomApproval
(
orgCode
);
@ApiOperation
(
value
=
"99.图标列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
99
)
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
public
Result
<
List
<
SpmkIcon
>>
selectListIcon
(
@CurrentUser
UserBean
userBean
){
return
ResultUtil
.
data
(
spmkIcons
,
"生成 审批组 和 自定义审批成功"
);
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
}
return
ResultUtil
.
data
(
spmkIcons
,
"获取图标列表成功"
);
@GetMapping
(
value
=
"/verification_staff"
)
}
@ApiOperation
(
value
=
"校验员工是否是正式员工"
,
httpMethod
=
"GET"
,
notes
=
" 查询列表-假期规则"
)
public
Result
<
Object
>
verification_staff
(
@CurrentUser
UserBean
userBean
)
{
//TODO 测试-生成 审批组 和 自定义审批
String
msg
=
""
;
@GetMapping
(
value
=
"/test"
)
YgglMainEmp
ygem
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
@ApiOperation
(
value
=
"98.测试-生成 审批组 和 自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"测试-生成 审批组 和 自定义审批"
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
()));
@ApiOperationSupport
(
order
=
98
)
if
(
ygem
.
getJobStatus
()
==
1
)
{
public
Result
<
List
<
SpmkIcon
>>
createCustomApproval
(
@RequestParam
Integer
orgCode
){
msg
=
"正式员工不能发起转正审批"
;
}
spmkService
.
createCustomApproval
(
orgCode
);
return
ResultUtil
.
data
(
msg
);
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
}
return
ResultUtil
.
data
(
spmkIcons
,
"生成 审批组 和 自定义审批成功"
);
@PostMapping
(
value
=
"/approved_quantity"
)
}
@ApiOperation
(
value
=
"APP-我发起的/我审批的/抄送我的-数量"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
Result
<
Object
>
ApprovedQuantity
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mysummaryquerydto
){
@GetMapping
(
value
=
"/verification_staff"
)
@ApiOperation
(
value
=
"校验员工是否是正式员工"
,
httpMethod
=
"GET"
,
notes
=
" 查询列表-假期规则"
)
ApprovedQuantityDto
qna
=
ApprovedQuantityDto
.
builder
().
build
();
public
Result
<
Object
>
verification_staff
(
@CurrentUser
UserBean
userBean
)
{
String
msg
=
""
;
mysummaryquerydto
.
setEndTime
(
null
);
YgglMainEmp
ygem
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
mysummaryquerydto
.
setStartTime
(
null
);
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
()));
if
(
ygem
.
getJobStatus
()
==
1
)
{
mysummaryquerydto
.
setOrgCode
(
userBean
.
getOrgCode
());
msg
=
"正式员工不能发起转正审批"
;
mysummaryquerydto
.
setEmpNum
(
userBean
.
getEmpNum
());
}
mysummaryquerydto
.
setSts
(
5
);
//状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝 4:(2/3) 5:全部
return
ResultUtil
.
data
(
msg
);
int
istartedit
=
0
,
ccme
=
0
,
iapprovedit
=
0
;
}
mysummaryquerydto
.
setType
(
0
);
//我发起的
List
<
SpmkApproveSummary
>
istartedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
@PostMapping
(
value
=
"/approved_quantity"
)
if
(
istartedit_
.
size
()
>
0
)
{
@ApiOperation
(
value
=
"APP-我发起的/我审批的/抄送我的-数量"
,
httpMethod
=
"POST"
,
notes
=
""
)
istartedit
=
istartedit_
.
size
();
public
Result
<
Object
>
ApprovedQuantity
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mysummaryquerydto
){
}
ApprovedQuantityDto
qna
=
ApprovedQuantityDto
.
builder
().
build
();
mysummaryquerydto
.
setType
(
1
);
//抄送我的
List
<
SpmkApproveSummary
>
ccme_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
mysummaryquerydto
.
setEndTime
(
null
);
if
(
ccme_
.
size
()
>
0
)
{
mysummaryquerydto
.
setStartTime
(
null
);
ccme
=
ccme_
.
size
();
}
mysummaryquerydto
.
setOrgCode
(
userBean
.
getOrgCode
());
mysummaryquerydto
.
setEmpNum
(
userBean
.
getEmpNum
());
mysummaryquerydto
.
setType
(
2
);
//我审批的
mysummaryquerydto
.
setSts
(
5
);
//状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝 4:(2/3) 5:全部
List
<
SpmkApproveSummary
>
iapprovedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
if
(
iapprovedit_
.
size
()
>
0
)
{
int
istartedit
=
0
,
ccme
=
0
,
iapprovedit
=
0
;
iapprovedit
=
iapprovedit_
.
size
();
mysummaryquerydto
.
setType
(
0
);
//我发起的
}
List
<
SpmkApproveSummary
>
istartedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
if
(
istartedit_
.
size
()
>
0
)
{
qna
.
setIstartedit
(
istartedit
);
istartedit
=
istartedit_
.
size
();
qna
.
setCcme
(
ccme
);
}
qna
.
setIapprovedit
(
iapprovedit
);
mysummaryquerydto
.
setType
(
1
);
//抄送我的
List
<
SpmkApproveSummary
>
ccme_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
return
ResultUtil
.
data
(
qna
);
if
(
ccme_
.
size
()
>
0
)
{
}
ccme
=
ccme_
.
size
();
}
@Value
(
"${config-8timer.environmental-science}"
)
public
String
environmental_science
;
mysummaryquerydto
.
setType
(
2
);
//我审批的
List
<
SpmkApproveSummary
>
iapprovedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
public
void
Logoutput
(
String
science
)
{
if
(
iapprovedit_
.
size
()
>
0
)
{
iapprovedit
=
iapprovedit_
.
size
();
if
(!(
"pro"
).
equals
(
environmental_science
))
{
}
System
.
out
.
println
(
science
);
qna
.
setIstartedit
(
istartedit
);
}
else
{
qna
.
setCcme
(
ccme
);
System
.
out
.
println
(
""
);
qna
.
setIapprovedit
(
iapprovedit
);
}
}
return
ResultUtil
.
data
(
qna
);
}
/**
* 审核详情数据转换
@Value
(
"${config-8timer.environmental-science}"
)
*/
public
String
environmental_science
;
@PostMapping
(
value
=
"/approved_addDetail"
)
@ApiOperation
(
value
=
"A审核详情数据转换"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
void
Logoutput
(
String
science
)
{
public
String
addApproveDetail
(){
return
spmkService
.
addApproveDetail
();
if
(!(
"pro"
).
equals
(
environmental_science
))
{
}
}
System
.
out
.
println
(
science
);
}
else
{
System
.
out
.
println
(
""
);
}
}
/**
* 审核详情数据转换
*/
@PostMapping
(
value
=
"/approved_addDetail"
)
@ApiOperation
(
value
=
"A审核详情数据转换"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
String
addApproveDetail
(){
return
spmkService
.
addApproveDetail
();
}
}
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