瀏覽代碼

student import bug solve

haogh 1 年之前
父節點
當前提交
6f60071ecb
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/main/java/com/qmth/exam/reserve/service/impl/StudentImportAsyncServiceImpl.java

+ 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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -167,7 +166,10 @@ public class StudentImportAsyncServiceImpl implements StudentImportAsyncService
                 .eq(StudentEntity::getStudentCode, studentEntity.getStudentCode());
         StudentEntity existStudent = studentService.getOne(wrapper);
         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);
             // 清空缓存
             cacheService.clearStudentApplyNumberCache(existStudent.getId());