Browse Source

删除

tags/正式3.2.0
王宁 2 years ago
parent
commit
ff0cd3159c

+ 0
- 42
sstudy/src/main/java/com/xhkjedu/sstudy/controller/resource/ResourceController.java View File

@@ -86,24 +86,6 @@ public class ResourceController {
86 86
         return new ResultVo(0,"获取列表成功",pageResult);
87 87
     }
88 88
 
89
-    @PostMapping("/share_school")
90
-    public ResultVo shareSchool(@RequestBody TResource tResource) {
91
-        String resourceid = tResource.getResourceid();
92
-        String lsbid = tResource.getLsbid();
93
-        String directorid = tResource.getDirectorid();
94
-        Integer resourcetype = tResource.getResourcetype();
95
-        Integer createid = tResource.getCreateid();
96
-        N_Utils.validation(new Object[]{resourceid,"资源id",2,lsbid,"教材关系表id",2,directorid,"章节id",2
97
-                ,resourcetype,"资源归类",1,createid,"教师id",1});
98
-        tResource.setLevel(1);//资源级别1校本
99
-        String id = resourceService.share(tResource);
100
-        if(id.equals("99")){
101
-            return new ResultVo(0,"该资源已分享过校本");
102
-        }else{
103
-            return new ResultVo(0,"分享成功",id);
104
-        }
105
-    }
106
-
107 89
     @PostMapping("/update_downcount")
108 90
     public ResultVo updateDownCount(@RequestBody TResource tResource) {
109 91
         String resourceid = tResource.getResourceid();
@@ -112,30 +94,6 @@ public class ResourceController {
112 94
         return new ResultVo(0,"更新下载次数成功");
113 95
     }
114 96
 
115
-    @PostMapping("/my_list")
116
-    public ResultVo myList(@RequestBody TResource tResource) {
117
-        Integer page = tResource.getPage();
118
-        Integer pageSize = tResource.getPageSize();
119
-        Integer createid = tResource.getCreateid();
120
-        Integer level = tResource.getLevel();
121
-        N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1,createid,"教师id",1
122
-                ,level,"资源级别",1});
123
-        PageHelper.startPage(page, pageSize);
124
-        List<TResource> list = resourceService.listMyResource(tResource);
125
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo(list));
126
-        return new ResultVo(0,"获取教师备课资源列表成功",pageResult);
127
-    }
128
-
129
-    @PostMapping("/my_list2")
130
-    public ResultVo myList2(@RequestBody TResource tResource) {
131
-        Integer createid = tResource.getCreateid();
132
-        N_Utils.validation(new Object[]{createid,"教师id",1});
133
-        tResource.setLevel(2);
134
-        List<TResource> list = resourceService.listMyResource(tResource);
135
-        return new ResultVo(0,"获取我的备课列表成功",list);
136
-    }
137
-
138
-
139 97
     @PostMapping("/student_video_list")
140 98
     public ResultVo studentVideoList(@RequestBody TResource tResource) {
141 99
         Integer page = tResource.getPage();

+ 2
- 12
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/resource/ResourceMapper.java View File

@@ -4,9 +4,11 @@ import com.xhkjedu.sstudy.base.TkMapper;
4 4
 import com.xhkjedu.sstudy.model.resource.TResource;
5 5
 import com.xhkjedu.sstudy.vo.resource.ResourceVo;
6 6
 import org.apache.ibatis.annotations.Param;
7
+import org.springframework.stereotype.Repository;
7 8
 
8 9
 import java.util.List;
9 10
 
11
+@Repository
10 12
 public interface ResourceMapper extends TkMapper<TResource> {
11 13
     //删除
12 14
     Integer deleteById(@Param("resourceid") String resourceid);
@@ -23,9 +25,6 @@ public interface ResourceMapper extends TkMapper<TResource> {
23 25
     //更新下载次数
24 26
     void updateDownCount(@Param("resourceid") String resourceid);
25 27
 
26
-    //判断资源是否已经分享到校本
27
-    Integer getLevelResourceForxb(@Param("resource") TResource resource);
28
-
29 28
     //学生同步视频资源列表
30 29
     List<TResource> studentVideoList(@Param("resource") TResource resource);
31 30
 
@@ -38,15 +37,6 @@ public interface ResourceMapper extends TkMapper<TResource> {
38 37
      **/
39 38
     Integer updateReadCount(String resourceid);
40 39
 
41
-    /**
42
-     * 教师备课、预习导学资源列表
43
-     * @Param [resource]
44
-     * @Author ywx
45
-     * @Date 2020/7/9 11:44
46
-     * @return java.util.List<com.xhkjedu.model.resource.TResource>
47
-     **/
48
-    List<TResource> listMyResource(@Param("resource") TResource resource);
49
-
50 40
     /**
51 41
      * 获取资源分享到预习导学的资源id
52 42
      * @Param [resourceid, createid]

+ 0
- 63
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/ResourceService.java View File

@@ -142,58 +142,6 @@ public class ResourceService {
142 142
         return resourceMapper.findAll(tResource);
143 143
     }
144 144
 
145
-    //分享
146
-    public String share(TResource model) {
147
-        String resourceid = model.getResourceid();
148
-
149
-        //判断该资源是否已经分享过该章节,如果已经分享过直接返回
150
-        Integer count = resourceMapper.getLevelResourceForxb(model);
151
-        if(count>0){
152
-            return "99";
153
-        }else{
154
-            return saveShare(model, resourceid);
155
-        }
156
-    }
157
-
158
-    /**
159
-     * 分享资源保存
160
-     * @Param [model, resourceid]
161
-     * @Author ywx
162
-     * @Date 2020/7/1 10:18
163
-     * @return java.lang.Integer
164
-     **/
165
-    private String saveShare(TResource model, String resourceid) {
166
-        if (N_Utils.isNotEmpty(resourceid)) {
167
-            ResourceVo r = findById(resourceid);
168
-            model.setResourcename(r.getResourcename());
169
-            model.setResourceclass(r.getResourceclass());
170
-            model.setResourceurl(r.getResourceurl());
171
-            model.setSuffix(r.getSuffix());
172
-            model.setResourcesize(r.getResourcesize());
173
-            model.setResourcecover(r.getResourcecover());
174
-            model.setConverted(r.getConverted());
175
-            model.setPdfurl(r.getPdfurl());
176
-            model.setComm(r.getComm());
177
-            model.setDuration(r.getDuration());
178
-            model.setMp4code(r.getMp4code());
179
-            if(model.getLevel()==1){
180
-                model.setBelong(3);
181
-            }else{
182
-                model.setBelong(r.getBelong());
183
-            }
184
-
185
-            if (model.getResourcetype() == null) {
186
-                model.setResourcetype(r.getResourcetype());
187
-            }
188
-
189
-            if(r.getResourceclass()==7 && N_Utils.isNotEmpty(r.getPdfurl())){
190
-                //压缩包,用costtime替代分享时的压缩包,设置为7
191
-                model.setCosttime(7);
192
-            }
193
-        }
194
-        return save(model);
195
-    }
196
-
197 145
     //更新下载次数
198 146
     public void updateDownCount(String resourceid) {
199 147
         resourceMapper.updateDownCount(resourceid);
@@ -215,17 +163,6 @@ public class ResourceService {
215 163
         return resourceMapper.updateReadCount(resourceid);
216 164
     }
217 165
 
218
-    /**
219
-     * 教师备课、预习导学资源列表
220
-     * @Param [resource]
221
-     * @Author ywx
222
-     * @Date 2020/7/9 11:45
223
-     * @return java.util.List<com.xhkjedu.model.resource.TResource>
224
-     **/
225
-    public List<TResource> listMyResource(TResource resource) {
226
-        return resourceMapper.listMyResource(resource);
227
-    }
228
-
229 166
     /**
230 167
      * 资源收藏
231 168
      * @Param [collect]

+ 2
- 44
sstudy/src/main/resources/mapper/resource/ResourceMapper.xml View File

@@ -9,7 +9,7 @@
9 9
         delete from t_resource where resourceid=#{resourceid}
10 10
     </delete>
11 11
     <!--列表-->
12
-    <select id="findAll" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
12
+    <select id="findAll" resultType="com.xhkjedu.sstudy.model.resource.TResource">
13 13
         select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname,r.resourceurl,rd.lsbid,
14 14
         rd.directorid,r.resourceclass,r.resourcetype,r.readcount,r.downcount,r.pdfurl,r.converted,r.resourcecover
15 15
         ,r.comm,r.duration,r.resourcesize,r.mp4code,r.createid,r.belong
@@ -79,40 +79,6 @@
79 79
         </choose>
80 80
         ,r.resourcename asc,r.resourceid asc
81 81
     </select>
82
-    <!--教师备课、预习导学资源列表-->
83
-    <!--2020.11.16 教师备课只获取自己上传到个人空间文件,不获取收藏的文件-->
84
-    <select id="listMyResource" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
85
-        select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname,r.resourceurl,rd.lsbid,
86
-        rd.directorid,r.resourceclass,r.resourcetype,r.readcount,r.downcount,r.pdfurl,r.converted,r.resourcecover
87
-        ,r.comm,r.duration,r.resourcesize,r.mp4code
88
-        from t_resource r left join t_user u on u.userid=r.createid
89
-        left join t_resource_director rd on r.resourceid=rd.resourceid
90
-       <!-- <if test="resource.level==2">
91
-            left join t_resource_collect rc on r.resourceid = rc.resourceid
92
-        </if>-->
93
-        where r.resourcestate=1 and r.level=#{resource.level} and r.createid=#{resource.createid}
94
-       <!-- and ((r.level=#{resource.level} and r.resourcetype=0 and r.createid=#{resource.createid})
95
-        <if test="resource.level==2">
96
-            or rc.userid=#{resource.createid}
97
-        </if>
98
-        )-->
99
-        <if test="resource.resourcename!=null and resource.resourcename!=''">
100
-            and r.resourcename like '%${resource.resourcename}%'
101
-        </if>
102
-        <if test="resource.resourceclass!=null and resource.resourceclass!=0">
103
-            and r.resourceclass=#{resource.resourceclass}
104
-        </if>
105
-        <if test="resource.subjectid!=null and resource.subjectid!='0'.toString() and resource.subjectid!=''">
106
-            and r.subjectid=#{resource.subjectid}
107
-        </if>
108
-        <if test="resource.lsbid!=null and resource.lsbid!='0'.toString() and resource.lsbid!=''">
109
-            and rd.lsbid=#{resource.lsbid}
110
-        </if>
111
-        <if test="resource.directorid!=null and resource.directorid!='0'.toString() and resource.directorid!=''">
112
-            and rd.directorid=#{resource.directorid}
113
-        </if>
114
-        order by r.createtime desc,r.resourcename asc,r.resourceid asc
115
-    </select>
116 82
     <!--详情-->
117 83
     <resultMap id="resourceResult" type="com.xhkjedu.sstudy.vo.resource.ResourceVo">
118 84
         <result property="resourceid" column="resourceid"></result>
@@ -196,14 +162,6 @@
196 162
         group by r.resourceid order by r.createtime desc,r.resourcename asc,r.resourceid asc limit #{resource.page},#{resource.pageSize}
197 163
     </select>
198 164
 
199
-    <!-- 获取资源是否已经分享到校本 -->
200
-    <select id="getLevelResourceForxb" resultType="java.lang.Integer">
201
-        SELECT COUNT(*) FROM t_resource r left join t_resource_director rd on r.resourceid=rd.resourceid
202
-        LEFT JOIN t_resource r2 ON r.resourceurl=r2.resourceurl
203
-        left join t_resource_director rd2 on r2.resourceid=rd2.resourceid and rd.lsbid=rd2.lsbid
204
-        WHERE r2.resourceid=#{resource.resourceid} AND r.level=1 AND rd.directorid=#{resource.directorid} and r.resourcestate=1
205
-        AND (r.belong IN(1,2) OR r.schoolid=#{resource.schoolid})
206
-    </select>
207 165
     <!--更新阅读次数-->
208 166
     <update id="updateReadCount">
209 167
         update t_resource set readcount=readcount+1 where resourceid=#{resourceid}
@@ -220,7 +178,7 @@
220 178
 
221 179
     <!--//////////////////////////////////////////////学生WEB端//////////////////////////////////////////////-->
222 180
     <!--学生同步视频资源列表-->
223
-    <select id="studentVideoWebList" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
181
+    <select id="studentVideoWebList" resultType="com.xhkjedu.sstudy.model.resource.TResource">
224 182
         select r.resourceid,r.resourcename,r.createtime,r.suffix,u.username createname
225 183
         ,r.readcount,r.comm,r.resourceurl,r.resourcecover,r.duration,r.resourcesize,r.mp4code
226 184
         ,r.resourcegrade,r.source,r.year,r.region,r.schoolname,r.converted

Loading…
Cancel
Save