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
a2d48c6f
Commit
a2d48c6f
authored
Jul 13, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
当前审批人审批时添加附件审批
parent
2649f0ca
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
1 deletions
+126
-1
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+9
-1
src/main/java/cn/timer/api/dto/spmk/ApprovingDto.java
+4
-0
src/main/java/cn/timer/api/dto/spmk/FromsFileValueData.java
+25
-0
src/main/java/cn/timer/api/utils/router/RequestDataUtils.java
+88
-0
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
a2d48c6f
...
@@ -9,6 +9,7 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
...
@@ -9,6 +9,7 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.router.RequestDataUtils
;
import
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
com.mysql.cj.util.StringUtils
;
import
com.mysql.cj.util.StringUtils
;
import
net.sf.json.JSON
;
import
net.sf.json.JSON
;
...
@@ -789,6 +790,7 @@ public class SpmkController {
...
@@ -789,6 +790,7 @@ public class SpmkController {
.
lambda
()
.
lambda
()
.
select
(
SpmkApproveDetailSummary:
:
getId
,
.
select
(
SpmkApproveDetailSummary:
:
getId
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getRequestData
,
SpmkApproveDetailSummary:
:
getFroms
,
SpmkApproveDetailSummary:
:
getFlowChildren
)
SpmkApproveDetailSummary:
:
getFlowChildren
)
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
.
eq
(
SpmkApproveDetailSummary:
:
getApproveSummaryId
,
asId
));
...
@@ -846,8 +848,14 @@ public class SpmkController {
...
@@ -846,8 +848,14 @@ public class SpmkController {
approvingDto
.
getUserList
()
approvingDto
.
getUserList
()
);
);
// 更新 flowChildren
// 更新 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
);
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
if
(
fc
.
getExecute
()
==
"2"
)
{
if
(
fc
.
getExecute
()
==
"2"
)
{
...
...
src/main/java/cn/timer/api/dto/spmk/ApprovingDto.java
View file @
a2d48c6f
...
@@ -3,6 +3,7 @@ package cn.timer.api.dto.spmk;
...
@@ -3,6 +3,7 @@ package cn.timer.api.dto.spmk;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
...
@@ -45,4 +46,7 @@ public class ApprovingDto {
...
@@ -45,4 +46,7 @@ public class ApprovingDto {
@ApiModelProperty
(
value
=
"被转派人数组 "
,
example
=
"数组"
)
@ApiModelProperty
(
value
=
"被转派人数组 "
,
example
=
"数组"
)
private
List
<
User
>
userList
;
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 @
a2d48c6f
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/utils/router/RequestDataUtils.java
0 → 100644
View file @
a2d48c6f
package
cn
.
timer
.
api
.
utils
.
router
;
import
cn.timer.api.bean.spmk.SpmkApproveDetailSummary
;
import
cn.timer.api.dto.spmk.FromsFileValueData
;
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
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
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
;
}
}
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