diff --git a/src/main/java/com/budwk/app/flow/handler/FlowSchoolUnionWelfareAdminAssignmentHandler.java b/src/main/java/com/budwk/app/flow/handler/FlowSchoolUnionWelfareAdminAssignmentHandler.java new file mode 100644 index 00000000..03d3e16c --- /dev/null +++ b/src/main/java/com/budwk/app/flow/handler/FlowSchoolUnionWelfareAdminAssignmentHandler.java @@ -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 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(); + } +} diff --git a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java index c7997c4c..89050424 100644 --- a/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/staffbenefit/condolence/service/impl/CondolenceServiceImpl.java @@ -242,6 +242,7 @@ public class CondolenceServiceImpl extends BaseServiceImpl implement List 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 implement * 将指定审批节点最近一次签字和填写时间放入模板字段。 */ private void putApprovalSign(Map docData, List doneTaskVos, String taskName, String templateField, String... timeFields) { + putApprovalSign(docData, doneTaskVos, taskName, new String[]{templateField}, timeFields); + } + + /** + * 将指定审批节点最近一次签字写入多个模板字段,兼容不同模板占位符命名。 + */ + private void putApprovalSign(Map docData, List 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 implement sign = taskFormData.getStr("tf_sign"); } if (StrUtil.isNotBlank(sign)) { - putPictureRenderData(docData, sign, templateField); + putPictureRenderData(docData, sign, templateFields); } }); } diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html index b21da14b..fc26c274 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/branchUnionApproval/index.html @@ -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() - } }) }) }, diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/common/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/common/info.js index 79252bfc..79a051e6 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/common/info.js +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/common/info.js @@ -68,6 +68,12 @@ const condolenceInfo = { {{ task.taskFormData.opinion }} + + + 暂无 + diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html index 6283e298..9bae4945 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolPrincipalApproval/index.html @@ -101,6 +101,10 @@ layout("/layouts/platform.html"){ :rules="[{required:true,message:'必填',trigger:['change','blur']}]"> + + + 取消 @@ -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() - } }) }) }, diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html index 47a63a5c..9bae4945 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/condolence/schoolUnionApproval/index.html @@ -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() - } }) }) }, diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/common/info.js b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/common/info.js index 532f959d..322f69d9 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/common/info.js +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/common/info.js @@ -58,6 +58,12 @@ const condolenceInfo = {
+ + + 暂无 + diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html index 974a2503..280a150b 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/condolence/schoolPrincipalApproval/index.html @@ -70,6 +70,17 @@ layout("/layouts/platform_h5.html"){ maxlength="100" show-word-limit > + + +
退回 @@ -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) {