From a98192c2836c2e63985690a191f97b25cc97d304 Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 4 Jun 2026 15:12:30 +0800 Subject: [PATCH] commit --- ...RecuperationLineUnionSelectController.java | 11 +++- ...erationSchoolUnionUserQueryController.java | 21 ++++++- .../theRapyRecuperation/lineQuery/index.html | 24 ++++---- .../process/lineUnionSelect.html | 7 ++- .../schoolUnionUserQuery/index.html | 56 ++++++++++++++++--- 5 files changed, 92 insertions(+), 27 deletions(-) diff --git a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationLineUnionSelectController.java b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationLineUnionSelectController.java index 1d4ca2d..6b67c49 100644 --- a/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationLineUnionSelectController.java +++ b/src/main/java/io/v/nutz/zhgh/therapyRecuperation/controller/process/TheRapyRecuperationLineUnionSelectController.java @@ -194,6 +194,7 @@ public class TheRapyRecuperationLineUnionSelectController { * 分工会选择线路时间 * * @param lineUnionSelects 分工会选择线路 + * @param year 页面选择年度,用于写入选择记录年度,保证历史年度线路能按年度查询 * @return {@link Object} */ @At("/selectLineTimes") @@ -201,15 +202,19 @@ public class TheRapyRecuperationLineUnionSelectController { @ViReturn @RequiresPermissions(value = {"theRapyRecuperation.lineFghSelect", "theRapyRecuperation.lineXghSelect", "theRapyRecuperation.linePersonalSelect"}, logical = Logical.OR) @Aop(TransAop.READ_COMMITTED) - public Object selectLineTimes(@Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects) { + public Object selectLineTimes(@Param("lineUnionSelects") TheRapyRecuperationLineUnionSelect[] lineUnionSelects, + @Param(value = "year", required = false) Integer year) { if (Lang.isNotEmpty(lineUnionSelects)) { + Integer selectYear = year == null ? DateUtil.thisYear() : year; + Date selectTime = DateUtil.parse(selectYear + "-01-01 00:00:00"); TheRapyRecuperationLineUnionSelect lineUnionSelect = lineUnionSelects[0]; - List oldUnionSelects = unionSelectService.query(Cnd.where("selectUserId", "=", ShiroUtil.getUserId()).and("lineId", "=", lineUnionSelect.getLineId())); + // 按页面年度维护选择时间段,避免编辑历史年度线路时误删同一线路其他年度的选择记录。 + List oldUnionSelects = unionSelectService.query(Cnd.where("selectUserId", "=", ShiroUtil.getUserId()).and("lineId", "=", lineUnionSelect.getLineId()).and("YEAR(selectTime)", "=", selectYear)); TheRapyRecuperationLineUnionSelect theRapyRecuperationLineUnionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, Cnd.where("id", "=", lineUnionSelect.getId())); for (TheRapyRecuperationLineUnionSelect unionSelect : lineUnionSelects) { - unionSelect.setSelectTime(new Date()); + unionSelect.setSelectTime(selectTime); unionSelect.setSelectUserId(ShiroUtil.getPlatformUid()); unionSelect.setUnionId(Vi.getUnionId()); unionSelect.setIsOpen(Lang.isNotEmpty(theRapyRecuperationLineUnionSelect)?theRapyRecuperationLineUnionSelect.getIsOpen():false); 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 5ee061d..a85fad2 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 @@ -82,6 +82,7 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { * @param takePartInLineId 线路id * @param lotId 标段id * @param regionalNature 区域性质 省内 省外 + * @param isTakePartIn 是否参加 * @return */ @At @@ -94,7 +95,8 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { String unionId, String takePartInLineId, String lotId, - String regionalNature) { + String regionalNature, + String isTakePartIn) { Cnd cnd = Cnd.NEW(); Sql sql = Sqls.create(""" SELECT @@ -157,6 +159,8 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { // 区域 cnd.andEX("line.regionalNature", "=", regionalNature); + addTakePartInCondition(cnd, isTakePartIn); + // 校工会可查询指定分工会 cnd.andEX("enroll.selfUnionId", "=", unionId); @@ -355,6 +359,7 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { String takePartInLineId, String lotId, String regionalNature, + String isTakePartIn, HttpServletResponse response) { Cnd cnd = Cnd.NEW(); Sql sql = Sqls.create(""" @@ -410,6 +415,8 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { // 区域 cnd.andEX("line.regionalNature", "=", regionalNature); + addTakePartInCondition(cnd, isTakePartIn); + // 校工会可查询指定分工会 cnd.andEX("enroll.selfUnionId", "=", unionId); @@ -536,4 +543,16 @@ public class TheRapyRecuperationSchoolUnionUserQueryController { e.printStackTrace(); } } + + /** + * 按是否参加筛选,空值表示查询全部。 + * + * @param cnd 查询条件 + * @param isTakePartIn 是否参加 + */ + private void addTakePartInCondition(Cnd cnd, String isTakePartIn) { + if ("true".equals(isTakePartIn) || "false".equals(isTakePartIn)) { + cnd.andEX("enroll.isTakePartIn", "=", Boolean.valueOf(isTakePartIn)); + } + } } diff --git a/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html b/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html index 595e120..99695d4 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html +++ b/src/main/resources/views/platform/theRapyRecuperation/lineQuery/index.html @@ -109,18 +109,18 @@ layout("/layouts/platform.html"){ - - 线  路: - - - - - + + + + + + + + + + + + diff --git a/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html b/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html index a6d74b8..386d39a 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html +++ b/src/main/resources/views/platform/theRapyRecuperation/process/lineUnionSelect.html @@ -870,7 +870,7 @@ layout("/layouts/platform.html"){ }, methods: { calPlayTime(time) { - const year = new Date().getFullYear() + 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') return !(time > new Date(year + '-06-30') && time < beforeTime) @@ -1034,7 +1034,10 @@ layout("/layouts/platform.html"){ mode: GetQueryString('mode') } }) - const resp = await $.post(loc() + '/selectLineTimes', {lineUnionSelects: JSON.stringify(fmtData)}) + const resp = await $.post(loc() + '/selectLineTimes', { + lineUnionSelects: JSON.stringify(fmtData), + year: this.pageForm.year + }) if (resp.code === 0) { this.setLineTimeDialog = false this.pageData() diff --git a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html index cff5070..e906f9b 100644 --- a/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html +++ b/src/main/resources/views/platform/theRapyRecuperation/schoolUnionUserQuery/index.html @@ -119,9 +119,8 @@ layout("/layouts/platform.html"){ -
-
区域
-
+
+ @@ -129,12 +128,23 @@ layout("/layouts/platform.html"){ 省内 省外 -
+ + + + 全部 + 已参加 + 未参加 + + + +
-