Browse Source

处理删除顺序

wn0920
王宁 2 years ago
parent
commit
74e8de8c4a

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

43
     TAppRecord findById(@Param("versionid") Integer versionid);
43
     TAppRecord findById(@Param("versionid") Integer versionid);
44
 
44
 
45
     /**
45
     /**
46
-     * 获取APP文件
46
+     * 获取APP文件
47
      * @Param [versionid]
47
      * @Param [versionid]
48
      * @Author ywx
48
      * @Author ywx
49
      * @Date 2021/10/26 15:58
49
      * @Date 2021/10/26 15:58

+ 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<TRead> listReadPath(Integer readid);
90
+    TRead getReadPath(Integer readid);
91
 
91
 
92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
92
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
93
     /**
93
     /**

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

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

+ 1
- 1
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
-        Integer result = appRecordMapper.deleteByPrimaryKey(versionid);
37
         List<String> resourceUrls = appRecordMapper.listApppath(versionid);//获取APP文件夹
36
         List<String> resourceUrls = appRecordMapper.listApppath(versionid);//获取APP文件夹
37
+        Integer result = appRecordMapper.deleteByPrimaryKey(versionid);
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
         }
40
         }

+ 1
- 1
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
-        Integer result = appStuappMapper.deleteByPrimaryKey(versionid);
38
         List<String> resourceUrls = appStuappMapper.listApppath(versionid);//获取APP文件
37
         List<String> resourceUrls = appStuappMapper.listApppath(versionid);//获取APP文件
38
+        Integer result = appStuappMapper.deleteByPrimaryKey(versionid);
39
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
         if(N_Utils.isListNotEmpty(resourceUrls)){
40
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
41
         }
41
         }

+ 1
- 1
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
-        Integer result = appStuliveMapper.deleteByPrimaryKey(versionid);
37
         List<String> resourceUrls = appStuliveMapper.listApppath(versionid);//获取APP文件
36
         List<String> resourceUrls = appStuliveMapper.listApppath(versionid);//获取APP文件
37
+        Integer result = appStuliveMapper.deleteByPrimaryKey(versionid);
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
         }
40
         }

+ 1
- 1
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
-        Integer result = appTeacherappMapper.deleteByPrimaryKey(versionid);
37
         List<String> resourceUrls = appTeacherappMapper.listApppath(versionid);//获取APP文件夹
36
         List<String> resourceUrls = appTeacherappMapper.listApppath(versionid);//获取APP文件夹
37
+        Integer result = appTeacherappMapper.deleteByPrimaryKey(versionid);
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
         }
40
         }

+ 1
- 1
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
-        Integer result = appTeacherclientMapper.deleteByPrimaryKey(versionid);
37
         List<String> resourceUrls = appTeacherclientMapper.listApppath(versionid);//获取APP文件夹
36
         List<String> resourceUrls = appTeacherclientMapper.listApppath(versionid);//获取APP文件夹
37
+        Integer result = appTeacherclientMapper.deleteByPrimaryKey(versionid);
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
         }
40
         }

+ 1
- 1
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
-        Integer result = appTeacherliveMapper.deleteByPrimaryKey(versionid);
37
         List<String> resourceUrls = appTeacherliveMapper.listApppath(versionid);//获取APP文件夹
36
         List<String> resourceUrls = appTeacherliveMapper.listApppath(versionid);//获取APP文件夹
37
+        Integer result = appTeacherliveMapper.deleteByPrimaryKey(versionid);
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
38
         if(N_Utils.isListNotEmpty(resourceUrls)){
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
39
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
40
         }
40
         }

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

+ 10
- 14
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
+        TRead read = readMapper.getReadPath(readid);//获取电子书文件
102
         Integer result = readMapper.deleteByPrimaryKey(readid);
103
         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
-            }
104
+        List<String> resourceUrls = new ArrayList<>();
105
+        if(read != null && N_Utils.isNotEmpty(read.getReadthumb())){
106
+            resourceUrls.add(read.getReadthumb());
107
+        }
108
+        if(read != null && N_Utils.isNotEmpty(read.getReadpath())){
109
+            resourceUrls.add(read.getReadpath());
110
+        }
111
+        if(N_Utils.isNotEmpty(resourceUrls)){
112
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
117
         }
113
         }
118
         return result;
114
         return result;
119
     }
115
     }

+ 11
- 15
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
+        TResearch research = researchMapper.getResarchpath(researchid);//获取教研文件
147
         Integer result = researchMapper.deleteByPrimaryKey(researchid);
148
         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
-            }
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
+
157
+        if(N_Utils.isListNotEmpty(resourceUrls)){
158
+            messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
163
         }
159
         }
164
         return result;
160
         return result;
165
     }
161
     }

+ 1
- 1
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="listReadPath" resultType="com.xhkjedu.sapi.model.itemtool.TRead">
95
+    <select id="getReadPath" resultType="com.xhkjedu.sapi.model.itemtool.TRead">
96
         SELECT readthumb,readpath FROM t_read WHERE readid=#{readid}
96
         SELECT readthumb,readpath FROM t_read WHERE readid=#{readid}
97
     </select>
97
     </select>
98
 
98
 

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

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
     <!--获取教研文件-->
46
     <!--获取教研文件-->
47
-    <select id="listResarchpath" resultType="com.xhkjedu.sapi.model.research.TResearch">
47
+    <select id="getResarchpath" resultType="com.xhkjedu.sapi.model.research.TResearch">
48
         SELECT researchcover,researchpath FROM t_research WHERE researchid=#{researchid}
48
         SELECT researchcover,researchpath FROM t_research WHERE researchid=#{researchid}
49
     </select>
49
     </select>
50
 </mapper>
50
 </mapper>

+ 1
- 2
sstudy/src/main/java/com/xhkjedu/sstudy/service/paper/PaperService.java View File

269
      * @date 2020/6/9
269
      * @date 2020/6/9
270
      */
270
      */
271
     public Integer delPaper(TPaper paper) {
271
     public Integer delPaper(TPaper paper) {
272
-        Integer result = paperMapper.delPaper(paper.getPaperid());
273
         List<TPaperFile> pfilelist = paperFileService.listObjsByPaperid(paper.getPaperid());//获取作业文件夹
272
         List<TPaperFile> pfilelist = paperFileService.listObjsByPaperid(paper.getPaperid());//获取作业文件夹
273
+        Integer result = paperMapper.delPaper(paper.getPaperid());
274
         if (N_Utils.isListNotEmpty(pfilelist)) {
274
         if (N_Utils.isListNotEmpty(pfilelist)) {
275
             List<String> resourceUrls = new ArrayList<>();
275
             List<String> resourceUrls = new ArrayList<>();
276
             for (int i = 0; i < pfilelist.size(); i++) {
276
             for (int i = 0; i < pfilelist.size(); i++) {
282
             }
282
             }
283
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
283
             messageSender.resourceDel(resourceUrls);//给文件服务器发送mq删除文件
284
         }
284
         }
285
-
286
         return result;
285
         return result;
287
     }
286
     }
288
 
287
 

Loading…
Cancel
Save