|
@@ -1,12 +1,8 @@
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.base.Constants;
|
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.service.GainBaseDataService;
|
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.LocalCacheService;
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.LocalCacheService;
|
|
-import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
|
|
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
import cn.com.qmth.examcloud.support.cache.CacheHelper;
|
|
import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -18,17 +14,13 @@ import java.util.Map;
|
|
* @author chenken
|
|
* @author chenken
|
|
* @date 2018年11月15日 下午4:58:44
|
|
* @date 2018年11月15日 下午4:58:44
|
|
* @company QMTH
|
|
* @company QMTH
|
|
- * @description LocalCacheServiceImpl.java
|
|
|
|
*/
|
|
*/
|
|
@Service("localCacheService")
|
|
@Service("localCacheService")
|
|
public class LocalCacheServiceImpl implements LocalCacheService {
|
|
public class LocalCacheServiceImpl implements LocalCacheService {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private GainBaseDataService gainBaseDataService;
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public String getStudentPhotoNumber(Map<String, Object> cahcheMap, Long studentId) {
|
|
public String getStudentPhotoNumber(Map<String, Object> cahcheMap, Long studentId) {
|
|
- String key = Constants.CACHE_PHONE_PREFIX + studentId;
|
|
|
|
|
|
+ String key = "cache_phone_" + studentId;
|
|
String photoNumber = "";
|
|
String photoNumber = "";
|
|
if (cahcheMap.containsKey(key)) {
|
|
if (cahcheMap.containsKey(key)) {
|
|
photoNumber = (String) cahcheMap.get(key);
|
|
photoNumber = (String) cahcheMap.get(key);
|
|
@@ -40,15 +32,4 @@ public class LocalCacheServiceImpl implements LocalCacheService {
|
|
return photoNumber;
|
|
return photoNumber;
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public ExamStudentBean getExamStudentBean(Map<String, Object> cahcheMap, Long examStudentId) {
|
|
|
|
- String key = Constants.CACHE_EXAM_STUDENT_PREFIX + examStudentId;
|
|
|
|
- ExamStudentBean examStudent = (ExamStudentBean) cahcheMap.get(key);
|
|
|
|
- if (examStudent == null) {
|
|
|
|
- examStudent = gainBaseDataService.getExamStudentBean(examStudentId);
|
|
|
|
- cahcheMap.put(key, examStudent);
|
|
|
|
- }
|
|
|
|
- return examStudent;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|