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
f32793c3
Commit
f32793c3
authored
2 years ago
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重复审批bug
parent
07b22e04
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
95 additions
and
44 deletions
+95
-44
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecord.java
+8
-5
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
+1
-1
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
+6
-1
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
+15
-1
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+3
-3
src/main/java/cn/timer/api/dao/qyxx/CmsIsReadMapper.java
+6
-2
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
+1
-1
src/main/java/cn/timer/api/dto/spmk/AdminApprovingDto.java
+6
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+23
-11
src/main/resources/mapping/qyxx/CmsIsReadMapper.xml
+22
-15
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
+4
-4
No files found.
src/main/java/cn/timer/api/bean/spmk/SpmkApproveExecuteRecord.java
View file @
f32793c3
...
...
@@ -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
...
...
@@ -32,7 +33,7 @@ import lombok.NoArgsConstructor;
public
class
SpmkApproveExecuteRecord
extends
Model
<
SpmkApproveExecuteRecord
>
{
/**
*
*
*/
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -57,11 +58,14 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
@TableField
(
fill
=
FieldFill
.
INSERT
)
@ApiModelProperty
(
value
=
"创建时间 "
,
example
=
"创建时间"
)
private
Date
createTime
;
@TableField
(
fill
=
FieldFill
.
UPDATE
)
@ApiModelProperty
(
value
=
"操作时间 "
,
example
=
"操作时间"
)
private
Date
updateTime
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
""
)
private
List
<
SpmkExecutor
>
spmkExecutors
;
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
View file @
f32793c3
...
...
@@ -135,7 +135,7 @@ public class DiskFilesController {
diskFilesLog
.
setFilesId
(
diskFiles
.
getId
());
diskFilesLog
.
setFileSize
(
dto
.
getFileSize
()
+
"B"
);
diskFilesLog
.
setTitle
(
dto
.
getResourceFileName
());
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
CREATE_LOG
.
getType
());
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
CREATE_LOG
.
getType
());
diskFilesLog
.
insert
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
View file @
f32793c3
...
...
@@ -64,6 +64,7 @@ public class CmsController {
@Autowired
private
CmsIsReadMapper
cmsIsReadMapper
;
// @Autowired
// private CmsAnnouncementMapper cmsAnnouncementMapper;
...
...
@@ -756,6 +757,10 @@ public class CmsController {
}
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
()));
}
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/spmk/AdminSpmkController.java
View file @
f32793c3
...
...
@@ -62,6 +62,9 @@ public class AdminSpmkController {
@Autowired
private
SpmkAssoBusinessFactory
spmkAssoBusinessFactory
;
@Autowired
private
SpmkApproveExecuteRecordMapper
spmkApproveExecuteRecordMapper
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
@Resource
...
...
@@ -144,6 +147,11 @@ public class AdminSpmkController {
}
}
//如果是再次审批
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
(
...
...
@@ -157,7 +165,9 @@ public class AdminSpmkController {
approvingDto
.
getUser
(),
approvingDto
.
getSignatureImg
(),
userBean
.
getEmpNum
(),
approvingDto
.
getUserList
()
approvingDto
.
getUserList
(),
approvingDto
.
getTypeIndex
(),
approvingDto
.
getUserIndex
()
);
...
...
@@ -168,6 +178,10 @@ public class AdminSpmkController {
sadsUpdate.setRequestData(ad.getRequestData());
}*/
sadsUpdate
.
updateById
();
//最后一条数据
FlowChildren
fc
=
CollUtil
.
getLast
(
listFlowChildren
);
if
(
fc
.
getExecute
()
==
"2"
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
f32793c3
...
...
@@ -1225,14 +1225,14 @@ public class SpmkController {
int
currentIndex
=
spmkApproveDetailDto
.
getIndex
();
for
(
int
i
=
currentIndex
+
1
;
i
<
listFlowChildren
.
size
();
i
++)
{
if
(
i
==
currentIndex
+
1
)
{
if
(!
listFlowChildren
.
get
(
currentIndex
).
getExecute
().
equals
(
"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
.
delExecut
or
(
spmkApproveExecuteRecord
.
getId
(),
spmkApproveDetailSummary
.
getApproveSummaryId
());
spmkApproveExecuteRecordMapper
.
delExecut
eRecord
(
spmkApproveExecuteRecord
.
getId
(),
spmkApproveDetailSummary
.
getApproveSummaryId
());
}
listFlowChildren
.
get
(
i
).
setExecute
(
"1"
);
listFlowChildren
.
get
(
i
).
getRelation
().
forEach
(
v
->
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/qyxx/CmsIsReadMapper.java
View file @
f32793c3
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,9 +9,11 @@ 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消息内容表
*
*
* @author dsc 2019-12-12
*/
@Repository
...
...
@@ -18,11 +21,12 @@ public interface CmsIsReadMapper extends BaseMapper<CmsIsRead> {
/**
* 查询已读人
*
*
* @param mid
* @param orgCode
* @return
*/
QyxxIsReadDto
queryIsReadEmp
(
@Param
(
value
=
"orgCode"
)
Integer
orgCode
,
@Param
(
value
=
"mid"
)
Integer
mid
);
List
<
CmsContent
>
getUnreadList
(
@Param
(
value
=
"userId"
)
Integer
userId
);
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dao/spmk/SpmkApproveExecuteRecordMapper.java
View file @
f32793c3
...
...
@@ -18,6 +18,6 @@ import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
public
interface
SpmkApproveExecuteRecordMapper
extends
BaseMapper
<
SpmkApproveExecuteRecord
>
{
List
<
SpmkApproveExecuteRecord
>
selectListByAsId
(
@Param
(
"id"
)
Integer
id
);
int
delExecut
or
(
@Param
(
"id"
)
Integer
i
d
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
int
delExecut
eRecord
(
@Param
(
"recordId"
)
Integer
recordI
d
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
SpmkApproveExecuteRecord
selectExecuteRecordById
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"approveSummaryId"
)
Integer
approveSummaryId
);
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/dto/spmk/AdminApprovingDto.java
View file @
f32793c3
...
...
@@ -50,4 +50,10 @@ public class AdminApprovingDto {
@ApiModelProperty
(
value
=
"申请数据 "
,
example
=
"申请数据"
,
required
=
true
)
private
Integer
execute
;
@ApiModelProperty
(
value
=
"节点索引 "
,
example
=
"节点索引"
,
required
=
true
)
private
Integer
typeIndex
;
@ApiModelProperty
(
value
=
"节点用户索引 "
,
example
=
"节点用户索引"
,
required
=
true
)
private
Integer
userIndex
;
}
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
f32793c3
...
...
@@ -927,13 +927,18 @@ public class RouterUtils {
* @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
)
throws
Exception
{
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
();
S
pmkApproveExecuteRecord
.
builder
().
id
(
executeRecordId
).
sts
(
sts
).
build
().
updateById
();
s
pmkApproveExecuteRecord
.
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
;
//统计并序审批 还有几个执行中的
...
...
@@ -946,9 +951,12 @@ public class RouterUtils {
//初始化转派人数据 用于转派
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
;
//用于判断是 否并序审批
...
...
@@ -971,7 +979,10 @@ public class RouterUtils {
}
}
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
()))
{
...
...
@@ -980,10 +991,13 @@ public class RouterUtils {
//遍历当前节点审批人
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
()))
{
return
;
//执行中
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
...
...
@@ -1120,7 +1134,8 @@ public class RouterUtils {
}
//判断大节点为未执行
}
else
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
}
else
if
(
UNEXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
//判断无下一个审批人 并且 执行中的小于等于1
if
(!
hasNextApprover
&&
es
<=
1
)
{
switch
(
listFlowChildren
.
get
(
i
).
getClassName
())
{
...
...
@@ -1252,11 +1267,8 @@ public class RouterUtils {
}
}
//重新新修改审批结果
}
else
if
(
EXECUTED
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
())){
SpmkExecutor
.
builder
().
id
(
executorId
).
sts
(
sts
).
opinion
(
opinion
).
build
().
updateById
();
SpmkApproveExecuteRecord
.
builder
().
id
(
executeRecordId
).
sts
(
sts
).
build
().
updateById
();
return
;
}
}
for
(
int
i
=
0
;
i
<
listFlowChildren
.
size
();
i
++)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/qyxx/CmsIsReadMapper.xml
View file @
f32793c3
...
...
@@ -45,19 +45,27 @@
a.read_time ASC
</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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test ='null !=
mid'> #{mid}, </if> <if test ='null != uid'> #{uid} </if> </trim> </insert>
<delete id="delete" > DELETE FROM cms_is_read WHERE id = #{id} </delete>
<update id="update" parameterType="cn.timer.api.bean.cmsI.CmsIsRead"> UPDATE
cms_is_read <set> <if test ='null != mid'>mid = #{mid},</if> <if test ='null
!= uid'>uid = #{uid}</if> </set> WHERE id = #{id} </update> <select id="load"
resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM
cms_is_read WHERE id = #{id} </select> <select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM cms_is_read LIMIT #{offset},
#{pageSize} </select> <select id="pageListCount" resultType="java.lang.Integer">
<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>
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test ='null !=
mid'> #{mid}, </if> <if test ='null != uid'> #{uid} </if> </trim> </insert>
<delete id="delete" > DELETE FROM cms_is_read WHERE id = #{id} </delete>
<update id="update" parameterType="cn.timer.api.bean.cmsI.CmsIsRead"> UPDATE
cms_is_read <set> <if test ='null != mid'>mid = #{mid},</if> <if test ='null
!= uid'>uid = #{uid}</if> </set> WHERE id = #{id} </update> <select id="load"
resultMap="BaseResultMap"> SELECT <include refid="Base_Column_List" /> FROM
cms_is_read WHERE id = #{id} </select> <select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM cms_is_read LIMIT #{offset},
#{pageSize} </select> <select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1) FROM cms_is_read </select> -->
</mapper>
\ No newline at end of file
</mapper>
This diff is collapsed.
Click to expand it.
src/main/resources/mapping/spmk/SpmkApproveExecuteRecordMapper.xml
View file @
f32793c3
...
...
@@ -172,10 +172,10 @@
WHERE sr.approve_summary_id = #{approveSummaryId} and se.emp_num = #{userId}
</select>
<delete
id=
"delExecutor"
>
DELETE FROM spmk_approve_execute_record
WHERE approve_summary_id = #{approveSummaryId} and id
<![CDATA[ > ]]>
#{id}
<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>
</mapper>
This diff is collapsed.
Click to expand it.
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