|
|
@@ -178,12 +178,21 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean add(AddXjrUserDto dto) {
|
|
|
-
|
|
|
XjrUser xjrUser = BeanUtil.toBean(dto, XjrUser.class);
|
|
|
xjrUser.setCode(dto.getUserName());
|
|
|
|
|
|
+ if (StringUtils.isEmpty(xjrUser.getCredentialNumber())) {
|
|
|
+ throw new MyException(xjrUser.getName() + "证件号为空,请填写后提交");
|
|
|
+ }
|
|
|
+
|
|
|
// 使用系统配置的默认密码
|
|
|
- xjrUser.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
+// xjrUser.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
+ String credentialNumber = xjrUser.getCredentialNumber();
|
|
|
+ String lastSixDigits = credentialNumber.length() <= 6
|
|
|
+ ? credentialNumber
|
|
|
+ : credentialNumber.substring(credentialNumber.length() - 6);
|
|
|
+ xjrUser.setPassword(BCrypt.hashpw(lastSixDigits, BCrypt.gensalt()));
|
|
|
+
|
|
|
teacherbaseManagerXjrUserMapper.insert(xjrUser);
|
|
|
for (BaseTeacher baseTeacher : xjrUser.getBaseTeacherList()) {
|
|
|
|
|
|
@@ -726,12 +735,12 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
for (Map<Integer, Object> rowData : excelDataList) {
|
|
|
boolean isEmpty = false;
|
|
|
for (Integer i : rowData.keySet()) {
|
|
|
- if(rowData.get(i) == null){
|
|
|
+ if (rowData.get(i) == null) {
|
|
|
errorList.add(rowData);
|
|
|
isEmpty = true;
|
|
|
}
|
|
|
}
|
|
|
- if(isEmpty){
|
|
|
+ if (isEmpty) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
@@ -748,16 +757,16 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
|
|
|
BaseTeacher teacher = teacherMap.get(user.getId());
|
|
|
teacher.setEmployType(dictionaryMap.get(2023000000000000016L).get(rowData.get(6).toString()));
|
|
|
- if(rowData.get(9) != null && StrUtil.isNotEmpty(rowData.get(9).toString())){
|
|
|
+ if (rowData.get(9) != null && StrUtil.isNotEmpty(rowData.get(9).toString())) {
|
|
|
teacher.setJobState(dictionaryMap.get(2023000000000000005L).get(rowData.get(9).toString()));
|
|
|
}
|
|
|
- if(rowData.get(10) != null && StrUtil.isNotEmpty(rowData.get(10).toString())){
|
|
|
+ if (rowData.get(10) != null && StrUtil.isNotEmpty(rowData.get(10).toString())) {
|
|
|
teacher.setJoinTime(sdf.parse(rowData.get(10).toString()));
|
|
|
}
|
|
|
|
|
|
updateTeacherList.add(teacher);
|
|
|
|
|
|
- if(rowData.get(11) != null && StrUtil.isNotEmpty(rowData.get(11).toString())){
|
|
|
+ if (rowData.get(11) != null && StrUtil.isNotEmpty(rowData.get(11).toString())) {
|
|
|
BaseTeacherRegular teacherRegular = regularMap.get(user.getId());
|
|
|
JSONArray teachingStatus = teacherRegular.getTeachingStatus();
|
|
|
teachingStatus.add(dictionaryMap.get(2023000000000000020L).get(rowData.get(11).toString()));
|
|
|
@@ -786,7 +795,12 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
}
|
|
|
User user = new User();
|
|
|
user.setUserName(rowData.get(0).toString());
|
|
|
- user.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
+// user.setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
|
|
|
+ String lastSixDigits = credentialNumber.length() <= 6
|
|
|
+ ? credentialNumber
|
|
|
+ : credentialNumber.substring(credentialNumber.length() - 6);
|
|
|
+ user.setPassword(BCrypt.hashpw(lastSixDigits, BCrypt.gensalt()));
|
|
|
+
|
|
|
user.setIsChangePassword(1);
|
|
|
user.setName(rowData.get(1).toString());
|
|
|
user.setGender(GenderDictionaryEnum.getCode(rowData.get(2).toString()));
|
|
|
@@ -800,17 +814,17 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
teacher.setEmployType(dictionaryMap.get(2023000000000000016L).get(rowData.get(6).toString()));
|
|
|
teacher.setUserId(user.getId());
|
|
|
teacher.setCreateDate(LocalDateTime.now());
|
|
|
- if(rowData.get(9) != null && StrUtil.isNotEmpty(rowData.get(9).toString())){
|
|
|
+ if (rowData.get(9) != null && StrUtil.isNotEmpty(rowData.get(9).toString())) {
|
|
|
teacher.setJobState(dictionaryMap.get(2023000000000000005L).get(rowData.get(9).toString()));
|
|
|
}
|
|
|
|
|
|
- if(rowData.get(10) != null && StrUtil.isNotEmpty(rowData.get(10).toString())){
|
|
|
+ if (rowData.get(10) != null && StrUtil.isNotEmpty(rowData.get(10).toString())) {
|
|
|
teacher.setJoinTime(sdf.parse(rowData.get(10).toString()));
|
|
|
}
|
|
|
|
|
|
teacherMapper.insert(teacher);
|
|
|
|
|
|
- if(rowData.get(11) != null && StrUtil.isNotEmpty(rowData.get(11).toString())){
|
|
|
+ if (rowData.get(11) != null && StrUtil.isNotEmpty(rowData.get(11).toString())) {
|
|
|
BaseTeacherRegular teacherRegular = new BaseTeacherRegular();
|
|
|
JSONArray teachingStatus = new JSONArray();
|
|
|
teachingStatus.add(dictionaryMap.get(2023000000000000020L).get(rowData.get(11).toString()));
|
|
|
@@ -1066,37 +1080,37 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
ProfessionalTitle insertOrUpdate = new ProfessionalTitle();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getGetDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getGetDate())) {
|
|
|
Instant instant = vo.getGetDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setGetDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getBeHonoredDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getBeHonoredDate())) {
|
|
|
Instant instant = vo.getBeHonoredDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setBeHonoredDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setIssuanceDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getQualificationStartDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getQualificationStartDate())) {
|
|
|
Instant instant = vo.getQualificationStartDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setQualificationStartDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getQualificationEndDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getQualificationEndDate())) {
|
|
|
Instant instant = vo.getQualificationEndDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setQualificationEndDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getNoticeDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getNoticeDate())) {
|
|
|
Instant instant = vo.getNoticeDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1188,7 +1202,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
TeacherCertification insertOrUpdate = new TeacherCertification();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1278,14 +1292,14 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
EvaluatorInformation insertOrUpdate = new EvaluatorInformation();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setIssuanceDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getValidity())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getValidity())) {
|
|
|
Instant instant = vo.getValidity().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1375,7 +1389,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
LanguageCompetence insertOrUpdate = new LanguageCompetence();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1472,7 +1486,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
insertOrUpdate.setStartDate(startDate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getEndDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getEndDate())) {
|
|
|
Instant endDateInstant = vo.getEndDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1562,14 +1576,14 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
OutsideAssociations insertOrUpdate = new OutsideAssociations();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getJoinDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getJoinDate())) {
|
|
|
Instant instant = vo.getJoinDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
insertOrUpdate.setJoinDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getExitDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getExitDate())) {
|
|
|
Instant instant = vo.getExitDate().toInstant();
|
|
|
insertOrUpdate.setExitDate(instant.atZone(ZoneId.systemDefault()).toLocalDate());
|
|
|
}
|
|
|
@@ -1657,7 +1671,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
CoreTeacher insertOrUpdate = new CoreTeacher();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1746,7 +1760,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
ScientificResearch insertOrUpdate = new ScientificResearch();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getIssuanceDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getIssuanceDate())) {
|
|
|
Instant instant = vo.getIssuanceDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|
|
|
@@ -1837,7 +1851,7 @@ public class TeacherbaseManagerServiceImpl extends MPJBaseServiceImpl<XjrUserMap
|
|
|
JobInformation insertOrUpdate = new JobInformation();
|
|
|
BeanUtils.copyProperties(vo, insertOrUpdate);
|
|
|
// 处理时间字符串
|
|
|
- if(ObjectUtils.isNotEmpty(vo.getEmployDate())){
|
|
|
+ if (ObjectUtils.isNotEmpty(vo.getEmployDate())) {
|
|
|
Instant instant = vo.getEmployDate().toInstant();
|
|
|
|
|
|
// 使用系统默认时区将 Instant 转换为 LocalDate
|