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.service.TripartiteInterfaceService;
|
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")
|
@RestController
|
public class TripartiteInterfaceController extends BaseController {
|
@Autowired
|
private TripartiteInterfaceService tripartiteInterfaceService;
|
|
@PostMapping("/question/bank")
|
public AjaxResult receiveQuestionBank(@RequestBody JSONObject jsonObject){
|
return success(tripartiteInterfaceService.receiveQuestionBank(jsonObject));
|
}
|
@PostMapping("/course")
|
public AjaxResult receiveCourse(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveCourse(jsonObject);
|
}
|
@PostMapping("/course/delete")
|
public AjaxResult receiveCourseDelete(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveCourseDelete(jsonObject);
|
}
|
|
@PostMapping("/batch")
|
public AjaxResult receiveBatch(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveBatch(jsonObject);
|
}
|
@PostMapping("/batch/open")
|
public AjaxResult receiveBatchOpen(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveBatchOpen(jsonObject);
|
}
|
@PostMapping("/student")
|
public AjaxResult receiveStudent(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveStudent(jsonObject);
|
}
|
@PostMapping("/study/detail")
|
public AjaxResult receiveStudyDetail(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveStudyDetail(jsonObject);
|
}
|
@PostMapping("/exam/record")
|
public AjaxResult receiveExamRecord(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveExamRecord(jsonObject);
|
}
|
@PostMapping("/batch/end")
|
public AjaxResult receiveBarchEnd(@RequestBody JSONObject jsonObject){
|
return tripartiteInterfaceService.receiveBarchEnd(jsonObject);
|
}
|
|
/**
|
* 题库组卷
|
* @param args
|
*/
|
/*public static void main(String[] args) {
|
ThQuestionBankReqDTO thQuestionBankReqDTO = new ThQuestionBankReqDTO();
|
thQuestionBankReqDTO.setUuid(UUID.randomUUID().toString());
|
thQuestionBankReqDTO.setMonth("2024年6月");
|
thQuestionBankReqDTO.setDelFlag((byte)0);
|
thQuestionBankReqDTO.setUrl("http://www.baidu.com");
|
thQuestionBankReqDTO.setAddCount(2);
|
thQuestionBankReqDTO.setAssemblyRate(new BigDecimal(80));
|
thQuestionBankReqDTO.setBrushRate(new BigDecimal(89));
|
thQuestionBankReqDTO.setReduceCount(4);
|
thQuestionBankReqDTO.setLastMonthCount(450);
|
String jsonString = JSONObject.toJSONString(thQuestionBankReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("PmvIbOPyVJ2pYqmGer1YBAij35Tfdk8lufUv+Y2CyqAds/iyh6PwS4dsnUzNO3El4kNaaSbqKO4dpSYLkHZiB41zB6OvNFcfSQr5uguBInWZHVGeWC7FljJkk/z8GB0ydvHSwsy+FGVkA6nMcOJGU31sf4JjO2hL10h6YeVEKtiEW2wOtuYWs067t4aP0q0zTnBWlnfO9i2WT3v0FjNhCXgPKR65HRAqrf+jrzRveLLFGL3be6qBOBwc8QqowMRS+6oUFMXTpzSfU6/QJrmbQw==");
|
System.out.println(decrypt);
|
ThQuestionBankReqDTO questionBankReqDTO = JSONObject.parseObject(decrypt, new TypeReference<ThQuestionBankReqDTO>() {});
|
System.out.println(questionBankReqDTO);
|
}*/
|
|
/**
|
* 课程
|
* @param args
|
*/
|
/*public static void main(String[] args) {
|
ThCourseReqDTO thCourseReqDTO = new ThCourseReqDTO();
|
thCourseReqDTO.setUuid("20bded7f-660c-4380-b7f9-00f3976e1875");
|
thCourseReqDTO.setCourseCode("java001111");
|
thCourseReqDTO.setCourseName("java课程");
|
//thCourseReqDTO.setDelFlag((byte)0);
|
thCourseReqDTO.setLessonNum(new BigDecimal(40));
|
thCourseReqDTO.setTrainOrgName("机构111");
|
List<ThCourseChapterReqDTO> chapterList = new ArrayList<>();
|
//章
|
ThCourseChapterReqDTO chapterReqDTO1 = new ThCourseChapterReqDTO();
|
chapterReqDTO1.setUuid("9d470732-6233-4820-82f7-37c80fe8ae68");
|
//chapterReqDTO1.setDelFlag((byte)0);
|
chapterReqDTO1.setChapterCode("001");
|
chapterReqDTO1.setChapterName("第一章节 基础理论");
|
chapterReqDTO1.setHaveResource((byte)10);
|
List<ThCourseChapterReqDTO> childList = new ArrayList<>();
|
//节
|
ThCourseChapterReqDTO child11 = new ThCourseChapterReqDTO();
|
child11.setUuid("d5cd3b26-be11-4ffe-8a34-283c49c85253");
|
child11.setUrl("https://www.baidu.com");
|
//child11.setDelFlag((byte)2);
|
child11.setChapterCode("1.1");
|
child11.setChapterName("1.1类");
|
child11.setHaveResource((byte)20);
|
child11.setDuration(1800l);
|
child11.setResourceType((byte)0);
|
child11.setLessonNum(new BigDecimal(1));
|
ThCourseChapterReqDTO child12= new ThCourseChapterReqDTO();
|
child12.setUuid("eb7167be-5716-43d0-8e27-12bb43d1dded");
|
child12.setUrl("https://www.baidu.com1213231");
|
//child12.setDelFlag((byte)0);
|
child12.setChapterCode("1.2");
|
child12.setChapterName("1.2接口");
|
child12.setHaveResource((byte)20);
|
child12.setLessonNum(new BigDecimal(1.5));
|
child12.setDuration(4500l);
|
child12.setResourceType((byte)0);
|
ThCourseChapterReqDTO child13= new ThCourseChapterReqDTO();
|
child13.setUuid(UUID.randomUUID().toString());
|
child13.setUrl("https://www.baidu.com3333");
|
//child13.setDelFlag((byte)0);
|
child13.setChapterCode("1.3");
|
child13.setChapterName("1.3多态");
|
child13.setHaveResource((byte)20);
|
child13.setLessonNum(new BigDecimal(1.5));
|
child13.setDuration(1800l);
|
child13.setResourceType((byte)0);
|
childList.add(child11);
|
childList.add(child12);
|
childList.add(child13);
|
chapterReqDTO1.setChildren(childList);
|
chapterList.add(chapterReqDTO1);
|
thCourseReqDTO.setChapters(chapterList);
|
|
String jsonString = JSONObject.toJSONString(thCourseReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("3G5/kr4d9CCjK6/q8LWZ1TZK6SF/GINWmeKzfmtvPZo0W/4Ydd7qti1VaOO4LQcKNNN67kvSfjCx3xUS1iAiUcWaVllWpVeNW8FWHt/1OQ+coFyslHVXDdCbQIVYpzF/0Q4jdBXpydtEmVsxifazo3l5/a2NBG319hhCXFNJmY5DgF2SUq7t6niKaEom6QbcFTENqV1KNZ87QeI7dl18UveADgxP91XpaRb+4M0JGIYpiXnr/LEDNAYM13eU6LSK+mBc38QQ+WcxijYGFvk1U6rlMYui3aLisyPLaFEwlhZ9Mscsrdw3t+XNJNp6SKiTG4HCOvSBYOGHp2PHhFQBNHzluOlcA5L8a4nogDpThwcl47O474VXnp0WG2+9DYVUTXW/UddZSc/aCCIhe/DTfA7WoZkOnMO8k8fHlXQ0exHnfPxBTxozG3UKyQ6hGHyjWqrfk/oVRcfOcPCQavIwwu9YLQeUpqL88VntE2+sBUPJtGOQrvq6A5No2RHgEGqptrUboMuL/OimEGjTAPdnRKQL+8JqqZf9HSPTCnoSYpTxKAfFf8hKEyMvW8SZzr3BS1MOL11HOTKeaD7kVuCYxEugfrdIzcAFsX9lxHSO2ubHadXektkdpLdMPd8WuLDzUknJqvYPDHBxcIzMea0XAQ==");
|
System.out.println(decrypt);
|
ThCourseReqDTO questionBankReqDTO = JSONObject.parseObject(decrypt, new TypeReference<ThCourseReqDTO>() {});
|
System.out.println(questionBankReqDTO);
|
}*/
|
|
/**
|
* 课程删除
|
*/
|
/*public static void main(String[] args) {
|
ThCourseDeleteReqDTO thQuestionBankReqDTO = new ThCourseDeleteReqDTO();
|
thQuestionBankReqDTO.setCourseUuid("20bded7f-660c-4380-b7f9-00f3976e1875");
|
String jsonString = JSONObject.toJSONString(thQuestionBankReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("PmvIbOPyVJ2pYqmGer1YBAij35Tfdk8lufUv+Y2CyqAds/iyh6PwS4dsnUzNO3El4kNaaSbqKO4dpSYLkHZiB41zB6OvNFcfSQr5uguBInWZHVGeWC7FljJkk/z8GB0ydvHSwsy+FGVkA6nMcOJGU31sf4JjO2hL10h6YeVEKtiEW2wOtuYWs067t4aP0q0zTnBWlnfO9i2WT3v0FjNhCXgPKR65HRAqrf+jrzRveLLFGL3be6qBOBwc8QqowMRS+6oUFMXTpzSfU6/QJrmbQw==");
|
System.out.println(decrypt);
|
ThQuestionBankReqDTO questionBankReqDTO = JSONObject.parseObject(decrypt, new TypeReference<ThQuestionBankReqDTO>() {});
|
System.out.println(questionBankReqDTO);
|
}*/
|
|
/**
|
* 批次上报
|
* @param args
|
*/
|
/*public static void main(String[] args) {
|
ThBatchReqDTO thBatchReqDTO = new ThBatchReqDTO();
|
thBatchReqDTO.setUuid(UUID.randomUUID().toString());
|
thBatchReqDTO.setBatchName("第一期2024");
|
thBatchReqDTO.setTrainOrgName("测试机构");
|
thBatchReqDTO.setHaveExam(HaveExam.YES.getStatus());
|
thBatchReqDTO.setOpenStatus(OpenStatus.NO.getStatus());
|
List<String> courseList = new ArrayList<>();
|
courseList.add(new String("20bded7f-660c-4380-b7f9-00f3976e1875"));
|
thBatchReqDTO.setCourseUuidList(courseList);
|
String jsonString = JSONObject.toJSONString(thBatchReqDTO);
|
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("PmvIbOPyVJ2pYqmGer1YBAij35Tfdk8lufUv+Y2CyqAds/iyh6PwS4dsnUzNO3El4kNaaSbqKO4dpSYLkHZiB41zB6OvNFcfSQr5uguBInWZHVGeWC7FljJkk/z8GB0ydvHSwsy+FGVkA6nMcOJGU31sf4JjO2hL10h6YeVEKtiEW2wOtuYWs067t4aP0q0zTnBWlnfO9i2WT3v0FjNhCXgPKR65HRAqrf+jrzRveLLFGL3be6qBOBwc8QqowMRS+6oUFMXTpzSfU6/QJrmbQw==");
|
System.out.println(decrypt);
|
ThQuestionBankReqDTO questionBankReqDTO = JSONObject.parseObject(decrypt, new TypeReference<ThQuestionBankReqDTO>() {});
|
System.out.println(questionBankReqDTO);
|
}*/
|
/**
|
* 学生信息上报
|
*/
|
/* public static void main(String[] args) {
|
ThStudentReqDTO thStudentReqDTO = new ThStudentReqDTO();
|
thStudentReqDTO.setName("李四");
|
thStudentReqDTO.setIdcard("11111");
|
thStudentReqDTO.setIndustry("ceshj");
|
thStudentReqDTO.setPost("post");
|
thStudentReqDTO.setPhone("111111");
|
thStudentReqDTO.setSex(StudentSex.BOY.getStatus());
|
thStudentReqDTO.setTrainOrgName("测试机构");
|
thStudentReqDTO.setAuthPhoto("http://baidu.om");
|
thStudentReqDTO.setBatchUuid("cc90070e-8d30-4c55-b696-7af25fd98900");
|
List<ThStudentReqDTO> studentList = new ArrayList<>();
|
studentList.add(thStudentReqDTO);
|
String jsonString = JSONObject.toJSONString(studentList);
|
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
String decrypt = AESUtils.decrypt("PmvIbOPyVJ2pYqmGer1YBAij35Tfdk8lufUv+Y2CyqAds/iyh6PwS4dsnUzNO3El4kNaaSbqKO4dpSYLkHZiB41zB6OvNFcfSQr5uguBInWZHVGeWC7FljJkk/z8GB0ydvHSwsy+FGVkA6nMcOJGU31sf4JjO2hL10h6YeVEKtiEW2wOtuYWs067t4aP0q0zTnBWlnfO9i2WT3v0FjNhCXgPKR65HRAqrf+jrzRveLLFGL3be6qBOBwc8QqowMRS+6oUFMXTpzSfU6/QJrmbQw==");
|
System.out.println(decrypt);
|
ThQuestionBankReqDTO questionBankReqDTO = JSONObject.parseObject(decrypt, new TypeReference<ThQuestionBankReqDTO>() {});
|
System.out.println(questionBankReqDTO);
|
}*/
|
/**
|
* 开班
|
* */
|
/*public static void main(String[] args) {
|
ThBatchOpenReqDTO thBatchOpenReqDTO = new ThBatchOpenReqDTO();
|
thBatchOpenReqDTO.setBatchUuid("b1b70bce-06dc-40b0-a3a1-dd595572eaa1");
|
String jsonString = JSONObject.toJSONString(thBatchOpenReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
|
}*/
|
/**
|
* 结束培训
|
* */
|
/* public static void main(String[] args) {
|
ThBatchEndReqDTO thBatchOpenReqDTO = new ThBatchEndReqDTO();
|
thBatchOpenReqDTO.setBatchUuid("cc90070e-8d30-4c55-b696-7af25fd98900");
|
thBatchOpenReqDTO.setIdcard("11111");
|
String jsonString = JSONObject.toJSONString(thBatchOpenReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
|
}*/
|
|
/**
|
* 考试记录
|
*/
|
/*public static void main(String[] args) {
|
ThExamRecordReqDTO thExamRecordReqDTO = new ThExamRecordReqDTO();
|
thExamRecordReqDTO.setUuid(UUID.randomUUID().toString());
|
thExamRecordReqDTO.setIdcard("1111");
|
thExamRecordReqDTO.setExamName("考试1");
|
thExamRecordReqDTO.setExamNum(1);
|
thExamRecordReqDTO.setCourseUuid("20bded7f-660c-4380-b7f9-00f3976e1875");
|
thExamRecordReqDTO.setBatchUuid("cc90070e-8d30-4c55-b696-7af25fd98900");
|
thExamRecordReqDTO.setExamPassScore(new BigDecimal(80));
|
thExamRecordReqDTO.setExamIsPass(ExamIsPass.YES.getStatus());
|
thExamRecordReqDTO.setExamUserScore(new BigDecimal(90));
|
thExamRecordReqDTO.setExamStartTime(LocalDateTime.now());
|
thExamRecordReqDTO.setExamSubmitTime(LocalDateTime.now());
|
thExamRecordReqDTO.setTrainOrgName("测试");
|
thExamRecordReqDTO.setExamTotalScore(new BigDecimal(100));
|
String jsonString = JSONObject.toJSONString(thExamRecordReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
|
}*/
|
/**
|
*
|
*/
|
/* public static void main(String[] args) {
|
ThStudyDetailReqDTO thStudyDetailReqDTO = new ThStudyDetailReqDTO();
|
thStudyDetailReqDTO.setUuid(UUID.randomUUID().toString());
|
thStudyDetailReqDTO.setIdcard("11111");
|
thStudyDetailReqDTO.setBatchUuid("cc90070e-8d30-4c55-b696-7af25fd98900");
|
thStudyDetailReqDTO.setCourseUuid("20bded7f-660c-4380-b7f9-00f3976e1875");
|
thStudyDetailReqDTO.setFinishStatus((byte)0);
|
thStudyDetailReqDTO.setStartPosition(0l);
|
thStudyDetailReqDTO.setFinishPosition(4567l);
|
thStudyDetailReqDTO.setChapterUuid("d5cd3b26-be11-4ffe-8a34-283c49c85253");
|
thStudyDetailReqDTO.setDuration(4567l);
|
thStudyDetailReqDTO.setTrainOrgName("测试");
|
thStudyDetailReqDTO.setStartTime(LocalDateTime.now());
|
thStudyDetailReqDTO.setFinishTime(LocalDateTime.now());
|
thStudyDetailReqDTO.setVideoUrl("hhtht");
|
thStudyDetailReqDTO.setLessonReportUrl("hht");
|
List<ThStudyTrackReqDTO> thStudyTrackReqDTOList = new ArrayList<>();
|
ThStudyTrackReqDTO thStudyTrackReqDTO = new ThStudyTrackReqDTO();
|
thStudyTrackReqDTO.setUuid(UUID.randomUUID().toString());
|
thStudyTrackReqDTO.setStartTime(LocalDateTime.now());
|
thStudyTrackReqDTO.setEndTime(LocalDateTime.now());
|
thStudyTrackReqDTO.setTimeInterval(789878l);
|
thStudyTrackReqDTOList.add(thStudyTrackReqDTO);
|
List<ThStudytAuthReqDTO> thStudytAuthReqDTOList = new ArrayList<>();
|
ThStudytAuthReqDTO thStudytAuthReqDTO = new ThStudytAuthReqDTO();
|
thStudytAuthReqDTO.setUuid(UUID.randomUUID().toString());
|
thStudytAuthReqDTO.setAuthPostion(0l);
|
thStudytAuthReqDTO.setAuthTime(LocalDateTime.now());
|
thStudytAuthReqDTO.setApprovePhoto("454l");
|
thStudytAuthReqDTO.setFaceType(FaceType.AUTH.getType());
|
thStudytAuthReqDTOList.add(thStudytAuthReqDTO);
|
thStudyDetailReqDTO.setTrackList(thStudyTrackReqDTOList);
|
thStudyDetailReqDTO.setStudentAuthList(thStudytAuthReqDTOList);
|
String jsonString = JSONObject.toJSONString(thStudyDetailReqDTO);
|
String encrypt = AESUtils.encrypt(jsonString);
|
System.out.println(encrypt);
|
|
}*/
|
public static void main(String[] args) {
|
String decrypt = AESUtils.decrypt("PmvIbOPyVJ2pYqmGer1YBAij35Tfdk8lufUv+Y2CyqAds/iyh6PwS4dsnUzNO3El4Sk/WXXwbPGQ7UdaV8jznT/3YPqTeLdkxQ/1/6r9pvxuD2tyds8jo9DIBZYVxHpX3/9Z5Byp1UvszWeTWeaiDN+paKNO5v/TcXrosdce2dMGXLwY0i3GYA1JIbWWTTrvoWKJK+k5VW+5NnnDo+2Gj5CNSNv4c2wT7f3hTRy6B66RrRN3xkucCw4VRJZ+r+RK");
|
System.out.println(decrypt);
|
}
|
}
|