From 2c7b5c16f750e4008240feea9c3d91f0d7cc586e Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Thu, 12 Mar 2026 10:50:28 +0800 Subject: [PATCH] commit --- .../controller/FlowTodoCenterController.java | 11 +- .../app/flow/engine/model/TaskModel.java | 2 + .../budwk/app/flow/entity/ProcessTask.java | 5 +- .../service/impl/ProcessTaskServiceImpl.java | 6 +- .../ProposalPersonnelOfficeController.java | 121 +++++++ .../views/platform/flow/design/designer.html | 342 +++++++++--------- .../transact/personnelOffice/index.html | 210 +++++++++++ .../proposal/transact/mine/index.html | 2 +- .../transact/personnelOffice/index.html | 190 ++++++++++ .../views/platform/zhghh5/sys/home/todo.js | 16 +- 10 files changed, 719 insertions(+), 186 deletions(-) create mode 100644 src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPersonnelOfficeController.java create mode 100644 src/main/resources/views/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html create mode 100644 src/main/resources/views/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html diff --git a/src/main/java/com/budwk/app/flow/controller/FlowTodoCenterController.java b/src/main/java/com/budwk/app/flow/controller/FlowTodoCenterController.java index 42d67b6c..11fcd5ae 100644 --- a/src/main/java/com/budwk/app/flow/controller/FlowTodoCenterController.java +++ b/src/main/java/com/budwk/app/flow/controller/FlowTodoCenterController.java @@ -48,6 +48,7 @@ public class FlowTodoCenterController { t.displayName AS taskName, t.taskState, t.formKey, + t.h5FormKey, t.createdAt, t.finishTime, t.variable, @@ -92,6 +93,7 @@ public class FlowTodoCenterController { t.displayName AS taskName, t.taskState, t.formKey, + t.h5FormKey, t.createdAt, t.finishTime, t.variable, @@ -115,6 +117,7 @@ public class FlowTodoCenterController { if (StrUtil.isNotBlank(searchKeyword)) { cnd.where().andLike("ins.variable ->> '$.instanceName'", searchKeyword); } + cnd.and("t.taskName", "!=", "startTask"); cnd.desc("t.createdAt"); sql.setCondition(cnd); Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql); @@ -140,10 +143,12 @@ public class FlowTodoCenterController { ins.createdAt, ins.variable ->> '$.instanceName' AS instanceName, GROUP_CONCAT(DISTINCT t.displayName) as taskName, - cat.`name` categoryName + cat.`name` categoryName, + t.formKey, + t.h5FormKey FROM wf_process_instance ins - LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id and t.taskState = 10 + LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id and t.taskName = 'startTask' LEFT JOIN wf_process_define def ON def.id = ins.processDefineId LEFT JOIN wf_process_category cat ON cat.id = def.category $condition @@ -179,7 +184,7 @@ public class FlowTodoCenterController { ins.variable, ins.createdAt, ins.variable ->> '$.instanceName' AS instanceName, - cat.`name` categoryName + cat.`name` categoryName FROM wf_process_instance ins LEFT JOIN wf_process_define def ON def.id = ins.processDefineId diff --git a/src/main/java/com/budwk/app/flow/engine/model/TaskModel.java b/src/main/java/com/budwk/app/flow/engine/model/TaskModel.java index 84d521d2..821b54c0 100644 --- a/src/main/java/com/budwk/app/flow/engine/model/TaskModel.java +++ b/src/main/java/com/budwk/app/flow/engine/model/TaskModel.java @@ -41,6 +41,8 @@ public class TaskModel extends NodeModel { */ private String countersignCompletionCondition; + private String h5form; + @Override public void exec(Execution execution) { // 执行任务节点自定义执行逻辑 diff --git a/src/main/java/com/budwk/app/flow/entity/ProcessTask.java b/src/main/java/com/budwk/app/flow/entity/ProcessTask.java index 072cadfc..ee1647eb 100644 --- a/src/main/java/com/budwk/app/flow/entity/ProcessTask.java +++ b/src/main/java/com/budwk/app/flow/entity/ProcessTask.java @@ -8,7 +8,6 @@ import org.nutz.dao.entity.annotation.Comment; import org.nutz.dao.entity.annotation.Id; import org.nutz.dao.entity.annotation.Table; -import java.io.Serializable; import java.util.Date; /** @@ -66,6 +65,10 @@ public class ProcessTask extends BaseModel { @Column private String formKey; + @Comment("h5任务处理表单KEY") + @Column + private String h5FormKey; + @Comment("父任务ID") @Column private Long taskParentId; diff --git a/src/main/java/com/budwk/app/flow/service/impl/ProcessTaskServiceImpl.java b/src/main/java/com/budwk/app/flow/service/impl/ProcessTaskServiceImpl.java index 85a80d6e..95f14c74 100644 --- a/src/main/java/com/budwk/app/flow/service/impl/ProcessTaskServiceImpl.java +++ b/src/main/java/com/budwk/app/flow/service/impl/ProcessTaskServiceImpl.java @@ -8,7 +8,6 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; -import com.budwk.app.base.constant.RoleConstant; import com.budwk.app.base.exception.BaseException; import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.base.vo.LabelValueVO; @@ -31,7 +30,6 @@ import com.budwk.app.flow.service.ProcessDefineService; import com.budwk.app.flow.service.ProcessInstanceService; import com.budwk.app.flow.service.ProcessTaskService; import com.budwk.app.flow.vo.ProcessTaskVO; -import com.budwk.app.web.commons.auth.utils.AuthUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; @@ -176,6 +174,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl impleme processTask.setTaskState(ProcessTaskStateEnum.DOING.getCode()); processTask.setTaskType(taskModel.getTaskType().getCode()); processTask.setFormKey(taskModel.getForm()); + processTask.setH5FormKey(taskModel.getH5form()); processTask.setProcessInstanceId(execution.getProcessInstanceId()); // 增加是否为第一个任务节点标识 @@ -283,7 +282,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl impleme @Override public boolean isAllowed(ProcessTask task, String operator) { // 执行者为超级管理员或自动执行用户 - if (AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) || FlowConst.ADMIN_ID.equalsIgnoreCase(operator) || FlowConst.AUTO_ID.equalsIgnoreCase(operator)) { + if (FlowConst.ADMIN_ID.equalsIgnoreCase(operator) || FlowConst.AUTO_ID.equalsIgnoreCase(operator)) { return true; } // 任务操作者==执行者 @@ -392,6 +391,7 @@ public class ProcessTaskServiceImpl extends BaseServiceImpl impleme processTask.setTaskState(ProcessTaskStateEnum.DOING.getCode()); processTask.setTaskType(taskModel.getTaskType().getCode()); processTask.setProcessInstanceId(execution.getProcessInstanceId()); + processTask.setH5FormKey(taskModel.getH5form()); // 增加是否为第一个任务节点标识 execution.getArgs().put(FlowConst.IS_FIRST_TASK_NODE, FlowUtil.isFistTaskName(execution.getProcessModel(), taskModel.getName())); diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPersonnelOfficeController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPersonnelOfficeController.java new file mode 100644 index 00000000..cf3dc382 --- /dev/null +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPersonnelOfficeController.java @@ -0,0 +1,121 @@ +package com.budwk.app.zhgh.democratic.proposal.controller.transact; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import com.budwk.app.base.constant.RoleConstant; +import com.budwk.app.base.page.Pagination; +import com.budwk.app.base.result.Result; +import com.budwk.app.base.service.BaseService; +import com.budwk.app.bpm.service.BpmService; +import com.budwk.app.flow.enums.ProcessTaskStateEnum; +import com.budwk.app.web.commons.auth.utils.AuthUtil; +import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.zhgh.democratic.proposal.param.ProposalSearchParam; +import com.budwk.app.zhgh.democratic.proposal.service.ProposalDelegationService; +import com.budwk.app.zhgh.democratic.proposal.service.common.ProposalCommonService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; +import org.nutz.mvc.annotation.At; +import org.nutz.mvc.annotation.Ok; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author zhf + * @date 2026/3/12 09:36 + * @description 人事处审核 + */ +@IocBean +@At("/platform/proposal/personnelOffice") +@Slf4j +@Ok("json:full") +@Api(tags = "提案-办理-人事处审核") +public class ProposalPersonnelOfficeController { + + @Inject + private BaseService baseService; + @Inject + private ProposalCommonService proposalCommonService; + @Inject + private ProposalDelegationService proposalDelegationService; + @Inject + private BpmService bpmService; + + @At("") + @Ok("beetl:/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html") + @SaCheckPermission("proposal.personnelOffice") + public void index() { + } + + @At("/h5") + @Ok("beetl:/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html") + @SaCheckPermission("h5.proposal.personnelOffice") + public void h5Index() { + } + + + @At + @SaCheckPermission("proposal.personnelOffice") + @ApiOperation("分页列表") + public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) { + Sql sql = Sqls.create(""" + SELECT + info.*, + type.name AS typeName, + tcs.fullName AS sessionName, + tcd.`name` AS delegationName, + ins.id AS instanceId, + ins.businessNo, + ins.state instanceState, + ins.variable instanceVariable, + ins.processDefineId instanceProcessDefineId, + t.id taskId, + t.taskName AS taskKey, + t.displayName taskName, + t.taskType, + t.performType taskPerformType, + t.taskState, + t.finishTime, + t.taskParentId, + t.variable taskVariable, + IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName, + IF(rt.id IS NOT NULL, 1, 0) AS canRevoke + FROM + wf_process_task t + LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId + LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id + LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10 + LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10 + LEFT JOIN proposal_info info ON info.id = ins.businessNo + LEFT JOIN proposal_type type on type.id = info.typeId + LEFT JOIN teacher_congress_session tcs on tcs.id = info.sessionId + LEFT JOIN teacher_congress_delegation tcd on tcd.id = info.delegationId + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("t.taskName", "=", "personnelOffice"); + + if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())){ + cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId())); + } + + if (approval) { + cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode())); + } else { + cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode()); + } + ProposalSearchParam.buildSearch(cnd, pageForm); + cnd.groupBy("t.id"); + cnd.desc("t.createdAt"); + sql.setCondition(cnd); + Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(), sql); + return Result.success(pagination); + } + +} diff --git a/src/main/resources/views/platform/flow/design/designer.html b/src/main/resources/views/platform/flow/design/designer.html index fdcf02e7..e72586b3 100644 --- a/src/main/resources/views/platform/flow/design/designer.html +++ b/src/main/resources/views/platform/flow/design/designer.html @@ -1,187 +1,191 @@ - - - - - 流程设计器 - - - - - - - - - - - - - - - - -
- + + + 流程设计器 + + + + + + + + + + + + + + + + +
+ - - - - - + > + - + - + - + - - - - - - - -
- - + }, + computed: { + startNodeNextNodeIds() { + if (this.$refs.designer && this.$refs.designer.lf) { + const graphData = this.$refs.designer.lf.getGraphData() + if (graphData) { + const { nodes, edges } = graphData + const startNode = nodes.find((v) => v.type === "snaker:start") + if (startNode) { + const targetNodeIds = edges.filter((v) => v.sourceNodeId === startNode.id).map((v) => v.targetNodeId) + return targetNodeIds + } + } + } + return [] + } + }, + methods: { + handleSave(val) { + const design = { + ...this.designerData, + content: val.json + } + $.post("/flow/design/updateContent", { design: JSON.stringify(design) }).then((res) => { + if (res.code === 0) { + window.parent.postMessage("success") + } else { + window.parent.postMessage("error") + } + }) + }, + getDetail() { + $.get("/flow/design/detail", { id: this.id }).then((res) => { + if (res.code === 0) { + this.designerData = res.data + if (res.data.content) { + this.flowData = res.data.content + } else { + this.flowData = {} + } + } + }) + }, + + init() { + $.get("/flow/design/assigmentHandlerClass").then((res) => { + if (res.code === 0) { + this.assignmentHandlerClassOptions = res.data + } + }) + $.get("/flow/design/candidateHandlerClass").then((res) => { + if (res.code === 0) { + this.candidateHandlerClassOptions = res.data + } + }) + }, + + getData() { + console.log(this.$refs.designer) + } + }, + created() { + this.init() + }, + mounted() { + if (this.id) { + this.getDetail() + } + } + }) + diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html new file mode 100644 index 00000000..1e17aecd --- /dev/null +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/personnelOffice/index.html @@ -0,0 +1,210 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html index 86f28a34..7686afa2 100644 --- a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html +++ b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/mine/index.html @@ -48,7 +48,7 @@ layout("/layouts/platform_h5.html"){ 撤回
+ @click="onDelete(row.id)"> 删除
diff --git a/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html new file mode 100644 index 00000000..d716406d --- /dev/null +++ b/src/main/resources/views/platform/zhghh5/democratic/proposal/transact/personnelOffice/index.html @@ -0,0 +1,190 @@ + +
+ + + + + + + + + + + + + + + + + + +
+
{{formData.taskName}}
+ + + +
+ 退回 + 不同意 + 同意 +
+
+
+ +
+ + diff --git a/src/main/resources/views/platform/zhghh5/sys/home/todo.js b/src/main/resources/views/platform/zhghh5/sys/home/todo.js index de2eaff8..b3092b2a 100644 --- a/src/main/resources/views/platform/zhghh5/sys/home/todo.js +++ b/src/main/resources/views/platform/zhghh5/sys/home/todo.js @@ -46,9 +46,7 @@ const todo = { title="variable.instanceName">