This commit is contained in:
=
2026-05-22 15:25:33 +08:00
parent 3d67c3a347
commit 7826beadfe
8 changed files with 164 additions and 48 deletions
@@ -0,0 +1,64 @@
package com.budwk.app.flow.handler;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.flow.engine.AssignmentHandler;
import com.budwk.app.flow.engine.core.Execution;
import com.budwk.app.flow.engine.core.ServiceContext;
import com.budwk.app.flow.engine.model.TaskModel;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import java.util.List;
/**
* 校工会福利管理员参与者处理类。
*/
public class FlowSchoolUnionWelfareAdminAssignmentHandler implements AssignmentHandler {
/**
* 根据校工会福利管理员角色查询流程任务参与者。
*
* @param model 当前任务模型
* @param execution 当前流程执行上下文
* @return 校工会福利管理员用户ID列表
*/
@Override
public List<String> assign(TaskModel model, Execution execution) {
Dao dao = ServiceContext.find(Dao.class);
Sql sql = Sqls.create("""
SELECT
userRole.userId
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
WHERE
role.`code` = @roleCode
GROUP BY
userRole.userId
""").setParam("roleCode", RoleConstant.SCHOOL_UNION_WELFARE_ADMIN.name());
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
return sql.getList(String.class);
}
/**
* 返回流程设计器下拉框显示名称。
*
* @return 处理类显示名称
*/
@Override
public String getMessage() {
return "获取校工会福利管理员";
}
/**
* 返回流程设计器下拉框排序值。
*
* @return 处理类排序值
*/
@Override
public int getOrder() {
return AssignmentHandler.super.getOrder();
}
}
@@ -242,6 +242,7 @@ public class CondolenceServiceImpl extends BaseServiceImpl<Condolence> implement
List<ProcessTaskVO> doneTaskVos = getDoneTaskVos(info.getLong("instanceId"));
putApprovalSign(docData, doneTaskVos, "分工会审核", "branchChairmanSign", "branchChairmanSignTime", "branchChairmanTime", "分工会主席填写时间");
putApprovalSign(docData, doneTaskVos, "校工会预审", new String[]{"schoolPrincipalSign", "principalSign"}, "schoolPrincipalSignTime", "schoolPrincipalTime", "校工会预审填写时间");
putApprovalSign(docData, doneTaskVos, "校工会审核", "unionChairmanSign", "unionChairmanSignTime", "unionChairmanTime", "工会主席填写时间");
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
@@ -395,6 +396,13 @@ public class CondolenceServiceImpl extends BaseServiceImpl<Condolence> implement
* 将指定审批节点最近一次签字和填写时间放入模板字段。
*/
private void putApprovalSign(Map<String, Object> docData, List<ProcessTaskVO> doneTaskVos, String taskName, String templateField, String... timeFields) {
putApprovalSign(docData, doneTaskVos, taskName, new String[]{templateField}, timeFields);
}
/**
* 将指定审批节点最近一次签字写入多个模板字段,兼容不同模板占位符命名。
*/
private void putApprovalSign(Map<String, Object> docData, List<ProcessTaskVO> doneTaskVos, String taskName, String[] templateFields, String... timeFields) {
doneTaskVos.stream()
.filter(task -> taskName.equals(task.getDisplayName()))
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
@@ -412,7 +420,7 @@ public class CondolenceServiceImpl extends BaseServiceImpl<Condolence> implement
sign = taskFormData.getStr("tf_sign");
}
if (StrUtil.isNotBlank(sign)) {
putPictureRenderData(docData, sign, templateField);
putPictureRenderData(docData, sign, templateFields);
}
});
}
@@ -146,22 +146,27 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
this.$refs.formRef.validate((valid) => {
if (!valid) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
@@ -68,6 +68,12 @@ const condolenceInfo = {
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3" v-if="!task.ext.isFirstTaskNode">
<el-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></el-image>
<span v-else>暂无</span>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
@@ -101,6 +101,10 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="tf_userSign"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_userSign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -158,28 +162,34 @@ layout("/layouts/platform.html"){
this.showApprovalForm = true
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
tf_userSign: null
}
this.$refs.condolenceInfoRef.onOpen(row)
})
},
handleTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
this.$refs.formRef.validate((valid) => {
if (!valid) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
@@ -169,22 +169,27 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
this.$refs.formRef.validate((valid) => {
if (!valid) {
return
}
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
}
})
})
},
@@ -58,6 +58,12 @@ const condolenceInfo = {
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode" class="direction-column-cell">
<div v-html="task.taskFormData.tf_opinion"></div>
</van-cell>
<van-cell title="签字" v-if="!task.ext.isFirstTaskNode">
<van-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></van-image>
<span v-else>暂无</span>
</van-cell>
</van-cell-group>
</template>
</div>
@@ -70,6 +70,17 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<van-field
class="more-text"
name="tf_userSign"
label="电子签名"
:rules="[{ required: true, message: '请签字' }]"
required
>
<template #input>
<h5-signature v-model="formData.tf_userSign"></h5-signature>
</template>
</van-field>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
@@ -128,7 +139,8 @@ layout("/layouts/platform_h5.html"){
this.$refs.infoRef.onOpen(row)
this.formData = {
processTaskId: row.taskId,
taskName: row.curTaskName
taskName: row.curTaskName,
tf_userSign: null
}
},
async handleTaskAction(val) {