Selaa lähdekoodia

student import bug solve

haogh 1 vuosi sitten
vanhempi
commit
6f60071ecb

+ 4 - 2
src/main/java/com/qmth/exam/reserve/service/impl/StudentImportAsyncServiceImpl.java

@@ -11,7 +11,6 @@ import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -167,7 +166,10 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
                 .eq(StudentEntity::getStudentCode, studentEntity.getStudentCode());
                 .eq(StudentEntity::getStudentCode, studentEntity.getStudentCode());
         StudentEntity existStudent = studentService.getOne(wrapper);
         StudentEntity existStudent = studentService.getOne(wrapper);
         if (existStudent != null) {
         if (existStudent != null) {
-            BeanUtils.copyProperties(studentEntity, existStudent);
+            existStudent.setName(studentEntity.getName());
+            existStudent.setIdentityNumber(studentEntity.getIdentityNumber());
+            existStudent.setCategoryId(studentEntity.getCategoryId());
+            existStudent.setApplyNumber(studentEntity.getApplyNumber());
             studentService.updateById(existStudent);
             studentService.updateById(existStudent);
             // 清空缓存
             // 清空缓存
             cacheService.clearStudentApplyNumberCache(existStudent.getId());
             cacheService.clearStudentApplyNumberCache(existStudent.getId());