疗休养

This commit is contained in:
Paidax
2025-06-19 12:23:52 +08:00
parent 70350c82e7
commit a9270e06f7
7 changed files with 251 additions and 134 deletions
@@ -176,12 +176,12 @@ public class TheRapyRecuperationEnrollController {
if (Lang.isNotEmpty(enrollInfo.getCompanionList())) {
for (TheRapyRecuperationEnrollCompanion companion : enrollInfo.getCompanionList()) {
if (StrUtil.isBlank(companion.getIdCard())) {
return Result.error("随行人身份证信息不能为空");
return Result.error("随行人" + companion.getUserName() + "身份证信息不能为空");
} else if (!IdcardUtil.isValidCard(companion.getIdCard())) {
return Result.error("随行人身份证信息有误");
return Result.error("随行人" + companion.getUserName() + "身份证信息有误");
}
if (companion.getAge() < 1 || companion.getAge() > 70) {
return Result.error("随行人年龄超过限制,请上传其他随行人");
return Result.error("随行人" + companion.getUserName() + "年龄超过限制,请上传其他随行人");
}
}
}
@@ -1072,6 +1072,17 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
// 去判断当前报名的记录,名额有没有超出限制,包含家属
List<TheRapyRecuperationEnrollCompanion> companionList = enrollInfo.getCompanionList();
int applyNum = StrUtil.isNotBlank(enrollInfo.getId()) ? 0 : 1;
if (StrUtil.isNotBlank(enrollInfo.getEditOther())) {
applyNum = applyNum + 1;
}
// 电脑有的特殊情况,在我的里面修改报名信息,可以直接修改多个时间段的信息,那就要判断数据库报名的Id和,修改的线路的Id是不是一致的
TheRapyRecuperationEnroll enroll = dao().fetch(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enrollInfo.getId()));
if (Lang.isNotEmpty(enroll) && !Objects.equals(enroll.getTakePartInLineId(), enrollInfo.getTakePartInLineId())) {
applyNum = applyNum + 1;
}
if (Lang.isNotEmpty(companionList)) {
applyNum = applyNum + companionList.size();
}
@@ -1081,7 +1092,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
if (canApplyNum == 0) {
return Map.of(false, "此线路报名人数已满,请选择其他线路报名");
} else {
return Map.of(false, "此线路剩余可报名人数为:【" + canApplyNum + "人】,您当前报名人数为:【" + (StrUtil.isNotBlank(enrollInfo.getId()) ? applyNum + 1 : applyNum) + "人】,请减少随行人或选择其他线路报名");
return Map.of(false, "此线路剩余可报名人数为:【" + canApplyNum + "人】,本人及家属超过名额限制,请减少随行人或选择其他线路报名");
}
}
@@ -1338,7 +1349,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
// } else if (hotelCount > 0) {
// str = "酒店";
// }
return Map.of(false, "您已报过其他线路,如有疑问请联系工会主席");
return Map.of(false, "您已报过其他线路,如有疑问请联系工会!");
}
return Map.of(true, "成功");
}