| @@ -76,7 +76,23 @@ public class BaseController { | |||||
| } | } | ||||
| /** | /** | ||||
| * 处理集团新增修改所需租户信息(广场独立修改,集团修改全部) | |||||
| * 处理集团新增修改所需租户信息(只能取集团数据,积分/成长值/等级) | |||||
| * 处理集团版 tenantId为空,parentTenantId为集团tenantId | |||||
| * ifParentUpdateTenantInfo | |||||
| */ | |||||
| public TenantEntity getFinalTenantInfo() { | |||||
| TenantEntity info = this.getTenantInfo(); | |||||
| String tenantId = info.getTenantId(); | |||||
| if(StringUtils.isNotBlank(info.getParentTenantId())){ | |||||
| tenantId = info.getParentTenantId(); | |||||
| } | |||||
| TenantEntity tenantEntity = new TenantEntity(); | |||||
| tenantEntity.setTenantId(tenantId); | |||||
| return tenantEntity; | |||||
| } | |||||
| /** | |||||
| * 处理集团新增修改所需租户信息(广场独立修改,集团能修改各广场、自己信息) | |||||
| * 处理集团版 tenantId为空,parentTenantId为集团tenantId | * 处理集团版 tenantId为空,parentTenantId为集团tenantId | ||||
| * ifParentUpdateTenantInfo | * ifParentUpdateTenantInfo | ||||
| */ | */ | ||||
| @@ -9,6 +9,7 @@ import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -71,6 +72,10 @@ public class WxChartDataController extends BaseController { | |||||
| String chart = params.get("chart"); | String chart = params.get("chart"); | ||||
| logger.info("[" + getIpAddr() + "] WxChartDataController::queryData chart: " + chart); | logger.info("[" + getIpAddr() + "] WxChartDataController::queryData chart: " + chart); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| params.put("tenantId",tenantEntity.getTenantId()); | params.put("tenantId",tenantEntity.getTenantId()); | ||||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | params.put("parentTenantId", tenantEntity.getParentTenantId()); | ||||
| ResultData data = wxChartDataService.queryData(params); | ResultData data = wxChartDataService.queryData(params); | ||||
| @@ -11,6 +11,7 @@ import com.iformall.service.*; | |||||
| import com.iformall.service.cuser.CUserServiceFactory; | import com.iformall.service.cuser.CUserServiceFactory; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -44,16 +45,19 @@ public class WxUserStatisticsController extends BaseController { | |||||
| if(plat == null){ | if(plat == null){ | ||||
| plat = EnumAppPlat.WX.getCode(); | plat = EnumAppPlat.WX.getCode(); | ||||
| } | } | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| //昨日同比 | //昨日同比 | ||||
| Map<String, Object> map = new HashMap<>(); | Map<String, Object> map = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| dto.setEndTime(new Date()); | dto.setEndTime(new Date()); | ||||
| //微信用户数据 | //微信用户数据 | ||||
| long wxTotalCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto,tenantEntitys);//总量 | |||||
| long wxTotalCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);//总量 | |||||
| map.put("wxTotalCount",wxTotalCount); | map.put("wxTotalCount",wxTotalCount); | ||||
| @@ -64,7 +68,7 @@ public class WxUserStatisticsController extends BaseController { | |||||
| Date today = c.getTime(); | Date today = c.getTime(); | ||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long wxTodayCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto, tenantEntitys);//今天新增 | |||||
| long wxTodayCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);//今天新增 | |||||
| map.put("wxTodayCount",wxTodayCount); | map.put("wxTodayCount",wxTodayCount); | ||||
| @@ -75,7 +79,7 @@ public class WxUserStatisticsController extends BaseController { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long wxYesterdayCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto, tenantEntitys); | |||||
| long wxYesterdayCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto); | |||||
| if (wxYesterdayCount > 0) { | if (wxYesterdayCount > 0) { | ||||
| double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | ||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | ||||
| @@ -86,54 +90,6 @@ public class WxUserStatisticsController extends BaseController { | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @ApiOperation("查询会员数量") | |||||
| @GetMapping("/findBasicUserCount") | |||||
| @SystemControllerLog(description = "查询会员数量") | |||||
| public ResultData findBasicUserCount() { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStatisticsController::findBasicUserCount"); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| //昨日同比 | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setEndTime(new Date()); | |||||
| //会员用户数据 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//总量 | |||||
| map.put("memTotalCount",memTotalCount); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE, 0); | |||||
| c.set(Calendar.SECOND, 0); | |||||
| Date today = c.getTime(); | |||||
| dto.setStartTime(today); | |||||
| dto.setEndTime(null); | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//今天新增 | |||||
| map.put("memTodayCount",memTodayCount); | |||||
| //昨日同比 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| if (memYesterdayCount > 0) { | |||||
| double yesterday = (double) (memTodayCount - memYesterdayCount) / memYesterdayCount * 100; | |||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| map.put("memhb", zrhb + "%"); | |||||
| } else { | |||||
| map.put("memhb", "--%"); | |||||
| } | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation("查询微信用户趋势") | @ApiOperation("查询微信用户趋势") | ||||
| @GetMapping("/findWxUserTrend") | @GetMapping("/findWxUserTrend") | ||||
| @SystemControllerLog(description = "查询微信用户趋势") | @SystemControllerLog(description = "查询微信用户趋势") | ||||
| @@ -143,7 +99,11 @@ public class WxUserStatisticsController extends BaseController { | |||||
| plat = EnumAppPlat.WX.getCode(); | plat = EnumAppPlat.WX.getCode(); | ||||
| } | } | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| @@ -159,8 +119,13 @@ public class WxUserStatisticsController extends BaseController { | |||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| dto.setReportType(reportType); | dto.setReportType(reportType); | ||||
| List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | |||||
| List<UserCountVo> wxCounts = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCountHistory(dto,tenantEntitys);//每日新增会员数 | |||||
| List<UserCountVo> wxCountList = new ArrayList<>(); | |||||
| List<UserCountVo> wxCounts = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCountHistory(dto);//获取每日/每月/每年新增微信用户数 | |||||
| dto.setEndTime(startTime); | |||||
| dto.setStartTime(null); | |||||
| dto.setReportType(null); | |||||
| long startTotal = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto);//获取开始时间之前的所有微信用户数量 | |||||
| SimpleDateFormat sdf; | SimpleDateFormat sdf; | ||||
| SimpleDateFormat fsdf; | SimpleDateFormat fsdf; | ||||
| @@ -206,30 +171,65 @@ public class WxUserStatisticsController extends BaseController { | |||||
| }while (curTime.before(endTime) || curTime.equals(endTime)); | }while (curTime.before(endTime) || curTime.equals(endTime)); | ||||
| if (wxCountList.size() > 0 | |||||
| && wxCountList.get(0).getTotalCount() != null | |||||
| && wxCountList.get(0).getTotalCount() == 0) { | |||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | |||||
| pdto.updateTenantInfo(tenantEntity); | |||||
| pdto.setEndTime(startTime); | |||||
| wxCountList.get(0).setTotalCount(cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(pdto, tenantEntitys)); | |||||
| } | |||||
| for (int i = 1; i < wxCountList.size(); i++){ | |||||
| if (wxCountList.get(i).getTotalCount() != null && | |||||
| wxCountList.get(i-1).getTotalCount() != null && | |||||
| wxCountList.get(i).getTotalCount() < wxCountList.get(i-1).getTotalCount()){ | |||||
| logger.info("修改前"+(i-1)+"=="+wxCountList.get(i-1).getTotalCount()); | |||||
| logger.info("修改前"+i+"=="+wxCountList.get(i).getTotalCount()); | |||||
| wxCountList.get(i).setTotalCount(wxCountList.get(i-1).getTotalCount()); | |||||
| logger.info("修改后"+(i-1)+"=="+wxCountList.get(i-1).getTotalCount()); | |||||
| logger.info("修改后"+i+"=="+wxCountList.get(i).getTotalCount()); | |||||
| for (UserCountVo ucv:wxCountList) { | |||||
| if(ucv.getIncCount() == null){ | |||||
| ucv.setTotalCount(0l); | |||||
| } | } | ||||
| startTotal += ucv.getIncCount(); | |||||
| ucv.setTotalCount(startTotal); | |||||
| } | } | ||||
| return new ResultData(wxCountList); | return new ResultData(wxCountList); | ||||
| } | } | ||||
| @ApiOperation("查询会员数量") | |||||
| @GetMapping("/findBasicUserCount") | |||||
| @SystemControllerLog(description = "查询会员数量") | |||||
| public ResultData findBasicUserCount() { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStatisticsController::findBasicUserCount"); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| //昨日同比 | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setEndTime(new Date()); | |||||
| //会员用户数据 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| map.put("memTotalCount",memTotalCount); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE, 0); | |||||
| c.set(Calendar.SECOND, 0); | |||||
| Date today = c.getTime(); | |||||
| dto.setStartTime(today); | |||||
| dto.setEndTime(null); | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| map.put("memTodayCount",memTodayCount); | |||||
| //昨日同比 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(dto); | |||||
| if (memYesterdayCount > 0) { | |||||
| double yesterday = (double) (memTodayCount - memYesterdayCount) / memYesterdayCount * 100; | |||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| map.put("memhb", zrhb + "%"); | |||||
| } else { | |||||
| map.put("memhb", "--%"); | |||||
| } | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation("查询会员趋势") | @ApiOperation("查询会员趋势") | ||||
| @GetMapping("/findBasicUserTrend") | @GetMapping("/findBasicUserTrend") | ||||
| @SystemControllerLog(description = "查询会员趋势") | @SystemControllerLog(description = "查询会员趋势") | ||||
| @@ -237,7 +237,7 @@ public class WxUserStatisticsController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStatisticsController::findBasicUserTrend"); | logger.debug("[" + getIpAddr() + "] WxUserStatisticsController::findBasicUserTrend"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| @@ -254,7 +254,7 @@ public class WxUserStatisticsController extends BaseController { | |||||
| dto.setReportType(reportType); | dto.setReportType(reportType); | ||||
| List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(ifParentUpdateTenantInfo(),dto);//每日新增会员数 | |||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(dto);//每日新增会员数 | |||||
| SimpleDateFormat sdf; | SimpleDateFormat sdf; | ||||
| SimpleDateFormat fsdf; | SimpleDateFormat fsdf; | ||||
| @@ -304,8 +304,9 @@ public class WxUserStatisticsController extends BaseController { | |||||
| && memCountList.get(0).getTotalCount() != null | && memCountList.get(0).getTotalCount() != null | ||||
| && memCountList.get(0).getTotalCount() == 0) { | && memCountList.get(0).getTotalCount() == 0) { | ||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | ||||
| pdto.updateTenantInfo(tenantEntity); | |||||
| pdto.setEndTime(startTime); | pdto.setEndTime(startTime); | ||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),pdto)); | |||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(pdto)); | |||||
| } | } | ||||
| for (int i = 1; i < memCountList.size(); i++){ | for (int i = 1; i < memCountList.size(); i++){ | ||||
| if ( memCountList.get(i).getTotalCount() != null && | if ( memCountList.get(i).getTotalCount() != null && | ||||
| @@ -65,16 +65,18 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员性别结构") | @SystemControllerLog(description = "会员管理-查询会员性别结构") | ||||
| public ResultData findUserSexStructure(Date startTime, Date endTime) { | public ResultData findUserSexStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserSexStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserSexStructure"); | ||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantInfo); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| //保密 | //保密 | ||||
| dto.setSex(EnumCUserBaseInfoSex.UNKNOWN.getCode()); | dto.setSex(EnumCUserBaseInfoSex.UNKNOWN.getCode()); | ||||
| long secrecy = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| long secrecy = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| dto.setSex(EnumCUserBaseInfoSex.MALE.getCode()); | dto.setSex(EnumCUserBaseInfoSex.MALE.getCode()); | ||||
| long boy = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| long boy = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| dto.setSex(EnumCUserBaseInfoSex.FEMALE.getCode()); | dto.setSex(EnumCUserBaseInfoSex.FEMALE.getCode()); | ||||
| long girl = wxCUserBasicInfoService.findCountBySex(getTenantInfo(),dto); | |||||
| long girl = wxCUserBasicInfoService.findCountBySex(dto); | |||||
| Long all = secrecy + boy + girl; | Long all = secrecy + boy + girl; | ||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| vos.add(getVo(boy, all, "男", 1)); | vos.add(getVo(boy, all, "男", 1)); | ||||
| @@ -88,10 +90,12 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员年龄结构") | @SystemControllerLog(description = "会员管理-查询会员年龄结构") | ||||
| public ResultData findUserAgeStructure(Date startTime, Date endTime) { | public ResultData findUserAgeStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | ||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantInfo); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long all = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| long all = wxCUserBasicInfoService.findCount(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| for (EnumAgeInfo a : EnumAgeInfo.values()) { | for (EnumAgeInfo a : EnumAgeInfo.values()) { | ||||
| @@ -100,7 +104,7 @@ public class WxUserStructureController extends BaseController { | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| c.set(Calendar.SECOND, 0); | c.set(Calendar.SECOND, 0); | ||||
| long count = getCountByAge(ifParentUpdateTenantInfo(),a, c, dto); | |||||
| long count = getCountByAge(a, c, dto); | |||||
| vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | ||||
| } | } | ||||
| return new ResultData(vos); | return new ResultData(vos); | ||||
| @@ -111,18 +115,18 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员成长值结构") | @SystemControllerLog(description = "会员管理-查询会员成长值结构") | ||||
| public ResultData findUserLevelStructure(Date startTime, Date endTime) { | public ResultData findUserLevelStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserAgeStructure"); | ||||
| WxLevelConfig wxLevelConfig = new WxLevelConfig(); | WxLevelConfig wxLevelConfig = new WxLevelConfig(); | ||||
| if(StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())){ | |||||
| wxLevelConfig.setTenantId(ifParentUpdateTenantInfo().getParentTenantId()); | |||||
| }else{ | |||||
| wxLevelConfig.setTenantId(ifParentUpdateTenantInfo().getTenantId()); | |||||
| } | |||||
| wxLevelConfig.updateTenantInfo(getFinalTenantInfo()); | |||||
| wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.findList(wxLevelConfig); | List<WxLevelConfig> levelList = wxLevelConfigService.findList(wxLevelConfig); | ||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| for( int i = 0; i < levelList.size(); i++) { | for( int i = 0; i < levelList.size(); i++) { | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantInfo); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| if (i + 1 < levelList.size()) { | if (i + 1 < levelList.size()) { | ||||
| @@ -132,7 +136,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setLevelStartScore(levelList.get(i).getPoints()); | dto.setLevelStartScore(levelList.get(i).getPoints()); | ||||
| } | } | ||||
| long all = wxCUserBasicInfoService.findCountByScore(ifParentUpdateTenantInfo(),dto); | |||||
| long all = wxCUserBasicInfoService.findCountByScore(dto); | |||||
| levelList.get(i).setCount(all); | levelList.get(i).setCount(all); | ||||
| } | } | ||||
| @@ -141,9 +145,10 @@ public class WxUserStructureController extends BaseController { | |||||
| //没有等级的会员 | //没有等级的会员 | ||||
| other.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | other.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantInfo); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| other.setCount(wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto) | |||||
| other.setCount(wxCUserBasicInfoService.findCount(dto) | |||||
| - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | ||||
| levelList.add(other); | levelList.add(other); | ||||
| @@ -158,9 +163,10 @@ public class WxUserStructureController extends BaseController { | |||||
| TenantEntity tenantInfo = getTenantInfo(); | TenantEntity tenantInfo = getTenantInfo(); | ||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantInfo); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantInfo); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| dto.updateTenantInfo(tenantInfo); | dto.updateTenantInfo(tenantInfo); | ||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | ||||
| @@ -199,11 +205,12 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员手机品牌结构") | @SystemControllerLog(description = "会员管理-查询会员手机品牌结构") | ||||
| public ResultData findUserPhoneBandStructure(Date startTime, Date endTime) { | public ResultData findUserPhoneBandStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserPhoneBandStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserPhoneBandStructure"); | ||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| @@ -236,11 +243,12 @@ public class WxUserStructureController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-查询会员活跃结构") | @SystemControllerLog(description = "会员管理-查询会员活跃结构") | ||||
| public ResultData findUserActivityStructure(Date startTime, Date endTime) { | public ResultData findUserActivityStructure(Date startTime, Date endTime) { | ||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserActivityStructure"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserActivityStructure"); | ||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| @@ -299,16 +307,21 @@ public class WxUserStructureController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| //昨日同比 | //昨日同比 | ||||
| Map<String, Object> map = new HashMap<>(); | Map<String, Object> map = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| dto.setEndTime(new Date()); | dto.setEndTime(new Date()); | ||||
| //微信用户数据 | //微信用户数据 | ||||
| long wxTotalCount = wxCUserService.findCount(dto,tenantEntitys);//总量 | |||||
| //微信用户数据 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//总量 | |||||
| long wxTotalCount = wxCUserService.findCount(dto);//总量 | |||||
| //会员数据 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| map.put("wxTotalCount",wxTotalCount); | map.put("wxTotalCount",wxTotalCount); | ||||
| map.put("memTotalCount",memTotalCount); | map.put("memTotalCount",memTotalCount); | ||||
| @@ -320,8 +333,8 @@ public class WxUserStructureController extends BaseController { | |||||
| Date today = c.getTime(); | Date today = c.getTime(); | ||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long wxTodayCount = wxCUserService.findCount(dto, tenantEntitys);//今天新增 | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto);//今天新增 | |||||
| long wxTodayCount = wxCUserService.findCount(dto);//今天新增 | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| map.put("wxTodayCount",wxTodayCount); | map.put("wxTodayCount",wxTodayCount); | ||||
| map.put("memTodayCount",memTodayCount); | map.put("memTodayCount",memTodayCount); | ||||
| @@ -333,8 +346,8 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long wxYesterdayCount = wxCUserService.findCount(dto, tenantEntitys); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),dto); | |||||
| long wxYesterdayCount = wxCUserService.findCount(dto); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(dto); | |||||
| if (wxYesterdayCount > 0) { | if (wxYesterdayCount > 0) { | ||||
| double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | ||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | ||||
| @@ -361,10 +374,10 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| dto.setReportType(reportType); | dto.setReportType(reportType); | ||||
| List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | |||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto,tenantEntitys);//每日新增会员数 | |||||
| List<UserCountVo> wxCountList = new ArrayList<>(); | |||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto);//获取每日/每月/每年新增微信用户数 | |||||
| List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | ||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(ifParentUpdateTenantInfo(),dto);//每日新增会员数 | |||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(dto);//每日新增会员数 | |||||
| SimpleDateFormat sdf; | SimpleDateFormat sdf; | ||||
| SimpleDateFormat fsdf; | SimpleDateFormat fsdf; | ||||
| @@ -424,35 +437,25 @@ public class WxUserStructureController extends BaseController { | |||||
| }while (curTime.before(endTime) || curTime.equals(endTime)); | }while (curTime.before(endTime) || curTime.equals(endTime)); | ||||
| if (wxCountList.size() > 0 | |||||
| && wxCountList.get(0).getTotalCount() != null | |||||
| && wxCountList.get(0).getTotalCount() == 0) { | |||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | |||||
| pdto.updateTenantInfo(tenantEntity); | |||||
| pdto.setEndTime(startTime); | |||||
| wxCountList.get(0).setTotalCount(wxCUserService.findCount(pdto, tenantEntitys)); | |||||
| } | |||||
| for (int i = 1; i < wxCountList.size(); i++){ | |||||
| if (wxCountList.get(i).getTotalCount() != null && | |||||
| wxCountList.get(i-1).getTotalCount() != null && | |||||
| wxCountList.get(i).getTotalCount() < wxCountList.get(i-1).getTotalCount()){ | |||||
| wxCountList.get(i).setTotalCount(wxCountList.get(i-1).getTotalCount()); | |||||
| dto.setEndTime(startTime); | |||||
| dto.setStartTime(null); | |||||
| dto.setReportType(null); | |||||
| long wxstartTotal = wxCUserService.findCount(dto);//获取开始时间之前的所有微信用户数量 | |||||
| long memstartTotal = wxCUserBasicInfoService.findCount(dto); | |||||
| for (UserCountVo ucv:wxCountList) { | |||||
| if(ucv.getIncCount() == null){ | |||||
| ucv.setTotalCount(0l); | |||||
| } | } | ||||
| wxstartTotal += ucv.getIncCount(); | |||||
| ucv.setTotalCount(wxstartTotal); | |||||
| } | } | ||||
| if (memCountList.size() > 0 | |||||
| && memCountList.get(0).getTotalCount() != null | |||||
| && memCountList.get(0).getTotalCount() == 0) { | |||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | |||||
| pdto.setEndTime(startTime); | |||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),pdto)); | |||||
| } | |||||
| for (int i = 1; i < memCountList.size(); i++){ | |||||
| if ( memCountList.get(i).getTotalCount() != null && | |||||
| memCountList.get(i-1).getTotalCount() != null && | |||||
| memCountList.get(i).getTotalCount() < memCountList.get(i-1).getTotalCount()){ | |||||
| memCountList.get(i).setTotalCount(memCountList.get(i-1).getTotalCount()); | |||||
| for (UserCountVo ucv:memCountList) { | |||||
| if(ucv.getIncCount() == null){ | |||||
| ucv.setTotalCount(0l); | |||||
| } | } | ||||
| memstartTotal += ucv.getIncCount(); | |||||
| ucv.setTotalCount(memstartTotal); | |||||
| } | } | ||||
| map.put("wxCountList", wxCountList);//累计/新增用户列表( 日期和数量list) | map.put("wxCountList", wxCountList);//累计/新增用户列表( 日期和数量list) | ||||
| @@ -473,8 +476,12 @@ public class WxUserStructureController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserByChannel"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserByChannel"); | ||||
| List<String> sceneList = null; | List<String> sceneList = null; | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| wxCUser.updateTenantInfo(tenantEntity); | |||||
| if (StringUtils.isNotBlank(wxCUser.getChannelName())) { | if (StringUtils.isNotBlank(wxCUser.getChannelName())) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setChannelName(wxCUser.getChannelName()); | c.setChannelName(wxCUser.getChannelName()); | ||||
| @@ -487,7 +494,7 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(wxCUser,tenantEntitys, pageNum, pageSize); | |||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(wxCUser, pageNum, pageSize); | |||||
| for (WxCUser u : page.getList()) { | for (WxCUser u : page.getList()) { | ||||
| WxUserChannel c = new WxUserChannel(); | WxUserChannel c = new WxUserChannel(); | ||||
| c.setSceneAddress(u.getSceneAddress()); | c.setSceneAddress(u.getSceneAddress()); | ||||
| @@ -511,8 +518,9 @@ public class WxUserStructureController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserStructureByChannel"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserStructureByChannel"); | ||||
| List<WxUserChannel> channelStructureList = new ArrayList<>(); | List<WxUserChannel> channelStructureList = new ArrayList<>(); | ||||
| List<WxUserChannel> senceStructureList = new ArrayList<>(); | List<WxUserChannel> senceStructureList = new ArrayList<>(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(getTenantInfo()); | |||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| wxCUser.updateTenantInfo(wxCUser); | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(getTenantInfo()); | |||||
| List<WxUserChannel> channels = wxUserChannelService.findDistinctChannel(); | List<WxUserChannel> channels = wxUserChannelService.findDistinctChannel(); | ||||
| for (WxUserChannel w : channels) { | for (WxUserChannel w : channels) { | ||||
| @@ -527,7 +535,7 @@ public class WxUserStructureController extends BaseController { | |||||
| wxCUser.setSceneList(scene); | wxCUser.setSceneList(scene); | ||||
| WxUserChannel senceStructure = new WxUserChannel(); | WxUserChannel senceStructure = new WxUserChannel(); | ||||
| senceStructure.setDescription(uc.getDescription()); | senceStructure.setDescription(uc.getDescription()); | ||||
| senceStructure.setCount(wxCUserService.countByChannel(tenantEntitys,wxCUser)); | |||||
| senceStructure.setCount(wxCUserService.countByChannel(wxCUser)); | |||||
| senceStructureList.add(senceStructure); | senceStructureList.add(senceStructure); | ||||
| sceneList.add(uc.getSceneAddress()); | sceneList.add(uc.getSceneAddress()); | ||||
| } | } | ||||
| @@ -535,7 +543,7 @@ public class WxUserStructureController extends BaseController { | |||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| WxUserChannel channelStructure = new WxUserChannel(); | WxUserChannel channelStructure = new WxUserChannel(); | ||||
| channelStructure.setChannelName(w.getChannelName()); | channelStructure.setChannelName(w.getChannelName()); | ||||
| channelStructure.setCount(wxCUserService.countByChannel(tenantEntitys,wxCUser)); | |||||
| channelStructure.setCount(wxCUserService.countByChannel(wxCUser)); | |||||
| channelStructureList.add(channelStructure); | channelStructureList.add(channelStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -567,7 +575,7 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| private long getCountByAge(TenantEntity tenantInfo, EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| private long getCountByAge(EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| if (a.getStart() != 0 || a.getEnd() != 0) { | if (a.getStart() != 0 || a.getEnd() != 0) { | ||||
| c.add(Calendar.YEAR, -a.getEnd()); | c.add(Calendar.YEAR, -a.getEnd()); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| @@ -583,7 +591,7 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setBirthEndTime(null); | dto.setBirthEndTime(null); | ||||
| } | } | ||||
| return wxCUserBasicInfoService.findCountByAge(tenantInfo,dto); | |||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| } | } | ||||
| private UserStructureVo getVo(long count, long all, String name, Integer num) { | private UserStructureVo getVo(long count, long all, String name, Integer num) { | ||||
| @@ -29,7 +29,7 @@ public class FengNiaoMapController extends BaseController { | |||||
| @ApiOperation("查询地图配置") | @ApiOperation("查询地图配置") | ||||
| @GetMapping("/getConfig") | @GetMapping("/getConfig") | ||||
| public ResultData getConfig() { | public ResultData getConfig() { | ||||
| String tenantId = ifParentUpdateTenantInfo().getTenantId(); | |||||
| String tenantId = getTenantInfo().getTenantId(); | |||||
| if (!StringUtils.isBlank(tenantId)) { | if (!StringUtils.isBlank(tenantId)) { | ||||
| try { | try { | ||||
| FengNiaoMapConfig config = fengNiaoMapService.getConfigByTenantId(tenantId); | FengNiaoMapConfig config = fengNiaoMapService.getConfigByTenantId(tenantId); | ||||
| @@ -57,7 +57,7 @@ public class WxCampaignController extends BaseController { | |||||
| if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | ||||
| wxCampaign.setStatus(null); | wxCampaign.setStatus(null); | ||||
| } | } | ||||
| wxCampaign.updateTenantInfo(ifParentUpdateTenantInfo()); | |||||
| wxCampaign.updateTenantInfo(getTenantInfo()); | |||||
| wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | wxCampaign.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | ||||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -166,6 +166,7 @@ public class WxCampaignController extends BaseController { | |||||
| WxCampaign wxCampaign = wxCampaignService.getById(id); | WxCampaign wxCampaign = wxCampaignService.getById(id); | ||||
| if (wxCampaign != null) { | if (wxCampaign != null) { | ||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.updateTenantInfo(wxCampaign); | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | ||||
| wxCouponChannel.setSubTargetId(wxCampaign.getId()); | wxCouponChannel.setSubTargetId(wxCampaign.getId()); | ||||
| wxCouponChannel.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); | ||||
| @@ -57,9 +57,6 @@ public class WxCouponController extends BaseController { | |||||
| private WxMallService wxMallService; | private WxMallService wxMallService; | ||||
| @Autowired | @Autowired | ||||
| RedisLock redisLock; | RedisLock redisLock; | ||||
| @Autowired | |||||
| private WxPayAccountService wxPayAccountService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -41,7 +41,7 @@ public class UserBasicInfoAddressController extends BaseController { | |||||
| if(userBasicInfoAddress.getUserId() == null){ | if(userBasicInfoAddress.getUserId() == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID为空"); | ||||
| } | } | ||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -56,7 +56,7 @@ public class UserBasicInfoAddressController extends BaseController { | |||||
| if(userBasicInfoAddress.getUserId() == null){ | if(userBasicInfoAddress.getUserId() == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public class UserBasicInfoAddressController extends BaseController { | |||||
| if(userBasicInfoAddress.getId() == null || userBasicInfoAddress.getUserId() == null){ | if(userBasicInfoAddress.getId() == null || userBasicInfoAddress.getUserId() == null){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID或者Id为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID或者Id为空"); | ||||
| } | } | ||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -87,7 +87,7 @@ public class UserBasicInfoAddressController extends BaseController { | |||||
| } | } | ||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | ||||
| userBasicInfoAddress.setId(id); | userBasicInfoAddress.setId(id); | ||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.deleteById(userBasicInfoAddress); | userBasicInfoAddressService.deleteById(userBasicInfoAddress); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -103,7 +103,7 @@ public class UserBasicInfoAddressController extends BaseController { | |||||
| } | } | ||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | ||||
| userBasicInfoAddress.setId(id); | userBasicInfoAddress.setId(id); | ||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.findById(userBasicInfoAddress); | userBasicInfoAddressService.findById(userBasicInfoAddress); | ||||
| return new ResultData(Result.SUCCESS, "查询成功", null); | return new ResultData(Result.SUCCESS, "查询成功", null); | ||||
| } | } | ||||
| @@ -93,7 +93,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| private WxCreditHistoryService wxCreditHistoryService; | private WxCreditHistoryService wxCreditHistoryService; | ||||
| private void updateLevelParam(WxCUserBasicInfo info) { | private void updateLevelParam(WxCUserBasicInfo info) { | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(ifParentUpdateTenantInfo()); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(getFinalTenantInfo()); | |||||
| levelList = levelList.stream() | levelList = levelList.stream() | ||||
| .sorted(Comparator.comparing(WxLevelConfig::getPoints)) | .sorted(Comparator.comparing(WxLevelConfig::getPoints)) | ||||
| .collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
| @@ -115,7 +115,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| } else { | } else { | ||||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | ||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(ifParentUpdateTenantInfo()); | |||||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(getFinalTenantInfo()); | |||||
| for (WxLevelConfig levelConfig : levelList) { | for (WxLevelConfig levelConfig : levelList) { | ||||
| if (info.getPoins() >= levelConfig.getPoints()) { | if (info.getPoins() >= levelConfig.getPoints()) { | ||||
| info.setLevel(levelConfig.getLevel()); | info.setLevel(levelConfig.getLevel()); | ||||
| @@ -191,9 +191,9 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| updateLevelParam(wxCUserBasicInfo); | updateLevelParam(wxCUserBasicInfo); | ||||
| } | } | ||||
| } | } | ||||
| wxCUserBasicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| wxCUserBasicInfo.undateFinalTenantId(getTenantInfo()); | |||||
| wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.wcubiActiveTime_DESC); | wxCUserBasicInfo.setSortColumns(BaseEntity.SortField.wcubiActiveTime_DESC); | ||||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(ifParentUpdateTenantInfo(),wxCUserBasicInfo, pageNum, pageSize); | |||||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||||
| if (page.getSize() > 0) { | if (page.getSize() > 0) { | ||||
| for (WxCUserBasicInfo info : page.getList()) { | for (WxCUserBasicInfo info : page.getList()) { | ||||
| @@ -362,9 +362,10 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| basicInfo.setName(null); | basicInfo.setName(null); | ||||
| } | } | ||||
| } | } | ||||
| basicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| int exportDataCount = wxCUserBasicInfoService.exportDataCount(ifParentUpdateTenantInfo(),basicInfo); | |||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| basicInfo.setTenantId(tenantInfo.getTenantId()); | |||||
| basicInfo.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| int exportDataCount = wxCUserBasicInfoService.exportDataCount(basicInfo); | |||||
| return new ResultData(exportDataCount); | return new ResultData(exportDataCount); | ||||
| @@ -385,9 +386,10 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| basicInfo.setName(null); | basicInfo.setName(null); | ||||
| } | } | ||||
| } | } | ||||
| basicInfo.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| wxCUserBasicInfoService.exportData(getTenantInfo(),basicInfo, request, response); | |||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| basicInfo.setTenantId(tenantInfo.getTenantId()); | |||||
| basicInfo.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| wxCUserBasicInfoService.exportData(basicInfo, request, response); | |||||
| } | } | ||||
| @RequestMapping("/exportTemplate") | @RequestMapping("/exportTemplate") | ||||
| @@ -620,14 +622,18 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| @SystemControllerLog(description = "会员管理-迁移数据") | @SystemControllerLog(description = "会员管理-迁移数据") | ||||
| public ResultData cuserOldToNew(@RequestBody Map<String,String> map) { | public ResultData cuserOldToNew(@RequestBody Map<String,String> map) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::cuserOldToNew"); | logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::cuserOldToNew"); | ||||
| TenantEntity tenantInfo = getTenantInfo(); | |||||
| if(StringUtils.isBlank(tenantInfo.getTenantId())){ | |||||
| return new ResultData(ErrorCode.SYS_AUTH_ERROR); | |||||
| } | |||||
| String oldCuserPhone = (String) map.get("oldCuserPhone"); | String oldCuserPhone = (String) map.get("oldCuserPhone"); | ||||
| String newCuserPhone = (String) map.get("newCuserPhone"); | String newCuserPhone = (String) map.get("newCuserPhone"); | ||||
| if(StringUtils.isNotBlank(oldCuserPhone) && StringUtils.isNotBlank(newCuserPhone)){ | if(StringUtils.isNotBlank(oldCuserPhone) && StringUtils.isNotBlank(newCuserPhone)){ | ||||
| WxCUserBasicInfo oldCuser = wxCUserBasicInfoService.findInfoByPhone(ifParentUpdateTenantInfo(), oldCuserPhone); | |||||
| WxCUserBasicInfo newCuser = wxCUserBasicInfoService.findInfoByPhone(ifParentUpdateTenantInfo(), newCuserPhone); | |||||
| WxCUserBasicInfo oldCuser = wxCUserBasicInfoService.findInfoByPhone(tenantInfo, oldCuserPhone); | |||||
| WxCUserBasicInfo newCuser = wxCUserBasicInfoService.findInfoByPhone(tenantInfo, newCuserPhone); | |||||
| if(null != oldCuser && null != newCuser){ | if(null != oldCuser && null != newCuser){ | ||||
| if(!oldCuserPhone.equals(newCuserPhone)){ | if(!oldCuserPhone.equals(newCuserPhone)){ | ||||
| wxCUserBasicInfoService.cuserOldToNew(oldCuser.getId(),newCuser.getId(),ifParentUpdateTenantInfo()); | |||||
| wxCUserBasicInfoService.cuserOldToNew(oldCuser.getId(),newCuser.getId(),tenantInfo); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| }else{ | }else{ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"同一个用户"); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"同一个用户"); | ||||
| @@ -61,10 +61,14 @@ public class WxCUserDataController extends BaseController { | |||||
| plat = EnumAppPlat.WX.getCode(); | plat = EnumAppPlat.WX.getCode(); | ||||
| } | } | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| if(StringUtils.isBlank(tenantEntity.getTenantId())){ | |||||
| //todo 集团版查询数据待重构 | |||||
| return new ResultData("集团版查询数据待重构"); | |||||
| } | |||||
| // List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| long allCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto, tenantEntitys); | |||||
| long allCount = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| @@ -84,7 +88,7 @@ public class WxCUserDataController extends BaseController { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto, tenantEntitys); | |||||
| long count = cuserFactory.getCUserService(EnumAppPlat.getByCode(plat)).findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | ||||
| @@ -143,13 +147,14 @@ public class WxCUserDataController extends BaseController { | |||||
| //Date startDate = DateUtils.getDateFromString(startdate + " 00:00:00","yyyy-MM-dd HH:mm:ss").getTime(); | //Date startDate = DateUtils.getDateFromString(startdate + " 00:00:00","yyyy-MM-dd HH:mm:ss").getTime(); | ||||
| //Date endDate = DateUtils.getDateFromString(systemTime + " 23:59:59","yyyy-MM-dd HH:mm:ss").getTime(); | //Date endDate = DateUtils.getDateFromString(systemTime + " 23:59:59","yyyy-MM-dd HH:mm:ss").getTime(); | ||||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | ||||
| wxCUserBasicInfoDto.updateTenantInfo(tenantEntity); | |||||
| wxCUserBasicInfoDto.setStartTime(null); | wxCUserBasicInfoDto.setStartTime(null); | ||||
| wxCUserBasicInfoDto.setEndTime(null); | wxCUserBasicInfoDto.setEndTime(null); | ||||
| map.put("growCount", wxCUserBasicInfoService.findGrowUserCount(ifParentUpdateTenantInfo())); | |||||
| map.put("growCount", wxCUserBasicInfoService.findGrowUserCount(tenantEntity)); | |||||
| //全部导入的 | //全部导入的 | ||||
| map.put("importCount", wxCUserBasicInfoService.findImportUserCount(ifParentUpdateTenantInfo())); | |||||
| map.put("importCount", wxCUserBasicInfoService.findImportUserCount(tenantEntity)); | |||||
| //全部 | //全部 | ||||
| map.put("allHistoryUserCount", wxCUserBasicInfoService.findCount(ifParentUpdateTenantInfo(),wxCUserBasicInfoDto)); | |||||
| map.put("allHistoryUserCount", wxCUserBasicInfoService.findCount(wxCUserBasicInfoDto)); | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @@ -47,14 +47,9 @@ public class WxLevelConfigController extends BaseController { | |||||
| public ResultData list(@ModelAttribute WxLevelConfig wxLevelConfig, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxLevelConfig wxLevelConfig, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::list"); | logger.debug("[" + getIpAddr() + "] WxLevelConfigController::list"); | ||||
| if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); | if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); | ||||
| TenantEntity tenantEntity = ifParentUpdateTenantInfo(); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| wxLevelConfig.setTenantId(tenantEntity.getParentTenantId()); | |||||
| }else{ | |||||
| wxLevelConfig.setTenantId(tenantEntity.getTenantId()); | |||||
| } | |||||
| wxLevelConfig.updateTenantInfo(getFinalTenantInfo()); | |||||
| wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | ||||
| final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(tenantEntity,wxLevelConfig, pageNum, pageSize); | |||||
| final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(getTenantInfo(),wxLevelConfig, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -67,7 +62,7 @@ public class WxLevelConfigController extends BaseController { | |||||
| if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | ||||
| } | } | ||||
| wxLevelConfigService.batchSave(ifParentUpdateTenantInfo(), levelConfigs); | |||||
| wxLevelConfigService.batchSave(getTenantInfo(), levelConfigs); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.DB_FAIL); | return new ResultData(ErrorCode.DB_FAIL); | ||||
| @@ -84,7 +79,7 @@ public class WxLevelConfigController extends BaseController { | |||||
| if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | if (StringUtils.isNotBlank(ifParentUpdateTenantInfo().getParentTenantId())) { | ||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | ||||
| } | } | ||||
| wxLevelConfigService.batchUpdateCapabilities(ifParentUpdateTenantInfo(), levelConfigs); | |||||
| wxLevelConfigService.batchUpdateCapabilities(getTenantInfo(), levelConfigs); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| return new ResultData(ErrorCode.DB_FAIL); | return new ResultData(ErrorCode.DB_FAIL); | ||||
| @@ -37,7 +37,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| @SystemControllerLog(description = "成长值-配置") | @SystemControllerLog(description = "成长值-配置") | ||||
| public ResultData list() { | public ResultData list() { | ||||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | ||||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(ifParentUpdateTenantInfo()); | |||||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(getFinalTenantInfo()); | |||||
| if (scoreRules.getCreditLocked() == null) { | if (scoreRules.getCreditLocked() == null) { | ||||
| scoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | scoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | ||||
| } | } | ||||
| @@ -23,11 +23,11 @@ public interface TtCUserMapper extends CommonMapper<TtCUser, Long> { | |||||
| long findCount(WxCUserBasicInfoDto basicDto); | long findCount(WxCUserBasicInfoDto basicDto); | ||||
| List<UserCountVo> findCountHistory(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("basicDto")WxCUserBasicInfoDto basicDto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto basicDto); | |||||
| List<TtCUser> listByChannel(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("ttCUser")TtCUser ttCUser); | |||||
| List<TtCUser> listByChannel(TtCUser ttCUser); | |||||
| long countByChannel(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("ttCUser")TtCUser ttCUser); | |||||
| long countByChannel(TtCUser ttCUser); | |||||
| //List<Map<String, Object>> checkCountByTenantOpenId(); | //List<Map<String, Object>> checkCountByTenantOpenId(); | ||||
| @@ -23,11 +23,11 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| long findCount(WxCUserBasicInfoDto basicDto); | long findCount(WxCUserBasicInfoDto basicDto); | ||||
| List<UserCountVo> findCountHistory(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("basicDto")WxCUserBasicInfoDto basicDto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto basicDto); | |||||
| List<WxCUser> listByChannel(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("wxCUser")WxCUser wxCUser); | |||||
| List<WxCUser> listByChannel(WxCUser wxCUser); | |||||
| long countByChannel(@Param("tenantEntitys")List<TenantEntity> tenantEntitys, @Param("wxCUser")WxCUser wxCUser); | |||||
| long countByChannel(WxCUser wxCUser); | |||||
| //List<Map<String, Object>> checkCountByTenantOpenId(); | //List<Map<String, Object>> checkCountByTenantOpenId(); | ||||
| @@ -88,32 +88,29 @@ public interface TtCUserService { | |||||
| * @param tenantEntitys | * @param tenantEntitys | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| long findCount(WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 统计数量 | * 统计数量 | ||||
| * @param dto | * @param dto | ||||
| * @param tenantEntitys | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 通过渠道获取会员信息 | * 通过渠道获取会员信息 | ||||
| * @param user | * @param user | ||||
| * @param tenantEntitys | |||||
| * @param pageIndex | * @param pageIndex | ||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<TtCUser> listByChannel(TtCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<TtCUser> listByChannel(TtCUser user, Integer pageIndex, Integer pageSize); | |||||
| long countByChannel(List<TenantEntity> tenantEntitys, TtCUser user); | |||||
| long countByChannel(TtCUser user); | |||||
| /** | /** | ||||
| * 登录后发消息 | * 登录后发消息 | ||||
| * @param user | |||||
| */ | */ | ||||
| void actionMsgAfterLogin(WxCUserFrom wxCUserFrom); | void actionMsgAfterLogin(WxCUserFrom wxCUserFrom); | ||||
| @@ -105,7 +105,6 @@ public interface WxCUserBasicInfoService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| long findCountBySex(WxCUserBasicInfoDto dto); | long findCountBySex(WxCUserBasicInfoDto dto); | ||||
| long findCountBySex(TenantEntity tenantInfo, WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 根据年龄查询数量 | * 根据年龄查询数量 | ||||
| @@ -115,7 +114,6 @@ public interface WxCUserBasicInfoService { | |||||
| */ | */ | ||||
| long findCountByAge(WxCUserBasicInfoDto dto); | long findCountByAge(WxCUserBasicInfoDto dto); | ||||
| long findCountByAge(TenantEntity tenantInfo, WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 根据年龄积分查寻数量 | * 根据年龄积分查寻数量 | ||||
| @@ -124,13 +122,10 @@ public interface WxCUserBasicInfoService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| long findCountByScore(WxCUserBasicInfoDto dto); | long findCountByScore(WxCUserBasicInfoDto dto); | ||||
| long findCountByScore(TenantEntity tenantInfo,WxCUserBasicInfoDto dto); | |||||
| int exportDataCount(WxCUserBasicInfo basicInfo); | int exportDataCount(WxCUserBasicInfo basicInfo); | ||||
| int exportDataCount(TenantEntity tenantInfo, WxCUserBasicInfo basicInfo); | |||||
| void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response); | void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response); | ||||
| void exportData(TenantEntity tenantInfo, WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response); | |||||
| void exportTemplate(HttpServletRequest request, HttpServletResponse response); | void exportTemplate(HttpServletRequest request, HttpServletResponse response); | ||||
| @@ -138,10 +133,8 @@ public interface WxCUserBasicInfoService { | |||||
| void importOneMem(String importKey, List<WxTags> tagList, CUserBaseInfoT uBase,MallUserInfo mallUserInfo); | void importOneMem(String importKey, List<WxTags> tagList, CUserBaseInfoT uBase,MallUserInfo mallUserInfo); | ||||
| long findCount(WxCUserBasicInfoDto dto); | long findCount(WxCUserBasicInfoDto dto); | ||||
| long findCount(TenantEntity tenantInfo,WxCUserBasicInfoDto dto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | ||||
| List<UserCountVo> findCountHistory(TenantEntity tenantInfo,WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 停车会员记录导出 | * 停车会员记录导出 | ||||
| * @param record | * @param record | ||||
| @@ -99,15 +99,14 @@ public interface WxCUserService { | |||||
| * @param tenantEntitys | * @param tenantEntitys | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| long findCount(WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| * 统计数量 | * 统计数量 | ||||
| * @param dto | * @param dto | ||||
| * @param tenantEntitys | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| /** | /** | ||||
| @@ -118,9 +117,9 @@ public interface WxCUserService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCUser> listByChannel(WxCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize); | |||||
| long countByChannel(List<TenantEntity> tenantEntitys, WxCUser user); | |||||
| long countByChannel(WxCUser user); | |||||
| /** | /** | ||||
| * 登录后发消息 | * 登录后发消息 | ||||
| @@ -42,9 +42,9 @@ public interface CUserServiceApapter { | |||||
| void updateMsgCount(CUser user); | void updateMsgCount(CUser user); | ||||
| long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| long findCount(WxCUserBasicInfoDto dto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| void actionAfterLogin(CUser user); | void actionAfterLogin(CUser user); | ||||
| @@ -245,12 +245,12 @@ public class TtBUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return 0l; | return 0l; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -300,19 +300,13 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| long count = 0l; | |||||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| long count1 = ttCUserMapper.findCount(dto); | |||||
| count += count1; | |||||
| } | |||||
| return count; | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return ttCUserMapper.findCount(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| return ttCUserMapper.findCountHistory(tenantEntitys,dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return ttCUserMapper.findCountHistory(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -245,12 +245,12 @@ public class WxBUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return 0l; | return 0l; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @@ -308,19 +308,13 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| long count = 0l; | |||||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| long count1 = wxCUserMapper.findCount(dto); | |||||
| count += count1; | |||||
| } | |||||
| return count; | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCount(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| return wxCUserMapper.findCountHistory(tenantEntitys,dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCountHistory(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -162,29 +162,23 @@ public class TtCUserServiceImpl implements TtCUserService { | |||||
| // } | // } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| long count = 0l; | |||||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| long count1 = ttCUserMapper.findCount(dto); | |||||
| count += count1; | |||||
| } | |||||
| return count; | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return ttCUserMapper.findCount(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| return ttCUserMapper.findCountHistory(tenantEntitys,dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return ttCUserMapper.findCountHistory(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<TtCUser> listByChannel(TtCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> ttCUserMapper.listByChannel(tenantEntitys,user)); | |||||
| public PageInfo<TtCUser> listByChannel(TtCUser user, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> ttCUserMapper.listByChannel(user)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long countByChannel(List<TenantEntity> tenantEntitys, TtCUser user) { | |||||
| return ttCUserMapper.countByChannel(tenantEntitys, user); | |||||
| public long countByChannel(TtCUser user) { | |||||
| return ttCUserMapper.countByChannel(user); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -767,49 +767,21 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| return wxCUserBasicInfoMapper.findCountBySex(dto); | return wxCUserBasicInfoMapper.findCountBySex(dto); | ||||
| } | } | ||||
| @Override | |||||
| public long findCountBySex(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { | |||||
| dto.setTenantId(tenantInfo.getTenantId()); | |||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| return wxCUserBasicInfoMapper.findCountBySex(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public long findCountByAge(WxCUserBasicInfoDto dto) { | public long findCountByAge(WxCUserBasicInfoDto dto) { | ||||
| return wxCUserBasicInfoMapper.findCountByAge(dto); | return wxCUserBasicInfoMapper.findCountByAge(dto); | ||||
| } | } | ||||
| @Override | |||||
| public long findCountByAge(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { | |||||
| dto.setTenantId(tenantInfo.getTenantId()); | |||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| return wxCUserBasicInfoMapper.findCountByAge(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public long findCountByScore(WxCUserBasicInfoDto dto) { | public long findCountByScore(WxCUserBasicInfoDto dto) { | ||||
| return wxCUserBasicInfoMapper.findCountByScore(dto); | return wxCUserBasicInfoMapper.findCountByScore(dto); | ||||
| } | } | ||||
| @Override | |||||
| public long findCountByScore(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { | |||||
| dto.setTenantId(tenantInfo.getTenantId()); | |||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| return wxCUserBasicInfoMapper.findCountByScore(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public int exportDataCount(WxCUserBasicInfo basicInfo) { | public int exportDataCount(WxCUserBasicInfo basicInfo) { | ||||
| return wxCUserBasicInfoMapper.countVoList(basicInfo); | return wxCUserBasicInfoMapper.countVoList(basicInfo); | ||||
| } | } | ||||
| @Override | |||||
| public int exportDataCount(TenantEntity tenantInfo, WxCUserBasicInfo basicInfo) { | |||||
| basicInfo.setTenantId(tenantInfo.getTenantId()); | |||||
| basicInfo.undateFinalTenantId(tenantInfo); | |||||
| return wxCUserBasicInfoMapper.countVoList(basicInfo); | |||||
| } | |||||
| @Override | @Override | ||||
| public void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response) { | public void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response) { | ||||
| // List<WxCUserBasicInfoVo> list = wxCUserBasicInfoMapper.findVoList(basicInfo); | // List<WxCUserBasicInfoVo> list = wxCUserBasicInfoMapper.findVoList(basicInfo); | ||||
| @@ -823,31 +795,6 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| excelService.exportBigExcel(this,basicInfo, null, "会员信息", WxCUserBasicInfoVo.class, "会员信息数据.xlsx", response, false); | excelService.exportBigExcel(this,basicInfo, null, "会员信息", WxCUserBasicInfoVo.class, "会员信息数据.xlsx", response, false); | ||||
| } | } | ||||
| @Override | |||||
| public void exportData(TenantEntity tenantInfo, WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response) { | |||||
| // List<WxCUserBasicInfoVo> list = new ArrayList<WxCUserBasicInfoVo>(); | |||||
| // if(StringUtils.isNotBlank(tenantInfo.getParentTenantId())){ | |||||
| // //关联微信表查询 | |||||
| // list = wxCUserBasicInfoMapper.findVoList1(tenantInfo,basicInfo); | |||||
| // }else{ | |||||
| // //直接查询本表 | |||||
| // basicInfo.undateFinalTenantId(tenantInfo); | |||||
| // list = wxCUserBasicInfoMapper.findVoList(basicInfo); | |||||
| // } | |||||
| // List<WxTags> tagList = wxTagsMapper.findListAll(); | |||||
| // Map<Long, String> tagMap = tagList.stream().collect(Collectors.toMap(WxTags::getId, WxTags::getName)); | |||||
| // list.stream().filter(u->u.getTags()!=null).forEach(u->{ | |||||
| // List<Long> ids = JSONObject.parseArray(u.getTags(), Long.class); | |||||
| // String tagNames = StringUtils.join(ids.stream().map(id->tagMap.get(id)).collect(Collectors.toList()),"/"); | |||||
| // u.setTagNames(tagNames); | |||||
| // }); | |||||
| // excelService.exportExcel(list, null, "会员信息", WxCUserBasicInfoVo.class, "会员信息数据.xlsx", response, false); | |||||
| Map params = new HashMap(); | |||||
| params.put("tenantInfo", tenantInfo); | |||||
| params.put("basicInfo", basicInfo); | |||||
| excelService.exportBigExcel(this,params, null, "会员信息", WxCUserBasicInfoVo.class, "会员信息数据.xlsx", response, false); | |||||
| } | |||||
| public void exportTemplate(HttpServletRequest request, HttpServletResponse response) { | public void exportTemplate(HttpServletRequest request, HttpServletResponse response) { | ||||
| List<WxCUserBasicInfoVo> list = new ArrayList<>(); | List<WxCUserBasicInfoVo> list = new ArrayList<>(); | ||||
| WxCUserBasicInfoVo u1 = new WxCUserBasicInfoVo(); | WxCUserBasicInfoVo u1 = new WxCUserBasicInfoVo(); | ||||
| @@ -1183,25 +1130,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| return wxCUserBasicInfoMapper.findCount(dto); | return wxCUserBasicInfoMapper.findCount(dto); | ||||
| } | } | ||||
| @Override | |||||
| public long findCount(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { | |||||
| dto.setTenantId(tenantInfo.getTenantId()); | |||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| return wxCUserBasicInfoMapper.findCount(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | ||||
| return wxCUserBasicInfoMapper.findCountHistory(dto); | return wxCUserBasicInfoMapper.findCountHistory(dto); | ||||
| } | } | ||||
| @Override | |||||
| public List<UserCountVo> findCountHistory(TenantEntity tenantInfo, WxCUserBasicInfoDto dto) { | |||||
| dto.setTenantId(tenantInfo.getTenantId()); | |||||
| dto.setFinalTenantId(tenantInfo.getFinalTenantId()); | |||||
| return wxCUserBasicInfoMapper.findCountHistory(dto); | |||||
| } | |||||
| @Override | @Override | ||||
| public void exportCarPayData(WxCarPayRecord record, HttpServletRequest request, HttpServletResponse response) { | public void exportCarPayData(WxCarPayRecord record, HttpServletRequest request, HttpServletResponse response) { | ||||
| List<WxCarPayRecord> list = wxCarPayRecordMapper.findCarPayList(record); | List<WxCarPayRecord> list = wxCarPayRecordMapper.findCarPayList(record); | ||||
| @@ -224,29 +224,23 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| // } | // } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| long count = 0l; | |||||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| long count1 = wxCUserMapper.findCount(dto); | |||||
| count += count1; | |||||
| } | |||||
| return count; | |||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCount(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto, List<TenantEntity> tenantEntitys) { | |||||
| return wxCUserMapper.findCountHistory(tenantEntitys,dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCountHistory(dto); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxCUser> listByChannel(WxCUser user, List<TenantEntity> tenantEntitys, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(tenantEntitys,user)); | |||||
| public PageInfo<WxCUser> listByChannel(WxCUser user, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserMapper.listByChannel(user)); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long countByChannel(List<TenantEntity> tenantEntitys, WxCUser user) { | |||||
| return wxCUserMapper.countByChannel(tenantEntitys, user); | |||||
| public long countByChannel(WxCUser user) { | |||||
| return wxCUserMapper.countByChannel(user); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -1383,11 +1383,11 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getNewUserCount(TenantEntity tenantEntity) { | private ResultData getNewUserCount(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| long allCount = wxCUserService.findCount(dto,tenantEntitys);//总数 | |||||
| long allCount = wxCUserService.findCount(dto);//总数 | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| @@ -1398,7 +1398,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long todayCount = wxCUserService.findCount(dto,tenantEntitys); | |||||
| long todayCount = wxCUserService.findCount(dto); | |||||
| datamap.put("allCount", allCount);//会员总数 | datamap.put("allCount", allCount);//会员总数 | ||||
| datamap.put("todayCount", todayCount);//今日新增会员数 | datamap.put("todayCount", todayCount);//今日新增会员数 | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -1475,7 +1475,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| private ResultData getNewMemberCount(TenantEntity tenantEntity, int days, String returnName) { | private ResultData getNewMemberCount(TenantEntity tenantEntity, int days, String returnName) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| @@ -1492,7 +1492,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = wxCUserService.findCount(dto,tenantEntitys); | |||||
| long count = wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | ||||
| vo.setSortNum(sortNum++); | vo.setSortNum(sortNum++); | ||||
| @@ -1792,12 +1792,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getMemeberWechatTotal(TenantEntity tenantEntity) { | private ResultData getMemeberWechatTotal(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | dto.updateTenantInfo(tenantEntity); | ||||
| //微信用户数据 | //微信用户数据 | ||||
| long wxallCount = wxCUserService.findCount(dto,tenantEntitys);//总量 | |||||
| long wxallCount = wxCUserService.findCount(dto);//总量 | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| @@ -1805,7 +1805,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date today = c.getTime(); | Date today = c.getTime(); | ||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long wxtodayCount = wxCUserService.findCount(dto,tenantEntitys);//今天新增 | |||||
| long wxtodayCount = wxCUserService.findCount(dto);//今天新增 | |||||
| datamap.put("wxallCount", wxallCount);//累计会员总数 | datamap.put("wxallCount", wxallCount);//累计会员总数 | ||||
| datamap.put("wxtodayCount", wxtodayCount);//今日新增会员数 | datamap.put("wxtodayCount", wxtodayCount);//今日新增会员数 | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -1819,7 +1819,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| private ResultData getMemberTotalCount(TenantEntity tenantEntity) { | private ResultData getMemberTotalCount(TenantEntity tenantEntity) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| long allCount = wxCUserBasicInfoService.findCount(tenantEntity,dto);//总量 | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| long allCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| @@ -1827,7 +1828,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date today = c.getTime(); | Date today = c.getTime(); | ||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long todayCount = wxCUserBasicInfoService.findCount(tenantEntity,dto);//今天新增 | |||||
| long todayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| datamap.put("allCount", allCount);//累计会员总数 | datamap.put("allCount", allCount);//累计会员总数 | ||||
| datamap.put("todayCount", todayCount);//今日新增会员数 | datamap.put("todayCount", todayCount);//今日新增会员数 | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -1839,7 +1840,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getMemberWechatJoinTrade(TenantEntity tenantEntity) { | private ResultData getMemberWechatJoinTrade(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| final int daysBefore = 29; | final int daysBefore = 29; | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| @@ -1858,7 +1859,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = wxCUserService.findCount(dto,tenantEntitys); | |||||
| long count = wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setSortNum(j); | vo.setSortNum(j); | ||||
| j++; | j++; | ||||
| @@ -1872,7 +1873,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | 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,tenantEntitys);//统计的第一天总数 | |||||
| long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | |||||
| int i = 0; | int i = 0; | ||||
| long sumCount = 0; | long sumCount = 0; | ||||
| for (UserStructureVo v : wxnewCountVos) { | for (UserStructureVo v : wxnewCountVos) { | ||||
| @@ -1942,6 +1943,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| private ResultData getMemberJoinTrade(TenantEntity tenantEntity) { | private ResultData getMemberJoinTrade(TenantEntity tenantEntity) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| final int daysBefore = 29; | final int daysBefore = 29; | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -1957,7 +1959,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long count = wxCUserBasicInfoService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setSortNum(j); | vo.setSortNum(j); | ||||
| j++; | j++; | ||||
| @@ -1971,7 +1973,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | 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(tenantEntity,dto);//统计的第一天总数 | |||||
| long firstDay = wxCUserBasicInfoService.findCount(dto);//统计的第一天总数 | |||||
| int i = 0; | int i = 0; | ||||
| long sumCount = 0; | long sumCount = 0; | ||||
| for (UserStructureVo v : newCountVos) { | for (UserStructureVo v : newCountVos) { | ||||
| @@ -1993,7 +1995,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getFromChannelAnalysis(TenantEntity tenantEntity) { | private ResultData getFromChannelAnalysis(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| List<WxUserChannel> channelStructureList = new ArrayList<>(); | List<WxUserChannel> channelStructureList = new ArrayList<>(); | ||||
| WxCUser wxCUser = new WxCUser(); | WxCUser wxCUser = new WxCUser(); | ||||
| @@ -2014,7 +2016,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| wxCUser.setSceneList(sceneList); | wxCUser.setSceneList(sceneList); | ||||
| WxUserChannel channelStructure = new WxUserChannel(); | WxUserChannel channelStructure = new WxUserChannel(); | ||||
| channelStructure.setChannelName(w.getChannelName()); | channelStructure.setChannelName(w.getChannelName()); | ||||
| channelStructure.setCount(wxCUserMapper.countByChannel(tenantEntitys,wxCUser)); | |||||
| channelStructure.setCount(wxCUserMapper.countByChannel(wxCUser)); | |||||
| channelStructureList.add(channelStructure); | channelStructureList.add(channelStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -2028,7 +2030,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getWechatMemberTrade(TenantEntity tenantEntity) { | private ResultData getWechatMemberTrade(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| final int daysBefore = 29; | final int daysBefore = 29; | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| @@ -2047,7 +2049,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = wxCUserService.findCount(dto,tenantEntitys); | |||||
| long count = wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setSortNum(j); | vo.setSortNum(j); | ||||
| j++; | j++; | ||||
| @@ -2083,7 +2085,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long count = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long count = wxCUserBasicInfoService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | UserStructureVo vo = new UserStructureVo(); | ||||
| vo.setSortNum(j); | vo.setSortNum(j); | ||||
| j++; | j++; | ||||
| @@ -2101,7 +2103,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getSceneAnalysis(TenantEntity tenantEntity) { | private ResultData getSceneAnalysis(TenantEntity tenantEntity) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| List<WxUserChannel> senceStructureList = new ArrayList<>(); | List<WxUserChannel> senceStructureList = new ArrayList<>(); | ||||
| WxCUser wxCUser = new WxCUser(); | WxCUser wxCUser = new WxCUser(); | ||||
| @@ -2118,7 +2120,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| wxCUser.setSceneList(scene); | wxCUser.setSceneList(scene); | ||||
| WxUserChannel senceStructure = new WxUserChannel(); | WxUserChannel senceStructure = new WxUserChannel(); | ||||
| senceStructure.setDescription(uc.getDescription()); | senceStructure.setDescription(uc.getDescription()); | ||||
| senceStructure.setCount(wxCUserMapper.countByChannel(tenantEntitys, wxCUser)); | |||||
| senceStructure.setCount(wxCUserMapper.countByChannel(wxCUser)); | |||||
| senceStructureList.add(senceStructure); | senceStructureList.add(senceStructure); | ||||
| } | } | ||||
| } | } | ||||
| @@ -2138,9 +2140,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| private ResultData getMemberSexRate(TenantEntity tenantEntity, String startdate, String enddate) { | private ResultData getMemberSexRate(TenantEntity tenantEntity, String startdate, String enddate) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | dto.setStartTime(DateUtils.stringToDate(startdate)); | ||||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | dto.setEndTime(DateUtils.stringToDate(enddate)); | ||||
| long all = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long all = wxCUserBasicInfoService.findCount(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| for (EnumAgeInfo a : EnumAgeInfo.values()) { | for (EnumAgeInfo a : EnumAgeInfo.values()) { | ||||
| @@ -2149,7 +2152,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| c.set(Calendar.SECOND, 0); | c.set(Calendar.SECOND, 0); | ||||
| long count = getCountByAge(tenantEntity,a, c, dto); | |||||
| long count = getCountByAge(a, c, dto); | |||||
| vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | ||||
| } | } | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -2163,13 +2166,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| private ResultData getMemberBindCar(TenantEntity tenantEntity, String startdate, String enddate) { | private ResultData getMemberBindCar(TenantEntity tenantEntity, String startdate, String enddate) { | ||||
| List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| // List<TenantEntity> tenantEntitys = wxMallMapper.getTenantEntitys(tenantEntity); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | dto.setStartTime(DateUtils.stringToDate(startdate)); | ||||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | dto.setEndTime(DateUtils.stringToDate(enddate)); | ||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| long userCountWithCar = wxCUserCarService.countUser(dto); | long userCountWithCar = wxCUserCarService.countUser(dto); | ||||
| Map userWithCar = new HashMap(); | Map userWithCar = new HashMap(); | ||||
| userWithCar.put("title", "已绑定车牌"); | userWithCar.put("title", "已绑定车牌"); | ||||
| @@ -2203,9 +2205,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| private ResultData getMemberAgeAnalysis(TenantEntity tenantEntity, String startdate, String enddate) { | private ResultData getMemberAgeAnalysis(TenantEntity tenantEntity, String startdate, String enddate) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | dto.setStartTime(DateUtils.stringToDate(startdate)); | ||||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | dto.setEndTime(DateUtils.stringToDate(enddate)); | ||||
| long all = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long all = wxCUserBasicInfoService.findCount(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | List<UserStructureVo> vos = new ArrayList<>(); | ||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| for (EnumAgeInfo a : EnumAgeInfo.values()) { | for (EnumAgeInfo a : EnumAgeInfo.values()) { | ||||
| @@ -2214,7 +2217,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| c.set(Calendar.MINUTE, 0); | c.set(Calendar.MINUTE, 0); | ||||
| c.set(Calendar.SECOND, 0); | c.set(Calendar.SECOND, 0); | ||||
| long count = getCountByAge(tenantEntity,a, c, dto); | |||||
| long count = getCountByAge(a, c, dto); | |||||
| vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | ||||
| } | } | ||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| @@ -2235,6 +2238,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| for (int i = 0; i < levelList.size(); i++) { | for (int i = 0; i < levelList.size(); i++) { | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setStartTime(DateUtils.stringToDate(startdate)); | dto.setStartTime(DateUtils.stringToDate(startdate)); | ||||
| dto.setEndTime(DateUtils.stringToDate(enddate)); | dto.setEndTime(DateUtils.stringToDate(enddate)); | ||||
| if (i + 1 < levelList.size()) { | if (i + 1 < levelList.size()) { | ||||
| @@ -2244,7 +2248,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setLevelStartScore(levelList.get(i).getPoints()); | dto.setLevelStartScore(levelList.get(i).getPoints()); | ||||
| } | } | ||||
| long all = wxCUserBasicInfoService.findCountByScore(tenantEntity,dto); | |||||
| long all = wxCUserBasicInfoService.findCountByScore(dto); | |||||
| levelList.get(i).setCount(all); | levelList.get(i).setCount(all); | ||||
| } | } | ||||
| @@ -2252,7 +2256,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| //没有等级的会员 | //没有等级的会员 | ||||
| other.setLevel("无"); | other.setLevel("无"); | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| other.setCount(wxCUserBasicInfoService.findCount(tenantEntity,dto) | |||||
| dto.updateTenantInfo(tenantEntity); | |||||
| other.setCount(wxCUserBasicInfoService.findCount(dto) | |||||
| - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | - levelList.stream().map(WxLevelConfig::getCount).reduce(Long::sum).orElse(0L)); | ||||
| levelList.add(other); | levelList.add(other); | ||||
| return new ResultData(levelList); | return new ResultData(levelList); | ||||
| @@ -2267,11 +2272,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| */ | */ | ||||
| private ResultData getMobileBrandAnalysis(TenantEntity tenantEntity, String startdate, String enddate) { | private ResultData getMobileBrandAnalysis(TenantEntity tenantEntity, String startdate, String enddate) { | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| Date startTime = DateUtils.stringToDate(startdate); | Date startTime = DateUtils.stringToDate(startdate); | ||||
| Date endTime = DateUtils.stringToDate(enddate); | Date endTime = DateUtils.stringToDate(enddate); | ||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| EnumTag[] tags = {EnumTag.ID_49, | EnumTag[] tags = {EnumTag.ID_49, | ||||
| EnumTag.ID_50, | EnumTag.ID_50, | ||||
| @@ -2303,11 +2309,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| */ | */ | ||||
| private ResultData getMemActivity(TenantEntity tenantEntity, String startdate, String enddate) { | private ResultData getMemActivity(TenantEntity tenantEntity, String startdate, String enddate) { | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| Date startTime = DateUtils.stringToDate(startdate); | Date startTime = DateUtils.stringToDate(startdate); | ||||
| Date endTime = DateUtils.stringToDate(enddate); | Date endTime = DateUtils.stringToDate(enddate); | ||||
| dto.setStartTime(startTime); | dto.setStartTime(startTime); | ||||
| dto.setEndTime(endTime); | dto.setEndTime(endTime); | ||||
| long total = wxCUserBasicInfoService.findCount(tenantEntity,dto); | |||||
| long total = wxCUserBasicInfoService.findCount(dto); | |||||
| List<WxTags> tagList = new ArrayList<>(); | List<WxTags> tagList = new ArrayList<>(); | ||||
| EnumTag[] tags = { | EnumTag[] tags = { | ||||
| EnumTag.ID_112, | EnumTag.ID_112, | ||||
| @@ -2689,7 +2696,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| private long getCountByAge(TenantEntity tenantInfo,EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| private long getCountByAge(EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| if (a.getStart() != 0 || a.getEnd() != 0) { | if (a.getStart() != 0 || a.getEnd() != 0) { | ||||
| c.add(Calendar.YEAR, -a.getEnd()); | c.add(Calendar.YEAR, -a.getEnd()); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| @@ -2705,7 +2712,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| dto.setBirthEndTime(null); | dto.setBirthEndTime(null); | ||||
| } | } | ||||
| return wxCUserBasicInfoService.findCountByAge(tenantInfo,dto); | |||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| } | } | ||||
| private UserStructureVo getVo(long count, long all, String name, Integer num) { | private UserStructureVo getVo(long count, long all, String name, Integer num) { | ||||
| @@ -77,11 +77,12 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||||
| l.setScale(WxLevelConfig.DEFAULT_SCALE); | l.setScale(WxLevelConfig.DEFAULT_SCALE); | ||||
| } | } | ||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.updateTenantInfo(tenantEntity); | |||||
| dto.setLevelStartScore(l.getPoints()); | dto.setLevelStartScore(l.getPoints()); | ||||
| if (i + 1<page.getList().size()) | if (i + 1<page.getList().size()) | ||||
| dto.setLevelEndScore(page.getList().get(i+1).getPoints()); | dto.setLevelEndScore(page.getList().get(i+1).getPoints()); | ||||
| l.setUserCount(wxCUserBasicInfoService.findCountByScore(tenantEntity,dto)); | |||||
| l.setUserCount(wxCUserBasicInfoService.findCountByScore(dto)); | |||||
| } | } | ||||
| return page; | return page; | ||||
| @@ -190,7 +191,7 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||||
| levelConfigs.add(levelConfig); | levelConfigs.add(levelConfig); | ||||
| } | } | ||||
| wxLevelConfigMapper.insertBatch(levelConfigs); | wxLevelConfigMapper.insertBatch(levelConfigs); | ||||
| this.deleteRedis(tenantEntity.getTenantId()); | |||||
| this.deleteRedis(tenantEntity.getFinalTenantId()); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -233,7 +233,9 @@ | |||||
| <select id="listOpenId" parameterType="com.iformall.domain.po.tt.TtCUser" resultType="String"> | <select id="listOpenId" parameterType="com.iformall.domain.po.tt.TtCUser" resultType="String"> | ||||
| select open_id from tt_c_user where msg_count >= 10 | |||||
| select open_id | |||||
| from tt_c_user | |||||
| where msg_count >= 10 | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -243,7 +245,8 @@ | |||||
| </select> | </select> | ||||
| <update id="updateMsgCount" parameterType="com.iformall.domain.po.tt.TtCUser"> | <update id="updateMsgCount" parameterType="com.iformall.domain.po.tt.TtCUser"> | ||||
| update tt_c_user set msg_count = msg_count+2 | |||||
| update tt_c_user | |||||
| set msg_count = msg_count+2 | |||||
| where msg_count < 10 | where msg_count < 10 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| @@ -269,7 +272,8 @@ | |||||
| <!-- </update>--> | <!-- </update>--> | ||||
| <select id="findByOpenId" parameterType="com.iformall.domain.po.tt.TtCUser" resultMap="BaseResultMap"> | <select id="findByOpenId" parameterType="com.iformall.domain.po.tt.TtCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from tt_c_user | |||||
| select <include refid="allColumns"/> | |||||
| from tt_c_user | |||||
| where `open_id` = #{openId} | where `open_id` = #{openId} | ||||
| <if test=" null != appId and '' != appId"> | <if test=" null != appId and '' != appId"> | ||||
| and `app_id` = #{appId} | and `app_id` = #{appId} | ||||
| @@ -278,21 +282,31 @@ | |||||
| </select> | </select> | ||||
| <select id="findByUnionId" parameterType="com.iformall.domain.po.tt.TtCUser" resultMap="BaseResultMap"> | <select id="findByUnionId" parameterType="com.iformall.domain.po.tt.TtCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from tt_c_user | |||||
| select <include refid="allColumns"/> | |||||
| from tt_c_user | |||||
| where `open_app_id` = #{openAppId} and `union_id` = #{unionId} | where `open_app_id` = #{openAppId} and `union_id` = #{unionId} | ||||
| </select> | </select> | ||||
| <select id="findByToken" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="findByToken" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from tt_c_user | |||||
| select <include refid="allColumns"/> | |||||
| from tt_c_user | |||||
| where `token` = #{token} and `tenant_id` = #{tenantId} | where `token` = #{token} and `tenant_id` = #{tenantId} | ||||
| </select> | </select> | ||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from tt_c_user where id = #{id} and `tenant_id` = #{tenantId} | |||||
| select <include refid="allColumns"/> | |||||
| from tt_c_user | |||||
| where id = #{id} | |||||
| and `tenant_id` = #{tenantId} | |||||
| </select> | </select> | ||||
| <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | ||||
| select count(id) from tt_c_user where 1=1 | |||||
| select count(id) | |||||
| from tt_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != sex "> | <if test=" null != sex "> | ||||
| and gender =#{sex} | and gender =#{sex} | ||||
| </if> | </if> | ||||
| @@ -302,114 +316,76 @@ | |||||
| <if test=" null != endTime"> | <if test=" null != endTime"> | ||||
| and create_date < #{endTime} | and create_date < #{endTime} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="findCountHistory" resultType="com.iformall.domain.vo.UserCountVo"> | <select id="findCountHistory" resultType="com.iformall.domain.vo.UserCountVo"> | ||||
| select count(id) as incCount, | select count(id) as incCount, | ||||
| <if test="1 == basicDto.reportType "> | |||||
| <if test="1 == reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') as reportTime, | date_format(create_date, '%Y-%m-%d') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="2 == basicDto.reportType "> | |||||
| <if test="2 == reportType "> | |||||
| date_format(create_date, '%Y-%m') as reportTime, | date_format(create_date, '%Y-%m') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="3 == basicDto.reportType "> | |||||
| <if test="3 == reportType "> | |||||
| date_format(create_date, '%Y') as reportTime, | date_format(create_date, '%Y') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| (select count(id) from | |||||
| (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from tt_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) tt_c_user where | |||||
| <if test="1 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') <= reportTime | |||||
| </if> | |||||
| <if test="2 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m') <= reportTime | |||||
| </if> | |||||
| <if test="3 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y') <= reportTime | |||||
| </if> | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | |||||
| ) as totalCount | |||||
| </if> | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from tt_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) tt_c_user where 1=1 | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.startTime "> | |||||
| and create_date >= #{basicDto.startTime} | |||||
| </if> | |||||
| <if test=" null != basicDto.endTime"> | |||||
| and create_date < #{basicDto.endTime} | |||||
| </if> | |||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| from tt_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != startTime "> | |||||
| and create_date >= #{startTime} | |||||
| </if> | |||||
| <if test=" null != endTime"> | |||||
| and create_date < #{endTime} | |||||
| </if> | |||||
| <if test="1 == reportType or 2 == reportType or 3 == reportType"> | |||||
| group by reportTime | group by reportTime | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="listByChannel" resultMap="BaseResultMap" > | <select id="listByChannel" resultMap="BaseResultMap" > | ||||
| select id,user_id,nick_name,phone,create_date,scene_address from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from tt_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) tt_c_user where 1=1 | |||||
| <if test=" null != ttCUser.tenantId and '' != ttCUser.tenantId"> | |||||
| and `tenant_id` = #{ttCUser.tenantId} | |||||
| </if> | |||||
| <if test=" null != ttCUser.parentTenantId and '' != ttCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{ttCUser.parentTenantId} | |||||
| select id,user_id,nick_name,phone,create_date,scene_address | |||||
| from tt_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != ttCUser.startDate "> | |||||
| and create_date >= #{ttCUser.startDate} | |||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != ttCUser.endDate"> | |||||
| and create_date < #{ttCUser.endDate} | |||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| </if> | </if> | ||||
| <if test=" ttCUser.sceneList!= null "> | |||||
| <if test=" sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="ttCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != ttCUser.sortColumns"> order by ${ttCUser.sortColumns} </if> | |||||
| <if test=" null == ttCUser.sortColumns"> order by create_date desc </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by create_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="countByChannel" resultType="java.lang.Long" > | <select id="countByChannel" resultType="java.lang.Long" > | ||||
| select count(id) from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from tt_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) tt_c_user where 1=1 | |||||
| <if test=" null != ttCUser.tenantId and '' != ttCUser.tenantId"> | |||||
| and `tenant_id` = #{ttCUser.tenantId} | |||||
| </if> | |||||
| <if test=" null != ttCUser.parentTenantId and '' != ttCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{ttCUser.parentTenantId} | |||||
| select count(id) | |||||
| from tt_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != ttCUser.startDate "> | |||||
| and create_date >= #{ttCUser.startDate} | |||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != ttCUser.endDate"> | |||||
| and create_date < #{ttCUser.endDate} | |||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| </if> | </if> | ||||
| <if test=" ttCUser.sceneList!= null "> | |||||
| <if test=" sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="ttCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| @@ -421,8 +397,9 @@ | |||||
| <update id="updateUserId" parameterType="com.iformall.domain.po.tt.TtCUser"> | <update id="updateUserId" parameterType="com.iformall.domain.po.tt.TtCUser"> | ||||
| update tt_c_user set user_id=#{userId} | |||||
| where id = #{id} | |||||
| update tt_c_user | |||||
| set user_id=#{userId} | |||||
| where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="delForUserIdOnly"> | <update id="delForUserIdOnly"> | ||||
| @@ -315,24 +315,6 @@ | |||||
| <if test="3 == reportType "> | <if test="3 == reportType "> | ||||
| date_format(wcubi.create_date, '%Y') as reportTime, | date_format(wcubi.create_date, '%Y') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="1 == reportType or 2 == reportType or 3 == reportType"> | |||||
| (select count(wcubi.id) from wx_c_user_basic_info wcubi | |||||
| where wcubi.`final_tenant_id` = #{finalTenantId} | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') | |||||
| </if> | |||||
| <if test="1 == reportType "> | |||||
| and date_format(wcubi.create_date, '%Y-%m-%d') <= reportTime | |||||
| </if> | |||||
| <if test="2 == reportType "> | |||||
| and date_format(wcubi.create_date, '%Y-%m') <= reportTime | |||||
| </if> | |||||
| <if test="3 == reportType "> | |||||
| and date_format(wcubi.create_date, '%Y') <= reportTime | |||||
| </if> | |||||
| ) as totalCount | |||||
| </if> | |||||
| from wx_c_user_basic_info wcubi | from wx_c_user_basic_info wcubi | ||||
| where wcubi.`final_tenant_id` = #{finalTenantId} | where wcubi.`final_tenant_id` = #{finalTenantId} | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| @@ -233,7 +233,9 @@ | |||||
| <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | <select id="listOpenId" parameterType="com.iformall.domain.po.WxCUser" resultType="String"> | ||||
| select open_id from wx_c_user where msg_count >= 10 | |||||
| select open_id | |||||
| from wx_c_user | |||||
| where msg_count >= 10 | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| @@ -243,8 +245,9 @@ | |||||
| </select> | </select> | ||||
| <update id="updateMsgCount" parameterType="com.iformall.domain.po.WxCUser"> | <update id="updateMsgCount" parameterType="com.iformall.domain.po.WxCUser"> | ||||
| update wx_c_user set msg_count = msg_count+2 | |||||
| where msg_count < 10 | |||||
| update wx_c_user | |||||
| set msg_count = msg_count+2 | |||||
| where msg_count < 10 | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | </if> | ||||
| @@ -269,7 +272,8 @@ | |||||
| <!-- </update>--> | <!-- </update>--> | ||||
| <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | <select id="findByOpenId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user | |||||
| select <include refid="allColumns"/> | |||||
| from wx_c_user | |||||
| where `open_id` = #{openId} | where `open_id` = #{openId} | ||||
| <if test=" null != appId and '' != appId"> | <if test=" null != appId and '' != appId"> | ||||
| and `app_id` = #{appId} | and `app_id` = #{appId} | ||||
| @@ -278,21 +282,33 @@ | |||||
| </select> | </select> | ||||
| <select id="findByUnionId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | <select id="findByUnionId" parameterType="com.iformall.domain.po.WxCUser" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user | |||||
| where `open_app_id` = #{openAppId} and `union_id` = #{unionId} | |||||
| select <include refid="allColumns"/> | |||||
| from wx_c_user | |||||
| where `open_app_id` = #{openAppId} | |||||
| and `union_id` = #{unionId} | |||||
| </select> | </select> | ||||
| <select id="findByToken" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="findByToken" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user | |||||
| where `token` = #{token} and `tenant_id` = #{tenantId} | |||||
| select <include refid="allColumns"/> | |||||
| from wx_c_user | |||||
| where `token` = #{token} | |||||
| and `tenant_id` = #{tenantId} | |||||
| </select> | </select> | ||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_c_user where id = #{id} and `tenant_id` = #{tenantId} | |||||
| select <include refid="allColumns"/> | |||||
| from wx_c_user | |||||
| where id = #{id} | |||||
| and `tenant_id` = #{tenantId} | |||||
| </select> | </select> | ||||
| <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> | ||||
| select count(id) from wx_c_user where 1=1 | |||||
| select count(id) | |||||
| from wx_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != sex "> | <if test=" null != sex "> | ||||
| and gender =#{sex} | and gender =#{sex} | ||||
| </if> | </if> | ||||
| @@ -302,114 +318,75 @@ | |||||
| <if test=" null != endTime"> | <if test=" null != endTime"> | ||||
| and create_date < #{endTime} | and create_date < #{endTime} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="findCountHistory" resultType="com.iformall.domain.vo.UserCountVo"> | <select id="findCountHistory" resultType="com.iformall.domain.vo.UserCountVo"> | ||||
| select count(id) as incCount, | select count(id) as incCount, | ||||
| <if test="1 == basicDto.reportType "> | |||||
| <if test="1 == reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') as reportTime, | date_format(create_date, '%Y-%m-%d') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="2 == basicDto.reportType "> | |||||
| <if test="2 == reportType "> | |||||
| date_format(create_date, '%Y-%m') as reportTime, | date_format(create_date, '%Y-%m') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="3 == basicDto.reportType "> | |||||
| <if test="3 == reportType "> | |||||
| date_format(create_date, '%Y') as reportTime, | date_format(create_date, '%Y') as reportTime, | ||||
| </if> | </if> | ||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| (select count(id) from | |||||
| (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where | |||||
| <if test="1 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m-%d') <= reportTime | |||||
| </if> | |||||
| <if test="2 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y-%m') <= reportTime | |||||
| </if> | |||||
| <if test="3 == basicDto.reportType "> | |||||
| date_format(create_date, '%Y') <= reportTime | |||||
| </if> | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | |||||
| ) as totalCount | |||||
| </if> | |||||
| from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != basicDto.tenantId and '' != basicDto.tenantId"> | |||||
| and `tenant_id` = #{basicDto.tenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.parentTenantId and '' != basicDto.parentTenantId"> | |||||
| and `parent_tenant_id` = #{basicDto.parentTenantId} | |||||
| </if> | |||||
| <if test=" null != basicDto.startTime "> | |||||
| and create_date >= #{basicDto.startTime} | |||||
| </if> | |||||
| <if test=" null != basicDto.endTime"> | |||||
| and create_date < #{basicDto.endTime} | |||||
| </if> | |||||
| <if test="1 == basicDto.reportType or 2 == basicDto.reportType or 3 == basicDto.reportType"> | |||||
| from wx_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != startTime "> | |||||
| and create_date >= #{startTime} | |||||
| </if> | |||||
| <if test=" null != endTime"> | |||||
| and create_date < #{endTime} | |||||
| </if> | |||||
| <if test="1 == reportType or 2 == reportType or 3 == reportType"> | |||||
| group by reportTime | group by reportTime | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="listByChannel" resultMap="BaseResultMap" > | <select id="listByChannel" resultMap="BaseResultMap" > | ||||
| select id,user_id,nick_name,phone,create_date,scene_address from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != wxCUser.tenantId and '' != wxCUser.tenantId"> | |||||
| and `tenant_id` = #{wxCUser.tenantId} | |||||
| </if> | |||||
| <if test=" null != wxCUser.parentTenantId and '' != wxCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{wxCUser.parentTenantId} | |||||
| select id,user_id,nick_name,phone,create_date,scene_address | |||||
| from wx_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != wxCUser.startDate "> | |||||
| and create_date >= #{wxCUser.startDate} | |||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != wxCUser.endDate"> | |||||
| and create_date < #{wxCUser.endDate} | |||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| </if> | </if> | ||||
| <if test=" wxCUser.sceneList!= null "> | |||||
| <if test=" sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="wxCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != wxCUser.sortColumns"> order by ${wxCUser.sortColumns} </if> | |||||
| <if test=" null == wxCUser.sortColumns"> order by create_date desc </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by create_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="countByChannel" resultType="java.lang.Long" > | <select id="countByChannel" resultType="java.lang.Long" > | ||||
| select count(id) from (<foreach collection="tenantEntitys" item="tenantEntity" index="index" separator="union all"> | |||||
| SELECT * from wx_c_user${tenantEntity.shardTableSuffix} | |||||
| </foreach>) wx_c_user where 1=1 | |||||
| <if test=" null != wxCUser.tenantId and '' != wxCUser.tenantId"> | |||||
| and `tenant_id` = #{wxCUser.tenantId} | |||||
| </if> | |||||
| <if test=" null != wxCUser.parentTenantId and '' != wxCUser.parentTenantId"> | |||||
| and `parent_tenant_id` = #{wxCUser.parentTenantId} | |||||
| select count(id) | |||||
| from wx_c_user | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != wxCUser.startDate "> | |||||
| and create_date >= #{wxCUser.startDate} | |||||
| <if test=" null != startDate "> | |||||
| and create_date >= #{startDate} | |||||
| </if> | </if> | ||||
| <if test=" null != wxCUser.endDate"> | |||||
| and create_date < #{wxCUser.endDate} | |||||
| <if test=" null != endDate"> | |||||
| and create_date < #{endDate} | |||||
| </if> | </if> | ||||
| <if test=" wxCUser.sceneList!= null "> | |||||
| <if test=" sceneList!= null "> | |||||
| and scene_address in | and scene_address in | ||||
| <foreach collection="wxCUser.sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| <foreach collection="sceneList" index="index" item="scene" open="(" separator="," close=")"> | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| @@ -421,8 +398,9 @@ | |||||
| <update id="updateUserId" parameterType="com.iformall.domain.po.WxCUser"> | <update id="updateUserId" parameterType="com.iformall.domain.po.WxCUser"> | ||||
| update wx_c_user set user_id=#{userId} | |||||
| where id = #{id} | |||||
| update wx_c_user | |||||
| set user_id=#{userId} | |||||
| where id = #{id} | |||||
| </update> | </update> | ||||
| <update id="delForUserIdOnly"> | <update id="delForUserIdOnly"> | ||||
| @@ -19,16 +19,12 @@ | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | |||||
| where wlc.`tenant_id` = #{finalTenantId} | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and wlc.`id` = #{id} | and wlc.`id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and wlc.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != points "> | <if test=" null != points "> | ||||
| and wlc.`points` = #{points} | and wlc.`points` = #{points} | ||||
| </if> | </if> | ||||
| @@ -75,7 +71,7 @@ | |||||
| discount_enable, capability,scale) values | discount_enable, capability,scale) values | ||||
| <foreach collection="list" item="item" index="index" separator=","> | <foreach collection="list" item="item" index="index" separator=","> | ||||
| (#{item.id,jdbcType=BIGINT}, | (#{item.id,jdbcType=BIGINT}, | ||||
| #{item.tenantId,jdbcType=VARCHAR}, | |||||
| #{item.finalTenantId,jdbcType=VARCHAR}, | |||||
| #{item.points,jdbcType=INTEGER}, | #{item.points,jdbcType=INTEGER}, | ||||
| #{item.level,jdbcType=VARCHAR}, | #{item.level,jdbcType=VARCHAR}, | ||||
| #{item.description,jdbcType=VARCHAR}, | #{item.description,jdbcType=VARCHAR}, | ||||
| @@ -92,7 +88,7 @@ | |||||
| <!-- <foreach collection="list" item="item" index="index" open="" close="" separator=";">--> | <!-- <foreach collection="list" item="item" index="index" open="" close="" separator=";">--> | ||||
| update wx_level_config | update wx_level_config | ||||
| <set> | <set> | ||||
| <if test=" null != tenantId ">`tenant_id` = #{tenantId},</if> | |||||
| <if test=" null != tenantId ">`tenant_id` = #{finalTenantId},</if> | |||||
| <if test=" null != points ">`points` = #{points},</if> | <if test=" null != points ">`points` = #{points},</if> | ||||
| <if test=" null != level ">`level` = #{level},</if> | <if test=" null != level ">`level` = #{level},</if> | ||||
| <if test=" null != description ">`description` = #{description},</if> | <if test=" null != description ">`description` = #{description},</if> | ||||
| @@ -106,14 +102,14 @@ | |||||
| </update> | </update> | ||||
| <delete id="deleteAll" parameterType="com.iformall.domain.po.WxLevelConfig"> | <delete id="deleteAll" parameterType="com.iformall.domain.po.WxLevelConfig"> | ||||
| delete from wx_level_config where `tenant_id` = #{tenantId}; | |||||
| delete from wx_level_config where `tenant_id` = #{finalTenantId}; | |||||
| </delete> | </delete> | ||||
| <select id="getLevel" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="String"> | <select id="getLevel" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="String"> | ||||
| SELECT `level` FROM `wx_level_config` where tenant_id = #{tenantId} and points <= #{points} ORDER BY points desc LIMIT 1 | |||||
| SELECT `level` FROM `wx_level_config` where tenant_id = #{finalTenantId} and points <= #{points} ORDER BY points desc LIMIT 1 | |||||
| </select> | </select> | ||||
| <select id="getScale" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="java.lang.Integer"> | <select id="getScale" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="java.lang.Integer"> | ||||
| select `scale` from wx_level_config where #{points} >=points and tenant_id = #{tenantId} order by points desc limit 1 ; | |||||
| select `scale` from wx_level_config where tenant_id = #{finalTenantId} and #{points} >=points order by points desc limit 1 ; | |||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||