Merge branch 'feat_可同步长江大学的优化_fix' into feat_本工会单独业务

This commit is contained in:
2026-10-29 10:45:35 +08:00
5 changed files with 37 additions and 15 deletions
@@ -54,9 +54,8 @@ public class ActivityBasicSettingsController {
if (parentId != null) {
parentId.setChild(child(parentId.getId()));
list.add(parentId);
return Result.success().addData(list);
}
return Result.success();
return Result.success(list);
}
private List<ActivityBasicSettings> child(String parentId) {
@@ -73,6 +72,9 @@ public class ActivityBasicSettingsController {
Cnd cnd = Cnd.NEW();
if (StrUtil.isBlank(parentId)) {
ActivityBasicSettings rootSetting = dao.fetch(ActivityBasicSettings.class, Cnd.where("parentId", "=", 0));
if (rootSetting == null) {
return Result.success(new Pagination<ActivityBasicSettings>(pageForm.getPageNumber(), pageForm.getPageSize(), 0, new ArrayList<ActivityBasicSettings>()));
}
cnd.and("parentId", "=", rootSetting.getId());
} else {
cnd.and("parentId", "=", parentId);
@@ -116,7 +118,13 @@ public class ActivityBasicSettingsController {
@At
public Result getActivityTwoLevelType(String code) {
if (StrUtil.isBlank(code)) {
return Result.success(new ArrayList<ActivityBasicSettings>());
}
ActivityBasicSettings fetch = dao.fetch(ActivityBasicSettings.class, Cnd.where("code", "=", code));
if (fetch == null) {
return Result.success(new ArrayList<ActivityBasicSettings>());
}
List<ActivityBasicSettings> query = dao.query(ActivityBasicSettings.class, Cnd.where("parentId", "=", fetch.getId()).asc("code"));
return Result.success(query);
}
@@ -649,8 +649,11 @@ public class TrainSignUpActivityServiceImpl extends BaseServiceImpl<TrainSignUpA
fillCourseResponsibles(courseList);
courseList.forEach(c -> {
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
if (c.getCourseTimeList() == null) {
c.setCourseTimeList(new ArrayList<>());
}
if (StrUtil.isNotBlank(c.getCourseType())) {
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
int courseCount = statisticsService.queryCourseCount(c.getId(), c.getCourseType());
c.setHasRegisterNum(courseCount);
int courseWaitCount = statisticsService.queryCourseWaitCount(c.getId(), c.getCourseType());
@@ -119,7 +119,7 @@ layout("/layouts/platform.html"){
currentTreeNode: null,
currentTreeData: null,
checkData: {},
checkData: { id: "0", name: "无(新建根节点)" },
tableData: [],
basicTypeDialog: false,
@@ -146,10 +146,8 @@ layout("/layouts/platform.html"){
getTreeData() {
this.$axios.post(loc() + "/tree").then((res) => {
this.treeData = res.data
if (this.treeData) {
this.checkData = this.treeData[0]
}
this.treeData = res.data || []
this.checkData = this.treeData.length ? this.treeData[0] : { id: "0", name: "无(新建根节点)" }
})
},
@@ -370,12 +370,14 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
</el-form-item>
</el-col>
<!--
<el-col :span="24">
<el-form-item label="报名表单" prop="formConfig"
v-if="formData.isEnrollSystem&&formData.signUpMethod===1">
<custom-form-field v-model="formData.formConfig"></custom-form-field>
</el-form-item>
</el-col>
-->
<el-col :span="24" v-if="formData.signUpMethod!=null&&formData.isEnrollSystem">
<el-form-item label="封面图" prop="cover">
@@ -592,6 +594,7 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
type: [{required: true, message: "必填", trigger: ["blur", "change"]}],
projectTypeCode: [{required: true, message: "必填", trigger: ["blur", "change"]}],
mobile: this.activity_type === 40001 ? [{pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: ["blur", "change"]}] : [],
address: [{required: true, message: "必填", trigger: ["blur", "change"]}],
plannedDate: [{required: true, message: "必填", trigger: ["blur", "change"]}],
time: [{required: true, message: "必填", trigger: ["blur", "change"]}],
@@ -725,7 +728,15 @@ const ACTIVITY_CULTURE_APPLY_ACTIVITY = {
return true
},
// 保存
onSave() {
async onSave() {
if (this.activity_type === 40001) {
const mobileValid = await new Promise(resolve => {
this.$refs["addForm"].validateField("mobile", error => resolve(!error))
})
if (!mobileValid) {
return
}
}
if (!this.formData.projectTypeCode) {
this.$message.error("请选择活动项目类型")
return
@@ -585,11 +585,13 @@ const basicForm = {
return
}
const courseValid = this.formData.courseList.some((v, i) => {
// 新活动通过多选关系设置负责人;未重新设置的旧活动仍允许保留历史联系人。
const hasResponsible = Array.isArray(v.responsibleList)
? v.responsibleList.length > 0 : !!v.courseInstructor
const basicValid = v.courseName && v.coursePeopleNumber && v.courseLocation && hasResponsible && v.courseType
const missingFields = []
if (!v.courseName) missingFields.push(this.trainType + "名称")
if (!v.coursePeopleNumber) missingFields.push(this.trainType + "人数(不能为空或为0)")
if (!v.courseLocation) missingFields.push(this.trainType + "地点")
if (!v.courseType) missingFields.push("类型")
const timeValid =
Array.isArray(v.courseTimeList) &&
v.courseTimeList.length > 0 &&
v.courseTimeList.every((x) => {
return x.courseStartTime && x.courseEndTime && x.courseStartTime < x.courseEndTime
@@ -598,8 +600,8 @@ const basicForm = {
this.$message.warning("第" + (i + 1) + "行时间填写有误,请核查")
return true
}
if (!basicValid) {
this.$message.warning("第" + (i + 1) + "行信息填写有误,请核查")
if (missingFields.length > 0) {
this.$message.warning("第" + (i + 1) + "行请补充:" + missingFields.join("、"))
return true
}
// 联系方式允许手机号或办公电话,逐人校验,不能只检查兼容展示的第一位。