福利项目开启关闭按钮

This commit is contained in:
=
2025-12-09 17:18:57 +08:00
parent b28a3a81c9
commit 360eb3d9e6
5 changed files with 42 additions and 1 deletions
@@ -83,6 +83,7 @@ public class WelfareMineController {
cnd.and("wp.isDisabled", "=", 0);
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
cnd.andEX("wl.userId", "=", SecurityUtil.getUserId());
cnd.andEX("wp.isUnseal", "=", true);
cnd.desc("wp.choiceTimeStart");
cnd.groupBy("wl.id");
sql.setCondition(cnd);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.welfare.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
@@ -80,6 +81,7 @@ public class WelfareProjectMangeController {
if (StrUtil.isNotBlank(project.getId())) {
projectService.updateProject(project);
} else {
project.setIsUnseal(false);
projectService.saveProject(project);
}
return Result.success();
@@ -146,4 +148,14 @@ public class WelfareProjectMangeController {
return Result.success();
}
@At
@SaCheckPermission("welfare.project.mange")
public Result welfareStatusChange(@Valid String id, @Valid Boolean isUnseal) {
projectService.update(Chain.make("isUnseal", isUnseal), Cnd.where("id", "=", id));
projectService.dao().update(WelfareProject.class,
Chain.make("isUnseal", isUnseal),
Cnd.where("id", "=", id));
return Result.success();
}
}
@@ -70,6 +70,7 @@ public class WelfareUserSelectController {
cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year);
cnd.and("wp.isDisabled", "=", 0);
cnd.groupBy("wp.id");
cnd.andEX("wp.isUnseal", "=", true);
cnd.desc("YEAR(wp.choiceTimeStart)");
sql.setCondition(cnd);
Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -74,6 +74,11 @@ public class WelfareProject extends BaseModel implements SysHomeConvert {
@ColDefine(type = ColType.DATETIME)
private Date choiceTimeEnd;
@Column
@Comment("是否开启")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUnseal;
@Column
@Comment("逾期补发结束时间")
@ColDefine(type = ColType.DATETIME)
@@ -51,6 +51,14 @@ layout("/layouts/platform.html"){
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isUnseal'">
<el-switch
@change="(val)=>{welfareStatusChange(row.id,row.isUnseal)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isUnseal">
</el-switch>
</template>
<!-- <template scope="{row}" v-if="column.prop=='gift'">-->
<!-- <span v-if="row.flexible">福利套餐</span>-->
<!-- <span v-else>{{row.gift}}</span>-->
@@ -261,7 +269,8 @@ layout("/layouts/platform.html"){
{ prop: "year", label: "年度" },
{ prop: "name", label: "项目名称" },
{ prop: "choiceTimeStart", label: "开始选择时间" },
{ prop: "choiceTimeEnd", label: "结束选择时间" }
{ prop: "choiceTimeEnd", label: "结束选择时间" },
{prop: "isUnseal", label: "是否开启"},
// { prop: "gift", label: "福利礼品" },
// { prop: "provideTimeStart", label: "发放时间" }
@@ -296,6 +305,19 @@ layout("/layouts/platform.html"){
this.sendMsg(data)
}
},
async welfareStatusChange(id, isUnseal) {
const resp = await this.$axios.post("/platform/welfare/project/mange/welfareStatusChange", {
id: id,
isUnseal: isUnseal
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
},
async save() {
const formValid = await this.$refs["form"].validate()
if (formValid) {