Browse Source

删除数据时只取文件地址

wn0920
王宁 2 years ago
parent
commit
c8a0f8d44c
32 changed files with 234 additions and 161 deletions
  1. 1
    1
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppRecordMapper.java
  2. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuappMapper.java
  3. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuliveMapper.java
  4. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherappMapper.java
  5. 1
    1
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherclientMapper.java
  6. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherliveMapper.java
  7. 4
    4
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppthirdHistoryMapper.java
  8. 1
    1
      sapi/src/main/java/com/xhkjedu/sapi/mapper/itemtool/ReadMapper.java
  9. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/research/ResearchMapper.java
  10. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppRecordService.java
  11. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuappService.java
  12. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuliveService.java
  13. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherappService.java
  14. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherclientService.java
  15. 6
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherliveService.java
  16. 10
    5
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppthirdService.java
  17. 17
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/itemtool/ReadService.java
  18. 18
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java
  19. 3
    3
      sapi/src/main/resources/mapper/appversion/AppRecordMapper.xml
  20. 3
    3
      sapi/src/main/resources/mapper/appversion/AppStuappMapper.xml
  21. 3
    3
      sapi/src/main/resources/mapper/appversion/AppStuliveMapper.xml
  22. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherappMapper.xml
  23. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherclientMapper.xml
  24. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherliveMapper.xml
  25. 3
    3
      sapi/src/main/resources/mapper/appversion/AppthirdHistoryMapper.xml
  26. 2
    2
      sapi/src/main/resources/mapper/itemtool/ReadMapper.xml
  27. 3
    3
      sapi/src/main/resources/mapper/research/ResearchMapper.xml
  28. 0
    8
      sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperFileMapper.java
  29. 3
    3
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperFileService.java
  30. 98
    72
      sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java
  31. 8
    1
      sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java
  32. 1
    5
      sstudy/src/main/resources/mapper/paper/PaperFileMapper.xml

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppRecordMapper.java View File

49
      * @Date 2021/10/26 15:58
49
      * @Date 2021/10/26 15:58
50
      * @return java.util.List<java.lang.String>
50
      * @return java.util.List<java.lang.String>
51
      **/
51
      **/
52
-    List<String> listFolder(Integer versionid);
52
+    List<String> listApppath(Integer versionid);
53
 }
53
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuappMapper.java View File

40
     List<Map> listNews();
40
     List<Map> listNews();
41
 
41
 
42
     /**
42
     /**
43
-     * 获取APP文件
43
+     * 获取APP文件
44
      * @Param [versionid]
44
      * @Param [versionid]
45
      * @Author ywx
45
      * @Author ywx
46
      * @Date 2021/10/26 15:58
46
      * @Date 2021/10/26 15:58
47
      * @return java.util.List<java.lang.String>
47
      * @return java.util.List<java.lang.String>
48
      **/
48
      **/
49
-    List<String> listFolder(Integer versionid);
49
+    List<String> listApppath(Integer versionid);
50
 }
50
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuliveMapper.java View File

36
     TAppStulive findById(@Param("versionid") Integer versionid);
36
     TAppStulive findById(@Param("versionid") Integer versionid);
37
 
37
 
38
     /**
38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40
      * @Param [versionid]
40
      * @Param [versionid]
41
      * @Author ywx
41
      * @Author ywx
42
      * @Date 2021/10/26 15:58
42
      * @Date 2021/10/26 15:58
43
      * @return java.util.List<java.lang.String>
43
      * @return java.util.List<java.lang.String>
44
      **/
44
      **/
45
-    List<String> listFolder(Integer versionid);
45
+    List<String> listApppath(Integer versionid);
46
 }
46
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherappMapper.java View File

36
     TAppTeacherapp findById(@Param("versionid") Integer versionid);
36
     TAppTeacherapp findById(@Param("versionid") Integer versionid);
37
 
37
 
38
     /**
38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40
      * @Param [versionid]
40
      * @Param [versionid]
41
      * @Author ywx
41
      * @Author ywx
42
      * @Date 2021/10/26 15:58
42
      * @Date 2021/10/26 15:58
43
      * @return java.util.List<java.lang.String>
43
      * @return java.util.List<java.lang.String>
44
      **/
44
      **/
45
-    List<String> listFolder(Integer versionid);
45
+    List<String> listApppath(Integer versionid);
46
 }
46
 }

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherclientMapper.java View File

42
      * @Date 2021/10/26 15:58
42
      * @Date 2021/10/26 15:58
43
      * @return java.util.List<java.lang.String>
43
      * @return java.util.List<java.lang.String>
44
      **/
44
      **/
45
-    List<String> listFolder(Integer versionid);
45
+    List<String> listApppath(Integer versionid);
46
 }
46
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherliveMapper.java View File

36
     TAppTeacherlive findById(@Param("versionid") Integer versionid);
36
     TAppTeacherlive findById(@Param("versionid") Integer versionid);
37
 
37
 
38
     /**
38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40
      * @Param [versionid]
40
      * @Param [versionid]
41
      * @Author ywx
41
      * @Author ywx
42
      * @Date 2021/10/26 15:58
42
      * @Date 2021/10/26 15:58
43
      * @return java.util.List<java.lang.String>
43
      * @return java.util.List<java.lang.String>
44
      **/
44
      **/
45
-    List<String> listFolder(Integer versionid);
45
+    List<String> listApppath(Integer versionid);
46
 }
46
 }

+ 4
- 4
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppthirdHistoryMapper.java View File

7
 
7
 
8
 public interface AppthirdHistoryMapper extends TkMapper<TAppthirdHistory> {
8
 public interface AppthirdHistoryMapper extends TkMapper<TAppthirdHistory> {
9
     /**
9
     /**
10
-     * 获取APP文件
10
+     * 获取APP文件
11
      * @Param [appid]
11
      * @Param [appid]
12
      * @Author ywx
12
      * @Author ywx
13
      * @Date 2021/10/26 16:15
13
      * @Date 2021/10/26 16:15
14
      * @return java.util.List<java.lang.String>
14
      * @return java.util.List<java.lang.String>
15
      **/
15
      **/
16
-    List<String> listFolder(Integer appid);
16
+    List<String> listApppath(Integer appid);
17
 
17
 
18
     /**
18
     /**
19
-     * 获取APP文件
19
+     * 获取APP文件
20
      * @Param [apphid]
20
      * @Param [apphid]
21
      * @Author ywx
21
      * @Author ywx
22
      * @Date 2021/10/26 16:29
22
      * @Date 2021/10/26 16:29
23
      * @return java.util.List<java.lang.String>
23
      * @return java.util.List<java.lang.String>
24
      **/
24
      **/
25
-    List<String> listFolder2(Integer apphid);
25
+    List<String> listApppath2(Integer apphid);
26
 }
26
 }

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/mapper/itemtool/ReadMapper.java View File

87
      * @Date 2021/10/26 16:25
87
      * @Date 2021/10/26 16:25
88
      * @return java.util.List<java.lang.String>
88
      * @return java.util.List<java.lang.String>
89
      **/
89
      **/
90
-    List<String> listFolder(Integer readid);
90
+    List<TRead> listReadPath(Integer readid);
91
 
91
 
92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
93
     /**
93
     /**

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/research/ResearchMapper.java View File

63
     Integer updateResourceMp4code(@Param("research") TResearch research);
63
     Integer updateResourceMp4code(@Param("research") TResearch research);
64
 
64
 
65
     /**
65
     /**
66
-     * 获取教研文件
66
+     * 获取教研文件
67
      * @Param [researchid]
67
      * @Param [researchid]
68
      * @Author ywx
68
      * @Author ywx
69
      * @Date 2021/10/26 15:41
69
      * @Date 2021/10/26 15:41
70
      * @return java.util.List<java.lang.String>
70
      * @return java.util.List<java.lang.String>
71
      **/
71
      **/
72
-    List<String> listFolder(Integer researchid);
72
+    List<TResearch> listResarchpath(Integer researchid);
73
 }
73
 }

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppRecordService.java View File

33
 
33
 
34
     //删除
34
     //删除
35
     public Integer deleteById(Integer versionid) {
35
     public Integer deleteById(Integer versionid) {
36
-        List<String> resourceUrls = appRecordMapper.listFolder(versionid);//获取APP文件夹
37
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
38
-        return appRecordMapper.deleteByPrimaryKey(versionid);
36
+        Integer result = appRecordMapper.deleteByPrimaryKey(versionid);
37
+        List<String> resourceUrls = appRecordMapper.listApppath(versionid);//获取APP文件夹
38
+        if(N_Utils.isListNotEmpty(resourceUrls)){
39
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
+        }
41
+        return result;
39
     }
42
     }
40
 
43
 
41
     //修改
44
     //修改

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuappService.java View File

34
 
34
 
35
     //删除
35
     //删除
36
     public Integer deleteById(Integer versionid) {
36
     public Integer deleteById(Integer versionid) {
37
-        List<String> resourceUrls = appStuappMapper.listFolder(versionid);//获取APP文件夹
38
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
-        return appStuappMapper.deleteByPrimaryKey(versionid);
37
+        Integer result = appStuappMapper.deleteByPrimaryKey(versionid);
38
+        List<String> resourceUrls = appStuappMapper.listApppath(versionid);//获取APP文件
39
+        if(N_Utils.isListNotEmpty(resourceUrls)){
40
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
41
+        }
42
+        return result;
40
     }
43
     }
41
 
44
 
42
     //修改
45
     //修改

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuliveService.java View File

33
 
33
 
34
     //删除
34
     //删除
35
     public Integer deleteById(Integer versionid) {
35
     public Integer deleteById(Integer versionid) {
36
-        List<String> resourceUrls = appStuliveMapper.listFolder(versionid);//获取APP文件夹
37
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
38
-        return appStuliveMapper.deleteByPrimaryKey(versionid);
36
+        Integer result = appStuliveMapper.deleteByPrimaryKey(versionid);
37
+        List<String> resourceUrls = appStuliveMapper.listApppath(versionid);//获取APP文件
38
+        if(N_Utils.isListNotEmpty(resourceUrls)){
39
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
+        }
41
+        return result;
39
     }
42
     }
40
 
43
 
41
     //修改
44
     //修改

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherappService.java View File

33
 
33
 
34
     //删除
34
     //删除
35
     public Integer deleteById(Integer versionid) {
35
     public Integer deleteById(Integer versionid) {
36
-        List<String> resourceUrls = appTeacherappMapper.listFolder(versionid);//获取APP文件夹
37
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
38
-        return appTeacherappMapper.deleteByPrimaryKey(versionid);
36
+        Integer result = appTeacherappMapper.deleteByPrimaryKey(versionid);
37
+        List<String> resourceUrls = appTeacherappMapper.listApppath(versionid);//获取APP文件夹
38
+        if(N_Utils.isListNotEmpty(resourceUrls)){
39
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
+        }
41
+        return result;
39
     }
42
     }
40
 
43
 
41
     //修改
44
     //修改

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherclientService.java View File

33
 
33
 
34
     //删除
34
     //删除
35
     public Integer deleteById(Integer versionid) {
35
     public Integer deleteById(Integer versionid) {
36
-        List<String> resourceUrls = appTeacherclientMapper.listFolder(versionid);//获取APP文件夹
37
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
38
-        return appTeacherclientMapper.deleteByPrimaryKey(versionid);
36
+        Integer result = appTeacherclientMapper.deleteByPrimaryKey(versionid);
37
+        List<String> resourceUrls = appTeacherclientMapper.listApppath(versionid);//获取APP文件夹
38
+        if(N_Utils.isListNotEmpty(resourceUrls)){
39
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
+        }
41
+        return result;
39
     }
42
     }
40
 
43
 
41
     //修改
44
     //修改

+ 6
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherliveService.java View File

33
 
33
 
34
     //删除
34
     //删除
35
     public Integer deleteById(Integer versionid) {
35
     public Integer deleteById(Integer versionid) {
36
-        List<String> resourceUrls = appTeacherliveMapper.listFolder(versionid);//获取APP文件夹
37
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
38
-        return appTeacherliveMapper.deleteByPrimaryKey(versionid);
36
+        Integer result = appTeacherliveMapper.deleteByPrimaryKey(versionid);
37
+        List<String> resourceUrls = appTeacherliveMapper.listApppath(versionid);//获取APP文件夹
38
+        if(N_Utils.isListNotEmpty(resourceUrls)){
39
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
+        }
41
+        return result;
39
     }
42
     }
40
 
43
 
41
     //修改
44
     //修改

+ 10
- 5
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppthirdService.java View File

46
     //删除
46
     //删除
47
     @Transactional(rollbackFor = Exception.class)
47
     @Transactional(rollbackFor = Exception.class)
48
     public Integer deleteById(Integer appid) {
48
     public Integer deleteById(Integer appid) {
49
-        List<String> resourceUrls = appthirdHistoryMapper.listFolder(appid);//获取APP文件夹
50
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
49
+        Integer result = appthirdMapper.deleteByPrimaryKey(appid);
51
         handleThirdManager(appid, 2);//处理应用白名单
50
         handleThirdManager(appid, 2);//处理应用白名单
52
-        return appthirdMapper.deleteByPrimaryKey(appid);
51
+        List<String> resourceUrls = appthirdHistoryMapper.listApppath(appid);//获取APP文件夹
52
+        if(N_Utils.isListNotEmpty(resourceUrls)){
53
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
54
+        }
55
+        return result;
53
     }
56
     }
54
 
57
 
55
     //修改
58
     //修改
147
      * @return void
150
      * @return void
148
      **/
151
      **/
149
     public void deleteByApphId(Integer apphid) {
152
     public void deleteByApphId(Integer apphid) {
150
-        List<String> resourceUrls = appthirdHistoryMapper.listFolder2(apphid);//获取APP文件夹
151
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
152
         appthirdHistoryMapper.deleteByPrimaryKey(apphid);
153
         appthirdHistoryMapper.deleteByPrimaryKey(apphid);
154
+        List<String> resourceUrls = appthirdHistoryMapper.listApppath2(apphid);//获取APP文件
155
+        if(N_Utils.isListNotEmpty(resourceUrls)){
156
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
157
+        }
153
     }
158
     }
154
 
159
 
155
     /**
160
     /**

+ 17
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/itemtool/ReadService.java View File

99
      * @return java.lang.Integer
99
      * @return java.lang.Integer
100
      */
100
      */
101
     public Integer del(Integer readid){
101
     public Integer del(Integer readid){
102
-        List<String> resourceUrls = readMapper.listFolder(readid);//获取电子书文件夹
103
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
104
-        return readMapper.deleteByPrimaryKey(readid);
102
+        Integer result = readMapper.deleteByPrimaryKey(readid);
103
+        List<TRead> readlist = readMapper.listReadPath(readid);//获取电子书文件
104
+        if(N_Utils.isListNotEmpty(readlist)){
105
+            List<String> resourceUrls = new ArrayList<>();
106
+            for(TRead r : readlist){
107
+                if(N_Utils.isNotEmpty(r.getReadthumb())){
108
+                    resourceUrls.add(r.getReadthumb());
109
+                }
110
+                if(N_Utils.isNotEmpty(r.getReadpath())){
111
+                    resourceUrls.add(r.getReadpath());
112
+                }
113
+            }
114
+            if(N_Utils.isNotEmpty(resourceUrls)){
115
+                messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
116
+            }
117
+        }
118
+        return result;
105
     }
119
     }
106
 
120
 
107
     /**
121
     /**

+ 18
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java View File

144
      * @date 2020/6/11
144
      * @date 2020/6/11
145
      */
145
      */
146
     public Integer del(Integer researchid) {
146
     public Integer del(Integer researchid) {
147
-        List<String> resourceUrls = researchMapper.listFolder(researchid);//获取教研文件夹
148
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
149
-        return researchMapper.deleteByPrimaryKey(researchid);
147
+        Integer result = researchMapper.deleteByPrimaryKey(researchid);
148
+        List<TResearch> relist = researchMapper.listResarchpath(researchid);//获取教研文件
149
+        if(N_Utils.isListNotEmpty(relist)){
150
+            List<String> resourceUrls = new ArrayList<>();
151
+            for(TResearch r : relist){
152
+                if(N_Utils.isNotEmpty(r.getResearchcover())){
153
+                    resourceUrls.add(r.getResearchcover());
154
+                }
155
+                if(N_Utils.isNotEmpty(r.getResearchpath())){
156
+                    resourceUrls.add(r.getResearchpath());
157
+                }
158
+            }
159
+
160
+            if(N_Utils.isListNotEmpty(resourceUrls)){
161
+                messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
162
+            }
163
+        }
164
+        return result;
150
     }
165
     }
151
 
166
 
152
     /**
167
     /**

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppRecordMapper.xml View File

16
         from t_app_record v left join t_user u on v.createid=u.userid
16
         from t_app_record v left join t_user u on v.createid=u.userid
17
         where v.versionid=#{versionid} limit 1
17
         where v.versionid=#{versionid} limit 1
18
     </select>
18
     </select>
19
-    <!--获取APP文件-->
20
-    <select id="listFolder" resultType="java.lang.String">
21
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_record WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_record WHERE versionid=#{versionid}
22
     </select>
22
     </select>
23
 </mapper>
23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppStuappMapper.xml View File

36
         (SELECT 23 apptype,versionname,versioncode,appsize,versionpath apppath,versioncomm
36
         (SELECT 23 apptype,versionname,versioncode,appsize,versionpath apppath,versioncomm
37
         FROM t_app_record ORDER BY versioncode DESC LIMIT 1)
37
         FROM t_app_record ORDER BY versioncode DESC LIMIT 1)
38
     </select>
38
     </select>
39
-    <!--获取APP文件-->
40
-    <select id="listFolder" resultType="java.lang.String">
41
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_stuapp WHERE versionid=#{versionid}
39
+    <!--获取APP文件-->
40
+    <select id="listApppath" resultType="java.lang.String">
41
+        SELECT versionpath FROM t_app_stuapp WHERE versionid=#{versionid}
42
     </select>
42
     </select>
43
 </mapper>
43
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppStuliveMapper.xml View File

16
         from t_app_stulive v left join t_user u on v.createid=u.userid
16
         from t_app_stulive v left join t_user u on v.createid=u.userid
17
         where v.versionid=#{versionid} limit 1
17
         where v.versionid=#{versionid} limit 1
18
     </select>
18
     </select>
19
-    <!--获取APP文件-->
20
-    <select id="listFolder" resultType="java.lang.String">
21
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_stulive WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_stulive WHERE versionid=#{versionid}
22
     </select>
22
     </select>
23
 </mapper>
23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppTeacherappMapper.xml View File

16
         from t_app_teacherapp v left join t_user u on v.createid=u.userid
16
         from t_app_teacherapp v left join t_user u on v.createid=u.userid
17
         where v.versionid=#{versionid} limit 1
17
         where v.versionid=#{versionid} limit 1
18
     </select>
18
     </select>
19
-    <!--获取APP文件-->
20
-    <select id="listFolder" resultType="java.lang.String">
21
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_teacherapp WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_teacherapp WHERE versionid=#{versionid}
22
     </select>
22
     </select>
23
 </mapper>
23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppTeacherclientMapper.xml View File

16
         from t_app_teacherclient v left join t_user u on v.createid=u.userid
16
         from t_app_teacherclient v left join t_user u on v.createid=u.userid
17
         where v.versionid=#{versionid} limit 1
17
         where v.versionid=#{versionid} limit 1
18
     </select>
18
     </select>
19
-    <!--获取APP文件-->
20
-    <select id="listFolder" resultType="java.lang.String">
21
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_teacherclient WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_teacherclient WHERE versionid=#{versionid}
22
     </select>
22
     </select>
23
 </mapper>
23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppTeacherliveMapper.xml View File

16
         from t_app_teacherlive v left join t_user u on v.createid=u.userid
16
         from t_app_teacherlive v left join t_user u on v.createid=u.userid
17
         where v.versionid=#{versionid} limit 1
17
         where v.versionid=#{versionid} limit 1
18
     </select>
18
     </select>
19
-    <!--获取APP文件-->
20
-    <select id="listFolder" resultType="java.lang.String">
21
-        SELECT SUBSTRING_INDEX(versionpath,'/',5) FROM t_app_teacherlive WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_teacherlive WHERE versionid=#{versionid}
22
     </select>
22
     </select>
23
 </mapper>
23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppthirdHistoryMapper.xml View File

1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.xhkjedu.sapi.mapper.appversion.AppthirdHistoryMapper">
3
 <mapper namespace="com.xhkjedu.sapi.mapper.appversion.AppthirdHistoryMapper">
4
-    <!--获取APP文件-->
5
-    <select id="listFolder" resultType="java.lang.String">
4
+    <!--获取APP文件-->
5
+    <select id="listApppath" resultType="java.lang.String">
6
         SELECT apphpath FROM t_appthird_history WHERE appid=#{appid}
6
         SELECT apphpath FROM t_appthird_history WHERE appid=#{appid}
7
         UNION SELECT applogo FROM t_appthird WHERE appid=#{appid}
7
         UNION SELECT applogo FROM t_appthird WHERE appid=#{appid}
8
     </select>
8
     </select>
9
     <!--获取APP文件夹-->
9
     <!--获取APP文件夹-->
10
-    <select id="listFolder2" resultType="java.lang.String">
10
+    <select id="listApppath2" resultType="java.lang.String">
11
         SELECT apphpath FROM t_appthird_history WHERE apphid=#{apphid}
11
         SELECT apphpath FROM t_appthird_history WHERE apphid=#{apphid}
12
     </select>
12
     </select>
13
 </mapper>
13
 </mapper>

+ 2
- 2
sapi/src/main/resources/mapper/itemtool/ReadMapper.xml View File

92
         update t_read set readstate=#{readstate} where readstate=#{readstate2}
92
         update t_read set readstate=#{readstate} where readstate=#{readstate2}
93
     </update>
93
     </update>
94
     <!--获取电子书文件夹-->
94
     <!--获取电子书文件夹-->
95
-    <select id="listFolder" resultType="java.lang.String">
96
-        SELECT SUBSTRING_INDEX(readpath,'/',5) FROM t_read WHERE readid=#{readid}
95
+    <select id="listReadPath" resultType="com.xhkjedu.sapi.model.itemtool.TRead">
96
+        SELECT readthumb,readpath FROM t_read WHERE readid=#{readid}
97
     </select>
97
     </select>
98
 
98
 
99
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
99
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->

+ 3
- 3
sapi/src/main/resources/mapper/research/ResearchMapper.xml View File

43
     <update id="updateResourceMp4code">
43
     <update id="updateResourceMp4code">
44
         UPDATE t_research SET researchpath=#{research.researchpath},mp4code=#{research.mp4code} WHERE researchid=#{research.researchid}
44
         UPDATE t_research SET researchpath=#{research.researchpath},mp4code=#{research.mp4code} WHERE researchid=#{research.researchid}
45
     </update>
45
     </update>
46
-    <!--获取教研文件-->
47
-    <select id="listFolder" resultType="java.lang.String">
48
-        SELECT SUBSTRING_INDEX(researchpath,'/',5) FROM t_research WHERE researchid=#{researchid}
46
+    <!--获取教研文件-->
47
+    <select id="listResarchpath" resultType="com.xhkjedu.sapi.model.research.TResearch">
48
+        SELECT researchcover,researchpath FROM t_research WHERE researchid=#{researchid}
49
     </select>
49
     </select>
50
 </mapper>
50
 </mapper>

+ 0
- 8
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paper/PaperFileMapper.java View File

34
      */
34
      */
35
     List<TPaperFile> listObjsByPaperid(@Param("paperid") Integer paperid);
35
     List<TPaperFile> listObjsByPaperid(@Param("paperid") Integer paperid);
36
 
36
 
37
-    /**
38
-     * 获取作业文件夹
39
-     * @Param [paperid]
40
-     * @Author ywx
41
-     * @Date 2021/10/26 15:29
42
-     * @return java.util.List<java.lang.String>
43
-     **/
44
-    List<String> listFolder(Integer paperid);
45
 }
37
 }

+ 3
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperFileService.java View File

58
      * @Date 2021/10/26 15:30
58
      * @Date 2021/10/26 15:30
59
      * @return java.util.List<java.lang.String>
59
      * @return java.util.List<java.lang.String>
60
      **/
60
      **/
61
-    public List<String> listFolder(Integer paperid) {
62
-        return paperFileMapper.listFolder(paperid);
63
-    }
61
+  /*  public List<String> listFolder(Integer paperid) {
62
+        return paperFileMapper.listObjsByPaperid(paperid);
63
+    }*/
64
 }
64
 }

+ 98
- 72
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

93
 
93
 
94
             //答题卡中试题
94
             //答题卡中试题
95
             List<TPaperScantron> scanlist = new ArrayList<>();
95
             List<TPaperScantron> scanlist = new ArrayList<>();
96
-            qtypes.forEach(t->{
96
+            qtypes.forEach(t -> {
97
                 scanlist.addAll(t.getScantrons());
97
                 scanlist.addAll(t.getScantrons());
98
             });
98
             });
99
             paper.setPapernum(scanlist.size());
99
             paper.setPapernum(scanlist.size());
104
 
104
 
105
             //保存作业关联信息
105
             //保存作业关联信息
106
             List<TPaperFile> lst = paper.getPfiles();
106
             List<TPaperFile> lst = paper.getPfiles();
107
-            if(lst==null || lst.size()==0 || scanlist ==null || scanlist.size()==0){
108
-            }else{
107
+            if (lst == null || lst.size() == 0 || scanlist == null || scanlist.size() == 0) {
108
+            } else {
109
                 //保存作业附件
109
                 //保存作业附件
110
                 savePaperScantronFile(paper);
110
                 savePaperScantronFile(paper);
111
                 //保存答题卡信息
111
                 //保存答题卡信息
112
-                savePaperScantronQtype(paper,qtypes);
112
+                savePaperScantronQtype(paper, qtypes);
113
                 //保存分析
113
                 //保存分析
114
                 //savePaperScantronAnalyze(paperid,paper.getSchoolid());
114
                 //savePaperScantronAnalyze(paperid,paper.getSchoolid());
115
             }
115
             }
116
 
116
 
117
-        }catch (Exception e){
117
+        } catch (Exception e) {
118
             log.error("保存答题卡作业失败:" + e.getMessage());
118
             log.error("保存答题卡作业失败:" + e.getMessage());
119
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
119
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
120
             throw new Exception("保存答题卡作业失败");
120
             throw new Exception("保存答题卡作业失败");
124
     }
124
     }
125
 
125
 
126
     /**
126
     /**
127
-     *功能描述  答题卡作业--修改
128
-     * @author WN
129
-     * @date 2020/6/11
130
-     * @param  * @param paper
127
+     * 功能描述  答题卡作业--修改
128
+     *
129
+     * @param *      @param paper
131
      * @param qtypes
130
      * @param qtypes
132
      * @return boolean
131
      * @return boolean
132
+     * @author WN
133
+     * @date 2020/6/11
133
      */
134
      */
134
     @Transactional(rollbackFor = Exception.class)
135
     @Transactional(rollbackFor = Exception.class)
135
     public boolean updateScantronPaper(TPaper paper, List<TPaperScantronQtype> qtypes) throws Exception {
136
     public boolean updateScantronPaper(TPaper paper, List<TPaperScantronQtype> qtypes) throws Exception {
138
 
139
 
139
             //答题卡中试题
140
             //答题卡中试题
140
             List<TPaperScantron> scanlist = new ArrayList<>();
141
             List<TPaperScantron> scanlist = new ArrayList<>();
141
-            qtypes.forEach(t->{
142
+            qtypes.forEach(t -> {
142
                 scanlist.addAll(t.getScantrons());
143
                 scanlist.addAll(t.getScantrons());
143
             });
144
             });
144
             paper.setPapernum(scanlist.size());
145
             paper.setPapernum(scanlist.size());
167
             }
168
             }
168
 
169
 
169
 
170
 
170
-        }catch (Exception e){
171
+        } catch (Exception e) {
171
             log.error("修改答题卡作业失败:" + e.getMessage());
172
             log.error("修改答题卡作业失败:" + e.getMessage());
172
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
173
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
173
             throw new Exception("修改答题卡作业失败");
174
             throw new Exception("修改答题卡作业失败");
176
     }
177
     }
177
 
178
 
178
 
179
 
179
-
180
     /**
180
     /**
181
      * 保存作业
181
      * 保存作业
182
+     *
183
+     * @return void
182
      * @Param [paper]
184
      * @Param [paper]
183
      * @Author ywx
185
      * @Author ywx
184
      * @Date 2020/6/10 10:29
186
      * @Date 2020/6/10 10:29
185
-     * @return void
186
      **/
187
      **/
187
     private Integer savePaper(TPaper paper) {
188
     private Integer savePaper(TPaper paper) {
188
         paper.setPaperstate(21);//作业状态:21未布置 22 已布置
189
         paper.setPaperstate(21);//作业状态:21未布置 22 已布置
197
     }
198
     }
198
 
199
 
199
     //答题卡--保存作业附件信息
200
     //答题卡--保存作业附件信息
200
-    private void savePaperScantronFile(TPaper paper){
201
+    private void savePaperScantronFile(TPaper paper) {
201
         int fileorder = 1;
202
         int fileorder = 1;
202
         List<TPaperFile> lst = paper.getPfiles();
203
         List<TPaperFile> lst = paper.getPfiles();
203
-        for(TPaperFile pf : lst){
204
+        for (TPaperFile pf : lst) {
204
             pf.setCreateid(paper.getCreateid());
205
             pf.setCreateid(paper.getCreateid());
205
             pf.setCreatetime(N_Utils.getSecondTimestamp());
206
             pf.setCreatetime(N_Utils.getSecondTimestamp());
206
             pf.setSchoolid(paper.getSchoolid());
207
             pf.setSchoolid(paper.getSchoolid());
247
     }
248
     }
248
 
249
 
249
     //保存答题卡分析
250
     //保存答题卡分析
250
-    private Integer savePaperScantronAnalyze(Integer paperid,Integer schoolid){
251
+    private Integer savePaperScantronAnalyze(Integer paperid, Integer schoolid) {
251
         List<Map<String, Object>> list = paperScantronMapper.listQtypeAnalyze(paperid);
252
         List<Map<String, Object>> list = paperScantronMapper.listQtypeAnalyze(paperid);
252
 
253
 
253
         TPaperAnalyze paperAnalyze = new TPaperAnalyze();
254
         TPaperAnalyze paperAnalyze = new TPaperAnalyze();
260
     }
261
     }
261
 
262
 
262
     /**
263
     /**
263
-     *功能描述  删除作业
264
+     * 功能描述  删除作业
265
+     *
266
+     * @param * @param paper
267
+     * @return void
264
      * @author WN
268
      * @author WN
265
      * @date 2020/6/9
269
      * @date 2020/6/9
266
-     * @param  * @param paper
267
-     * @return void
268
      */
270
      */
269
-    public Integer delPaper(TPaper paper){
270
-        List<String> resourceUrls = paperFileService.listFolder(paper.getPaperid());//获取作业文件夹
271
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
271
+    public Integer delPaper(TPaper paper) {
272
+        List<TPaperFile> pfilelist = paperFileService.listObjsByPaperid(paper.getPaperid());//获取作业文件夹
273
+        if (N_Utils.isListNotEmpty(pfilelist)) {
274
+            List<String> resourceUrls = new ArrayList<>();
275
+            for (int i = 0; i < pfilelist.size(); i++) {
276
+                TPaperFile pf = pfilelist.get(i);
277
+                resourceUrls.add(pf.getFilepath());
278
+                if (i == 0) {
279
+                    resourceUrls.add(pf.getSourcepath());
280
+                }
281
+            }
282
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
283
+        }
284
+
272
         return paperMapper.delPaper(paper.getPaperid());
285
         return paperMapper.delPaper(paper.getPaperid());
273
     }
286
     }
274
 
287
 
275
     /**
288
     /**
276
      * 结构性试题作业--保存
289
      * 结构性试题作业--保存
290
+     *
291
+     * @return boolean
277
      * @Param [paper, qtypes]
292
      * @Param [paper, qtypes]
278
      * @Author ywx
293
      * @Author ywx
279
      * @Date 2020/6/10 8:11
294
      * @Date 2020/6/10 8:11
280
-     * @return boolean
281
      **/
295
      **/
282
     @Transactional(rollbackFor = Exception.class)
296
     @Transactional(rollbackFor = Exception.class)
283
     public Integer saveQuestionPaper(TPaper paper, List<TPaperQtype> qtypes) throws Exception {
297
     public Integer saveQuestionPaper(TPaper paper, List<TPaperQtype> qtypes) throws Exception {
288
             paper.setPaperid(paperid);
302
             paper.setPaperid(paperid);
289
             savePaperQtype(paper, qtypes);//保存作业题型信息
303
             savePaperQtype(paper, qtypes);//保存作业题型信息
290
             //generatePaperAnalyze(paperid, paper.getSchoolid());//生成作业分析
304
             //generatePaperAnalyze(paperid, paper.getSchoolid());//生成作业分析
291
-        }catch (Exception e){
305
+        } catch (Exception e) {
292
             log.error("保存结构性试题作业失败:" + e.getMessage());
306
             log.error("保存结构性试题作业失败:" + e.getMessage());
293
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
307
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
294
             throw new Exception("保存结构性试题作业失败");
308
             throw new Exception("保存结构性试题作业失败");
295
-       }
309
+        }
296
         return paperid;
310
         return paperid;
297
     }
311
     }
298
 
312
 
299
     /**
313
     /**
300
      * 设置作业分值和试题数量
314
      * 设置作业分值和试题数量
315
+     *
316
+     * @return void
301
      * @Param [paper, qtypes]
317
      * @Param [paper, qtypes]
302
      * @Author ywx
318
      * @Author ywx
303
      * @Date 2020/6/28 18:05
319
      * @Date 2020/6/28 18:05
304
-     * @return void
305
      **/
320
      **/
306
     private void setPaperScoreAndNum(TPaper paper, List<TPaperQtype> qtypes) {
321
     private void setPaperScoreAndNum(TPaper paper, List<TPaperQtype> qtypes) {
307
         List<QuestionVo> questionList = new ArrayList<>();
322
         List<QuestionVo> questionList = new ArrayList<>();
325
             //paperAnalyzeMapper.deleteByPaperid(paper.getPaperid());//删除分析信息
340
             //paperAnalyzeMapper.deleteByPaperid(paper.getPaperid());//删除分析信息
326
             //generatePaperAnalyze(paper.getPaperid(), paper.getSchoolid());//生成作业分析
341
             //generatePaperAnalyze(paper.getPaperid(), paper.getSchoolid());//生成作业分析
327
             rtn = true;
342
             rtn = true;
328
-        }catch (Exception e){
343
+        } catch (Exception e) {
329
             log.error("保存结构性试题作业失败:" + e.getMessage());
344
             log.error("保存结构性试题作业失败:" + e.getMessage());
330
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
345
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
331
             throw new Exception("保存结构性试题作业失败");
346
             throw new Exception("保存结构性试题作业失败");
335
 
350
 
336
     /**
351
     /**
337
      * 保存作业题型信息
352
      * 保存作业题型信息
353
+     *
354
+     * @return void
338
      * @Param [paper, qtypes]
355
      * @Param [paper, qtypes]
339
      * @Author ywx
356
      * @Author ywx
340
      * @Date 2020/6/28 17:58
357
      * @Date 2020/6/28 17:58
341
-     * @return void
342
      **/
358
      **/
343
     private void savePaperQtype(TPaper paper, List<TPaperQtype> qtypes) {
359
     private void savePaperQtype(TPaper paper, List<TPaperQtype> qtypes) {
344
         Integer paperid = paper.getPaperid();
360
         Integer paperid = paper.getPaperid();
382
 
398
 
383
     /**
399
     /**
384
      * 生成作业分析
400
      * 生成作业分析
401
+     *
402
+     * @return java.lang.Integer
385
      * @Param [paperid, schoolid]
403
      * @Param [paperid, schoolid]
386
      * @Author ywx
404
      * @Author ywx
387
      * @Date 2020/6/10 9:57
405
      * @Date 2020/6/10 9:57
388
-     * @return java.lang.Integer
389
      **/
406
      **/
390
     private Integer generatePaperAnalyze(Integer paperid, Integer schoolid) {
407
     private Integer generatePaperAnalyze(Integer paperid, Integer schoolid) {
391
         //1.题型统计
408
         //1.题型统计
405
     }
422
     }
406
 
423
 
407
     /**
424
     /**
408
-     *功能描述  详情--答题卡
425
+     * 功能描述  详情--答题卡
426
+     *
427
+     * @param * @param paperid
428
+     * @return com.xhkjedu.vo.paper.PaperScantronVo
409
      * @author WN
429
      * @author WN
410
      * @date 2020/6/11
430
      * @date 2020/6/11
411
-     * @param  * @param paperid
412
-     * @return com.xhkjedu.vo.paper.PaperScantronVo
413
      */
431
      */
414
-    public PaperScantronVo getPaperScantronDetial(Integer paperid){
432
+    public PaperScantronVo getPaperScantronDetial(Integer paperid) {
415
         PaperVo paper = paperMapper.findById(paperid);
433
         PaperVo paper = paperMapper.findById(paperid);
416
         PaperScantronVo ps = new PaperScantronVo();
434
         PaperScantronVo ps = new PaperScantronVo();
417
         ps.setPaperid(paperid);
435
         ps.setPaperid(paperid);
439
 
457
 
440
     /**
458
     /**
441
      * 作业详情--结构性试题
459
      * 作业详情--结构性试题
460
+     *
461
+     * @return com.xhkjedu.vo.paper.PaperVo
442
      * @Param [paperid]
462
      * @Param [paperid]
443
      * @Author ywx
463
      * @Author ywx
444
      * @Date 2020/6/10 14:33
464
      * @Date 2020/6/10 14:33
445
-     * @return com.xhkjedu.vo.paper.PaperVo
446
      **/
465
      **/
447
     public PaperVo findById(Integer paperid) {
466
     public PaperVo findById(Integer paperid) {
448
         PaperVo paper = paperMapper.findById(paperid);
467
         PaperVo paper = paperMapper.findById(paperid);
457
                 for (QuestionVo question : questions) {
476
                 for (QuestionVo question : questions) {
458
                     String questionid = question.getQuestionid();
477
                     String questionid = question.getQuestionid();
459
                     List<Map> qsList = students.stream().filter(s -> s.get("questionids").toString().contains(questionid))
478
                     List<Map> qsList = students.stream().filter(s -> s.get("questionids").toString().contains(questionid))
460
-                            .collect(Collectors.toList());
479
+                                               .collect(Collectors.toList());
461
                     Map<Integer, List<Map>> classCollect = qsList.stream().collect(Collectors.groupingBy(m -> (Integer) m.get("classid")
480
                     Map<Integer, List<Map>> classCollect = qsList.stream().collect(Collectors.groupingBy(m -> (Integer) m.get("classid")
462
                             , LinkedHashMap::new, Collectors.toList()));
481
                             , LinkedHashMap::new, Collectors.toList()));
463
                     List<Map> classes = new ArrayList<>();
482
                     List<Map> classes = new ArrayList<>();
480
 
499
 
481
     /**
500
     /**
482
      * 作业列表
501
      * 作业列表
502
+     *
503
+     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
483
      * @Param [paper]
504
      * @Param [paper]
484
      * @Author ywx
505
      * @Author ywx
485
      * @Date 2020/6/11 16:30
506
      * @Date 2020/6/11 16:30
486
-     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
487
      **/
507
      **/
488
     public List<PaperListVo> findAll(PaperSearchVo paper) {
508
     public List<PaperListVo> findAll(PaperSearchVo paper) {
489
-        if(paper.getPsstate()!=null && paper.getPsstate() == 21){
509
+        if (paper.getPsstate() != null && paper.getPsstate() == 21) {
490
             //未布置作业
510
             //未布置作业
491
             return paperMapper.listWfbPapers(paper);
511
             return paperMapper.listWfbPapers(paper);
492
-        }else{
512
+        } else {
493
             //全部作业
513
             //全部作业
494
-            List<PaperListVo>  list = paperMapper.listAll(paper);
514
+            List<PaperListVo> list = paperMapper.listAll(paper);
495
             return getPaperListVo(list);
515
             return getPaperListVo(list);
496
         }
516
         }
497
     }
517
     }
498
 
518
 
499
     /**
519
     /**
500
      * 设置批改方式
520
      * 设置批改方式
521
+     *
522
+     * @return void
501
      * @Param [param]
523
      * @Param [param]
502
      * @Author ywx
524
      * @Author ywx
503
      * @Date 2020/6/12 7:57
525
      * @Date 2020/6/12 7:57
504
-     * @return void
505
      **/
526
      **/
506
     @Transactional(rollbackFor = Exception.class)
527
     @Transactional(rollbackFor = Exception.class)
507
     public void setCheckType(PaperParam param) throws Exception {
528
     public void setCheckType(PaperParam param) throws Exception {
510
 
531
 
511
         try {
532
         try {
512
             paperMapper.updateCheckType(paperid, checktype);//设置批改方式
533
             paperMapper.updateCheckType(paperid, checktype);//设置批改方式
513
-            if (checktype == 1){//教师批阅
534
+            if (checktype == 1) {//教师批阅
514
                 if (N_Utils.isEmptyInteger(param.getTeacherid())) {//不同班级分别指定教师
535
                 if (N_Utils.isEmptyInteger(param.getTeacherid())) {//不同班级分别指定教师
515
                     List<PaperCheckParam> checkParams = JSON.parseArray(param.getClassids(), PaperCheckParam.class);
536
                     List<PaperCheckParam> checkParams = JSON.parseArray(param.getClassids(), PaperCheckParam.class);
516
                     paperStudentMapper.updateCheckId2(paperid, checkParams);
537
                     paperStudentMapper.updateCheckId2(paperid, checkParams);
517
                 } else {//不同班级指定同一个教师
538
                 } else {//不同班级指定同一个教师
518
-                    paperStudentMapper.updateCheckId(paperid,param.getTeacherid());//设置批改人
539
+                    paperStudentMapper.updateCheckId(paperid, param.getTeacherid());//设置批改人
519
                 }
540
                 }
520
             } else {
541
             } else {
521
                 List<PaperCheckParam> checkParams = JSON.parseArray(param.getClassids(), PaperCheckParam.class);
542
                 List<PaperCheckParam> checkParams = JSON.parseArray(param.getClassids(), PaperCheckParam.class);
525
                 for (int i = 0; i < checkParams.size(); i++) {
546
                 for (int i = 0; i < checkParams.size(); i++) {
526
                     PaperCheckParam gs = checkParams.get(i);
547
                     PaperCheckParam gs = checkParams.get(i);
527
                     List<Integer> studentids = classStudents.stream().filter(cs -> cs.getClassid().equals(gs.getClassid()))
548
                     List<Integer> studentids = classStudents.stream().filter(cs -> cs.getClassid().equals(gs.getClassid()))
528
-                            .map(PaperCheckParam::getCheckid).collect(Collectors.toList());
549
+                                                            .map(PaperCheckParam::getCheckid).collect(Collectors.toList());
529
                     gs.setStudentids(studentids);
550
                     gs.setStudentids(studentids);
530
                     if (checktype == 2) {
551
                     if (checktype == 2) {
531
                         //学生互改
552
                         //学生互改
563
             }
584
             }
564
         } catch (Exception e) {
585
         } catch (Exception e) {
565
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
586
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
566
-            log.error("设置批改方式失败:"+e.getMessage());
587
+            log.error("设置批改方式失败:" + e.getMessage());
567
             throw new Exception("设置批改方式失败");
588
             throw new Exception("设置批改方式失败");
568
         }
589
         }
569
     }
590
     }
570
 
591
 
571
     /**
592
     /**
572
      * 设置学生批改人对应关系
593
      * 设置学生批改人对应关系
594
+     *
595
+     * @return java.util.List<com.xhkjedu.model.paperstudent.TPaperStudent>
573
      * @Param [paperid, checkParams, checktype, map]
596
      * @Param [paperid, checkParams, checktype, map]
574
      * @Author ywx
597
      * @Author ywx
575
      * @Date 2020/6/12 9:05
598
      * @Date 2020/6/12 9:05
576
-     * @return java.util.List<com.xhkjedu.model.paperstudent.TPaperStudent>
577
      **/
599
      **/
578
     private List<TPaperStudent> setStudentCheckId(Integer paperid, List<PaperCheckParam> checkParams, Integer checktype, Map<Integer, Integer> map) {
600
     private List<TPaperStudent> setStudentCheckId(Integer paperid, List<PaperCheckParam> checkParams, Integer checktype, Map<Integer, Integer> map) {
579
         List<TPaperStudent> list = new ArrayList<>();
601
         List<TPaperStudent> list = new ArrayList<>();
580
-        for(int i=0;i<checkParams.size();i++){
602
+        for (int i = 0; i < checkParams.size(); i++) {
581
             PaperCheckParam cp = checkParams.get(i);
603
             PaperCheckParam cp = checkParams.get(i);
582
-            for(int j=0;j<cp.getStudentids().size();j++){
604
+            for (int j = 0; j < cp.getStudentids().size(); j++) {
583
                 TPaperStudent ps = new TPaperStudent();
605
                 TPaperStudent ps = new TPaperStudent();
584
                 ps.setPaperid(paperid);
606
                 ps.setPaperid(paperid);
585
                 ps.setClassid(cp.getClassid());
607
                 ps.setClassid(cp.getClassid());
586
                 Integer studentid = cp.getStudentids().get(j);
608
                 Integer studentid = cp.getStudentids().get(j);
587
                 ps.setStudentid(studentid);
609
                 ps.setStudentid(studentid);
588
                 Integer checkid;
610
                 Integer checkid;
589
-                if(checktype==1){
611
+                if (checktype == 1) {
590
                     checkid = cp.getCheckids().get(0);
612
                     checkid = cp.getCheckids().get(0);
591
-                } else if(checktype==2){
613
+                } else if (checktype == 2) {
592
                     checkid = cp.getCheckids().get(j);
614
                     checkid = cp.getCheckids().get(j);
593
-                }else{
615
+                } else {
594
                     //第一种只有一个批改人的
616
                     //第一种只有一个批改人的
595
-                    if(cp.getCheckids().size()==1){
617
+                    if (cp.getCheckids().size() == 1) {
596
                         checkid = cp.getCheckids().get(0);
618
                         checkid = cp.getCheckids().get(0);
597
-                    }else{
619
+                    } else {
598
                         checkid = map.get(studentid);
620
                         checkid = map.get(studentid);
599
                     }
621
                     }
600
                 }
622
                 }
606
     }
628
     }
607
 
629
 
608
     //设置作业批改人(选择指定学生)
630
     //设置作业批改人(选择指定学生)
609
-    private Map<Integer,Integer> setStudentIdCheckerId(PaperCheckParam gs){
610
-        Map<Integer,Integer> map = new HashMap<>();
631
+    private Map<Integer, Integer> setStudentIdCheckerId(PaperCheckParam gs) {
632
+        Map<Integer, Integer> map = new HashMap<>();
611
         //选择学生批改
633
         //选择学生批改
612
         List<Integer> allstudents = new ArrayList<>();//所有有作业的学生
634
         List<Integer> allstudents = new ArrayList<>();//所有有作业的学生
613
         allstudents.addAll(gs.getStudentids());
635
         allstudents.addAll(gs.getStudentids());
614
         //去除选中的是批改人的作业
636
         //去除选中的是批改人的作业
615
-        for(int k=0;k<gs.getCheckids().size();k++){
637
+        for (int k = 0; k < gs.getCheckids().size(); k++) {
616
             allstudents.remove(gs.getCheckids().get(k));//把批改人的作业去除
638
             allstudents.remove(gs.getCheckids().get(k));//把批改人的作业去除
617
         }
639
         }
618
 
640
 
619
         List<List<Integer>> result = N_Utils.averageAssignList(allstudents, gs.getCheckids().size());
641
         List<List<Integer>> result = N_Utils.averageAssignList(allstudents, gs.getCheckids().size());
620
         Collections.shuffle(gs.getCheckids());//重置批改作业人顺序
642
         Collections.shuffle(gs.getCheckids());//重置批改作业人顺序
621
 
643
 
622
-        for(int l=0;l<result.size();l++){
644
+        for (int l = 0; l < result.size(); l++) {
623
             List<Integer> groupstu = new ArrayList<>();
645
             List<Integer> groupstu = new ArrayList<>();
624
             groupstu.addAll(result.get(l));
646
             groupstu.addAll(result.get(l));
625
 
647
 
626
-            if(l==0){
648
+            if (l == 0) {
627
                 //把最有一个用户的作业插入这个集合中(避免数据自己批改自己的作业)
649
                 //把最有一个用户的作业插入这个集合中(避免数据自己批改自己的作业)
628
-                groupstu.add(gs.getCheckids().get(result.size()-1));
629
-            }else{
650
+                groupstu.add(gs.getCheckids().get(result.size() - 1));
651
+            } else {
630
                 //否则把上一个加入到作业集合中(避免数据自己批改自己的作业)
652
                 //否则把上一个加入到作业集合中(避免数据自己批改自己的作业)
631
-                int n = l-1;
653
+                int n = l - 1;
632
                 groupstu.add(gs.getCheckids().get(n));
654
                 groupstu.add(gs.getCheckids().get(n));
633
             }
655
             }
634
-            for(int m=0;m<groupstu.size();m++){
656
+            for (int m = 0; m < groupstu.size(); m++) {
635
                 map.put(groupstu.get(m), gs.getCheckids().get(l));//设置批改人
657
                 map.put(groupstu.get(m), gs.getCheckids().get(l));//设置批改人
636
             }
658
             }
637
         }
659
         }
639
     }
661
     }
640
 
662
 
641
     /**
663
     /**
642
-     *获取批改学生列表
664
+     * 获取批改学生列表
665
+     *
666
+     * @return com.xhkjedu.vo.paper.CheckClassVo
643
      * @Param [paperid, checkid, classid]
667
      * @Param [paperid, checkid, classid]
644
      * @Author ywx
668
      * @Author ywx
645
      * @Date 2020/6/12 11:00
669
      * @Date 2020/6/12 11:00
646
-     * @return com.xhkjedu.vo.paper.CheckClassVo
647
      **/
670
      **/
648
     public CheckClassVo listStudentsByPaperIdCheckId(Integer paperid, Integer checkid, Integer classid) {
671
     public CheckClassVo listStudentsByPaperIdCheckId(Integer paperid, Integer checkid, Integer classid) {
649
         CheckClassVo checkVo = paperMapper.listStudentsByPaperIdCheckId(paperid, checkid, classid);
672
         CheckClassVo checkVo = paperMapper.listStudentsByPaperIdCheckId(paperid, checkid, classid);
650
         Integer ytjnum = checkVo.getYtjnum();
673
         Integer ytjnum = checkVo.getYtjnum();
651
-        checkVo.setWtjnum(checkVo.getClassnum()-ytjnum);
652
-        if (!N_Utils.isEmptyInteger(ytjnum)){
653
-            double scale = N_Utils.getIntegerDivideAndMulitiply(checkVo.getYpynum(),ytjnum);
674
+        checkVo.setWtjnum(checkVo.getClassnum() - ytjnum);
675
+        if (!N_Utils.isEmptyInteger(ytjnum)) {
676
+            double scale = N_Utils.getIntegerDivideAndMulitiply(checkVo.getYpynum(), ytjnum);
654
             checkVo.setScale(scale);
677
             checkVo.setScale(scale);
655
         } else {
678
         } else {
656
             checkVo.setScale(0);
679
             checkVo.setScale(0);
657
         }
680
         }
658
-        if(checkVo.getYpynum() == null){
681
+        if (checkVo.getYpynum() == null) {
659
             checkVo.setYpynum(0);
682
             checkVo.setYpynum(0);
660
         }
683
         }
661
         return checkVo;
684
         return checkVo;
663
 
686
 
664
     /**
687
     /**
665
      * 教师批阅列表
688
      * 教师批阅列表
689
+     *
690
+     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
666
      * @Param [checkid]
691
      * @Param [checkid]
667
      * @Author ywx
692
      * @Author ywx
668
      * @Date 2020/6/18 14:55
693
      * @Date 2020/6/18 14:55
669
-     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
670
      **/
694
      **/
671
     public List<PaperListVo> correctList(Integer checkid) {
695
     public List<PaperListVo> correctList(Integer checkid) {
672
         List<PaperListVo> list = paperMapper.correctList(checkid);
696
         List<PaperListVo> list = paperMapper.correctList(checkid);
675
 
699
 
676
     /**
700
     /**
677
      * 作业列表
701
      * 作业列表
702
+     *
703
+     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
678
      * @Param [list]
704
      * @Param [list]
679
      * @Author ywx
705
      * @Author ywx
680
      * @Date 2020/6/18 15:09
706
      * @Date 2020/6/18 15:09
681
-     * @return java.util.List<com.xhkjedu.vo.paper.PaperListVo>
682
      **/
707
      **/
683
     private List<PaperListVo> getPaperListVo(List<PaperListVo> list) {
708
     private List<PaperListVo> getPaperListVo(List<PaperListVo> list) {
684
         for (PaperListVo p : list) {
709
         for (PaperListVo p : list) {
685
-            if (p.getPaperstate() == 21){//未布置
710
+            if (p.getPaperstate() == 21) {//未布置
686
                 p.setClasses(null);
711
                 p.setClasses(null);
687
             } else {
712
             } else {
688
                 List<PaperClassVo> classes = p.getClasses();
713
                 List<PaperClassVo> classes = p.getClasses();
698
 
723
 
699
     /**
724
     /**
700
      * 作业附件列表
725
      * 作业附件列表
726
+     *
727
+     * @return java.util.List<com.xhkjedu.model.paper.TPaperFile>
701
      * @Param [paperid]
728
      * @Param [paperid]
702
      * @Author ywx
729
      * @Author ywx
703
      * @Date 2020/6/23 21:53
730
      * @Date 2020/6/23 21:53
704
-     * @return java.util.List<com.xhkjedu.model.paper.TPaperFile>
705
      **/
731
      **/
706
     public List<TPaperFile> listPaperFile(Integer paperid, Integer fileclass) {
732
     public List<TPaperFile> listPaperFile(Integer paperid, Integer fileclass) {
707
         return paperMapper.listPaperFile(paperid, fileclass);
733
         return paperMapper.listPaperFile(paperid, fileclass);
715
     //获取今天布置作业数量
741
     //获取今天布置作业数量
716
     public String getPaperNum(String subjectid, Integer createid, Integer createtime) {
742
     public String getPaperNum(String subjectid, Integer createid, Integer createtime) {
717
         Integer num = paperMapper.getPaperNum(subjectid, createid, createtime);
743
         Integer num = paperMapper.getPaperNum(subjectid, createid, createtime);
718
-        String paperNum = "("+ N_Utils.NumberToChn(num)+")";
744
+        String paperNum = "(" + N_Utils.NumberToChn(num) + ")";
719
         return paperNum;
745
         return paperNum;
720
     }
746
     }
721
 
747
 

+ 8
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java View File

239
                 resourceMapper.deleteByIdReal(resourceid);
239
                 resourceMapper.deleteByIdReal(resourceid);
240
                 Map resource = resources.get(i);
240
                 Map resource = resources.get(i);
241
                 String resourceurl = resource.get("resourceurl").toString();
241
                 String resourceurl = resource.get("resourceurl").toString();
242
-                resourceurl = resourceurl.substring(0,resourceurl.lastIndexOf("/"));
243
                 resourceUrls.add(resourceurl);
242
                 resourceUrls.add(resourceurl);
243
+                if(N_Utils.isNotEmpty(resource.get("pdfurl"))){
244
+                    String pdfurl = resource.get("pdfurl").toString();
245
+                    resourceUrls.add(pdfurl);
246
+                }
247
+                if(N_Utils.isNotEmpty(resource.get("resourcecover"))){
248
+                    String resourcecover = resource.get("resourcecover").toString();
249
+                    resourceUrls.add(resourcecover);
250
+                }
244
             }
251
             }
245
         }
252
         }
246
 
253
 

+ 1
- 5
sstudy/src/main/resources/mapper/paper/PaperFileMapper.xml View File

9
 
9
 
10
     <!-- 根据作业id获取作业附件 -->
10
     <!-- 根据作业id获取作业附件 -->
11
     <select id="listObjsByPaperid" resultType="com.xhkjedu.sstudy.model.paper.TPaperFile">
11
     <select id="listObjsByPaperid" resultType="com.xhkjedu.sstudy.model.paper.TPaperFile">
12
-        SELECT pfid,paperid,filepath,fileclass,fileorder,createtime
12
+        SELECT pfid,paperid,filepath,sourcepath,fileclass,fileorder,createtime
13
         FROM t_paper_file WHERE paperid=#{paperid} ORDER BY fileorder asc
13
         FROM t_paper_file WHERE paperid=#{paperid} ORDER BY fileorder asc
14
     </select>
14
     </select>
15
-    <!--获取作业文件夹-->
16
-    <select id="listFolder" resultType="java.lang.String">
17
-        SELECT SUBSTRING_INDEX(sourcepath,'/',5) FROM t_paper_file WHERE paperid=#{paperid} GROUP BY fileclass
18
-    </select>
19
 </mapper>
15
 </mapper>

Loading…
Cancel
Save