From bedf31bf0c0aa8a02c8fd27bd2db7df747538424 Mon Sep 17 00:00:00 2001 From: zhouhefeng Date: Thu, 18 Jun 2026 15:33:11 +0800 Subject: [PATCH] commit --- .../TourSchoolUserAssignmentController.java | 29 ++++- .../service/TourUserAssignmentService.java | 27 ++++- .../impl/TourUserAssignmentServiceImpl.java | 58 ++++++++- .../Tour/schoolUserAssignment/index.html | 113 +++++++++++++++++- 4 files changed, 215 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/controller/TourSchoolUserAssignmentController.java b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/controller/TourSchoolUserAssignmentController.java index 977a7f4f..d7f83fa6 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/controller/TourSchoolUserAssignmentController.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/controller/TourSchoolUserAssignmentController.java @@ -52,9 +52,9 @@ public class TourSchoolUserAssignmentController { @At @SaCheckPermission("tour.schoolUserAssignment") public Result pageData(PageForm pageForm, Integer year, String settingId, String matterId, String unionId, - String personType, String keyword, String assignSource) { + String personType, String keyword, String assignSource, Boolean cancelled) { return Result.success(tourUserAssignmentService.schoolAssignmentPage(pageForm, year, settingId, matterId, - unionId, personType, keyword, assignSource)); + unionId, personType, keyword, assignSource, cancelled)); } /** @@ -64,9 +64,9 @@ public class TourSchoolUserAssignmentController { @SaCheckPermission("tour.schoolUserAssignment") @Ok("void") public void exportData(PageForm pageForm, Integer year, String settingId, String matterId, String unionId, - String personType, String keyword, String assignSource, HttpServletResponse response) { + String personType, String keyword, String assignSource, Boolean cancelled, HttpServletResponse response) { List rows = tourUserAssignmentService.schoolAssignmentExportRows(pageForm, year, settingId, matterId, - unionId, personType, keyword, assignSource); + unionId, personType, keyword, assignSource, cancelled); ExportParams exportParams = new ExportParams(); exportParams.setSheetName("校工会人员分配"); exportParams.setType(ExcelType.XSSF); @@ -74,6 +74,27 @@ public class TourSchoolUserAssignmentController { CommonDownloadUtil.download("校工会人员分配.xlsx", workbook, response); } + /** + * 按页面当前查询条件给人员分配列表中的可报名人员发送提醒。 + * 参数包括列表筛选条件和 content 提醒内容;返回 Result,data.receiverCount 表示实际接收人数。 + */ + @At + @Aop(TransAop.READ_COMMITTED) + @SaCheckPermission("tour.schoolUserAssignment") + @SLog(type = "tour", tag = "疗休养校工会人员分配", msg = "发送校工会人员分配提醒") + public Result sendReminder(PageForm pageForm, Integer year, String settingId, String matterId, String unionId, + String personType, String keyword, String assignSource, Boolean cancelled, String content) { + if (StrUtil.isBlank(content)) { + return Result.error("请输入提醒内容"); + } + try { + return Result.success(tourUserAssignmentService.sendSchoolAssignmentReminder(pageForm, year, settingId, + matterId, unionId, personType, keyword, assignSource, cancelled, content)); + } catch (IllegalArgumentException e) { + return Result.error(e.getMessage()); + } + } + /** * 分页查询候选人员,候选范围由疗休养配置的可参加人员范围决定;userIds 仅作为人员选择器筛选条件。 */ diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/TourUserAssignmentService.java b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/TourUserAssignmentService.java index 9b8547b6..f4a983fa 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/TourUserAssignmentService.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/TourUserAssignmentService.java @@ -21,10 +21,12 @@ public interface TourUserAssignmentService extends BaseService schoolAssignmentPage(PageForm pageForm, Integer year, String settingId, String matterId, - String unionId, String personType, String keyword, String assignSource); + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled); /** * 按校工会人员分配页面当前筛选条件查询导出数据,不做分页截断。 @@ -37,10 +39,31 @@ public interface TourUserAssignmentService extends BaseService schoolAssignmentExportRows(PageForm pageForm, Integer year, String settingId, String matterId, - String unionId, String personType, String keyword, String assignSource); + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled); + + /** + * 按校工会人员分配页面当前筛选条件发送报名提醒。 + * + * @param pageForm 排序参数,提醒接收人范围与当前列表筛选口径保持一致,不按当前分页截断 + * @param year 疗休养年度 + * @param settingId 疗休养配置ID + * @param matterId 疗休养事项ID + * @param unionId 所属分工会ID + * @param personType 人员类型:FORMAL 正式人员,BACKUP 替补人员 + * @param keyword 姓名或工号关键字 + * @param assignSource 分配类别:SCHOOL_UNION 校工会分配,BRANCH_UNION 分工会分配;为空时查询全部 + * @param cancelled 是否退出:true 已退出,false 未退出,空时查询全部 + * @param content 提醒内容,由页面弹框输入,不能为空 + * @return 发送结果,receiverCount 表示本次去重后的接收人数 + */ + NutMap sendSchoolAssignmentReminder(PageForm pageForm, Integer year, String settingId, String matterId, + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled, String content); /** * 分页查询校工会可分配候选人,候选人来自疗休养配置的可参加人员范围,并排除同一配置下已分配人员。 diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/impl/TourUserAssignmentServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/impl/TourUserAssignmentServiceImpl.java index 204d53b0..4b39b01d 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/impl/TourUserAssignmentServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/tour/service/impl/TourUserAssignmentServiceImpl.java @@ -2,12 +2,15 @@ package com.budwk.app.zhgh.dayofficework.tour.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONObject; import com.budwk.app.base.page.Pagination; import com.budwk.app.base.param.PageForm; import com.budwk.app.base.service.impl.BaseServiceImpl; import com.budwk.app.sys.models.Sys_config; import com.budwk.app.sys.services.SysConfigService; import com.budwk.app.web.commons.auth.utils.SecurityUtil; +import com.budwk.app.web.commons.base.Globals; +import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService; import com.budwk.app.zhgh.dayofficework.tour.models.*; import com.budwk.app.zhgh.dayofficework.tour.service.TourUserAssignmentService; import org.nutz.dao.Chain; @@ -39,13 +42,17 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl schoolAssignmentPage(PageForm pageForm, Integer year, String settingId, String matterId, - String unionId, String personType, String keyword, String assignSource) { + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled) { Sql sql = Sqls.create(""" SELECT a.*, @@ -70,6 +77,7 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl schoolAssignmentExportRows(PageForm pageForm, Integer year, String settingId, String matterId, - String unionId, String personType, String keyword, String assignSource) { - List rows = assignmentExportRows(pageForm, year, settingId, matterId, unionId, personType, keyword, assignSource); + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled) { + List rows = assignmentExportRows(pageForm, year, settingId, matterId, unionId, personType, keyword, assignSource, cancelled); fillAssignmentExportText(rows); return rows; } + @Override + public NutMap sendSchoolAssignmentReminder(PageForm pageForm, Integer year, String settingId, String matterId, + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled, String content) { + if (StrUtil.isBlank(content)) { + throw new IllegalArgumentException("请输入提醒内容"); + } + List rows = assignmentExportRows(pageForm, year, settingId, matterId, unionId, personType, keyword, assignSource, cancelled); + List receiverIds = rows.stream() + .map(row -> row.getString("userId")) + .filter(StrUtil::isNotBlank) + .distinct() + .collect(Collectors.toList()); + if (Lang.isEmpty(receiverIds)) { + throw new IllegalArgumentException("当前查询条件下暂无可发送人员"); + } + JSONObject config = new JSONObject(); + config.set("pcUrl", Globals.AppDomain + "/platform/tour/schoolUserAssignment"); + config.set("mobileUrl", Globals.AppDomain + "/platform/tooltip/h5"); + globalMessageSendService.sendMessage("疗休养报名提醒", content.trim(), 1, receiverIds, config); + return NutMap.NEW().addv("receiverCount", receiverIds.size()); + } + @Override public Pagination schoolCandidatePage(PageForm pageForm, String settingId, String unionId, String keyword, List userIds) { TourSetting setting = fetchSettingForAssignment(settingId); @@ -128,7 +160,7 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl rows = assignmentExportRows(pageForm, year, settingId, matterId, unionId, personType, keyword, - TourUserAssignment.ASSIGN_SOURCE_BRANCH_UNION); + TourUserAssignment.ASSIGN_SOURCE_BRANCH_UNION, null); fillAssignmentExportText(rows); return rows; } @@ -146,7 +178,8 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl assignmentExportRows(PageForm pageForm, Integer year, String settingId, String matterId, - String unionId, String personType, String keyword, String assignSource) { + String unionId, String personType, String keyword, String assignSource, + Boolean cancelled) { Sql sql = Sqls.create(""" SELECT a.*, @@ -170,6 +203,7 @@ public class TourUserAssignmentServiceImpl extends BaseServiceImpl + + + + + + 人员分配 + 发送提醒 导出 + + + + + + + + + 取消 + 发送 + + + { + if (res.code === 0) { + this.tableData = res.data.list + this.pageForm.totalCount = res.data.totalCount + } + }).finally(() => { + this.tableLoading = false + }) + }, exportData() { const params = new URLSearchParams() - ;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => { + ;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "cancelled", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => { const value = this.pageForm[key] if (value !== undefined && value !== null && value !== "") { params.append(key, value) @@ -452,6 +513,56 @@ layout("/layouts/platform.html"){ }) window.location.href = loc() + "/exportData?" + params.toString() }, + buildCurrentQueryParams() { + const params = {} + ;["year", "settingId", "matterId", "unionId", "personType", "assignSource", "cancelled", "keyword", "pageOrderName", "pageOrderBy"].forEach(key => { + const value = this.pageForm[key] + if (value !== undefined && value !== null && value !== "") { + params[key] = value + } + }) + return params + }, + openRemindDialog() { + if (!this.pageForm.settingId) { + this.$message.warning("请先选择疗休养配置") + return + } + this.remindForm = this.defaultRemindForm() + this.remindDialogVisible = true + }, + resetRemindDialog() { + this.remindForm = this.defaultRemindForm() + this.remindSubmitting = false + if (this.$refs.remindFormRef) { + this.$refs.remindFormRef.clearValidate() + } + }, + doSendReminder() { + this.$refs.remindFormRef.validate((valid) => { + if (!valid) return + const params = this.buildCurrentQueryParams() + params.content = this.remindForm.content + this.$confirm("确定给当前查询结果中的人员发送提醒吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(() => { + this.remindSubmitting = true + this.$axios.post(loc() + "/sendReminder", params).then((res) => { + if (res.code === 0) { + const data = res.data || {} + this.$message.success("提醒发送成功,共发送" + (data.receiverCount || 0) + "人") + this.remindDialogVisible = false + } else { + this.$message.warning(res.msg || "提醒发送失败") + } + }).finally(() => { + this.remindSubmitting = false + }) + }).catch(() => {}) + }) + }, openAssign() { const year = this.pageForm.year || moment().format("YYYY") this.assignForm = this.defaultAssignForm(year)