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
62693996
Commit
62693996
authored
Apr 03, 2023
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并华颐 审批流程 代码
parent
5b52fe85
Show whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
3297 additions
and
237 deletions
+3297
-237
src/main/java/cn/timer/api/Application.java
+1
-1
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
+10
-0
src/main/java/cn/timer/api/bean/qyxx/CmsContent.java
+0
-0
src/main/java/cn/timer/api/bean/qyxx/CmsContentModular.java
+1
-1
src/main/java/cn/timer/api/bean/qyxx/CmsContentRead.java
+0
-0
src/main/java/cn/timer/api/bean/spmk/SpmkApprovalG.java
+0
-1
src/main/java/cn/timer/api/bean/spmk/SpmkApproveDetailDrafts.java
+158
-0
src/main/java/cn/timer/api/bean/spmk/SpmkApproveDrafts.java
+304
-0
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecord.java
+4
-0
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecordDrafts.java
+144
-0
src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java
+0
-2
src/main/java/cn/timer/api/bean/spmk/SpmkExecutor.java
+3
-0
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
+9
-0
src/main/java/cn/timer/api/controller/disk/constant/FileAddressConstant.java
+0
-0
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
+159
-43
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
+0
-0
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
+102
-24
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
+240
-0
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+807
-114
src/main/java/cn/timer/api/controller/spmk/service/SpmkService.java
+3
-1
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
+91
-2
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
+3
-4
src/main/java/cn/timer/api/dao/qyxx/CmsContentMapper.java
+0
-1
src/main/java/cn/timer/api/dao/qyxx/CmsIsReadMapper.java
+4
-0
src/main/java/cn/timer/api/dao/spmk/SpmkApproveDetailDraftsMapper.java
+18
-0
src/main/java/cn/timer/api/dao/spmk/SpmkApproveDraftsMapper.java
+21
-0
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordDraftsMapper.java
+17
-0
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
+5
-0
src/main/java/cn/timer/api/dto/kqmk/BalanceSheetDataDto.java
+3
-0
src/main/java/cn/timer/api/dto/kqmk/ExportEmployeeLeaveBalanceDto.java
+37
-0
src/main/java/cn/timer/api/dto/qyxx/CmsContentDto.java
+2
-0
src/main/java/cn/timer/api/dto/qyxx/CmsContentReadDto.java
+4
-0
src/main/java/cn/timer/api/dto/spmk/AdminApprovingDto.java
+57
-0
src/main/java/cn/timer/api/dto/spmk/ApprovingDto.java
+9
-0
src/main/java/cn/timer/api/dto/spmk/FromsFileValueData.java
+25
-0
src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java
+7
-0
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
+8
-3
src/main/java/cn/timer/api/utils/router/RequestDataUtils.java
+129
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+491
-34
src/main/resources/application-dev.yml
+2
-2
src/main/resources/application-test.yml
+3
-3
src/main/resources/application.yml
+1
-1
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
+24
-0
src/main/resources/mapping/qyxx/CmsIsReadMapper.xml
+8
-0
src/main/resources/mapping/spmk/SpmkApproveDetailDraftsMapper.xml
+164
-0
src/main/resources/mapping/spmk/SpmkApproveDraftsMapper.xml
+36
-0
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordDraftsMapper.xml
+153
-0
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
+24
-0
src/main/resources/mapping/spmk/SpmkApproveSummaryMapper.xml
+0
-0
src/main/resources/mapping/spmk/SpmkExecutorMapper.xml
+6
-0
No files found.
src/main/java/cn/timer/api/Application.java
View file @
62693996
...
...
@@ -26,7 +26,7 @@ import cn.hutool.core.net.NetUtil;
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
final
Integer
port
=
8
0
89
;
final
Integer
port
=
8
1
89
;
if
(!
NetUtil
.
isUsableLocalPort
(
port
))
{
System
.
err
.
printf
(
"端口%d被占用了,无法启动%n"
,
port
);
System
.
exit
(
1
);
...
...
src/main/java/cn/timer/api/bean/kqmk/KqglAssoLeaveBalance.java
View file @
62693996
...
...
@@ -3,8 +3,10 @@ package cn.timer.api.bean.kqmk;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
...
...
@@ -15,6 +17,8 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author LAL 2020-05-09
*/
...
...
@@ -67,4 +71,9 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty
(
value
=
"是否为系统自动 0:否;1:是"
,
example
=
"101"
)
private
Integer
isAutomatic
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"假期统调用户ID"
)
private
List
<
Integer
>
userIds
;
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/qyxx/CmsContent.java
View file @
62693996
src/main/java/cn/timer/api/bean/qyxx/CmsContentModular.java
View file @
62693996
...
...
@@ -54,7 +54,7 @@ public class CmsContentModular extends Model<CmsContentModular> {
@ApiModelProperty
(
value
=
"0- 开启 1-关闭"
,
example
=
"0"
)
private
Integer
isOpen
;
@ApiModelProperty
(
value
=
"排序
:升序
"
,
example
=
"0"
)
@ApiModelProperty
(
value
=
"排序"
,
example
=
"0"
)
private
Integer
sort
;
}
src/main/java/cn/timer/api/bean/qyxx/CmsContentRead.java
View file @
62693996
src/main/java/cn/timer/api/bean/spmk/SpmkApprovalG.java
View file @
62693996
...
...
@@ -58,5 +58,4 @@ public class SpmkApprovalG extends Model<SpmkApprovalG> {
@ApiModelProperty
(
value
=
"是否可编辑 0是 1否"
,
example
=
"101"
)
private
Integer
isEditable
;
}
src/main/java/cn/timer/api/bean/spmk/SpmkApproveDetailDrafts.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
bean
.
spmk
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Table
;
/**
* 审批草稿详情
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"spmk_approve_detail_drafts"
)
@ApiModel
(
"审批草稿详情"
)
public
class
SpmkApproveDetailDrafts
extends
Model
<
SpmkApproveDetailDrafts
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 编号
*/
private
Integer
id
;
/**
* 审批汇总id
*/
private
Integer
approveSummaryId
;
/**
* 标题
*/
private
String
name
;
/**
* 所在部门名称
*/
private
String
departmentName
;
/**
* 申请数据
*/
private
String
requestData
;
/**
* 审批表单
*/
private
String
froms
;
/**
* 审批流程
*/
private
String
router
;
/**
* 通过节点
*/
private
String
flowChildren
;
/**
* 设置:编号
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取:编号
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置:审批汇总id
*/
public
void
setApproveSummaryId
(
Integer
approveSummaryId
)
{
this
.
approveSummaryId
=
approveSummaryId
;
}
/**
* 获取:审批汇总id
*/
public
Integer
getApproveSummaryId
()
{
return
approveSummaryId
;
}
/**
* 设置:标题
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/**
* 获取:标题
*/
public
String
getName
()
{
return
name
;
}
/**
* 设置:所在部门名称
*/
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
;
}
/**
* 获取:所在部门名称
*/
public
String
getDepartmentName
()
{
return
departmentName
;
}
/**
* 设置:申请数据
*/
public
void
setRequestData
(
String
requestData
)
{
this
.
requestData
=
requestData
;
}
/**
* 获取:申请数据
*/
public
String
getRequestData
()
{
return
requestData
;
}
/**
* 设置:审批表单
*/
public
void
setFroms
(
String
froms
)
{
this
.
froms
=
froms
;
}
/**
* 获取:审批表单
*/
public
String
getFroms
()
{
return
froms
;
}
/**
* 设置:审批流程
*/
public
void
setRouter
(
String
router
)
{
this
.
router
=
router
;
}
/**
* 获取:审批流程
*/
public
String
getRouter
()
{
return
router
;
}
/**
* 设置:通过节点
*/
public
void
setFlowChildren
(
String
flowChildren
)
{
this
.
flowChildren
=
flowChildren
;
}
/**
* 获取:通过节点
*/
public
String
getFlowChildren
()
{
return
flowChildren
;
}
}
src/main/java/cn/timer/api/bean/spmk/SpmkApproveDrafts.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
bean
.
spmk
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 审批草稿箱
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"spmk_approve_drafts"
)
@ApiModel
(
"审批草稿箱"
)
public
class
SpmkApproveDrafts
extends
Model
<
SpmkApproveDrafts
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 审批编号
*/
private
Integer
id
;
/**
* 企业组织代码
*/
private
Integer
orgCode
;
/**
* 发起人id 用于搜索(所在部门)
*/
private
Integer
empNum
;
/**
* 标题
*/
private
String
title
;
/**
* 所在部门名称
*/
private
String
departmentName
;
/**
* 发起人名称
*/
private
String
initiator
;
/**
* 发起时间
*/
private
Date
createTime
;
/**
* 审批名称
*/
private
String
approveName
;
/**
* 状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
private
Integer
sts
;
/**
* 当前审批人
*/
private
String
currentApprover
;
/**
* 历史审批人
*/
private
String
historyApprover
;
/**
* assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
private
Integer
assoType
;
/**
* 最近处理时间
*/
private
Date
updateTime
;
/**
* 结束时间
*/
private
Date
endTime
;
/**
* 摘要
*/
private
String
digest
;
/**
* 是否删除 0-否 1-是
*/
private
Integer
isDelete
;
/**
* 是否加急 0-否 1-是
*/
private
Integer
isUrgent
;
/**
* 设置:审批编号
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取:审批编号
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置:企业组织代码
*/
public
void
setOrgCode
(
Integer
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
/**
* 获取:企业组织代码
*/
public
Integer
getOrgCode
()
{
return
orgCode
;
}
/**
* 设置:发起人id 用于搜索(所在部门)
*/
public
void
setEmpNum
(
Integer
empNum
)
{
this
.
empNum
=
empNum
;
}
/**
* 获取:发起人id 用于搜索(所在部门)
*/
public
Integer
getEmpNum
()
{
return
empNum
;
}
/**
* 设置:标题
*/
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
/**
* 获取:标题
*/
public
String
getTitle
()
{
return
title
;
}
/**
* 设置:所在部门名称
*/
public
void
setDepartmentName
(
String
departmentName
)
{
this
.
departmentName
=
departmentName
;
}
/**
* 获取:所在部门名称
*/
public
String
getDepartmentName
()
{
return
departmentName
;
}
/**
* 设置:发起人名称
*/
public
void
setInitiator
(
String
initiator
)
{
this
.
initiator
=
initiator
;
}
/**
* 获取:发起人名称
*/
public
String
getInitiator
()
{
return
initiator
;
}
/**
* 设置:发起时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:发起时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:审批名称
*/
public
void
setApproveName
(
String
approveName
)
{
this
.
approveName
=
approveName
;
}
/**
* 获取:审批名称
*/
public
String
getApproveName
()
{
return
approveName
;
}
/**
* 设置:状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
public
void
setSts
(
Integer
sts
)
{
this
.
sts
=
sts
;
}
/**
* 获取:状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝
*/
public
Integer
getSts
()
{
return
sts
;
}
/**
* 设置:当前审批人
*/
public
void
setCurrentApprover
(
String
currentApprover
)
{
this
.
currentApprover
=
currentApprover
;
}
/**
* 获取:当前审批人
*/
public
String
getCurrentApprover
()
{
return
currentApprover
;
}
/**
* 设置:历史审批人
*/
public
void
setHistoryApprover
(
String
historyApprover
)
{
this
.
historyApprover
=
historyApprover
;
}
/**
* 获取:历史审批人
*/
public
String
getHistoryApprover
()
{
return
historyApprover
;
}
/**
* 设置:assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
public
void
setAssoType
(
Integer
assoType
)
{
this
.
assoType
=
assoType
;
}
/**
* 获取:assoType 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪
*/
public
Integer
getAssoType
()
{
return
assoType
;
}
/**
* 设置:最近处理时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:最近处理时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* 设置:结束时间
*/
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
/**
* 获取:结束时间
*/
public
Date
getEndTime
()
{
return
endTime
;
}
/**
* 设置:摘要
*/
public
void
setDigest
(
String
digest
)
{
this
.
digest
=
digest
;
}
/**
* 获取:摘要
*/
public
String
getDigest
()
{
return
digest
;
}
/**
* 设置:是否删除 0-否 1-是
*/
public
void
setIsDelete
(
Integer
isDelete
)
{
this
.
isDelete
=
isDelete
;
}
/**
* 获取:是否删除 0-否 1-是
*/
public
Integer
getIsDelete
()
{
return
isDelete
;
}
/**
* 设置:是否加急 0-否 1-是
*/
public
void
setIsUrgent
(
Integer
isUrgent
)
{
this
.
isUrgent
=
isUrgent
;
}
/**
* 获取:是否加急 0-否 1-是
*/
public
Integer
getIsUrgent
()
{
return
isUrgent
;
}
}
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecord.java
View file @
62693996
...
...
@@ -19,6 +19,7 @@ import lombok.AllArgsConstructor;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.Transient
;
/**
* @author Tang 2020-04-17
...
...
@@ -62,6 +63,9 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
@ApiModelProperty
(
value
=
"操作时间 "
,
example
=
"操作时间"
)
private
Date
updateTime
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
""
)
private
List
<
SpmkExecutor
>
spmkExecutors
;
}
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecordDrafts.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
bean
.
spmk
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 审批执行记录 发起人、抄送人、审批人操作记录--草稿
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-19 14:53:36
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"spmk_approve_execute_record_drafts"
)
@ApiModel
(
"审批执行记录 发起人、抄送人、审批人操作记录--草稿"
)
public
class
SpmkApproveExecuteRecordDrafts
extends
Model
<
SpmkApproveExecuteRecordDrafts
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 编号
*/
private
Integer
id
;
/**
* 审批汇总id
*/
private
Integer
approveSummaryId
;
/**
* 名称 发起申请 1抄送人 审批人 连续多级主管
*/
private
String
name
;
/**
* 类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
private
Integer
type
;
/**
* 状态 0未执行 1审批中 2同意 3拒绝
*/
private
Integer
sts
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
/**
* 设置:编号
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取:编号
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置:审批汇总id
*/
public
void
setApproveSummaryId
(
Integer
approveSummaryId
)
{
this
.
approveSummaryId
=
approveSummaryId
;
}
/**
* 获取:审批汇总id
*/
public
Integer
getApproveSummaryId
()
{
return
approveSummaryId
;
}
/**
* 设置:名称 发起申请 1抄送人 审批人 连续多级主管
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/**
* 获取:名称 发起申请 1抄送人 审批人 连续多级主管
*/
public
String
getName
()
{
return
name
;
}
/**
* 设置:类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
/**
* 获取:类型 0发起申请 1抄送人 2审批人 3连续多级主管
*/
public
Integer
getType
()
{
return
type
;
}
/**
* 设置:状态 0未执行 1审批中 2同意 3拒绝
*/
public
void
setSts
(
Integer
sts
)
{
this
.
sts
=
sts
;
}
/**
* 获取:状态 0未执行 1审批中 2同意 3拒绝
*/
public
Integer
getSts
()
{
return
sts
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/cn/timer/api/bean/spmk/SpmkApproveSummary.java
View file @
62693996
...
...
@@ -102,5 +102,4 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
}
\ No newline at end of file
src/main/java/cn/timer/api/bean/spmk/SpmkExecutor.java
View file @
62693996
...
...
@@ -61,6 +61,9 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@ApiModelProperty
(
value
=
"状态 0未执行 1执行中 2同意 3拒接 4转派"
,
example
=
"101"
)
private
Integer
sts
;
@ApiModelProperty
(
value
=
"阅读标记0.未读 1.已读"
,
example
=
"0"
)
private
Integer
readStatus
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
@ApiModelProperty
(
value
=
"创建时间 "
,
example
=
"创建时间"
)
private
Date
createTime
;
...
...
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
View file @
62693996
...
...
@@ -63,9 +63,18 @@ public class DiskFilesController {
@Autowired
private
SftpConfiguration
config
;
@Value
(
"${sftp.client.targetPath}"
)
private
String
targetPath
;
@Value
(
"${sftp.client.reservedName}"
)
private
boolean
reservedName
;
@Value
(
"${sftp.client.serverUrl}"
)
private
String
serverUrl
;
@Autowired
private
OSSService
ossService
;
@ResponseBody
@PostMapping
(
"/upload"
)
@ApiOperation
(
value
=
"上传普通文件"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
...
...
src/main/java/cn/timer/api/controller/disk/constant/FileAddressConstant.java
View file @
62693996
src/main/java/cn/timer/api/controller/kqgl/TimeCardController.java
View file @
62693996
...
...
@@ -9,13 +9,30 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.locks.ReentrantLock
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.util.IdcardUtil
;
import
cn.hutool.core.util.ReUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.dzht.DzhtAssoMbzj
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.config.enuminterface.YgEnumInterface
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.config.exception.Regular
;
import
cn.timer.api.config.validation.ValidList
;
import
cn.timer.api.dto.kqmk.*
;
import
cn.timer.api.dto.yggl.AddygdaDto
;
import
cn.timer.api.utils.*
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
...
...
@@ -23,6 +40,8 @@ import org.springframework.http.HttpHeaders;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.StringUtils
;
...
...
@@ -95,52 +114,10 @@ import cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper;
import
cn.timer.api.dao.kqmk.KqglAssoYhsbMapper
;
import
cn.timer.api.dao.kqmk.KqglAssoZhoupaibanMapper
;
import
cn.timer.api.dao.kqmk.KqglMainKqzMapper
;
import
cn.timer.api.dto.kqmk.AdditionalDto
;
import
cn.timer.api.dto.kqmk.AttLateLate
;
import
cn.timer.api.dto.kqmk.AttMemberSettings
;
import
cn.timer.api.dto.kqmk.AttSchedule
;
import
cn.timer.api.dto.kqmk.AttSchedulingDto
;
import
cn.timer.api.dto.kqmk.AttendanceAssistantDto
;
import
cn.timer.api.dto.kqmk.AttendanceCardListDto
;
import
cn.timer.api.dto.kqmk.AttendanceMachineStatus
;
import
cn.timer.api.dto.kqmk.AttendanceSummaryQueryDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.AttstateDate
;
import
cn.timer.api.dto.kqmk.BalanceSheetDataDto
;
import
cn.timer.api.dto.kqmk.CalendarDetailsDto
;
import
cn.timer.api.dto.kqmk.CalendarPunchDetailsDto
;
import
cn.timer.api.dto.kqmk.CalendarTableDataDto
;
import
cn.timer.api.dto.kqmk.ChangePunchResultsDto
;
import
cn.timer.api.dto.kqmk.CompensateDto
;
import
cn.timer.api.dto.kqmk.DailyDetailsDto
;
import
cn.timer.api.dto.kqmk.DetailsofbusinessDto
;
import
cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto
;
import
cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto
;
import
cn.timer.api.dto.kqmk.JiaqibalanceDto
;
import
cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto
;
import
cn.timer.api.dto.kqmk.KqglAssoMonthPunchSummaryDto
;
import
cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto
;
import
cn.timer.api.dto.kqmk.KqglAssoPbmxDto
;
import
cn.timer.api.dto.kqmk.KqglAssoRulesViceDto
;
import
cn.timer.api.dto.kqmk.KqglMainKqzDto
;
import
cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto
;
import
cn.timer.api.dto.kqmk.LeaveTypeDto
;
import
cn.timer.api.dto.kqmk.MachinememberDto
;
import
cn.timer.api.dto.kqmk.ModifyEmployeeBalanceDto
;
import
cn.timer.api.dto.kqmk.OriginalRecordDto
;
import
cn.timer.api.dto.kqmk.ResttryfixdayDto
;
import
cn.timer.api.dto.kqmk.SetConditionsDto
;
import
cn.timer.api.dto.kqmk.StartTimeRestDto
;
import
cn.timer.api.dto.kqmk.UserAttendanceRelDto
;
import
cn.timer.api.dto.kqmk.VacationInformationDto
;
import
cn.timer.api.dto.kqmk.WorkbenchCalendarDto
;
import
cn.timer.api.utils.DateUtil
;
import
cn.timer.api.utils.ResponseResult
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Slf4j
@Api
(
tags
=
"3.0[1]考勤模块"
)
@RestController
@Transactional
...
...
@@ -984,6 +961,65 @@ public class TimeCardController {
}
/**
* 假期统调
*/
@PostMapping
(
value
=
"/leave_balance_all"
)
@ApiOperation
(
value
=
"假期统调"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
LeaveBalanceAll
(
@CurrentUser
UserBean
userBean
,
@RequestBody
KqglAssoLeaveBalance
balance
)
{
balance
.
setModifyUserid
(
userBean
.
getEmpNum
());
balance
.
setModifyTimer
(
new
Date
().
getTime
());
balance
.
setOrgCode
(
userBean
.
getOrgCode
());
String
balanceDays
=
"0"
;
if
(
balance
.
getModifyAction
()
==
1
)
{
//增加
balanceDays
=
"+"
+
balance
.
getBalanceDays
();
}
else
{
balanceDays
=
"-"
+
balance
.
getBalanceDays
();
}
balance
.
setBalanceDays
(
balanceDays
);
if
(!
CollectionUtils
.
isEmpty
(
balance
.
getUserIds
())){
for
(
Integer
userId
:
balance
.
getUserIds
())
{
KqglAssoLeaveBalance
balan
=
kqglassoleavebalancemapper
.
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveBalance
>().
lambda
().
eq
(
KqglAssoLeaveBalance:
:
getUserid
,
userId
)
.
orderByDesc
(
KqglAssoLeaveBalance
::
getModifyNumber
).
last
(
"LIMIT 1"
));
if
(
balan
!=
null
)
{
balance
.
setModifyNumber
(
balan
.
getModifyNumber
()+
1
);
}
else
{
balance
.
setModifyNumber
(
1
);
}
balance
.
setUserid
(
userId
);
//添加成功
if
(
balance
.
insert
())
{
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance
emba
=
KqglAssoLeaveEmployeeBalance
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveEmployeeBalance
>().
lambda
().
eq
(
KqglAssoLeaveEmployeeBalance:
:
getLeaveRulesId
,
balance
.
getLeaveRulesId
())
.
eq
(
KqglAssoLeaveEmployeeBalance:
:
getUserid
,
userId
).
eq
(
KqglAssoLeaveEmployeeBalance:
:
getOrgCode
,
userBean
.
getOrgCode
()));
//获取最后得到的最终余额
double
balance_days
=
kqglassoleavebalancemapper
.
Sumbalancedays
(
userId
,
userBean
.
getOrgCode
(),
balance
.
getLeaveRulesId
());
if
(
emba
!=
null
&&
balance_days
>
0
)
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
balance_days
).
build
().
updateById
();
}
}
else
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
0
).
build
().
updateById
();
}
}
}
}
}
return
ResultUtil
.
success
(
"操作成功!"
)
;
}
/**
* 根据考勤余额id获取信息 ||大于“0”为有数字限制 ||为“-1”时为无数字限制
*/
@GetMapping
(
value
=
"/hqleavebalance/{id}"
)
...
...
@@ -1721,6 +1757,86 @@ public class TimeCardController {
return
ResultUtil
.
data
(
pageAs
,
sumlist
,
"操作成功!"
);
}
@PostMapping
(
value
=
"/export_leave_balance"
)
@ApiOperation
(
value
=
"导出假期余额列表数据"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
ExportLeaveBalance
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AttqueryCriteriaDto
attquerycriteriadto
)
{
attquerycriteriadto
.
setOrgCode
(
userBean
.
getOrgCode
());
attquerycriteriadto
.
setEmpNum
(
userBean
.
getEmpNum
());
List
<
ExportEmployeeLeaveBalanceDto
>
list
=
kqglassoleavebalancemapper
.
selectLeaveBalance
(
attquerycriteriadto
);
for
(
ExportEmployeeLeaveBalanceDto
endo
:
list
)
{
List
<
KqglAssoLeaveEmployeeBalance
>
empye
=
KqglAssoLeaveEmployeeBalance
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
KqglAssoLeaveEmployeeBalance
>().
lambda
().
eq
(
KqglAssoLeaveEmployeeBalance:
:
getUserid
,
endo
.
getEmpnum
())
.
eq
(
KqglAssoLeaveEmployeeBalance:
:
getOrgCode
,
endo
.
getOrgcode
()));
List
<
BalanceSheetDataDto
>
balanceTo
=
new
ArrayList
<
BalanceSheetDataDto
>();
for
(
KqglAssoLeaveEmployeeBalance
empyes
:
empye
)
{
BalanceSheetDataDto
bal
=
BalanceSheetDataDto
.
builder
().
build
();
bal
.
setBalancedays
(
empyes
.
getBalanceDays
());
bal
.
setLeaverulesid
(
empyes
.
getLeaveRulesId
());
balanceTo
.
add
(
bal
);
}
endo
.
setBalanceTo
(
balanceTo
);
}
return
ResultUtil
.
data
(
list
,
"操作成功!"
);
}
/**
* 导入假期余额数据
*/
@PostMapping
(
value
=
"/import_leave_balance"
)
@ApiOperation
(
value
=
"导入假期余额数据"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
importLeaveBalance
(
@CurrentUser
UserBean
userBean
,
@RequestBody
Object
o
)
throws
Exception
{
Integer
orgCode
=
userBean
.
getOrgCode
();
JSONArray
jsonArray
=
(
JSONArray
)
o
;
for
(
Object
object
:
jsonArray
)
{
JSONObject
jsonObject
=
(
JSONObject
)
object
;
if
(
StringUtils
.
isEmpty
(
jsonObject
.
get
(
"empnum"
))){
continue
;
}
String
empnum
=
jsonObject
.
get
(
"empnum"
).
toString
();
for
(
Map
.
Entry
<
String
,
Object
>
entity:
jsonObject
.
entrySet
())
{
log
.
info
(
"entity key:{},vlue{}"
,
entity
.
getKey
(),
entity
.
getValue
());
if
(
"empnum"
.
equals
(
entity
.
getKey
())){
}
else
if
(
"department"
.
equals
(
entity
.
getKey
())){
}
else
{
Integer
leaveRulesId
=
Integer
.
parseInt
(
entity
.
getKey
());
double
balanceDays
=
0
;
if
(
StringUtils
.
isEmpty
(
entity
.
getValue
())){
continue
;
}
else
{
if
(
"不限制余额"
.
equals
(
entity
.
getValue
().
toString
())){
balanceDays
=
-
1
;
}
else
{
balanceDays
=
Double
.
parseDouble
(
entity
.
getValue
().
toString
());
}
}
//查询员工假期余额表中所对应的假期id
KqglAssoLeaveEmployeeBalance
emba
=
KqglAssoLeaveEmployeeBalance
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
KqglAssoLeaveEmployeeBalance
>().
lambda
().
eq
(
KqglAssoLeaveEmployeeBalance:
:
getLeaveRulesId
,
leaveRulesId
)
.
eq
(
KqglAssoLeaveEmployeeBalance:
:
getUserid
,
empnum
).
eq
(
KqglAssoLeaveEmployeeBalance:
:
getOrgCode
,
userBean
.
getOrgCode
()));
if
(
emba
!=
null
&&
balanceDays
>
0
)
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
balanceDays
).
build
().
updateById
();
}
}
else
{
if
(
emba
.
getBalanceDays
()
!=
-
1
)
{
//确认为限制余额的
//修改最终的余额数
KqglAssoLeaveEmployeeBalance
.
builder
().
id
(
emba
.
getId
()).
balanceDays
(
0
).
build
().
updateById
();
}
}
}
}
}
return
ResultUtil
.
success
(
"导入假期余额成功!"
);
}
/**
* 移除考勤机管理员
...
...
src/main/java/cn/timer/api/controller/kqgl/service/KqglServiceImpl.java
View file @
62693996
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
View file @
62693996
...
...
@@ -3,11 +3,16 @@ package cn.timer.api.controller.qyxx;
import
java.util.*
;
import
cn.timer.api.bean.qyxx.*
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.dto.qyxx.CmsContentReadDto
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
com.github.yulichang.query.MPJQueryWrapper
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -47,7 +52,7 @@ import javax.annotation.Resource;
@RestController
@Api
(
tags
=
"5.0企业讯息"
)
@Transactional
@RequestMapping
(
value
=
"/qyxx"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/qyxx"
,
produces
=
{
"application/json"
})
@Slf4j
public
class
CmsController
{
...
...
@@ -57,6 +62,7 @@ public class CmsController {
@Autowired
private
CmsIsReadMapper
cmsIsReadMapper
;
// @Autowired
// private CmsAnnouncementMapper cmsAnnouncementMapper;
...
...
@@ -106,7 +112,6 @@ public class CmsController {
List
<
CmsContent
>
picList
=
CmsContent
.
builder
().
build
().
selectList
(
qw
);
map
.
put
(
"list"
,
qynr
);
map
.
put
(
"picList"
,
picList
);
return
ResultUtil
.
data
(
map
,
"查询分类成功!"
);
}
...
...
@@ -145,7 +150,6 @@ public class CmsController {
/**
* 分类内容获取
*
*/
@GetMapping
(
value
=
"/getType"
)
@ApiOperation
(
value
=
"分类内容获取"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
...
...
@@ -164,8 +168,8 @@ public class CmsController {
.
leftJoin
(
"cms_content_read ccr on t.id = ccr.cms_content_id"
);
queryWrapper
.
eq
(
"t.releasestate"
,
0
)
.
and
(!
StringUtils
.
isEmpty
(
userBean
.
getEmpNum
()),
wq
->
wq
.
eq
(
"t.open_status"
,
1
)
.
or
(
true
,
q
->
q
.
eq
(
"t.open_status"
,
0
).
eq
(
"ccr.user_id"
,
userBean
.
getEmpNum
()))
.
or
(
true
,
q
->
q
.
eq
(
"t.open_status"
,
0
).
eq
(
"t.userid"
,
userBean
.
getEmpNum
())))
.
or
(
true
,
q
->
q
.
eq
(
"t.open_status"
,
0
).
eq
(
"ccr.user_id"
,
userBean
.
getEmpNum
()))
.
or
(
true
,
q
->
q
.
eq
(
"t.open_status"
,
0
).
eq
(
"t.userid"
,
userBean
.
getEmpNum
())))
.
eq
(
"t.organization_id"
,
userBean
.
getOrgCode
()).
eq
(
"t.modularid"
,
id
)
.
groupBy
(
"t.id"
)
.
orderByDesc
(
"t.releasetime"
)
...
...
@@ -178,7 +182,6 @@ public class CmsController {
/**
* 获取分类
*
*/
@GetMapping
(
value
=
"/xxfl"
)
@ApiOperation
(
value
=
"获取分类"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
...
...
@@ -208,7 +211,7 @@ public class CmsController {
// qynr.setXxbh("XX" + i++);
Boolean
a
=
qynr
.
getId
()
==
null
;
if
(
a
)
{
if
(
a
)
{
qynr
.
setUserid
(
empNum
);
}
if
(
a
&&
qynr
.
getPublisher
()
==
null
)
...
...
@@ -229,16 +232,16 @@ public class CmsController {
.
eq
(
YgglMainEmp:
:
getOrgCode
,
orgCode
).
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
)).
getName
());
qynr
.
setReleasetype
(
fbfs
);
qynr
.
setStatus
(
0
);
if
(
fbfs
!=
null
&&
fbfs
==
4
)
{
if
(
fbfs
!=
null
&&
fbfs
==
4
)
{
qynr
.
setReleasestate
(
0
);
qynr
.
setStatus
(
1
);
qynr
.
setReleasetime
(
now
.
toString
());
}
qynr
.
insertOrUpdate
();
// 新增 文件传阅 人员数据
if
(
a
)
{
if
(!
CollectionUtils
.
isEmpty
(
cmsContentDto
.
getCmsContentReads
()))
{
for
(
CmsContentRead
entity
:
cmsContentDto
.
getCmsContentReads
()
)
{
if
(
a
)
{
if
(!
CollectionUtils
.
isEmpty
(
cmsContentDto
.
getCmsContentReads
()))
{
for
(
CmsContentRead
entity
:
cmsContentDto
.
getCmsContentReads
()
)
{
entity
.
setCmsContentId
(
qynr
.
getId
());
entity
.
setOrgCode
(
orgCode
);
entity
.
setReadStatus
(
0
);
...
...
@@ -248,8 +251,8 @@ public class CmsController {
}
}
if
(
a
){
String
msg
=
fbfs
==
4
?
"提交成功"
:
"提交成功、等待管理员审核"
;
if
(
a
)
{
String
msg
=
fbfs
==
4
?
"提交成功"
:
"提交成功、等待管理员审核"
;
return
ResultUtil
.
data
(
qynr
,
msg
);
}
else
{
return
ResultUtil
.
data
(
qynr
,
"修改成功"
);
...
...
@@ -351,7 +354,7 @@ public class CmsController {
MPJQueryWrapper
<
CmsContent
>
queryWrapper
=
new
MPJQueryWrapper
<>();
queryWrapper
.
selectAll
(
CmsContent
.
class
)
.
leftJoin
(
"cms_content_read ccr on t.id = ccr.cms_content_id"
);
queryWrapper
.
and
(!
StringUtils
.
isEmpty
(
userBean
.
getEmpNum
()),
wq
->
wq
.
eq
(
"t.open_status"
,
1
).
or
(
true
,
sq
->
sq
.
eq
(
"t.open_status"
,
0
).
eq
(
"ccr.user_id"
,
userBean
.
getEmpNum
())));
queryWrapper
.
and
(!
StringUtils
.
isEmpty
(
userBean
.
getEmpNum
()),
wq
->
wq
.
eq
(
"t.open_status"
,
1
).
or
(
true
,
sq
->
sq
.
eq
(
"t.open_status"
,
0
).
eq
(
"ccr.user_id"
,
userBean
.
getEmpNum
())));
queryWrapper
.
eq
(
"t.organization_id"
,
userBean
.
getOrgCode
()).
eq
(
"t.status"
,
1
).
eq
(
"t.releasestate"
,
0
)
.
eq
(
t
!=
null
&&
t
>
-
1
,
"t.modularid"
,
t
).
eq
(
r
!=
null
&&
r
>
-
1
,
"t.releasestate"
,
r
)
.
between
(!
StrUtil
.
hasBlank
(
s
)
&&
!
StrUtil
.
hasBlank
(
e
),
"t.releasetime"
,
...
...
@@ -402,6 +405,35 @@ public class CmsController {
return
ResultUtil
.
data
(
cmsContentPage
,
cmsContents
,
"企业OA讯息搜索成功"
);
}
@PostMapping
(
value
=
"/oaCirculate"
)
@ApiOperation
(
value
=
"搜索OA文件传阅记录"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
oaCirculate
(
@CurrentUser
UserBean
userBean
,
@RequestBody
QyxxQueryDto
qyxxQueryDto
)
{
String
s
=
qyxxQueryDto
.
getStartTime
();
String
e
=
qyxxQueryDto
.
getEndTime
();
Integer
r
=
qyxxQueryDto
.
getReleasestate
();
Page
<
CmsContent
>
page
=
new
Page
<
CmsContent
>(
qyxxQueryDto
.
getCurrentPage
()
==
null
?
1
:
qyxxQueryDto
.
getCurrentPage
(),
qyxxQueryDto
.
getTotalPage
()
==
null
?
10
:
qyxxQueryDto
.
getTotalPage
());
QueryWrapper
<
CmsContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"organization_id"
,
userBean
.
getOrgCode
())
.
eq
(
"modularid"
,
7
).
eq
(
r
!=
null
&&
r
>
-
1
,
"releasestate"
,
r
)
.
between
(!
StrUtil
.
hasBlank
(
s
)
&&
!
StrUtil
.
hasBlank
(
e
),
"releasetime"
,
!
StrUtil
.
hasBlank
(
s
)
?
s
:
"1000-01-01 00:00:00"
,
!
StrUtil
.
hasBlank
(
e
)
?
e
:
"9999-01-01 00:00:00"
)
.
and
(
wq
->
wq
.
eq
(
"publisher"
,
userBean
.
getEmpNum
()).
or
().
eq
(
"author"
,
userBean
.
getUserInfo
().
getName
()).
or
().
inSql
(
"id"
,
"select cms_content_id from cms_content_read where user_id ="
+
userBean
.
getEmpNum
()))
.
orderByDesc
(
"addeddate"
);
IPage
<
CmsContent
>
cmsContentPage
=
CmsContent
.
builder
().
build
().
selectPage
(
page
,
queryWrapper
);
List
<
CmsContent
>
cmsContents
=
cmsContentPage
.
getRecords
();
cmsContentPage
.
getCurrent
();
cmsContentPage
.
getPages
();
cmsContentPage
.
getTotal
();
cmsContentPage
.
getSize
();
return
ResultUtil
.
data
(
cmsContentPage
,
cmsContents
,
"企业OA讯息搜索成功"
);
}
/**
* 根据id查讯息
*
...
...
@@ -442,7 +474,7 @@ public class CmsController {
QueryWrapper
<
CmsContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"organization_id"
,
userBean
.
getOrgCode
())
.
select
(
"id"
,
"publisher_name"
,
"auditopinion"
,
"modularid"
,
"status"
,
"title"
,
"releasetime"
,
"addeddate"
,
"author"
,
"summary"
,
"releasetype"
,
"fmtpath"
,
"filepath"
,
"open_status"
)
"addeddate"
,
"author"
,
"summary"
,
"releasetype"
,
"fmtpath"
,
"filepath"
,
"open_status"
)
.
ne
(
"status"
,
1
).
eq
(
t
!=
null
&&
t
>
-
1
,
"modularid"
,
t
)
.
between
(!
StrUtil
.
hasBlank
(
s
)
&&
!
StrUtil
.
hasBlank
(
e
),
"releasetime"
,
!
StrUtil
.
hasBlank
(
s
)
?
s
:
"1000-01-01 00:00:00"
,
...
...
@@ -500,7 +532,6 @@ public class CmsController {
* 添加已读
*
* @param userBean
* @param id
* @return
*/
@GetMapping
(
value
=
"/isread"
)
...
...
@@ -623,6 +654,7 @@ public class CmsController {
/**
* 查询传阅列表
*
* @return
*/
@PostMapping
(
value
=
"/getCmsContentReads"
)
...
...
@@ -648,17 +680,17 @@ public class CmsController {
.
selectOne
(
new
QueryWrapper
<
CmsContentRead
>().
lambda
()
.
eq
(
CmsContentRead:
:
getUserId
,
userBean
.
getEmpNum
())
.
eq
(
CmsContentRead:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
CmsContentRead:
:
getCmsContentId
,
id
));
.
eq
(
CmsContentRead:
:
getCmsContentId
,
id
));
if
(
cmsContentRead
==
null
)
{
if
(
cmsContentRead
==
null
)
{
cmsContentRead
=
new
CmsContentRead
();
cmsContentRead
.
setUserId
(
userBean
.
getEmpNum
());
cmsContentRead
.
setUserName
(
userBean
.
getUserInfo
().
getName
());
cmsContentRead
.
setOrgCode
(
userBean
.
getOrgCode
());
cmsContentRead
.
setCmsContentId
(
id
);
}
else
{
}
else
{
//已阅 直接返回
if
(
cmsContentRead
.
getReadStatus
()
==
1
)
{
if
(
cmsContentRead
.
getReadStatus
()
==
1
)
{
return
ResultUtil
.
data
(
1
);
}
}
...
...
@@ -667,7 +699,7 @@ public class CmsController {
cmsContentRead
.
setReadStatus
(
1
);
cmsContentRead
.
setReviewTime
(
new
Date
());
cmsContentRead
.
insertOrUpdate
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"=============已阅操作失败, "
+
e
);
return
ResultUtil
.
error
(
e
);
}
...
...
@@ -676,6 +708,7 @@ public class CmsController {
/**
* 根据讯息id查传阅列表
*
* @return
*/
@PostMapping
(
value
=
"/comment"
)
...
...
@@ -686,11 +719,11 @@ public class CmsController {
.
selectOne
(
new
QueryWrapper
<
CmsContentRead
>().
lambda
()
.
eq
(
CmsContentRead:
:
getUserId
,
userBean
.
getEmpNum
())
.
eq
(
CmsContentRead:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
CmsContentRead:
:
getCmsContentId
,
cmsContentReadDto
.
getCmsContentId
()));
.
eq
(
CmsContentRead:
:
getCmsContentId
,
cmsContentReadDto
.
getCmsContentId
()));
try
{
cmsContentRead
.
setReviewContent
(
cmsContentReadDto
.
getReviewContent
());
cmsContentRead
.
insertOrUpdate
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"=============评论失败, "
+
e
);
return
ResultUtil
.
error
(
e
);
}
...
...
@@ -698,18 +731,63 @@ public class CmsController {
}
/**
* 根据讯息id查传阅增加文件
*
* @return
*/
@PostMapping
(
value
=
"/cmsAddFile"
)
@ApiOperation
(
value
=
"文件传阅增加文件"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
cmsAddFile
(
@CurrentUser
UserBean
userBean
,
@RequestBody
JSONObject
request
)
{
String
cmsContentId
=
request
.
getString
(
"cmsContentId"
);
//用户id查询传阅消息
QueryWrapper
<
CmsContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"id"
,
cmsContentId
);
CmsContent
cmsContent
=
CmsContent
.
builder
().
build
().
selectOne
(
queryWrapper
);
JSONArray
addjsonArray
=
JSONArray
.
fromObject
(
request
.
getString
(
"filepathcms"
));
JSONArray
resjsonArray
=
JSONArray
.
fromObject
(
cmsContent
.
getFilepath
());
resjsonArray
.
addAll
(
addjsonArray
);
cmsContent
.
setFilepath
(
resjsonArray
.
toString
());
cmsContentMapper
.
updateById
(
cmsContent
);
return
ResultUtil
.
data
(
resjsonArray
.
toString
());
}
/**
* 添加传阅人员
*
* @return
*/
@PostMapping
(
value
=
"/addReadPersonnel"
)
@ApiOperation
(
value
=
"添加传阅人员"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
addReadPersonnel
(
@CurrentUser
UserBean
userBean
,
@RequestBody
List
<
CmsContentRead
>
cmsContentReads
)
{
for
(
CmsContentRead
ccr
:
cmsContentReads
for
(
CmsContentRead
ccr
:
cmsContentReads
)
{
ccr
.
insert
();
}
return
ResultUtil
.
success
();
}
@PostMapping
(
value
=
"/getUnreadCmsList"
)
@ApiOperation
(
value
=
"获取当前用户的未读传阅列表"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
shxxquery
(
@CurrentUser
UserBean
userBean
)
{
return
ResultUtil
.
data
(
cmsIsReadMapper
.
getUnreadList
(
userBean
.
getEmpNum
()));
}
@PostMapping
(
value
=
"/adminDeleteFile"
)
@ApiOperation
(
value
=
"管理员删除附件"
,
httpMethod
=
"POST"
,
notes
=
"接口发布说明"
)
public
Result
<
Object
>
adminDeleteFile
(
@CurrentUser
UserBean
userBean
,
@RequestBody
CmsContentReadDto
cmsContentReadDto
)
{
QyzxEmpEntAsso
ent
=
QyzxEmpEntAsso
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
QyzxEmpEntAsso
>().
lambda
().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
()));
if
(
ent
.
getUserType
()
==
2
)
{
return
ResultUtil
.
error
(
"当前用户没有权限操作"
);
}
CmsContent
cmsContent
=
CmsContent
.
builder
().
id
(
cmsContentReadDto
.
getId
()).
build
().
selectById
();
JSONArray
resjsonArray
=
JSONArray
.
fromObject
(
cmsContent
.
getFilepath
());
/*不转为int会默认使用remove(object)*/
resjsonArray
.
remove
((
int
)
cmsContentReadDto
.
getFileIndex
());
cmsContent
.
setFilepath
(
resjsonArray
.
toString
());
cmsContent
.
updateById
();
return
ResultUtil
.
success
(
"删除附件成功"
);
}
}
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
controller
.
spmk
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.aspect.lang.annotation.Log
;
import
cn.timer.api.aspect.lang.enums.BusinessType
;
import
cn.timer.api.bean.qyzx.QyzxEmpEntAsso
;
import
cn.timer.api.bean.spmk.SpmkApproveDetailSummary
;
import
cn.timer.api.bean.spmk.SpmkApproveExecuteRecord
;
import
cn.timer.api.bean.spmk.SpmkApproveSummary
;
import
cn.timer.api.bean.spmk.SpmkExecutor
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts
;
import
cn.timer.api.config.enums.CommonEnum
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper
;
import
cn.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper
;
import
cn.timer.api.dao.spmk.SpmkApproveSummaryMapper
;
import
cn.timer.api.dao.spmk.SpmkExecutorMapper
;
import
cn.timer.api.dto.spmk.AdminApprovingDto
;
import
cn.timer.api.dto.spmk.FlowChildren
;
import
cn.timer.api.dto.spmk.FromData
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.router.RouterUtils
;
import
cn.timer.api.utils.router.business.SpmkAssoBusiness
;
import
cn.timer.api.utils.router.business.SpmkAssoBusinessFactory
;
import
cn.timer.api.utils.router.enums.ApproveEnum
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.json.JSONArray
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
@Api
(
tags
=
"3.0Admin审批模块"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/admin/spmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
public
class
AdminSpmkController
{
@Autowired
private
QyzxEmpEntAssoMapper
qyzxEmpEntAssoMapper
;
@Autowired
private
SpmkApproveSummaryMapper
spmkApproveSummaryMapper
;
@Autowired
private
SpmkExecutorMapper
spmkExecutorMapper
;
@Autowired
private
SpmkAssoBusinessFactory
spmkAssoBusinessFactory
;
@Autowired
private
SpmkApproveExecuteRecordMapper
spmkApproveExecuteRecordMapper
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
@Resource
private
RedisUtil
redisUtil
;
//TODO 管理员审批
/**
* 管理员审批
*/
@PostMapping
(
value
=
"/approving"
)
@ApiOperation
(
value
=
"1.审批人审批"
,
httpMethod
=
"POST"
,
notes
=
"审批人审批"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ApiOperationSupport
(
order
=
20
)
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
public
Result
<
Object
>
approving
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
AdminApprovingDto
approvingDto
)
throws
Exception
{
/*判断是否有权限转派*/
//if(approvingDto.getSts()==4){
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
,
"/Approvalspbutonspbuton020102"
));
if
(
zzglAuth
==
null
)
{
return
ResultUtil
.
error
(
"您没有权限"
);
}
}
}
//}
Integer
asId
=
approvingDto
.
getAsId
();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
if
(
approStatus
==
1
){
return
ResultUtil
.
error
(
"该审批已在审批中!"
);
}
else
{
redisUtil
.
set
(
asId
.
toString
(),
1
,
2
);
}
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
()
.
select
(
SpmkApproveDetailSummary:
:
getId
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getFroms
,
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
// 查询 SpmkApproveSummary 状态,
SpmkApproveSummary
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
.
select
(
SpmkApproveSummary:
:
getSts
)
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
// if (aSummary.getSts() > ApproveSummarySts.IN.ordinal()) {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("该审批已结束!");
// }
//
// // 查询该 审批的状态 是否为 1 审批中
// Integer count = SpmkExecutor.builder().build().selectCount(new QueryWrapper<SpmkExecutor>().lambda()
// .eq(SpmkExecutor::getId, approvingDto.getExecutorId())
// .eq(SpmkExecutor::getSts, ExecutorSts.IN_EXECUTION.ordinal()));
//
// if (count == 0) {
// 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
())
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()))
==
0
)
{
Integer
adminNum
=
new
LambdaQueryChainWrapper
<
QyzxEmpEntAsso
>(
qyzxEmpEntAssoMapper
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
SysRoleType
.
U_TYPE_ADMIN
,
SysRoleType
.
U_TYPE_C_ADMIN
)
.
count
();
if
(
adminNum
<=
0
)
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"非当前审批人 或 管理员,无法操作!"
);
}
}
//如果是再次审批
SpmkApproveExecuteRecord
spmkApproveExecuteRecord
=
SpmkApproveExecuteRecord
.
builder
().
id
(
approvingDto
.
getExecuteRecordId
()).
build
().
selectById
();
if
(
spmkApproveExecuteRecord
.
getSts
()>
1
){
spmkApproveExecuteRecordMapper
.
delExecuteRecord
(
approvingDto
.
getExecuteRecordId
(),
asId
);
}
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
RouterUtils
.
updateRefuseToAgree
(
listFlowChildren
,
asId
,
approvingDto
.
getExecuteRecordId
(),
approvingDto
.
getExecutorId
(),
approvingDto
.
getOpinion
(),
approvingDto
.
getSts
(),
aSummary
.
getSts
(),
approvingDto
.
getUser
(),
approvingDto
.
getSignatureImg
(),
userBean
.
getEmpNum
(),
approvingDto
.
getUserList
(),
approvingDto
.
getTypeIndex
(),
approvingDto
.
getUserIndex
()
);
// 更新 flowChildren
SpmkApproveDetailSummary
sadsUpdate
=
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
();
/*// 审批详情 审批时添加 附件
if(RequestDataUtils.addFileList(ad,approvingDto.getFileList())){
sadsUpdate.setRequestData(ad.getRequestData());
}*/
sadsUpdate
.
updateById
();
//最后一条数据
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
if
(
fc
.
getExecute
()
==
"2"
)
{
// 查询 SpmkApproveSummary 状态
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
// if (aSummary.getSts() != ApproveSummarySts.REFUSE.ordinal()) {
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
FINISH
.
ordinal
()).
build
().
updateById
();
JSONObject
jSONObject
=
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
);
jSONObject
.
set
(
"approveId"
,
FromData
.
builder
().
value
(
String
.
valueOf
(
asId
)).
build
());
jSONObject
.
set
(
"orgCode"
,
userBean
.
getOrgCode
());
//审批完成后 业务
SpmkAssoBusiness
sab
=
spmkAssoBusinessFactory
.
createSpmkService
(
ApproveEnum
.
getEnums
(
aSummary
.
getAssoType
()));
if
(
sab
!=
null
){
log
.
info
(
"1----------{}"
,
sab
);
}
log
.
info
(
"2----------{}"
,
jSONObject
);
sab
.
handleApprove
(
jSONObject
);
}
// }
// }else {
// redisUtil.set(asId.toString(),0,500);
// return ResultUtil.error("该审批已结束!");
// }
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
success
();
}
/**
* 删除-考核模板
@DeleteMapping(value = "/del_appraisal_t/{id}")
@ApiOperation(value = "2.移除-审批人", httpMethod = "DELETE", notes = "移除-审批人")
@ApiOperationSupport(order = 6)
@Role
public Result<Object> delAT(@CurrentUser UserBean userBean,@Validated @RequestBody AdminApprovingDto approvingDto) throws Exception {
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.success();
}*/
}
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
62693996
...
...
@@ -2,22 +2,27 @@ package cn.timer.api.controller.spmk;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
cn.timer.api.bean.crm.CrmClientContacts
;
import
cn.timer.api.bean.sche.ScheduleTask
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.zzgl.ZzglAuth
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.router.RequestDataUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
net.sf.json.JSON
;
import
com.beust.jcommander.internal.Lists
;
import
net.sf.json.JSONArray
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
...
...
@@ -80,7 +85,7 @@ import javax.annotation.Resource;
@Api
(
tags
=
"3.0审批模块"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/spmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
@RequestMapping
(
value
=
"/spmk"
,
produces
=
{
"application/json"
,
"multipart/form-data"
})
public
class
SpmkController
{
@Autowired
...
...
@@ -112,6 +117,9 @@ public class SpmkController {
@Autowired
private
SpmkAssoBusinessFactory
spmkAssoBusinessFactory
;
@Autowired
private
SpmkApproveDetailDraftsMapper
spmkApproveDetailDraftsMapper
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
private
boolean
ISFIRST
=
true
;
// 第一次启动审批流程
...
...
@@ -119,18 +127,22 @@ public class SpmkController {
@Resource
private
RedisUtil
redisUtil
;
@Autowired
private
SpmkApproveDraftsMapper
spmkApproveDraftsMapper
;
//TODO 审批模板组
/**
* 新增或编辑-审批模板组
*/
@PostMapping
(
value
=
"/save_approval_template_g"
)
@ApiOperation
(
value
=
"1.新增或编辑-审批模板组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板组"
)
@ApiOperationSupport
(
order
=
1
)
public
Result
<
Object
>
saveAtg
(
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
)
{
public
Result
<
Object
>
saveAtg
(
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalTemplateG
spmkApprovalTemplateG
)
{
if
(
spmkApprovalTemplateG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplateG
>().
lambda
()
.
ne
(
spmkApprovalTemplateG
.
getId
()
!=
null
,
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
.
ne
(
spmkApprovalTemplateG
.
getId
()
!=
null
,
SpmkApprovalTemplateG:
:
getId
,
spmkApprovalTemplateG
.
getId
())
.
eq
(
SpmkApprovalTemplateG:
:
getName
,
spmkApprovalTemplateG
.
getName
()))
>
0
)
{
return
ResultUtil
.
error
(
"审批模板组名重复!"
);
}
...
...
@@ -145,9 +157,9 @@ public class SpmkController {
@DeleteMapping
(
value
=
"/delete_approval_template_g/{id}"
)
@ApiOperation
(
value
=
"2.删除-审批模板组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板组"
)
@ApiOperationSupport
(
order
=
2
)
public
Result
<
Object
>
deleteAtgById
(
@PathVariable
int
id
){
public
Result
<
Object
>
deleteAtgById
(
@PathVariable
int
id
)
{
if
(
spmkApprovalTemplateMapper
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
().
eq
(
SpmkApprovalTemplate:
:
getApprovalTemplateGId
,
id
))
>
0
)
if
(
spmkApprovalTemplateMapper
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
().
eq
(
SpmkApprovalTemplate:
:
getApprovalTemplateGId
,
id
))
>
0
)
return
ResultUtil
.
error
(
"审批模板组存在 模板,不可直接删除!"
);
return
SpmkApprovalTemplateG
.
builder
().
id
(
id
).
build
().
deleteById
()
?
...
...
@@ -160,7 +172,7 @@ public class SpmkController {
@GetMapping
(
value
=
"/list_approval_template_g"
)
@ApiOperation
(
value
=
"3.查询列表-审批模板组"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批模板组"
)
@ApiOperationSupport
(
order
=
3
)
public
Result
<
Object
>
selectListAtg
(){
public
Result
<
Object
>
selectListAtg
()
{
return
ResultUtil
.
data
(
spmkApprovalTemplateGMapper
.
selectListAtInAtg
());
}
...
...
@@ -171,7 +183,7 @@ public class SpmkController {
@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
){
public
Result
<
Object
>
ranksAtg
(
@Validated
(
Ranks
.
class
)
@RequestBody
ValidList
<
SpmkApprovalTemplateG
>
list
)
{
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
return
ResultUtil
.
success
();
...
...
@@ -180,13 +192,14 @@ public class SpmkController {
}
//TODO 审批模板
/**
* 新增或编辑-审批模板
*/
@PostMapping
(
value
=
"/save_approval_template"
)
@ApiOperation
(
value
=
"5.新增或编辑-审批模板"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批模板"
)
@ApiOperationSupport
(
order
=
5
)
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
){
public
Result
<
Object
>
saveAt
(
@Validated
@RequestBody
SpmkApprovalTemplateDto
spmkApprovalTemplateDto
)
{
Integer
approvalTemplateGId
=
spmkApprovalTemplateDto
.
getApprovalTemplateGId
();
if
(
ObjectUtil
.
isNull
(
approvalTemplateGId
))
...
...
@@ -195,9 +208,9 @@ public class SpmkController {
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
build
();
// 克隆 SpmkApprovalTemplateDto对象 到 SpmkApprovalTemplate对象,排除属性froms,router
BeanUtil
.
copyProperties
(
spmkApprovalTemplateDto
,
at
,
"froms"
,
"router"
);
BeanUtil
.
copyProperties
(
spmkApprovalTemplateDto
,
at
,
"froms"
,
"router"
);
// 序列化 后 写入 SpmkApprovalTemplate对象
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
at
.
setFroms
(
ObjectUtil
.
serialize
((
List
<
JSONObject
>)
spmkApprovalTemplateDto
.
getFroms
()));
at
.
setRouter
(
ObjectUtil
.
serialize
(
spmkApprovalTemplateDto
.
getRouter
()));
if
(
at
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalTemplate
>().
lambda
()
...
...
@@ -222,7 +235,7 @@ public class SpmkController {
@DeleteMapping
(
value
=
"/delete_approval_template/{id}"
)
@ApiOperation
(
value
=
"6.删除-审批模板"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批模板"
)
@ApiOperationSupport
(
order
=
6
)
public
Result
<
Object
>
deleteAtById
(
@PathVariable
int
id
){
public
Result
<
Object
>
deleteAtById
(
@PathVariable
int
id
)
{
return
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
deleteById
()
?
ResultUtil
.
success
()
:
ResultUtil
.
error
(
"没有找到该对象"
);
...
...
@@ -234,11 +247,11 @@ public class SpmkController {
@GetMapping
(
value
=
"/select_approval_template/{id}"
)
@ApiOperation
(
value
=
"7.id查询-审批模板"
,
httpMethod
=
"GET"
,
notes
=
"id查询-审批模板"
)
@ApiOperationSupport
(
order
=
7
)
public
Result
<
Object
>
selectAtById
(
@PathVariable
int
id
){
public
Result
<
Object
>
selectAtById
(
@PathVariable
int
id
)
{
SpmkApprovalTemplate
at
=
SpmkApprovalTemplate
.
builder
().
id
(
id
).
build
().
selectById
();
SpmkApprovalTemplateDto
atd
=
SpmkApprovalTemplateDto
.
builder
().
build
();
BeanUtil
.
copyProperties
(
at
,
atd
,
"froms"
,
"router"
);
BeanUtil
.
copyProperties
(
at
,
atd
,
"froms"
,
"router"
);
atd
.
setFroms
(
ObjectUtil
.
deserialize
(
at
.
getFroms
()));
atd
.
setRouter
(
ObjectUtil
.
deserialize
(
at
.
getRouter
()));
return
ResultUtil
.
data
(
atd
);
...
...
@@ -251,7 +264,7 @@ public class SpmkController {
@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
)
{
public
Result
<
Object
>
ranksAt
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalTemplate
>
list
)
{
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
return
ResultUtil
.
success
();
...
...
@@ -262,15 +275,15 @@ public class SpmkController {
}
//TODO 审批组
/**
* 新增或编辑-审批组
*/
@PostMapping
(
value
=
"/save_approval_g"
)
@ApiOperation
(
value
=
"9.新增或编辑-审批组"
,
httpMethod
=
"POST"
,
notes
=
"新增或编辑-审批组"
)
@ApiOperationSupport
(
order
=
9
)
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalG
spmkApprovalG
)
{
public
Result
<
Object
>
saveAg
(
@CurrentUser
UserBean
userBean
,
@Validated
({
Insert
.
class
,
Update
.
class
})
@RequestBody
SpmkApprovalG
spmkApprovalG
)
{
if
(
spmkApprovalG
.
selectCount
(
new
QueryWrapper
<
SpmkApprovalG
>().
lambda
()
.
ne
(
spmkApprovalG
.
getId
()
!=
null
,
SpmkApprovalG:
:
getId
,
spmkApprovalG
.
getId
())
...
...
@@ -290,7 +303,7 @@ public class SpmkController {
@DeleteMapping
(
value
=
"/delete_approval_g/{id}"
)
@ApiOperation
(
value
=
"10.删除-审批组"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批组"
)
@ApiOperationSupport
(
order
=
10
)
public
Result
<
Object
>
deleteAgById
(
@PathVariable
int
id
){
public
Result
<
Object
>
deleteAgById
(
@PathVariable
int
id
)
{
// if (spmkCustomApprovalMapper.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda().eq(SpmkCustomApproval::getApprovalGId, id)) > 0 )
// return ResultUtil.error("审批组存在 自定义审批,不可直接删除!");
...
...
@@ -306,7 +319,7 @@ public class SpmkController {
@GetMapping
(
value
=
"/all_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-审批管理"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-审批管理"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAgByAdmin
(
@CurrentUser
UserBean
userBean
){
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
));
...
...
@@ -319,10 +332,10 @@ public class SpmkController {
@GetMapping
(
value
=
"/all_approval_g1"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-审批管理"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-审批管理"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAgByAdmin1
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"eaaname"
)
String
eaaname
)
{
public
Result
<
Object
>
selectListAgByAdmin1
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"eaaname"
)
String
eaaname
)
{
List
<
Integer
>
depts
=
zzglBmgwMService
.
empNumupGetDepts
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
());
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCaByAdmin1
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
,
eaaname
));
return
ResultUtil
.
data
(
spmkApprovalGMapper
.
selectListAgInCaByAdmin1
(
userBean
.
getOrgCode
(),
userBean
.
getEmpNum
(),
depts
,
eaaname
));
}
...
...
@@ -332,7 +345,7 @@ public class SpmkController {
@GetMapping
(
value
=
"/list_approval_g"
)
@ApiOperation
(
value
=
"11.查询列表-审批组-个人审批"
,
httpMethod
=
"GET"
,
notes
=
"查询列表-审批组-个人审批"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
Object
>
selectListAg
(
@CurrentUser
UserBean
userBean
){
public
Result
<
Object
>
selectListAg
(
@CurrentUser
UserBean
userBean
)
{
List
<
SpmkApprovalG
>
spmkApprovalGS
=
spmkService
.
selectListAg
(
userBean
);
return
ResultUtil
.
data
(
spmkService
.
selectListAg
(
userBean
));
}
...
...
@@ -343,7 +356,7 @@ public class SpmkController {
@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
){
public
Result
<
Object
>
ranksAg
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkApprovalG
>
list
)
{
if
(
list
==
null
||
list
.
size
()
<=
0
)
{
return
ResultUtil
.
success
();
...
...
@@ -361,11 +374,11 @@ public class SpmkController {
@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
{
public
Result
<
Object
>
saveCa
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkCustomApprovalDto
spmkCustomApprovalDto
)
throws
Exception
{
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
build
();
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
BeanUtil
.
copyProperties
(
spmkCustomApprovalDto
,
ca
,
"froms"
,
"router"
,
"initiatorConfigs"
);
if
(
ca
.
selectCount
(
new
QueryWrapper
<
SpmkCustomApproval
>().
lambda
()
.
ne
(
ca
.
getId
()
!=
null
,
SpmkCustomApproval:
:
getId
,
ca
.
getId
())
...
...
@@ -418,13 +431,14 @@ public class SpmkController {
/**
* 删除-自定义审批
*
* @throws Exception
*/
@DeleteMapping
(
value
=
"/delete_custom_approval/{id}"
)
@ApiOperation
(
value
=
"14.删除-自定义审批"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-自定义审批"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ApiOperationSupport
(
order
=
14
)
public
Result
<
Object
>
deleteCaById
(
@PathVariable
int
id
)
throws
Exception
{
public
Result
<
Object
>
deleteCaById
(
@PathVariable
int
id
)
throws
Exception
{
SpmkInitiatorConfig
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
if
(!
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
deleteById
())
{
...
...
@@ -440,14 +454,14 @@ public class SpmkController {
@GetMapping
(
value
=
"/select_custom_approval/{id}"
)
@ApiOperation
(
value
=
"15.id查询-自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"id查询-自定义审批"
)
@ApiOperationSupport
(
order
=
15
)
public
Result
<
Object
>
selectCaById
(
@PathVariable
int
id
){
public
Result
<
Object
>
selectCaById
(
@PathVariable
int
id
)
{
SpmkCustomApproval
ca
=
SpmkCustomApproval
.
builder
().
id
(
id
).
build
().
selectById
();
List
<
SpmkInitiatorConfig
>
listIc
=
SpmkInitiatorConfig
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
SpmkInitiatorConfig
>().
lambda
().
eq
(
SpmkInitiatorConfig:
:
getCustomApprovalId
,
id
));
SpmkCustomApprovalDto
caD
=
SpmkCustomApprovalDto
.
builder
()
.
froms
(
ObjectUtil
.
deserialize
(
ca
.
getFroms
()))
.
router
(
ObjectUtil
.
deserialize
(
ca
.
getRouter
()))
.
build
();
BeanUtil
.
copyProperties
(
ca
,
caD
,
"froms"
,
"router"
);
BeanUtil
.
copyProperties
(
ca
,
caD
,
"froms"
,
"router"
);
caD
.
setInitiatorConfigs
(
listIc
);
return
ResultUtil
.
data
(
caD
);
}
...
...
@@ -458,7 +472,7 @@ public class SpmkController {
@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
){
public
Result
<
Object
>
ranksCa
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
)
{
if
(
list
==
null
||
(
list
!=
null
&&
list
.
size
()
<=
0
))
{
return
ResultUtil
.
success
();
...
...
@@ -476,7 +490,7 @@ public class SpmkController {
@PutMapping
(
value
=
"/test_spmk"
)
@ApiOperation
(
value
=
"16.测试"
,
httpMethod
=
"PUT"
,
notes
=
"排序-自定义审批"
)
@ApiOperationSupport
(
order
=
16
)
public
Result
<
Object
>
test222
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
){
public
Result
<
Object
>
test222
(
@Validated
({
Ranks
.
class
})
@RequestBody
ValidList
<
SpmkCustomApproval
>
list
)
{
Set
<
Integer
>
lanzi
=
new
HashSet
<
Integer
>();
//所有部门岗位
...
...
@@ -493,11 +507,11 @@ public class SpmkController {
}
//遍历
public
static
Set
<
Integer
>
empNumupdept2
(
Set
<
Integer
>
lanzi
,
List
<
ZzglBmgwM
>
bmgws
,
Integer
getId
)
{
public
static
Set
<
Integer
>
empNumupdept2
(
Set
<
Integer
>
lanzi
,
List
<
ZzglBmgwM
>
bmgws
,
Integer
getId
)
{
for
(
ZzglBmgwM
z
:
bmgws
)
{
if
(
getId
.
equals
(
z
.
getId
()))
{
lanzi
.
add
(
getId
);
if
(
z
.
getUpId
()
==
null
||
z
.
getUpId
()
==
0
)
{
if
(
z
.
getUpId
()
==
null
||
z
.
getUpId
()
==
0
)
{
return
lanzi
;
}
getId
=
z
.
getUpId
();
...
...
@@ -508,8 +522,10 @@ public class SpmkController {
}
// TODO 审批汇总(发起审批)
/**
* 发起审批
*
* @throws Exception
*/
@PostMapping
(
value
=
"/start_approval"
)
...
...
@@ -517,10 +533,10 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
17
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Log
(
title
=
"审批-发起审批"
,
businessType
=
BusinessType
.
INSERT
)
public
Result
<
Object
>
saveA
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
public
Result
<
Object
>
saveA
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveSummaryDto
spmkApproveSummaryDto
)
throws
Exception
{
YgglMainEmp
ygglMainEmp
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>()
.
lambda
()
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
.
select
(
YgglMainEmp:
:
getHeadUrl
,
YgglMainEmp:
:
getName
)
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
);
...
...
@@ -532,8 +548,7 @@ public class SpmkController {
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
List
<
Router
>
routers
=
router
.
getChildren
();
// routers = RouterUtils.clearRouters(routers);
if
(
routers
==
null
){
if
(
routers
==
null
)
{
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
if
(
CollectionUtil
.
isNotEmpty
(
routers
))
{
...
...
@@ -556,7 +571,7 @@ public class SpmkController {
// if(!hasAudit){
// return ResultUtil.error("请选择审批人!");
// }
}
else
{
}
else
{
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
...
...
@@ -570,17 +585,17 @@ public class SpmkController {
.
set
(
"id"
,
userBean
.
getEmpNum
());
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
if
(
listFlowChildren
.
isEmpty
())
{
if
(
listFlowChildren
.
isEmpty
())
{
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
List
<
FlowChildren
>
listFlowChildren1
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren
);
List
<
String
>
uidlist
=
new
ArrayList
<>();
int
i
=
0
;
int
i
=
0
;
int
fsize
=
listFlowChildren
.
size
();
int
f
=
0
;
//listFlowChildren删除次数
for
(
FlowChildren
flowChildrenItem:
listFlowChildren
)
{
int
f
=
0
;
//listFlowChildren删除次数
for
(
FlowChildren
flowChildrenItem
:
listFlowChildren
)
{
if
(
"audit"
.
equals
(
flowChildrenItem
.
getClassName
()))
{
boolean
hasAudit
=
false
;
...
...
@@ -588,29 +603,29 @@ public class SpmkController {
if
(
relation
.
getUsers
().
size
()
>
0
)
{
hasAudit
=
true
;
//审批人去重
if
(
relation
.
getUsers
().
size
()
>
1
){
int
j
=
0
;
int
usize
=
relation
.
getUsers
().
size
();
//
int
r
=
0
;
//user list删除次数
for
(
User
user
:
relation
.
getUsers
()
if
(
relation
.
getUsers
().
size
()
>
1
)
{
int
j
=
0
;
int
usize
=
relation
.
getUsers
().
size
();
//
int
r
=
0
;
//user list删除次数
for
(
User
user
:
relation
.
getUsers
()
)
{
if
(!
uidlist
.
contains
(
user
.
getId
()))
{
uidlist
.
add
(
user
.
getId
());
}
else
{
listFlowChildren1
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
remove
(
j
-
r
);
}
else
{
listFlowChildren1
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
remove
(
j
-
r
);
r
++;
}
j
++;
}
if
(
usize
==
r
)
{
listFlowChildren1
.
remove
(
i
-
f
);
if
(
usize
==
r
)
{
listFlowChildren1
.
remove
(
i
-
f
);
f
++;
}
}
else
{
}
else
{
if
(!
uidlist
.
contains
(
relation
.
getUsers
().
get
(
0
).
getId
()))
{
uidlist
.
add
(
relation
.
getUsers
().
get
(
0
).
getId
());
}
else
{
listFlowChildren1
.
remove
(
i
-
f
);
}
else
{
listFlowChildren1
.
remove
(
i
-
f
);
f
++;
}
}
...
...
@@ -648,6 +663,7 @@ public class SpmkController {
.
orgCode
(
userBean
.
getOrgCode
())
.
empNum
(
userBean
.
getEmpNum
())
.
title
(
spmkApproveSummaryDto
.
getTitle
())
.
digest
(
spmkApproveSummaryDto
.
getDigest
())
.
initiator
(
spmkApproveSummaryDto
.
getInitiator
())
.
approveName
(
spmkApproveSummaryDto
.
getApproveName
())
.
assoType
(
spmkApproveSummaryDto
.
getAssoType
())
...
...
@@ -672,7 +688,7 @@ public class SpmkController {
adm
.
setFlowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
());
try
{
spmkApproveDetailSummaryMapper
.
insert
(
adm
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
CustomException
(
"审批详情-新增异常"
);
}
...
...
@@ -680,8 +696,10 @@ public class SpmkController {
}
//TODO 审批汇总
/**
* 审批汇总
*
* @param summaryQueryDto
* @return
* @throws
...
...
@@ -719,6 +737,7 @@ public class SpmkController {
}
//TODO 审批详情
/**
* 审批详情
*/
...
...
@@ -726,14 +745,28 @@ public class SpmkController {
@ApiOperation
(
value
=
"19.审批详情"
,
httpMethod
=
"GET"
,
notes
=
"审批详情"
)
@ApiOperationSupport
(
order
=
19
)
@Log
(
title
=
"审批-审批详情"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
public
Result
<
Object
>
selectAd
(
@CurrentUser
UserBean
userBean
,
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
,
userBean
.
getEmpNum
());
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
return
ResultUtil
.
data
(
adD
);
}
/**
* 审批详情
*/
@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 审批人审批
/**
* 审批人审批
*/
...
...
@@ -743,19 +776,36 @@ public class SpmkController {
@ApiOperationSupport
(
order
=
20
)
@Log
(
title
=
"审批-审批流程"
,
businessType
=
BusinessType
.
UPDATE
)
// @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
{
/*判断是否有权限转派*/
if
(
approvingDto
.
getSts
()
==
4
)
{
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
,
"/Approvalspbutonspbuton020102"
));
if
(
zzglAuth
==
null
)
{
return
ResultUtil
.
error
(
"您没有转派权限"
);
}
}
}
}
Integer
asId
=
approvingDto
.
getAsId
();
//查询redis中当前有没有在被审批执行中,0是没有在执行,1是在执行
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
if
(
approStatus
==
1
)
{
Integer
approStatus
=
Integer
.
parseInt
(
redisUtil
.
get
(
asId
.
toString
())
==
null
?
"0"
:
redisUtil
.
get
(
asId
.
toString
()).
toString
());
if
(
approStatus
==
1
)
{
return
ResultUtil
.
error
(
"该审批已在审批中!"
);
}
else
{
redisUtil
.
set
(
asId
.
toString
(),
1
,
5000
);
}
else
{
redisUtil
.
set
(
asId
.
toString
(),
1
,
2
);
}
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
()
.
select
(
SpmkApproveDetailSummary:
:
getId
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getFroms
,
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
...
...
@@ -765,7 +815,7 @@ public class SpmkController {
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
if
(
aSummary
.
getSts
()
>
ApproveSummarySts
.
IN
.
ordinal
())
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"该审批已结束!"
);
}
...
...
@@ -775,11 +825,11 @@ public class SpmkController {
.
eq
(
SpmkExecutor:
:
getSts
,
ExecutorSts
.
IN_EXECUTION
.
ordinal
()));
if
(
count
==
0
)
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"您已审批过!"
);
}
if
(
spmkExecutorMapper
.
selectCount
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
()
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
)
{
...
...
@@ -787,18 +837,18 @@ public class SpmkController {
Integer
adminNum
=
new
LambdaQueryChainWrapper
<
QyzxEmpEntAsso
>(
qyzxEmpEntAssoMapper
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
SysRoleType
.
U_TYPE_ADMIN
,
SysRoleType
.
U_TYPE_C_ADMIN
)
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
SysRoleType
.
U_TYPE_ADMIN
,
SysRoleType
.
U_TYPE_C_ADMIN
)
.
count
();
if
(
adminNum
<=
0
)
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"非当前审批人 或 管理员,无法操作!"
);
}
}
if
(
aSummary
.
getSts
()
==
0
)
{
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
List
<
FlowChildren
>
listFlowChildren
=
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
);
// 审批逻辑
RouterUtils
.
approving
(
listFlowChildren
,
...
...
@@ -809,46 +859,54 @@ public class SpmkController {
approvingDto
.
getSts
(),
approvingDto
.
getUser
(),
approvingDto
.
getSignatureImg
(),
userBean
.
getEmpNum
()
userBean
.
getEmpNum
(),
approvingDto
.
getUserList
()
);
// 更新 flowChildren
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
SpmkApproveDetailSummary
sadsUpdate
=
SpmkApproveDetailSummary
.
builder
().
id
(
ad
.
getId
()).
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
();
// 审批详情 审批时添加 附件
if
(
RequestDataUtils
.
addFileList
(
ad
,
approvingDto
.
getFileList
()))
{
sadsUpdate
.
setRequestData
(
ad
.
getRequestData
());
}
sadsUpdate
.
updateById
();
//最后一条数据
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
if
(
fc
.
getExecute
()
==
"2"
)
{
// 查询 SpmkApproveSummary 状态
aSummary
=
spmkApproveSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
()
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
.
select
(
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getAssoType
)
.
eq
(
SpmkApproveSummary:
:
getId
,
asId
));
if
(
aSummary
.
getSts
()
!=
ApproveSummarySts
.
REFUSE
.
ordinal
())
{
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
FINISH
.
ordinal
()).
build
().
updateById
();
JSONObject
jSONObject
=
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
);
JSONObject
jSONObject
=
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
);
jSONObject
.
set
(
"approveId"
,
FromData
.
builder
().
value
(
String
.
valueOf
(
asId
)).
build
());
jSONObject
.
set
(
"orgCode"
,
userBean
.
getOrgCode
());
//审批完成后 业务
SpmkAssoBusiness
sab
=
spmkAssoBusinessFactory
.
createSpmkService
(
ApproveEnum
.
getEnums
(
aSummary
.
getAssoType
()));
if
(
sab
!=
null
)
Logoutput
(
"1----------"
+
sab
);
Logoutput
(
"2----------"
+
jSONObject
);
Logoutput
(
"1----------"
+
sab
);
Logoutput
(
"2----------"
+
jSONObject
);
sab
.
handleApprove
(
jSONObject
);
}
}
}
else
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
}
else
{
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
error
(
"该审批已结束!"
);
}
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
redisUtil
.
set
(
asId
.
toString
(),
0
,
500
);
return
ResultUtil
.
success
();
}
@Autowired
private
PunchRecordMapper
punchrecordmapper
;
//TODO 我发起的/我审批的/抄送我的
/**
* 查询列表-我发起的/我审批的/抄送我的-分页
*/
...
...
@@ -856,17 +914,17 @@ public class SpmkController {
@ApiOperation
(
value
=
"21.查询列表-我发起的/我审批的/抄送我的-分页"
,
httpMethod
=
"POST"
,
notes
=
"查询列表-我审批的-关键字、审批状态、发起时间-分页"
)
@ApiOperationSupport
(
order
=
21
)
@Log
(
title
=
"审批-我发起的/我审批的/抄送我的"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
selectMyAs
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
)
throws
MethodArgumentNotValidException
{
public
Result
<
Object
>
selectMyAs
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mySummaryQueryDto
)
throws
MethodArgumentNotValidException
{
IPage
<
SpmkApproveSummary
>
page
=
new
Page
<
SpmkApproveSummary
>(
mySummaryQueryDto
.
getCurrentPage
()
==
null
?
1
:
mySummaryQueryDto
.
getCurrentPage
(),
mySummaryQueryDto
.
getTotalPage
()
==
null
?
10
:
mySummaryQueryDto
.
getTotalPage
());
mySummaryQueryDto
.
setOrgCode
(
userBean
.
getOrgCode
());
mySummaryQueryDto
.
setEmpNum
(
userBean
.
getEmpNum
());
if
(
mySummaryQueryDto
.
getSts
()
==
null
)
{
if
(
mySummaryQueryDto
.
getSts
()
==
null
)
{
mySummaryQueryDto
.
setSts
(
0
);
}
//我发起的
if
(
mySummaryQueryDto
.
getType
()
==
0
)
{
if
(
mySummaryQueryDto
.
getType
()
==
0
)
{
// mySummaryQueryDto.setSts(null);
}
// 缺-部门id 搜索
...
...
@@ -874,40 +932,52 @@ public class SpmkController {
List
<
SpmkApproveSummary
>
listAs
=
pageAs
.
getRecords
();
for
(
SpmkApproveSummary
sp
:
listAs
)
{
for
(
SpmkApproveSummary
sp
:
listAs
)
{
String
requerstr
=
""
;
try
{
SpmkApproveDetailSummary
ad
=
spmkApproveDetailSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
sp
.
getId
()));
SpmkApproveDetailSummary
ad
=
spmkApproveDetailSummaryMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>().
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
sp
.
getId
())
.
last
(
"limit 1"
)
);
JSONObject
as
=
jsonObject
.
parseObject
(
ad
.
getRequestData
().
toString
(),
JSONObject
.
class
);
JSONObject
as
=
jsonObject
.
parseObject
(
ad
.
getRequestData
().
toString
(),
JSONObject
.
class
);
// Logoutput(as);
// Logoutput(sp.getId()+"==========================================="+sp.getAssoType());
requerstr
=
""
;
//assoType : 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡
switch
(
sp
.
getAssoType
())
{
case
1
:
requerstr
=
"转正时间:"
+
as
.
getJSONObject
(
"__newConfirmationTime"
).
getStr
(
"value"
);
break
;
case
2
:
requerstr
=
"离职时间:"
+
as
.
getJSONObject
(
"__terminationDate"
).
getStr
(
"value"
);
break
;
case
1
:
requerstr
=
"转正时间:"
+
as
.
getJSONObject
(
"__newConfirmationTime"
).
getStr
(
"value"
);
break
;
case
2
:
requerstr
=
"离职时间:"
+
as
.
getJSONObject
(
"__terminationDate"
).
getStr
(
"value"
);
break
;
case
3
:
String
namepos
=
""
;
PunchRecord
pu
=
punchrecordmapper
.
organizationalStructure
(
Integer
.
valueOf
(
as
.
getJSONObject
(
"__TransferInDepartment"
).
getStr
(
"value"
)));
if
(
pu
!=
null
)
{
if
(
pu
!=
null
)
{
namepos
=
pu
.
getPost
();
}
requerstr
=
"调入岗位:"
+
namepos
;
requerstr
=
"调入岗位:"
+
namepos
;
break
;
case
5
:
requerstr
=
"加班时长:"
+
as
.
getJSONObject
(
"__timeLong"
).
getStr
(
"value"
)
+
"(小时)"
;
break
;
case
5
:
requerstr
=
"加班时长:"
+
as
.
getJSONObject
(
"__timeLong"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
case
6
:
String
name
=
""
;
KqglAssoLeaveRules
rul
=
KqglAssoLeaveRules
.
builder
().
build
().
selectById
(
as
.
getJSONObject
(
"__LeaveType"
).
getStr
(
"value"
));
if
(
rul
!=
null
)
{
if
(
rul
!=
null
)
{
name
=
rul
.
getName
();
}
requerstr
=
"请假类型:"
+
name
;
requerstr
=
"请假类型:"
+
name
;
break
;
case
7
:
requerstr
=
"出差时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)
+
"(小时)"
;
break
;
case
8
:
requerstr
=
"外出时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)
+
"(小时)"
;
break
;
case
9
:
requerstr
=
"补卡时间:"
+
as
.
getJSONObject
(
"__PatchCardTime"
).
getStr
(
"value"
);
break
;
case
7
:
requerstr
=
"出差时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
case
8
:
requerstr
=
"外出时长:"
+
as
.
getJSONObject
(
"__longTime"
).
getStr
(
"value"
)+
"(小时)"
;
break
;
case
9
:
requerstr
=
"补卡时间:"
+
as
.
getJSONObject
(
"__PatchCardTime"
).
getStr
(
"value"
);
break
;
default
:
break
;
}
...
...
@@ -915,13 +985,17 @@ public class SpmkController {
e
.
printStackTrace
();
}
// Logoutput(requerstr);
sp
.
setDigest
(
requerstr
);
/*if(!StringUtils.isEmpty(sp.getDigest())){
requerstr = requerstr+" "+sp.getDigest();
}
sp.setDigest(requerstr);*/
}
return
ResultUtil
.
data
(
pageAs
,
listAs
);
}
//TODO 撤销审批
/**
* 撤销审批
*/
...
...
@@ -948,7 +1022,7 @@ public class SpmkController {
@ApiOperation
(
value
=
"23.删除-审批(发起的审批)-根据审批汇总id"
,
httpMethod
=
"DELETE"
,
notes
=
"删除-审批(发起的审批)-根据审批汇总id"
)
@ApiOperationSupport
(
order
=
23
)
@Log
(
title
=
"审批-删除审批"
,
businessType
=
BusinessType
.
DELETE
)
public
Result
<
Object
>
deleteApprovalData
(
@PathVariable
Integer
id
){
public
Result
<
Object
>
deleteApprovalData
(
@PathVariable
Integer
id
)
{
/*
List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectList(new QueryWrapper<SpmkApproveExecuteRecord>()
.lambda()
...
...
@@ -977,7 +1051,7 @@ public class SpmkController {
@DeleteMapping
(
value
=
"/delete_approval_data"
)
@ApiOperation
(
value
=
"90.(开发使用)删除-审批数据"
,
httpMethod
=
"DELETE"
,
notes
=
"审批组、自定义审批、审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据"
)
@ApiOperationSupport
(
order
=
90
)
public
Result
<
Object
>
deleteApprovalData
(
@CurrentUser
UserBean
userBean
){
public
Result
<
Object
>
deleteApprovalData
(
@CurrentUser
UserBean
userBean
)
{
spmkApprovalGMapper
.
delete
(
null
);
spmkCustomApprovalMapper
.
delete
(
null
);
spmkApproveSummaryMapper
.
delete
(
null
);
...
...
@@ -992,24 +1066,24 @@ public class SpmkController {
@GetMapping
(
value
=
"/icon"
)
@ApiOperation
(
value
=
"99.图标列表"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperationSupport
(
order
=
99
)
public
Result
<
List
<
SpmkIcon
>>
selectListIcon
(
@CurrentUser
UserBean
userBean
){
public
Result
<
List
<
SpmkIcon
>>
selectListIcon
(
@CurrentUser
UserBean
userBean
)
{
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
return
ResultUtil
.
data
(
spmkIcons
,
"获取图标列表成功"
);
return
ResultUtil
.
data
(
spmkIcons
,
"获取图标列表成功"
);
}
//TODO 测试-生成 审批组 和 自定义审批
@GetMapping
(
value
=
"/test"
)
@ApiOperation
(
value
=
"98.测试-生成 审批组 和 自定义审批"
,
httpMethod
=
"GET"
,
notes
=
"测试-生成 审批组 和 自定义审批"
)
@ApiOperationSupport
(
order
=
98
)
public
Result
<
List
<
SpmkIcon
>>
createCustomApproval
(
@RequestParam
Integer
orgCode
){
public
Result
<
List
<
SpmkIcon
>>
createCustomApproval
(
@RequestParam
Integer
orgCode
)
{
spmkService
.
createCustomApproval
(
orgCode
);
List
<
SpmkIcon
>
spmkIcons
=
SpmkIcon
.
builder
().
build
().
selectAll
();
return
ResultUtil
.
data
(
spmkIcons
,
"生成 审批组 和 自定义审批成功"
);
return
ResultUtil
.
data
(
spmkIcons
,
"生成 审批组 和 自定义审批成功"
);
}
@GetMapping
(
value
=
"/verification_staff"
)
...
...
@@ -1018,7 +1092,7 @@ public class SpmkController {
String
msg
=
""
;
YgglMainEmp
ygem
=
YgglMainEmp
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
YgglMainEmp
>().
lambda
().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
YgglMainEmp:
:
getEmpNum
,
userBean
.
getEmpNum
()));
if
(
ygem
.
getJobStatus
()
==
1
)
{
if
(
ygem
.
getJobStatus
()
==
1
)
{
msg
=
"正式员工不能发起转正审批"
;
}
...
...
@@ -1027,7 +1101,7 @@ public class SpmkController {
@PostMapping
(
value
=
"/approved_quantity"
)
@ApiOperation
(
value
=
"APP-我发起的/我审批的/抄送我的-数量"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
Result
<
Object
>
ApprovedQuantity
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mysummaryquerydto
){
public
Result
<
Object
>
ApprovedQuantity
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
MySummaryQueryDto
mysummaryquerydto
)
{
ApprovedQuantityDto
qna
=
ApprovedQuantityDto
.
builder
().
build
();
...
...
@@ -1038,22 +1112,22 @@ public class SpmkController {
mysummaryquerydto
.
setEmpNum
(
userBean
.
getEmpNum
());
mysummaryquerydto
.
setSts
(
5
);
//状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝 4:(2/3) 5:全部
int
istartedit
=
0
,
ccme
=
0
,
iapprovedit
=
0
;
int
istartedit
=
0
,
ccme
=
0
,
iapprovedit
=
0
;
mysummaryquerydto
.
setType
(
0
);
//我发起的
List
<
SpmkApproveSummary
>
istartedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
if
(
istartedit_
.
size
()
>
0
)
{
if
(
istartedit_
.
size
()
>
0
)
{
istartedit
=
istartedit_
.
size
();
}
mysummaryquerydto
.
setType
(
1
);
//抄送我的
List
<
SpmkApproveSummary
>
ccme_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
if
(
ccme_
.
size
()
>
0
)
{
if
(
ccme_
.
size
()
>
0
)
{
ccme
=
ccme_
.
size
();
}
mysummaryquerydto
.
setType
(
2
);
//我审批的
List
<
SpmkApproveSummary
>
iapprovedit_
=
spmkApproveSummaryMapper
.
selectPageByQueryForEmpNum
(
mysummaryquerydto
);
if
(
iapprovedit_
.
size
()
>
0
)
{
if
(
iapprovedit_
.
size
()
>
0
)
{
iapprovedit
=
iapprovedit_
.
size
();
}
...
...
@@ -1070,10 +1144,10 @@ public class SpmkController {
public
void
Logoutput
(
String
science
)
{
if
(!(
"pro"
).
equals
(
environmental_science
))
{
if
(!(
"pro"
).
equals
(
environmental_science
))
{
System
.
out
.
println
(
science
);
}
else
{
}
else
{
System
.
out
.
println
(
""
);
}
...
...
@@ -1084,7 +1158,626 @@ public class SpmkController {
*/
@PostMapping
(
value
=
"/approved_addDetail"
)
@ApiOperation
(
value
=
"A审核详情数据转换"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
String
addApproveDetail
(){
public
String
addApproveDetail
()
{
return
spmkService
.
addApproveDetail
();
}
/**
* 判断人员是否一致
*
* @param olist
* @param list
* @return
*/
private
boolean
isTrue
(
List
<
Router
>
olist
,
List
<
Router
>
list
)
{
if
(
olist
.
size
()
==
0
&&
list
.
size
()
==
0
)
{
return
false
;
}
else
if
(
olist
.
size
()
!=
list
.
size
())
{
return
true
;
}
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
());
}
}
else
if
(
list
.
get
(
0
).
getClassName
().
equals
(
"copy"
)
&&
list
.
get
(
0
).
getName
().
equals
(
"抄送人"
))
{
return
false
;
}
return
false
;
}
/**
* 更新审批流程通过节点
*
* @param userBean
* @param spmkApproveDetailDto
* @return
*/
@PostMapping
(
value
=
"/updateFlowChildren"
)
@ApiOperation
(
value
=
"更新审批流程通过节点"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
Result
<
Object
>
updateFlowChildren
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveDetailDto
spmkApproveDetailDto
)
{
try
{
SpmkApproveDetailSummary
spmkApproveDetailSummary
=
SpmkApproveDetailSummary
.
builder
().
id
(
spmkApproveDetailDto
.
getId
()).
build
().
selectById
();
List
<
FlowChildren
>
listFlowChildren
=
spmkApproveDetailDto
.
getFlowChildren
();
//只有添加审批人才会有值
if
(
spmkApproveDetailDto
.
getIndex
()
!=
null
&&
spmkApproveDetailDto
.
getUserIndex
()
!=
null
)
{
//如果当前索引下的都要变更为0未执行
int
currentIndex
=
spmkApproveDetailDto
.
getIndex
();
for
(
int
i
=
currentIndex
+
1
;
i
<
listFlowChildren
.
size
();
i
++)
{
if
(
i
==
currentIndex
+
1
)
{
if
(!
listFlowChildren
.
get
(
currentIndex
).
getExecute
().
equals
(
"1"
)
&&
!
listFlowChildren
.
get
(
currentIndex
).
getExecute
().
equals
(
"0"
))
{
//如果当前索引下的都要变更为0未执行
FlowChildren
flowChildren
=
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
());
User
user
=
flowChildren
.
getRelation
().
get
(
0
).
getUsers
().
get
(
spmkApproveDetailDto
.
getUserIndex
());
SpmkApproveExecuteRecord
spmkApproveExecuteRecord
=
spmkApproveExecuteRecordMapper
.
selectExecuteRecordById
(
Integer
.
parseInt
(
user
.
getId
()),
spmkApproveDetailSummary
.
getApproveSummaryId
());
//删除审批过的人记录
if
(
spmkApproveExecuteRecord
!=
null
)
{
spmkApproveExecuteRecordMapper
.
delExecuteRecord
(
spmkApproveExecuteRecord
.
getId
(),
spmkApproveDetailSummary
.
getApproveSummaryId
());
}
listFlowChildren
.
get
(
i
).
setExecute
(
"1"
);
listFlowChildren
.
get
(
i
).
getRelation
().
forEach
(
v
->
{
v
.
getUsers
().
forEach
(
u
->
{
u
.
setExecute
(
"1"
);
//添加审批记录
SpmkApproveExecuteRecord
spmkApproveExecuteRecord1
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
spmkApproveDetailSummary
.
getApproveSummaryId
())
.
name
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
SpmkEnumInterface
.
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
spmkApproveExecuteRecord1
.
insert
();
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
spmkApproveExecuteRecord1
.
getId
())
.
empNum
(
Integer
.
parseInt
(
u
.
getId
()))
.
operatorHeaderUrl
(
u
.
getHeadUrl
())
.
executorName
(
u
.
getName
())
.
sts
(
1
)
.
build
().
insert
();
SpmkApproveSummary
.
builder
().
currentApprover
(
u
.
getName
()).
id
(
spmkApproveDetailSummary
.
getApproveSummaryId
()).
build
().
updateById
();
});
});
continue
;
}
}
listFlowChildren
.
get
(
i
).
setExecute
(
"0"
);
listFlowChildren
.
get
(
i
).
getRelation
().
forEach
(
v
->
{
v
.
getUsers
().
forEach
(
u
->
u
.
setExecute
(
"0"
));
});
}
SpmkApproveSummary
.
builder
().
sts
(
0
).
id
(
spmkApproveDetailSummary
.
getApproveSummaryId
()).
build
().
updateById
();
}
// 更新 flowChildren
SpmkApproveDetailSummary
.
builder
().
id
(
spmkApproveDetailDto
.
getId
())
.
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
}
catch
(
Exception
e
)
{
return
ResultUtil
.
error
(
e
);
}
SpmkApproveDetailSummary
detailSummary
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getId
,
spmkApproveDetailDto
.
getId
()));
return
ResultUtil
.
data
(
JSON
.
toJSONString
(
detailSummary
));
}
//移除审批人 1.0
// @Transactional(rollbackFor = Exception.class)
// @PostMapping(value = "/delteApprove")
// @ApiOperation(value = "移除审批人", httpMethod = "POST", notes = "")
// public Result<Object> delteApprove(@CurrentUser UserBean userBean, @Validated @RequestBody SpmkApproveDetailDto spmkApproveDetailDto) {
//// try {
//
// SpmkApproveDetailSummary spmkApproveDetailSummary = SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId()).build().selectById();
// List<FlowChildren> listFlowChildren = spmkApproveDetailDto.getFlowChildren();
// //是否执行到下一个节点
// boolean onlyOne = false;//是否只有一条
// boolean isExecute = false;//是否执行中
// boolean isAbreas = false;//是否并序
// boolean isFinal = false;//是否最终审批人
// boolean isNext = false;//是否轮到下一个节点
// User u;
// //当前节点
// FlowChildren currentChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex());
// List<User> userList = currentChildren.getRelation().get(0).getUsers();
// User currentUser = userList.get(spmkApproveDetailDto.getUserIndex());
// //只有添加审批人才会有值
// if (spmkApproveDetailDto.getIndex() != null && spmkApproveDetailDto.getUserIndex() != null) {
// if (currentChildren.getClassName().equals("audit")) {
// //如果是并序
// if ("1".equals(currentChildren.getRelation().get(0).getApprovalOrder())) {
// isAbreas = true;
// }
// //如果只有一个人
// if (userList.size() == 1) {
// onlyOne = true;
// isNext=true;
// }
// if (currentChildren.getExecute().equals("1")) {
// isExecute = true;
// if (userList.get(spmkApproveDetailDto.getUserIndex()).getExecute().equals("1")) {
// //如果是最后一个
// if (userList.size() - 1 == spmkApproveDetailDto.getUserIndex() && !isAbreas) {
// isNext = true;
// }
// //出了自己其他人都审批过了
// if (isAbreas) {
// int num = currentChildren.getRelation().get(0).getUsers().stream().filter(v -> v.getExecute().equals("1") && v.getId() != currentUser.getId()).collect(Collectors.toList()).size();
// if (num == 0) {
// isNext = true;
// }
// }
// } else {
// isExecute = false;
// }
// }
// //是否最终审批人
// if (spmkApproveDetailDto.getIndex() == listFlowChildren.size() - 1) {
// if (isNext || onlyOne) {
// isFinal = true;
// }
// } else if (!listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getClassName().equals("audit")) {
// isFinal = true;
// }
//
// SpmkApproveExecuteRecord spmkApproveExecuteRecord = spmkApproveExecuteRecordMapper.selectExecuteRecordById(Integer.parseInt(currentUser.getId()), spmkApproveDetailSummary.getApproveSummaryId());
// //删除审批过的人记录
// if (spmkApproveExecuteRecord != null) {
// if (onlyOne) {
// spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
// } else {
// List<SpmkExecutor> spmkExecutorsList=SpmkExecutor.builder().build().selectList(new LambdaQueryWrapper<SpmkExecutor>()
// .eq(SpmkExecutor::getApproveExecuteRecordId,spmkApproveExecuteRecord.getId()));
// if(spmkExecutorsList.size()>0&&spmkExecutorsList.size()==1){
// spmkApproveExecuteRecordMapper.delExecuteRecordByRecordIds(spmkApproveExecuteRecord.getId(), Integer.parseInt(currentUser.getId()));
// }else{
// spmkExecutorsList.stream().filter(v->v.getEmpNum()==Integer.parseInt(currentUser.getId())).collect(Collectors.toList()).get(0).deleteById();
// }
// }
// }
// if (isExecute && !isFinal) {
// if (!isAbreas) {
// if (isNext) {
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0).setExecute("1");
// //并序
// u = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().get(0);
// } else {
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1).setExecute("1");
// u = listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().get(spmkApproveDetailDto.getUserIndex() + 1);
// }
//
// if (onlyOne || isNext) {
// spmkApproveExecuteRecord = SpmkApproveExecuteRecord
// .builder()
// .approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
// .name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
// .type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
// .sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
// .build();
// spmkApproveExecuteRecord.insert();
// }
// SpmkExecutor.builder()
// .approveExecuteRecordId(spmkApproveExecuteRecord.getId())
// .empNum(Integer.parseInt(u.getId()))
// .operatorHeaderUrl(u.getHeadUrl())
// .executorName(u.getName())
// .sts(1)
// .build().insert();
// SpmkApproveSummary.builder().currentApprover(u.getName()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
// } else {
// //并序
// if (isNext) {
// FlowChildren nextFlowChildren = listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1);
// if (nextFlowChildren.getRelation().get(0).getApprovalOrder().equals("1")) {
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).setExecute("1");
// listFlowChildren.get(spmkApproveDetailDto.getIndex() + 1).getRelation().get(0).getUsers().forEach(v -> {
// v.setExecute("1");
// SpmkApproveExecuteRecord spmkApproveExecuteRecord1 = SpmkApproveExecuteRecord
// .builder()
// .approveSummaryId(spmkApproveDetailSummary.getApproveSummaryId())
// .name(SpmkEnumInterface.ParticipatorType.APPROVER.getName())
// .type(SpmkEnumInterface.ParticipatorType.APPROVER.ordinal())
// .sts(SpmkEnumInterface.ExecuteRecordSts.IN_EXECUTION.ordinal())
// .build();
// spmkApproveExecuteRecord1.insert();
// SpmkExecutor.builder()
// .approveExecuteRecordId(spmkApproveExecuteRecord1.getId())
// .empNum(Integer.parseInt(v.getId()))
// .operatorHeaderUrl(v.getHeadUrl())
// .executorName(v.getName())
// .sts(1)
// .build().insert();
// });
// SpmkApproveSummary.builder().currentApprover(nextFlowChildren.getRelation().get(0).getUsers().get(0).getName()).id(spmkApproveDetailSummary.getApproveSummaryId()).build().updateById();
// }
// }
// }
// }
//
//
// if (isExecute && isFinal) {
// SpmkApproveSummary.builder().id(spmkApproveDetailSummary.getApproveSummaryId()).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
// }
//
// if (onlyOne) {
// listFlowChildren.removeIf(f -> f == currentChildren);
// } else {
// listFlowChildren.get(spmkApproveDetailDto.getIndex()).getRelation().get(0).getUsers().removeIf(user -> user == currentUser);
// }
// }
// }
// // 更新 flowChildren
// SpmkApproveDetailSummary.builder().id(spmkApproveDetailDto.getId())
// .flowChildren(JSONArray.fromObject(listFlowChildren).toString()).build().updateById();
//// } catch (Exception e) {
//// return ResultUtil.error(e);
//// }
//
// SpmkApproveDetailSummary detailSummary = SpmkApproveDetailSummary.builder().build().selectOne(new QueryWrapper<SpmkApproveDetailSummary>()
// .lambda().eq(SpmkApproveDetailSummary::getId, spmkApproveDetailDto.getId()));
//
// return ResultUtil.data(JSON.toJSONString(detailSummary));
// }
@Transactional
(
rollbackFor
=
Exception
.
class
)
@PostMapping
(
value
=
"/delteApprove"
)
@ApiOperation
(
value
=
"移除审批人"
,
httpMethod
=
"POST"
,
notes
=
""
)
public
Result
<
Object
>
delteApprove
(
@CurrentUser
UserBean
userBean
,
@Validated
@RequestBody
SpmkApproveDetailDto
spmkApproveDetailDto
)
{
SpmkApproveDetailSummary
spmkApproveDetailSummary
=
SpmkApproveDetailSummary
.
builder
().
id
(
spmkApproveDetailDto
.
getId
()).
build
().
selectById
();
List
<
FlowChildren
>
listFlowChildren
=
spmkApproveDetailDto
.
getFlowChildren
();
FlowChildren
currentFlowChildren
=
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
());
List
<
User
>
currentUserList
=
currentFlowChildren
.
getRelation
().
get
(
0
).
getUsers
();
User
currentUser
=
currentUserList
.
get
(
spmkApproveDetailDto
.
getUserIndex
());
//是否执行到下一个节点
boolean
onlyOne
=
false
;
//是否只有一条
boolean
isExecute
=
false
;
//是否执行中
boolean
isAbreas
=
false
;
//是否并序
boolean
isFinal
=
false
;
//是否最终审批人
boolean
isNext
=
false
;
//是否轮到下一个节点
StringBuffer
buffer
=
new
StringBuffer
();
//新当前审批人的名字
if
(
"1"
.
equals
(
currentFlowChildren
.
getRelation
().
get
(
0
).
getApprovalOrder
()))
{
isAbreas
=
true
;
}
//如果只有一个人
if
(
currentUserList
.
size
()
==
1
)
{
onlyOne
=
true
;
isNext
=
true
;
}
//大节点在执行中
if
(
currentFlowChildren
.
getExecute
().
equals
(
"1"
))
{
//小节点也在执行中
isExecute
=
true
;
if
(
currentUser
.
getExecute
().
equals
(
"1"
))
{
if
(
isAbreas
)
{
if
(
currentUserList
.
stream
().
filter
(
u
->
u
.
getId
()
!=
currentUser
.
getId
()
&&
u
.
getExecute
().
equals
(
"1"
)).
collect
(
Collectors
.
toList
()).
size
()
==
0
)
{
isNext
=
true
;
}
}
else
{
if
(
currentUserList
.
size
()
-
1
==
spmkApproveDetailDto
.
getUserIndex
())
{
isNext
=
true
;
}
}
}
else
{
isExecute
=
false
;
}
}
//如果属于最后一个大节点
if
(
listFlowChildren
.
size
()
-
1
==
spmkApproveDetailDto
.
getIndex
())
{
if
(
isNext
)
{
isFinal
=
true
;
}
else
{
isFinal
=
false
;
}
}
else
if
(
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
getClassName
().
equals
(
"copy"
))
{
isFinal
=
true
;
}
//执行中的人会存在操作记录
SpmkApproveExecuteRecord
spmkApproveExecuteRecord
=
spmkApproveExecuteRecordMapper
.
selectExecuteRecordById
(
Integer
.
parseInt
(
currentUser
.
getId
()),
spmkApproveDetailSummary
.
getApproveSummaryId
());
//删除操作人记录
if
(
spmkApproveExecuteRecord
!=
null
)
{
SpmkExecutor
spmkExecutor
=
SpmkExecutor
.
builder
().
build
().
selectOne
(
new
LambdaQueryWrapper
<
SpmkExecutor
>()
.
eq
(
SpmkExecutor:
:
getApproveExecuteRecordId
,
spmkApproveExecuteRecord
.
getId
()).
eq
(
SpmkExecutor:
:
getEmpNum
,
currentUser
.
getId
()));
if
(
onlyOne
)
{
if
(
spmkExecutor
.
getSts
()!=
4
)
{
spmkApproveExecuteRecordMapper
.
delExecuteRecordByRecordIds
(
spmkApproveExecuteRecord
.
getId
(),
Integer
.
parseInt
(
currentUser
.
getId
()));
}
}
else
{
List
<
SpmkExecutor
>
spmkExecutorsList
=
SpmkExecutor
.
builder
().
build
().
selectList
(
new
LambdaQueryWrapper
<
SpmkExecutor
>()
.
eq
(
SpmkExecutor:
:
getApproveExecuteRecordId
,
spmkApproveExecuteRecord
.
getId
()));
if
(
isAbreas
)
{
//正常的并序是一条对应一个id,转派的是同一个id
if
(
spmkExecutorsList
.
size
()
==
1
)
{
spmkApproveExecuteRecordMapper
.
delExecuteRecordByRecordIds
(
spmkApproveExecuteRecord
.
getId
(),
Integer
.
parseInt
(
currentUser
.
getId
()));
}
}
spmkExecutor
.
deleteById
();
}
}
//当前被移除的人在执行中
if
(
isExecute
)
{
//如果不是最终的就还存在下一个审批节点
if
(!
isFinal
)
{
if
(
isNext
)
{
FlowChildren
nextFlowChildren
=
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
);
//如果下一个节点是并序的
if
(
nextFlowChildren
.
getRelation
().
get
(
0
).
getApprovalOrder
().
equals
(
"1"
))
{
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
setExecute
(
"1"
);
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
getRelation
().
get
(
0
).
getUsers
().
forEach
(
v
->
{
v
.
setExecute
(
"1"
);
SpmkApproveExecuteRecord
spmkApproveExecuteRecord1
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
spmkApproveDetailSummary
.
getApproveSummaryId
())
.
name
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
SpmkEnumInterface
.
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
spmkApproveExecuteRecord1
.
insert
();
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
spmkApproveExecuteRecord1
.
getId
())
.
empNum
(
Integer
.
parseInt
(
v
.
getId
()))
.
operatorHeaderUrl
(
v
.
getHeadUrl
())
.
executorName
(
v
.
getName
())
.
sts
(
1
)
.
build
().
insert
();
buffer
.
append
(
v
.
getName
()
+
","
);
});
buffer
.
deleteCharAt
(
buffer
.
lastIndexOf
(
","
));
}
else
{
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
setExecute
(
"1"
);
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
getRelation
().
get
(
0
).
getUsers
().
get
(
0
).
setExecute
(
"1"
);
User
u
=
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()
+
1
).
getRelation
().
get
(
0
).
getUsers
().
get
(
0
);
SpmkApproveExecuteRecord
spmkApproveExecuteRecord1
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
spmkApproveDetailSummary
.
getApproveSummaryId
())
.
name
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
SpmkEnumInterface
.
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
SpmkEnumInterface
.
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
spmkApproveExecuteRecord1
.
insert
();
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
spmkApproveExecuteRecord1
.
getId
())
.
empNum
(
Integer
.
parseInt
(
u
.
getId
()))
.
operatorHeaderUrl
(
u
.
getHeadUrl
())
.
executorName
(
u
.
getName
())
.
sts
(
1
)
.
build
().
insert
();
buffer
.
append
(
u
.
getName
());
}
}
else
{
if
(!
isAbreas
)
{
//顺序有一个同一个user里面的
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()).
getRelation
().
get
(
0
).
getUsers
().
get
(
spmkApproveDetailDto
.
getUserIndex
()
+
1
).
setExecute
(
"1"
);
User
u
=
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()).
getRelation
().
get
(
0
).
getUsers
().
get
(
spmkApproveDetailDto
.
getUserIndex
()
+
1
);
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
spmkApproveExecuteRecord
.
getId
())
.
empNum
(
Integer
.
parseInt
(
u
.
getId
()))
.
operatorHeaderUrl
(
u
.
getHeadUrl
())
.
executorName
(
u
.
getName
())
.
sts
(
1
)
.
build
().
insert
();
buffer
.
append
(
u
.
getName
());
}
}
}
SpmkApproveSummary
.
builder
().
currentApprover
(
buffer
.
toString
()).
id
(
spmkApproveDetailSummary
.
getApproveSummaryId
()).
build
().
updateById
();
}
//只有一条数据或者已经到下一个大节点
if
(
onlyOne
&&
isNext
)
{
listFlowChildren
.
removeIf
(
f
->
f
==
currentFlowChildren
);
}
else
{
listFlowChildren
.
get
(
spmkApproveDetailDto
.
getIndex
()).
getRelation
().
get
(
0
).
getUsers
().
removeIf
(
u
->
u
==
currentUser
);
}
//如果是最终执行人
if
(
isFinal
&&
isNext
&&
isExecute
)
{
SpmkApproveSummary
.
builder
().
id
(
spmkApproveDetailSummary
.
getApproveSummaryId
()).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
ApproveSummarySts
.
FINISH
.
ordinal
()).
build
().
updateById
();
}
SpmkApproveDetailSummary
.
builder
().
id
(
spmkApproveDetailDto
.
getId
())
.
flowChildren
(
JSONArray
.
fromObject
(
listFlowChildren
).
toString
()).
build
().
updateById
();
SpmkApproveDetailSummary
detailSummary
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
().
eq
(
SpmkApproveDetailSummary:
:
getId
,
spmkApproveDetailDto
.
getId
()));
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
,
true
);
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
())
.
digest
(
spmkApproveSummaryDto
.
getDigest
())
.
updateTime
(
new
Date
())
.
currentApprover
(
currentApprover
).
isUrgent
(
spmkApproveSummaryDto
.
getIsUrgent
())
.
build
();
if
(
spmkApproveSummaryDto
.
getId
()
!=
null
)
{
as
.
setId
(
spmkApproveSummaryDto
.
getId
());
}
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
);
}
@PostMapping
(
value
=
"/del_drafts"
)
@ApiOperation
(
value
=
"删除草稿"
,
httpMethod
=
"POST"
,
notes
=
"删除草稿"
)
@Log
(
title
=
"审批-删除草稿"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
myDrafts
(
@CurrentUser
UserBean
userBean
,
@RequestBody
SpmkApproveDrafts
spmkApproveDrafts
)
{
SpmkApproveDrafts
drafts
=
SpmkApproveDrafts
.
builder
().
id
(
spmkApproveDrafts
.
getId
()).
build
().
selectById
();
SpmkApproveDetailDrafts
.
builder
().
build
().
delete
(
new
QueryWrapper
<
SpmkApproveDetailDrafts
>().
lambda
().
eq
(
SpmkApproveDetailDrafts:
:
getApproveSummaryId
,
drafts
.
getId
()));
drafts
.
deleteById
();
return
ResultUtil
.
data
(
"删除成功"
);
}
@PostMapping
(
value
=
"/add_files"
)
@ApiOperation
(
value
=
"添加附件"
,
httpMethod
=
"POST"
,
notes
=
"添加附件"
)
@Log
(
title
=
"审批-添加附件"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
addFiles
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ApprovingDto
approvingDto
)
{
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
)
{
return
ResultUtil
.
error
(
"暂无权限"
);
}
}
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
()
.
select
(
SpmkApproveDetailSummary:
:
getId
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getFroms
,
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getId
,
approvingDto
.
getAsId
()));
// 审批详情 审批时添加 附件
try
{
if
(
RequestDataUtils
.
addFileList
(
ad
,
approvingDto
.
getFileList
()))
{
ad
.
updateById
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResultUtil
.
data
(
"添加附件成功"
);
}
@PostMapping
(
value
=
"/del_file"
)
@ApiOperation
(
value
=
"添加附件"
,
httpMethod
=
"POST"
,
notes
=
"添加附件"
)
@Log
(
title
=
"审批-添加附件"
,
businessType
=
BusinessType
.
OTHER
)
public
Result
<
Object
>
delFileList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
ApprovingDto
approvingDto
)
{
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
)
{
return
ResultUtil
.
error
(
"暂无权限"
);
}
}
SpmkApproveDetailSummary
ad
=
SpmkApproveDetailSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailSummary
>()
.
lambda
()
.
select
(
SpmkApproveDetailSummary:
:
getId
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getFroms
,
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getId
,
approvingDto
.
getAsId
()));
// 审批详情 审批时添加 附件
try
{
if
(
RequestDataUtils
.
delFileList
(
ad
,
approvingDto
.
getFileList
()))
{
ad
.
updateById
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResultUtil
.
data
(
"删除附件成功"
);
}
}
src/main/java/cn/timer/api/controller/spmk/service/SpmkService.java
View file @
62693996
...
...
@@ -10,10 +10,12 @@ public interface SpmkService {
boolean
createCustomApproval
(
Integer
orgCode
);
SpmkApproveDetailDto
selectApproveDetailByAsId
(
Integer
asId
);
SpmkApproveDetailDto
selectApproveDetailByAsId
(
Integer
asId
,
Integer
empNum
);
List
<
SpmkApprovalG
>
selectListAg
(
UserBean
userBean
);
String
addApproveDetail
();
SpmkApproveDetailDto
selectDraftsDetailByAsId
(
Integer
asId
);
}
src/main/java/cn/timer/api/controller/spmk/service/SpmkServiceImpl.java
View file @
62693996
...
...
@@ -12,6 +12,7 @@ import cn.timer.api.dao.spmk.*;
import
cn.timer.api.dto.spmk.FlowChildren
;
import
cn.timer.api.dto.spmk.Router
;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -43,6 +44,12 @@ public class SpmkServiceImpl implements SpmkService{
@Autowired
private
SpmkApproveDetailSummaryMapper
spmkApproveDetailSummaryMapper
;
@Autowired
private
SpmkApproveDetailDraftsMapper
spmkApproveDetailDraftsMapper
;
@Autowired
private
SpmkApproveDraftsMapper
spmkApproveDraftsMapper
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
/**
...
...
@@ -87,9 +94,12 @@ public class SpmkServiceImpl implements SpmkService{
/**
* 根据审批汇总id 获取 审批详情
* @param asId
* @param empNum
* @return
*/
@Override
public
SpmkApproveDetailDto
selectApproveDetailByAsId
(
Integer
asId
)
{
public
SpmkApproveDetailDto
selectApproveDetailByAsId
(
Integer
asId
,
Integer
empNum
)
{
// TODO Auto-generated method stub
//SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
//审批详情
...
...
@@ -97,7 +107,7 @@ public class SpmkServiceImpl implements SpmkService{
//审批汇总
SpmkApproveSummary
sum
=
null
;
if
(
ad
!=
null
)
{
sum
=
SpmkApproveSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
().
select
(
SpmkApproveSummary:
:
getId
,
SpmkApproveSummary:
:
getEmpNum
,
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getCreateTime
)
sum
=
SpmkApproveSummary
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveSummary
>().
lambda
().
select
(
SpmkApproveSummary:
:
getId
,
SpmkApproveSummary:
:
getEmpNum
,
SpmkApproveSummary:
:
getSts
,
SpmkApproveSummary:
:
getCreateTime
,
SpmkApproveSummary:
:
getDigest
)
.
eq
(
SpmkApproveSummary:
:
getId
,
ad
.
getApproveSummaryId
()));
}
...
...
@@ -121,10 +131,72 @@ public class SpmkServiceImpl implements SpmkService{
adD
.
setFlowChildren
(
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
));
}
adD
.
setApproveExecuteRecord
(
listAer
);
/*** 标记 执行人 阅读 ***/
if
(!
CollectionUtils
.
isEmpty
(
listAer
)){
this
.
updateSpmkExecutorReadStatus
(
listAer
,
empNum
);
}
/*** 标记执行人阅读 结束***/
if
(
sum
!=
null
)
{
adD
.
setEmpNum
(
sum
.
getEmpNum
());
adD
.
setSts
(
sum
.
getSts
());
adD
.
setLaunchTime
(
sum
.
getCreateTime
());
adD
.
setDigest
(
sum
.
getDigest
());
SpmkExecutor
exe
=
null
;
SpmkApproveExecuteRecord
exere
=
SpmkApproveExecuteRecord
.
builder
().
build
()
.
selectOne
(
new
QueryWrapper
<
SpmkApproveExecuteRecord
>().
lambda
().
select
(
SpmkApproveExecuteRecord:
:
getId
).
eq
(
SpmkApproveExecuteRecord:
:
getApproveSummaryId
,
sum
.
getId
())
.
eq
(
SpmkApproveExecuteRecord:
:
getSts
,
1
));
if
(
exere
!=
null
)
{
exe
=
SpmkExecutor
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkExecutor
>().
lambda
().
eq
(
SpmkExecutor:
:
getApproveExecuteRecordId
,
exere
.
getId
()).
orderByDesc
(
SpmkExecutor:
:
getId
));
}
if
(
exe
!=
null
)
{
adD
.
setExecuteEmpNum
(
exe
.
getEmpNum
());
adD
.
setExecuteSts
(
exe
.
getSts
());
adD
.
setExeid
(
exe
.
getId
());
adD
.
setExereid
(
exere
.
getId
());
}
}
return
adD
;
}
//草稿箱用
public
SpmkApproveDetailDto
selectDraftsDetailByAsId
(
Integer
asId
)
{
// TODO Auto-generated method stub
//SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
SpmkApproveDetailDrafts
ad
=
spmkApproveDetailDraftsMapper
.
selectOne
(
new
QueryWrapper
<
SpmkApproveDetailDrafts
>().
lambda
().
eq
(
SpmkApproveDetailDrafts:
:
getApproveSummaryId
,
asId
));
SpmkApproveDrafts
sum
=
null
;
if
(
ad
!=
null
)
{
sum
=
SpmkApproveDrafts
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
SpmkApproveDrafts
>().
lambda
().
select
(
SpmkApproveDrafts:
:
getId
,
SpmkApproveDrafts:
:
getEmpNum
,
SpmkApproveDrafts:
:
getSts
,
SpmkApproveDrafts:
:
getCreateTime
,
SpmkApproveDrafts:
:
getDigest
)
.
eq
(
SpmkApproveDrafts:
:
getId
,
ad
.
getApproveSummaryId
()));
}
SpmkApproveDetailDto
adD
=
SpmkApproveDetailDto
.
builder
().
build
();
if
(
ad
==
null
)
{
return
null
;
}
//审批操作记录
// List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(asId);
BeanUtil
.
copyProperties
(
ad
,
adD
,
"requestData"
,
"froms"
,
"router"
,
"flowChildren"
,
"spmkApproveExecuteRecord"
);
if
(
ad
.
getRequestData
()
!=
null
)
{
adD
.
setRequestData
(
jsonObject
.
parseObject
(
ad
.
getRequestData
(),
JSONObject
.
class
));
}
if
(
ad
.
getFroms
()!=
null
)
{
adD
.
setFroms
(
jsonObject
.
parseArray
(
ad
.
getFroms
(),
JSONObject
.
class
));
}
if
(
ad
.
getFlowChildren
()
!=
null
)
{
adD
.
setRouter
(
jsonObject
.
parseObject
(
ad
.
getRouter
(),
Router
.
class
));
}
if
(
ad
.
getFlowChildren
()!=
null
)
{
adD
.
setFlowChildren
(
jsonObject
.
parseArray
(
ad
.
getFlowChildren
(),
FlowChildren
.
class
));
}
// adD.setApproveExecuteRecord(listAer);
if
(
sum
!=
null
)
{
adD
.
setEmpNum
(
sum
.
getEmpNum
());
adD
.
setSts
(
sum
.
getSts
());
adD
.
setLaunchTime
(
sum
.
getCreateTime
());
adD
.
setDigest
(
sum
.
getDigest
());
SpmkExecutor
exe
=
null
;
SpmkApproveExecuteRecord
exere
=
SpmkApproveExecuteRecord
.
builder
().
build
()
...
...
@@ -207,4 +279,21 @@ public class SpmkServiceImpl implements SpmkService{
return
"成功"
;
}
/**
* 标记 执行人 阅读
* @param listAer
* @param empNum
*/
private
void
updateSpmkExecutorReadStatus
(
List
<
SpmkApproveExecuteRecord
>
listAer
,
Integer
empNum
){
for
(
SpmkApproveExecuteRecord
entity:
listAer
)
{
if
(!
CollectionUtils
.
isEmpty
(
entity
.
getSpmkExecutors
())){
for
(
SpmkExecutor
se:
entity
.
getSpmkExecutors
())
{
if
(
empNum
.
equals
(
se
.
getEmpNum
())
&&
0
==
se
.
getReadStatus
()){
SpmkExecutor
.
builder
().
id
(
se
.
getId
()).
readStatus
(
1
).
build
().
updateById
();
}
}
}
}
}
}
src/main/java/cn/timer/api/dao/kqmk/KqglAssoLeaveBalanceMapper.java
View file @
62693996
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.kqmk;
import
java.util.List
;
import
cn.timer.api.dto.kqmk.*
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -9,10 +10,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
cn.timer.api.bean.kqmk.KqglAssoLeaveBalance
;
import
cn.timer.api.dto.kqmk.AdditionalDto
;
import
cn.timer.api.dto.kqmk.AttqueryCriteriaDto
;
import
cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto
;
import
cn.timer.api.dto.kqmk.JiaqibalanceDto
;
/**
* 员工假期余额
...
...
@@ -35,4 +32,6 @@ public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBala
List
<
AdditionalDto
>
RealTimeUpdate
(
int
orgcode
,
int
kqzid
);
List
<
AdditionalDto
>
selectAdditionalByempnum
(
int
orgcode
,
int
empnum
);
List
<
ExportEmployeeLeaveBalanceDto
>
selectLeaveBalance
(
@Param
(
"param"
)
AttqueryCriteriaDto
attquerycriteriadto
);
}
src/main/java/cn/timer/api/dao/qyxx/CmsContentMapper.java
View file @
62693996
...
...
@@ -3,7 +3,6 @@ package cn.timer.api.dao.qyxx;
import
com.github.yulichang.base.MPJBaseMapper
;
import
org.springframework.stereotype.Repository
;
import
cn.timer.api.bean.qyxx.CmsContent
;
/**
...
...
src/main/java/cn/timer/api/dao/qyxx/CmsIsReadMapper.java
View file @
62693996
package
cn
.
timer
.
api
.
dao
.
qyxx
;
import
cn.timer.api.bean.qyxx.CmsContent
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -8,6 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
cn.timer.api.bean.qyxx.CmsIsRead
;
import
cn.timer.api.dto.qyxx.QyxxIsReadDto
;
import
java.util.List
;
/**
* OA消息内容表
*
...
...
@@ -24,5 +27,6 @@ public interface CmsIsReadMapper extends BaseMapper<CmsIsRead> {
* @return
*/
QyxxIsReadDto
queryIsReadEmp
(
@Param
(
value
=
"orgCode"
)
Integer
orgCode
,
@Param
(
value
=
"mid"
)
Integer
mid
);
List
<
CmsContent
>
getUnreadList
(
@Param
(
value
=
"userId"
)
Integer
userId
);
}
src/main/java/cn/timer/api/dao/spmk/SpmkApproveDetailDraftsMapper.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dao
.
spmk
;
import
cn.timer.api.bean.spmk.SpmkApproveDetailDrafts
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
/**
* 审批草稿详情
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Repository
public
interface
SpmkApproveDetailDraftsMapper
extends
BaseMapper
<
SpmkApproveDetailDrafts
>
{
}
src/main/java/cn/timer/api/dao/spmk/SpmkApproveDraftsMapper.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dao
.
spmk
;
import
cn.timer.api.bean.spmk.SpmkApproveDrafts
;
import
cn.timer.api.dto.spmk.MySummaryQueryDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
/**
* 审批草稿箱
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-16 14:52:01
*/
@Repository
public
interface
SpmkApproveDraftsMapper
extends
BaseMapper
<
SpmkApproveDrafts
>
{
IPage
<
SpmkApproveDrafts
>
selectPageByQueryForEmpNum
(
IPage
<
SpmkApproveDrafts
>
page
,
@Param
(
"param"
)
MySummaryQueryDto
mySummaryQueryDto
);
}
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordDraftsMapper.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dao
.
spmk
;
import
cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 审批执行记录 发起人、抄送人、审批人操作记录--草稿
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-08-19 14:53:36
*/
public
interface
SpmkApproveExecuteRecordDraftsMapper
extends
BaseMapper
<
SpmkApproveExecuteRecordDrafts
>
{
}
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
View file @
62693996
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.spmk;
import
java.util.List
;
import
io.swagger.models.auth.In
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -18,5 +19,9 @@ import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
public
interface
SpmkApproveExecuteRecordMapper
extends
BaseMapper
<
SpmkApproveExecuteRecord
>
{
List
<
SpmkApproveExecuteRecord
>
selectListByAsId
(
@Param
(
"id"
)
Integer
id
);
int
delExecuteRecord
(
@Param
(
"recordId"
)
Integer
recordId
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
SpmkApproveExecuteRecord
selectExecuteRecordById
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
int
delExecuteRecordByRecordIds
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"uid"
)
Integer
uid
);
SpmkApproveExecuteRecord
selectExecuteRecordReoId
(
@Param
(
"reoId"
)
Integer
reoId
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
}
src/main/java/cn/timer/api/dto/kqmk/BalanceSheetDataDto.java
View file @
62693996
...
...
@@ -29,6 +29,9 @@ public class BalanceSheetDataDto implements Serializable{
@ApiModelProperty
(
value
=
"假期规则id"
,
example
=
"字段说明"
)
private
Integer
leaverulesid
;
@ApiModelProperty
(
value
=
"假期name"
,
example
=
"字段说明"
)
private
String
name
;
@ApiModelProperty
(
value
=
"余额天数 "
,
example
=
"字段说明"
)
private
double
balancedays
;
}
src/main/java/cn/timer/api/dto/kqmk/ExportEmployeeLeaveBalanceDto.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dto
.
kqmk
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
ExportEmployeeLeaveBalanceDto
{
@ApiModelProperty
(
value
=
"员工工号 "
,
example
=
"字段说明"
)
private
Integer
empnum
;
@ApiModelProperty
(
value
=
"员工名称 "
,
example
=
"字段说明"
)
private
String
empname
;
@ApiModelProperty
(
value
=
"部门 "
,
example
=
"字段说明"
)
private
String
department
;
@ApiModelProperty
(
value
=
"入职日期 "
,
example
=
"字段说明"
)
private
String
rztime
;
@ApiModelProperty
(
value
=
"企业组织代码 "
,
example
=
"字段说明"
)
private
Integer
orgcode
;
private
Integer
turnover_status
;
@ApiModelProperty
(
value
=
"表数据"
,
example
=
"字段说明"
)
List
<
BalanceSheetDataDto
>
balanceTo
;
}
src/main/java/cn/timer/api/dto/qyxx/CmsContentDto.java
View file @
62693996
...
...
@@ -5,9 +5,11 @@ import java.util.List;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Transient
;
import
cn.timer.api.bean.qyxx.CmsContentRead
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
cn.timer.api.utils.Page
;
...
...
src/main/java/cn/timer/api/dto/qyxx/CmsContentReadDto.java
View file @
62693996
...
...
@@ -4,6 +4,7 @@ import cn.timer.api.utils.Page;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -53,4 +54,7 @@ public class CmsContentReadDto extends Page implements Serializable {
@ApiModelProperty
(
value
=
"更新时间"
,
example
=
""
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"附件索引"
,
example
=
""
)
private
Integer
fileIndex
;
}
src/main/java/cn/timer/api/dto/spmk/AdminApprovingDto.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dto
.
spmk
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
AdminApprovingDto
{
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"审批汇总id"
,
example
=
"2"
,
required
=
true
)
private
Integer
asId
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"审批执行记录id"
,
example
=
"10"
,
required
=
true
)
private
Integer
executeRecordId
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"执行人记录id"
,
example
=
"10"
,
required
=
true
)
private
Integer
executorId
;
@ApiModelProperty
(
value
=
"意见"
,
example
=
"同意、拒绝"
)
private
String
opinion
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"状态 2同意 3拒绝 4转派"
,
example
=
"2"
,
required
=
true
)
private
Integer
sts
;
@ApiModelProperty
(
value
=
"被转派人 "
,
example
=
"对象"
)
private
User
user
;
@ApiModelProperty
(
value
=
"签字图片 "
,
example
=
"签字图片"
)
private
String
signatureImg
;
@ApiModelProperty
(
value
=
"被转派人数组 "
,
example
=
"数组"
)
private
List
<
User
>
userList
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"申请数据 "
,
example
=
"申请数据"
,
required
=
true
)
private
Integer
execute
;
@ApiModelProperty
(
value
=
"节点索引 "
,
example
=
"节点索引"
,
required
=
true
)
private
Integer
typeIndex
;
@ApiModelProperty
(
value
=
"节点用户索引 "
,
example
=
"节点用户索引"
,
required
=
true
)
private
Integer
userIndex
;
}
src/main/java/cn/timer/api/dto/spmk/ApprovingDto.java
View file @
62693996
...
...
@@ -3,12 +3,15 @@ package cn.timer.api.dto.spmk;
import
javax.validation.constraints.NotNull
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
...
...
@@ -40,4 +43,10 @@ public class ApprovingDto {
@ApiModelProperty
(
value
=
"签字图片 "
,
example
=
"签字图片"
)
private
String
signatureImg
;
@ApiModelProperty
(
value
=
"被转派人数组 "
,
example
=
"数组"
)
private
List
<
User
>
userList
;
@ApiModelProperty
(
value
=
"申请数据 "
,
example
=
"申请数据"
,
required
=
true
)
private
List
<
JSONObject
>
fileList
;
}
src/main/java/cn/timer/api/dto/spmk/FromsFileValueData.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
dto
.
spmk
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
FromsFileValueData
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
String
file
;
private
String
name
;
}
src/main/java/cn/timer/api/dto/spmk/SpmkApproveDetailDto.java
View file @
62693996
...
...
@@ -26,6 +26,9 @@ public class SpmkApproveDetailDto {
@ApiModelProperty
(
value
=
"标题 "
,
example
=
"标题"
)
private
String
name
;
@ApiModelProperty
(
value
=
"副标题 "
,
example
=
"副标题"
)
private
String
digest
;
@ApiModelProperty
(
value
=
"所在部门名称 "
,
example
=
"所在部门名称"
)
private
String
departmentName
;
...
...
@@ -58,4 +61,8 @@ public class SpmkApproveDetailDto {
private
Date
launchTime
;
//审批发起时间
private
Integer
index
;
//插入审批人的索引
private
Integer
userIndex
;
//插入审批人的当前用户索引
}
src/main/java/cn/timer/api/dto/spmk/SpmkApproveSummaryDto.java
View file @
62693996
...
...
@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
...
...
@@ -24,6 +25,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public
class
SpmkApproveSummaryDto
{
@NotBlank
(
message
=
ValidationMsg
.
NOTBLANK
)
@ApiModelProperty
(
value
=
"标题 "
,
example
=
"标题"
,
required
=
true
)
private
String
title
;
...
...
@@ -40,9 +42,9 @@ public class SpmkApproveSummaryDto{
private
String
initiator
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@DecimalMax
(
value
=
"
11"
,
message
=
ValidationMsg
.
DECIMALMAX
+
" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 10调薪 11录用
"
)
@DecimalMin
(
value
=
"0"
,
message
=
ValidationMsg
.
DECIMALMIN
+
" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡
10调薪 11录用
"
)
@ApiModelProperty
(
value
=
"关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡
10调薪 11录用
"
,
example
=
"1"
)
@DecimalMax
(
value
=
"
9"
,
message
=
ValidationMsg
.
DECIMALMAX
+
" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡
"
)
@DecimalMin
(
value
=
"0"
,
message
=
ValidationMsg
.
DECIMALMIN
+
" 只能为 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡 "
)
@ApiModelProperty
(
value
=
"关联类型 0无 1转正 2离职 3调岗 4招聘 5加班 6请假 7出差 8外出 9补卡"
,
example
=
"1"
)
private
Integer
assoType
;
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
...
...
@@ -60,4 +62,7 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty
(
value
=
"是否加急"
,
example
=
"是否加急"
,
required
=
true
)
private
Integer
isUrgent
;
@ApiModelProperty
private
Integer
id
;
}
src/main/java/cn/timer/api/utils/router/RequestDataUtils.java
0 → 100644
View file @
62693996
package
cn
.
timer
.
api
.
utils
.
router
;
import
cn.timer.api.bean.spmk.SpmkApproveDetailSummary
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
/**
* 申请数据工具类
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-07-13 10:05:49
*/
@Slf4j
public
class
RequestDataUtils
{
/**
* 表单file类型
*/
private
final
static
String
FORMS_CLASS_NAME_KEY
=
"className"
;
private
final
static
String
FORMS_CLASS_NAME_VALUE
=
"file"
;
/**
* 表单label类型
*/
private
final
static
String
FORMS_DISPLAY_NAME_KEY
=
"displayName"
;
private
final
static
String
FORMS_DISPLAY_NAME_VALUE
=
"上传附件"
;
/**
* 表单inputId
*/
private
final
static
String
FORMS_INPUTID_KEY
=
"inputId"
;
/**
* 申请数据 file* value
*/
private
final
static
String
FORMS_INPUTID_KEY_VALUE
=
"value"
;
private
static
JSONObject
jsonObject
=
new
JSONObject
();
/**
* 审批详情 审批时添加 附件
*
* @param spmkApproveDetailSummary 审批详情数据
* @param fileList 新增数据
* @throws Exception
*/
public
static
Boolean
addFileList
(
SpmkApproveDetailSummary
spmkApproveDetailSummary
,
List
<
JSONObject
>
fileList
)
throws
Exception
{
if
(
CollectionUtils
.
isEmpty
(
fileList
))
{
return
false
;
}
log
.
info
(
"fileList = {}"
,
fileList
);
List
<
JSONObject
>
forms
=
jsonObject
.
parseArray
(
spmkApproveDetailSummary
.
getFroms
(),
JSONObject
.
class
);
if
(
CollectionUtils
.
isEmpty
(
forms
))
{
return
false
;
}
String
inputId
=
""
;
// 找到审批表单对应的附件节点 inputId
for
(
JSONObject
object
:
forms
)
{
if
(
FORMS_CLASS_NAME_VALUE
.
equals
(
object
.
get
(
FORMS_CLASS_NAME_KEY
))
/*&& FORMS_DISPLAY_NAME_VALUE.equals(object.get(FORMS_DISPLAY_NAME_KEY))*/
)
{
inputId
=
object
.
get
(
FORMS_INPUTID_KEY
).
toString
();
break
;
}
}
if
(
StringUtils
.
isEmpty
(
inputId
)
||
inputId
.
length
()
<=
0
)
{
log
.
info
(
"审批详情 >审批时添加附件 forms not file point."
);
return
false
;
}
log
.
info
(
"forms = {}"
,
forms
);
JSONObject
requestData
=
jsonObject
.
parseObject
(
spmkApproveDetailSummary
.
getRequestData
(),
JSONObject
.
class
);
if
(
StringUtils
.
isEmpty
(
requestData
))
{
return
false
;
}
// 找到 申请数据 对应节点 的数据
JSONObject
value
=
(
JSONObject
)
requestData
.
get
(
inputId
);
JSONArray
v
=
(
JSONArray
)
value
.
get
(
FORMS_INPUTID_KEY_VALUE
);
// 添加 申请数据 对应节点 的数据
v
.
addAll
(
fileList
);
log
.
info
(
"requestData = {}"
,
requestData
);
spmkApproveDetailSummary
.
setRequestData
(
requestData
.
toJSONString
());
return
true
;
}
/**
* 审批详情 审批时添加 附件
*
* @param spmkApproveDetailSummary 审批详情数据
* @param fileList 新增数据
* @throws Exception
*/
public
static
Boolean
delFileList
(
SpmkApproveDetailSummary
spmkApproveDetailSummary
,
List
<
JSONObject
>
fileList
)
throws
Exception
{
log
.
info
(
"fileList = {}"
,
fileList
);
List
<
JSONObject
>
forms
=
jsonObject
.
parseArray
(
spmkApproveDetailSummary
.
getFroms
(),
JSONObject
.
class
);
if
(
CollectionUtils
.
isEmpty
(
forms
))
{
return
false
;
}
String
inputId
=
""
;
// 找到审批表单对应的附件节点 inputId
for
(
JSONObject
object
:
forms
)
{
if
(
FORMS_CLASS_NAME_VALUE
.
equals
(
object
.
get
(
FORMS_CLASS_NAME_KEY
))
/*&& FORMS_DISPLAY_NAME_VALUE.equals(object.get(FORMS_DISPLAY_NAME_KEY))*/
)
{
inputId
=
object
.
get
(
FORMS_INPUTID_KEY
).
toString
();
break
;
}
}
if
(
StringUtils
.
isEmpty
(
inputId
)
||
inputId
.
length
()
<=
0
)
{
log
.
info
(
"审批详情 >审批时添加附件 forms not file point."
);
return
false
;
}
log
.
info
(
"forms = {}"
,
forms
);
JSONObject
requestData
=
jsonObject
.
parseObject
(
spmkApproveDetailSummary
.
getRequestData
(),
JSONObject
.
class
);
if
(
StringUtils
.
isEmpty
(
requestData
))
{
return
false
;
}
// 找到 申请数据 对应节点 的数据
JSONObject
value
=
(
JSONObject
)
requestData
.
get
(
inputId
);
JSONArray
v
=
(
JSONArray
)
value
.
get
(
FORMS_INPUTID_KEY_VALUE
);
v
.
clear
();
if
(
fileList
.
size
()>=
0
)
{
v
.
addAll
(
fileList
);
}
spmkApproveDetailSummary
.
setRequestData
(
requestData
.
toJSONString
());
return
true
;
}
}
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
62693996
...
...
@@ -5,6 +5,11 @@ import java.util.Date;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.config.enuminterface.SpmkEnumInterface
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -18,7 +23,6 @@ import cn.hutool.core.collection.ListUtil;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.ConvertException
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.spmk.SpmkApproveExecuteRecord
;
import
cn.timer.api.bean.spmk.SpmkApproveSummary
;
import
cn.timer.api.bean.spmk.SpmkExecutor
;
...
...
@@ -79,12 +83,15 @@ public class RouterUtils {
*/
private
final
static
String
RELATION_TYPE_USERS
=
"users"
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
public
static
List
<
Router
>
NextNode
(
List
<
Router
>
listRouter
,
JSONObject
obj
,
boolean
isFirse
)
throws
NumberFormatException
,
ConvertException
,
Exception
{
return
NextNode
(
listRouter
,
obj
,
isFirse
,
false
);
}
// 执行下一个节点
public
static
List
<
Router
>
NextNode
(
List
<
Router
>
listRouter
,
JSONObject
obj
,
boolean
isFirse
,
boolean
isAuditNext
)
throws
NumberFormatException
,
ConvertException
,
Exception
{
public
static
List
<
Router
>
NextNode
(
List
<
Router
>
listRouter
,
JSONObject
obj
,
boolean
isFirse
,
boolean
isAuditNext
,
boolean
...
isDrafts
)
throws
NumberFormatException
,
ConvertException
,
Exception
{
Router
router
;
if
(
CollectionUtil
.
isNotEmpty
(
listRouter
))
{
...
...
@@ -153,9 +160,10 @@ public class RouterUtils {
// }
if
(!
isAuditNext
)
{
//此处如果是草稿就不需要更改
if
(
isDrafts
!=
null
)
{
router
.
setExecute
(
EXECUTING
);
}
if
(
router
.
getRelation
().
size
()
>
0
)
{
// if (r != null && RELATION_TYPE_USERS.equals(r.getType())) {
List
<
User
>
listUser
=
router
.
getRelation
().
get
(
0
).
getUsers
();
...
...
@@ -168,7 +176,9 @@ public class RouterUtils {
}
switch
(
execute
)
{
case
UNEXECUTED:
if
(
isDrafts
!=
null
)
{
listUser
.
get
(
i
).
setExecute
(
EXECUTING
);
}
// 首次发起申请时,写入 审批人名称 至 obj 中
if
(
isFirse
&&
obj
.
getStr
(
"current_approver"
)
==
null
)
{
obj
.
set
(
"current_approver"
,
listUser
.
get
(
i
).
getName
());
...
...
@@ -568,26 +578,40 @@ public class RouterUtils {
* @param asId 审批汇总Id
* @param executorId 执行人记录Id
* @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝
* @param sts 状态 1执行中 2通过 3拒绝
4转派
*/
public
static
void
approving
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
,
Integer
executeRecordId
,
Integer
executorId
,
String
opinion
,
Integer
sts
,
User
redeployUser
,
String
signatureImg
,
Integer
empNum
)
throws
Exception
{
public
static
void
approving
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
,
Integer
executeRecordId
,
Integer
executorId
,
String
opinion
,
Integer
sts
,
User
redeployUser
,
String
signatureImg
,
Integer
empNum
,
List
<
User
>
redeployUserList
)
throws
Exception
{
//是否有下一个审批人
boolean
hasNextApprover
=
false
;
//统计并序审批 还有几个执行中的
int
es
=
0
;
//操作人是否在审批名单里
boolean
isExist
=
false
;
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
List
<
FlowChildren
>
flowChildrenList
=
new
ArrayList
<>();
int
redeployIndex
=
-
1
;
//当前转派人所在节点下标
//初始化转派人数据 用于转派
String
flowChildrenJson
=
"{\"className\":\"audit\",\"execute\":\"0\",\"flow\":true,\"relation\":[{\"approvalOrder\":\"0\",\"departmentId\":\"\",\"down\":0,\"empty\":0,\"name\":\"\",\"signature\":0,\"type\":\"users\",\"upward\":0,\"users\":[{\"execute\":\"0\",\"headUrl\":\"\",\"id\":\"\",\"name\":\"\"}]}]}"
;
//FlowChildren flowChildren = jsonObject.parseObject(flowChildrenJson,FlowChildren.class);
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
// 新增 执行人
List
<
User
>
listUser
=
CollUtil
.
toList
();
boolean
aobl
=
false
;
boolean
aobl
=
false
;
//用于判断是 否并序审批
List
<
Relation
>
listR
=
listFlowChildren
.
get
(
i
).
getRelation
();
if
(
CollectionUtil
.
isNotEmpty
(
listR
))
{
listUser
=
listR
.
get
(
0
).
getUsers
();
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
aobl
=
true
;
for
(
User
user:
listR
.
get
(
0
).
getUsers
()
)
{
if
(
Integer
.
parseInt
(
user
.
getId
())
==
empNum
&&
listFlowChildren
.
get
(
i
).
getClassName
().
equals
(
AUDIT
)){
isExist
=
true
;
}
//判断是顺序还是并序 0顺序 1并序
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
aobl
=
true
;
if
(
"1"
.
equals
(
user
.
getExecute
())){
es
++;
}
...
...
@@ -596,15 +620,23 @@ public class RouterUtils {
}
}
//判断大节点的执行状态 0 未执行 1 执行中 2 已执行
//执行中
if
(
EXECUTING
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
String
currentApprover
=
""
;
//存放当前审批人名称
int
num
=
0
;
//遍历当前节点审批人
outloop:
// 标识 (若内层满足条件直接跳到该层循环)
for
(
int
i_user
=
0
,
n_user
=
listUser
.
size
();
i_user
<
n_user
;
i_user
++)
{
//判断用户执行状态 0 未执行 1 执行中 2 已执行
//已执行
if
(
EXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//执行中
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
if
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
==
empNum
){
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
if
((
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
==
empNum
&&
num
==
0
)
||
(!
isExist
&&
num
==
0
)){
num
++;
SpmkExecutor
.
builder
()
.
id
(
executorId
)
.
opinion
(
opinion
)
...
...
@@ -640,24 +672,63 @@ public class RouterUtils {
listFlowChildren
.
get
(
i_user
).
setExecute
(
EXECUTED
);
return
;
//转派 处理
//在 原审批人 列表中 插入 一个被转派人(审批人)
//在 原审批人 列表中 插入 一个
或多个
被转派人(审批人)
}
else
if
(
sts
==
ExecutorSts
.
REDEPLOY
.
ordinal
())
{
List
<
User
>
users1
=
CollectionUtil
.
sub
(
listUser
,
0
,
i_user
+
1
);
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
if
(!
CollectionUtils
.
isEmpty
(
redeployUserList
)){
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); 第一次修改
//redeployUserList.add(users1.get(users1.size() - 1)); 第二次修改
/*flowChildren.getRelation().get(0).setName(users1.get(users1.size() - 1).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(users1.get(users1.size() - 1).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(users1.get(users1.size() - 1).getId());*/
redeployIndex
=
i
;
for
(
User
ruser:
redeployUserList
)
{
ruser
.
setExecute
(
UNEXECUTED
);
users1
.
add
(
ruser
);
n_user
=
listUser
.
size
();
}
// List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
// listUser = ListUtils.union(users1, users2);//并集
//listR.get(0).setApprovalOrder("1");
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
setApprovalOrder
(
"1"
);
}
else
{
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
redeployUser
.
setExecute
(
UNEXECUTED
);
users1
.
add
(
redeployUser
);
//新加的 把转派人跟在后面说
User
user
=
users1
.
get
(
users1
.
size
()
-
2
);
// User us = new User();
// us.setExecute(UNEXECUTED);
// us.setName(user.getName());
// us.setId(user.getId());
// users1.add(us);
/*flowChildren.getRelation().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(user.getId());*/
redeployIndex
=
i
;
List
<
User
>
users2
=
CollectionUtil
.
sub
(
listUser
,
i_user
+
1
,
listUser
.
size
());
redeployUserList
=
users2
;
//listUser = ListUtils.union(users1, users2);
n_user
=
listUser
.
size
();
}
// System.out.println(users1);
// System.out.println(users2);
listUser
=
ListUtils
.
union
(
users1
,
users2
);
n_user
=
listUser
.
size
();
//
// System.out.println(listUser);
}
//break outloop;
}
//未执行
}
else
if
(
UNEXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//新增执行人 执行状态为执行中
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
executeRecordId
)
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
()))
...
...
@@ -666,7 +737,7 @@ public class RouterUtils {
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
build
()
.
insert
();
hasNextApprover
=
true
;
hasNextApprover
=
true
;
//标记为有下个审批人
listUser
.
get
(
i_user
).
setExecute
(
EXECUTING
);
...
...
@@ -674,12 +745,15 @@ public class RouterUtils {
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user
).
getName
()).
build
().
updateById
();
// 处理了 下一个审批人 则跳出循环
break
;
if
(
CollectionUtils
.
isEmpty
(
redeployUserList
)){
break
outloop
;
}
}
}
// 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行)
if
(!
hasNextApprover
)
{
if
(!
hasNextApprover
&&
es
<=
1
)
{
SpmkApproveExecuteRecord
aer
=
SpmkApproveExecuteRecord
.
builder
()
.
id
(
executeRecordId
)
...
...
@@ -688,17 +762,18 @@ public class RouterUtils {
// 更新 审批执行记录
aer
.
updateById
();
if
(
es
<=
1
){
// if(es<=1){
// listFlowChildren.get(i).setExecute(EXECUTED);
// }
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
}
}
//判断大节点为未执行
}
else
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
//判断无下一个审批人 并且 执行中的小于等于1
if
(!
hasNextApprover
&&
es
<=
1
)
{
switch
(
listFlowChildren
.
get
(
i
).
getClassName
())
{
case
CREATOR:
case
CREATOR:
//发起审批人
SpmkApproveExecuteRecord
aer
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
...
...
@@ -722,11 +797,12 @@ public class RouterUtils {
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
break
;
case
AUDIT:
case
AUDIT:
//审批中
//判断是否是并序
if
(
aobl
){
String
currentApprover
=
""
;
//遍历当前节点审批人
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
SpmkApproveExecuteRecord
aer2
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
...
...
@@ -737,6 +813,7 @@ public class RouterUtils {
// 新增 审批执行记录
aer2
.
insert
();
//新增执行人 并设置状态为执行中
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user2
).
getId
()))
...
...
@@ -766,7 +843,7 @@ public class RouterUtils {
.
build
();
// 新增 审批执行记录
aer2
.
insert
();
//遍历当前节点审批人
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
...
...
@@ -789,7 +866,7 @@ public class RouterUtils {
}
break
;
case
COPY:
case
COPY:
//抄送人
SpmkApproveExecuteRecord
aer3
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
...
...
@@ -826,11 +903,391 @@ public class RouterUtils {
}
}
for
(
int
i
=
0
;
i
<
listFlowChildren
.
size
();
i
++)
{
flowChildrenList
.
add
(
listFlowChildren
.
get
(
i
));
/*** 转派添加审批人 ***/
/*if(i == redeployIndex){
flowChildrenList.add(flowChildren);
}*/
}
if
(
flowChildrenList
.
size
()
>
0
){
listFlowChildren
.
clear
();
listFlowChildren
.
addAll
(
flowChildrenList
);
}
}
public
static
List
<
Router
>
clearRouters
(
List
<
Router
>
routers
){
return
routers
;
}
/**
* 被拒审批 管理员修改为同意审批
* @param listFlowChildren 节点
* @param asId 审批汇总Id
* @param executorId 执行人记录Id
* @param opinion 意见
* @param sts 状态 1执行中 2通过 3拒绝 4转派
*/
public
static
void
updateRefuseToAgree
(
List
<
FlowChildren
>
listFlowChildren
,
Integer
asId
,
Integer
executeRecordId
,
Integer
executorId
,
String
opinion
,
Integer
sts
,
Integer
currentSts
,
User
redeployUser
,
String
signatureImg
,
Integer
empNum
,
List
<
User
>
redeployUserList
,
Integer
typeIndex
,
Integer
userIndex
)
throws
Exception
{
//拒绝单
SpmkApproveExecuteRecord
spmkApproveExecuteRecord
=
SpmkApproveExecuteRecord
.
builder
().
id
(
executeRecordId
).
build
().
selectById
();
if
(
currentSts
==
3
){
SpmkExecutor
.
builder
().
id
(
executorId
).
sts
(
sts
).
opinion
(
opinion
).
build
().
updateById
();
spmkApproveExecuteRecord
.
builder
().
id
(
executeRecordId
).
sts
(
sts
).
build
().
updateById
();
// 更新 审批汇总 状态
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
updateTime
(
new
Date
()).
sts
(
SpmkEnumInterface
.
ApproveSummarySts
.
IN
.
ordinal
()).
build
().
updateById
();
}
else
if
(
currentSts
==
2
){
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listFlowChildren
.
get
(
typeIndex
).
getRelation
().
get
(
0
).
getUsers
().
get
(
userIndex
).
getName
()).
updateTime
(
new
Date
()).
sts
(
SpmkEnumInterface
.
ApproveSummarySts
.
IN
.
ordinal
()).
build
().
updateById
();
}
//是否有下一个审批人
boolean
hasNextApprover
=
false
;
//统计并序审批 还有几个执行中的
int
es
=
0
;
//操作人是否在审批名单里
boolean
isExist
=
false
;
List
<
FlowChildren
>
flowChildrenList
=
new
ArrayList
<>();
int
redeployIndex
=
-
1
;
//当前转派人所在节点下标
//初始化转派人数据 用于转派
String
flowChildrenJson
=
"{\"className\":\"audit\",\"execute\":\"0\",\"flow\":true,\"relation\":[{\"approvalOrder\":\"0\",\"departmentId\":\"\",\"down\":0,\"empty\":0,\"name\":\"\",\"signature\":0,\"type\":\"users\",\"upward\":0,\"users\":[{\"execute\":\"0\",\"headUrl\":\"\",\"id\":\"\",\"name\":\"\"}]}]}"
;
//FlowChildren flowChildren = jsonObject.parseObject(flowChildrenJson,FlowChildren.class);
boolean
isApprover
=
false
;
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
//等于当前审批人
if
(
i
==
typeIndex
){
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTING
);
}
// 新增 执行人
List
<
User
>
listUser
=
CollUtil
.
toList
();
boolean
aobl
=
false
;
//用于判断是 否并序审批
List
<
Relation
>
listR
=
listFlowChildren
.
get
(
i
).
getRelation
();
if
(
CollectionUtil
.
isNotEmpty
(
listR
))
{
listUser
=
listR
.
get
(
0
).
getUsers
();
for
(
User
user:
listR
.
get
(
0
).
getUsers
()
)
{
if
(
Integer
.
parseInt
(
user
.
getId
())
==
empNum
&&
listFlowChildren
.
get
(
i
).
getClassName
().
equals
(
AUDIT
)){
isExist
=
true
;
}
//判断是顺序还是并序 0顺序 1并序
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
aobl
=
true
;
if
(
"1"
.
equals
(
user
.
getExecute
())){
es
++;
}
}
}
}
if
(
isApprover
){
listFlowChildren
.
get
(
i
).
setExecute
(
UNEXECUTED
);
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
forEach
(
v
->
v
.
setExecute
(
UNEXECUTED
));
}
//判断大节点的执行状态 0 未执行 1 执行中 2 已执行
//执行中
if
(
EXECUTING
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
String
currentApprover
=
""
;
//存放当前审批人名称
int
num
=
0
;
//遍历当前节点审批人
outloop:
// 标识 (若内层满足条件直接跳到该层循环)
for
(
int
i_user
=
0
,
n_user
=
listUser
.
size
();
i_user
<
n_user
;
i_user
++)
{
if
(
i_user
==
userIndex
){
isApprover
=
true
;
listUser
.
get
(
i_user
).
setExecute
(
EXECUTING
);
}
//判断用户执行状态 0 未执行 1 执行中 2 已执行
//已执行
if
(
EXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//执行中
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
if
((
Integer
.
parseInt
(
redeployUser
.
getId
())
==
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
&&
num
==
0
)){
num
++;
SpmkExecutor
.
builder
()
.
id
(
executorId
)
.
opinion
(
opinion
)
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user
).
getHeadUrl
())
.
sts
(
sts
)
.
signatureImg
(
signatureImg
)
.
build
().
updateById
();
listUser
.
get
(
i_user
).
setExecute
(
EXECUTED
);
// 历史审批人
SpmkApproveSummary
.
builder
()
.
id
(
asId
)
.
historyApprover
(
listUser
.
get
(
i_user
).
getName
())
.
build
()
.
updateById
();
//拒绝处理
// 0未执行 1执行中 2同意 3拒绝 4 转派
if
(
sts
==
ExecutorSts
.
AGREE
.
ordinal
()){
}
if
(
sts
==
ExecutorSts
.
REFUSE
.
ordinal
())
{
// 更新 审批汇总 状态
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
CommonEnum
.
NULL_STR
.
getDesc
()).
endTime
(
new
Date
()).
sts
(
sts
).
build
().
updateById
();
SpmkApproveExecuteRecord
.
builder
()
.
id
(
executeRecordId
)
.
sts
(
sts
)
.
build
()
// 更新 审批执行记录
.
updateById
();
listFlowChildren
.
get
(
i_user
).
setExecute
(
EXECUTED
);
return
;
//转派 处理
//在 原审批人 列表中 插入 一个或多个被转派人(审批人)
}
else
if
(
sts
==
ExecutorSts
.
REDEPLOY
.
ordinal
())
{
List
<
User
>
users1
=
CollectionUtil
.
sub
(
listUser
,
userIndex
,
userIndex
+
1
);
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
if
(!
CollectionUtils
.
isEmpty
(
redeployUserList
)){
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); 第一次修改
//redeployUserList.add(users1.get(users1.size() - 1)); 第二次修改
/*flowChildren.getRelation().get(0).setName(users1.get(0).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(users1.get(0).getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(users1.get(0).getId());*/
redeployIndex
=
i
;
for
(
User
ruser:
redeployUserList
)
{
ruser
.
setExecute
(
UNEXECUTED
);
users1
.
add
(
ruser
);
n_user
=
listUser
.
size
();
}
// List<User> users2 = CollectionUtil.sub(listUser, i_user+1, listUser.size());
// listUser = ListUtils.union(users1, users2);//并集
//listR.get(0).setApprovalOrder("1");
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
setApprovalOrder
(
"1"
);
}
else
{
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
redeployUser
.
setExecute
(
UNEXECUTED
);
users1
.
add
(
redeployUser
);
//新加的 把转派人跟在后面说
User
user
=
users1
.
get
(
users1
.
size
()
-
2
);
// User us = new User();
// us.setExecute(UNEXECUTED);
// us.setName(user.getName());
// us.setId(user.getId());
// users1.add(us);
/*flowChildren.getRelation().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setName(user.getName());
flowChildren.getRelation().get(0).getUsers().get(0).setId(user.getId());*/
redeployIndex
=
i
;
List
<
User
>
users2
=
CollectionUtil
.
sub
(
listUser
,
i_user
+
1
,
listUser
.
size
());
redeployUserList
=
users2
;
//listUser = ListUtils.union(users1, users2);
n_user
=
listUser
.
size
();
}
// System.out.println(users1);
// System.out.println(users2);
//
// System.out.println(listUser);
}
//break outloop;
}
//未执行
}
else
if
(
UNEXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//新增执行人 执行状态为执行中
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
executeRecordId
)
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user
).
getHeadUrl
())
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
build
()
.
insert
();
hasNextApprover
=
true
;
//标记为有下个审批人
listUser
.
get
(
i_user
).
setExecute
(
EXECUTING
);
// 当前审批人
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user
).
getName
()).
build
().
updateById
();
// 处理了 下一个审批人 则跳出循环
if
(
CollectionUtils
.
isEmpty
(
redeployUserList
)){
break
outloop
;
}
}
}
// 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行)
if
(!
hasNextApprover
&&
es
<=
1
)
{
SpmkApproveExecuteRecord
aer
=
SpmkApproveExecuteRecord
.
builder
()
.
id
(
executeRecordId
)
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
())
.
build
();
// 更新 审批执行记录
aer
.
updateById
();
// if(es<=1){
// listFlowChildren.get(i).setExecute(EXECUTED);
// }
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
}
//判断大节点为未执行
}
else
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
//判断无下一个审批人 并且 执行中的小于等于1
if
(!
hasNextApprover
&&
es
<=
1
)
{
switch
(
listFlowChildren
.
get
(
i
).
getClassName
())
{
case
CREATOR:
//发起审批人
SpmkApproveExecuteRecord
aer
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
.
name
(
ParticipatorType
.
INITIATOR
.
getName
())
.
type
(
ParticipatorType
.
INITIATOR
.
ordinal
())
.
sts
(
ExecuteRecordSts
.
AGREE
.
ordinal
())
.
build
();
// 新增 审批执行记录
aer
.
insert
();
// 新增 执行人
User
user
=
listFlowChildren
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
get
(
0
);
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer
.
getId
())
.
empNum
(
Integer
.
parseInt
(
user
.
getId
()))
.
executorName
(
user
.
getName
())
.
operatorHeaderUrl
(
user
.
getHeadUrl
())
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
())
.
build
()
.
insert
();
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
break
;
case
AUDIT:
//审批中
//判断是否是并序
if
(
aobl
){
String
currentApprover
=
""
;
//遍历当前节点审批人
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
SpmkApproveExecuteRecord
aer2
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
.
name
(
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
// 新增 审批执行记录
aer2
.
insert
();
//新增执行人 并设置状态为执行中
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user2
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user2
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user2
).
getHeadUrl
())
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
executor
.
insert
();
listUser
.
get
(
i_user2
).
setExecute
(
EXECUTING
);
hasNextApprover
=
true
;
currentApprover
=
currentApprover
!=
""
?
currentApprover
+
","
+
listUser
.
get
(
i_user2
).
getName
():
listUser
.
get
(
i_user2
).
getName
();
// 当前审批人
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
currentApprover
).
build
().
updateById
();
}
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTING
);
}
else
{
SpmkApproveExecuteRecord
aer2
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
.
name
(
ParticipatorType
.
APPROVER
.
getName
())
.
type
(
ParticipatorType
.
APPROVER
.
ordinal
())
.
sts
(
ExecuteRecordSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
// 新增 审批执行记录
aer2
.
insert
();
//遍历当前节点审批人
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user2
).
getId
()))
.
executorName
(
listUser
.
get
(
i_user2
).
getName
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user2
).
getHeadUrl
())
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
executor
.
insert
();
listUser
.
get
(
i_user2
).
setExecute
(
EXECUTING
);
hasNextApprover
=
true
;
// 当前审批人
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user2
).
getName
()).
build
().
updateById
();
// 处理了 下一个审批人 则跳出循环
break
;
}
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTING
);
}
break
;
case
COPY:
//抄送人
SpmkApproveExecuteRecord
aer3
=
SpmkApproveExecuteRecord
.
builder
()
.
approveSummaryId
(
asId
)
.
name
(
ParticipatorType
.
COPY
.
getName
())
.
type
(
ParticipatorType
.
COPY
.
ordinal
())
.
sts
(
ExecuteRecordSts
.
AGREE
.
ordinal
())
.
build
();
// 新增 审批执行记录
aer3
.
insert
();
List
<
Relation
>
listRelation
=
listFlowChildren
.
get
(
i
).
getRelation
();
for
(
Relation
relation
:
listRelation
)
{
List
<
User
>
listUser2
=
relation
.
getUsers
();
if
(
listUser2
!=
null
)
{
// 新增 执行人
for
(
User
user2
:
listUser2
)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer3
.
getId
())
.
empNum
(
Integer
.
parseInt
(
user2
.
getId
()))
.
executorName
(
user2
.
getName
())
.
operatorHeaderUrl
(
user2
.
getHeadUrl
())
.
sts
(
ExecutorSts
.
AGREE
.
ordinal
())
.
build
();
executor
.
insert
();
}
}
}
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTED
);
break
;
}
}
//重新新修改审批结果
}
}
for
(
int
i
=
0
;
i
<
listFlowChildren
.
size
();
i
++)
{
flowChildrenList
.
add
(
listFlowChildren
.
get
(
i
));
/*** 转派添加审批人 ***/
/*if(i == redeployIndex){
flowChildrenList.add(flowChildren);
}*/
}
if
(
flowChildrenList
.
size
()
>
0
){
listFlowChildren
.
clear
();
listFlowChildren
.
addAll
(
flowChildrenList
);
}
}
}
src/main/resources/application-dev.yml
View file @
62693996
...
...
@@ -244,8 +244,8 @@ config-8timer:
# 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS)
# 默认存储物理机器OSS
file-address
:
type
:
physics-oss
#
type: aliyun-oss
#
type: physics-oss
type
:
aliyun-oss
#导出zip临时地址
zip
:
...
...
src/main/resources/application-test.yml
View file @
62693996
...
...
@@ -107,7 +107,7 @@ spring:
port
:
465
class
:
javax.net.ssl.SSLSocketFactor
redis
:
database
:
4
# Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中
database
:
2
# Redis数据库索引(默认为0),如果设置为1,那么存入的key-value都存放在select 1中
host
:
120.78.162.177
port
:
7788
password
:
(!0YouLingRcRedis0!)
...
...
@@ -219,8 +219,8 @@ config-8timer:
# 文件存储地址类型:aliyun-oss(阿里云OSS),physics-oss(物理机器OSS)
# 默认存储物理机器OSS
file-address
:
type
:
physics-oss
#
type: aliyun-oss
#
type: physics-oss
type
:
aliyun-oss
#导出zip临时地址
zip
:
...
...
src/main/resources/application.yml
View file @
62693996
spring
:
profiles
:
active
:
dev
active
:
test
#active: '@environment@'
src/main/resources/mapping/kqmk/KqglAssoLeaveBalanceMapper.xml
View file @
62693996
...
...
@@ -123,6 +123,30 @@
yz.balance_days as balancedays-->
</select>
<select
id=
"selectLeaveBalance"
resultType=
"cn.timer.api.dto.kqmk.ExportEmployeeLeaveBalanceDto"
>
SELECT emp.emp_num as empnum,
emp.`name` as empname,
emp.org_code as orgcode,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
IFNULL((select em.job_status from yggl_main_lzb em where em.emp_num = emp.emp_num and em.org_code = emp.org_code),0) as turnover_status
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
where emp.org_code = #{param.orgCode}
<if
test=
"param.query != null and param.query != ''"
>
and ( emp.`name` like CONCAT('%',#{param.query},'%') or
emp.emp_num like CONCAT('%',#{param.query},'%') or
c.name like CONCAT('%',#{param.query},'%'))
</if>
<if
test=
"param.deptid != null and param.deptid != ''"
>
and c.id in (select m.id from zzgl_bmgw_m m where m.up_id = #{param.deptid}) or (c.id =#{param.deptid})
</if>
<if
test=
"param.turnover_status == 0"
>
and emp.emp_num not in (select em.emp_num from yggl_main_lzb em where em.org_code = #{param.orgCode} and em.job_status = 3)
</if>
</select>
<select
id=
"selectAdditional"
resultMap=
"AdditionalMap"
>
SELECT emp.emp_num as empnum,
...
...
src/main/resources/mapping/qyxx/CmsIsReadMapper.xml
View file @
62693996
...
...
@@ -45,6 +45,14 @@
a.read_time ASC
</select>
<select
id=
"getUnreadList"
resultType=
"cn.timer.api.bean.qyxx.CmsContent"
>
select cc.* from cms_content cc
left JOIN cms_content_read ccs on ccs.cms_content_id=cc.id
WHERE ccs.read_status = 0 and ccs.user_id=#{userId}
order by ccs.create_time desc
limit 10
</select>
<!-- <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.cmsI.CmsIsRead">
INSERT INTO cms_is_read <trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != mid'> mid, </if> <if test ='null != uid'> uid </if> </trim>
...
...
src/main/resources/mapping/spmk/SpmkApproveDetailDraftsMapper.xml
0 → 100644
View file @
62693996
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.spmk.SpmkApproveDetailDraftsMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
id=
"spmkApproveDetailDraftsMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"approveSummaryId"
column=
"approve_summary_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"departmentName"
column=
"department_name"
/>
<result
property=
"requestData"
column=
"request_data"
/>
<result
property=
"froms"
column=
"froms"
/>
<result
property=
"router"
column=
"router"
/>
<result
property=
"flowChildren"
column=
"flow_children"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
>
select *
from spmk_approve_detail_drafts
where id = #{value}
</select>
<select
id=
"queryList"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
>
select * from spmk_approve_detail_drafts
<where>
<if
test=
"approveSummaryId != null and approveSummaryId != ''"
>
AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if
test=
"name != null and name != ''"
>
AND `name` = #{name}
</if>
<if
test=
"departmentName != null and departmentName != ''"
>
AND `department_name` = #{departmentName}
</if>
<if
test=
"requestData != null and requestData != ''"
>
AND `request_data` = #{requestData}
</if>
<if
test=
"froms != null and froms != ''"
>
AND `froms` = #{froms}
</if>
<if
test=
"router != null and router != ''"
>
AND `router` = #{router}
</if>
<if
test=
"flowChildren != null and flowChildren != ''"
>
AND `flow_children` = #{flowChildren}
</if>
</where>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from spmk_approve_detail_drafts
<where>
<if
test=
"approveSummaryId != null and approveSummaryId != ''"
>
AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if
test=
"name != null and name != ''"
>
AND `name` = #{name}
</if>
<if
test=
"departmentName != null and departmentName != ''"
>
AND `department_name` = #{departmentName}
</if>
<if
test=
"requestData != null and requestData != ''"
>
AND `request_data` = #{requestData}
</if>
<if
test=
"froms != null and froms != ''"
>
AND `froms` = #{froms}
</if>
<if
test=
"router != null and router != ''"
>
AND `router` = #{router}
</if>
<if
test=
"flowChildren != null and flowChildren != ''"
>
AND `flow_children` = #{flowChildren}
</if>
</where>
</select>
<insert
id=
"save"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_detail_drafts
(`approve_summary_id`,
`name`,
`department_name`,
`request_data`,
`froms`,
`router`,
`flow_children`)
values (#{approveSummaryId},
#{name},
#{departmentName},
#{requestData},
#{froms},
#{router},
#{flowChildren})
</insert>
<insert
id=
"saveSelective"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_detail_drafts
(
<if
test=
"approveSummaryId != null"
>
,`approve_summary_id`
</if>
<if
test=
"name != null"
>
,`name`
</if>
<if
test=
"departmentName != null"
>
,`department_name`
</if>
<if
test=
"requestData != null"
>
,`request_data`
</if>
<if
test=
"froms != null"
>
,`froms`
</if>
<if
test=
"router != null"
>
,`router`
</if>
<if
test=
"flowChildren != null"
>
,`flow_children`
</if>
)
values
(
<if
test=
"approveSummaryId != null"
>
,#{approveSummaryId}
</if>
<if
test=
"name != null"
>
,#{name}
</if>
<if
test=
"departmentName != null"
>
,#{departmentName}
</if>
<if
test=
"requestData != null"
>
,#{requestData}
</if>
<if
test=
"froms != null"
>
,#{froms}
</if>
<if
test=
"router != null"
>
,#{router}
</if>
<if
test=
"flowChildren != null"
>
,#{flowChildren}
</if>
)
</insert>
<insert
id=
"saveList"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_detail_drafts
(
`approve_summary_id`,
`name`,
`department_name`,
`request_data`,
`froms`,
`router`,
`flow_children`
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.approveSummaryId},
#{item.name},
#{item.departmentName},
#{item.requestData},
#{item.froms},
#{item.router},
#{item.flowChildren}
)
</foreach>
</insert>
<update
id=
"update"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveDetailDrafts"
>
update spmk_approve_detail_drafts
<set>
<if
test=
"approveSummaryId != null"
>
`approve_summary_id` = #{approveSummaryId},
</if>
<if
test=
"name != null"
>
`name` = #{name},
</if>
<if
test=
"departmentName != null"
>
`department_name` = #{departmentName},
</if>
<if
test=
"requestData != null"
>
`request_data` = #{requestData},
</if>
<if
test=
"froms != null"
>
`froms` = #{froms},
</if>
<if
test=
"router != null"
>
`router` = #{router},
</if>
<if
test=
"flowChildren != null"
>
`flow_children` = #{flowChildren}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete
from spmk_approve_detail_drafts
where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from spmk_approve_detail_drafts where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
src/main/resources/mapping/spmk/SpmkApproveDraftsMapper.xml
0 → 100644
View file @
62693996
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.spmk.SpmkApproveDraftsMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.spmk.SpmkApproveDrafts"
id=
"spmkApproveDraftsMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orgCode"
column=
"org_code"
/>
<result
property=
"empNum"
column=
"emp_num"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"departmentName"
column=
"department_name"
/>
<result
property=
"initiator"
column=
"initiator"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"approveName"
column=
"approve_name"
/>
<result
property=
"sts"
column=
"sts"
/>
<result
property=
"currentApprover"
column=
"current_approver"
/>
<result
property=
"historyApprover"
column=
"history_approver"
/>
<result
property=
"assoType"
column=
"asso_type"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"endTime"
column=
"end_time"
/>
<result
property=
"digest"
column=
"digest"
/>
<result
property=
"isDelete"
column=
"is_delete"
/>
<result
property=
"isUrgent"
column=
"is_urgent"
/>
</resultMap>
<select
id=
"selectPageByQueryForEmpNum"
resultMap=
"spmkApproveDraftsMap"
>
SELECT
*
FROM spmk_approve_drafts a
WHERE a.org_code = #{param.orgCode} and a.is_delete=0 and a.emp_num=#{param.empNum}
ORDER BY a.id DESC
</select>
</mapper>
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordDraftsMapper.xml
0 → 100644
View file @
62693996
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.spmk.SpmkApproveExecuteRecordDraftsMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
id=
"spmkApproveExecuteRecordDraftsMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"approveSummaryId"
column=
"approve_summary_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"sts"
column=
"sts"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
>
select *
from spmk_approve_execute_record_drafts
where id = #{value}
</select>
<select
id=
"queryList"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
>
select * from spmk_approve_execute_record_drafts
<where>
<if
test=
"approveSummaryId != null and approveSummaryId != ''"
>
AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if
test=
"name != null and name != ''"
>
AND `name` = #{name}
</if>
<if
test=
"type != null and type != ''"
>
AND `type` = #{type}
</if>
<if
test=
"sts != null and sts != ''"
>
AND `sts` = #{sts}
</if>
<if
test=
"createTime != null and createTime != ''"
>
AND `create_time` = #{createTime}
</if>
<if
test=
"updateTime != null and updateTime != ''"
>
AND `update_time` = #{updateTime}
</if>
</where>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from spmk_approve_execute_record_drafts
<where>
<if
test=
"approveSummaryId != null and approveSummaryId != ''"
>
AND `approve_summary_id` =
#{approveSummaryId}
</if>
<if
test=
"name != null and name != ''"
>
AND `name` = #{name}
</if>
<if
test=
"type != null and type != ''"
>
AND `type` = #{type}
</if>
<if
test=
"sts != null and sts != ''"
>
AND `sts` = #{sts}
</if>
<if
test=
"createTime != null and createTime != ''"
>
AND `create_time` = #{createTime}
</if>
<if
test=
"updateTime != null and updateTime != ''"
>
AND `update_time` = #{updateTime}
</if>
</where>
</select>
<insert
id=
"save"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_execute_record_drafts
(`approve_summary_id`,
`name`,
`type`,
`sts`,
`create_time`,
`update_time`)
values (#{approveSummaryId},
#{name},
#{type},
#{sts},
#{createTime},
#{updateTime})
</insert>
<insert
id=
"saveSelective"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_execute_record_drafts
(
<if
test=
"approveSummaryId != null"
>
,`approve_summary_id`
</if>
<if
test=
"name != null"
>
,`name`
</if>
<if
test=
"type != null"
>
,`type`
</if>
<if
test=
"sts != null"
>
,`sts`
</if>
<if
test=
"createTime != null"
>
,`create_time`
</if>
<if
test=
"updateTime != null"
>
,`update_time`
</if>
)
values
(
<if
test=
"approveSummaryId != null"
>
,#{approveSummaryId}
</if>
<if
test=
"name != null"
>
,#{name}
</if>
<if
test=
"type != null"
>
,#{type}
</if>
<if
test=
"sts != null"
>
,#{sts}
</if>
<if
test=
"createTime != null"
>
,#{createTime}
</if>
<if
test=
"updateTime != null"
>
,#{updateTime}
</if>
)
</insert>
<insert
id=
"saveList"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into spmk_approve_execute_record_drafts
(
`approve_summary_id`,
`name`,
`type`,
`sts`,
`create_time`,
`update_time`
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.approveSummaryId},
#{item.name},
#{item.type},
#{item.sts},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<update
id=
"update"
parameterType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecordDrafts"
>
update spmk_approve_execute_record_drafts
<set>
<if
test=
"approveSummaryId != null"
>
`approve_summary_id` = #{approveSummaryId},
</if>
<if
test=
"name != null"
>
`name` = #{name},
</if>
<if
test=
"type != null"
>
`type` = #{type},
</if>
<if
test=
"sts != null"
>
`sts` = #{sts},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete
from spmk_approve_execute_record_drafts
where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from spmk_approve_execute_record_drafts where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
View file @
62693996
...
...
@@ -54,6 +54,7 @@
b.operator_header_url SpmkExecutor_operator_header_url,
b.opinion SpmkExecutor_opinion,
b.sts SpmkExecutor_sts,
b.read_status SpmkExecutor_read_status,
b.create_time SpmkExecutor_create_time,
b.update_time SpmkExecutor_update_time,
b.signature_img SpmkExecutor_signature_img
...
...
@@ -165,5 +166,28 @@
</select>
-->
<select
id=
"selectExecuteRecordById"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecord"
>
SELECT sr.id FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
</select>
<select
id=
"selectExecuteRecordReoId"
resultType=
"cn.timer.api.bean.spmk.SpmkApproveExecuteRecord"
>
SELECT sr.id FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se ON se.approve_execute_record_id=sr.id
WHERE sr.approve_summary_id = #{approveSummaryId} and se.uid = #{reoId}
</select>
<delete
id=
"delExecuteRecord"
>
DELETE sr,se FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se on sr.id=se.approve_execute_record_id
WHERE sr.approve_summary_id = #{approveSummaryId} and sr.id
<![CDATA[ > ]]>
#{recordId}
</delete>
<delete
id=
"delExecuteRecordByRecordIds"
>
DELETE sr,se FROM spmk_approve_execute_record sr
LEFT JOIN spmk_executor se on sr.id=se.approve_execute_record_id
WHERE sr.id =#{id} and se.emp_num =#{uid}
</delete>
</mapper>
src/main/resources/mapping/spmk/SpmkApproveSummaryMapper.xml
View file @
62693996
src/main/resources/mapping/spmk/SpmkExecutorMapper.xml
View file @
62693996
...
...
@@ -11,6 +11,7 @@
<result
column=
"operator_header_url"
property=
"operatorHeaderUrl"
/>
<result
column=
"opinion"
property=
"opinion"
/>
<result
column=
"sts"
property=
"sts"
/>
<result
column=
"read_status"
property=
"readStatus"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"signature_img"
property=
"signatureImg"
/>
...
...
@@ -24,6 +25,7 @@
operator_header_url,
opinion,
sts,
read_status,
create_time,
update_time,
signature_img,
...
...
@@ -138,5 +140,9 @@
</select>
-->
<select
id=
"executor"
resultMap=
"BaseResultMap"
>
select
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment