Browse Source

统计接口统计错误bug

wangmh 7 years ago
parent
commit
e2d3154841

+ 4 - 4
sso-server/src/main/java/com/uas/sso/controller/UserManagerController.java

@@ -437,13 +437,13 @@ public class UserManagerController extends BaseController {
      * 获取本月用户注册数量
      * @return
      */
-    @RequestMapping(value = "/currentMonth/user/count", method = RequestMethod.GET)
+    @RequestMapping(value = "/currentMonth/count", method = RequestMethod.GET)
     public ModelMap getCurrentMonthUserCount() {
         Calendar start = Calendar.getInstance();
         start.setTime(new Date());
         start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH), 1, 0, 0, 0);
         Calendar end = Calendar.getInstance();
-        start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
+        end.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
         return success(new ModelMap("count", userService.getCountByRegisterDate(start, end)));
     }
 
@@ -451,13 +451,13 @@ public class UserManagerController extends BaseController {
      * 获取上个月用户注册数量
      * @return
      */
-    @RequestMapping(value = "/lastMonth/user/count", method = RequestMethod.GET)
+    @RequestMapping(value = "/lastMonth/count", method = RequestMethod.GET)
     public ModelMap getLastMonthUserCount() {
         Calendar start = Calendar.getInstance();
         start.setTime(new Date());
         start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) - 1, 1, 0, 0, 0);
         Calendar end = Calendar.getInstance();
-        start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH), 1, 0, 0, 0);
+        end.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
         return success(new ModelMap("count", userService.getCountByRegisterDate(start, end)));
     }
 }

+ 3 - 3
sso-server/src/main/java/com/uas/sso/controller/UserspaceManagerController.java

@@ -416,7 +416,7 @@ public class UserspaceManagerController extends BaseController {
         start.setTime(new Date());
         start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH), 1, 0, 0, 0);
         Calendar end = Calendar.getInstance();
-        start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
+        end.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
         return success(new ModelMap("count", userspaceService.getCountByRegisterDate(start, end)));
     }
 
@@ -424,13 +424,13 @@ public class UserspaceManagerController extends BaseController {
      * 获取上个月企业注册数量
      * @return
      */
-    @RequestMapping(value = "/lastMonth/enterprise/count", method = RequestMethod.GET)
+    @RequestMapping(value = "/lastMonth/count", method = RequestMethod.GET)
     public ModelMap getLastMonthEnterpriseCount() {
         Calendar start = Calendar.getInstance();
         start.setTime(new Date());
         start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) - 1, 1, 0, 0, 0);
         Calendar end = Calendar.getInstance();
-        start.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH), 1, 0, 0, 0);
+        end.set(start.get(Calendar.YEAR), start.get(Calendar.MONTH) + 1, 1, 0, 0, 0);
         return success(new ModelMap("count", userspaceService.getCountByRegisterDate(start, end)));
     }