diff --git a/src/main/java/cn/com/tenlion/dao/apply/IApplyDao.java b/src/main/java/cn/com/tenlion/dao/apply/IApplyDao.java index 394fd60..15b56d3 100644 --- a/src/main/java/cn/com/tenlion/dao/apply/IApplyDao.java +++ b/src/main/java/cn/com/tenlion/dao/apply/IApplyDao.java @@ -140,4 +140,7 @@ public interface IApplyDao { Integer countKaoshi(Map query); Integer countKaoShiCiShu(Map query); + + List listApplyInstitutionNameByCreator(String creator); + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java index f562d10..30a5eaa 100644 --- a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java @@ -53,6 +53,7 @@ import ink.wgink.properties.FileProperties; import ink.wgink.properties.ServerProperties; import ink.wgink.service.user.pojo.vos.UserVO; import ink.wgink.service.user.service.IUserService; +import ink.wgink.util.ArrayListUtil; import ink.wgink.util.QRCodeUtil; import ink.wgink.util.UUIDUtil; import ink.wgink.util.date.DateUtil; @@ -64,6 +65,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; import javax.imageio.ImageIO; @@ -71,10 +73,8 @@ import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; -import java.util.ArrayList; -import java.util.HashMap; +import java.util.*; import java.util.List; -import java.util.Map; /** * @ClassName: ApplyServiceImpl @@ -456,10 +456,11 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic String applyInstitutionId = applyVO.getApplyInstitutionId(); if (checkApplyIsFirst(creator, applyWorkTypeId, applyInstitutionId) != 0) { - throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() + "]: 已经报名,若姓名与手机号不符,可能是手机号被注册,请联系管理人员处理或更换手机号"); + throw new SaveException(applyVO.getApplyName() + "【" + applyVO.getApplyPhone() + "】: 已经报名,若姓名与手机号不符,可能是手机号被注册,请联系管理人员处理或更换手机号"); } if (checkApplyIsFirst(creator, applyWorkTypeId, null) != 0) { - throw new SaveException(applyVO.getApplyName() + "[" + applyVO.getApplyPhone() + "]: 已报名其他培训机构,请勿重复报名"); + List applyInstitutionNames = applyDao.listApplyInstitutionNameByCreator(creator); + throw new SaveException(applyVO.getApplyName() + "【" + applyVO.getApplyPhone() + "】: 已报名其他培训机构【" + String.join(",", applyInstitutionNames) + "】,请勿重复报名"); } if (!examCheckService.getExamCheckFailOrBack(applyWorkTypeId, applyInstitutionId)) { throw new SaveException("已经提交开班计划,无法在审核过程中添加学员"); diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index 80b60ce..a9b863a 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -840,4 +840,17 @@ + + \ No newline at end of file