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,5 +49,5 @@ public interface AppRecordMapper extends TkMapper<TAppRecord> {
49 49
      * @Date 2021/10/26 15:58
50 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,11 +40,11 @@ public interface AppStuappMapper extends TkMapper<TAppStuapp> {
40 40
     List<Map> listNews();
41 41
 
42 42
     /**
43
-     * 获取APP文件
43
+     * 获取APP文件
44 44
      * @Param [versionid]
45 45
      * @Author ywx
46 46
      * @Date 2021/10/26 15:58
47 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,11 +36,11 @@ public interface AppStuliveMapper extends TkMapper<TAppStulive> {
36 36
     TAppStulive findById(@Param("versionid") Integer versionid);
37 37
 
38 38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40 40
      * @Param [versionid]
41 41
      * @Author ywx
42 42
      * @Date 2021/10/26 15:58
43 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,11 +36,11 @@ public interface AppTeacherappMapper extends TkMapper<TAppTeacherapp> {
36 36
     TAppTeacherapp findById(@Param("versionid") Integer versionid);
37 37
 
38 38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40 40
      * @Param [versionid]
41 41
      * @Author ywx
42 42
      * @Date 2021/10/26 15:58
43 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,5 +42,5 @@ public interface AppTeacherclientMapper extends TkMapper<TAppTeacherclient> {
42 42
      * @Date 2021/10/26 15:58
43 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,11 +36,11 @@ public interface AppTeacherliveMapper extends TkMapper<TAppTeacherlive> {
36 36
     TAppTeacherlive findById(@Param("versionid") Integer versionid);
37 37
 
38 38
     /**
39
-     * 获取APP文件
39
+     * 获取APP文件
40 40
      * @Param [versionid]
41 41
      * @Author ywx
42 42
      * @Date 2021/10/26 15:58
43 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,20 +7,20 @@ import java.util.List;
7 7
 
8 8
 public interface AppthirdHistoryMapper extends TkMapper<TAppthirdHistory> {
9 9
     /**
10
-     * 获取APP文件
10
+     * 获取APP文件
11 11
      * @Param [appid]
12 12
      * @Author ywx
13 13
      * @Date 2021/10/26 16:15
14 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 20
      * @Param [apphid]
21 21
      * @Author ywx
22 22
      * @Date 2021/10/26 16:29
23 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,7 +87,7 @@ public interface ReadMapper extends TkMapper<TRead> {
87 87
      * @Date 2021/10/26 16:25
88 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 92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
93 93
     /**

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

@@ -63,11 +63,11 @@ public interface ResearchMapper extends TkMapper<TResearch> {
63 63
     Integer updateResourceMp4code(@Param("research") TResearch research);
64 64
 
65 65
     /**
66
-     * 获取教研文件
66
+     * 获取教研文件
67 67
      * @Param [researchid]
68 68
      * @Author ywx
69 69
      * @Date 2021/10/26 15:41
70 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,9 +33,12 @@ public class AppRecordService {
33 33
 
34 34
     //删除
35 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,9 +34,12 @@ public class AppStuappService {
34 34
 
35 35
     //删除
36 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,9 +33,12 @@ public class AppStuliveService {
33 33
 
34 34
     //删除
35 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,9 +33,12 @@ public class AppTeacherappService {
33 33
 
34 34
     //删除
35 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,9 +33,12 @@ public class AppTeacherclientService {
33 33
 
34 34
     //删除
35 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,9 +33,12 @@ public class AppTeacherliveService {
33 33
 
34 34
     //删除
35 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,10 +46,13 @@ public class AppthirdService {
46 46
     //删除
47 47
     @Transactional(rollbackFor = Exception.class)
48 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 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,9 +150,11 @@ public class AppthirdService {
147 150
      * @return void
148 151
      **/
149 152
     public void deleteByApphId(Integer apphid) {
150
-        List<String> resourceUrls = appthirdHistoryMapper.listFolder2(apphid);//获取APP文件夹
151
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
152 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,9 +99,23 @@ public class ReadService {
99 99
      * @return java.lang.Integer
100 100
      */
101 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,9 +144,24 @@ public class ResearchService {
144 144
      * @date 2020/6/11
145 145
      */
146 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,8 +16,8 @@
16 16
         from t_app_record v left join t_user u on v.createid=u.userid
17 17
         where v.versionid=#{versionid} limit 1
18 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 22
     </select>
23 23
 </mapper>

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

@@ -36,8 +36,8 @@
36 36
         (SELECT 23 apptype,versionname,versioncode,appsize,versionpath apppath,versioncomm
37 37
         FROM t_app_record ORDER BY versioncode DESC LIMIT 1)
38 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 42
     </select>
43 43
 </mapper>

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

@@ -16,8 +16,8 @@
16 16
         from t_app_stulive v left join t_user u on v.createid=u.userid
17 17
         where v.versionid=#{versionid} limit 1
18 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 22
     </select>
23 23
 </mapper>

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

@@ -16,8 +16,8 @@
16 16
         from t_app_teacherapp v left join t_user u on v.createid=u.userid
17 17
         where v.versionid=#{versionid} limit 1
18 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 22
     </select>
23 23
 </mapper>

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

@@ -16,8 +16,8 @@
16 16
         from t_app_teacherclient v left join t_user u on v.createid=u.userid
17 17
         where v.versionid=#{versionid} limit 1
18 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 22
     </select>
23 23
 </mapper>

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

@@ -16,8 +16,8 @@
16 16
         from t_app_teacherlive v left join t_user u on v.createid=u.userid
17 17
         where v.versionid=#{versionid} limit 1
18 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 22
     </select>
23 23
 </mapper>

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

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

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

@@ -92,8 +92,8 @@
92 92
         update t_read set readstate=#{readstate} where readstate=#{readstate2}
93 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 97
     </select>
98 98
 
99 99
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->

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

@@ -43,8 +43,8 @@
43 43
     <update id="updateResourceMp4code">
44 44
         UPDATE t_research SET researchpath=#{research.researchpath},mp4code=#{research.mp4code} WHERE researchid=#{research.researchid}
45 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 49
     </select>
50 50
 </mapper>

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

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

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

@@ -239,8 +239,15 @@ public class GuideService {
239 239
                 resourceMapper.deleteByIdReal(resourceid);
240 240
                 Map resource = resources.get(i);
241 241
                 String resourceurl = resource.get("resourceurl").toString();
242
-                resourceurl = resourceurl.substring(0,resourceurl.lastIndexOf("/"));
243 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,11 +9,7 @@
9 9
 
10 10
     <!-- 根据作业id获取作业附件 -->
11 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 13
         FROM t_paper_file WHERE paperid=#{paperid} ORDER BY fileorder asc
14 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 15
 </mapper>

Loading…
Cancel
Save