| @@ -254,6 +254,8 @@ public class WxUserStructureController extends BaseController { | |||||
| @ApiOperation("查询会员数量") | @ApiOperation("查询会员数量") | ||||
| @GetMapping("/findUserDataCount") | @GetMapping("/findUserDataCount") | ||||
| public ResultData findUserCount(Date startTime, Date endTime) { | public ResultData findUserCount(Date startTime, Date endTime) { | ||||
| final int daysBefore = 29; | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.setTenantId(getTenantId()); | dto.setTenantId(getTenantId()); | ||||
| @@ -280,7 +282,7 @@ public class WxUserStructureController extends BaseController { | |||||
| long wxtodayCount = wxCUserService.findCount(dto);//今天新增 | long wxtodayCount = wxCUserService.findCount(dto);//今天新增 | ||||
| List<UserStructureVo> wxnewCountVos = new ArrayList<>();//每日新增会员数 | List<UserStructureVo> wxnewCountVos = new ArrayList<>();//每日新增会员数 | ||||
| int j = 1; | int j = 1; | ||||
| for (int i = 29; i >= 0; i--) { | |||||
| for (int i = daysBefore; i >= 0; i--) { | |||||
| c.clear(); | c.clear(); | ||||
| c.setTime(today); | c.setTime(today); | ||||
| c.add(Calendar.DAY_OF_YEAR, -i); | c.add(Calendar.DAY_OF_YEAR, -i); | ||||
| @@ -298,7 +300,7 @@ public class WxUserStructureController extends BaseController { | |||||
| List<UserStructureVo> wxallCountVos = new ArrayList<>();//累计会员数 | List<UserStructureVo> wxallCountVos = new ArrayList<>();//累计会员数 | ||||
| c.clear(); | c.clear(); | ||||
| c.setTime(today); | c.setTime(today); | ||||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | |||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| dto.setStartTime(null); | dto.setStartTime(null); | ||||
| long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | ||||
| @@ -341,7 +343,7 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| private Map<String,Object> getMemberData(WxCUserBasicInfoDto dto) { | private Map<String,Object> getMemberData(WxCUserBasicInfoDto dto) { | ||||
| final int daysBefore = 29; | |||||
| long allCount = wxCUserBasicInfoService.findCount(dto);//总量 | long allCount = wxCUserBasicInfoService.findCount(dto);//总量 | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| @@ -354,7 +356,7 @@ public class WxUserStructureController extends BaseController { | |||||
| long todayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | long todayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | ||||
| List<UserStructureVo> newCountVos = new ArrayList<>();//每日新增会员数 | List<UserStructureVo> newCountVos = new ArrayList<>();//每日新增会员数 | ||||
| int j = 1; | int j = 1; | ||||
| for (int i = 29; i >= 0; i--) { | |||||
| for (int i = daysBefore; i >= 0; i--) { | |||||
| c.clear(); | c.clear(); | ||||
| c.setTime(today); | c.setTime(today); | ||||
| c.add(Calendar.DAY_OF_YEAR, -i); | c.add(Calendar.DAY_OF_YEAR, -i); | ||||
| @@ -372,7 +374,7 @@ public class WxUserStructureController extends BaseController { | |||||
| List<UserStructureVo> allCountVos = new ArrayList<>();//累计会员数 | List<UserStructureVo> allCountVos = new ArrayList<>();//累计会员数 | ||||
| c.clear(); | c.clear(); | ||||
| c.setTime(today); | c.setTime(today); | ||||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | |||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| dto.setStartTime(null); | dto.setStartTime(null); | ||||
| long firstDay = wxCUserBasicInfoService.findCount(dto);//统计的第一天总数 | long firstDay = wxCUserBasicInfoService.findCount(dto);//统计的第一天总数 | ||||