| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.common.constant.AgeConstant; |
| | | import org.springblade.common.constant.AgeUtil; |
| | | import org.springblade.common.utils.FtpSyncUtil; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | |
| | | User user = userService.getUserById(userId); |
| | | UserVO userVO = userService.getUserAgeById(Long.parseLong(userId)); |
| | | //判断年龄 |
| | | if (userVO.getAge()>=18 && userVO.getAge()<=60) { |
| | | if (userVO.getAge()>= AgeConstant.APPLY_MIN_AGE && userVO.getAge() <= AgeConstant.APPLY_MAX_AGE) { |
| | | //未报名的新增,已报名的不做处理 |
| | | if (null == user.getIsTrain()) { |
| | | TrainingRegistration trainingRegistration1 = new TrainingRegistration(); |
| | |
| | | //如果存在年龄不符的,则抛出异常 |
| | | if (count.get()>0){ |
| | | String errorAccount = StringUtils.join(errorList, "\\\n"); |
| | | throw new ServiceException("保安员:[" + errorAccount + "]报名失败!年龄不符,报名年龄为[18-60]周岁!"); |
| | | throw new ServiceException("保安员:[" + errorAccount + "]报名失败!年龄不符,报名年龄为[" + AgeConstant.APPLY_MIN_AGE + "-"+ AgeConstant.APPLY_MAX_AGE + "]周岁!"); |
| | | } |
| | | return R.data(200,"报名成功"); |
| | | } |
| | |
| | | int year = instance.get(Calendar.YEAR); |
| | | int month = instance.get(Calendar.MONTH)+1; |
| | | int day = instance.get(Calendar.DAY_OF_MONTH); |
| | | String examName = year + "年" + month+ "月"+ day +"日" +"保安员证培训考试"; |
| | | String examName = year + "年" + month+ "月"+ day +"日" +"保安员证考试"; |
| | | //考试名称 |
| | | examPaper.setExamName(examName); |
| | | //考试申请人 |