| | |
| | | import com.dsh.competition.util.JuHeUtil; |
| | | import com.dsh.competition.util.ResultUtil; |
| | | import com.dsh.competition.util.ToolUtil; |
| | | import io.undertow.util.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | participant.setState(1); |
| | | participant.setInsertTime(new Date()); |
| | | this.save(participant); |
| | | TStudent tStudent = new TStudent(); |
| | | tStudent.setAppUserId(uid); |
| | | tStudent.setName(addParticipant.getName()); |
| | | tStudent.setPhone(addParticipant.getPhone()); |
| | | if (ToolUtil.isNotEmpty(addParticipant.getBirthday())){ |
| | | Date date = DateUtils.parseDate(addParticipant.getBirthday()); |
| | | tStudent.setBirthday(date); |
| | | }else{ |
| | | String birthDateStr = addParticipant.getIdcard().substring(6, 14); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | | Date parse = dateFormat.parse(birthDateStr); |
| | | tStudent.setBirthday(parse); |
| | | } |
| | | tStudent.setSex(addParticipant.getGender()); |
| | | tStudent.setIdCard(addParticipant.getIdcard()); |
| | | tStudent.setState(1); |
| | | tStudent.setInsertTime(new Date()); |
| | | tStudent.setHeadImg(addParticipant.getHeadImg()); |
| | | tStudent.setIsDefault(2); |
| | | studentClient.addStudent(tStudent); |
| | | return ResultUtil.success(); |
| | | } |
| | | |