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

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

@@ -10,5 +10,5 @@ import java.util.Map;
10 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,9 +36,8 @@ public class BkService {
36 36
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
37 37
      **/
38 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 41
         }else{
43 42
             return new ArrayList<>();
44 43
         }

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

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

Loading…
Cancel
Save