zhangf
2024-06-24 21362fd048558832cdcaca8ee957d2d7aa753be2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
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);
    }
}