Forráskód Böngészése

新增云阅卷成绩同步功能

wangliang 2 éve
szülő
commit
09e88ddd1c

+ 8 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/TEExamController.java

@@ -545,7 +545,7 @@ public class TEExamController {
 
     @ApiOperation(value = "云阅卷成绩同步")
     @ApiResponses({@ApiResponse(code = 200, message = "成绩同步信息", response = Result.class)})
-    @RequestMapping(value = "/score/sync", method = RequestMethod.POST)
+    @RequestMapping(value = "/cloud_mark/score/sync", method = RequestMethod.POST)
     public Result scoreSync(@ApiParam(value = "考试ID", required = true) @RequestParam String examId,
                             @ApiParam(value = "云阅卷考试id", required = true) @RequestParam String yunMarkExamId,
                             @ApiParam(value = "accessKey", required = false) @RequestParam(required = false) String accessKey,
@@ -589,6 +589,13 @@ public class TEExamController {
             tbTaskHistory.setExamId(Long.parseLong(examId));
             taskHistoryService.save(tbTaskHistory);
 
+            TBOrg tbOrg = cacheService.addOrgCache(examCacheBean.getOrgId());
+            if (Objects.isNull(accessKey) || Objects.equals(accessKey.trim(), "")) {
+                accessKey = tbOrg.getAccessKey();
+            }
+            if (Objects.isNull(accessSecret) || Objects.equals(accessSecret.trim(), "")) {
+                accessSecret = tbOrg.getAccessSecret();
+            }
             transMap.put("tbTaskHistory", tbTaskHistory);
             transMap.put(SystemConstant.CREATE_ID, tbUser.getId());
             transMap.put(SystemConstant.ORG_ID, tbUser.getOrgId());

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

@@ -157,7 +157,7 @@ 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/
 
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
-yun.mark.url=https://epcc.markingcloud.com/admin/home
+yun.mark.url=http://192.168.10.224:80
 yun.mark.studentScoreApi=/api/exam/student/score
 
 #============================================================================

+ 23 - 16
themis-business/src/main/resources/mapper/TEAudioMapper.xml

@@ -54,6 +54,7 @@
                 and tea.activity_id = #{activityId}
             </if>
         </where>
+            order by tea.create_time
         ) t
     </select>
 
@@ -68,20 +69,26 @@
             tea.audio_default as audioDefault,
             tea.`type`,
             (case
-                 when tea.`type` = 'BEFORE'
-                     then teea.start_time - (tea.play_time * 1000)
-                 else teea.finish_time - (tea.play_time * 1000)
-                end) as execTime,
-            teea.start_time as startTime,
-            teea.finish_time as finishTime
-        from
-            t_e_audio tea
-                join t_e_exam_activity teea on
-                teea.id = tea.activity_id
-        <where>1 = 1
-            <if test="activityId != null and activityId != ''">
-                and tea.activity_id = #{activityId}
-            </if>
-        </where>
-    </select>
+             when tea.`type` = 'BEFORE'
+                 then teea.start_time - (tea.play_time * 1000)
+             else teea.finish_time - (tea.play_time * 1000)
+            end) as execTime,-->
+        <!--(case
+        when tea.`type` = 'BEFORE'
+        then unix_timestamp(current_timestamp()) * 1000 + 1000 * 60 * 2
+        else unix_timestamp(current_timestamp()) * 1000 + 1000 * 60 * 3
+        end) as execTime,-->
+        teea.start_time as startTime,
+        teea.finish_time as finishTime
+    from
+        t_e_audio tea
+            join t_e_exam_activity teea on
+            teea.id = tea.activity_id
+    <where> 1 = 1
+        <if test="activityId != null and activityId != ''">
+            and tea.activity_id = #{activityId}
+        </if>
+    </where>
+    order by tea.create_time
+</select>
 </mapper>

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

@@ -218,5 +218,5 @@ tencentyun.sdk.trtcRegion=ap-guangzhou
 monitor.config.prefix=oe_test
 
 #\u4E91\u9605\u5377\u540C\u6B65\u914D\u7F6E
-yun.mark.url=https://epcc.markingcloud.com/admin/home
+yun.mark.url=http://192.168.10.224:80
 yun.mark.studentScoreApi=/api/exam/student/score