فهرست منبع

推送云阅卷数据修改

wangliang 2 سال پیش
والد
کامیت
07443be7e3

+ 13 - 13
themis-admin/src/main/resources/application-dev.properties

@@ -21,7 +21,7 @@ spring.application.name=themis-admin
 #\u6570\u636E\u6E90\u914D\u7F6E
 #\u6570\u636E\u6E90\u914D\u7F6E
 db.host=localhost
 db.host=localhost
 db.port=3306
 db.port=3306
-db.name=themis_release
+db.name=themis_v1.1
 db.username=root
 db.username=root
 db.password=123456789
 db.password=123456789
 #redis\u6570\u636E\u6E90\u914D\u7F6E
 #redis\u6570\u636E\u6E90\u914D\u7F6E
@@ -157,18 +157,18 @@ sys.config.adminLogoUrl=http://qmth-test.oss-cn-shenzhen.aliyuncs.com/frontend/w
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 
 
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
-#cloud.mark.url=http://192.168.10.224:80
-#cloud.mark.studentScoreApi=/api/exam/student/score
-#cloud.mark.examSaveApi=/api/exam/save
-#cloud.mark.subjectSaveApi=/api/exam/subject/save
-#cloud.mark.studentSaveApi=/api/exam/student/save
-#cloud.mark.fileUploadApi=/api/file/{type}/upload
-cloud.mark.url=http://127.0.0.1:6001
-cloud.mark.studentScoreApi=/api/admin/exam/http/test/student/score
-cloud.mark.examSaveApi=/api/admin/exam/http/test/save
-cloud.mark.subjectSaveApi=/api/admin/exam/http/test/subject/save
-cloud.mark.studentSaveApi=/api/admin/exam/http/test/student/save
-cloud.mark.fileUploadApi=/api/admin/exam/http/test/file/{type}/upload
+cloud.mark.url=https://192.168.10.224:80
+cloud.mark.studentScoreApi=/api/exam/student/score
+cloud.mark.examSaveApi=/api/exam/save
+cloud.mark.subjectSaveApi=/api/exam/subject/save
+cloud.mark.studentSaveApi=/api/exam/student/save
+cloud.mark.fileUploadApi=/api/file/{type}/upload
+#cloud.mark.url=http://127.0.0.1:6001
+#cloud.mark.studentScoreApi=/api/admin/exam/http/test/student/score
+#cloud.mark.examSaveApi=/api/admin/exam/http/test/save
+#cloud.mark.subjectSaveApi=/api/admin/exam/http/test/subject/save
+#cloud.mark.studentSaveApi=/api/admin/exam/http/test/student/save
+#cloud.mark.fileUploadApi=/api/admin/exam/http/test/file/{type}/upload
 
 
 #============================================================================
 #============================================================================
 # \u914D\u7F6Erocketmq
 # \u914D\u7F6Erocketmq

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/AuthInfoServiceImpl.java

@@ -121,7 +121,7 @@ public class AuthInfoServiceImpl implements AuthInfoService {
         if (Objects.nonNull(code)) {
         if (Objects.nonNull(code)) {
             AuthOrgInfoDto authOrgInfoDto = cacheService.authInfoCache(code);
             AuthOrgInfoDto authOrgInfoDto = cacheService.authInfoCache(code);
             if (Objects.isNull(authOrgInfoDto) || (Objects.nonNull(authOrgInfoDto) && authOrgInfoDto.getControl().hasExpired())) {
             if (Objects.isNull(authOrgInfoDto) || (Objects.nonNull(authOrgInfoDto) && authOrgInfoDto.getControl().hasExpired())) {
-//                throw new BusinessException(ExceptionResultEnum.AUTH_INFO_ERROR);
+                throw new BusinessException(ExceptionResultEnum.AUTH_INFO_ERROR);
             }
             }
         }
         }
     }
     }

+ 17 - 24
themis-business/src/main/java/com/qmth/themis/business/templete/service/impl/TempleteLogicServiceImpl.java

@@ -11,6 +11,9 @@ import com.qmth.themis.business.bean.admin.OpenRecordAnswerStructBean;
 import com.qmth.themis.business.bean.admin.OpenRecordAnswerTempBean;
 import com.qmth.themis.business.bean.admin.OpenRecordAnswerTempBean;
 import com.qmth.themis.business.bean.admin.OpenRecordNeedMarkBean;
 import com.qmth.themis.business.bean.admin.OpenRecordNeedMarkBean;
 import com.qmth.themis.business.bean.cloudmark.FileUploadParams;
 import com.qmth.themis.business.bean.cloudmark.FileUploadParams;
+import com.qmth.themis.business.bean.cloudmark.SaveExamParams;
+import com.qmth.themis.business.bean.cloudmark.SaveStudentParams;
+import com.qmth.themis.business.bean.cloudmark.SaveSubjectParams;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.RedisKeyHelper;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
 import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
@@ -409,8 +412,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
     public Map<String, Object> execPushCloudMarkDataLogic(Map<String, Object> map) throws IOException {
     public Map<String, Object> execPushCloudMarkDataLogic(Map<String, Object> map) throws IOException {
         checkData(map);
         checkData(map);
         Long examId = (Long) map.get(SystemConstant.EXAM_ID);
         Long examId = (Long) map.get(SystemConstant.EXAM_ID);
-//        Long orgId = (Long) map.get(SystemConstant.ORG_ID);
-//        String examCode = (String) map.get(SystemConstant.EXAM_CODE);
+        Long orgId = (Long) map.get(SystemConstant.ORG_ID);
+        String examCode = (String) map.get(SystemConstant.EXAM_CODE);
 
 
         //先推送考试
         //先推送考试
         ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
         ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
@@ -421,8 +424,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
 
 
         TEExam teExam = teExamService.cacheConvert(examCacheBean);
         TEExam teExam = teExamService.cacheConvert(examCacheBean);
         if (Objects.isNull(tbTaskHistory.getEntityId())) {
         if (Objects.isNull(tbTaskHistory.getEntityId())) {
-//          cloudMarkExamId = cloudMarkUtil.callExamSaveApi(new SaveExamParams(orgId, examId, examCode, examCacheBean.getName(), DateUtil.format(new Date(examCacheBean.getStartTime()), Constants.DEFAULT_DATE_PATTERN)));
-            cloudMarkExamId = Long.parseLong((int) (Math.random() * 1000) + "");
+            cloudMarkExamId = cloudMarkUtil.callExamSaveApi(new SaveExamParams(orgId, examId, examCode, examCacheBean.getName(), DateUtil.format(new Date(examCacheBean.getStartTime()), Constants.DEFAULT_DATE_PATTERN)));
+//            cloudMarkExamId = Long.parseLong((int) (Math.random() * 1000) + "");
             teExam.setUpdateTime(System.currentTimeMillis());
             teExam.setUpdateTime(System.currentTimeMillis());
             teExam.setThirdExamId(String.valueOf(cloudMarkExamId));
             teExam.setThirdExamId(String.valueOf(cloudMarkExamId));
             teExamService.updateById(teExam);
             teExamService.updateById(teExam);
@@ -620,9 +623,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
         while (max <= size) {
         while (max <= size) {
             List<TEExamStudent> subList = teExamStudentList.subList(min, max);
             List<TEExamStudent> subList = teExamStudentList.subList(min, max);
             for (int y = 0; y < subList.size(); y++) {
             for (int y = 0; y < subList.size(); y++) {
-//                if (y == 300) {
-//                    int k = 1 / 0;
-//                }
                 TEExamStudent t = subList.get(y);
                 TEExamStudent t = subList.get(y);
                 if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
                 if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
                     jsonObject.put("currentTaskSize", currentTaskSize);
                     jsonObject.put("currentTaskSize", currentTaskSize);
@@ -630,17 +630,14 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                     tbTaskHistory.setRemark(jsonObject.toJSONString());
                     tbTaskHistory.setRemark(jsonObject.toJSONString());
                     continue;
                     continue;
                 } else {
                 } else {
-//                    cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
-//                            t.getIdentity(),
-//                            t.getName(),
-//                            tbOrg.getName(),
-//                            t.getClassNo(), SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
-//                            t.getCourseCode(),
-//                            t.getCourseName()));
+                    cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
+                            t.getIdentity(),
+                            t.getName(),
+                            tbOrg.getName(),
+                            t.getClassNo(), SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
+                            t.getCourseCode(),
+                            t.getCourseName()));
                     TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
                     TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
-//                    if (Objects.isNull(tOeExamRecord)) {
-//                        continue;
-//                    }
                     Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
                     Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
 
 
                     Gson gson = new Gson();
                     Gson gson = new Gson();
@@ -683,8 +680,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                     }
                     }
                     IOUtils.write(JacksonUtil.parseJson(openRecordNeedMarkBean).getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(fileAnswerJson));
                     IOUtils.write(JacksonUtil.parseJson(openRecordNeedMarkBean).getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(fileAnswerJson));
                     recordJsonList.add(fileAnswerJson);
                     recordJsonList.add(fileAnswerJson);
-                    FileUploadParams fileUploadParamsAnswerJson = new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson);
-//                    cloudMarkUtil.callFileUploadApi(fileUploadParamsAnswerJson);
+                    cloudMarkUtil.callFileUploadApi(new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson));
 
 
                     jsonObject.put("currentTaskSize", currentTaskSize);
                     jsonObject.put("currentTaskSize", currentTaskSize);
                     currentTaskSize++;
                     currentTaskSize++;
@@ -816,9 +812,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
             paperJsonList = new ArrayList<>(teExamPaperList.size());
             paperJsonList = new ArrayList<>(teExamPaperList.size());
             map.put("paperJsonList", paperJsonList);
             map.put("paperJsonList", paperJsonList);
             for (int i = 0; i < teExamPaperList.size(); i++) {
             for (int i = 0; i < teExamPaperList.size(); i++) {
-//                if (i == 10) {
-//                    int y = 1 / 0;
-//                }
                 TEExamPaper t = teExamPaperList.get(i);
                 TEExamPaper t = teExamPaperList.get(i);
                 examPaperIdSet.add(t.getId());
                 examPaperIdSet.add(t.getId());
                 if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
                 if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
@@ -828,7 +821,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                     continue;
                     continue;
                 } else {
                 } else {
                     String courseCode = t.getCourseCode() + SystemConstant.JOINT_MARK + t.getId();
                     String courseCode = t.getCourseCode() + SystemConstant.JOINT_MARK + t.getId();
-//                    cloudMarkUtil.callSubjectSaveApi(new SaveSubjectParams(orgId, cloudMarkExamId, courseCode, t.getName()));
+                    cloudMarkUtil.callSubjectSaveApi(new SaveSubjectParams(orgId, cloudMarkExamId, courseCode, t.getName()));
                     //解析试卷JSON文件
                     //解析试卷JSON文件
                     JSONObject paperResult = JSONObject.parseObject(new String(ossUtil.download(false, t.getPaperViewPath()), StandardCharsets.UTF_8));
                     JSONObject paperResult = JSONObject.parseObject(new String(ossUtil.download(false, t.getPaperViewPath()), StandardCharsets.UTF_8));
                     paperResult.put(SystemConstant.ID, t.getId());
                     paperResult.put(SystemConstant.ID, t.getId());
@@ -866,7 +859,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
                     paperJsonList.add(filePaperJson);
                     paperJsonList.add(filePaperJson);
                     FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.PAPER, filePaperJson);
                     FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.PAPER, filePaperJson);
                     fileUploadParamsPaperJson.setFormat(CloudMarkFileUploadTypeEnum.JSON.getCode());
                     fileUploadParamsPaperJson.setFormat(CloudMarkFileUploadTypeEnum.JSON.getCode());
-//                    cloudMarkUtil.callFileUploadApi(fileUploadParamsPaperJson);
+                    cloudMarkUtil.callFileUploadApi(fileUploadParamsPaperJson);
 
 
                     jsonObject.put("currentTaskSize", currentTaskSize);
                     jsonObject.put("currentTaskSize", currentTaskSize);
                     currentTaskSize++;
                     currentTaskSize++;

+ 2 - 2
themis-task/src/main/resources/application-dev.properties

@@ -13,7 +13,7 @@ spring.application.name=themis-task
 #\u6570\u636E\u6E90\u914D\u7F6E
 #\u6570\u636E\u6E90\u914D\u7F6E
 db.host=localhost
 db.host=localhost
 db.port=3306
 db.port=3306
-db.name=themis_release
+db.name=themis_v1.1
 db.username=root
 db.username=root
 db.password=123456789
 db.password=123456789
 #redis\u6570\u636E\u6E90\u914D\u7F6E
 #redis\u6570\u636E\u6E90\u914D\u7F6E
@@ -218,7 +218,7 @@ tencentyun.sdk.trtcRegion=ap-guangzhou
 monitor.config.prefix=oe_test
 monitor.config.prefix=oe_test
 
 
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
-cloud.mark.url=http://192.168.10.224:80
+cloud.mark.url=https://192.168.10.224:80
 cloud.mark.studentScoreApi=/api/exam/student/score
 cloud.mark.studentScoreApi=/api/exam/student/score
 cloud.mark.examSaveApi=/api/exam/save
 cloud.mark.examSaveApi=/api/exam/save
 cloud.mark.subjectSaveApi=/api/exam/subject/save
 cloud.mark.subjectSaveApi=/api/exam/subject/save