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 a85fad2..514c637 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 @@ -351,7 +351,8 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { @At @Ok("void") @RequiresPermissions("theRapyRecuperation.schoolUnionUserQuery") - public void exportXlsx(Integer year, + public void exportXlsx(PageForm pageForm, + Integer year, String userName, String loginName, String signUpMode, @@ -362,6 +363,9 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { String isTakePartIn, HttpServletResponse response) { Cnd cnd = Cnd.NEW(); + if (pageForm == null) { + pageForm = new PageForm(); + } Sql sql = Sqls.create(""" SELECT state.stateName, @@ -390,6 +394,13 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { LEFT JOIN audit_state state ON state.stateId = enroll.stateId $condition """); + // 导出复用列表的通用检索和排序条件,保证列表查出什么,导出什么。 + if (Strings.isNotBlank(pageForm.getSearchKeyword()) && Strings.isNotBlank(pageForm.getSearchName())) { + cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword())); + } + if (StrUtil.isNotBlank(pageForm.getPageOrderName()) && StrUtil.isNotBlank(pageForm.getPageOrderBy())) { + cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC"); + } cnd.and("enroll.takePartInLineId", "is not", null); cnd.and("line.stateId", "=", 4); // 年度 diff --git a/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html b/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html index 386d39a..f83904d 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html +++ b/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html @@ -869,15 +869,34 @@ layout("/layouts/platform.html"){ }, }, methods: { + getCurrentLotValue() { + const lot = this.lotList.find(o => o.id === this.lineData.lotId) + if (lot && lot.lotValue) { + return Number(lot.lotValue) + } + if (this.lineData.playNumberOfDays) { + return Number(this.lineData.playNumberOfDays) + } + return null + }, calPlayTime(time) { const year = this.pageForm.year || new Date().getFullYear() - const lot = this.lotList.find(o => o.id === this.lineData.lotId) - const beforeTime = moment(year + '-09-01').add(-(Number(lot.lotValue)), 'days') + const lotValue = this.getCurrentLotValue() + if (!lotValue) { + return false + } + const beforeTime = moment(year + '-09-01').add(-lotValue, 'days') return !(time > new Date(year + '-06-30') && time < beforeTime) }, platStartChange(time, row) { - const lot = this.lotList.find(o => o.id === this.lineData.lotId) - const afterTime = moment(time).add(Number(lot.lotValue), 'days') + const lotValue = this.getCurrentLotValue() + if (!lotValue) { + row.playStartTime = null + row.playEndTime = null + this.$message.warning('未找到线路标段,请检查线路标段配置') + return + } + const afterTime = moment(time).add(lotValue, 'days') row.playEndTime = afterTime.format('YYYY-MM-DD HH:mm:ss') this.$forceUpdate() }, @@ -978,8 +997,10 @@ layout("/layouts/platform.html"){ this.lineData = resp.data }, async openSetLineTime({id, lineName, usUnionId, signUpMode}) { - await this.getLineConfig(id) await this.getLineInfo(id) + // 出行日期选择必须使用线路自身年度的标段,避免历史年度线路匹配到当前年度标段列表。 + await this.getLotList(this.lineData.year || this.pageForm.year) + await this.getLineConfig(id) const resp = await $.post(loc() + '/selectLineInfo', { lineId: id, unionId: usUnionId, diff --git a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html index e906f9b..db23556 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html +++ b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html @@ -638,17 +638,8 @@ layout("/layouts/platform.html"){ if (!canExport) { return } - const {year, userName, loginName, unionId, signUpMode, regionalNature, isTakePartIn, takePartInLineId, lotId} = this.pageForm - window.open('/platform/theRapyRecuperation/schoolUnionUserQuery/exportXlsx?year=' + - year - + '&userName=' + userName - + '&loginName=' + loginName - + '&unionId=' + unionId - + '&signUpMode=' + signUpMode - + '®ionalNature=' + regionalNature - + '&isTakePartIn=' + isTakePartIn - + '&takePartInLineId=' + takePartInLineId - + '&lotId=' + lotId) + // 使用列表当前查询参数生成导出地址,确保列表查出什么,导出什么。 + window.open('/platform/theRapyRecuperation/schoolUnionUserQuery/exportXlsx?' + $.param(this.pageForm)) }, async checkExportConfig(year) {