|
@@ -41,6 +41,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
@@ -160,7 +161,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
setClassroomId(taskClass.getClassroomId());
|
|
|
setTeacherId(taskClass.getTeacherId());
|
|
|
setIsGraduate(1);
|
|
|
- setIsOrderClass(taskClass.getIsOrderClass().intValue());
|
|
|
+ setIsOrderClass(taskClass.getIsOrderClass()==null?0:taskClass.getIsOrderClass().intValue());
|
|
|
setGradeId(bandingTask.getGradeId());
|
|
|
setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
setEnrollType(bandingTask.getEnrollType());
|
|
@@ -194,7 +195,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
Map<Long, Long> studentClassRelation = classStudents.stream().collect(Collectors.toMap(BandingTaskClassStudent::getNewStudentId, BandingTaskClassStudent::getBandingTaskClassId));
|
|
|
for (BaseNewStudent student : updateList) {
|
|
|
- LocalDateTime birthDate = getBirthDate(student.getCredentialNumber());
|
|
|
+ LocalDate birthDate = getBirthDate(student.getCredentialNumber());
|
|
|
User xjrUser = new User() {{
|
|
|
setCreateDate(now);
|
|
|
setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
@@ -206,7 +207,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
setEnabledMark(EnabledMark.DISABLED.getCode());
|
|
|
setGender(student.getGender());
|
|
|
setIsChangePassword(1);
|
|
|
- setBirthDate(birthDate);
|
|
|
+ setBirthDate(birthDate.atStartOfDay());
|
|
|
}};
|
|
|
userService.save(xjrUser);
|
|
|
|
|
@@ -250,13 +251,13 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- LocalDateTime getBirthDate(String idCardNumber){
|
|
|
+ LocalDate getBirthDate(String idCardNumber){
|
|
|
// 获取出生日期前6位,即yyyyMM
|
|
|
String birthdayString = idCardNumber.substring(6, 14);
|
|
|
|
|
|
// 将字符串解析为LocalDate对象
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
- return LocalDateTime.parse(birthdayString, formatter);
|
|
|
+ return LocalDate.parse(birthdayString, formatter);
|
|
|
}
|
|
|
|
|
|
@Override
|