diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java index 78c8561..32b3251 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/domain/HitCompetitionStudentInfo.java @@ -104,6 +104,7 @@ public class HitCompetitionStudentInfo implements Serializable { @ApiModelProperty(value = "逻辑删除 0未删除 1真删除") private Boolean delFlag; + @Excel(name = "报名时间", dateFormat = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间(默认时间当前)") @TableField(fill = FieldFill.INSERT) private Date createTime; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java index 30cbdbc..c7d5b5c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitCompetitionStudentInfoServiceImpl.java @@ -130,6 +130,16 @@ public class HitCompetitionStudentInfoServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(HitCompetitionStudentInfo::getStudentId, hitCompetitionStudentInfo.getStudentId()); + DateTime now = DateUtil.date(); + queryWrapper.between(HitCompetitionStudentInfo::getCreateTime, DateUtil.beginOfYear(now), DateUtil.endOfYear(now)); + queryWrapper.eq(HitCompetitionStudentInfo::getDelFlag, false); + List hitCompetitionStudentInfos = hitCompetitionStudentInfoMapper.selectList(queryWrapper); + if (CollectionUtil.isNotEmpty(hitCompetitionStudentInfos)) { + throw new RuntimeException("请勿重复报名!"); + } hitCompetitionStudentInfo.setCreateTime(DateUtils.getNowDate()); SysUser user = SecurityUtils.getLoginUser().getUser(); hitCompetitionStudentInfo.setUserId(user.getUserId()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java index 29b3094..32577d7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/cms/service/impl/HitRegistrationTeachInfoServiceImpl.java @@ -169,6 +169,8 @@ public class HitRegistrationTeachInfoServiceImpl implements IHitRegistrationTeac @Override @Transactional(rollbackFor = Exception.class) public void register(RegisterBody user) throws Exception { + //删除学校名称的空格 + user.getHitRegistrationTeachInfo().setSchoolName(user.getHitRegistrationTeachInfo().getSchoolName().trim()); String msg = "", username = user.getUsername(), password = user.getPassword(); SysUser sysUser = new SysUser(); sysUser.setUserName(username);