|
@@ -20,7 +20,6 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -48,6 +47,7 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.StudentCodeEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.StudentService;
|
|
|
import cn.com.qmth.examcloud.core.basic.service.bean.StudentInfo;
|
|
|
+import cn.com.qmth.examcloud.core.basic.service.cache.StudentCache;
|
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
|
|
|
import cn.com.qmth.examcloud.web.config.SystemConfig;
|
|
@@ -84,6 +84,9 @@ public class StudentController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
DataSyncCloudService dataSyncCloudService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ StudentCache studentCache;
|
|
|
+
|
|
|
private static final String[] EXCEL_HEADER = new String[]{"ID", "姓名", "学号", "身份证", "学习中心代码",
|
|
|
"学习中心名称"};
|
|
|
|
|
@@ -305,24 +308,6 @@ public class StudentController extends ControllerSupport {
|
|
|
FileUtils.deleteQuietly(file);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 方法注释
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "按ID删除学生", notes = "删除")
|
|
|
- @DeleteMapping("{id}")
|
|
|
- public Long deleteStudent(@PathVariable Long id) {
|
|
|
- StudentEntity s = GlobalHelper.getEntity(studentRepo, id, StudentEntity.class);
|
|
|
- if (null != s) {
|
|
|
- validateRootOrgIsolation(s.getRootOrgId());
|
|
|
- }
|
|
|
- studentRepo.deleteById(id);
|
|
|
- return id;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -342,6 +327,9 @@ public class StudentController extends ControllerSupport {
|
|
|
studentRepo.save(s);
|
|
|
ret.add(s.getId() + ":" + s.getName());
|
|
|
}
|
|
|
+ for (Long cur : studentIds) {
|
|
|
+ studentCache.remove(cur);
|
|
|
+ }
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -364,6 +352,9 @@ public class StudentController extends ControllerSupport {
|
|
|
studentRepo.save(s);
|
|
|
ret.add(s.getId() + ":" + s.getName());
|
|
|
}
|
|
|
+ for (Long cur : studentIds) {
|
|
|
+ studentCache.remove(cur);
|
|
|
+ }
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -507,6 +498,10 @@ public class StudentController extends ControllerSupport {
|
|
|
List<Long> studentIdList = studentService.unbindStudentCode(rootOrgId, studentCode,
|
|
|
identityNumber);
|
|
|
|
|
|
+ for (Long cur : studentIdList) {
|
|
|
+ studentCache.remove(cur);
|
|
|
+ }
|
|
|
+
|
|
|
return studentIdList;
|
|
|
}
|
|
|
|
|
@@ -527,6 +522,10 @@ public class StudentController extends ControllerSupport {
|
|
|
studentService.unbindSecurityPhone(cur);
|
|
|
}
|
|
|
|
|
|
+ for (Long cur : studentIds) {
|
|
|
+ studentCache.remove(cur);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|