|
@@ -47,8 +47,8 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public List<Map> callStudentScoreApi(Long examId, String examCode, Map<String, String> secretMap) throws IOException {
|
|
|
- SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
+ public List<Map> callStudentScoreApi(Long examId, String examCode, Map<String, String> secretMap, Long schoolId) throws IOException {
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
Optional.ofNullable(sysConfig).orElseThrow(() -> new JkServerException("未配置云阅卷地址"));
|
|
|
String url = sysConfig.getConfigValue() + SystemConstant.CLOUD_MARK_STUDENT_SCORE_API;
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -90,7 +90,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public int callExamSaveApi(SaveExamParams saveExamParams, Map<String, String> secretMap) throws IOException, IllegalAccessException {
|
|
|
+ public int callExamSaveApi(SaveExamParams saveExamParams, Map<String, String> secretMap, Long schoolId) throws IOException, IllegalAccessException {
|
|
|
VerifyResultParams verifyResultParams = SystemConstant.verifyDBFields(saveExamParams, saveExamParams.getClass());
|
|
|
if (!verifyResultParams.getStatus()) {
|
|
|
throw new JkServerException(verifyResultParams.getMessage());
|
|
@@ -108,7 +108,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
paramMap.remove("id");
|
|
|
}
|
|
|
|
|
|
- SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
Optional.ofNullable(sysConfig).orElseThrow(() -> new JkServerException("未配置云阅卷地址"));
|
|
|
String url = sysConfig.getConfigValue() + SystemConstant.CLOUD_MARK_EXAM_SAVE_API;
|
|
|
|
|
@@ -127,7 +127,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String callSubjectSaveApi(SaveSubjectParams saveSubjectParams, Map<String, String> secretMap) throws IOException, IllegalAccessException {
|
|
|
+ public String callSubjectSaveApi(SaveSubjectParams saveSubjectParams, Map<String, String> secretMap, Long schoolId) throws IOException, IllegalAccessException {
|
|
|
VerifyResultParams verifyResultParams = SystemConstant.verifyDBFields(saveSubjectParams, saveSubjectParams.getClass());
|
|
|
if (!verifyResultParams.getStatus()) {
|
|
|
throw new JkServerException(verifyResultParams.getMessage());
|
|
@@ -141,7 +141,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
// 请求参数
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
- SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
Optional.ofNullable(sysConfig).orElseThrow(() -> new JkServerException("未配置云阅卷地址"));
|
|
|
String url = sysConfig.getConfigValue() + SystemConstant.CLOUD_MARK_SUBJECT_SAVE_API;
|
|
|
String accessToken = SignatureInfo.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.CLOUD_MARK_SUBJECT_SAVE_API, timestamp, secretMap.get(SystemConstant.ACCESS_KEY), secretMap.get(SystemConstant.ACCESS_SECRET));
|
|
@@ -156,7 +156,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String callStudentSaveApi(SaveStudentParams saveStudentParams, Map<String, String> secretMap) throws IOException, IllegalAccessException {
|
|
|
+ public String callStudentSaveApi(SaveStudentParams saveStudentParams, Map<String, String> secretMap, Long schoolId) throws IOException, IllegalAccessException {
|
|
|
VerifyResultParams verifyResultParams = SystemConstant.verifyDBFields(saveStudentParams, saveStudentParams.getClass());
|
|
|
if (!verifyResultParams.getStatus()) {
|
|
|
throw new JkServerException(verifyResultParams.getMessage());
|
|
@@ -169,7 +169,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
// 请求参数
|
|
|
long timestamp = System.currentTimeMillis();
|
|
|
- SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
Optional.ofNullable(sysConfig).orElseThrow(() -> new JkServerException("未配置云阅卷地址"));
|
|
|
String url = sysConfig.getConfigValue() + SystemConstant.CLOUD_MARK_STUDENT_SAVE_API;
|
|
|
String accessToken = SignatureInfo.build(SignatureType.SECRET, SystemConstant.METHOD, SystemConstant.CLOUD_MARK_STUDENT_SAVE_API, timestamp, secretMap.get(SystemConstant.ACCESS_KEY), secretMap.get(SystemConstant.ACCESS_SECRET));
|
|
@@ -184,7 +184,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public boolean callFileUploadApi(Object obj, Map<String, String> secretMap) throws IllegalAccessException, IOException {
|
|
|
+ public boolean callFileUploadApi(Object obj, Map<String, String> secretMap, Long schoolId) throws IllegalAccessException, IOException {
|
|
|
// 参数
|
|
|
Map<String, Object> paramMap = JSON.parseObject(JSON.toJSONString(obj), Map.class);
|
|
|
File file = new File(String.valueOf(paramMap.get("file")));
|
|
@@ -195,7 +195,7 @@ public class CallYunMarkApiServiceImpl implements CallYunMarkApiService {
|
|
|
String type = this.verifyAndGetParamType(obj);
|
|
|
|
|
|
// api
|
|
|
- SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
+ SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.CLOUDMARK_HOST_URL);
|
|
|
Optional.ofNullable(sysConfig).orElseThrow(() -> new JkServerException("未配置云阅卷地址"));
|
|
|
String host = sysConfig.getConfigValue();
|
|
|
String api = SystemConstant.CLOUD_MARK_FILE_UPLOAD_API;
|