职工福利-选择福利统计-新增: 导出选择福利统计表;

This commit is contained in:
dd3s_206
2026-03-04 15:50:26 +08:00
parent 17e0fe7a0b
commit c440b56530
2 changed files with 62 additions and 0 deletions
@@ -853,6 +853,53 @@ public class WelfareSingleController {
} }
@At
@ViReturn
@Ok("void")
@RequiresPermissions("welfare.project.statistics.single")
public void statisticsExport(String projectId, HttpServletResponse response) {
WelfareProject welfareProject = dao.fetch(WelfareProject.class, Cnd.where("id", "=", projectId));
String projectName = welfareProject.getName();
NutMap nutMap = welfareSingleService.pageData(projectId, "", "", "", "");
List<NutMap> tableList = nutMap.getAsList("tableList", NutMap.class);
// Json.fromJsonAsList()
for (NutMap map : tableList) {
boolean isAudit = (boolean) map.get("isAudit");
map.setv("isAudit", isAudit ? "已核对" : "未核对");
}
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("所属工会", "welfareUnitName", 50));
exportEntities.add(new ExcelExportEntity("本次福利会员人数", "teacherSum", 20));
//传入动态列 tableColumn
List<NutMap> labelList = nutMap.getAsList("tableColumn", NutMap.class);
for (NutMap labeMap : labelList) {
exportEntities.add(new ExcelExportEntity(labeMap.getString("label"), labeMap.get("prop"), 20));
}
exportEntities.add(new ExcelExportEntity("参加人数", "totalCount", 20));
exportEntities.add(new ExcelExportEntity("未选人数", "unselectedTeacherSum", 20));
exportEntities.add(new ExcelExportEntity("是否核对", "isAudit", 20));
Workbook workbook = new XSSFWorkbook();
ExcelExportService service = new ExcelExportService();
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
exportParams.setTitle(projectName + "选择统计");
exportParams.setSheetName(projectName);
service.createSheetForMap(workbook, exportParams, exportEntities, tableList);
try (ServletOutputStream outputStream = response.getOutputStream()) {
ViTool.excelResponse(response, projectName + "选择统计.xlsx");
workbook.write(outputStream);
} catch (IOException e) {
e.printStackTrace();
}
}
@Data @Data
public static class qlbExportEntityUser { public static class qlbExportEntityUser {
@@ -103,6 +103,16 @@ layout("/layouts/platform.html"){
导出各分工会福利签领表 导出各分工会福利签领表
</el-button> </el-button>
<el-button
@click="statisticsExport"
icon="el-icon-printer"
size="small"
type="primary"
v-if="judgmentAuthority"
>
导出选择福利统计表
</el-button>
<el-button <el-button
@click="welfareProjectGroupExport" @click="welfareProjectGroupExport"
icon="el-icon-printer" icon="el-icon-printer"
@@ -728,6 +738,11 @@ layout("/layouts/platform.html"){
loc() + "/welfareProjectGroupExport?projectId=" + this.pageForm.projectId + "&welfareUnitCode=" + this.pageForm.welfareUnitCode loc() + "/welfareProjectGroupExport?projectId=" + this.pageForm.projectId + "&welfareUnitCode=" + this.pageForm.welfareUnitCode
) )
}, },
statisticsExport() {
window.open(
loc() + "/statisticsExport?projectId=" + this.pageForm.projectId + "&welfareUnitCode=" + this.pageForm.welfareUnitCode
)
},
sendMsg() { sendMsg() {
this.$confirm("您确定要向未领取人员发送短信提醒吗?", "提示", { this.$confirm("您确定要向未领取人员发送短信提醒吗?", "提示", {