Compare commits

...

194 Commits

Author SHA1 Message Date
zhaolongfei
a8ce10c575 Merge remote-tracking branch 'java-servse-yx/zcwy0912-llf' into zcwy0912-llf 2024-10-21 11:07:47 +08:00
zhaolongfei
70a87ac812 视频解析添加日志 2024-10-21 11:06:36 +08:00
Wangxxz
5285506f0f 恢复 2024-09-30 13:20:31 +08:00
Wangxxz
33df8b0831 加判断 2024-09-30 11:57:55 +08:00
Wangxxz
effb45c6d0 加判断 2024-09-30 11:51:47 +08:00
zhaolongfei
3af3c2eedf 考试随机试题功能修改 2024-09-29 11:17:00 +08:00
zhaolongfei
57e04f46c0 试题管理模板修改 2024-09-27 14:22:51 +08:00
zhaolongfei
2e2edbbf57 试题管理模板修改 2024-09-13 16:02:26 +08:00
zhaolongfei
beba553faa 试题管理模板修改 2024-09-13 15:08:45 +08:00
zhaolongfei
120a4f45fc 试题管理模板修改 2024-09-12 14:35:13 +08:00
nisen
18bb8a434a Merge branch 'master-0705' into 121-master 2024-09-05 14:57:17 +08:00
nisen
2ae3d99f21 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 19:44:02 +08:00
zhaolongfei
89573debef 在线课考试添加任务计算,redis放开 2024-08-23 19:43:18 +08:00
nisen
457597eabc Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 19:28:25 +08:00
zhaolongfei
24ae3c0ec6 在线课考试添加任务计算,暂时注释redis 2024-08-23 19:27:31 +08:00
zhaolongfei
fffa12344a 在线课考试添加任务计算,回退 2024-08-23 18:54:38 +08:00
nisen
52a58a6c6f Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:45:46 +08:00
zhaolongfei
a4b034752d 在线课考试添加任务计算 2024-08-23 18:45:10 +08:00
nisen
23e63062e9 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:30:42 +08:00
zhaolongfei
06415d58ac 在线课考试添加任务计算 2024-08-23 18:30:05 +08:00
nisen
3fc8ce614d Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 18:00:57 +08:00
zhaolongfei
bebe36d39e 在线课考试添加任务计算 2024-08-23 18:00:26 +08:00
nisen
d4af5ba8d5 Merge branch 'zcwy0823-llf' into master-0705 2024-08-23 17:59:12 +08:00
zhaolongfei
d42d1b2e83 处理study接口,添加接口访问限制次数 2024-08-23 17:55:53 +08:00
nisen
cf64f0406f Merge branch 'zcwy0815-llf' into master-0705 2024-08-15 20:20:14 +08:00
zhaolongfei
df3b0b95c1 处理study接口,studyitemid返回值为空的问题 2024-08-15 20:19:27 +08:00
nisen
f5ff666c07 Merge branch 'zcwy0815-llf' into master-0705 2024-08-15 19:57:23 +08:00
zhaolongfei
731e62c89f 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:44:23 +08:00
zhaolongfei
7fe53c026e 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:26:10 +08:00
zhaolongfei
6492e3b0dd 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:18:28 +08:00
zhaolongfei
30aab6eab4 处理study接口,studyitemid返回值为空的问题 2024-08-15 19:03:11 +08:00
670788339
61754d3852 放开redis 2024-08-15 16:26:47 +08:00
670788339
a26ee1c707 放开注释 2024-08-15 15:42:45 +08:00
670788339
1f0060c4dc 放开注释 2024-08-15 15:27:41 +08:00
670788339
6b0050286c 放开注释 2024-08-15 15:19:59 +08:00
670788339
2b07029aca 注释 2024-08-15 12:09:40 +08:00
670788339
d2d7fab96c 注释 2024-08-15 12:03:05 +08:00
670788339
be3bae969c study接口加redis过滤 2024-08-15 11:35:02 +08:00
670788339
8e1b7519ef study接口加redis过滤 2024-08-15 11:31:17 +08:00
670788339
bddb11caf8 study接口加redis过滤 2024-08-15 10:53:26 +08:00
nisen
f0fe015561 Merge branch 'zcwy0731-llf' into master-0705 2024-08-06 17:52:08 +08:00
zhaolongfei
91bcec00ef 修复同步到item表没有名称问题 2024-08-06 14:42:05 +08:00
nisen
7a210ec701 Merge branch 'zcwy0731-llf' into master-0705 2024-08-05 19:03:09 +08:00
zhaolongfei
6c616a1163 在线课作业重复提交报错修复 2024-08-05 15:12:54 +08:00
zhaolongfei
939325d5bd 在线课作业重复提交报错修复 2024-08-05 15:05:28 +08:00
zhaolongfei
4eddbc8e8f 在线管理资源完成情况名称搜索修复 2024-08-05 11:21:14 +08:00
zhaolongfei
50bdd59a26 在线管理资源完成情况名称搜索修复 2024-08-05 11:11:12 +08:00
zhaolongfei
b85eb97bc1 在线管理资源完成情况名称搜索修复 2024-08-05 10:57:14 +08:00
zhaolongfei
28b58a73cf 在线管理资源完成情况名称搜索修复 2024-08-05 10:29:36 +08:00
zhaolongfei
b9adf4c45f 作业多次点击提交报错修复 2024-08-02 17:08:00 +08:00
zhaolongfei
49aab74463 作业多次点击提交报错修复 2024-08-02 13:19:08 +08:00
zhaolongfei
9f30910d04 作业多次点击提交报错修复 2024-08-02 11:32:14 +08:00
zhaolongfei
6658b8c04b 作业多次点击提交报错修复 2024-08-02 11:03:13 +08:00
zhaolongfei
19df4224a9 作业多次点击提交报错修复 2024-08-02 10:16:05 +08:00
zhaolongfei
95ddc9f5d5 作业多次点击提交报错修复 2024-08-02 09:36:36 +08:00
nisen
f3b6bb6fee Merge branch 'zcwy0731-llf' into master-0705
# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/entity/ExamTest.java
2024-08-01 17:43:07 +08:00
zhaolongfei
64965f5ec6 考试管理删除不同步 2024-07-31 19:01:53 +08:00
zhaolongfei
a407ca2dad 考试管理删除不同步 2024-07-31 18:35:49 +08:00
nisen
16f1c2337b Merge branch 'zcwy0716-llf' into master-0705 2024-07-30 15:46:41 +08:00
zhaolongfei
bf476a23a0 在线管理状态完成情况 2024-07-30 14:05:06 +08:00
joshen
92a4e509ef Merge branch 'master-0705' into 'master'
Master 0705

See merge request !116
2024-07-30 11:58:33 +08:00
nisen
0f0edaf2cd Merge branch 'zcwy0729-llf' into master-0705 2024-07-30 11:56:45 +08:00
nisen
68d00e8c51 Merge branch 'zcwy0716-llf' into master-0705 2024-07-29 19:56:17 +08:00
zhaolongfei
41a542ea23 Merge remote-tracking branch 'java-servse-yx/zcwy0606-llf' into zcwy0729-llf
# Conflicts:
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/api/ExamTestApi.java
#	servers/boe-server-all/src/main/java/com/xboe/module/exam/service/impl/ExamTestServiceImpl.java
2024-07-29 19:52:50 +08:00
nisen
83e71dc5d6 Merge branch 'zcwy0716-llf' into yxmaster 2024-07-29 19:47:41 +08:00
zhaolongfei
fc98025a3a 视频暂存为空判断 2024-07-29 19:21:26 +08:00
zhaolongfei
687cd24de3 在线管理资源完成情况修改 2024-07-29 09:34:40 +08:00
nisen
f5f53557b6 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:21:06 +08:00
zhaolongfei
4687b353eb 在线管理资源完成情况修改 2024-07-26 22:19:59 +08:00
nisen
4b4f30b412 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:16:40 +08:00
zhaolongfei
072ee25037 在线管理资源完成情况修改 2024-07-26 22:15:44 +08:00
nisen
6f19ff7b0f Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:11:30 +08:00
zhaolongfei
2f8163b0a3 在线管理资源完成情况修改 2024-07-26 22:10:47 +08:00
nisen
f8566d2321 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 22:06:19 +08:00
zhaolongfei
5890f1b800 在线管理资源完成情况修改 2024-07-26 22:04:37 +08:00
nisen
d6102d1ce1 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:52:10 +08:00
zhaolongfei
50942a9435 在线管理资源完成情况修改 2024-07-26 21:50:40 +08:00
nisen
6521464676 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:38:42 +08:00
zhaolongfei
3ec7f587b3 在线管理资源完成情况修改 2024-07-26 21:36:23 +08:00
nisen
b6378b6565 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 21:20:05 +08:00
zhaolongfei
885b203dd6 在线管理资源完成情况修改 2024-07-26 21:17:35 +08:00
nisen
66d7f2a3cf Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:53:21 +08:00
zhaolongfei
e6f4affa21 在线管理资源完成情况修改 2024-07-26 20:51:55 +08:00
nisen
faea4f8b2a Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:37:09 +08:00
zhaolongfei
e4f845fdde 在线管理资源完成情况修改 2024-07-26 20:36:28 +08:00
nisen
c203956bc6 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 20:25:00 +08:00
zhaolongfei
c97cd3daab 在线管理资源完成情况修改 2024-07-26 20:24:17 +08:00
nisen
cf4004f073 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 19:00:39 +08:00
zhaolongfei
74f37b008d 在线管理资源完成情况修改 2024-07-26 19:00:14 +08:00
nisen
6bf5ccbcec Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:59:20 +08:00
zhaolongfei
d0b1894c14 在线管理资源完成情况修改 2024-07-26 18:58:35 +08:00
nisen
63867db58e Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:45:50 +08:00
zhaolongfei
7e1e32a70e 在线管理资源完成情况修改 2024-07-26 18:45:12 +08:00
zhaolongfei
30f8d363fa 在线管理资源完成情况修改 2024-07-26 18:42:32 +08:00
nisen
7ef0f976fc Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:38:12 +08:00
zhaolongfei
338a709ebc 在线管理资源完成情况修改 2024-07-26 18:36:47 +08:00
nisen
5a05ff74b7 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:18:17 +08:00
zhaolongfei
650107aea1 在线管理资源完成情况修改 2024-07-26 18:17:39 +08:00
nisen
a93580c387 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 18:04:08 +08:00
zhaolongfei
4c6480b428 在线管理资源完成情况修改 2024-07-26 17:56:59 +08:00
nisen
78184d3a11 Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 17:31:26 +08:00
zhaolongfei
901aded0c3 在线管理资源完成情况修改 2024-07-26 17:30:03 +08:00
nisen
bcb8b59e8a Merge branch 'zcwy0716-llf' into master-0705 2024-07-26 16:50:18 +08:00
zhaolongfei
e77ee34225 在线管理资源完成情况修改 2024-07-24 16:42:10 +08:00
zhaolongfei
9373a95631 在线管理资源完成情况修改 2024-07-24 11:32:38 +08:00
zhaolongfei
d81d4c474e 在线管理资源完成情况修改 2024-07-24 11:28:06 +08:00
zhaolongfei
2b3f59522c 在线管理资源完成情况修改 2024-07-24 11:09:21 +08:00
zhaolongfei
2f150449fe 在线管理资源完成情况修改 2024-07-24 10:50:08 +08:00
zhaolongfei
4f6fbff5e1 在线管理资源完成情况修改 2024-07-23 18:00:18 +08:00
zhaolongfei
abef4c963e 在线管理资源完成情况修改 2024-07-23 17:51:55 +08:00
zhaolongfei
5e355986a0 在线管理资源完成情况修改 2024-07-23 16:54:42 +08:00
zhaolongfei
13914ede08 在线管理资源完成情况修改 2024-07-23 16:00:43 +08:00
zhaolongfei
7eb1dcd7c4 在线管理资源完成情况修改 2024-07-23 15:54:56 +08:00
zhaolongfei
ea7ff473d0 在线管理资源完成情况修改 2024-07-23 15:32:18 +08:00
zhaolongfei
9aaab480bf 在线管理资源完成情况修改 2024-07-23 15:05:24 +08:00
zhaolongfei
b0ac4951ad 在线管理资源完成情况修改 2024-07-23 14:47:25 +08:00
zhaolongfei
3e9eaf30cb 在线管理资源完成情况修改 2024-07-23 14:36:33 +08:00
zhaolongfei
9fbeea85c6 在线管理资源完成情况修改 2024-07-23 14:30:40 +08:00
zhaolongfei
b2981cff8a 在线管理资源完成情况修改 2024-07-23 08:46:54 +08:00
zhaolongfei
dc2d144682 在线管理资源完成情况修改 2024-07-22 17:38:57 +08:00
nisen
1025f8f716 Merge branch 'zcwy0716-llf' into master-0705 2024-07-18 17:27:52 +08:00
zhaolongfei
46b63c36eb 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 19:33:50 +08:00
zhaolongfei
312108e6c0 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 19:28:08 +08:00
zhaolongfei
fee3f263bc 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 19:14:58 +08:00
zhaolongfei
16c755d14d 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 18:40:04 +08:00
zhaolongfei
69b6a50011 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 18:30:47 +08:00
zhaolongfei
bed3bd7fae 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 16:56:15 +08:00
zhaolongfei
d60a1521f9 在线管理资源完成情况修改,添加日志,先暂时注释 2024-07-17 16:48:38 +08:00
zhaolongfei
34db08d1a8 在线管理资源完成情况修改,添加日志 2024-07-17 16:24:22 +08:00
zhaolongfei
2822021f30 在线管理资源完成情况修改,添加日志 2024-07-17 16:01:05 +08:00
zhaolongfei
63d3844b76 在线管理资源完成情况修改,添加日志 2024-07-17 15:40:13 +08:00
zhaolongfei
e9645d631d 在线管理资源完成情况修改,添加日志 2024-07-17 14:49:55 +08:00
zhaolongfei
588f527293 在线管理资源完成情况修改,添加日志 2024-07-17 14:40:10 +08:00
zhaolongfei
99df06481f 在线管理资源完成情况修改,添加日志 2024-07-17 14:30:44 +08:00
zhaolongfei
921aa5909e 在线管理资源完成情况修改 2024-07-17 13:56:34 +08:00
zhaolongfei
d514450f23 在线管理资源完成情况修改 2024-07-17 13:49:24 +08:00
zhaolongfei
00c1fe8c49 在线管理资源完成情况修改 2024-07-17 13:36:34 +08:00
zhaolongfei
92aa649fa1 在线管理资源完成情况修改 2024-07-17 13:22:12 +08:00
zhaolongfei
019d534956 在线管理资源完成情况修改 2024-07-17 10:29:27 +08:00
zhaolongfei
b67d931741 在线管理资源完成情况修改 2024-07-17 10:20:34 +08:00
zhaolongfei
1bd09c0f02 在线管理资源完成情况修改 2024-07-17 09:45:50 +08:00
zhaolongfei
1794344829 在线管理资源完成情况修改 2024-07-17 09:37:19 +08:00
zhaolongfei
952f47fdc6 在线管理资源完成情况修改 2024-07-17 09:06:31 +08:00
zhaolongfei
f19b928bc9 在线课固定时长问题修改 2024-07-17 09:05:38 +08:00
zhaolongfei
df91242e1b 在线管理资源完成情况问题修改 2024-07-16 19:57:36 +08:00
joshen
4c6f15a707 Merge branch 'zcwy-0613-wjw' into 'master-0705'
新在线课逻辑删除库名

See merge request !115
2024-07-05 19:21:27 +08:00
xiaozhequ
488e6c2872 新在线课逻辑删除库名 2024-07-05 19:20:11 +08:00
joshen
e86afad4ef Merge branch 'zcwy-0613-wjw' into 'master-0705'
新在线课逻辑打印日志

See merge request !114
2024-07-05 19:00:59 +08:00
xiaozhequ
3285c639b9 新在线课逻辑打印日志 2024-07-05 18:59:29 +08:00
joshen
db3695019a Merge branch 'zcwy-0613-wjw' into 'master-0705'
Zcwy 0613 wjw

See merge request !113
2024-07-05 17:52:48 +08:00
joshen
7b2217c017 Merge branch 'zcwy0618-llf' into 'master'
Zcwy0618 llf

See merge request !112
2024-07-05 17:48:02 +08:00
xiaozhequ
84dd5cb192 在线课逻辑更改库名 2024-07-05 15:22:55 +08:00
zhaolongfei
333f29f008 在线课考试分数状态问题修改 2024-07-05 15:17:38 +08:00
xiaozhequ
407c7693bb 区分新建课 2024-07-04 16:21:48 +08:00
xiaozhequ
564bf42464 hrbp只读权限 2024-07-04 15:06:42 +08:00
xiaozhequ
55717e4dde 删除筛选 2024-07-04 12:33:35 +08:00
xiaozhequ
2698061eae 更改实体类字段 2024-07-04 12:32:44 +08:00
xiaozhequ
eb401d8fdf 新在线课逻辑 2024-07-04 10:55:17 +08:00
xiaozhequ
20374e274a 新在线课逻辑修复bug 2024-07-04 10:31:28 +08:00
xiaozhequ
c7a39a1f22 新在线课修复bug 2024-07-04 09:49:49 +08:00
zhaolongfei
ba6cca93b3 在线课考试成绩状态文提修改 2024-07-03 17:43:14 +08:00
xiaozhequ
7eb578127d 新在线课逻辑优化2 2024-07-03 16:30:19 +08:00
xiaozhequ
f2be349301 新在线课逻辑优化 2024-07-03 12:46:55 +08:00
xiaozhequ
e0037b8814 课程权限优化 2024-07-03 09:57:59 +08:00
xiaozhequ
0b0bd748d9 新在线课逻辑 2024-07-02 09:42:47 +08:00
xiaozhequ
9fd4171107 新在线课逻辑 2024-07-02 08:56:28 +08:00
joshen
d23bfbe159 Merge branch 'zcwy0618-llf' into 'master'
Zcwy0618 llf

See merge request !111
2024-06-28 18:38:12 +08:00
joshen
17ab1add64 Merge branch 'zcwy0529-l' into 'master'
课程审核时更新发布状态及发布时间

See merge request !110
2024-06-24 17:52:57 +08:00
xiaozhequ
625c41f466 在线可权限bug 2024-06-24 16:00:23 +08:00
xiaozhequ
f950788e08 课程权限学习路径图保持一致 2024-06-24 14:58:13 +08:00
670788339
7c9c1987a3 课程审核时更新发布状态及发布时间 2024-06-24 14:05:34 +08:00
xiaozhequ
a26ceb86d1 学习路径图保持一致 2024-06-24 14:04:53 +08:00
xiaozhequ
a2317d0b59 在线可权限更改逻辑 2024-06-24 13:47:34 +08:00
xiaozhequ
53c38baf22 修复查询失败bug 2024-06-21 15:46:43 +08:00
zhaolongfei
da6ed5eed4 考试时间修改同步 2024-06-21 14:58:36 +08:00
zhaolongfei
b108bc3e76 考试时间修改同步 2024-06-21 11:14:41 +08:00
zhaolongfei
1abd059820 修改bug 2024-06-19 18:07:48 +08:00
zhaolongfei
e2c697f860 修改bug 2024-06-19 16:43:08 +08:00
zhaolongfei
33fee46433 在线课考试成绩为空问题修改 2024-06-19 15:49:35 +08:00
xiaozhequ
de69ba1c11 在线课权限查询 2024-06-19 15:34:53 +08:00
zhaolongfei
c6a785bb4f 添加视频暂存点 2024-06-19 13:55:54 +08:00
xiaozhequ
2fcdb6b4b6 代码还原 2024-06-18 15:49:10 +08:00
zhaolongfei
7d08954525 修改项目下考试结束时间并未生效修复 2024-06-18 15:05:42 +08:00
xiaozhequ
62884bcc15 所有后台人过滤在线课 2024-06-18 14:56:28 +08:00
zhaolongfei
8567fa9ecc content表添加processVideo字段,添加判断 2024-06-18 13:47:46 +08:00
zhaolongfei
359b66e48a content表添加processVideo字段,添加判断 2024-06-18 13:31:39 +08:00
zhaolongfei
8125a6bd77 content表添加processVideo字段,添加判断 2024-06-18 11:12:08 +08:00
zhaolongfei
9b37e8a73d content表添加processVideo字段,添加判断 2024-06-18 09:09:52 +08:00
zhaolongfei
2fa3378e94 content表添加processVideo字段 2024-06-17 16:16:29 +08:00
xiaozhequ
dd0af3cbef 选择在线可时增加数据权限逻辑 2024-06-13 18:11:41 +08:00
zhaolongfei
0b7784779f item添加processVideo字段 2024-06-13 15:28:13 +08:00
zhaolongfei
e03118275d 修改项目下考试结束时间并未生效修复 2024-06-06 18:10:28 +08:00
zhaolongfei
1b1cb17861 Merge branch 'zcwy0525-llf' into zcwy0606-llf 2024-06-06 16:35:40 +08:00
zhaolongfei
a35c1faa49 学员在线删除失败的bug修复 2024-06-06 16:32:33 +08:00
28 changed files with 2348 additions and 1607 deletions

View File

@@ -9,15 +9,13 @@ import com.xboe.module.course.vo.StudyCourseVo;
import com.xboe.module.course.vo.TeacherInfoVo;
import com.xboe.module.course.vo.TeacherVo;
import com.xboe.module.dict.entity.DictDto;
import com.xboe.module.exam.entity.ExamTest;
import com.xboe.school.study.entity.StudyCourse;
import com.xboe.system.user.dao.UserDao;
import com.xboe.system.user.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
@@ -62,6 +60,9 @@ public class ThirdApi {
@Value("${coursesuilt.getStudyStatus}")
private String getStudyStatus;
@Value("${manageApi.editExam}")
private String editExam;
//获取例外人员的id
public List<String> getUserId(){
String responseBody = Optional.ofNullable(HttpRequest.get(infarasApiUrl+"?pid=316&type=1").execute() //prod 316
@@ -206,6 +207,14 @@ public class ThirdApi {
return studyCourseResult.getResult();
}
public void sqlUpdate(ExamTest examTest, String token) {
examTest.setSysUpdateTime(null);
examTest.setSysCreateTime(null);
examTest.setPublishTime(null);
String resp = Optional.ofNullable(HttpRequest.post(editExam).body(JSONUtil.toJsonStr(examTest)).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
Opt.ofBlankAble(resp).map(t -> JSONUtil.toBean(t, DynamicBean.class).success());
}
public static void main(String[] args) {
String token = "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJjb21wYW55Q29kZSI6IkMwMDEiLCJ1SWQiOiI5NjUzNDIwMjc0OTc2MDcxNjgiLCJjb21wYW55SWQiOiIxMDQxNjczOTc3Mzc5OTQ2NDk2IiwibG9naW5JZCI6IjE2ODg0NDg5MjIwNzY0OTE3NzgiLCJpc3MiOiJodHRwOi8vdS5ib2UuY29tIiwiR2l2ZW5OYW1lIjoiYm9ldSIsImV4cCI6MTY5MTM5OTc2NzU1OCwidXNlck5hbWUiOiLmnY7njonlhrAiLCJ1c2VySWQiOiI2QjA0OUZBRi1DMzE0LTdDQ0YtMEQyOC0wRDIzRjRDNDI1MzEifQ==.8b52dcf4d48a790ed258b9ca2b279bb269f5301722095382fbd352705b51c893";
String resp = Optional.ofNullable(HttpRequest.post("https://u-pre.boe.com/statApi/xboe/m/stat/userdynamic/list").body(JSONUtil.toJsonStr(UserdynamicParam.builder().
@@ -221,4 +230,6 @@ public class ThirdApi {
}
}

View File

@@ -17,5 +17,7 @@ public class UserOrgIds {
private Map<String,Boolean> permissions=new HashMap<String,Boolean>();
private List<String> ids;
//hrbp只读权限
private List<String> readIds;
}

View File

@@ -229,8 +229,10 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
public UserOrgIds getOrgIds() {
UserOrgIds uids=new UserOrgIds();
List<String> orgIds = new ArrayList<>();
List<String> readIds = new ArrayList<>();
uids.setIds(orgIds);
uids.setReadIds(readIds);
String token = TokenProxy.getToken(request);
String type="application/json";
String[] headers=new String[] {"token",token,"Content-Type",type};
@@ -281,7 +283,8 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
while (elements.hasNext()){
String oid=elements.next().asText();
if(!orgSetIds.contains(oid)) {
orgIds.add(oid);
// orgIds.add(oid);
readIds.add(oid);
}
}
}

View File

@@ -1,11 +1,7 @@
package com.xboe.module.course.api;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -134,7 +130,6 @@ public class CourseManageApi extends ApiBaseController{
}else {
dto.setIsSystemAdmin(false);
}
String ids="";
if(userOrgIds.getIds()!=null && !userOrgIds.getIds().isEmpty())
{
@@ -142,12 +137,14 @@ public class CourseManageApi extends ApiBaseController{
}
//log.info("获取到的用户的组织机构权限ids",ids);
String aid=getCurrent().getAccountId();
// String aid="1706272694871445506";
//如果前端查询当前人的,这里去掉
if(StringUtils.isNotBlank(dto.getAid())) {
dto.setAid(null);
}
dto.setOrgAid(aid);
dto.setOrgIds(ids);
dto.setReadIds(userOrgIds.getReadIds());
PageList<Course> coursePageList = courseService.findPage(pager.getPageIndex(), pager.getPageSize(),dto);
return success(coursePageList);
}catch(Exception e) {

View File

@@ -9,6 +9,7 @@ import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -28,6 +29,7 @@ import com.xboe.module.course.service.ICourseFileService;
*/
@RestController
@RequestMapping(value = "/xboe/m/course/cware")
@Slf4j
public class CourseWareApi extends ApiBaseController {
private String cookieName = "PLAYSIGN_TIME";
@@ -131,6 +133,8 @@ public class CourseWareApi extends ApiBaseController {
// 第一个/前端是时间
int index = signStr.indexOf("/");
if (index <= 0) {
log.info("解密后的字符串:"+signStr);
log.info("解密后的字符串的时间拼接:"+index);
return badRequest("验证错误");
}
@@ -138,9 +142,13 @@ public class CourseWareApi extends ApiBaseController {
String cfid = signStr.substring(index+1);// 文件路径
if (!time.equals(cookieTime)) {
log.info("请求头时间和解析后的时间对比:"+"解析时间:"+time+" 请求头时间:"+cookieTime);
log.info("解密后的字符串的时间拼接:"+signStr);
return badRequest("验证错误");
}
if(StringUtils.isBlank(cfid) || cfid.length()<10) {
log.info("查看时间文件路径:"+cfid);
log.info("解密后的字符串的时间拼接:"+signStr);
return badRequest("验证错误");
}

View File

@@ -1,10 +1,13 @@
package com.xboe.module.course.dao;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.xboe.core.orm.BaseDao;
import com.xboe.module.course.entity.CourseContent;
import java.util.List;
@Repository
public class CourseContentDao extends BaseDao<CourseContent> {
@@ -20,4 +23,5 @@ public class CourseContentDao extends BaseDao<CourseContent> {
int count=count(hql, courseId);
return count;
}
}

View File

@@ -2,6 +2,8 @@ package com.xboe.module.course.dto;
import lombok.Data;
import java.util.List;
/**
* 课程查询的条件对象
*/
@@ -102,6 +104,9 @@ public class CourseQueryDto {
* */
private String orgIds;
//hrpb只读
private List<String> readIds;
/**用户权限的查询*/
private String orgAid;
@@ -110,6 +115,11 @@ public class CourseQueryDto {
*/
private Boolean isSystemAdmin;
/**
* 是否是新建在线可
*/
private Boolean isCreateCourse;
private Boolean visible;
private String refId;
@@ -129,4 +139,5 @@ public class CourseQueryDto {
* 登录人id
*/
private String userId;
}

View File

@@ -370,6 +370,9 @@ public class Course extends BaseEntity {
@Column(name = "ref_type",length=32,columnDefinition="varchar(32) comment '反向关联的类型'")
private String refType;
@Transient
private Boolean isPermission=true;
@Transient
private String orgName;

View File

@@ -83,8 +83,13 @@ public class CourseContent extends BaseEntity {
* */
@Column(name = "duration")
private Integer duration;
/**
* 视频播放进度
* */
@Column(name = "progress_video")
private Float progressVideo;
/**用于学习时的状态显示,非存储字段*/
@Transient
private Integer status;
@@ -100,6 +105,21 @@ public class CourseContent extends BaseEntity {
this.contentType=contentType;
this.contentRefId=contentRefId;
}
@Override
public String toString() {
return "CourseContent{" +
"rid='" + rid + '\'' +
", typeId='" + typeId + '\'' +
", courseId='" + courseId + '\'' +
", csectionId='" + csectionId + '\'' +
", sortIndex=" + sortIndex +
", contentType=" + contentType +
", contentName='" + contentName + '\'' +
", contentRefId='" + contentRefId + '\'' +
", content='" + content + '\'' +
", duration=" + duration +
", status=" + status +
'}';
}
}

View File

@@ -82,4 +82,7 @@ public interface ICourseContentService{
* @return
*/
CourseAssess getAssess(String ccid);
void updateProcessVideo(String contentId, String courseId, Float processVideo);
}

View File

@@ -214,6 +214,12 @@ public class CourseAuditServiceImpl implements ICourseAuditService{
UpdateBuilder.create("lastState", CourseHRBPAudit.STATUS_PASS)
);
//设置课程状态已审核完成,这里是管理员的审核
courseDao.updateMultiFieldById(courseId,
UpdateBuilder.create("published", pass),
UpdateBuilder.create("erasable", false), //设置以后不能物理删除了
UpdateBuilder.create("publishTime", LocalDateTime.now()));
//发布到全文检索中
Course c=courseDao.get(courseId);
publishUtil.fullTextPublish(c);

View File

@@ -1,5 +1,7 @@
package com.xboe.module.course.service.impl;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import javax.annotation.Resource;
@@ -141,6 +143,17 @@ public class CourseContentServiceImpl implements ICourseContentService {
return assess;
}
@Override
@Transactional
public void updateProcessVideo(String id, String courseId, Float progressVideo) {
// 处理 processVideo 为 null 的情况
if (progressVideo == null) {
progressVideo = 0.00f;
}
String sql = "UPDATE boe_course_content SET progress_video = "+ progressVideo+" WHERE id = "+ id+" AND course_id = "+ courseId+" ";
ccDao.sqlUpdate(sql);
}
@Override
@Transactional
public void updateName(String id, String name) {

View File

@@ -355,17 +355,17 @@ public class AloneExamApi extends ApiBaseController {
return badRequest("此考试无试卷内容,考试已经过期或试卷已被删除");
}
try {
List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson);
ObjectMapper objectMapper = new ObjectMapper();
paperJson=objectMapper.writeValueAsString(qlist);
} catch (XaskException e) {
log.error("生成试卷错误",e);
return error("生成考试试卷错误",e.getMessage(),map);
} catch (JsonProcessingException e) {
log.error("生成试卷解析生成json错误",e);
return error("生成考试试卷解析错误",e.getMessage(),map);
}
}
List<TestQuestionVo> qlist=this.randomQuestion(examTest, paperJson);
ObjectMapper objectMapper = new ObjectMapper();
paperJson=objectMapper.writeValueAsString(qlist);
} catch (XaskException e) {
log.error("生成试卷错误",e);
return error("生成考试试卷错误",e.getMessage(),map);
} catch (JsonProcessingException e) {
log.error("生成试卷解析生成json错误",e);
return error("生成考试试卷解析错误",e.getMessage(),map);
}
}
map.put("paper", paperJson);
long end=System.currentTimeMillis();
log.info("开始考试用时="+(end-start)+" ms");

View File

@@ -166,118 +166,258 @@ public class ExamQuestionApi extends ApiBaseController {
return badRequest("请上传正确的试题文件");
}
//获取表头
Row row = sheetAt.getRow(1);
Row row ;
//从第二行开始获取数据
List<ExamQuestion> examQuestions1 = new ArrayList<>();
QuestionDto questionDto = new QuestionDto();
if(sheetAt.getRow(1).getCell(0).getStringCellValue().equals("标题(*)") && !sheetAt.getRow(1).getCell(0).getStringCellValue().equals("")){
row = sheetAt.getRow(1);
for (int i = 2;i<sheetAt.getPhysicalNumberOfRows();i++) {
//获取每一行
for (int i=2;i<sheetAt.getPhysicalNumberOfRows();i++) {
//获取每一行
Row row1 = sheetAt.getRow(i);
if(row1==null || row1.getCell(0)==null){
break;
}
if(StringUtil.isBlank(row1.getCell(0).getStringCellValue())){
break;
}
ExamQuestion examQuestion = new ExamQuestion();
examQuestion.setTitle(row1.getCell(0).getStringCellValue());
if(row1.getCell(1).getStringCellValue().equals("选题")){
examQuestion.setType(1);
}
if(row1.getCell(1).getStringCellValue().equals("多选题")){
examQuestion.setType(2);
}
examQuestion.setKnowledge(row1.getCell(2).getStringCellValue());
if(row1.getCell(3).getStringCellValue().equals("")){
examQuestion.setDifficulty(2f);
}
if(row1.getCell(3).getStringCellValue().equals("")){
examQuestion.setDifficulty(3f);
}
if(row1.getCell(3).getStringCellValue().equals("")){
examQuestion.setDifficulty(1f);
}
Cell cell = row1.getCell(4);
cell.setCellType(CellType.STRING);
Row row1 = sheetAt.getRow(i);
if(row1==null || row1.getCell(0)==null){
break;
}
if(StringUtil.isBlank(row1.getCell(0).getStringCellValue())){
break;
}
ExamQuestion examQuestion = new ExamQuestion();
examQuestion.setTitle(row1.getCell(0).getStringCellValue());
if(row1.getCell(1).getStringCellValue().equals("单选题")){
examQuestion.setType(1);
}
if(row1.getCell(1).getStringCellValue().equals("选题")){
examQuestion.setType(2);
}
if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(2f);
}else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(3f);
} else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(1f);
}else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(null);
}
Cell cell = row1.getCell(3);
cell.setCellType(CellType.STRING);
// examQuestion.setDefaultScore(Float.valueOf(cell.getStringCellValue()));
//单选
if (!cell.getStringCellValue().contains(",")){
examQuestion.setAnswer(row1.getCell(6).getStringCellValue());
examQuestion.setDefaultScore(Float.valueOf(row1.getCell(4).getStringCellValue()));
Cell cell1 = row1.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
//单选
if (!cell.getStringCellValue().contains(",")){
examQuestion.setAnswer(row1.getCell(5).getStringCellValue());
if (row1.getCell(3).getStringCellValue().isEmpty()){
examQuestion.setDefaultScore(null);
}else {
examQuestion.setDefaultScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
Cell cell1 = row1.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
List<ExamOption> examOptions = new ArrayList<>();
for (int j=7;j<=13;j++) {
List<ExamOption> examOptions = new ArrayList<>();
for (int j=6;j<=12;j++) {
if(row1.getCell(j)!=null) {
ExamOption examOption = new ExamOption();
if(row1.getCell(j)!=null) {
ExamOption examOption = new ExamOption();
// 截取表头
String substring = row.getCell(j).getStringCellValue().substring(3, 4);
if (row1.getCell(6).getStringCellValue().contains(substring)) {
String substring = row.getCell(j).getStringCellValue().substring(3, 4);
if (row1.getCell(5).getStringCellValue().contains(substring)) {
examOption.setIsAnswer(true);
examOption.setScore(Float.valueOf(row1.getCell(4).getStringCellValue()));
} else {
examOption.setIsAnswer(false);
}
if (examOption.getIsAnswer()) {
examOption.setScore(Float.valueOf(row1.getCell(4).getStringCellValue()));
}
examOption.setIsAnswer(true);
if (row1.getCell(3).getStringCellValue().isEmpty()){
examOption.setScore(null);
}else {
examOption.setScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
} else {
examOption.setIsAnswer(false);
}
if (examOption.getIsAnswer()) {
if (row1.getCell(3).getStringCellValue().isEmpty()){
examOption.setScore(null);
}else {
examOption.setScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
}
examOption.setOptions(row.getCell(j).getStringCellValue());
examOption.setOptions(row.getCell(j).getStringCellValue());
Cell cell2 = row1.getCell(j);
cell2.setCellType(CellType.STRING);
examOption.setContent(cell2.getStringCellValue());
Cell cell2 = row1.getCell(j);
cell2.setCellType(CellType.STRING);
examOption.setContent(cell2.getStringCellValue());
if (examOption != null && StringUtil.isNotBlank(examOption.getContent())) {
examOptions.add(examOption);
if (examOption != null && StringUtil.isNotBlank(examOption.getContent())) {
examOptions.add(examOption);
}
}
}
}
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
}
//多选 多选的默认分存的是最大分
else{
String stringCellValue = row1.getCell(4).getStringCellValue();
String[] strings = stringCellValue.split(",");
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
}
//多选 多选的默认分存的是最大分
else{
String stringCellValue = row1.getCell(4).getStringCellValue();
String[] strings = stringCellValue.split(",");
// String[] strings = new String[stringCellValue.length()];
String max=strings[0];
for (int j=0;j<strings.length;j++) {
if(Float.valueOf(max)<Float.valueOf(strings[j])){
max=strings[j];
}
}
examQuestion.setDefaultScore(Float.valueOf(max));
Cell cell1 = row1.getCell(5, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
examQuestion.setAnswer(row1.getCell(6).getStringCellValue());
List<ExamOption> examOptions = new ArrayList<>();
//A
for (int j=7;j<=13;j++){
if(row1.getCell(j)!=null && StringUtil.isNotBlank(row1.getCell(j).getStringCellValue())){
ExamOption examOption=new ExamOption();
examOption.setOptions(row.getCell(j).getStringCellValue());
examOption.setContent(row1.getCell(j).getStringCellValue());
examOption.setIsAnswer(true);
examOption.setScore(Float.valueOf(strings[j-7]));
if(examOption!=null && StringUtil.isNotBlank(examOption.getContent())){
examOptions.add(examOption);
String max=strings[0];
for (int j=0;j<strings.length;j++) {
if(Float.valueOf(max)<Float.valueOf(strings[j])){
max=strings[j];
}
}
examQuestion.setDefaultScore(Float.valueOf(max));
Cell cell1 = row1.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
examQuestion.setAnswer(row1.getCell(5).getStringCellValue());
List<ExamOption> examOptions = new ArrayList<>();
//A
for (int j=6;j<=12;j++){
if(row1.getCell(j)!=null && StringUtil.isNotBlank(row1.getCell(j).getStringCellValue())){
ExamOption examOption=new ExamOption();
examOption.setOptions(row.getCell(j).getStringCellValue());
examOption.setContent(row1.getCell(j).getStringCellValue());
examOption.setIsAnswer(true);
examOption.setScore(Float.valueOf(strings[j-6]));
if(examOption!=null && StringUtil.isNotBlank(examOption.getContent())){
examOptions.add(examOption);
}
}
}
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
}
}
}else {
row = sheetAt.getRow(2);
for (int i = 3;i<sheetAt.getPhysicalNumberOfRows();i++) {
//获取每一行
Row row1 = sheetAt.getRow(i);
if(row1==null || row1.getCell(0)==null){
break;
}
if(StringUtil.isBlank(row1.getCell(0).getStringCellValue())){
break;
}
ExamQuestion examQuestion = new ExamQuestion();
examQuestion.setTitle(row1.getCell(0).getStringCellValue());
if(row1.getCell(1).getStringCellValue().equals("单选题")){
examQuestion.setType(1);
}
if(row1.getCell(1).getStringCellValue().equals("多选题")){
examQuestion.setType(2);
}
log.debug("row1.getCell(2) = " + row1.getCell(2));
if (row1.getCell(2)==null ||row1.getCell(2).getStringCellValue() == null || row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(null);
}else{
if( row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(2f);
}else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(3f);
} else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(1f);
}else if(row1.getCell(2).getStringCellValue().equals("")){
examQuestion.setDifficulty(null);
}
}
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
Cell cell = row1.getCell(3);
cell.setCellType(CellType.STRING);
// examQuestion.setDefaultScore(Float.valueOf(cell.getStringCellValue()));
//单选
if (!cell.getStringCellValue().contains(",")){
examQuestion.setAnswer(row1.getCell(5).getStringCellValue());
if (row1.getCell(3).getStringCellValue().isEmpty()){
examQuestion.setDefaultScore(null);
}else {
examQuestion.setDefaultScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
Cell cell1 = row1.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
List<ExamOption> examOptions = new ArrayList<>();
for (int j=6;j<=12;j++) {
if(row1.getCell(j)!=null) {
ExamOption examOption = new ExamOption();
// 截取表头
String substring = row.getCell(j).getStringCellValue().substring(3, 4);
if (row1.getCell(5).getStringCellValue().contains(substring)) {
examOption.setIsAnswer(true);
if (row1.getCell(3).getStringCellValue().isEmpty()){
examOption.setScore(null);
}else {
examOption.setScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
} else {
examOption.setIsAnswer(false);
}
if (examOption.getIsAnswer()) {
if (row1.getCell(3).getStringCellValue().isEmpty()){
examOption.setScore(null);
}else {
examOption.setScore(Float.valueOf(row1.getCell(3).getStringCellValue()));
}
}
examOption.setOptions(row.getCell(j).getStringCellValue());
Cell cell2 = row1.getCell(j);
cell2.setCellType(CellType.STRING);
examOption.setContent(cell2.getStringCellValue());
if (examOption != null && StringUtil.isNotBlank(examOption.getContent())) {
examOptions.add(examOption);
}
}
}
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
}
//多选 多选的默认分存的是最大分
else{
String stringCellValue = row1.getCell(4).getStringCellValue();
String[] strings = stringCellValue.split(",");
// String[] strings = new String[stringCellValue.length()];
String max=strings[0];
for (int j=0;j<strings.length;j++) {
if(Float.valueOf(max)<Float.valueOf(strings[j])){
max=strings[j];
}
}
examQuestion.setDefaultScore(Float.valueOf(max));
Cell cell1 = row1.getCell(4, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell1.setCellType(CellType.STRING);
examQuestion.setAnalysis(cell1.getStringCellValue());
examQuestion.setAnswer(row1.getCell(5).getStringCellValue());
List<ExamOption> examOptions = new ArrayList<>();
//A
for (int j=6;j<=13;j++){
if(row1.getCell(j)!=null && StringUtil.isNotBlank(row1.getCell(j).getStringCellValue())){
ExamOption examOption=new ExamOption();
examOption.setOptions(row.getCell(j).getStringCellValue());
examOption.setContent(row1.getCell(j).getStringCellValue());
examOption.setIsAnswer(true);
examOption.setScore(Float.valueOf(strings[j-6]));
if(examOption!=null && StringUtil.isNotBlank(examOption.getContent())){
examOptions.add(examOption);
}
}
}
examQuestion.setOptionList(examOptions);
examQuestions1.add(examQuestion);
}
}
}
//判断题 只存在试题表中
@@ -300,27 +440,30 @@ public class ExamQuestionApi extends ApiBaseController {
ExamQuestion examQuestion1 = new ExamQuestion();
examQuestion1.setTitle(row2.getCell(0).getStringCellValue());
examQuestion1.setType(3);
examQuestion1.setKnowledge(row2.getCell(1).getStringCellValue());
if(row2.getCell(2).getStringCellValue().equals("")){
System.out.println("1+++++++"+row2.getCell(1));
if(row2.getCell(1).getStringCellValue().equals("")){
examQuestion1.setDifficulty(2f);
}
if(row2.getCell(2).getStringCellValue().equals("")){
}else if(row2.getCell(1).getStringCellValue().equals("")){
examQuestion1.setDifficulty(3f);
}
if(row2.getCell(2).getStringCellValue().equals("")){
} else if(row2.getCell(1).getStringCellValue().equals("")){
examQuestion1.setDifficulty(1f);
}else if(row2.getCell(1).getStringCellValue().equals("")){
examQuestion1.setDifficulty(null);
}
Cell cell1 = row2.getCell(3);
Cell cell1 = row2.getCell(2);
cell1.setCellType(CellType.STRING);
examQuestion1.setDefaultScore(Float.valueOf(cell1.getStringCellValue()));
if(row2.getCell(4)!=null) {
examQuestion1.setAnalysis(row2.getCell(4).getStringCellValue());
if (row2.getCell(2).getStringCellValue().isEmpty()){
examQuestion1.setDefaultScore(null);
}else {
examQuestion1.setDefaultScore(Float.valueOf(row2.getCell(2).getStringCellValue()));
}
if(row2.getCell(3)!=null) {
examQuestion1.setAnalysis(row2.getCell(3).getStringCellValue());
}else {
examQuestion1.setAnalysis("");
}
String cvalue=row2.getCell(5).getStringCellValue();
String cvalue=row2.getCell(4).getStringCellValue();
examQuestion1.setAnswer(cvalue.equals("正确")? "true":"false");
if(examQuestion1!=null){
examQuestions2.add(examQuestion1);

View File

@@ -1,7 +1,11 @@
package com.xboe.module.exam.api;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.xboe.api.ThirdApi;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -29,7 +33,8 @@ public class ExamTestApi extends ApiBaseController {
@Resource
private IExamTestService examTestService;
@Resource
ThirdApi thirdApi;
/**
*查询考试,分页,搜索,资源归属,状态
**/
@@ -77,16 +82,33 @@ public class ExamTestApi extends ApiBaseController {
* */
@PostMapping("update")
@AutoLog(module = "考试",action = "修改考试",info = "修改考试")
public JsonResponse<ExamTest> update(@RequestBody ExamTest examTest){
public JsonResponse<ExamTest> update(@RequestBody ExamTest examTest, HttpServletRequest request){
if(StringUtil.isBlank(examTest.getTestName())){
return badRequest("标题为空");
}
// 确保examTest有一个有效的主键ID如果适用
// 这取决于您的业务逻辑是否允许更新主键
// 通常,更新操作不会改变主键
if (examTest.getId() == null) {
return badRequest("更新操作需要有效的主键ID");
}
String token = request.getHeader("Xboe-Access-Token");
if (StringUtils.isEmpty(token)) {
token = request.getHeader("token");
}
try {
examTestService.update(examTest);
thirdApi.sqlUpdate(examTest,token);
return success(examTest);
} catch (ConstraintViolationException e) {
// 捕获约束违反异常,并返回一个更具体的错误消息
log.error("修改失败,违反了约束条件", e);
return error("修改失败,违反了约束条件(可能是主键已存在)");
} catch (Exception e) {
log.error("修改失败",e);
return error("修改失败",e.getMessage());
// 捕获其他所有异常
log.error("修改失败", e);
return error("修改失败", e.getMessage());
}
}
/**、

View File

@@ -28,7 +28,7 @@ public class ExamTest extends BaseEntity {
/**
* 考试名称
* */
@Column(name = "test_name",nullable = false,length = 50)
@Column(name = "test_name",length = 50)
private String testName;
/**
@@ -46,7 +46,7 @@ public class ExamTest extends BaseEntity {
/**
* 考试时长 分钟
* */
@Column(name = "test_duration",nullable = false)
@Column(name = "test_duration")
private Integer testDuration;
/**
* 显示解析
@@ -101,19 +101,19 @@ public class ExamTest extends BaseEntity {
/**
* 试卷的ID
*/
@Column(name = "paper_id",nullable = false,length=20)
@Column(name = "paper_id",length=20)
private String paperId;
/**
* 考试的类型
* */
@Column(name = "test_type",nullable = false)
@Column(name = "test_type")
private Integer testType;
/**
* 发布状态 ,是否已发布
*/
@Column(name = "published",length = 1,nullable = false)
@Column(name = "published",length = 1)
private Boolean published;
/**
* 发布时间
@@ -154,7 +154,7 @@ public class ExamTest extends BaseEntity {
/**
* 范围1表独立使用2表课程内部
* */
@Column(name = "range_type",nullable = false)
@Column(name = "range_type")
private Integer rangeType;
/**
@@ -173,7 +173,7 @@ public class ExamTest extends BaseEntity {
/**启用的,上架*/
@Column(name = "enabled", nullable = false, length = 1)
@Column(name = "enabled", length = 1)
private Boolean enabled;
@Transient

View File

@@ -70,7 +70,18 @@ public class ExamTestServiceImpl implements IExamTestService {
@Override
public void update(ExamTest examTest) {
examTestDao.update(examTest);
if (examTest.getId() == null) {
throw new IllegalArgumentException("ID must not be null");
}
String sql = "update boe_exam_test set arrange = "+ examTest.getArrange() +", deadline_time = '"+examTest.getDeadlineTime() +"' , " +
"entrance_time = '"+examTest.getEntranceTime() +"' , paper_id = "+examTest.getPaperId() +",pass_line = "+examTest.getPassLine() +
", percent_score = "+examTest.getPercentScore() +" ,publish_time = '"+examTest.getPublishTime()+"' , published = "+examTest.getPublished()+
",random_count = "+examTest.getRandomCount()+" ,random_mode = "+examTest.getRandomMode()+",range_type = "+examTest.getRangeType() +
",scoring_type = "+examTest.getScoringType() +",show_analysis="+examTest.getShowAnalysis() +",show_answer = "+examTest.getShowAnswer() +
",test_duration = "+examTest.getTestDuration() +",test_name = '"+examTest.getTestName() +"',test_remark= '"+examTest.getTestRemark() +
"',test_type= "+examTest.getTestType() +" ,test_up = '"+examTest.getTestUp() +"' ,test_front= '"+examTest.getTestFront() +
"',times = '"+examTest.getTimes() +"' where id = "+examTest.getId()+"";
examTestDao.sqlUpdate(sql);
}
@Override
@@ -84,7 +95,7 @@ public class ExamTestServiceImpl implements IExamTestService {
@Override
public Boolean has(String paperId) {
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId));
ExamTest et=examTestDao.findOne(FieldFilters.eq("paperId", paperId),FieldFilters.eq("deleted", false));
//String etId= (String)examTestDao.findField("id", FieldFilters.eq("paperId", paperId));
if(et==null){
return true;

View File

@@ -11,6 +11,7 @@ import com.xboe.api.vo.*;
import com.xboe.module.course.vo.TeacherVo;
import com.xboe.module.usergroup.entity.UserGroupItem;
import com.xboe.module.usergroup.service.IUserGroupService;
import com.xboe.school.study.dao.StudyCourseDao;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -65,7 +66,9 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping(value="/xboe/school/study/course")
public class StudyCourseApi extends ApiBaseController{
@Autowired
IStudyCourseService service;
@@ -321,8 +324,19 @@ public class StudyCourseApi extends ApiBaseController{
if (StringUtils.isEmpty(token)) {
token = request.getHeader("token");
}
//检查是否已存在
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item!=null) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
@@ -407,6 +421,14 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) {
//如果记录存在但是进度不到100未完成情况就更新进度一期不会有这种情况
// 20240815 特训营结营考试 临时代码
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item.getProgress()<100) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
}
@@ -512,6 +534,14 @@ public class StudyCourseApi extends ApiBaseController{
token = request.getHeader("token");
}
try {
// 20240815 特训营结营考试 临时代码
// if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
// redisTemplate.opsForValue().set(itemId,itemId);
// //设置过期时间为1天
// redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
// }else{
// return success(true);
// }
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
log.info("在线课学习记录"+allUserList);
@@ -529,7 +559,7 @@ public class StudyCourseApi extends ApiBaseController{
* @return
*/
@PostMapping("/study-video-time")
public JsonResponse<Boolean> study(String studyId,String itemId,Integer videoTime){
public JsonResponse<Boolean> study(String itemId,Integer videoTime,String contentId , String courseId,Float progressVideo){
if(StringUtils.isBlank(itemId)){
return error("参数错误");
@@ -539,7 +569,10 @@ public class StudyCourseApi extends ApiBaseController{
}
//检查是否已存在
try {
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId());
studyService.updateLastTime(itemId,videoTime, getCurrent().getAccountId());
if (contentId != null && courseId != null && progressVideo != null){
contentService.updateProcessVideo(contentId, courseId, progressVideo);
}
return success(true);
}catch(Exception e) {
log.error("记录最后学习时间错误",e);
@@ -690,9 +723,10 @@ public class StudyCourseApi extends ApiBaseController{
return error("查询失败",e.getMessage());
}
}
@RequestMapping(value="/study-course-content",method = {RequestMethod.GET,RequestMethod.POST})
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId){
public JsonResponse<StudyCourseItem> findStudyCourseItem(String studyId,String contentId, HttpServletRequest request){
if(StringUtils.isBlank(studyId)){
return error("无学习信息");
}

View File

@@ -7,6 +7,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.xboe.api.ThirdApi;
import com.xboe.school.study.dao.StudyCourseDao;
import com.xboe.school.study.entity.StudyCourse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +33,8 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping(value="/xboe/school/study/exam")
public class StudyExamApi extends ApiBaseController{
@Autowired
StudyCourseDao scDao;
@Autowired
IStudyExamService sexamService;

View File

@@ -94,5 +94,5 @@ public interface IStudyService {
* @param status
* @return
*/
PageList<StudyCourseItem> findItemPage(int pageIndex,int pageSize,String contentId,String courseId,String name,Integer status);
PageList<StudyCourseItem> findItemPage(int pageIndex, int pageSize, String contentId, String courseId, String name, Integer status);
}

View File

@@ -6,6 +6,7 @@ import com.xboe.common.OrderCondition;
import com.xboe.common.PageList;
import com.xboe.common.beans.KeyValue;
import com.xboe.school.study.entity.StudyCourse;
import com.xboe.school.study.entity.StudyCourseItem;
import com.xboe.school.study.entity.StudySignup;
/**
@@ -48,6 +49,13 @@ public interface IStudySignupService {
* @param signup
*/
StudyCourse addSignup(StudySignup signup);
/**
* 管理员添加报名课件
* @param signup
*/
StudyCourseItem addStudyCourseItem(StudySignup signup);
/**
* 删除报名,只有未审核过的才可以删除

View File

@@ -44,7 +44,7 @@ public class StudyAssessServiceImpl implements IStudyAssessService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(assess.getStudyId());
sci.setContentId(assess.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("评估");
sci.setCourseId(assess.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成

View File

@@ -82,7 +82,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(exam.getStudyId());
sci.setContentId(exam.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName("考试");
sci.setCourseId(exam.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(prog);//直接设置为学习完成
@@ -112,29 +112,34 @@ public class StudyExamServiceImpl implements IStudyExamService{
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_LAST){
scItemDao.updateFieldById(exam.getStudyItemId(), "score",exam.getScore());
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog);
}
if(prog==100){
scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
if(exam.getScore()>=exam.getPassLine()){
scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",exam.getScore());
//scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
}
}
}
//1最高一次,用于最高一次的计算
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_MAX) {
Float f=(Float)dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId()));
Float f=(Float)dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId()), FieldFilters.eq("courseId", exam.getCourseId()), FieldFilters.eq("studyId", exam.getStudyId()));
scItemDao.updateFieldById(exam.getStudyItemId(), "score", f);
scItemDao.updateFieldById(exam.getStudyItemId(), "status", f>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING);
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",f>=exam.getPassLine()?100:f.intValue());
if(f>=exam.getPassLine()){
scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
scItemDao.updateFieldById(exam.getStudyId(), "score",exam.getScore());
//scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
}
}
}
int totalContent = courseContentDao.getCount(exam.getCourseId());
scDao.finishCheck(exam.getStudyId(),exam.getCourseId(),totalContent,token);
scDao.updateFieldById(exam.getStudyId(), "last_score",exam.getScore());
//执行完毕 清除redis记录
// redisTemplate.delete(key);
return "";

View File

@@ -46,7 +46,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
LocalDateTime ldt=LocalDateTime.now();
sci.setStudyId(homework.getStudyId());
sci.setContentId(homework.getContentId());
//sci.setContentName(homework.getContentName());
sci.setContentName(homework.getHwName());
sci.setCourseId(homework.getCourseId());
//sci.setCsectionId(homework.getCsectionId());
sci.setProgress(100);//直接设置为学习完成
@@ -67,7 +67,7 @@ public class StudyHomeWorkServiceImpl implements IStudyHomeWorkService{
//只是保留一条作业记录,不再保存多条记录了
//dao.save(homework);
//设置id。然后进行悠
homework.setId(obj.toString());
homework.setId(homework.getStudyItemId());
dao.update(homework);
}
}

View File

@@ -1,6 +1,9 @@
package com.xboe.school.study.service.impl;
import java.math.BigInteger;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,7 +11,8 @@ import java.util.Map;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import com.xboe.api.ThirdApi;
import com.xboe.module.article.entity.Article;
import com.xboe.module.interaction.entity.Shares;
import com.xboe.school.study.entity.StudyCourse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -94,8 +98,12 @@ public class StudyServiceImpl implements IStudyService{
//sci.setProgress(100);//直接设置为学习完成
sci.setLastTime(ldt);
scItemDao.saveOrUpdate(sci);
dto.setStudyItemId(sci.getId());
if (sci.getId() != null){
dto.setStudyItemId(sci.getId());
}else {
log.info("学习记录插入失败"+sci.getId());
throw new IllegalArgumentException("学习记录插入失败");
}
//检查是否全部学习完成
scDao.finishCheck(dto.getStudyId(),dto.getCourseId(),dto.getContentTotal(),token);
@@ -163,12 +171,10 @@ public class StudyServiceImpl implements IStudyService{
@Override
public PageList<StudyCourseItem> findItemPage(int pageIndex, int pageSize, String contentId, String courseId,String name,Integer status) {
QueryBuilder query=QueryBuilder.from(StudyCourseItem.class);
QueryBuilder query = QueryBuilder.from(StudyCourseItem.class);
query.setPageIndex(pageIndex);
query.setPageSize(pageSize);
OrderCondition oc=OrderCondition.desc("id");
query.addOrder(oc);
if(StringUtils.isNotBlank(contentId)) {
@@ -177,19 +183,92 @@ public class StudyServiceImpl implements IStudyService{
if(StringUtils.isNotBlank(courseId)) {
query.addFilter(FieldFilters.eq("courseId",courseId));
}
if(status!=null) {
if(status==1) {
query.addFilter(FieldFilters.eq("progress", 0));
}else {
query.addFilter(FieldFilters.eq("progress",100));
}
}
if(StringUtils.isNotBlank(name)) {
query.addFilter(FieldFilters.eq("aname", name));
}
return scItemDao.findPage(query.builder());
int pageIndex2 = (pageIndex-1)*10;
if(status!=null) {
if(status==3) {
query.addFilter(FieldFilters.eq("status", 2));
return scItemDao.findPage(query.builder());
}else if(status==2){
query.addFilter(FieldFilters.eq("status",9));
return scItemDao.findPage(query.builder());
}else if (status == 1) {
String sql = "select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
" select item.study_id from boe_study_course_item item " +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
" ) group by bsc.id limit "+ pageIndex2+","+ pageSize+";";
String sql2 = "select count(*) as total from (select bsc.id,bsc.course_id,bsc.course_name,bsc.aname,item.content_id,0 as progress,1 as status from boe_study_course bsc " +
" left join boe_study_course_item item on bsc.course_id = item.course_id and bsc.id = item.study_id" +
" where bsc.course_id = '"+courseId+"' and bsc.aname like '%"+name+"%' and bsc.id not in(" +
" select item.study_id from boe_study_course_item item " +
" where item.course_id = '" + courseId + "' and item.content_id = '"+ contentId+"' and item.aname like '%"+name+"%' group by item.study_id" +
" ) group by bsc.id) as total";
log.info("资源完成情况未开始sql"+sql);
List<Object[]> list = scDao.sqlFindList(sql);
log.info("资源完成情况人数"+list);
int totalCount = scDao.sqlCount(sql2);
List<StudyCourseItem> item = new ArrayList<>();
for (Object[] objs : list) {
StudyCourseItem sc = new StudyCourseItem();
sc.setProgress(Integer.valueOf(objs[5].toString()));
sc.setStatus(Integer.valueOf(objs[6].toString()));
sc.setAname(objs[3].toString());
item.add(sc);
}
log.info("资源完成情况人员"+item);
PageList<StudyCourseItem> pageList = new PageList<>(item);
pageList.setCount(totalCount);
pageList.setPageSize(pageSize);
pageList.setList(item);
return pageList;
}
}
String sql = "select a.id, a.course_id, a.course_name, a.aname, " +
"IFNULL(b.finish_time, '0') as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
"left join " +
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
"on a.course_id = b.course_id and a.id = b.id " +
"group by a.id limit "+ pageIndex2+","+ pageSize+";";
String sql2 = "select count(*) as total from (select a.id, a.course_id, a.course_name, a.aname, " +
"IFNULL(b.finish_time, 0) as finish_time, IFNULL(b.progress, 0) as progress, IFNULL(b.status, 1) as status " +
"from (select id, course_id, course_name, aname, 0, 1 from boe_study_course where course_id = '" + courseId + "' and aname like '%"+name+"%') a " +
"left join " +
"(select bsc.id, bsc.course_id, bsc.course_name, bsc.aname, item.finish_time, item.progress, item.status " +
"from boe_study_course bsc left join boe_study_course_item item on item.course_id = bsc.course_id and item.study_id = bsc.id " +
"where bsc.course_id = '" + courseId + "' and item.content_id = '" + contentId + "' and item.aname like '%"+name+"%' group by bsc.id) b " +
"on a.course_id = b.course_id and a.id = b.id " +
"group by a.id) as total";
log.info("资源完成情况全部sql"+sql);
List<Object[]> list = scDao.sqlFindList(sql);
log.info("资源完成情况人数"+list);
int totalCount = scDao.sqlCount(sql2);
List<StudyCourseItem> item = new ArrayList<>();
for (Object[] objs : list) {
StudyCourseItem sc = new StudyCourseItem();
if (!"0".equals(objs[4].toString())) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime finishTime = LocalDateTime.parse(objs[4].toString(), formatter);
sc.setFinishTime(finishTime);
}
sc.setProgress(Integer.valueOf(objs[5].toString()));
sc.setStatus(Integer.valueOf(objs[6].toString()));
sc.setAname(objs[3].toString());
item.add(sc);
}
log.info("资源完成情况人员"+item);
PageList<StudyCourseItem> pageList = new PageList<>(item);
pageList.setCount(totalCount);
pageList.setPageSize(pageSize);
pageList.setList(item);
return pageList;
}

View File

@@ -4,9 +4,15 @@ import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Optional;
import javax.transaction.Transactional;
import com.xboe.module.course.dao.CourseContentDao;
import com.xboe.module.course.dto.CourseContentDto;
import com.xboe.module.course.entity.CourseContent;
import com.xboe.school.study.dao.StudyCourseItemDao;
import com.xboe.school.study.entity.StudyCourseItem;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -39,7 +45,13 @@ public class StudySignupServiceImpl implements IStudySignupService{
@Autowired
StudyCourseDao studyCourseDao;
@Autowired
StudyCourseItemDao scItemDao;
@Autowired
CourseContentDao contentDao;
@Autowired(required = false)
ICourseStudySearch esSearch;
@@ -69,7 +81,6 @@ public class StudySignupServiceImpl implements IStudySignupService{
signupDao.save(signup);
//添加到课程学习
LocalDateTime now=LocalDateTime.now();
StudyCourse sc=new StudyCourse();
sc.setAddTime(now);
sc.setAid(signup.getAid());
@@ -124,11 +135,40 @@ public class StudySignupServiceImpl implements IStudySignupService{
//courseDao.updateMultiFieldById(signup.getCourseId(),UpdateBuilder.create("studys", "studys+1",FieldUpdateType.EXPRESSION));
}
@Override
public StudyCourseItem addStudyCourseItem(StudySignup signup) {
String sql = "select id,course_id,content_name from boe_course_content where course_id = '"+signup.getCourseId()+"'";
List<Object[]> courseContents = contentDao.sqlFindList(sql);
if (!courseContents.isEmpty()) {
log.info("查看在线课集合内容数据(共 {} 条记录)", courseContents.size());
for (Object[] objs : courseContents){
log.info("查看在线课内容数据: {}", objs[0].toString());
// 使用toString()或自定义格式化字符串
StudyCourseItem scitem = new StudyCourseItem();
// 设置scitem的属性
scitem.setAname(signup.getName());
scitem.setAid(signup.getAid());
scitem.setCourseId(signup.getCourseId());
scitem.setProgress(0);
scitem.setScore(0f);
scitem.setStatus(1);
scitem.setContentId(objs[0].toString());
scitem.setStudyId(signup.getStudyId());
// 如果需要可以取消注释以下行来设置contentName
// scitem.setContentName(c.getContentName());
scItemDao.save(scitem);
}
} else {
log.info("没有找到在线课内容数据。");
}
return null;
}
@Override
public void addList(List<StudySignup> list) {
//用于管理员添加报名
for(StudySignup ss : list) {
addSignup(ss);
// addStudyCourseItem(ss);
}
}
@@ -136,7 +176,6 @@ public class StudySignupServiceImpl implements IStudySignupService{
public void audit(String id, String aid, String user, boolean pass, String remark) {
if(pass) {
StudySignup signup =signupDao.get(id);
//是否需要检查是否已报名
StudyCourse sc=new StudyCourse();
sc.setAddTime(LocalDateTime.now());

View File

@@ -71,6 +71,7 @@ audience.getOrgUsers=${boe.domain}/userbasic/user/getOrgUsers
infrasApi.dict=${boe.domain}/infrasApi/dict/list
#获取非报名课id
manageApi.stu.offcourse=${boe.domain}/manageApi/stu/offcourse/getOffCourseId
manageApi.editExam=${boe.domain}/manageApi/admin/project/editExam
#获取离职教师id
userBasic.getTeacherIds=${boe.domain}/userbasic/user/getTeacherInfo
coursesuilt.getStudyStatus=${boe.domain}/manageApi/stu/project/completeStatus