This commit is contained in:
那些花儿
2025-07-02 20:09:27 +08:00
parent bc41d3bfd1
commit 9b1221747c
3 changed files with 97 additions and 10 deletions
@@ -5,8 +5,8 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.zhgh.dayofficework.rest.models.RestAct;
@@ -22,6 +22,7 @@ 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 org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@@ -31,7 +32,7 @@ import java.util.List;
@IocBean
@At("/platform/rest/query")
@Ok("json:full")
@Api(tags = "疗休养查询统计接口")
@Api(tags = "疗休养综合查询接口")
public class RestQueryController {
@Inject
@@ -50,6 +51,9 @@ public class RestQueryController {
@ApiOperation("分页查询")
public Result pageData(@Valid RestQueryPageForm pageForm) {
Cnd cnd = Cnd.NEW();
cnd.andEX(RestActSignUp::getRestActId, "=", pageForm.getActId());
cnd.andEX(RestActSignUp::getUnionId, "=", pageForm.getUnionId());
cnd.andEX(RestActSignUp::getUnitId, "=", pageForm.getUnitId());
Pagination pagination = restActSignUpService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
return Result.success(pagination);
}
@@ -65,8 +69,7 @@ public class RestQueryController {
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginName", 20));
entities.add(new ExcelExportEntity("姓名", "name", 20));
entities.add(new ExcelExportEntity("性别", "sex", 20));
entities.add(new ExcelExportEntity("部门", "unitName", 20));
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("分工会", "unionName", 20));
entities.add(new ExcelExportEntity("批次", "batch", 20));
entities.add(new ExcelExportEntity("备注", "remark", 20));
@@ -82,4 +85,13 @@ public class RestQueryController {
e.printStackTrace();
}
}
@At
@SaCheckPermission("rest.query")
@ApiOperation("删除")
@SLog(tag = "疗休养综合查询", msg = "删除报名人员,报名记录ID:${args[0]}")
public Result delete(@Param("id") @Valid String id) {
restActSignUpService.delete(id);
return Result.success();
}
}
@@ -17,4 +17,10 @@ public class RestQueryPageForm extends PageForm {
@ApiModelProperty("批次")
private String batch;
@ApiModelProperty("分工会ID")
private String unionId;
@ApiModelProperty("单位ID")
private String unitId;
}
@@ -5,14 +5,47 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<search-item label="年度">
<el-date-picker placeholder="选择年度" type="year" style="width: 100%" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
</search-item>
<search-item label="名称:">
<el-input placeholder="请输入名称查询" clearable v-model="pageForm.searchKeyword"></el-input>
<search-item label="活动">
<el-select v-model="pageForm.activityId" placeholder="请选择活动">
<el-option v-for="item in actOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" filterable clearable style="width: 100%">
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</search-item>
<search-item label="所属单位:">
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" filterable clearable style="width: 100%">
<el-option v-for="item in unitOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<table-tool>
<el-button size="mini" type="primary" icon="el-icon-download" @click="exportExcel">导出</el-button>
</table-tool>
<el-table :data="tableData">
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
<el-table-column prop="loginName" label="工号" show-overflow-tooltip></el-table-column>
<el-table-column prop="userName" label="姓名" show-overflow-tooltip></el-table-column>
<el-table-column prop="unitName" label="单位" show-overflow-tooltip></el-table-column>
<el-table-column prop="unionName" label="分工会" show-overflow-tooltip></el-table-column>
<el-table-column prop="batch" label="批次" show-overflow-tooltip></el-table-column>
<el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100px" fixed="right">
<template slot-scope="{row}">
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</div>
<script>
@@ -23,17 +56,53 @@ layout("/layouts/platform.html"){
return {
pageForm: {
year: new Date().getFullYear().toString(),
searchKeyword: ""
}
searchKeyword: "",
activityId: null
},
actOptions: [],
activityId: null,
unionOptions: [],
unitOptions: []
}
},
methods: {
doSearch() {
this.pageData()
},
listAct() {
this.$axios.post("/platform/rest/common/listAct").then((res) => {
if (res.code === 0) {
this.actOptions = res.data
if (this.actOptions.length > 0) {
this.$set(this.pageForm, "activityId", this.actOptions[0].id)
this.pageData()
}
}
})
},
onDelete(id) {
this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const { code, msg } = await this.$axios.post("/platform/rest/query/delete", { id: id })
if (code === 0) {
this.$message.success(msg)
this.doSearch()
}
})
.catch(() => {})
},
exportExcel() {
this.$downLoad("/platform/rest/query/exportExcel", this.pageForm)
}
},
created() {
this.pageData()
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
this.listAct()
}
})
</script>