Commit 9bce135b by jsy672

修改公开招聘报名列表查询接口

parent 43f4ee33
...@@ -51,979 +51,1029 @@ import yangtz.cs.liu.webpage.vo.RecruitAdmissionTicketVo; ...@@ -51,979 +51,1029 @@ import yangtz.cs.liu.webpage.vo.RecruitAdmissionTicketVo;
import yangtz.cs.liu.webpage.vo.WebSchoolRecruitStudentVo; import yangtz.cs.liu.webpage.vo.WebSchoolRecruitStudentVo;
@Service @Service
public class SchoolRecruitStudentServiceImpl extends ServiceImpl<SchoolRecruitStudentMapper, SchoolRecruitStudent> implements ISchoolRecruitStudentService { public class SchoolRecruitStudentServiceImpl extends
@Autowired ServiceImpl<SchoolRecruitStudentMapper, SchoolRecruitStudent> implements
private SchoolRecruitStudentMapper recruitStudentMapper; ISchoolRecruitStudentService {
@Autowired @Autowired
private SchoolRecruitExamMapper recruitExamMapper; private SchoolRecruitStudentMapper recruitStudentMapper;
@Autowired @Autowired
private SchoolRecruitRelationMapper recruitRelationMapper; private SchoolRecruitExamMapper recruitExamMapper;
@Autowired @Autowired
private SchoolRecruitProjectMapper projectMapper; private SchoolRecruitRelationMapper recruitRelationMapper;
@Autowired @Autowired
private JuniorHighSchoolMapper schoolMapper; private SchoolRecruitProjectMapper projectMapper;
@Autowired @Autowired
private EduRecruitStudentMapper eduRecruitStudentMapper; private JuniorHighSchoolMapper schoolMapper;
@Autowired @Autowired
private SchoolRecruitStudentJlMapper recruitStudentJlMapper; private EduRecruitStudentMapper eduRecruitStudentMapper;
@Autowired
private SchoolRecruitStudentFamilyMapper recruitStudentFamilyMapper; @Autowired
@Autowired private SchoolRecruitStudentJlMapper recruitStudentJlMapper;
private SchoolRecruitStudentFjbMapper recruitStudentFjbMapper; @Autowired
private SchoolRecruitStudentFamilyMapper recruitStudentFamilyMapper;
@Override @Autowired
public String register(WebRegisterBody registerBody) { private SchoolRecruitStudentFjbMapper recruitStudentFjbMapper;
String msg = "", studentName = registerBody.getStudentName(), idCard = registerBody.getIdCard(), phoneNumber = registerBody.getPhoneNumber(), password = registerBody.getPassword();
SchoolRecruitStudent student = new SchoolRecruitStudent(); @Override
student.setIdCard(idCard); public String register(WebRegisterBody registerBody) {
student.setPhoneNumber(phoneNumber); String msg = "", studentName = registerBody.getStudentName(), idCard = registerBody.getIdCard(), phoneNumber = registerBody.getPhoneNumber(), password = registerBody.getPassword();
SchoolRecruitStudent student = new SchoolRecruitStudent();
if (StringUtils.isEmpty(studentName)) { student.setIdCard(idCard);
msg = "姓名不能为空"; student.setPhoneNumber(phoneNumber);
} else if (StringUtils.isEmpty(idCard)) {
msg = "身份证号不能为空"; if (StringUtils.isEmpty(studentName)) {
} else if (StringUtils.isEmpty(phoneNumber)) { msg = "姓名不能为空";
msg = "手机号不能为空"; } else if (StringUtils.isEmpty(idCard)) {
} else if (StringUtils.isEmpty(password)) { msg = "身份证号不能为空";
msg = "用户密码不能为空"; } else if (StringUtils.isEmpty(phoneNumber)) {
} else if (studentName.length() < UserConstants.USERNAME_MIN_LENGTH msg = "手机号不能为空";
|| studentName.length() > UserConstants.USERNAME_MAX_LENGTH) { } else if (StringUtils.isEmpty(password)) {
msg = "姓名长度必须在2到20个字符之间"; msg = "用户密码不能为空";
} else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH } else if (studentName.length() < UserConstants.USERNAME_MIN_LENGTH
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) { || studentName.length() > UserConstants.USERNAME_MAX_LENGTH) {
msg = "密码长度必须在5到20个字符之间"; msg = "姓名长度必须在2到20个字符之间";
} else if (idCard.length() != 18) { } else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
msg = "身份证号长度必须为18位"; || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
} else if (phoneNumber.length() != 11) { msg = "密码长度必须在5到20个字符之间";
msg = "手机号长度必须为11位"; } else if (idCard.length() != 18) {
} msg = "身份证号长度必须为18位";
} else if (phoneNumber.length() != 11) {
msg = "手机号长度必须为11位";
}
/*else if (UserConstants.NOT_UNIQUE.equals(checkPhoneUnique(student))) /*else if (UserConstants.NOT_UNIQUE.equals(checkPhoneUnique(student)))
{ {
msg = "保存学生'" + studentName + "'失败,手机号已存在"; msg = "保存学生'" + studentName + "'失败,手机号已存在";
}*/ }*/
else if (UserConstants.NOT_UNIQUE.equals(checkIdCardUnique(student))) { else if (UserConstants.NOT_UNIQUE.equals(checkIdCardUnique(student))) {
msg = "保存学生'" + studentName + "'失败,身份证号已存在"; msg = "保存学生'" + studentName + "'失败,身份证号已存在";
} else { } else {
student.setStudentName(studentName); student.setStudentName(studentName);
student.setPassword(SecurityUtils.encryptPassword(password)); student.setPassword(SecurityUtils.encryptPassword(password));
boolean regFlag = recruitStudentMapper.insert(student) > 0 ? true : false; boolean regFlag = recruitStudentMapper.insert(student) > 0 ? true : false;
if (!regFlag) { if (!regFlag) {
msg = "注册失败,请联系系统管理人员"; msg = "注册失败,请联系系统管理人员";
} else { } else {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(studentName, Constants.REGISTER, MessageUtils.message("user.register.success"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(studentName, Constants.REGISTER,
} MessageUtils.message("user.register.success")));
} }
return msg;
} }
return msg;
//身份证唯一,手机号不唯一 }
@Override
public WebLoginBody login(WebRegisterBody webRegisterBody) { //身份证唯一,手机号不唯一
WebLoginBody loginBody = new WebLoginBody(); @Override
SchoolRecruitStudent student = recruitStudentMapper.getStudentByPhoneNumber(webRegisterBody.getPhoneNumber(), webRegisterBody.getIdCard()); public WebLoginBody login(WebRegisterBody webRegisterBody) {
if (StringUtils.isNull(student)) { WebLoginBody loginBody = new WebLoginBody();
throw new ServiceException("登录用户:" + webRegisterBody.getIdCard() + "不存在"); SchoolRecruitStudent student = recruitStudentMapper.getStudentByPhoneNumber(
} webRegisterBody.getPhoneNumber(), webRegisterBody.getIdCard());
if (!SecurityUtils.matchesPassword(webRegisterBody.getPassword(), student.getPassword())) { if (StringUtils.isNull(student)) {
throw new ServiceException("密码错误"); throw new ServiceException("登录用户:" + webRegisterBody.getIdCard() + "不存在");
}
loginBody.setId(student.getId());
loginBody.setIdCard(student.getIdCard());
loginBody.setPhoneNumber(student.getPhoneNumber());
loginBody.setStudentName(student.getStudentName());
loginBody.setPassword(student.getPassword());
return loginBody;
} }
if (!SecurityUtils.matchesPassword(webRegisterBody.getPassword(), student.getPassword())) {
/** throw new ServiceException("密码错误");
* 判断能不能点进去进入按钮 }
* 1能 0不能 loginBody.setId(student.getId());
* 当前状态(0=报名,1=待审核,2=通过,3=驳回,4=信息修改,5=准考证打印,6=成绩查询,7=审核) loginBody.setIdCard(student.getIdCard());
*/ loginBody.setPhoneNumber(student.getPhoneNumber());
@Override loginBody.setStudentName(student.getStudentName());
public int enterBtn(Long studentId, Long testId) { loginBody.setPassword(student.getPassword());
//获取考试详情 return loginBody;
SchoolRecruitExam exam = recruitExamMapper.selectById(testId); }
//获取学生与考试关系,是否报名
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(testId, studentId); /**
//未报名 * 判断能不能点进去进入按钮 1能 0不能 当前状态(0=报名,1=待审核,2=通过,3=驳回,4=信息修改,5=准考证打印,6=成绩查询,7=审核)
if (StringUtils.isNull(relation)) { */
//未报名,查询不到信息,且考试状态为报名阶段(信息审核)可以进去报名 @Override
if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) { public int enterBtn(Long studentId, Long testId) {
return 1; //获取考试详情
} else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) { SchoolRecruitExam exam = recruitExamMapper.selectById(testId);
//未报名,查询不到信息,且考试状态为考场分配,不能进入,因为考试报名审核已截止 //获取学生与考试关系,是否报名
return 0; SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(testId, studentId);
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) { //未报名
//未报名,查询不到信息,且考试状态为成绩发布 if (StringUtils.isNull(relation)) {
return 0; //未报名,查询不到信息,且考试状态为报名阶段(信息审核)可以进去报名
} else { if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为结束 return 1;
return 0; } else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) {
} //未报名,查询不到信息,且考试状态为考场分配,不能进入,因为考试报名审核已截止
return 0;
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为成绩发布
return 0;
} else {
//未报名,查询不到信息,且考试状态为结束
return 0;
}
} else {
//可以查到考生和考试的关系
//提交状态为未提交,也就是未报名
if (RecruitExamConstant.NOSUBMIT.equals(relation.getSubmit())) {
if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//未提交信息,考试状态为审核,可以进入
return 1;
} else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为考场分配,不可进入
return 0;
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为成绩发布
return 0;
} else { } else {
//可以查到考生和考试的关系 //未报名,查询不到信息,且考试状态为结束
//提交状态为未提交,也就是未报名 return 0;
if (RecruitExamConstant.NOSUBMIT.equals(relation.getSubmit())) {
if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//未提交信息,考试状态为审核,可以进入
return 1;
} else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为考场分配,不可进入
return 0;
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) {
//未报名,查询不到信息,且考试状态为成绩发布
return 0;
} else {
//未报名,查询不到信息,且考试状态为结束
return 0;
}
} else {
//提交状态为已提交,
if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//考试状态为信息审核阶段
return 1;
} else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) {
//考试状态为考场分配
return 1;
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) {
//考试状态为成绩发布
return 1;
} else {
//考试状态为结束
return 1;
}
}
} }
} else {
//提交状态为已提交,
if (RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//考试状态为信息审核阶段
return 1;
} else if (RecruitExamConstant.ADDRESS.equals(exam.getStatus())) {
//考试状态为考场分配
return 1;
} else if (RecruitExamConstant.SCORE.equals(exam.getStatus())) {
//考试状态为成绩发布
return 1;
} else {
//考试状态为结束
return 1;
}
}
} }
}
@Override
public WebSchoolRecruitStudentVo getInfo(Long id) { @Override
return recruitStudentMapper.getInfo(id); public WebSchoolRecruitStudentVo getInfo(Long id) {
return recruitStudentMapper.getInfo(id);
}
@Override
public WebSchoolRecruitStudentVo getStuInfo(Long id, Long examId) {
WebSchoolRecruitStudentVo s = recruitStudentMapper.getStuInfo(id, examId);
LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId());
lqw.eq(SchoolRecruitStudentJl::getDelFlag, "0");
List<SchoolRecruitStudentJl> resumeData = recruitStudentJlMapper.selectList(lqw);
s.setResumeData(resumeData);
LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>();
lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId());
lqw2.eq(SchoolRecruitStudentFamily::getDelFlag, "0");
List<SchoolRecruitStudentFamily> familyList = recruitStudentFamilyMapper.selectList(lqw2);
s.setRemeberData(familyList);
LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>();
lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId());
lqw3.eq(SchoolRecruitStudentFjb::getDelFlag, "0");
List<SchoolRecruitStudentFjb> fList = recruitStudentFjbMapper.selectList(lqw3);
s.setFileList(fList);
return s;
}
//根据考试id和考生id获取准考证信息(前提是当前学生已通过审核,且考试状态位于成绩发布)
@Override
public RecruitAdmissionTicketVo getTicket(Long studentId, Long examId) {
RecruitAdmissionTicketVo vo = new RecruitAdmissionTicketVo();
//获取考试详情
SchoolRecruitExam exam = recruitExamMapper.selectById(examId);
//获取考生信息
SchoolRecruitStudent student = recruitStudentMapper.selectById(studentId);
//获取考试和考生关系(此表中包含考试时间地点等)
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, studentId);
//测试项目
SchoolRecruitProject project = projectMapper.selectById(relation.getTestId());
//毕业学校
JuniorHighSchool school = schoolMapper.selectById(relation.getJuniorId());
vo.setExamName(exam.getExamName());
vo.setNotice(exam.getNotice());
vo.setStudentName(student.getStudentName());
vo.setExamNumber(relation.getExamNumber());
if (StringUtils.isNotNull(project)) {
vo.setProject(project.getProject());
} }
vo.setInGroup(relation.getInGroup());
vo.setPhoneNumber(student.getPhoneNumber());
@Override if (StringUtils.isNotNull(school)) {
public WebSchoolRecruitStudentVo getStuInfo(Long id, Long examId) { vo.setSchoolName(school.getSchoolName());
WebSchoolRecruitStudentVo s = recruitStudentMapper.getStuInfo(id, examId);
LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId());
lqw.eq(SchoolRecruitStudentJl::getDelFlag, "0");
List<SchoolRecruitStudentJl> resumeData = recruitStudentJlMapper.selectList(lqw);
s.setResumeData(resumeData);
LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>();
lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId());
lqw2.eq(SchoolRecruitStudentFamily::getDelFlag, "0");
List<SchoolRecruitStudentFamily> familyList = recruitStudentFamilyMapper.selectList(lqw2);
s.setRemeberData(familyList);
LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>();
lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId());
lqw3.eq(SchoolRecruitStudentFjb::getDelFlag, "0");
List<SchoolRecruitStudentFjb> fList = recruitStudentFjbMapper.selectList(lqw3);
s.setFileList(fList);
return s;
} }
vo.setPhoto(student.getPhoto());
//根据考试id和考生id获取准考证信息(前提是当前学生已通过审核,且考试状态位于成绩发布) //"yyyy-MM-dd"考试日期
@Override Date d = relation.getExamDate();
public RecruitAdmissionTicketVo getTicket(Long studentId, Long examId) { Calendar ca = Calendar.getInstance();
RecruitAdmissionTicketVo vo = new RecruitAdmissionTicketVo(); ca.setTime(d);
//获取考试详情 vo.setExamYear(ca.get(Calendar.YEAR));
SchoolRecruitExam exam = recruitExamMapper.selectById(examId); int day = ca.get(Calendar.DAY_OF_MONTH);
//获取考生信息 int month = ca.get(Calendar.MONTH) + 1;//第几个月 8
SchoolRecruitStudent student = recruitStudentMapper.selectById(studentId); //考试时间 HH:mm
//获取考试和考生关系(此表中包含考试时间地点等) String t = relation.getExamTime();
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, studentId); int hour = Integer.parseInt(StringUtils.substringBefore(t, ":"));
//测试项目 //判断是上午还是下午,小于12为上午,其余为下午
SchoolRecruitProject project = projectMapper.selectById(relation.getTestId()); String examDate = "";
//毕业学校 if (hour < 12) {
JuniorHighSchool school = schoolMapper.selectById(relation.getJuniorId()); examDate = month + "月" + day + "日上午";
} else {
vo.setExamName(exam.getExamName()); examDate = month + "月" + day + "日下午";
vo.setNotice(exam.getNotice());
vo.setStudentName(student.getStudentName());
vo.setExamNumber(relation.getExamNumber());
if (StringUtils.isNotNull(project)) {
vo.setProject(project.getProject());
}
vo.setInGroup(relation.getInGroup());
vo.setPhoneNumber(student.getPhoneNumber());
if (StringUtils.isNotNull(school)) {
vo.setSchoolName(school.getSchoolName());
}
vo.setPhoto(student.getPhoto());
//"yyyy-MM-dd"考试日期
Date d = relation.getExamDate();
Calendar ca = Calendar.getInstance();
ca.setTime(d);
vo.setExamYear(ca.get(Calendar.YEAR));
int day = ca.get(Calendar.DAY_OF_MONTH);
int month = ca.get(Calendar.MONTH) + 1;//第几个月 8
//考试时间 HH:mm
String t = relation.getExamTime();
int hour = Integer.parseInt(StringUtils.substringBefore(t, ":"));
//判断是上午还是下午,小于12为上午,其余为下午
String examDate = "";
if (hour < 12) {
examDate = month + "月" + day + "日上午";
} else {
examDate = month + "月" + day + "日下午";
}
vo.setExamDate(examDate);
vo.setExamTime(t + "开始");
vo.setExamAddress(relation.getExamAddress());
return vo;
} }
vo.setExamDate(examDate);
@Override vo.setExamTime(t + "开始");
public QueryScoreVo getScore(Long studentId, Long examId) { vo.setExamAddress(relation.getExamAddress());
QueryScoreVo vo = new QueryScoreVo(); return vo;
//获取考试详情 }
SchoolRecruitExam exam = recruitExamMapper.selectById(examId);
//获取考生信息 @Override
SchoolRecruitStudent student = recruitStudentMapper.selectById(studentId); public QueryScoreVo getScore(Long studentId, Long examId) {
//获取考试和考生关系(此表中包含考试时间地点等) QueryScoreVo vo = new QueryScoreVo();
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, studentId); //获取考试详情
//测试项目 SchoolRecruitExam exam = recruitExamMapper.selectById(examId);
SchoolRecruitProject project = projectMapper.selectById(relation.getTestId()); //获取考生信息
vo.setExamName(exam.getExamName()); SchoolRecruitStudent student = recruitStudentMapper.selectById(studentId);
vo.setExamYear(exam.getExamYear()); //获取考试和考生关系(此表中包含考试时间地点等)
vo.setStudentName(student.getStudentName()); SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, studentId);
vo.setStudentNumber(student.getStudentNumber()); //测试项目
vo.setExamNumber(relation.getExamNumber()); SchoolRecruitProject project = projectMapper.selectById(relation.getTestId());
vo.setIdCard(student.getIdCard()); vo.setExamName(exam.getExamName());
if (StringUtils.isNotNull(project)) { vo.setExamYear(exam.getExamYear());
//设置类别 vo.setStudentName(student.getStudentName());
String type = ""; vo.setStudentNumber(student.getStudentNumber());
switch (project.getType()) { vo.setExamNumber(relation.getExamNumber());
case "0": vo.setIdCard(student.getIdCard());
type = "体育"; if (StringUtils.isNotNull(project)) {
break; //设置类别
case "1": String type = "";
type = "音乐"; switch (project.getType()) {
break; case "0":
case "2": type = "体育";
type = "美术"; break;
break; case "1":
case "3": type = "音乐";
type = "书法"; break;
} case "2":
vo.setExamSort(type); type = "美术";
vo.setExamProject(project.getProject()); break;
} case "3":
vo.setScore(relation.getScore()); type = "书法";
vo.setResult(relation.getResult()); }
vo.setPassScore(relation.getPassScore()); vo.setExamSort(type);
return vo; vo.setExamProject(project.getProject());
} }
vo.setScore(relation.getScore());
/** vo.setResult(relation.getResult());
* 考生报名-暂存 vo.setPassScore(relation.getPassScore());
* 修改考生表 return vo;
* 首先判断该考生和该考试是否有relation,没有的话则要新增一份该考试考生关系数据 }
* 此时存考试id,考生id,身份证,提交状态(0未提交)
* 如果存在该考试考生关系数据,则对比身份证是否改变,修改了则修改关系表对应字段即可 /**
*/ * 考生报名-暂存 修改考生表 首先判断该考生和该考试是否有relation,没有的话则要新增一份该考试考生关系数据 此时存考试id,考生id,身份证,提交状态(0未提交)
@Override * 如果存在该考试考生关系数据,则对比身份证是否改变,修改了则修改关系表对应字段即可
@Transactional(rollbackFor = Exception.class) */
public int webSave(Long examId, WebSchoolRecruitStudentVo student) { @Override
//判断考试所在节点,如果不是审核阶段则不能暂存 @Transactional(rollbackFor = Exception.class)
SchoolRecruitExam exam = recruitExamMapper.selectById(examId); public int webSave(Long examId, WebSchoolRecruitStudentVo student) {
if (!RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) { //判断考试所在节点,如果不是审核阶段则不能暂存
throw new ServiceException("报名、审核阶段已过,暂时无法暂存信息"); SchoolRecruitExam exam = recruitExamMapper.selectById(examId);
} if (!RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
//修改学生信息 throw new ServiceException("报名、审核阶段已过,暂时无法暂存信息");
SchoolRecruitStudent s = recruitStudentMapper.selectById(student.getId()); }
//BeanUtils.copyProperties(student,s); //修改学生信息
s.setStudentNumber(student.getStudentNumber()); SchoolRecruitStudent s = recruitStudentMapper.selectById(student.getId());
s.setSex(student.getSex()); //BeanUtils.copyProperties(student,s);
s.setHeight(student.getHeight()); s.setStudentNumber(student.getStudentNumber());
s.setWeight(student.getWeight()); s.setSex(student.getSex());
s.setTelephone1(student.getTelephone1()); s.setHeight(student.getHeight());
s.setTelephone2(student.getTelephone2()); s.setWeight(student.getWeight());
s.setPhoto(student.getPhoto()); s.setTelephone1(student.getTelephone1());
s.setUpdateTime(DateUtils.getNowDate()); s.setTelephone2(student.getTelephone2());
s.setPhoto(student.getPhoto());
s.setMz(student.getMz()); s.setUpdateTime(DateUtils.getNowDate());
s.setZzmm(student.getZzmm());
s.setCsrq(student.getCsrq()); s.setMz(student.getMz());
s.setHyzk(student.getHyzk()); s.setZzmm(student.getZzmm());
s.setHjszd(student.getHjszd()); s.setCsrq(student.getCsrq());
s.setSyd(student.getSyd()); s.setHyzk(student.getHyzk());
s.setKssf(student.getKssf()); s.setHjszd(student.getHjszd());
s.setCjgzsj(student.getCjgzsj()); s.setSyd(student.getSyd());
s.setXgzdwzw(student.getXgzdwzw()); s.setKssf(student.getKssf());
s.setBkxlsfqrz(student.getBkxlsfqrz()); s.setCjgzsj(student.getCjgzsj());
s.setXl(student.getXl()); s.setXgzdwzw(student.getXgzdwzw());
s.setXw(student.getXw()); s.setBkxlsfqrz(student.getBkxlsfqrz());
s.setByxx(student.getByxx()); s.setXl(student.getXl());
s.setSxzz(student.getSxzz()); s.setXw(student.getXw());
s.setZhbysj(student.getZhbysj()); s.setByxx(student.getByxx());
recruitStudentMapper.updateById(s); s.setSxzz(student.getSxzz());
s.setZhbysj(student.getZhbysj());
recruitStudentMapper.updateById(s);
//从表信息的保存 //从表信息的保存
//简历 //简历
LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId()); lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId());
recruitStudentJlMapper.delete(lqw); recruitStudentJlMapper.delete(lqw);
List<SchoolRecruitStudentJl> resumeData = student.getResumeData(); List<SchoolRecruitStudentJl> resumeData = student.getResumeData();
for(SchoolRecruitStudentJl j:resumeData){ for (SchoolRecruitStudentJl j : resumeData) {
j.setId(null); j.setId(null);
j.setStudentId(student.getId()); j.setStudentId(student.getId());
recruitStudentJlMapper.insert(j); recruitStudentJlMapper.insert(j);
} }
//家庭 //家庭
LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>();
lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId()); lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId());
recruitStudentFamilyMapper.delete(lqw2); recruitStudentFamilyMapper.delete(lqw2);
List<SchoolRecruitStudentFamily> remeberData = student.getRemeberData(); List<SchoolRecruitStudentFamily> remeberData = student.getRemeberData();
for(SchoolRecruitStudentFamily j:remeberData){ for (SchoolRecruitStudentFamily j : remeberData) {
j.setId(null); j.setId(null);
j.setStudentId(student.getId()); j.setStudentId(student.getId());
recruitStudentFamilyMapper.insert(j); recruitStudentFamilyMapper.insert(j);
} }
//附件 //附件
LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>();
lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId()); lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId());
recruitStudentFjbMapper.delete(lqw3); recruitStudentFjbMapper.delete(lqw3);
List<SchoolRecruitStudentFjb> fileList = student.getFileList(); List<SchoolRecruitStudentFjb> fileList = student.getFileList();
for(SchoolRecruitStudentFjb j:fileList){ for (SchoolRecruitStudentFjb j : fileList) {
j.setId(null); j.setId(null);
j.setStudentId(student.getId()); j.setStudentId(student.getId());
recruitStudentFjbMapper.insert(j); recruitStudentFjbMapper.insert(j);
}
//获取考试考生关系
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, student.getId());
//暂无关系,则一份关系
if (StringUtils.isNull(relation)) {
relation = new SchoolRecruitRelation();
relation.setExamId(examId);
relation.setStudentId(student.getId());
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
relation.setSubmit(RecruitExamConstant.NOSUBMIT);
relation.setCreateTime(DateUtils.getNowDate());
return recruitRelationMapper.insert(relation);
}
//身份证号、初中学校、测试项目改变
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
relation.setUpdateTime(DateUtils.getNowDate());
return recruitRelationMapper.updateById(relation);
} }
/** //获取考试考生关系
* 考生报名-提交 SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId,
* 修改考生表 student.getId());
* 首先判断该考生和该考试是否有relation,没有的话则要新增一份该考试考生关系数据 //暂无关系,则一份关系
* 此时存考试id,考生id,身份证,提交状态(1已提交),审核状态为3=待审核 if (StringUtils.isNull(relation)) {
* 如果存在该考试考生关系数据, 修改身份证号,提交状态(1已提交),审核状态为3=待审核,修改关系表即可 relation = new SchoolRecruitRelation();
*/ relation.setExamId(examId);
@Override relation.setStudentId(student.getId());
@Transactional(rollbackFor = Exception.class) relation.setInfoIdCard(student.getIdCard());
public int webSubmit(Long examId, WebSchoolRecruitStudentVo student) { relation.setJuniorId(student.getJuniorId());
//判断考试所在节点,如果不是审核阶段则不能提交 relation.setTestId(student.getTestId());
SchoolRecruitExam exam = recruitExamMapper.selectById(examId); relation.setSubmit(RecruitExamConstant.NOSUBMIT);
if (!RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) { relation.setCreateTime(DateUtils.getNowDate());
throw new ServiceException("报名、审核阶段已过,暂时无法提交信息"); return recruitRelationMapper.insert(relation);
} }
//修改学生信息 //身份证号、初中学校、测试项目改变
SchoolRecruitStudent s = recruitStudentMapper.selectById(student.getId()); relation.setInfoIdCard(student.getIdCard());
//BeanUtils.copyProperties(student,s); relation.setJuniorId(student.getJuniorId());
s.setStudentNumber(student.getStudentNumber()); relation.setTestId(student.getTestId());
s.setSex(student.getSex()); relation.setUpdateTime(DateUtils.getNowDate());
s.setHeight(student.getHeight()); return recruitRelationMapper.updateById(relation);
s.setWeight(student.getWeight()); }
s.setTelephone1(student.getTelephone1());
s.setTelephone2(student.getTelephone2()); /**
s.setPhoto(student.getPhoto()); * 考生报名-提交 修改考生表 首先判断该考生和该考试是否有relation,没有的话则要新增一份该考试考生关系数据 此时存考试id,考生id,身份证,提交状态(1已提交),审核状态为3=待审核
s.setUpdateTime(DateUtils.getNowDate()); * 如果存在该考试考生关系数据, 修改身份证号,提交状态(1已提交),审核状态为3=待审核,修改关系表即可
*/
s.setMz(student.getMz()); @Override
s.setZzmm(student.getZzmm()); @Transactional(rollbackFor = Exception.class)
s.setCsrq(student.getCsrq()); public int webSubmit(Long examId, WebSchoolRecruitStudentVo student) {
s.setHyzk(student.getHyzk()); //判断考试所在节点,如果不是审核阶段则不能提交
s.setHjszd(student.getHjszd()); SchoolRecruitExam exam = recruitExamMapper.selectById(examId);
s.setSyd(student.getSyd()); if (!RecruitExamConstant.INFOCHECK.equals(exam.getStatus())) {
s.setKssf(student.getKssf()); throw new ServiceException("报名、审核阶段已过,暂时无法提交信息");
s.setCjgzsj(student.getCjgzsj()); }
s.setXgzdwzw(student.getXgzdwzw()); //修改学生信息
s.setBkxlsfqrz(student.getBkxlsfqrz()); SchoolRecruitStudent s = recruitStudentMapper.selectById(student.getId());
s.setXl(student.getXl()); //BeanUtils.copyProperties(student,s);
s.setXw(student.getXw()); s.setStudentNumber(student.getStudentNumber());
s.setByxx(student.getByxx()); s.setSex(student.getSex());
s.setSxzz(student.getSxzz()); s.setHeight(student.getHeight());
s.setZhbysj(student.getZhbysj()); s.setWeight(student.getWeight());
recruitStudentMapper.updateById(s); s.setTelephone1(student.getTelephone1());
s.setTelephone2(student.getTelephone2());
s.setPhoto(student.getPhoto());
s.setUpdateTime(DateUtils.getNowDate());
//从表信息的保存
//简历 s.setMz(student.getMz());
LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>(); s.setZzmm(student.getZzmm());
lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId()); s.setCsrq(student.getCsrq());
recruitStudentJlMapper.delete(lqw); s.setHyzk(student.getHyzk());
s.setHjszd(student.getHjszd());
List<SchoolRecruitStudentJl> resumeData = student.getResumeData(); s.setSyd(student.getSyd());
for(SchoolRecruitStudentJl j:resumeData){ s.setKssf(student.getKssf());
j.setStudentId(student.getId()); s.setCjgzsj(student.getCjgzsj());
recruitStudentJlMapper.insert(j); s.setXgzdwzw(student.getXgzdwzw());
} s.setBkxlsfqrz(student.getBkxlsfqrz());
//家庭 s.setXl(student.getXl());
LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>(); s.setXw(student.getXw());
lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId()); s.setByxx(student.getByxx());
recruitStudentFamilyMapper.delete(lqw2); s.setSxzz(student.getSxzz());
s.setZhbysj(student.getZhbysj());
List<SchoolRecruitStudentFamily> remeberData = student.getRemeberData(); recruitStudentMapper.updateById(s);
for(SchoolRecruitStudentFamily j:remeberData){
j.setStudentId(student.getId()); //从表信息的保存
recruitStudentFamilyMapper.insert(j); //简历
} LambdaQueryWrapper<SchoolRecruitStudentJl> lqw = new LambdaQueryWrapper<>();
//附件 lqw.eq(SchoolRecruitStudentJl::getStudentId, s.getId());
LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>(); recruitStudentJlMapper.delete(lqw);
lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId());
recruitStudentFjbMapper.delete(lqw3); List<SchoolRecruitStudentJl> resumeData = student.getResumeData();
for (SchoolRecruitStudentJl j : resumeData) {
List<SchoolRecruitStudentFjb> fileList = student.getFileList(); j.setStudentId(student.getId());
for(SchoolRecruitStudentFjb j:fileList){ recruitStudentJlMapper.insert(j);
j.setId(null); }
j.setStudentId(student.getId()); //家庭
recruitStudentFjbMapper.insert(j); LambdaQueryWrapper<SchoolRecruitStudentFamily> lqw2 = new LambdaQueryWrapper<>();
} lqw2.eq(SchoolRecruitStudentFamily::getStudentId, s.getId());
recruitStudentFamilyMapper.delete(lqw2);
List<SchoolRecruitStudentFamily> remeberData = student.getRemeberData();
//获取考试考生关系 for (SchoolRecruitStudentFamily j : remeberData) {
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, student.getId()); j.setStudentId(student.getId());
//暂无关系,则新增一份关系 recruitStudentFamilyMapper.insert(j);
if (StringUtils.isNull(relation)) { }
relation = new SchoolRecruitRelation(); //附件
relation.setExamId(examId); LambdaQueryWrapper<SchoolRecruitStudentFjb> lqw3 = new LambdaQueryWrapper<>();
relation.setStudentId(student.getId()); lqw3.eq(SchoolRecruitStudentFjb::getStudentId, s.getId());
relation.setInfoIdCard(student.getIdCard()); recruitStudentFjbMapper.delete(lqw3);
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId()); List<SchoolRecruitStudentFjb> fileList = student.getFileList();
relation.setSubmit(RecruitExamConstant.SUBMIT); for (SchoolRecruitStudentFjb j : fileList) {
relation.setAuditStatus(RecruitExamConstant.CHECK); j.setId(null);
relation.setCreateTime(DateUtils.getNowDate()); j.setStudentId(student.getId());
return recruitRelationMapper.insert(relation); recruitStudentFjbMapper.insert(j);
}
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
relation.setSubmit(RecruitExamConstant.SUBMIT);
relation.setAuditStatus(RecruitExamConstant.CHECK);
relation.setUpdateTime(DateUtils.getNowDate());
return recruitRelationMapper.updateById(relation);
} }
/** //获取考试考生关系
* 教务管理-考试管理-信息审核列表 SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId,
*/ student.getId());
@Override //暂无关系,则新增一份关系
public List<RecruitEduStudentVo> getInfoCheck(RecruitEduStudentVo vo) { if (StringUtils.isNull(relation)) {
//结果集 ,获取到了所有考试考生关系及报名学生的信息 relation = new SchoolRecruitRelation();
List<RecruitEduStudentVo> voList = recruitRelationMapper.getInfoCheck(vo); relation.setExamId(examId);
//获取教育局考生信息 relation.setStudentId(student.getId());
LambdaQueryWrapper<EduRecruitStudent> eduLqw = new LambdaQueryWrapper<>(); relation.setInfoIdCard(student.getIdCard());
eduLqw.eq(EduRecruitStudent::getExamId, vo.getExamId()); relation.setJuniorId(student.getJuniorId());
List<EduRecruitStudent> eduRecruitStudentList = eduRecruitStudentMapper.selectList(eduLqw); relation.setTestId(student.getTestId());
if (StringUtils.isNotNull(eduRecruitStudentList) && eduRecruitStudentList.size() > 0) { relation.setSubmit(RecruitExamConstant.SUBMIT);
//遍历教育局学生信息,将其值整到对应结果集对象信息,若根据身份证号匹配不到,就新建个对象放到结果集中 relation.setAuditStatus(RecruitExamConstant.CHECK);
for (EduRecruitStudent eduRecruitStudent : eduRecruitStudentList) { relation.setCreateTime(DateUtils.getNowDate());
//判断能否根据身份证号匹配上 return recruitRelationMapper.insert(relation);
boolean flag = true; }
for (RecruitEduStudentVo studentVo : voList) { relation.setInfoIdCard(student.getIdCard());
//若可以匹配上 relation.setJuniorId(student.getJuniorId());
if (eduRecruitStudent.getEduIdCard().equals(studentVo.getInfoIdCard())) { relation.setTestId(student.getTestId());
flag = false; relation.setSubmit(RecruitExamConstant.SUBMIT);
//设置结果集对应教育局信息 relation.setAuditStatus(RecruitExamConstant.CHECK);
studentVo.setEduIdCard(eduRecruitStudent.getEduIdCard()); relation.setUpdateTime(DateUtils.getNowDate());
studentVo.setEduStudentName(eduRecruitStudent.getEduStudentName()); return recruitRelationMapper.updateById(relation);
}
/**
* 教务管理-考试管理-信息审核列表
*/
@Override
public List<RecruitEduStudentVo> getInfoCheck(RecruitEduStudentVo vo) {
//结果集 ,获取到了所有考试考生关系及报名学生的信息
List<RecruitEduStudentVo> voList = recruitRelationMapper.getInfoCheck(vo);
//获取教育局考生信息
LambdaQueryWrapper<EduRecruitStudent> eduLqw = new LambdaQueryWrapper<>();
eduLqw.eq(EduRecruitStudent::getExamId, vo.getExamId());
List<EduRecruitStudent> eduRecruitStudentList = eduRecruitStudentMapper.selectList(eduLqw);
if (StringUtils.isNotNull(eduRecruitStudentList) && eduRecruitStudentList.size() > 0) {
//遍历教育局学生信息,将其值整到对应结果集对象信息,若根据身份证号匹配不到,就新建个对象放到结果集中
for (EduRecruitStudent eduRecruitStudent : eduRecruitStudentList) {
//判断能否根据身份证号匹配上
boolean flag = true;
for (RecruitEduStudentVo studentVo : voList) {
//若可以匹配上
if (eduRecruitStudent.getEduIdCard().equals(studentVo.getInfoIdCard())) {
flag = false;
//设置结果集对应教育局信息
studentVo.setEduIdCard(eduRecruitStudent.getEduIdCard());
studentVo.setEduStudentName(eduRecruitStudent.getEduStudentName());
// studentVo.setEduStudentNumber(eduRecruitStudent.getEduStudentNumber()); // studentVo.setEduStudentNumber(eduRecruitStudent.getEduStudentNumber());
// studentVo.setEduSchoolName(eduRecruitStudent.getEduSchoolName()); // studentVo.setEduSchoolName(eduRecruitStudent.getEduSchoolName());
studentVo.setEduProject(eduRecruitStudent.getEduProject()); studentVo.setEduProject(eduRecruitStudent.getEduProject());
studentVo.setEduSex(eduRecruitStudent.getEduSex()); studentVo.setEduSex(eduRecruitStudent.getEduSex());
break; break;
} }
} }
if (flag) { if (flag) {
//说明没有报名信息可以和教育局信息匹配上,需要新增一条数据 //说明没有报名信息可以和教育局信息匹配上,需要新增一条数据
RecruitEduStudentVo studentVo = new RecruitEduStudentVo(); RecruitEduStudentVo studentVo = new RecruitEduStudentVo();
studentVo.setExamId(vo.getExamId()); studentVo.setExamId(vo.getExamId());
studentVo.setInfoIdCard(eduRecruitStudent.getEduIdCard()); studentVo.setInfoIdCard(eduRecruitStudent.getEduIdCard());
studentVo.setEduIdCard(eduRecruitStudent.getEduIdCard()); studentVo.setEduIdCard(eduRecruitStudent.getEduIdCard());
studentVo.setEduStudentName(eduRecruitStudent.getEduStudentName()); studentVo.setEduStudentName(eduRecruitStudent.getEduStudentName());
// studentVo.setEduStudentNumber(eduRecruitStudent.getEduStudentNumber()); // studentVo.setEduStudentNumber(eduRecruitStudent.getEduStudentNumber());
// studentVo.setEduSchoolName(eduRecruitStudent.getEduSchoolName()); // studentVo.setEduSchoolName(eduRecruitStudent.getEduSchoolName());
studentVo.setEduProject(eduRecruitStudent.getEduProject()); studentVo.setEduProject(eduRecruitStudent.getEduProject());
studentVo.setEduSex(eduRecruitStudent.getEduSex()); studentVo.setEduSex(eduRecruitStudent.getEduSex());
voList.add(studentVo); voList.add(studentVo);
}
}
}
//设置匹配状态
List<RecruitEduStudentVo> list = setState(voList);
//通过模糊查询过滤,匹配状态,审核状态,姓名(对应学生自己的报名信息),身份证号
if (StringUtils.isNotNull(vo.getMatchStatus())) {
list = list.stream().filter(a -> a.getMatchStatus().equals(vo.getMatchStatus())).collect(Collectors.toList());
} }
if (StringUtils.isNotNull(vo.getAuditStatus())) { }
list = list.stream().filter(a -> a.getAuditStatus().equals(vo.getAuditStatus())).collect(Collectors.toList());
}
if (StringUtils.isNotNull(vo.getStudentName())) {
list = list.stream().filter(a -> a.getStudentName().contains(vo.getStudentName())).collect(Collectors.toList());
}
if (StringUtils.isNotNull(vo.getInfoIdCard())) {
list = list.stream().filter(a -> a.getInfoIdCard().contains(vo.getInfoIdCard())).collect(Collectors.toList());
}
return list;
} }
@Override //设置匹配状态
@Transactional(rollbackFor = Exception.class) List<RecruitEduStudentVo> list = setState(voList);
public int editRecruitAndEdu(Long examId, RecruitAndEduStudentVo student) { //通过模糊查询过滤,匹配状态,审核状态,姓名(对应学生自己的报名信息),身份证号
//修改学生信息 if (StringUtils.isNotNull(vo.getMatchStatus())) {
SchoolRecruitStudent s = new SchoolRecruitStudent(); list = list.stream().filter(a -> a.getMatchStatus().equals(vo.getMatchStatus()))
BeanUtils.copyProperties(student, s); .collect(Collectors.toList());
s.setId(student.getId());
s.setCreateBy(student.getCreateBy());
s.setCreateTime(student.getCreateTime());
s.update();
recruitStudentMapper.updateById(s);
//获取考试考生关系
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, student.getId());
//身份证号改变
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
relation.update();
recruitRelationMapper.updateById(relation);
//教育局信息修改
LambdaQueryWrapper<EduRecruitStudent> lqw = new LambdaQueryWrapper<>();
lqw.eq(EduRecruitStudent::getExamId,examId).eq(EduRecruitStudent::getEduIdCard,student.getIdCard());
List<EduRecruitStudent> list = eduRecruitStudentMapper.selectList(lqw);
//存在 1条教育局信息
if(StringUtils.isNotNull(list) && list.size() > 0){
//修改
EduRecruitStudent edu = list.get(0);
edu.setEduStudentName(student.getEduStudentName());
edu.setEduStudentNumber(student.getEduStudentNumber());
edu.setEduJuniorId(student.getEduJuniorId());
edu.setEduSchoolName(student.getEduSchoolName());
edu.setEduTestId(student.getEduTestId());
edu.setEduProject(student.getEduProject());
edu.setEduSex(student.getEduSex());
edu.update();
return eduRecruitStudentMapper.updateById(edu);
}else {
//不存在,新增对应教育局信息
EduRecruitStudent edu = new EduRecruitStudent();
edu.setExamId(examId);
//赋值学生的身份证号
edu.setEduIdCard(student.getIdCard());
edu.setEduStudentName(student.getEduStudentName());
edu.setEduStudentNumber(student.getEduStudentNumber());
edu.setEduJuniorId(student.getEduJuniorId());
edu.setEduSchoolName(student.getEduSchoolName());
edu.setEduTestId(student.getEduTestId());
edu.setEduProject(student.getEduProject());
edu.setEduSex(student.getEduSex());
edu.insert();
return eduRecruitStudentMapper.insert(edu);
}
} }
if (StringUtils.isNotNull(vo.getAuditStatus())) {
/** list = list.stream().filter(
* 教务管理-考试管理-信息审核-修改 a -> StringUtils.isNotNull(a.getAuditStatus()) && a.getAuditStatus()
*/ .equals(vo.getAuditStatus())).collect(Collectors.toList());
@Override
@Transactional(rollbackFor = Exception.class)
public int edit(Long examId, WebSchoolRecruitStudentVo student) {
//修改学生信息
SchoolRecruitStudent s = new SchoolRecruitStudent();
BeanUtils.copyProperties(student, s);
s.setId(student.getId());
s.setCreateBy(student.getCreateBy());
s.setCreateTime(student.getCreateTime());
s.update();
recruitStudentMapper.updateById(s);
//获取考试考生关系
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId, student.getId());
//身份证号改变
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
return recruitRelationMapper.updateById(relation);
} }
if (StringUtils.isNotNull(vo.getStudentName())) {
/** list = list.stream().filter(
* 教务管理-考试管理-信息审核-导出报名信息 a -> StringUtils.isNotNull(a.getStudentName()) && a.getStudentName()
*/ .contains(vo.getStudentName())).collect(Collectors.toList());
@Override
public List<SchoolRecruitStudentVo> editExport(List<Long> idList, Long examId) {
List<SchoolRecruitStudentVo> list = recruitStudentMapper.editExport(idList, examId);
//序号
int i = 1;
for (SchoolRecruitStudentVo student : list) {
student.setXh(i);
i++;
}
return list;
} }
if (StringUtils.isNotNull(vo.getInfoIdCard())) {
/** list = list.stream().filter(a -> a.getInfoIdCard().contains(vo.getInfoIdCard()))
* 教务管理-考试管理-通过 .collect(Collectors.toList());
*/ }
@Override return list;
@Transactional(rollbackFor = Exception.class) }
public String pass(Long examId, List<Long> studentIds) {
// 准备记录日志数据 @Override
int successNum = 0; @Transactional(rollbackFor = Exception.class)
int failureNum = 0; public int editRecruitAndEdu(Long examId, RecruitAndEduStudentVo student) {
StringBuilder successMsg = new StringBuilder(); //修改学生信息
//查询出所有studentIds对应的学生信息 SchoolRecruitStudent s = new SchoolRecruitStudent();
List<SchoolRecruitStudentVo> list = recruitStudentMapper.editExport(studentIds, examId); BeanUtils.copyProperties(student, s);
//选中的有效学生信息总数 s.setId(student.getId());
int allNum = list.size(); s.setCreateBy(student.getCreateBy());
for (SchoolRecruitStudentVo student : list) { s.setCreateTime(student.getCreateTime());
//根据考试id,和学生身份证号查出教育局学生信息进行比对 s.update();
EduRecruitStudent eduRecruitStudent = eduRecruitStudentMapper.getStudent(examId, student.getIdCard()); recruitStudentMapper.updateById(s);
boolean flag = true;
if (StringUtils.isNotNull(eduRecruitStudent)) { //获取考试考生关系
//匹配学生和教育局信息 SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId,
if (!student.getStudentName().equals(eduRecruitStudent.getEduStudentName())) { student.getId());
flag = false; //身份证号改变
} relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
relation.update();
recruitRelationMapper.updateById(relation);
//教育局信息修改
LambdaQueryWrapper<EduRecruitStudent> lqw = new LambdaQueryWrapper<>();
lqw.eq(EduRecruitStudent::getExamId, examId)
.eq(EduRecruitStudent::getEduIdCard, student.getIdCard());
List<EduRecruitStudent> list = eduRecruitStudentMapper.selectList(lqw);
//存在 1条教育局信息
if (StringUtils.isNotNull(list) && list.size() > 0) {
//修改
EduRecruitStudent edu = list.get(0);
edu.setEduStudentName(student.getEduStudentName());
edu.setEduStudentNumber(student.getEduStudentNumber());
edu.setEduJuniorId(student.getEduJuniorId());
edu.setEduSchoolName(student.getEduSchoolName());
edu.setEduTestId(student.getEduTestId());
edu.setEduProject(student.getEduProject());
edu.setEduSex(student.getEduSex());
edu.update();
return eduRecruitStudentMapper.updateById(edu);
} else {
//不存在,新增对应教育局信息
EduRecruitStudent edu = new EduRecruitStudent();
edu.setExamId(examId);
//赋值学生的身份证号
edu.setEduIdCard(student.getIdCard());
edu.setEduStudentName(student.getEduStudentName());
edu.setEduStudentNumber(student.getEduStudentNumber());
edu.setEduJuniorId(student.getEduJuniorId());
edu.setEduSchoolName(student.getEduSchoolName());
edu.setEduTestId(student.getEduTestId());
edu.setEduProject(student.getEduProject());
edu.setEduSex(student.getEduSex());
edu.insert();
return eduRecruitStudentMapper.insert(edu);
}
}
/**
* 教务管理-考试管理-信息审核-修改
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int edit(Long examId, WebSchoolRecruitStudentVo student) {
//修改学生信息
SchoolRecruitStudent s = new SchoolRecruitStudent();
BeanUtils.copyProperties(student, s);
s.setId(student.getId());
s.setCreateBy(student.getCreateBy());
s.setCreateTime(student.getCreateTime());
s.update();
recruitStudentMapper.updateById(s);
//获取考试考生关系
SchoolRecruitRelation relation = recruitRelationMapper.getRelationByIds(examId,
student.getId());
//身份证号改变
relation.setInfoIdCard(student.getIdCard());
relation.setJuniorId(student.getJuniorId());
relation.setTestId(student.getTestId());
return recruitRelationMapper.updateById(relation);
}
/**
* 教务管理-考试管理-信息审核-导出报名信息
*/
@Override
public List<SchoolRecruitStudentVo> editExport(List<Long> idList, Long examId) {
List<SchoolRecruitStudentVo> list = recruitStudentMapper.editExport(idList, examId);
//序号
int i = 1;
for (SchoolRecruitStudentVo student : list) {
student.setXh(i);
i++;
}
return list;
}
/**
* 教务管理-考试管理-通过
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String pass(Long examId, List<Long> studentIds) {
// 准备记录日志数据
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
//查询出所有studentIds对应的学生信息
List<SchoolRecruitStudentVo> list = recruitStudentMapper.editExport(studentIds, examId);
//选中的有效学生信息总数
int allNum = list.size();
for (SchoolRecruitStudentVo student : list) {
//根据考试id,和学生身份证号查出教育局学生信息进行比对
EduRecruitStudent eduRecruitStudent = eduRecruitStudentMapper.getStudent(examId,
student.getIdCard());
boolean flag = true;
if (StringUtils.isNotNull(eduRecruitStudent)) {
//匹配学生和教育局信息
if (!student.getStudentName().equals(eduRecruitStudent.getEduStudentName())) {
flag = false;
}
// if (!student.getStudentNumber().equals(eduRecruitStudent.getEduStudentNumber())) { // if (!student.getStudentNumber().equals(eduRecruitStudent.getEduStudentNumber())) {
// flag = false; // flag = false;
// } // }
// if (!student.getSchoolName().equals(eduRecruitStudent.getEduSchoolName())) { // if (!student.getSchoolName().equals(eduRecruitStudent.getEduSchoolName())) {
// flag = false; // flag = false;
// } // }
if (!student.getProject().equals(eduRecruitStudent.getEduProject())) { if (!student.getProject().equals(eduRecruitStudent.getEduProject())) {
flag = false; flag = false;
}
if (!student.getSex().equals(eduRecruitStudent.getEduSex())) {
flag = false;
}
if (flag) {
//全部都匹配
//判断状态是否已是通过
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId).eq(SchoolRecruitRelation::getStudentId, student.getId());
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard() + "的学生信息已驳回,无法通过;");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard() + "的学生信息已通过,无法再次通过;");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard() + "的学生信息已退回修改,没有再次提交申请,无法通过;");
} else {
relation.setAuditStatus(RecruitExamConstant.PASS);
recruitRelationMapper.updateById(relation);
successNum++;
}
} else {
//存在教育局信息,但是没有匹配上
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard() + "的学生,信息不匹配,无法通过;");
}
} else {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard() + "的学生,无教育局信息,无法通过;");
}
} }
if(allNum != successNum){ if (!student.getSex().equals(eduRecruitStudent.getEduSex())) {
//存在无法通过的数据 flag = false;
successMsg.insert(0, "选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + "</span> 条(排除所有未报名的数据),已将选中数据中所有匹配的、待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"+ successNum +"</span> 条数据的状态改为通过!有 <span style='color: red;font-size: 20px; font-weight:bold'>" + failureNum + "</span> 条不符合条件的数据,不通过的理由如下:");
return successMsg.toString();
}else {
return "恭喜您,已将选中的所有有效数据(排除所有未报名的数据)的状态改为通过!共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + " </span> 条";
} }
if (flag) {
//全部都匹配
//判断状态是否已是通过
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId)
.eq(SchoolRecruitRelation::getStudentId, student.getId());
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + student.getIdCard() + "的学生信息已驳回,无法通过;");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + student.getIdCard() + "的学生信息已通过,无法再次通过;");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + student.getIdCard()
+ "的学生信息已退回修改,没有再次提交申请,无法通过;");
} else {
relation.setAuditStatus(RecruitExamConstant.PASS);
recruitRelationMapper.updateById(relation);
successNum++;
}
} else {
//存在教育局信息,但是没有匹配上
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + student.getIdCard() + "的学生,信息不匹配,无法通过;");
}
} else {
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + student.getIdCard() + "的学生,无教育局信息,无法通过;");
}
} }
if (allNum != successNum) {
@Override //存在无法通过的数据
@Transactional(rollbackFor = Exception.class) successMsg.insert(0,
public int passOne(Long examId, Long studentId) { "选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum
//查询出所有studentIds对应的学生信息 + "</span> 条(排除所有未报名的数据),已将选中数据中所有匹配的、待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"
WebSchoolRecruitStudentVo vo = recruitStudentMapper.getStuInfo(studentId, examId); + successNum
+ "</span> 条数据的状态改为通过!有 <span style='color: red;font-size: 20px; font-weight:bold'>"
//根据考试id,和学生身份证号查出教育局学生信息进行比对 + failureNum + "</span> 条不符合条件的数据,不通过的理由如下:");
EduRecruitStudent eduRecruitStudent = eduRecruitStudentMapper.getStudent(examId, vo.getIdCard()); return successMsg.toString();
boolean flag = true; } else {
if (StringUtils.isNotNull(eduRecruitStudent)) { return
//匹配学生和教育局信息 "恭喜您,已将选中的所有有效数据(排除所有未报名的数据)的状态改为通过!共 <span style='color: red;font-size: 20px; font-weight:bold'>"
if (!vo.getStudentName().equals(eduRecruitStudent.getEduStudentName())) { + allNum + " </span> 条";
flag = false; }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public int passOne(Long examId, Long studentId) {
//查询出所有studentIds对应的学生信息
WebSchoolRecruitStudentVo vo = recruitStudentMapper.getStuInfo(studentId, examId);
//根据考试id,和学生身份证号查出教育局学生信息进行比对
EduRecruitStudent eduRecruitStudent = eduRecruitStudentMapper.getStudent(examId,
vo.getIdCard());
boolean flag = true;
if (StringUtils.isNotNull(eduRecruitStudent)) {
//匹配学生和教育局信息
if (!vo.getStudentName().equals(eduRecruitStudent.getEduStudentName())) {
flag = false;
}
// if (!vo.getStudentNumber().equals(eduRecruitStudent.getEduStudentNumber())) { // if (!vo.getStudentNumber().equals(eduRecruitStudent.getEduStudentNumber())) {
// flag = false; // flag = false;
// } // }
// if (!vo.getSchoolName().equals(eduRecruitStudent.getEduSchoolName())) { // if (!vo.getSchoolName().equals(eduRecruitStudent.getEduSchoolName())) {
// flag = false; // flag = false;
// } // }
if (!vo.getProject().equals(eduRecruitStudent.getEduProject())) { if (!vo.getProject().equals(eduRecruitStudent.getEduProject())) {
flag = false; flag = false;
} }
if (!vo.getSex().equals(eduRecruitStudent.getEduSex())) { if (!vo.getSex().equals(eduRecruitStudent.getEduSex())) {
flag = false; flag = false;
} }
if (flag) { if (flag) {
//全部都匹配 //全部都匹配
//判断状态是否已是通过 //判断状态是否已是通过
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId).eq(SchoolRecruitRelation::getStudentId, vo.getId());
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生信息已驳回,无法通过");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生信息已通过,无法再次通过");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生信息已退回修改,没有再次提交申请,无法通过");
} else {
relation.setAuditStatus(RecruitExamConstant.PASS);
return recruitRelationMapper.updateById(relation);
}
} else {
//存在教育局信息,但是没有匹配上
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生,信息不匹配,无法通过");
}
} else {
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生,无教育局信息,无法通过");
}
}
/**
* 教务管理-考试管理-退回修改
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String back(Long examId, List<Long> studentIds) {
// 准备记录日志数据
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
//查询出所有studentIds对应的学生信息
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId).in(SchoolRecruitRelation::getStudentId, studentIds); lqw.eq(SchoolRecruitRelation::getExamId, examId)
List<SchoolRecruitRelation> list = recruitRelationMapper.selectList(lqw); .eq(SchoolRecruitRelation::getStudentId, vo.getId());
//选中的有效学生信息总数
int allNum = list.size();
for (SchoolRecruitRelation relation : list) {
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法退回修改;");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法退回修改;");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已退回修改,没有再次提交申请,无法再次退回修改;");
} else {
relation.setAuditStatus(RecruitExamConstant.EDIT);
recruitRelationMapper.updateById(relation);
successNum++;
}
}
if(allNum != successNum){
//存在无法退回修改的数据
successMsg.insert(0, "选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + "</span> 条(排除所有未报名的数据),已将选中数据中所有匹配的、待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"+ successNum +"</span> 条数据的状态改为退回修改!有 <span style='color: red;font-size: 20px; font-weight:bold'>" + failureNum + "</span> 条不符合条件的数据,无法退回修改的理由如下:");
return successMsg.toString();
}else {
return "恭喜您,已将选中的所有有效数据(排除所有未报名的数据)的状态改为退回修改,共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + "</span> 条!";
}
}
@Override
public int backOne(Long examId, Long studentId) {
//查询出studentId对应的学生考试信息
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId).eq(SchoolRecruitRelation::getStudentId, studentId);
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0); SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) { if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法退回修改"); throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生信息已驳回,无法通过");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) { } else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法退回修改"); throw new ServiceException(
"身份证号为" + vo.getIdCard() + "的学生信息已通过,无法再次通过");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) { } else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已退回修改,没有再次提交申请,无法再次退回修改"); throw new ServiceException(
"身份证号为" + vo.getIdCard() + "的学生信息已退回修改,没有再次提交申请,无法通过");
} else { } else {
relation.setAuditStatus(RecruitExamConstant.EDIT); relation.setAuditStatus(RecruitExamConstant.PASS);
return recruitRelationMapper.updateById(relation); return recruitRelationMapper.updateById(relation);
} }
} else {
//存在教育局信息,但是没有匹配上
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生,信息不匹配,无法通过");
}
} else {
throw new ServiceException("身份证号为" + vo.getIdCard() + "的学生,无教育局信息,无法通过");
} }
}
/**
* 教务管理-考试管理-驳回 /**
*/ * 教务管理-考试管理-退回修改
@Override */
public String reject(Long examId, List<Long> studentIds) { @Override
// 准备记录日志数据 @Transactional(rollbackFor = Exception.class)
int successNum = 0; public String back(Long examId, List<Long> studentIds) {
int failureNum = 0; // 准备记录日志数据
StringBuilder successMsg = new StringBuilder(); int successNum = 0;
//查询出所有studentIds对应的学生信息 int failureNum = 0;
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>(); StringBuilder successMsg = new StringBuilder();
lqw.eq(SchoolRecruitRelation::getExamId, examId).in(SchoolRecruitRelation::getStudentId, studentIds); //查询出所有studentIds对应的学生信息
List<SchoolRecruitRelation> list = recruitRelationMapper.selectList(lqw); LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
//选中的有效学生信息总数 lqw.eq(SchoolRecruitRelation::getExamId, examId)
int allNum = list.size(); .in(SchoolRecruitRelation::getStudentId, studentIds);
for (SchoolRecruitRelation relation : list) { List<SchoolRecruitRelation> list = recruitRelationMapper.selectList(lqw);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) { //选中的有效学生信息总数
failureNum++; int allNum = list.size();
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法再次驳回;"); for (SchoolRecruitRelation relation : list) {
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) { if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
failureNum++; failureNum++;
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法驳回;"); successMsg.append(
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) { "<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法退回修改;");
failureNum++; } else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已退回修改,没有再次提交申请,无法驳回;"); failureNum++;
} else { successMsg.append(
relation.setAuditStatus(RecruitExamConstant.REJECT); "<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法退回修改;");
recruitRelationMapper.updateById(relation); } else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
successNum++; failureNum++;
} successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard()
} + "的学生信息已退回修改,没有再次提交申请,无法再次退回修改;");
if(allNum != successNum){ } else {
//存在无法通过的数据 relation.setAuditStatus(RecruitExamConstant.EDIT);
successMsg.insert(0, "选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + "</span> 条(排除所有未报名的数据),已将选中数据中所有待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"+ successNum +"</span> 条数据的状态改为驳回!有 <span style='color: red;font-size: 20px; font-weight:bold'>" + failureNum + "</span> 条不符合条件的数据,无法驳回的理由如下:"); recruitRelationMapper.updateById(relation);
return successMsg.toString(); successNum++;
}else { }
return "恭喜您,已将选中的所有有效数据的数据(排除所有未报名的数据)的状态改为驳回,共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum + "</span> 条!";
}
} }
if (allNum != successNum) {
@Override //存在无法退回修改的数据
public int rejectOne(Long examId, Long studentId) { successMsg.insert(0,
//查询出studentId对应的学生信息 "选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>(); + "</span> 条(排除所有未报名的数据),已将选中数据中所有匹配的、待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"
lqw.eq(SchoolRecruitRelation::getExamId, examId).eq(SchoolRecruitRelation::getStudentId, studentId); + successNum
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0); + "</span> 条数据的状态改为退回修改!有 <span style='color: red;font-size: 20px; font-weight:bold'>"
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) { + failureNum + "</span> 条不符合条件的数据,无法退回修改的理由如下:");
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法再次驳回"); return successMsg.toString();
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) { } else {
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法驳回"); return
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) { "恭喜您,已将选中的所有有效数据(排除所有未报名的数据)的状态改为退回修改,共 <span style='color: red;font-size: 20px; font-weight:bold'>"
throw new ServiceException("身份证号为" + relation.getInfoIdCard() + "的学生信息已退回修改,没有再次提交申请,无法驳回"); + allNum + "</span> 条!";
} else {
relation.setAuditStatus(RecruitExamConstant.REJECT);
return recruitRelationMapper.updateById(relation);
}
} }
}
/**
* 考务管理-考生账号管理-列表 @Override
*/ public int backOne(Long examId, Long studentId) {
@Override //查询出studentId对应的学生考试信息
public List<SchoolRecruitStudent> queryList(SchoolRecruitStudent student) { LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
LambdaQueryWrapper<SchoolRecruitStudent> lqw = new LambdaQueryWrapper<>(); lqw.eq(SchoolRecruitRelation::getExamId, examId)
lqw .eq(SchoolRecruitRelation::getStudentId, studentId);
.like(isNotNull(student.getStudentName()), SchoolRecruitStudent::getStudentName, student.getStudentName()) SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
.like(isNotNull(student.getPhoneNumber()), SchoolRecruitStudent::getPhoneNumber, student.getPhoneNumber())
.like(isNotNull(student.getIdCard()), SchoolRecruitStudent::getIdCard, student.getIdCard()) if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
.orderByDesc(SchoolRecruitStudent::getCreateTime) throw new ServiceException(
; "身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法退回修改");
return recruitStudentMapper.selectList(lqw); } else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
throw new ServiceException(
"身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法退回修改");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + relation.getInfoIdCard()
+ "的学生信息已退回修改,没有再次提交申请,无法再次退回修改");
} else {
relation.setAuditStatus(RecruitExamConstant.EDIT);
return recruitRelationMapper.updateById(relation);
} }
}
//设置匹配状态
public List<RecruitEduStudentVo> setState(List<RecruitEduStudentVo> list) { /**
for (RecruitEduStudentVo vo : list) { * 教务管理-考试管理-驳回
//匹配时所有信息都匹配才算匹配(身份证号,姓名,学籍号,初中学校,报考的测试项目,性别) */
@Override
//因为学生数据必填, public String reject(Long examId, List<Long> studentIds) {
// 所以只需判断身份证号不为空,则可证明学生的其他字段都不为空, // 准备记录日志数据
// 教育局信息也是如此 int successNum = 0;
if (StringUtils.isNotNull(vo.getIdCard())) { int failureNum = 0;
//学生数据存在 StringBuilder successMsg = new StringBuilder();
//教育局信息存在 //查询出所有studentIds对应的学生信息
if (StringUtils.isNotNull(vo.getEduIdCard())) { LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
//匹配学生和教育局信息 lqw.eq(SchoolRecruitRelation::getExamId, examId)
boolean flag = true; .in(SchoolRecruitRelation::getStudentId, studentIds);
if (!vo.getStudentName().equals(vo.getEduStudentName())) { List<SchoolRecruitRelation> list = recruitRelationMapper.selectList(lqw);
flag = false; //选中的有效学生信息总数
} int allNum = list.size();
for (SchoolRecruitRelation relation : list) {
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法再次驳回;");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append(
"<br/>" + "身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法驳回;");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
failureNum++;
successMsg.append("<br/>" + "身份证号为" + relation.getInfoIdCard()
+ "的学生信息已退回修改,没有再次提交申请,无法驳回;");
} else {
relation.setAuditStatus(RecruitExamConstant.REJECT);
recruitRelationMapper.updateById(relation);
successNum++;
}
}
if (allNum != successNum) {
//存在无法通过的数据
successMsg.insert(0,
"选中的有效数据共 <span style='color: red;font-size: 20px; font-weight:bold'>" + allNum
+ "</span> 条(排除所有未报名的数据),已将选中数据中所有待审核的 <span style='color: red;font-size: 20px; font-weight:bold'>"
+ successNum
+ "</span> 条数据的状态改为驳回!有 <span style='color: red;font-size: 20px; font-weight:bold'>"
+ failureNum + "</span> 条不符合条件的数据,无法驳回的理由如下:");
return successMsg.toString();
} else {
return
"恭喜您,已将选中的所有有效数据的数据(排除所有未报名的数据)的状态改为驳回,共 <span style='color: red;font-size: 20px; font-weight:bold'>"
+ allNum + "</span> 条!";
}
}
@Override
public int rejectOne(Long examId, Long studentId) {
//查询出studentId对应的学生信息
LambdaQueryWrapper<SchoolRecruitRelation> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolRecruitRelation::getExamId, examId)
.eq(SchoolRecruitRelation::getStudentId, studentId);
SchoolRecruitRelation relation = recruitRelationMapper.selectList(lqw).get(0);
if (RecruitExamConstant.REJECT.equals(relation.getAuditStatus())) {
throw new ServiceException(
"身份证号为" + relation.getInfoIdCard() + "的学生信息已驳回,无法再次驳回");
} else if (RecruitExamConstant.PASS.equals(relation.getAuditStatus())) {
throw new ServiceException(
"身份证号为" + relation.getInfoIdCard() + "的学生信息已通过,无法驳回");
} else if (RecruitExamConstant.EDIT.equals(relation.getAuditStatus())) {
throw new ServiceException("身份证号为" + relation.getInfoIdCard()
+ "的学生信息已退回修改,没有再次提交申请,无法驳回");
} else {
relation.setAuditStatus(RecruitExamConstant.REJECT);
return recruitRelationMapper.updateById(relation);
}
}
/**
* 考务管理-考生账号管理-列表
*/
@Override
public List<SchoolRecruitStudent> queryList(SchoolRecruitStudent student) {
LambdaQueryWrapper<SchoolRecruitStudent> lqw = new LambdaQueryWrapper<>();
lqw
.like(isNotNull(student.getStudentName()), SchoolRecruitStudent::getStudentName,
student.getStudentName())
.like(isNotNull(student.getPhoneNumber()), SchoolRecruitStudent::getPhoneNumber,
student.getPhoneNumber())
.like(isNotNull(student.getIdCard()), SchoolRecruitStudent::getIdCard, student.getIdCard())
.orderByDesc(SchoolRecruitStudent::getCreateTime)
;
return recruitStudentMapper.selectList(lqw);
}
//设置匹配状态
public List<RecruitEduStudentVo> setState(List<RecruitEduStudentVo> list) {
for (RecruitEduStudentVo vo : list) {
//匹配时所有信息都匹配才算匹配(身份证号,姓名,学籍号,初中学校,报考的测试项目,性别)
//因为学生数据必填,
// 所以只需判断身份证号不为空,则可证明学生的其他字段都不为空,
// 教育局信息也是如此
if (StringUtils.isNotNull(vo.getIdCard())) {
//学生数据存在
//教育局信息存在
if (StringUtils.isNotNull(vo.getEduIdCard())) {
//匹配学生和教育局信息
boolean flag = true;
if (!vo.getStudentName().equals(vo.getEduStudentName())) {
flag = false;
}
// if (!vo.getStudentNumber().equals(vo.getEduStudentNumber())) { // if (!vo.getStudentNumber().equals(vo.getEduStudentNumber())) {
// flag = false; // flag = false;
// } // }
// if (!vo.getSchoolName().equals(vo.getEduSchoolName())) { // if (!vo.getSchoolName().equals(vo.getEduSchoolName())) {
// flag = false; // flag = false;
// } // }
if (!vo.getProject().equals(vo.getEduProject())) { if (!vo.getProject().equals(vo.getEduProject())) {
flag = false; flag = false;
} }
// if (!vo.getSex().equals(vo.getEduSex())) { // if (!vo.getSex().equals(vo.getEduSex())) {
// flag = false; // flag = false;
// } // }
if (flag) { if (flag) {
//全部都匹配 //全部都匹配
vo.setMatchStatus(RecruitExamConstant.PASS); vo.setMatchStatus(RecruitExamConstant.PASS);
} else { } else {
//不匹配 //不匹配
vo.setMatchStatus(RecruitExamConstant.REJECT); vo.setMatchStatus(RecruitExamConstant.REJECT);
} }
} else { } else {
//不存在教育局信息 //不存在教育局信息
vo.setMatchStatus(RecruitExamConstant.EDIT); vo.setMatchStatus(RecruitExamConstant.EDIT);
}
} else {
//学生信息不存在,也就是未报名
vo.setMatchStatus(RecruitExamConstant.CHECK);
}
} }
return list; } else {
//学生信息不存在,也就是未报名
vo.setMatchStatus(RecruitExamConstant.CHECK);
}
} }
return list;
/** }
* 校验手机号是否唯一
*/ /**
public String checkPhoneUnique(SchoolRecruitStudent student) { * 校验手机号是否唯一
Long id = StringUtils.isNull(student.getId()) ? -1L : student.getId(); */
SchoolRecruitStudent info = recruitStudentMapper.checkPhoneUnique(student.getPhoneNumber()); public String checkPhoneUnique(SchoolRecruitStudent student) {
if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) { Long id = StringUtils.isNull(student.getId()) ? -1L : student.getId();
return UserConstants.NOT_UNIQUE; SchoolRecruitStudent info = recruitStudentMapper.checkPhoneUnique(student.getPhoneNumber());
} if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) {
return UserConstants.UNIQUE; return UserConstants.NOT_UNIQUE;
} }
return UserConstants.UNIQUE;
/** }
* 校验身份证号是否唯一
*/ /**
public String checkIdCardUnique(SchoolRecruitStudent student) { * 校验身份证号是否唯一
Long id = StringUtils.isNull(student.getId()) ? -1L : student.getId(); */
SchoolRecruitStudent info = recruitStudentMapper.checkIdCardUnique(student.getIdCard()); public String checkIdCardUnique(SchoolRecruitStudent student) {
if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) { Long id = StringUtils.isNull(student.getId()) ? -1L : student.getId();
return UserConstants.NOT_UNIQUE; SchoolRecruitStudent info = recruitStudentMapper.checkIdCardUnique(student.getIdCard());
} if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue()) {
return UserConstants.UNIQUE; return UserConstants.NOT_UNIQUE;
} }
return UserConstants.UNIQUE;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment