From 637f850af1ddc97c57b04ba5bb68f7d5eb7821b9 Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Tue, 14 Mar 2023 14:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8A=A5=E5=90=8D=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8A=A5=E5=90=8D=E6=9C=BA=E6=9E=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/com/tenlion/dao/apply/IApplyDao.java | 3 +++ .../service/apply/impl/ApplyServiceImpl.java | 11 ++++++----- .../resources/mybatis/mapper/apply/apply-mapper.xml | 13 +++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) 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