Преглед изворни кода

mq删除文件

tags/正式版本
王宁 пре 2 година
родитељ
комит
c5890df90e
30 измењених фајлова са 160 додато и 115 уклоњено
  1. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppRecordMapper.java
  2. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppScanMapper.java
  3. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuappMapper.java
  4. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppStuliveMapper.java
  5. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherappMapper.java
  6. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherclientMapper.java
  7. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherliveMapper.java
  8. 3
    3
      sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppthirdHistoryMapper.java
  9. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/itemtool/ReadMapper.java
  10. 2
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/research/ResearchMapper.java
  11. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppRecordService.java
  12. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppScanService.java
  13. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuappService.java
  14. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuliveService.java
  15. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherappService.java
  16. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherclientService.java
  17. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherliveService.java
  18. 8
    4
      sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppthirdService.java
  19. 61
    43
      sapi/src/main/java/com/xhkjedu/sapi/service/itemtool/ReadService.java
  20. 11
    2
      sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java
  21. 3
    3
      sapi/src/main/resources/mapper/appversion/AppRecordMapper.xml
  22. 3
    3
      sapi/src/main/resources/mapper/appversion/AppScanMapper.xml
  23. 3
    3
      sapi/src/main/resources/mapper/appversion/AppStuappMapper.xml
  24. 3
    3
      sapi/src/main/resources/mapper/appversion/AppStuliveMapper.xml
  25. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherappMapper.xml
  26. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherclientMapper.xml
  27. 3
    3
      sapi/src/main/resources/mapper/appversion/AppTeacherliveMapper.xml
  28. 4
    4
      sapi/src/main/resources/mapper/appversion/AppthirdHistoryMapper.xml
  29. 3
    3
      sapi/src/main/resources/mapper/itemtool/ReadMapper.xml
  30. 3
    3
      sapi/src/main/resources/mapper/research/ResearchMapper.xml

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppRecordMapper.java Прегледај датотеку

@@ -43,11 +43,11 @@ public interface AppRecordMapper extends TkMapper<TAppRecord> {
43 43
     TAppRecord findById(@Param("versionid") Integer versionid);
44 44
 
45 45
     /**
46
-     * 获取APP文件
46
+     * 获取APP文件
47 47
      * @Param [versionid]
48 48
      * @Author ywx
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/AppScanMapper.java Прегледај датотеку

@@ -36,11 +36,11 @@ public interface AppScanMapper extends TkMapper<TAppScan> {
36 36
     TAppScan 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/AppStuappMapper.java Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppTeacherclientMapper.java Прегледај датотеку

@@ -36,11 +36,11 @@ public interface AppTeacherclientMapper extends TkMapper<TAppTeacherclient> {
36 36
     TAppTeacherclient 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/AppTeacherliveMapper.java Прегледај датотеку

@@ -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
 }

+ 3
- 3
sapi/src/main/java/com/xhkjedu/sapi/mapper/appversion/AppthirdHistoryMapper.java Прегледај датотеку

@@ -7,13 +7,13 @@ 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 19
      * 获取APP文件夹
@@ -22,5 +22,5 @@ public interface AppthirdHistoryMapper extends TkMapper<TAppthirdHistory> {
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
 }

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/itemtool/ReadMapper.java Прегледај датотеку

@@ -81,13 +81,13 @@ public interface ReadMapper extends TkMapper<TRead> {
81 81
     Integer updateTaskState(@Param("readstate") int readstate, @Param("readstate2") int readstate2);
82 82
 
83 83
     /**
84
-     * 获取电子书文件
84
+     * 获取电子书文件
85 85
      * @Param [readid]
86 86
      * @Author ywx
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
+    TRead getReadPath(Integer readid);
91 91
 
92 92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
93 93
     /**

+ 2
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/research/ResearchMapper.java Прегледај датотеку

@@ -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
+    TResearch getResarchpath(Integer researchid);
73 73
 }

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppRecordService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppScanService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuappService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppStuliveService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherappService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherclientService.java Прегледај датотеку

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

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppTeacherliveService.java Прегледај датотеку

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

+ 8
- 4
sapi/src/main/java/com/xhkjedu/sapi/service/appversion/AppthirdService.java Прегледај датотеку

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

+ 61
- 43
sapi/src/main/java/com/xhkjedu/sapi/service/itemtool/ReadService.java Прегледај датотеку

@@ -92,16 +92,26 @@ public class ReadService {
92 92
     }
93 93
 
94 94
     /**
95
-     *功能描述  删除
95
+     * 功能描述  删除
96
+     *
97
+     * @param * @param readid
98
+     * @return java.lang.Integer
96 99
      * @author WN
97 100
      * @date 2020/6/9
98
-     * @param  * @param readid
99
-     * @return java.lang.Integer
100 101
      */
101
-    public Integer del(Integer readid){
102
-        List<String> resourceUrls = readMapper.listFolder(readid);//获取电子书文件夹
102
+    public Integer del(Integer readid) {
103 103
         Integer result = readMapper.deleteByPrimaryKey(readid);
104
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
104
+        TRead read = readMapper.getReadPath(readid);//获取电子书文件
105
+        List<String> resourceUrls = new ArrayList<>();
106
+        if (read != null && N_Utils.isNotEmpty(read.getReadthumb())) {
107
+            resourceUrls.add(read.getReadthumb());
108
+        }
109
+        if (read != null && N_Utils.isNotEmpty(read.getReadpath())) {
110
+            resourceUrls.add(read.getReadpath());
111
+        }
112
+        if(N_Utils.isNotEmpty(resourceUrls)){
113
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
114
+        }
105 115
         return result;
106 116
     }
107 117
 
@@ -149,13 +159,14 @@ public class ReadService {
149 159
     }
150 160
 
151 161
     /**
152
-     *功能描述  阅读详情(android)
162
+     * 功能描述  阅读详情(android)
163
+     *
164
+     * @param * @param readid
165
+     * @return com.xhkjedu.model.itemtool.TRead
153 166
      * @author WN
154 167
      * @date 2020/6/17
155
-     * @param  * @param readid
156
-     * @return com.xhkjedu.model.itemtool.TRead
157 168
      */
158
-    public TRead getObjByReandidForAndr(Integer readid){
169
+    public TRead getObjByReandidForAndr(Integer readid) {
159 170
         //修改阅读次数
160 171
         readMapper.updateReadcount(readid);
161 172
 
@@ -163,13 +174,14 @@ public class ReadService {
163 174
     }
164 175
 
165 176
     /**
166
-     *功能描述 阅读历史保存
177
+     * 功能描述 阅读历史保存
178
+     *
179
+     * @param * @param readStudent
180
+     * @return java.lang.Integer
167 181
      * @author WN
168 182
      * @date 2020/6/17
169
-     * @param  * @param readStudent
170
-     * @return java.lang.Integer
171 183
      */
172
-    public Integer saveReadStudent(TReadStudent readStudent){
184
+    public Integer saveReadStudent(TReadStudent readStudent) {
173 185
         //修改阅读次数
174 186
         readMapper.updateReadcount(readStudent.getReadid());
175 187
         readStudent.setReadtime(N_Utils.getSecondTimestamp());
@@ -177,42 +189,44 @@ public class ReadService {
177 189
     }
178 190
 
179 191
     /**
180
-     *功能描述  获取学生阅读历史
192
+     * 功能描述  获取学生阅读历史
193
+     *
194
+     * @param * @param readStudent
195
+     * @return java.util.List<com.xhkjedu.model.itemtool.TReadStudent>
181 196
      * @author WN
182 197
      * @date 2020/6/17
183
-     * @param  * @param readStudent
184
-     * @return java.util.List<com.xhkjedu.model.itemtool.TReadStudent>
185 198
      */
186
-    public List<ReadStudentVo> listReadStudents(TReadStudent readStudent){
199
+    public List<ReadStudentVo> listReadStudents(TReadStudent readStudent) {
187 200
         Integer begintime = readStudent.getBegintime();
188 201
         Integer endtime = 0;
189 202
         if (begintime == 0) {//全部
190 203
             endtime = 0;
191 204
         } else if (begintime == 1) {//5分钟以内
192 205
             begintime = 0;
193
-            endtime = 5*60;
206
+            endtime = 5 * 60;
194 207
         } else if (begintime == 2) {//5~10分钟
195
-            begintime = 5*60;
196
-            endtime = 10*60;
208
+            begintime = 5 * 60;
209
+            endtime = 10 * 60;
197 210
         } else if (begintime == 3) {//10~30分钟
198
-            begintime = 10*60;
199
-            endtime = 30*60;
211
+            begintime = 10 * 60;
212
+            endtime = 30 * 60;
200 213
         } else if (begintime == 4) {//10~1小时
201
-            begintime = 10*60;
202
-            endtime = 60*60;
214
+            begintime = 10 * 60;
215
+            endtime = 60 * 60;
203 216
         } else if (begintime == 5) {//1小时以上
204
-            begintime = 60*60;
217
+            begintime = 60 * 60;
205 218
             endtime = 0;
206 219
         }
207
-        return readMapper.listReadStudents(readStudent.getSchoolid(),readStudent.getReadid(),begintime,endtime);
220
+        return readMapper.listReadStudents(readStudent.getSchoolid(), readStudent.getReadid(), begintime, endtime);
208 221
     }
209 222
 
210 223
     /**
211 224
      * 修改上架状态
225
+     *
226
+     * @return java.lang.Integer
212 227
      * @Param [readid, readstate]
213 228
      * @Author ywx
214 229
      * @Date 2020/6/26 11:50
215
-     * @return java.lang.Integer
216 230
      **/
217 231
     public Integer updateState(Integer readid, Integer readstate) {
218 232
         return readMapper.updateState(readid, readstate);
@@ -220,10 +234,11 @@ public class ReadService {
220 234
 
221 235
     /**
222 236
      * 定时任务修改阅读状态
237
+     *
238
+     * @return java.lang.Integer
223 239
      * @Param [readstate, readstate2]
224 240
      * @Author ywx
225 241
      * @Date 2020/9/1 9:52
226
-     * @return java.lang.Integer
227 242
      **/
228 243
     public Integer updateTaskState(int readstate, int readstate2) {
229 244
         return readMapper.updateTaskState(readstate, readstate2);
@@ -231,10 +246,11 @@ public class ReadService {
231 246
 
232 247
     /**
233 248
      * 获取学校阅读历史
249
+     *
250
+     * @return java.util.List<com.xhkjedu.vo.itemtool.ReadStudentVo>
234 251
      * @Param [readStudent]
235 252
      * @Author ywx
236 253
      * @Date 2021/7/31 17:20
237
-     * @return java.util.List<com.xhkjedu.vo.itemtool.ReadStudentVo>
238 254
      **/
239 255
     public List<ReadStudentVo> listReadSchool(TReadStudent readStudent) {
240 256
         Integer begintime = readStudent.getBegintime();
@@ -243,29 +259,30 @@ public class ReadService {
243 259
             endtime = 0;
244 260
         } else if (begintime == 1) {//5分钟以内
245 261
             begintime = 0;
246
-            endtime = 5*60;
262
+            endtime = 5 * 60;
247 263
         } else if (begintime == 2) {//5~10分钟
248
-            begintime = 5*60;
249
-            endtime = 10*60;
264
+            begintime = 5 * 60;
265
+            endtime = 10 * 60;
250 266
         } else if (begintime == 3) {//10~30分钟
251
-            begintime = 10*60;
252
-            endtime = 30*60;
267
+            begintime = 10 * 60;
268
+            endtime = 30 * 60;
253 269
         } else if (begintime == 4) {//10~1小时
254
-            begintime = 10*60;
255
-            endtime = 60*60;
270
+            begintime = 10 * 60;
271
+            endtime = 60 * 60;
256 272
         } else if (begintime == 5) {//1小时以上
257
-            begintime = 60*60;
273
+            begintime = 60 * 60;
258 274
             endtime = 0;
259 275
         }
260
-        return readMapper.listReadSchool(readStudent.getReadid(),begintime,endtime);
276
+        return readMapper.listReadSchool(readStudent.getReadid(), begintime, endtime);
261 277
     }
262 278
 
263 279
     /**
264
-     *功能描述  电子书学生--网页-列表
280
+     * 功能描述  电子书学生--网页-列表
281
+     *
282
+     * @param * @param read
283
+     * @return java.util.List<com.xhkjedu.sapi.model.itemtool.TRead>
265 284
      * @author WN
266 285
      * @date 2022/2/22
267
-     * @param  * @param read
268
-     * @return java.util.List<com.xhkjedu.sapi.model.itemtool.TRead>
269 286
      */
270 287
     public List<TRead> listReadStuWeb(TRead read) {
271 288
         List<TRead> reads = readMapper.listReadForStuWeb(read);
@@ -275,10 +292,11 @@ public class ReadService {
275 292
 
276 293
     /**
277 294
      * 获取电子书是否可读
295
+     *
296
+     * @return java.lang.Integer
278 297
      * @Param [read]
279 298
      * @Author ywx
280 299
      * @Date 2022/3/14 10:52
281
-     * @return java.lang.Integer
282 300
      **/
283 301
     public Integer getReadable(TRead read) {
284 302
         return readDateService.setRead(read);

+ 11
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/research/ResearchService.java Прегледај датотеку

@@ -144,9 +144,18 @@ 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);//获取教研文件夹
147
+        TResearch research = researchMapper.getResarchpath(researchid);
148 148
         Integer result = researchMapper.deleteByPrimaryKey(researchid);
149
-        messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
149
+        List<String> resourceUrls = new ArrayList<>();
150
+        if(research != null && N_Utils.isNotEmpty(research.getResearchcover())){
151
+            resourceUrls.add(research.getResearchcover());
152
+        }
153
+        if(research != null && N_Utils.isNotEmpty(research.getResearchpath())){
154
+            resourceUrls.add(research.getResearchpath());
155
+        }
156
+        if(N_Utils.isListNotEmpty(resourceUrls)){
157
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
158
+        }
150 159
         return result;
151 160
     }
152 161
 

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppRecordMapper.xml Прегледај датотеку

@@ -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/AppScanMapper.xml Прегледај датотеку

@@ -16,8 +16,8 @@
16 16
         from t_app_scan 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_scan WHERE versionid=#{versionid}
19
+    <!--获取APP文件-->
20
+    <select id="listApppath" resultType="java.lang.String">
21
+        SELECT versionpath FROM t_app_scan WHERE versionid=#{versionid}
22 22
     </select>
23 23
 </mapper>

+ 3
- 3
sapi/src/main/resources/mapper/appversion/AppStuappMapper.xml Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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>

+ 4
- 4
sapi/src/main/resources/mapper/appversion/AppthirdHistoryMapper.xml Прегледај датотеку

@@ -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
-    <!--获取APP文件-->
10
-    <select id="listFolder2" resultType="java.lang.String">
9
+    <!--获取APP文件-->
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>

+ 3
- 3
sapi/src/main/resources/mapper/itemtool/ReadMapper.xml Прегледај датотеку

@@ -91,9 +91,9 @@
91 91
     <update id="updateTaskState">
92 92
         update t_read set readstate=#{readstate} where readstate=#{readstate2}
93 93
     </update>
94
-    <!--获取电子书文件-->
95
-    <select id="listFolder" resultType="java.lang.String">
96
-        SELECT SUBSTRING_INDEX(readpath,'/',5) FROM t_read WHERE readid=#{readid}
94
+    <!--获取电子书文件-->
95
+    <select id="getReadPath" 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 Прегледај датотеку

@@ -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="getResarchpath" resultType="com.xhkjedu.sapi.model.research.TResearch">
48
+        SELECT researchcover,researchpath FROM t_research WHERE researchid=#{researchid}
49 49
     </select>
50 50
 </mapper>

Loading…
Откажи
Сачувај