From 3402a6cdef63a87cf046a8bbfdc2898bb842c93f Mon Sep 17 00:00:00 2001
From: kongzy <kongzy>
Date: Sat, 12 Oct 2024 14:09:47 +0800
Subject: [PATCH] 新增学时证书
---
exam-system/src/main/java/com/gkhy/exam/institutionalaccess/controller/TripartiteInterfaceController.java | 45 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/controller/TripartiteInterfaceController.java b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/controller/TripartiteInterfaceController.java
index bdbaf50..88cc6e3 100644
--- a/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/controller/TripartiteInterfaceController.java
+++ b/exam-system/src/main/java/com/gkhy/exam/institutionalaccess/controller/TripartiteInterfaceController.java
@@ -1,17 +1,26 @@
package com.gkhy.exam.institutionalaccess.controller;
import com.alibaba.fastjson2.JSONObject;
+import com.alibaba.fastjson2.TypeReference;
+import com.gkhy.exam.institutionalaccess.enums.*;
+import com.gkhy.exam.institutionalaccess.model.req.*;
+import com.gkhy.exam.institutionalaccess.model.resp.ThPlatformStudentRespDTO;
import com.gkhy.exam.institutionalaccess.service.TripartiteInterfaceService;
import com.ruoyi.common.annotation.RepeatedClick;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.signature.AESUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
@RequestMapping("/gov-server/receive")
@@ -22,7 +31,7 @@
@PostMapping("/question/bank")
@RepeatedClick
- public AjaxResult receiveQuestionBank(@RequestBody JSONObject jsonObject){
+ public AjaxResult receiveQuestionBank(@RequestBody JSONObject jsonObject) throws Exception {
return success(tripartiteInterfaceService.receiveQuestionBank(jsonObject));
}
@PostMapping("/course")
@@ -69,6 +78,18 @@
}
/**
+ * 学时证书推送
+ * @param jsonObject
+ * @return
+ */
+ @RepeatedClick
+ @PostMapping("/certs")
+ public AjaxResult receiveCerts(@RequestBody JSONObject jsonObject) throws Exception {
+ return tripartiteInterfaceService.receiveCerts(jsonObject);
+ }
+
+
+ /**
* 题库组卷
* @param args
*/
@@ -96,7 +117,7 @@
* 课程
* @param args
*/
- /*public static void main(String[] args) {
+ /* public static void main(String[] args) {
List<ThCourseReqDTO> list = new ArrayList<>();
ThCourseReqDTO thCourseReqDTO = new ThCourseReqDTO();
thCourseReqDTO.setUuid("20bded7f-660c-4380-b7f9-00f3976e1875");
@@ -189,7 +210,12 @@
thBatchReqDTO.setBatchName("第一期2024");
thBatchReqDTO.setTrainOrgName("测试机构");
thBatchReqDTO.setHaveExam(HaveExam.YES.getStatus());
- thBatchReqDTO.setStatus(OpenStatus.NO.getStatus());
+ thBatchReqDTO.setStatus(OpenStatus.START.getStatus());
+ thBatchReqDTO.setActualEndTime(LocalDateTime.now());
+ thBatchReqDTO.setActualStartTime(null);
+ thBatchReqDTO.setExpectEndTime(LocalDateTime.now());
+ thBatchReqDTO.setExpectStartTime(LocalDateTime.now());
+ thBatchReqDTO.setSubjectCode("201");
thBatchReqDTO.setDelFlag((byte)0);
thBatchReqDTO.setBatchLessonNum(new BigDecimal(40));
List<ThBatchCourseReqDTO> courseList = new ArrayList<>();
@@ -233,7 +259,7 @@
/**
* 学生信息上报
*/
- /* public static void main(String[] args) {
+ /* public static void main(String[] args) {
ThStudentReqDTO thStudentReqDTO = new ThStudentReqDTO();
thStudentReqDTO.setUuid("5096d539-9ec4-499e-a7ef-3fc1c688ba51");
thStudentReqDTO.setName("李四fafas");
@@ -306,7 +332,7 @@
/**
*
*/
- /*public static void main(String[] args) {
+ public static void main(String[] args) {
List<ThStudyDetailReqDTO> list = new ArrayList<>();
ThStudyDetailReqDTO thStudyDetailReqDTO = new ThStudyDetailReqDTO();
thStudyDetailReqDTO.setUuid("8c061cb1-8560-43b8-abe4-04ae8e763f59");
@@ -319,6 +345,7 @@
thStudyDetailReqDTO.setChapterUuid("d5cd3b26-be11-4ffe-8a34-283c49c85253");
thStudyDetailReqDTO.setDuration(4567l);
thStudyDetailReqDTO.setTrainOrgName("测试");
+ thStudyDetailReqDTO.setCompleteStatus(StudentFinishStatus.YES.getStatus());
thStudyDetailReqDTO.setStartTime(LocalDateTime.now());
thStudyDetailReqDTO.setFinishTime(LocalDateTime.now());
thStudyDetailReqDTO.setVideoUrl("hhtht");
@@ -345,10 +372,12 @@
String encrypt = AESUtils.encrypt(jsonString);
System.out.println(encrypt);
- }*/
+ }
/* public static void main(String[] args) {
- String decrypt = AESUtils.decrypt("");
+ String decrypt = AESUtils.decrypt("BhSazFtvofCRelDGgefpPEYzIR9eUed3RV52ThGuzib1FyirNEW8Dri7WBJBKDKAn8+bNbL2HydRalakvoNA6oP/AM/sYpxDvO4pwaJPvYkow8crP8qPcB+vnDoJRCpvChl6RIBc4+oMONh6gsX6FA==");
+ ThPlatformStudentRespDTO studentRespDTO = JSONObject.parseObject(decrypt, new TypeReference<ThPlatformStudentRespDTO>() {});
System.out.println(decrypt);
+ System.out.println(studentRespDTO);
}*/
}
--
Gitblit v1.9.2