From 5aeb59d282e5fb22c64b062adae2a2bb1b85a15b Mon Sep 17 00:00:00 2001
From: "@jyuhsin" <729757837@qq.com>
Date: Mon, 15 Sep 2025 18:10:47 +0800
Subject: [PATCH] commit
---
.../manage/FamilyActivityApplyController.java | 23 +------
.../activity/family/models/FamilyCourse.java | 29 +++++++++
.../plugins/sysFilePreview/PdfIndex.vue | 1 -
.../zhgh/activity/family/manage/basicForm.js | 24 ++++++-
.../zhgh/activity/family/manage/customForm.js | 65 ++++++++++++++++++-
.../zhghh5/activity/family/list/applyForm.js | 58 +++++++++++++++++
.../zhghh5/activity/family/list/index.html | 4 +-
7 files changed, 178 insertions(+), 26 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 bcfa461..8a5f112 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
@@ -123,27 +123,8 @@ public class FamilyActivityApplyController {
@Param(value = "dataType") String dataType) {
Sql sql = Sqls.create("""
SELECT
- tsuc.id,
- tsuc.activityId,
- tsuc.courseName,
- tsuc.coursePeopleNumber,
- tsuc.courseLocation,
- tsuc.courseType,
- tsuc.courseLocationCoordinates,
- tsuc.courseReservedNumber,
- tsuc.courseInstructor,
- tsuc.campus,
- tsuc.unionLimit,
- tsuc.isMobileSign,
- tsuc.signType,
- tsuc.isReceiveGift,
- tsuc.giftType,
- tsuc.reserveMode,
- tsuc.waitingNum,
- tsuc.assort,
- tsuc.introduce,
- type.typeName,
- tsuc.courseIsLimitApply
+ tsuc.*,
+ type.typeName
FROM
`family_course` tsuc
LEFT JOIN family_type type ON type.id = tsuc.courseType
diff --git a/src/main/java/com/budwk/app/zhgh/activity/family/models/FamilyCourse.java b/src/main/java/com/budwk/app/zhgh/activity/family/models/FamilyCourse.java
index 0140485..7bd8ac3 100644
--- a/src/main/java/com/budwk/app/zhgh/activity/family/models/FamilyCourse.java
+++ b/src/main/java/com/budwk/app/zhgh/activity/family/models/FamilyCourse.java
@@ -94,6 +94,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("移动端是否签到")
+ @Default("0")
private boolean isMobileSign;
@Column
@@ -104,6 +105,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("移动端是否签收礼品")
+ @Default("0")
private boolean isReceiveGift;
@Column
@@ -142,6 +144,33 @@ public class FamilyCourse extends BaseModel implements Serializable {
@Comment("候补名额数")
private Integer waitingNum;
+ @Column
+ @ColDefine(type = ColType.BOOLEAN)
+ @Comment("是否限制年龄")
+ @Default("0")
+ private boolean familyAgeLimit;
+
+ @Column
+ @ColDefine(type = ColType.INT)
+ @Comment("最小年龄")
+ private Integer minAge;
+
+ @Column
+ @ColDefine(type = ColType.INT)
+ @Comment("最大年龄")
+ private Integer maxAge;
+
+ @Column
+ @ColDefine(type = ColType.BOOLEAN)
+ @Comment("是否限制性别")
+ @Default("0")
+ private boolean familySexLimit;
+
+ @Column
+ @ColDefine(type = ColType.VARCHAR)
+ @Comment("限制性别")
+ private String familySex;
+
private Integer hasWaitingNum;
private String courseTimeName;
private Integer hasRegisterNum;
diff --git a/src/main/resources/static/components/plugins/sysFilePreview/PdfIndex.vue b/src/main/resources/static/components/plugins/sysFilePreview/PdfIndex.vue
index d624945..01c86fa 100644
--- a/src/main/resources/static/components/plugins/sysFilePreview/PdfIndex.vue
+++ b/src/main/resources/static/components/plugins/sysFilePreview/PdfIndex.vue
@@ -32,7 +32,6 @@ module.exports = {
methods: {
init() {
try {
- debugger
const parser = new DOMParser();
const doc = parser.parseFromString(this.content, 'text/html');
const link = doc.querySelector('a');
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 2de089a..5d29c2f 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
@@ -317,7 +317,17 @@ const basicForm = {
formData: {
notice: false,
courseList: [
- { orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
+ {
+ orderNum: 1,
+ courseName: "",
+ courseTimeList: [],
+ isMobileSign: false,
+ isReceiveGift: false,
+ reserveMode: 1,
+ courseIsLimitApply: false,
+ familyAgeLimit: false,
+ familySexLimit: false,
+ },
],
conditionStructure: {
method: "AND",
@@ -516,6 +526,18 @@ const basicForm = {
this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查")
return true
}
+ if(v.familyAgeLimit === true && !v.minAge) {
+ this.$message.warning("第" + (i + 1) + "行最小年龄不能为空,请核查")
+ return true
+ }
+ if(v.familyAgeLimit === true && !v.maxAge) {
+ this.$message.warning("第" + (i + 1) + "行最大年龄不能为空,请核查")
+ return true
+ }
+ if(v.familySexLimit === true && !v.familySex) {
+ this.$message.warning("第" + (i + 1) + "行性别不能为空,请核查")
+ return true
+ }
return false
})
if (courseValid) return
diff --git a/src/main/resources/views/platform/zhgh/activity/family/manage/customForm.js b/src/main/resources/views/platform/zhgh/activity/family/manage/customForm.js
index 18f2c65..e0eedca 100644
--- a/src/main/resources/views/platform/zhgh/activity/family/manage/customForm.js
+++ b/src/main/resources/views/platform/zhgh/activity/family/manage/customForm.js
@@ -50,6 +50,69 @@ const customForm = {
+
+
+ 是否限制年龄
+
+
+
+ 限制
+ 不限制
+
+
+
+
+
+ 最小年龄
+
+
+
+
+
+
+
+ 最大年龄
+
+
+
+
+
+
+
+ 是否限制性别
+
+
+
+ 限制
+ 不限制
+
+
+
+
+
+ 限制性别
+
+
+
+
+
+
+
+
+
是否签到
@@ -132,7 +195,7 @@ const customForm = {
候补数量
- this.row.maxAge) {
+ const message = '限制报名最大年龄为' + this.row.maxAge;
+ showAlert(message);
+ return false;
+ }
+ }
+ if(col.validRule === 'idCard' && this.row.familySexLimit) {
+ const parseCard = this.parseIdCard(value)
+ if(this.row.familySex && parseCard.sex !== this.row.familySex) {
+ const message = '限制报名性别为' + this.row.familySex;
+ showAlert(message);
+ return false;
+ }
+ }
}
}
return true;
},
+ parseIdCard(idCard) {
+ if (!idCard || (idCard.length !== 18 && idCard.length !== 15)) {
+ return null;
+ }
+
+ let birthStr = '';
+ let sexCode = '';
+
+ if (idCard.length === 15) {
+ birthStr = '19' + idCard.substring(6, 12);
+ sexCode = idCard.substring(14, 15); // 15位:第15位是性别
+ } else {
+ birthStr = idCard.substring(6, 14);
+ sexCode = idCard.substring(16, 17); // 18位:第17位是性别
+ }
+
+ const birthYear = parseInt(birthStr.substring(0, 4), 10);
+ const birthMonth = parseInt(birthStr.substring(4, 6), 10) - 1;
+ const birthDay = parseInt(birthStr.substring(6, 8), 10);
+
+ const birthDate = new Date(birthYear, birthMonth, birthDay);
+ const today = new Date();
+
+ let age = today.getFullYear() - birthDate.getFullYear();
+ const monthDiff = today.getMonth() - birthDate.getMonth();
+ const dayDiff = today.getDate() - birthDate.getDate();
+
+ if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
+ age--;
+ }
+
+ const sex = parseInt(sexCode, 10) % 2 === 1 ? '男' : '女';
+
+ return { age, sex, };
+ },
async validateSignUp() {
// 获取家属人数
const res = await this.$axios.post("/platform/family/apply/validateSignUp", {
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 57f0943..36c21b3 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
@@ -40,8 +40,8 @@ layout("/layouts/platform_h5.html"){
{{row.courseLocation}}
{{row.courseInstructor}}
-
- {{ $moment(row.courseTimes[0].courseStartTime).format('HH:mm') + '~' + $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
+
+ {{ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm') + '~' + $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
点我查看