From b1708d55a47285c32a401fe3eaa6665b81ae41b2 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 17 Apr 2026 17:13:42 +0800 Subject: [PATCH] commit --- .../app/task/job/SysUserAllRenewJob.java | 2 +- .../ProposalPositiveSecondedController.java | 45 ++- .../transact/ProposalSecondedController.java | 14 +- .../proposal/transact/seconded/index.html | 322 ++++++++++++++---- .../proposal/transact/write/index.html | 2 +- .../staffmanage/member/info/board/index.html | 237 +++++++++---- .../proposal/transact/seconded/index.html | 211 ++++++++++-- 7 files changed, 639 insertions(+), 194 deletions(-) diff --git a/src/main/java/com/budwk/app/task/job/SysUserAllRenewJob.java b/src/main/java/com/budwk/app/task/job/SysUserAllRenewJob.java index 6d20f36..4ca0a98 100644 --- a/src/main/java/com/budwk/app/task/job/SysUserAllRenewJob.java +++ b/src/main/java/com/budwk/app/task/job/SysUserAllRenewJob.java @@ -57,6 +57,6 @@ public class SysUserAllRenewJob implements Job { param.setUpdateMode(SysDataUpdateMode.ALL.name()); param.setConditionGroup(conditionGroup); - // sysDataUserUpdateService.update(param); + sysDataUserUpdateService.update(param); } } diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPositiveSecondedController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPositiveSecondedController.java index ce179d2..72c4f91 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPositiveSecondedController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalPositiveSecondedController.java @@ -60,19 +60,25 @@ public class ProposalPositiveSecondedController { @At("") @Ok("beetl:/platform/zhgh/democratic/proposal/transact/positiveSeconded/index.html") - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public void index() { } @At("/h5") @Ok("beetl:/platform/zhghh5/democratic/proposal/transact/positiveSeconded/index.html") - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public void h5Index() { } @At - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) { + // 主动附议查询规则: + // 1. 受邀附议的提案不能出现在主动附议中; + // 2. 自己发起的提案不能出现在主动附议“未附议”中; + // 3. 主动附议“未附议”只展示:未被邀请、不是自己写、自己还没主动附议过的提案; + // 4. 主动附议“已附议”只展示:本人已经主动附议过的提案,不混入受邀附议记录; + // 5. 受邀附议识别同时兼容 proposal_second.mode=1 的新数据和 second 节点办理人的历史流程数据。 Sql sql = Sqls.create(""" SELECT info.*, @@ -104,7 +110,34 @@ public class ProposalPositiveSecondedController { cnd.and("ps.seconderId", "=", SecurityUtil.getUserId()); cnd.and("ps.mode", "=", false); cnd.and("ps.isAgree", "is not", null); + // 已附议列表也排除“被邀请附议”的提案,保证这里只展示主动附议记录。 + cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and mode = 1)".formatted(SecurityUtil.getUserId()))); + cnd.and(new Static(""" + info.id not in ( + select ins2.businessNo + from wf_process_instance ins2 + inner join wf_process_task t2 on t2.processInstanceId = ins2.id and t2.taskName = 'second' + inner join wf_process_task_actor ta2 on ta2.processTaskId = t2.id + where ta2.actorId = '%s' + ) + """.formatted(SecurityUtil.getUserId()))); } else { + // 未附议列表中排除自己发起的提案,已附议列表保留本人已主动附议记录。 + cnd.and("info.createdBy", "!=", SecurityUtil.getUserId()); + // 主动附议列表只查询当前用户可主动附议的提案。 + // 这里同时兼容两类受邀附议识别方式: + // 1. proposal_second.mode = 1 的新数据; + // 2. 流程中存在当前用户的 second 节点办理记录的历史数据。 + cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and mode = 1)".formatted(SecurityUtil.getUserId()))); + cnd.and(new Static(""" + info.id not in ( + select ins2.businessNo + from wf_process_instance ins2 + inner join wf_process_task t2 on t2.processInstanceId = ins2.id and t2.taskName = 'second' + inner join wf_process_task_actor ta2 on ta2.processTaskId = t2.id + where ta2.actorId = '%s' + ) + """.formatted(SecurityUtil.getUserId()))); cnd.and(new Static("info.id not in (select proposalId from proposal_second where seconderId = '%s' and isAgree is not null)".formatted(SecurityUtil.getUserId()))); } @@ -119,7 +152,7 @@ public class ProposalPositiveSecondedController { @Aop(TransAop.READ_COMMITTED) @ApiOperation("主动附议") @SLog(tag = "提案管理系统-主动附议", msg = "主动附议") - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public Result handle(@Param("proposalId") String proposalId, @Param("opinion") String opinion, @Param("submitType") Integer submitType) { @@ -158,14 +191,14 @@ public class ProposalPositiveSecondedController { } @At - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public Result listPositiveSeconded(String bizId) { List list = dao.query(ProposalSecond.class, Cnd.where(ProposalSecond::getProposalId, "=", bizId).and(ProposalSecond::getMode, "=", false)); return Result.success(list); } @At - @SaCheckPermission(value = {"proposal.positiveSeconded", "proposal.positiveSeconded.h5"}, mode = SaMode.OR) + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public Result validateTime() { ProposalConfig config = dao.fetch(ProposalConfig.class, Cnd.NEW()); if(System.currentTimeMillis() < config.getSecondedStartTime().getTime()) { diff --git a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalSecondedController.java b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalSecondedController.java index c544b56..354e833 100644 --- a/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalSecondedController.java +++ b/src/main/java/com/budwk/app/zhgh/democratic/proposal/controller/transact/ProposalSecondedController.java @@ -1,6 +1,7 @@ package com.budwk.app.zhgh.democratic.proposal.controller.transact; import cn.dev33.satoken.annotation.SaCheckPermission; +import cn.dev33.satoken.annotation.SaMode; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.budwk.app.base.annotation.SLog; @@ -60,19 +61,24 @@ public class ProposalSecondedController { @At("") @Ok("beetl:/platform/zhgh/democratic/proposal/transact/seconded/index.html") - @SaCheckPermission("proposal.seconded") + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public void index() { } @At("/h5") @Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html") - @SaCheckPermission("proposal.seconded") + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public void h5Index() { } @At - @SaCheckPermission("proposal.seconded") + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) public Result pageData(@Valid ProposalSearchParam pageForm, boolean approval) { + // 受邀附议查询规则: + // 1. 只查询流程中的 second 节点任务,即“被邀请附议”的提案; + // 2. 未附议:查询当前用户待办中的 second 任务; + // 3. 已附议:查询当前用户已办/中断的 second 任务; + // 4. 这里不处理主动附议口径,主动附议由 positiveSeconded 独立查询。 Sql sql = Sqls.create(""" SELECT info.*, @@ -134,7 +140,7 @@ public class ProposalSecondedController { } @At - @SaCheckPermission("proposal.seconded") + @SaCheckPermission(value = {"proposal.seconded", "h5.proposal.seconded"}, mode = SaMode.OR) @Aop(TransAop.READ_COMMITTED) @ApiOperation("修改提案附议信息") @SLog(tag = "提案管理系统-附议提案", msg = "修改提案附议信息") diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/seconded/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/seconded/index.html index 5e10f08..0b08252 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/seconded/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/seconded/index.html @@ -1,26 +1,51 @@ - -
+
- - + + + + + + + + + + + + + + 受邀附议 + + + + + + 主动附议 + + + + 已附议 @@ -54,10 +79,7 @@ layout("/layouts/platform.html"){ @@ -68,7 +90,7 @@ layout("/layouts/platform.html"){
- {{formData.taskName}} + {{approvalTitle}}
@@ -98,122 +120,274 @@ layout("/layouts/platform.html"){ components: { "proposal-info": PROPOSAL_INFO }, - data() { + data: function () { return { - tableColumns: [ + activeTab: "inviteSeconded", + inviteColumns: [ {label: "提案编号", prop: "code"}, {label: "提案名称", prop: "name", width: "200px"}, {label: "提案人", prop: "createUserName"}, {label: "提案类别", prop: "typeName"}, {label: "代表团", prop: "delegationName"}, - {label: "附议人", prop: "taskActorName"}, + // {label: "附议人", prop: "taskActorName"}, {label: "当前节点", prop: "curTaskName"}, {label: "流程状态", prop: "instanceState"} ], + positiveColumns: [ + {label: "提案编号", prop: "code"}, + {label: "提案名称", prop: "name", width: "200px"}, + {label: "提案人", prop: "createUserName"}, + {label: "提案类别", prop: "typeName"}, + {label: "代表团", prop: "delegationName"}, + {label: "当前节点", prop: "taskName"}, + {label: "流程状态", prop: "instanceState"} + ], + tableColumns: [], pageForm: { - approval: false + approval: false, + name: "", + sessionId: null, + createUserKeyword: "", + delegationId: null, + pageNumber: 1, + pageSize: 10, + totalCount: 0, + pageOrderName: "", + pageOrderBy: "" }, showApprovalForm: false, sessionOptions: [], delegationOptions: [], - row: {}, + row: {} + } + }, + computed: { + approvalTitle: function () { + if (this.activeTab === "inviteSeconded") { + return this.formData.taskName + } + return "主动附议" + }, + searchPlaceholder: function () { + if (this.activeTab === "inviteSeconded") { + return { + session: "所属教代会", + name: "提案名称" + } + } + return { + session: "请选择所属教代会", + name: "请输入提案名称" + } } }, methods: { - openView(row) { + // 根据当前页签切换表头,避免和公共 mixin 中同名字段冲突。 + syncTableColumns: function () { + if (this.activeTab === "inviteSeconded") { + this.$set(this, "tableColumns", this.inviteColumns) + } else { + this.$set(this, "tableColumns", this.positiveColumns) + } + }, + + currentPageDataUrl: function () { + if (this.activeTab === "inviteSeconded") { + return "/platform/proposal/seconded/pageData" + } + return "/platform/proposal/positiveSeconded/pageData" + }, + + // 切换附议类型时,保留顶部搜索卡片和列表卡片,只刷新当前页签数据。 + tabChange: function () { + this.syncTableColumns() + this.$set(this, "tableData", []) + if (this.activeTab !== "positiveSeconded") { + this.$set(this.pageForm, "createUserKeyword", "") + this.$set(this.pageForm, "delegationId", null) + } + this.doSearch() + }, + + doSearch: function () { + this.tableKey = new Date().getTime() + this.$set(this.pageForm, "pageNumber", 1) + this.pageData() + }, + + pageOrder: function (column) { + this.$set(this.pageForm, "pageOrderName", column.prop) + this.$set(this.pageForm, "pageOrderBy", column.order) + this.pageData() + }, + + pageNumberChange: function (val) { + this.$set(this.pageForm, "pageNumber", val) + this.pageData() + }, + + pageSizeChange: function (val) { + this.$set(this.pageForm, "pageSize", val) + this.pageData() + }, + + pageData: function () { + this.tableLoading = true + this.$axios.post(this.currentPageDataUrl(), this.pageForm).then((res) => { + this.tableLoading = false + if (res.code === 0) { + this.$set(this, "tableData", res.data.list) + this.$set(this.pageForm, "totalCount", res.data.totalCount) + } + }) + }, + + showAuditButton: function (row) { + if (this.activeTab === "inviteSeconded") { + return row.taskState === 10 + } + return row.count === 0 + }, + + openView: function (row) { this.$refs.guava.edit(() => { - this.showApprovalForm = false + this.$set(this, "showApprovalForm", false) this.$refs.proposalInfoRef.onOpen(row) }) }, - openAudit(row) { - this.row = row + + openAudit: async function (row) { + if (this.activeTab === "positiveSeconded") { + var validatePass = await this.validatePositiveTime() + if (!validatePass) { + return + } + } + this.$set(this, "row", row) this.$refs.guava.edit(() => { - this.showApprovalForm = true - this.formData = { - processTaskId: row.taskId, - sessionId: row.sessionId, - delegationId: row.delegationId, - taskName: row.curTaskName, - tf_opinion: "同意该提案" + this.$set(this, "showApprovalForm", true) + if (this.activeTab === "inviteSeconded") { + this.$set(this, "formData", { + processTaskId: row.taskId, + sessionId: row.sessionId, + delegationId: row.delegationId, + taskName: row.curTaskName, + tf_opinion: "同意该提案" + }) + } else { + this.$set(this, "formData", { + processTaskId: row.taskId, + taskName: row.curTaskName, + tf_opinion: "同意该提案" + }) } this.$refs.proposalInfoRef.onOpen(row) }) }, - handleTaskAction(val) { - this.$refs.formRef.validate(valid => { + handleTaskAction: function (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() - this.updateSecond(val) - } - }) - }) - }) - }, - - updateSecond(submitType) { - this.$axios.post("/platform/proposal/seconded/updateInfo", { - proposalId: this.row.id, - taskActorUserId: this.row.taskActorUserId, - opinion: this.formData.tf_opinion, - submitType: submitType, - }) - }, - - onRevoke(row) { - this.$confirm("您确定要撤回吗?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "info" - }).then(() => { - this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => { - if (res.code === 0) { - this.$message.success(res.msg) - this.doSearch() + if (this.activeTab === "inviteSeconded") { + this.handleInviteSeconded(val) + } else { + this.handlePositiveSeconded(val) } }) }) }, - // 教代会 - async meetingChange(val) { - this.formData.delegationId = null - this.formData.committeeId = null + // 受邀附议需要先执行流程任务,再同步附议结果。 + handleInviteSeconded: function (val) { + this.$axios.post("/flow/common/executeTask", { + data: JSON.stringify({ + ...this.formData, + submitType: val + }) + }).then((res) => { + if (res.code === 0) { + this.updateInviteSeconded(val) + this.$refs.guava.index() + this.$message.success(res.msg) + this.doSearch() + } + }) + }, + + updateInviteSeconded: function (submitType) { + this.$axios.post("/platform/proposal/seconded/updateInfo", { + proposalId: this.row.id, + taskActorUserId: this.row.taskActorUserId, + opinion: this.formData.tf_opinion, + submitType: submitType + }) + }, + + // 主动附议走独立业务接口处理。 + handlePositiveSeconded: function (val) { + this.$axios.post("/platform/proposal/positiveSeconded/handle", { + proposalId: this.row.id, + opinion: this.formData.tf_opinion, + submitType: val + }).then((res) => { + if (res.code === 0) { + this.$refs.guava.index() + this.$message.success(res.msg) + this.doSearch() + } + }) + }, + + validatePositiveTime: function () { + return this.$axios.post("/platform/proposal/positiveSeconded/validateTime").then((res) => { + if (res.code !== 0) { + this.$message.error(res.msg) + return false + } + return true + }) + }, + + meetingChange: function () { + if (this.activeTab === "positiveSeconded") { + this.$set(this.pageForm, "delegationId", null) + this.listDelegation() + } this.doSearch() }, - // 查询开启的教代会 - listOpenSession() { + listOpenSession: function () { this.$axios.post("/platform/proposal/common/listOpenSession").then((res) => { if (res.code === 0) { - this.sessionOptions = res.data - if (this.sessionOptions) { + this.$set(this, "sessionOptions", res.data) + if (this.sessionOptions && this.sessionOptions.length > 0) { this.$set(this.pageForm, "sessionId", this.sessionOptions[0].id) this.pageData() this.listDelegation() } } }) - } + }, + listDelegation: function () { + if (!this.pageForm.sessionId) { + this.$set(this, "delegationOptions", []) + return + } + this.$axios.post("/platform/proposal/common/listDelegation", {sessionId: this.pageForm.sessionId}).then((res) => { + if (res.code === 0) { + this.$set(this, "delegationOptions", res.data) + } + }) + } }, - created() { - this.pageData() + created: function () { + this.syncTableColumns() this.listOpenSession() } }) diff --git a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/write/index.html b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/write/index.html index 04b4805..8287794 100644 --- a/src/main/resources/views/platform/zhgh/democratic/proposal/transact/write/index.html +++ b/src/main/resources/views/platform/zhgh/democratic/proposal/transact/write/index.html @@ -153,7 +153,7 @@ layout("/layouts/platform.html"){ -