Sfoglia il codice sorgente

feat:移动会员看课功能(未完成)

caoliqin 4 giorni fa
parent
commit
cebdf020a8

+ 15 - 4
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -1,6 +1,8 @@
 package com.fs.his.controller;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
@@ -14,6 +16,8 @@ import com.fs.his.vo.FsUserVO;
 import com.fs.his.vo.UserVo;
 import com.fs.store.param.h5.FsUserPageListParam;
 import com.fs.store.vo.h5.FsUserPageListVO;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -190,10 +194,17 @@ public class FsUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('his:user:darkRoomList')")
     @GetMapping("/darkRoomList")
     @ApiOperation("小黑屋")
-    public TableDataInfo darkRoomList(FsUserPageListParam param) {
-        startPage();
-        List<FsUserPageListVO> list = fsUserService.selectFsUserPageList(param);
-        return getDataTable(list);
+    public R darkRoomList(FsUserPageListParam param) {
+//        startPage();
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        PageInfo<FsUserPageListVO> fsUserPageListVOPageInfo = fsUserService.selectFsUserPageList(param);
+        for (FsUserPageListVO fsUserPageListVO : fsUserPageListVOPageInfo.getList()) {
+            fsUserPageListVO.setPhone(ParseUtils.parsePhone(fsUserPageListVO.getPhone()));
+        }
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("rows", fsUserPageListVOPageInfo.getList());
+        map.put("total", fsUserPageListVOPageInfo.getList().size());
+        return R.ok(map);
     }
 
     @PreAuthorize("@ss.hasPermi('his:user:enabledUsers')")

+ 13 - 4
fs-company/src/main/java/com/fs/company/controller/store/FsUserController.java

@@ -3,6 +3,7 @@ package com.fs.company.controller.store;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
@@ -20,12 +21,16 @@ import com.fs.his.vo.FsUserVO;
 import com.fs.his.vo.UserVo;
 import com.fs.store.param.h5.FsUserPageListParam;
 import com.fs.store.vo.h5.FsUserPageListVO;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
 import static com.fs.his.utils.PhoneUtil.encryptPhone;
@@ -226,12 +231,16 @@ public class FsUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('users:user:darkRoomList')")
     @GetMapping("/darkRoomList")
     @ApiOperation("小黑屋")
-    public TableDataInfo darkRoomList(FsUserPageListParam param) {
+    public R darkRoomList(FsUserPageListParam param) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setUserId(loginUser.getUser().getUserId());
-        startPage();
-        List<FsUserPageListVO> list = fsUserService.selectFsUserPageList(param);
-        return getDataTable(list);
+//        startPage();
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        PageInfo<FsUserPageListVO> fsUserPageListVOPageInfo = fsUserService.selectFsUserPageList(param);
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("rows", fsUserPageListVOPageInfo.getList());
+        map.put("total", fsUserPageListVOPageInfo.getList().size());
+        return R.ok(map);
     }
 
     @PreAuthorize("@ss.hasPermi('users:user:enabledUsers')")