瀏覽代碼

原代理商兼容多应用查询需单独处理分页
现修改为单应用查询使用分页

marxjaw 1 月之前
父節點
當前提交
58b603bb5b
共有 28 個文件被更改,包括 112 次插入810 次删除
  1. 4 29
      yt-adage/adage-service/src/main/java/com/ytpm/adage/controller/UserController.java
  2. 4 29
      yt-algebraic/algebraic-service/src/main/java/com/ytpm/algebraic/controller/UserController.java
  3. 4 29
      yt-allusion/allusion-service/src/main/java/com/ytpm/allusion/controller/UserController.java
  4. 4 29
      yt-answer/answer-service/src/main/java/com/ytpm/answer/controller/UserController.java
  5. 4 28
      yt-arena/arena-service/src/main/java/com/ytpm/arena/controller/UserController.java
  6. 4 29
      yt-arithmetic/arithmetic-service/src/main/java/com/ytpm/arithmetic/controller/UserController.java
  7. 4 29
      yt-calculator/calculator-service/src/main/java/com/ytpm/calculator/controller/UserController.java
  8. 4 29
      yt-carp/carp-service/src/main/java/com/ytpm/carp/controller/UserController.java
  9. 4 29
      yt-countstep/countstep-service/src/main/java/com/ytpm/countstep/controller/UserController.java
  10. 4 29
      yt-diary/diary-service/src/main/java/com/ytpm/diary/controller/UserController.java
  11. 4 29
      yt-dtw/dtw-service/src/main/java/com/ytpm/dtw/controller/UserController.java
  12. 4 29
      yt-emoticons/emoticons-service/src/main/java/com/ytpm/emoticons/controller/UserController.java
  13. 4 29
      yt-funarith/funarith-service/src/main/java/com/ytpm/funarith/controller/UserController.java
  14. 4 29
      yt-idiom/idiom-service/src/main/java/com/ytpm/idiom/controller/UserController.java
  15. 4 28
      yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/controller/UserController.java
  16. 4 29
      yt-irun/irun-service/src/main/java/com/ytpm/irun/controller/UserController.java
  17. 4 29
      yt-lemon/lemon-service/src/main/java/com/ytpm/lemon/controller/UserController.java
  18. 4 29
      yt-lime/lime-service/src/main/java/com/ytpm/lime/controller/UserController.java
  19. 4 29
      yt-mileage/mileage-service/src/main/java/com/ytpm/mileage/controller/UserController.java
  20. 4 29
      yt-nofeeds/nofeeds-service/src/main/java/com/ytpm/nofeeds/controller/UserController.java
  21. 4 29
      yt-picking/picking-service/src/main/java/com/ytpm/picking/controller/UserController.java
  22. 4 29
      yt-proverb/proverb-service/src/main/java/com/ytpm/proverb/controller/UserController.java
  23. 4 29
      yt-raisepig/raisepig-service/src/main/java/com/ytpm/raisepig/controller/UserController.java
  24. 4 29
      yt-summary/summary-service/src/main/java/com/ytpm/summary/controller/UserController.java
  25. 4 29
      yt-typing/typing-service/src/main/java/com/ytpm/typing/controller/UserController.java
  26. 4 29
      yt-vitality/vitality-service/src/main/java/com/ytpm/vitality/controller/UserController.java
  27. 4 29
      yt-walk/walk-service/src/main/java/com/ytpm/walk/controller/UserController.java
  28. 4 29
      yt-walking/walking-service/src/main/java/com/ytpm/walking/controller/UserController.java

+ 4 - 29
yt-adage/adage-service/src/main/java/com/ytpm/adage/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.adage.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-algebraic/algebraic-service/src/main/java/com/ytpm/algebraic/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.algebraic.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-allusion/allusion-service/src/main/java/com/ytpm/allusion/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.allusion.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-answer/answer-service/src/main/java/com/ytpm/answer/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.answer.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 28
yt-arena/arena-service/src/main/java/com/ytpm/arena/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.arena.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -73,34 +74,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            result = resultList.stream().limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -108,7 +84,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-arithmetic/arithmetic-service/src/main/java/com/ytpm/arithmetic/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.arithmetic.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-calculator/calculator-service/src/main/java/com/ytpm/calculator/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.calculator.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-carp/carp-service/src/main/java/com/ytpm/carp/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.carp.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-countstep/countstep-service/src/main/java/com/ytpm/countstep/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.countstep.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -88,35 +89,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -124,7 +99,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-diary/diary-service/src/main/java/com/ytpm/diary/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.diary.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-dtw/dtw-service/src/main/java/com/ytpm/dtw/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.dtw.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -87,35 +88,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -123,7 +98,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-emoticons/emoticons-service/src/main/java/com/ytpm/emoticons/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.emoticons.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-funarith/funarith-service/src/main/java/com/ytpm/funarith/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.funarith.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-idiom/idiom-service/src/main/java/com/ytpm/idiom/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.idiom.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 28
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/controller/UserController.java

@@ -2,6 +2,7 @@ package com.ytpm.lemonios.controller;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -66,34 +67,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            result = resultList.stream().limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -101,7 +77,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-irun/irun-service/src/main/java/com/ytpm/irun/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.irun.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-lemon/lemon-service/src/main/java/com/ytpm/lemon/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.lemon.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-lime/lime-service/src/main/java/com/ytpm/lime/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.lime.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-mileage/mileage-service/src/main/java/com/ytpm/mileage/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.mileage.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-nofeeds/nofeeds-service/src/main/java/com/ytpm/nofeeds/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.nofeeds.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-picking/picking-service/src/main/java/com/ytpm/picking/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.picking.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-proverb/proverb-service/src/main/java/com/ytpm/proverb/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.proverb.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -86,35 +87,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -122,7 +97,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-raisepig/raisepig-service/src/main/java/com/ytpm/raisepig/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.raisepig.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-summary/summary-service/src/main/java/com/ytpm/summary/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.summary.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-typing/typing-service/src/main/java/com/ytpm/typing/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.typing.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -72,35 +73,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -108,7 +83,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-vitality/vitality-service/src/main/java/com/ytpm/vitality/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.vitality.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-walk/walk-service/src/main/java/com/ytpm/walk/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.walk.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**

+ 4 - 29
yt-walking/walking-service/src/main/java/com/ytpm/walking/controller/UserController.java

@@ -3,6 +3,7 @@ package com.ytpm.walking.controller;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ytpm.advertise.enums.AdSourceTypeEnum;
 import com.ytpm.agent.enums.UserStatusEnum;
@@ -85,35 +86,9 @@ public class UserController {
     @PostMapping("/queryAll")
     public ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param) {
         //查询主应用
-        List<YtAppUserListView> resultList = new ArrayList<>();
-        List<YtAppUserListView> dyzUserList = appUserMapper.queryAll(param);
-        if (CollUtil.isNotEmpty(dyzUserList)) {
-            resultList.addAll(dyzUserList);
-        }
-        int total = resultList.size()/param.getLimit();
-        long a =  resultList.size() % param.getLimit();
-        if(resultList.size() % param.getLimit() != 0){
-            total++;
-        }
-        int totalSize = resultList.size();
-        //判断最后一页时返回剩余数据
-        List<YtAppUserListView> result;
-        if(param.getPage().compareTo(total)>=0){
-            int skip = (param.getPage() - 1) *param.getLimit();
-            result = resultList.stream().skip(skip).limit(a).collect(Collectors.toList());
-        }else {
-            if(param.getPage()>1){
-                int skip = (param.getPage() - 1) *param.getLimit();
-                result = resultList.stream().skip(skip).limit(param.getLimit()).collect(Collectors.toList());
-            }else{
-                result = resultList.stream().limit(param.getLimit()).collect(Collectors.toList());
-            }
-
-        }
-        dyzUserList.clear();
-        resultList.clear();
+        PageHelper.startPage(param.getPage(), param.getLimit());
+        List<YtAppUserListView> result = appUserMapper.queryAll(param);
         String collect = result.stream().map(YtAppUserListView::getUserId).collect(Collectors.joining(","));
-
         List<YtDyzAdRecord> adRecords = adRecordMapper.getByUserIds(collect);
         List<YtDyzLoginRecord> dyzLogins = loginRecordMapper.getLoginRecordByIds(collect);
         Map<String, List<YtDyzAdRecord>> userAdMap = adRecords.stream().collect(
@@ -121,7 +96,7 @@ public class UserController {
         Map<String, List<YtDyzLoginRecord>> loginMap = dyzLogins.stream().collect(
                 Collectors.groupingBy(YtDyzLoginRecord::getUserId));
         setUserExtInfo(result,userAdMap,loginMap);
-        return ResultTable.resultTableOk(result , (long) totalSize,param.getLimit(),param.getPage(),total);
+        return ResultTable.resultTableOk(new PageInfo<>(result));
     }
 
     /**