diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/query/TheRapyRecuperationSchoolUnionUserQueryController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/query/TheRapyRecuperationSchoolUnionUserQueryController.java index 514c637..5b4c4e5 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/query/TheRapyRecuperationSchoolUnionUserQueryController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/query/TheRapyRecuperationSchoolUnionUserQueryController.java @@ -161,8 +161,10 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { addTakePartInCondition(cnd, isTakePartIn); - // 校工会可查询指定分工会 - cnd.andEX("enroll.selfUnionId", "=", unionId); + // 分工会为空时查询全部分工会,避免空字符串条件把历史年度数据过滤掉。 + if (StrUtil.isNotBlank(unionId)) { + cnd.andEX("enroll.selfUnionId", "=", unionId); + } // // 报名模式 // if (StrUtil.isNotBlank(signUpMode)) { @@ -428,8 +430,10 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { addTakePartInCondition(cnd, isTakePartIn); - // 校工会可查询指定分工会 - cnd.andEX("enroll.selfUnionId", "=", unionId); + // 分工会为空时导出全部分工会,保持和列表查询一致。 + if (StrUtil.isNotBlank(unionId)) { + cnd.andEX("enroll.selfUnionId", "=", unionId); + } // // 报名模式 // if (StrUtil.isNotBlank(signUpMode)) { diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/statistics/TheRapyRecuperationLineFragmentController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/statistics/TheRapyRecuperationLineFragmentController.java index 8471000..9055e7a 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/statistics/TheRapyRecuperationLineFragmentController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/statistics/TheRapyRecuperationLineFragmentController.java @@ -93,6 +93,12 @@ public class TheRapyRecuperationLineFragmentController { @Param(value = "playStart") String playStart, @Param(value = "playEnd") String playEnd, @Param(value = "regionalNature", required = false) String regionalNature) { + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + // 输入姓名或工号时直接定位人员所在酒店和团期,便于快速打开对应团删除人员。 + boolean selfOnly = !ShiroUtil.hasAnyRoles("sysadmin, SchoolUnionAdmin"); + return enrollService.fragmentUserLocatePageData(pageForm, startYear, endYear, baseManagementId, travelAgencyId, + playStart, playEnd, regionalNature, selfOnly); + } Sql sql = Sqls.create(""" SELECT bm.*, @@ -162,6 +168,8 @@ public class TheRapyRecuperationLineFragmentController { @Param(value = "playStart", required = false) String playStart, @Param(value = "playEnd", required = false) String playEnd, @Param(value = "playCount", required = false) Integer playCount) { + return enrollService.fragmentSignUserPageData(pageForm, takePartInBaseManagementId, specificTime, playStart, playEnd, playCount); + /* Sql sql = Sqls.create(""" SELECT en.id, @@ -183,13 +191,13 @@ public class TheRapyRecuperationLineFragmentController { Cnd cnd = Cnd.NEW(); cnd.and("en.takePartInBaseManagementId", "is not", null); cnd.andEX("en.specificTime", "=", specificTime); - cnd.andEX("en.playCount", "=", playCount); cnd.andEX("REPLACE(REPLACE(SUBSTRING_INDEX(specificTime, '-', 1), '月', '-'), '日', '')", ">=", playStart); cnd.andEX("REPLACE(REPLACE(SUBSTRING_INDEX(specificTime, '-', 1), '月', '-'), '日', '')", "<=", playEnd); cnd.andEX("en.takePartInBaseManagementId", "=", takePartInBaseManagementId); cnd.desc("en.specificTime"); sql.setCondition(cnd); return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + */ } @At diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java index 1128799..6130e5f 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/theRapyConfig/TheRapyRecuperationConfigController.java @@ -61,6 +61,16 @@ public class TheRapyRecuperationConfigController { return configService.copyLastYear(year); } + /** + * 沿用指定来源年度配置到目标年度。 + */ + @At + @ViReturn + @RequiresAuthentication + public Object copyByYear(Integer sourceYear, Integer targetYear) { + return configService.copyByYear(sourceYear, targetYear); + } + /** * 查使用该标段的线路和目的地 diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationConfigService.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationConfigService.java index 01bf577..5fdfc8d 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationConfigService.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/service/TheRapyRecuperationConfigService.java @@ -61,6 +61,15 @@ public interface TheRapyRecuperationConfigService extends ViService=", startYear); + cnd.andEX("bm.year", "<=", endYear); + cnd.andEX("bm.id", "=", baseManagementId); + cnd.andEX("bm.regionalNature", "=", regionalNature); + cnd.andEX("bm.travelAgencyId", "=", travelAgencyId); + addFragmentPlayDateCnd(cnd, "en.specificTime", playStart, playEnd); + if (selfOnly) { + cnd.and("en.loginName", "=", ShiroUtil.getPlatformLoginname()); + } + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + String keyword = pageForm.getSearchKeyword().trim(); + // 人员定位同时匹配报名记录和用户表,兼容历史报名记录姓名与用户表姓名不同步的情况。 + cnd.and(Cnd.exps(Cnd.likeEX("en.userName", keyword)) + .or(Cnd.likeEX("en.loginName", keyword)) + .or(Cnd.likeEX("su.username", keyword)) + .or(Cnd.likeEX("su.loginname", keyword))); + } + cnd.asc("bm.sortNumber * 1").desc("en.specificTime").asc("en.loginName"); + sql.setCondition(cnd); + return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + } + + @Override + public Pagination fragmentSignUserPageData(PageForm pageForm, String takePartInBaseManagementId, String specificTime, + String playStart, String playEnd, Integer playCount) { + Sql sql = Sqls.create(""" + SELECT + en.id, + en.takePartInBaseManagementId, + en.specificTime, + en.playDay, + (en.playDay * 600) AS money, + u.loginname, + u.username, + u.sex, + u.mobile, + u.unionname, + u.unitname + FROM + the_rapy_recuperation_enroll en + LEFT JOIN user u ON en.loginName = u.loginname + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("en.takePartInBaseManagementId", "is not", null); + cnd.and("en.isNormal", "=", true); + cnd.andEX("en.specificTime", "=", specificTime); + addFragmentPlayDateCnd(cnd, "en.specificTime", playStart, playEnd); + cnd.andEX("en.takePartInBaseManagementId", "=", takePartInBaseManagementId); + if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { + String keyword = pageForm.getSearchKeyword().trim(); + // 弹窗按姓名或工号过滤,用于从人员定位结果直接锁定待删除人员。 + cnd.and(Cnd.exps(Cnd.likeEX("en.userName", keyword)) + .or(Cnd.likeEX("en.loginName", keyword)) + .or(Cnd.likeEX("u.username", keyword)) + .or(Cnd.likeEX("u.loginname", keyword))); + } + cnd.desc("en.specificTime"); + sql.setCondition(cnd); + return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); + } + + /** + * 分段式出行日期按 specificTime 起始日期过滤,页面传入格式为 MM-dd。 + */ + private void addFragmentPlayDateCnd(Cnd cnd, String specificTimeColumn, String playStart, String playEnd) { + String playDateExpr = "REPLACE(REPLACE(SUBSTRING_INDEX(" + specificTimeColumn + ", '-', 1), '月', '-'), '日', '')"; + cnd.andEX(playDateExpr, ">=", playStart); + cnd.andEX(playDateExpr, "<=", playEnd); + } + + /** + * 分段式酒店列表统计人数时复用出行日期过滤,避免人员定位结果和列表统计口径不一致。 + */ + private String buildFragmentPlayDateSql(String playStart, String playEnd) { + String playDateExpr = "REPLACE(REPLACE(SUBSTRING_INDEX(specificTime, '-', 1), '月', '-'), '日', '')"; + if (StrUtil.isNotBlank(playStart) && StrUtil.isNotBlank(playEnd)) { + return " AND " + playDateExpr + " >= @fragmentPlayStart AND " + playDateExpr + " <= @fragmentPlayEnd"; + } else if (StrUtil.isNotBlank(playStart)) { + return " AND " + playDateExpr + " >= @fragmentPlayStart"; + } else if (StrUtil.isNotBlank(playEnd)) { + return " AND " + playDateExpr + " <= @fragmentPlayEnd"; + } + return ""; + } + /** * 线路报名 * diff --git a/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html b/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html index 99695d4..117978a 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html +++ b/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html @@ -269,7 +269,7 @@ layout("/layouts/platform.html"){ {prop: 'stateName', label: '审核状态'}, ], - modifyConfig: {}, + modifyConfig: {lots: []}, lineList: [], unions: [], signUpModeOptions: [ @@ -309,8 +309,10 @@ layout("/layouts/platform.html"){ const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne', { year: year || this.pageForm.startYear }) - if (res.code === 0) { + if (res.code === 0 && res.data) { this.$set(this, 'modifyConfig', res.data) + } else { + this.$set(this, 'modifyConfig', {lots: []}) } }, async selectTravelAgencyList() { diff --git a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html index a003a11..0101656 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html +++ b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html @@ -85,7 +85,7 @@ layout("/layouts/platform.html"){ type="year" placeholder="选择年度" value-format="yyyy" - @change="getConfig(pageForm.year);getLines()" + @change="yearChange" style="width: 100%"> @@ -766,12 +766,21 @@ layout("/layouts/platform.html"){ $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne', { year: year || this.pageForm.year }).then((res) => { - if (res.code === 0) { + if (res.code === 0 && res.data) { this.$set(this, 'config', res.data) + } else { + this.$set(this, 'config', {lots: []}) } }) }, + yearChange() { + // 年度变化后线路和标段都依赖旧年度配置,需要清空后重新查询。 + this.$set(this.pageForm, 'takePartInLineId', '') + this.$set(this.pageForm, 'lotId', '') + this.doSearch() + }, + signUpModeChange(val) { this.pageForm.takePartInLineId = '' this.getLines() @@ -786,8 +795,9 @@ layout("/layouts/platform.html"){ regionalNature: this.pageForm.regionalNature }).then(res => { if (res.code === 0) { - this.takePartInLines = res.data + this.$set(this, 'takePartInLines', res.data || []) } else { + this.$set(this, 'takePartInLines', []) this.$message.error(res.msg) } }) diff --git a/src/main/resources/views/platform/theRapyRecuperation/statistics/fragment.html b/src/main/resources/views/platform/theRapyRecuperation/statistics/fragment.html index 97a0e73..2d195e4 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/statistics/fragment.html +++ b/src/main/resources/views/platform/theRapyRecuperation/statistics/fragment.html @@ -112,6 +112,28 @@ layout("/layouts/platform.html"){ + + + + + + 姓名/工号: + + + + + 查询 + 重置 + + + + @@ -154,6 +176,7 @@ layout("/layouts/platform.html"){ align="center" header-align="center" v-for="column in tableColumns" + v-if="!column.personOnly || pageForm.searchKeyword" show-overflow-tooltip :label="column.label" :prop="column.prop" @@ -168,9 +191,12 @@ layout("/layouts/platform.html"){ {{row.stateName?row.stateName:'待成团'}} - +