重复报名增加报名机构提示

This commit is contained in:
TS-QD1 2023-03-14 14:29:41 +08:00
parent 4ded4d64d7
commit 637f850af1
3 changed files with 22 additions and 5 deletions

View File

@ -140,4 +140,7 @@ public interface IApplyDao {
Integer countKaoshi(Map<String, Object> query);
Integer countKaoShiCiShu(Map<String, Object> query);
List<String> listApplyInstitutionNameByCreator(String creator);
}

View File

@ -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<String> applyInstitutionNames = applyDao.listApplyInstitutionNameByCreator(creator);
throw new SaveException(applyVO.getApplyName() + "" + applyVO.getApplyPhone() + "】: 已报名其他培训机构【" + String.join(",", applyInstitutionNames) + "】,请勿重复报名");
}
if (!examCheckService.getExamCheckFailOrBack(applyWorkTypeId, applyInstitutionId)) {
throw new SaveException("已经提交开班计划,无法在审核过程中添加学员");

View File

@ -840,4 +840,17 @@
</if>
</select>
<select id="listApplyInstitutionNameByCreator" parameterType="java.lang.String" resultType="java.lang.String">
SELECT
mi.institution_name
FROM
e_apply ea
INNER JOIN
m_institution mi
ON
ea.apply_institution_id = mi.institution_id
WHERE
ea.creator = #{_parameter}
</select>
</mapper>