Browse Source

优化备课列表

tags/正式3.14.0
王宁 5 months ago
parent
commit
3cded67256

+ 7
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/controller/bk/BkController.java View File

1
 package com.xhkjedu.sstudy.controller.bk;
1
 package com.xhkjedu.sstudy.controller.bk;
2
 
2
 
3
+import com.github.pagehelper.PageHelper;
3
 import com.github.pagehelper.PageInfo;
4
 import com.github.pagehelper.PageInfo;
4
 import com.xhkjedu.annotation.Action;
5
 import com.xhkjedu.annotation.Action;
6
+import com.xhkjedu.constant.PlatformConstant;
5
 import com.xhkjedu.sstudy.model.bk.TBk;
7
 import com.xhkjedu.sstudy.model.bk.TBk;
6
 import com.xhkjedu.sstudy.service.bk.BkService;
8
 import com.xhkjedu.sstudy.service.bk.BkService;
7
 import com.xhkjedu.utils.N_Utils;
9
 import com.xhkjedu.utils.N_Utils;
14
 import org.springframework.web.bind.annotation.RestController;
16
 import org.springframework.web.bind.annotation.RestController;
15
 
17
 
16
 import javax.annotation.Resource;
18
 import javax.annotation.Resource;
19
+import javax.servlet.http.HttpServletRequest;
17
 import java.util.List;
20
 import java.util.List;
18
 import java.util.Map;
21
 import java.util.Map;
19
 
22
 
36
      * @Return com.xhkjedu.vo.ResultVo
39
      * @Return com.xhkjedu.vo.ResultVo
37
      **/
40
      **/
38
     @PostMapping("list")
41
     @PostMapping("list")
39
-    public ResultVo list(@RequestBody TBk bk) {
42
+    public ResultVo list(@RequestBody TBk bk, HttpServletRequest request) {
43
+        Integer createid = request.getIntHeader(PlatformConstant.XH_USER_ID);
40
         N_Utils.validation(new Object[]{
44
         N_Utils.validation(new Object[]{
41
                 bk.getPage(), "显示页码", 1, bk.getPageSize(), "显示条数", 1,bk.getLsbid(),"教材",2});
45
                 bk.getPage(), "显示页码", 1, bk.getPageSize(), "显示条数", 1,bk.getLsbid(),"教材",2});
46
+        bk.setCreateid(createid);
47
+        PageHelper.startPage(bk.getPage(), bk.getPageSize());
42
         List<Map<String,Object>> list = bkService.listBks(bk);
48
         List<Map<String,Object>> list = bkService.listBks(bk);
43
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
49
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
44
         return new ResultVo(0, "获取列表成功", pageResult);
50
         return new ResultVo(0, "获取列表成功", pageResult);

+ 1
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/bk/TBkMapper.java View File

10
 public interface TBkMapper extends TkMapper<TBk> {
10
 public interface TBkMapper extends TkMapper<TBk> {
11
 
11
 
12
     //我的备课列表
12
     //我的备课列表
13
-    List<Map<String,Object>> listBks(@Param("createid")Integer createid, @Param("bk")TBk bk);
13
+    List<Map<String,Object>> listBks(@Param("bk")TBk bk);
14
 }
14
 }

+ 2
- 3
sstudy/src/main/java/com/xhkjedu/sstudy/service/bk/BkService.java View File

36
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
36
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
37
      **/
37
      **/
38
     public List<Map<String,Object>> listBks(TBk bk){
38
     public List<Map<String,Object>> listBks(TBk bk){
39
-        Integer createid = request.getIntHeader(PlatformConstant.XH_USER_ID);
40
-        if(N_Utils.isTrueInteger(createid)){
41
-            return bkMapper.listBks(createid,bk);
39
+        if(N_Utils.isTrueInteger(bk.getCreateid())){
40
+            return bkMapper.listBks(bk);
42
         }else{
41
         }else{
43
             return new ArrayList<>();
42
             return new ArrayList<>();
44
         }
43
         }

+ 1
- 1
sstudy/src/main/resources/mapper/bk/TBkMapper.xml View File

6
   <select id="listBks" resultType="java.util.Map">
6
   <select id="listBks" resultType="java.util.Map">
7
     select bkid,lsbid,directorid,bktype,asktype,bktitle,duration,papernum,paperscore,votetype,inforsize,inforsuffix,bkjson,
7
     select bkid,lsbid,directorid,bktype,asktype,bktitle,duration,papernum,paperscore,votetype,inforsize,inforsuffix,bkjson,
8
     inforpath,inforpdf,imgpath,updatetime from t_bk
8
     inforpath,inforpdf,imgpath,updatetime from t_bk
9
-    where createid=#{createid}
9
+    where createid=#{bk.createid}
10
     <if test="bk.bktype!=null and bk.bktype!=0">
10
     <if test="bk.bktype!=null and bk.bktype!=0">
11
       and bktype=#{bk.bktype}
11
       and bktype=#{bk.bktype}
12
     </if>
12
     </if>

Loading…
Cancel
Save