From 1da9b94af22d591457c23e67423bc2e609fab16f Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Tue, 9 Jun 2026 17:06:35 +0800 Subject: [PATCH] commit --- .../transact/OpinionMineController.java | 13 +++- .../OpinionSchoolAuditController.java | 5 +- .../opinion/transact/schoolAudit/index.html | 73 ++++++++++++++----- 3 files changed, 69 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionMineController.java b/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionMineController.java index 0ae6d086..80a6cb78 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionMineController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionMineController.java @@ -78,6 +78,7 @@ public class OpinionMineController { @SaCheckPermission("opinion.mine") @Aop(TransAop.READ_COMMITTED) public Result pageData(@Valid OpinionSearchParam pageForm, String sessionId) { + // 当前节点优先取正在办理的任务;没有待办任务时,按流程实例状态显示最终状态,避免已结束流程误显示为待提交。 Sql sql = Sqls.create(""" SELECT info.*, @@ -98,7 +99,17 @@ public class OpinionMineController { t.finishTime, t.taskParentId, t.variable taskVariable, - IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'待提交') curTaskName, + CASE + WHEN GROUP_CONCAT(DISTINCT nt.displayName) IS NOT NULL THEN GROUP_CONCAT(DISTINCT nt.displayName) + WHEN ins.id IS NULL THEN '待提交' + WHEN ins.state = 20 THEN '已完成' + WHEN ins.state = 30 THEN '已撤回' + WHEN ins.state = 40 THEN '强行终止' + WHEN ins.state = 45 THEN '已拒绝' + WHEN ins.state = 50 THEN '挂起' + WHEN ins.state = 99 THEN '已废弃' + ELSE '待提交' + END curTaskName, IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke, (select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId FROM diff --git a/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionSchoolAuditController.java b/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionSchoolAuditController.java index 31360eb3..b1e64035 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionSchoolAuditController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/opinion/controller/transact/OpinionSchoolAuditController.java @@ -19,6 +19,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.nutz.aop.interceptor.ioc.TransAop; +import org.nutz.dao.Chain; import org.nutz.dao.Cnd; import org.nutz.dao.Dao; import org.nutz.dao.Sqls; @@ -127,8 +128,8 @@ public class OpinionSchoolAuditController { @ApiOperation("修改意见") @SLog(tag = "意见管理系统-校工会审核", msg = "修改意见") public Result edit(@Param("info") OpinionInfo opinionInfo) { - // The school-union audit only edits opinion category here, so update the target field explicitly. - dao.update(opinionInfo); + dao.update(OpinionInfo.class, Chain.make("typeId", opinionInfo.getTypeId()), Cnd.where("id", "=", opinionInfo.getId())); + ProcessInstance instance = dao.fetch(ProcessInstance.class, Cnd.where(ProcessInstance::getBusinessNo, "=", opinionInfo.getId())); Dict dict = FlowUtil.variableToDict(instance.getVariable()); diff --git a/src/main/resources/views/platform/zhgh/democratic/opinion/transact/schoolAudit/index.html b/src/main/resources/views/platform/zhgh/democratic/opinion/transact/schoolAudit/index.html index 50d4018f..ec319928 100644 --- a/src/main/resources/views/platform/zhgh/democratic/opinion/transact/schoolAudit/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/opinion/transact/schoolAudit/index.html @@ -69,12 +69,14 @@ layout("/layouts/platform.html"){ - + 通过 不通过 + 退回发起人修改 @@ -100,7 +103,7 @@ layout("/layouts/platform.html"){ > - + 取消 - 提交 + 提交 @@ -187,6 +190,18 @@ layout("/layouts/platform.html"){ onReady() { this.$refs.basicFormRef.ready(this.row.id, this.row.taskId) }, + // 通过时才需要维护意见类别和承办单位;不通过只填写审核意见,避免退回场景强制选择承办单位。 + isSchoolPass() { + return this.formData.tf_schoolResult === 'YES' + }, + schoolResultChange() { + if (this.isSchoolPass()) { + return + } + this.$nextTick(() => { + this.$refs.formRef && this.$refs.formRef.clearValidate(["typeId", "tf_masterUnitId", "tf_slaveUnitIds"]) + }) + }, openView(row) { this.$refs.guava.edit(() => { this.showApprovalForm = false @@ -210,8 +225,10 @@ layout("/layouts/platform.html"){ }) }, - handleTaskAction(val) { - this.$refs.formRef.validate((valid) => { + handleTaskAction() { + this.schoolResultChange() + this.$nextTick(() => { + this.$refs.formRef.validate((valid) => { if (valid) { this.$confirm("您确定要提交吗?", "提示", { confirmButtonText: "确定", @@ -219,24 +236,24 @@ layout("/layouts/platform.html"){ type: "warning" }).then(() => { const loading = createLoading('提交中') - // The school-union audit can modify opinion type, so persist typeId before completing the workflow task. - this.$axios.post("/platform/opinion/schoolAudit/edit", { - info: JSON.stringify({ + const submitType = this.formData.tf_schoolResult === 'ROLLBACK' ? 6 : 1 + const executeTask = () => { + const taskData = submitType === 6 ? { id: this.formData.id, - typeId: this.formData.typeId - }) - }).then((editRes) => { - if (editRes.code !== 0) { - loading.close() - return + processTaskId: this.formData.processTaskId, + taskName: this.formData.taskName, + roleCode: this.formData.roleCode, + tf_opinion: this.formData.tf_opinion, + } : { + ...this.formData, + tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null, + tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name), + tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','), } this.$axios.post("/flow/common/executeTask", { data: JSON.stringify({ - ...this.formData, - submitType: val, - tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null, - tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name), - tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','), + ...taskData, + submitType: submitType, }) }).then((res) => { if (res.code === 0) { @@ -247,11 +264,29 @@ layout("/layouts/platform.html"){ }).finally(() => { loading.close() }) + } + if (submitType === 6 || !this.isSchoolPass()) { + executeTask() + return + } + // 通过审核时校工会可调整意见类别,需要先保存 typeId,再按流程表 YES 分支继续流转。 + this.$axios.post("/platform/opinion/schoolAudit/edit", { + info: JSON.stringify({ + id: this.formData.id, + typeId: this.formData.typeId + }) + }).then((editRes) => { + if (editRes.code === 0) { + executeTask() + return + } + loading.close() }).catch(() => { loading.close() }) }) } + }) }) },