Browse Source

优化接口

zhouxianguang 6 years ago
parent
commit
21d7b9a43c

+ 33 - 2
rankin-cms-web/src/main/java/cn/rankin/cmsweb/controller/stmt/StmtStatsController.java

@@ -10,6 +10,7 @@ import cn.rankin.common.utils.util.BeanUtil;
 import cn.rankin.data.api.user.dto.CampusSearchDTO;
 import cn.rankin.data.api.user.dto.TerminalUserSearchDTO;
 import cn.rankin.data.api.user.vo.CampusVo;
+import cn.rankin.data.api.user.vo.TerminalUserAuthVo;
 import cn.rankin.data.api.user.vo.TerminalUserVo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,7 +32,8 @@ public class StmtStatsController
 
     /**
      * 获取终端明细
-     * @param user the user details
+     *
+     * @param user      the user details
      * @param searchDTO the search Dto
      * @return
      */
@@ -50,7 +52,8 @@ public class StmtStatsController
 
     /**
      * 获取校区总数
-     * @param user the user details
+     *
+     * @param user            the user details
      * @param campusSearchDTO the search Dto
      * @return
      */
@@ -66,4 +69,32 @@ public class StmtStatsController
 
         return APIResult.ok(pageData.getData().getTotalSize());
     }
+
+    /**
+     * 获取终端用户数
+     *
+     * @param user the user details
+     * @param dto  the search Dto
+     * @return
+     */
+    @RequestMapping(value = {"/terminal/user/totalsize", "/"}, method = RequestMethod.GET)
+    public APIResult<Page<TerminalUserAuthVo>> getTerminalTotalSize(@NeedUser UserDetails user, TerminalUserSearchDTO dto)
+    {
+        if (!user.isPlatForm())
+        {
+            String merchantId = user.getMerchantId();
+            dto.setMerchantId(merchantId);
+        }
+
+        Page<TerminalUserAuthVo> pageData = terminalUserService.findAuthList(BeanUtil.convertToMap(dto));
+
+        if (pageData != null)
+        {
+            return APIResult.ok(pageData.getTotalSize());
+        }
+        else
+        {
+            return APIResult.ok(0);
+        }
+    }
 }

+ 1 - 0
rankin-cms-web/src/main/java/cn/rankin/cmsweb/controller/stmt/StmtTerminalUserController.java

@@ -82,6 +82,7 @@ public class StmtTerminalUserController
     @RequestMapping(value = {"/export", "/"}, method = RequestMethod.GET)
     public String exportCampus(HttpServletResponse res, @NeedUser UserDetails user, TerminalUserSearchDTO searchDTO)
     {
+        log.info("fastExpired:"+searchDTO.getFastExpired()+"");
         if (!user.isPlatForm())
         {
             String merchantId = user.getMerchantId();