From 691d948835da37e59428677a2d93caf3cab1cc18 Mon Sep 17 00:00:00 2001 From: server Date: Tue, 16 Sep 2025 17:35:52 +0800 Subject: [PATCH 1/2] .. --- .../com/budwk/app/sys/controller/SysH5IndexController.java | 5 ++++- .../com/budwk/app/sys/controller/SysHomeController.java | 5 ++++- .../zhgh/welfare/service/impl/WelfareListServiceImpl.java | 2 ++ src/main/resources/views/platform/sys/home/activity.js | 7 ++++++- src/main/resources/views/platform/zhghh5/sys/home/home.js | 6 +++++- .../resources/views/platform/zhghh5/sys/home/index.html | 2 +- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/budwk/app/sys/controller/SysH5IndexController.java b/src/main/java/com/budwk/app/sys/controller/SysH5IndexController.java index 4cae5a1..ca40bc0 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysH5IndexController.java +++ b/src/main/java/com/budwk/app/sys/controller/SysH5IndexController.java @@ -76,7 +76,10 @@ public class SysH5IndexController { Date startDate = activity.getStartDate(); Date endDate = activity.getEndDate(); // 判断当前时间是否在活动范围内,不在就过滤掉 - if (!DateUtil.isIn(today, startDate, endDate)) { + /*if (!DateUtil.isIn(today, startDate, endDate)) { + continue; + }*/ + if(DateUtil.compare(today, endDate) > 0) { continue; } Integer allowUserGroupId = activity.getAllowUserGroupId(); diff --git a/src/main/java/com/budwk/app/sys/controller/SysHomeController.java b/src/main/java/com/budwk/app/sys/controller/SysHomeController.java index 65b5640..82871ab 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysHomeController.java +++ b/src/main/java/com/budwk/app/sys/controller/SysHomeController.java @@ -176,7 +176,10 @@ public class SysHomeController { Date startDate = activity.getStartDate(); Date endDate = activity.getEndDate(); // 判断当前时间是否在活动范围内,不在就过滤掉 - if (!DateUtil.isIn(today, startDate, endDate)) { + /*if (!DateUtil.isIn(today, startDate, endDate)) { + continue; + }*/ + if(DateUtil.compare(today, endDate) > 0) { continue; } Integer allowUserGroupId = activity.getAllowUserGroupId(); diff --git a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java index 2208329..4296672 100644 --- a/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/welfare/service/impl/WelfareListServiceImpl.java @@ -468,6 +468,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl impleme cnd.andEX("u.personType", "in", pageForm.getPersonTypes()); cnd.andEX("u.preparedBy", "in", pageForm.getPreparedBys()); cnd.andEX("u.userState", "in", pageForm.getUserStates()); + cnd.andEX("u.member","=",pageForm.getIsMember()); if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.asc("u.unionCode"); @@ -519,6 +520,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl impleme cnd.andEX("personType", "in", pageForm.getPersonTypes()); cnd.andEX("preparedBy", "in", pageForm.getPreparedBys()); cnd.andEX("userState", "in", pageForm.getUserStates()); + cnd.andEX("member","=",pageForm.getIsMember()); if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { cnd.asc("unionCode"); diff --git a/src/main/resources/views/platform/sys/home/activity.js b/src/main/resources/views/platform/sys/home/activity.js index 885ff95..6a3e5b1 100644 --- a/src/main/resources/views/platform/sys/home/activity.js +++ b/src/main/resources/views/platform/sys/home/activity.js @@ -22,9 +22,14 @@ const activity = { + v-else-if="$moment().unix() > $moment(item.startDate).unix() && $moment().unix() < $moment(item.endDate).unix()"> 进行中 + + + 即将开始 +
diff --git a/src/main/resources/views/platform/zhghh5/sys/home/home.js b/src/main/resources/views/platform/zhghh5/sys/home/home.js index 97c504d..9cb831e 100644 --- a/src/main/resources/views/platform/zhghh5/sys/home/home.js +++ b/src/main/resources/views/platform/zhghh5/sys/home/home.js @@ -38,9 +38,13 @@ const home = { 已结束 - + 进行中 + + + 即将开始 +
diff --git a/src/main/resources/views/platform/zhghh5/sys/home/index.html b/src/main/resources/views/platform/zhghh5/sys/home/index.html index 7e30dac..7e3f884 100644 --- a/src/main/resources/views/platform/zhghh5/sys/home/index.html +++ b/src/main/resources/views/platform/zhghh5/sys/home/index.html @@ -6,7 +6,7 @@ layout("/layouts/platform_h5.html"){
-
+
From 6235144a747389c25ea79075e18aec12edfa6aed Mon Sep 17 00:00:00 2001 From: "@jyuhsin" <729757837@qq.com> Date: Tue, 16 Sep 2025 17:45:35 +0800 Subject: [PATCH 2/2] commit --- .../manage/FamilyActivityApplyController.java | 15 +- .../manage/FamilyMineController.java | 22 ++ .../family/service/FamilyActivityService.java | 3 +- .../impl/FamilyActivityServiceImpl.java | 64 ++++- .../zhgh/activity/family/manage/basicForm.js | 11 +- .../zhghh5/activity/family/apply/index.html | 43 ++-- .../zhghh5/activity/family/list/applyForm.js | 34 +-- .../zhghh5/activity/family/list/index.html | 7 +- .../zhghh5/activity/family/mine/index.html | 241 +++++++++++++++++- 9 files changed, 373 insertions(+), 67 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java index 2a4017a..4675536 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyActivityApplyController.java @@ -100,7 +100,7 @@ public class FamilyActivityApplyController { } if("mine".equals(dataType)) { - cnd.and(new Static("id in (select activityId from train_sign_up_user where userId = '%s')".formatted(SecurityUtil.getUserId()))); + cnd.and(new Static("id in (select activityId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId()))); } Pagination pagination = familyActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd); @@ -135,7 +135,7 @@ public class FamilyActivityApplyController { } if("mine".equals(dataType)) { - cnd.and(new Static("tsuc.id in (select courseId from train_sign_up_user where userId = '%s')".formatted(SecurityUtil.getUserId()))); + cnd.and(new Static("tsuc.id in (select courseId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId()))); } List courseArray = familyActivityService.dao().query(FamilyCourse.class, Cnd.where("activityId", "=", activityId)); @@ -335,12 +335,13 @@ public class FamilyActivityApplyController { if(courseByUser) { return Result.error(99,"您已报过该活动"); } - FamilyActivity activity = familyActivityService.fetch(familyUser.getActivityId()); - boolean validFamilyCount = familyActivityService.validFamilyCount(familyUser); - if(validFamilyCount) { - return Result.error(99,activity.getKeyWord() + "人数最多为" + activity.getFamilyMaxCount()); + + Map validFamilyCount = familyActivityService.validFamilyCount(familyUser); + if(validFamilyCount.containsKey(false)) { + //return Result.error(99,activity.getKeyWord() + "人数最多为" + activity.getFamilyMaxCount()); + return Result.error(99,validFamilyCount.get(false)); } - //判断人数 + // 判断人数 int number = 0; FamilyCourse course = familyActivityService.dao().fetch(FamilyCourse.class, familyUser.getCourseId()); FamilyType type = familyActivityService.dao().fetch(FamilyType.class, course.getCourseType()); diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyMineController.java b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyMineController.java index efa3324..2b59c2a 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyMineController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/controller/manage/FamilyMineController.java @@ -138,4 +138,26 @@ public class FamilyMineController { List listMap = activityService.listMap(sql); return Result.success(listMap); } + + @At + @ApiOperation("获取我报名的课程") + @SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR) + public Result queryMineCourse(String activityId) { + + Sql sql = Sqls.create(""" + SELECT + c.*, + u.mobileColumnsValue + FROM + family_user u + LEFT JOIN family_course c ON c.id = u.courseId + $condition + """); + Cnd cnd = Cnd.NEW(); + cnd.and("u.activityId", "=", activityId); + cnd.and("u.userId", "=", SecurityUtil.getUserId()); + sql.setCondition(cnd); + List listMap = activityService.listMap(sql); + return Result.success(listMap); + } } diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/service/FamilyActivityService.java b/src/main/java/com/budwk/app/zhgh/activity/family/service/FamilyActivityService.java index 6e3044d..2849f0b 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/service/FamilyActivityService.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/service/FamilyActivityService.java @@ -10,6 +10,7 @@ import org.nutz.dao.Cnd; import org.nutz.lang.util.NutMap; import java.util.List; +import java.util.Map; /** * @author NINGMEI @@ -85,7 +86,7 @@ public interface FamilyActivityService extends BaseService { */ boolean isSignFull(FamilyCourse course, Integer currentFamilyNumber); - boolean validFamilyCount(FamilyUser user); + Map validFamilyCount(FamilyUser user); /** * 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项 diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/service/impl/FamilyActivityServiceImpl.java b/src/main/java/com/budwk/app/zhgh/activity/family/service/impl/FamilyActivityServiceImpl.java index 6ba4fd4..45ed661 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/family/service/impl/FamilyActivityServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/activity/family/service/impl/FamilyActivityServiceImpl.java @@ -370,13 +370,11 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl i } @Override - public boolean validFamilyCount(FamilyUser user) { + public Map validFamilyCount(FamilyUser user) { String activityId = user.getActivityId(); // 查询报名记录 List list = dao().query(FamilyUser.class, Cnd.where(FamilyUser::getActivityId, "=", activityId).and(FamilyUser::getUserId, "=", SecurityUtil.getUserId())); - if(Lang.isEmpty(list)) { - return false; - } + FamilyActivity activity = dao().fetch(FamilyActivity.class, activityId); List> allMobileColumnsValue = new ArrayList<>(list.stream() @@ -387,6 +385,9 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl i allMobileColumnsValue.addAll(user.getMobileColumnsValue()); + // 后面搞活动,用这行代码吧,因为这次活动1个人可以报2个孩子,但是同一个孩子又可以报2个场地,草 + //return allMobileColumnsValue.size() > activity.getFamilyMaxCount(); + long count = allMobileColumnsValue.stream() .flatMap(List::stream) .filter(nutMap -> activity.getOnlyKey().equals(nutMap.getString("columnCode"))) @@ -395,8 +396,59 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl i .distinct() .count(); - return count > activity.getFamilyMaxCount(); - } + if(count > activity.getFamilyMaxCount()) { + return Map.of(false, activity.getKeyWord() + "人数最多为" + activity.getFamilyMaxCount()); + } + + List courseList = dao().query(FamilyCourse.class, Cnd.where("activityId", "=", activityId)); + Map courseMap = courseList.stream().collect(Collectors.toMap(FamilyCourse::getId, FamilyCourse::getCourseType)); + + List typeList = dao().query(FamilyType.class, Cnd.NEW()); + Map typeMap = typeList.stream().collect(Collectors.toMap(FamilyType::getId, FamilyType::getTypeName)); + + List> currentValue = user.getMobileColumnsValue(); + + String tempValue = ""; + // 循环家属 + for (List listMap : currentValue) { + NutMap nutMap = listMap.stream().filter(o -> o.getString("columnCode").equals(activity.getOnlyKey())).findFirst().orElse(null); + if(nutMap == null) { + continue; + } + // 家属匹配唯一标识的值 + String onlyKeyValue = nutMap.getString("columnValue"); + if(Objects.equals(tempValue, onlyKeyValue)) { + return Map.of(false, activity.getKeyWord() + "不能重复报同一分场"); + } + tempValue = onlyKeyValue; + + int oneFamilyCount = 1; + + for (FamilyUser hisRecord : list) { + List> hisValueList = hisRecord.getMobileColumnsValue(); + for (List hisValue : hisValueList) { + NutMap hisNutMap = hisValue.stream().filter(o -> o.getString("columnCode").equals(activity.getOnlyKey())).findFirst().orElse(null); + if(hisNutMap == null) { + continue; + } + String hisKeyValue = hisNutMap.getString("columnValue"); + // 判断是不是同一个孩子 + if(Objects.equals(onlyKeyValue, hisKeyValue)) { + oneFamilyCount ++; + if(Objects.equals(courseMap.get(user.getCourseId()), courseMap.get(hisRecord.getCourseId()))) { + return Map.of(false, onlyKeyValue + "已经报名" + typeMap.get(courseMap.get(user.getCourseId())) + "分场"); + } + } + } + } + + if(oneFamilyCount > 2) { + return Map.of(false, "同一个" + activity.getKeyWord() + "最多报2个分场"); + } + } + + return Map.of(true, ""); + } @Override public boolean isSignCourse(FamilyCourse course, FamilyActivity activity) { diff --git a/src/main/resources/views/platform/zhgh/activity/family/manage/basicForm.js b/src/main/resources/views/platform/zhgh/activity/family/manage/basicForm.js index b71094b..2ab8cd8 100644 --- a/src/main/resources/views/platform/zhgh/activity/family/manage/basicForm.js +++ b/src/main/resources/views/platform/zhgh/activity/family/manage/basicForm.js @@ -382,7 +382,16 @@ const basicForm = { typeList.forEach(item => { array = array.concat(item.familyMobileSignColumnList) }) - this.typeArray = array + // 根据 columnCode 去重 + const uniqueMap = new Map() + array.forEach(item => { + if (item.columnCode) { + uniqueMap.set(item.columnCode, item) + } + }) + // 可选:保留没有 columnCode 的项 + const withoutCode = array.filter(item => !item.columnCode) + this.typeArray = [...uniqueMap.values(), ...withoutCode] }, async validNumber(row, old) { if (GetQueryString("id") === "") { diff --git a/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html b/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html index f2693f1..28f8bed 100644 --- a/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/family/apply/index.html @@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){ text-align: center !important; } .info-container { - height: calc(100vh - 46px - 44px); - min-height: calc(100vh - 46px - 44px); - overflow-y: auto; + margin-bottom: 60px; + } + .button { + position: fixed; + bottom: 0; + width: 100%; } .info-img { display: block; @@ -62,25 +65,27 @@ layout("/layouts/platform_h5.html"){ - - +
- -
{{infoRow.activityName}}
- +
+ +
{{infoRow.activityName}}
+ +
+
+ + + 去报名 + + + +
- - - - 去报名 - - - -
+
diff --git a/src/main/resources/views/platform/zhghh5/activity/family/list/applyForm.js b/src/main/resources/views/platform/zhghh5/activity/family/list/applyForm.js index d099c90..0e8210c 100644 --- a/src/main/resources/views/platform/zhghh5/activity/family/list/applyForm.js +++ b/src/main/resources/views/platform/zhghh5/activity/family/list/applyForm.js @@ -3,8 +3,7 @@ const applyForm = { /*language=HTML*/ `
- - + @@ -18,21 +17,21 @@ const applyForm = { @@ -65,11 +64,11 @@ const applyForm = {
-
- 提交 +
+ 提交
- +
`, data() { @@ -329,15 +328,16 @@ const applyForm = { }, }, style: /*language=CSS*/ ` - .form-container { - height: calc(100vh - 46px - 64px - 20px); - overflow-y: auto; - } .companionList_empty_text { text-align: center; padding: 10px 0; font-size: 14px; color: grey; } + .button { + position: fixed; + bottom: 0; + width: 100%; + } ` } diff --git a/src/main/resources/views/platform/zhghh5/activity/family/list/index.html b/src/main/resources/views/platform/zhghh5/activity/family/list/index.html index 668a03f..e6b371f 100644 --- a/src/main/resources/views/platform/zhghh5/activity/family/list/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/family/list/index.html @@ -83,10 +83,9 @@ layout("/layouts/platform_h5.html"){ - - - - + + + diff --git a/src/main/resources/views/platform/zhghh5/activity/family/mine/index.html b/src/main/resources/views/platform/zhghh5/activity/family/mine/index.html index 963bef4..fcb0177 100644 --- a/src/main/resources/views/platform/zhghh5/activity/family/mine/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/family/mine/index.html @@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){ text-align: center !important; } .info-container { - height: calc(100vh - 46px - 44px); - min-height: calc(100vh - 46px - 44px); - overflow-y: auto; + + } + .button { + position: fixed; + bottom: 0; + width: 100%; } .info-img { display: block; @@ -21,6 +24,170 @@ layout("/layouts/platform_h5.html"){ .van-count-down { color: #fff; } + .table-list-container { + padding: 0; + margin-top: 10px; + } + + .table-list-container .table-list-item { + background-color: #fff; + border-bottom: 1px solid #eaecef; + padding: 16px; + position: relative; + margin-bottom: 10px; + } + + .table-list-container .table-list-item:last-child { + border-bottom: none; + margin-bottom: 0; + } + + .table-list-container .table-list-item .item-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + margin-bottom: 10px; + } + + .table-list-container .table-list-item .item-title { + font-size: 16px; + font-weight: 500; + color: #1f2f3d; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + flex: 1; + padding-right: 10px; + } + + .table-list-container .table-list-item .img-container { + width: 100px; + height: 100px; + flex-shrink: 0; + border-radius: 6px; + } + + .table-list-container .table-list-item .img-container img { + width: 100%; + height: 100%; + border-radius: 6px; + } + + + .table-list-container .table-list-item .item-meta { + display: flex; + color: #606266; + font-size: 14px; + margin-bottom: 5px; + padding: 4px 0; + } + + .table-list-container .table-list-item .meta-item { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + } + + .table-list-container .table-list-item .meta-item i { + font-size: 14px; + color: #909399; + width: 16px; + text-align: center; + } + + .table-list-container .table-list-item .item-content { + color: #606266; + font-size: 14px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + line-height: 1.5; + } + + .table-list-container .table-list-item .item-footer { + display: flex; + justify-content: space-between; + margin-top: 12px; + padding-top: 8px; + border-top: 1px dashed #eaecef; + color: #909399; + font-size: 13px; + } + + .table-list-container .table-list-item .item-actions { + display: flex; + column-gap: 20px; + justify-content: end; + margin-top: 15px; + padding-top: 12px; + border-top: 1px solid #eaecef; + } + + .table-list-container .table-list-item .action-btn { + display: flex; + align-items: center; + justify-content: end; + font-size: 14px; + color: var(--color-primary); + padding: 4px 0; + } + + .table-list-container .table-list-item .action-btn i { + margin-right: 6px; + font-size: 16px; + } + + .table-list-container .table-list-item .action-btn.delete { + color: #ff0000; + } + + .table-list-container .table-list-item .action-btn.review { + color: #67c23a; + } + + .table-list-container .empty-state { + text-align: center; + padding: 60px 20px; + color: #909399; + } + + .table-list-container .empty-state i { + font-size: 60px; + margin-bottom: 16px; + color: #dcdee0; + } + + .table-list-container .empty-state p { + margin-top: 10px; + font-size: 14px; + } + .table-column { + display: flex; + padding: 6px 0; + align-items: center; + } + + .label { + color: #333; + font-size: 14px; + flex-shrink: 0; + max-width: 120px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .value { + color: #555; + font-size: 14px; + flex-grow: 1; /* 动态占据剩余部分 */ + white-space: nowrap; /* 防止换行 */ + overflow: hidden; /* 隐藏溢出的部分 */ + text-overflow: ellipsis; /* 省略号 */ + }
@@ -53,26 +220,66 @@ layout("/layouts/platform_h5.html"){ - - +
- -
{{infoRow.activityName}}
- +
+ +
{{infoRow.activityName}}
+ +
+
- 下一步 -
+ +
+
+
+
{{ row.courseName }}
+
+
+
+
校区:
+
{{ row.campus }}
+
+
+
+
+
地点:
+
{{ row.courseLocation }}
+
+
+
+
+
联系人:
+
{{ row.courseInstructor }}
+
+
+
+
+
家属人数:
+
+ {{ row.mobileColumnsValue ? JSON.parse(row.mobileColumnsValue).length : '暂无' }} +
+
+
+
+
+
+
@@ -101,6 +308,9 @@ layout("/layouts/platform_h5.html"){ ], infoVisible: false, infoRow: {}, + + mineCourses: [], + courseVisible: false, } }, methods: { @@ -111,6 +321,13 @@ layout("/layouts/platform_h5.html"){ onApply(row) { this.$pjaxReplace('/platform/family/apply/list/h5?id=' + row.id + '&dataType=mine') }, + onInfo(row) { + this.$axios.post('/platform/family/mine/queryMineCourse', {activityId: row.id}) + .then((res) => { + this.mineCourses = res.data + this.courseVisible = true + }) + }, onReady() { this.doSearch() },