| @@ -60,7 +60,7 @@ public class WxLevelConfigController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | |||
| try { | |||
| if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "子广场用户无此权限"); | |||
| } | |||
| wxLevelConfigService.batchSave(getTenantInfo(), levelConfigs); | |||
| } catch (Exception e) { | |||
| @@ -77,7 +77,7 @@ public class WxLevelConfigController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | |||
| try { | |||
| if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "子广场用户无此权限"); | |||
| } | |||
| wxLevelConfigService.batchUpdateCapabilities(getTenantInfo(), levelConfigs); | |||
| } catch (Exception e) { | |||
| @@ -96,7 +96,7 @@ public class WxLevelConfigController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if (StringUtils.isNotBlank(getTenantInfo().getParentTenantId())) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "子广场用户无此权限"); | |||
| } | |||
| wxLevelConfigService.deleteById(wxLevelConfig.getId()); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| @@ -53,14 +53,14 @@ public class WxScoreRulesController extends BaseController { | |||
| if(wxScoreRules.getType().equals(EnumScoreRules.SCORE.getCode()) || wxScoreRules.getType().equals(EnumScoreRules.CREDIT.getCode())){ | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "子广场用户无此权限"); | |||
| } | |||
| wxScoreRules.updateTenantInfo(tenantEntity); | |||
| }else if(wxScoreRules.getType().equals(EnumScoreRules.CREDIT_DOUBLE.getCode())){ | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| WxMall mall = wxMallService.getByTenantId(getUser().getTenantId()); | |||
| if((mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && StringUtils.isBlank(getUser().getParentTenantId())) || | |||
| StringUtils.isBlank(tenantEntity.getTenantId())){ | |||
| if(mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||
| && StringUtils.isBlank(mall.getParentTenantId())){ | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | |||
| } | |||
| wxScoreRules.updateTenantInfo(tenantEntity); | |||
| @@ -88,8 +88,10 @@ public class WxScoreRulesController extends BaseController { | |||
| @SystemControllerLog(description = "积分-配置") | |||
| public ResultData creditDoubleRulesList() { | |||
| logger.debug("[" + getIpAddr() + "] creditDoubleRulesList::list"); | |||
| if(StringUtils.isBlank(getTenantInfo().getTenantId())){ | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION,"集团用户无此权限"); | |||
| WxMall mall = wxMallService.getByTenantId(getUser().getTenantId()); | |||
| if(mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||
| && StringUtils.isBlank(mall.getParentTenantId())){ | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | |||
| } | |||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditDoubleRules(getTenantInfo().getTenantId()); | |||
| return new ResultData(scoreRules); | |||
| @@ -108,7 +110,7 @@ public class WxScoreRulesController extends BaseController { | |||
| } | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "子广场用户无此权限"); | |||
| } | |||
| wxScoreRules.updateTenantInfo(tenantEntity); | |||
| try { | |||
| @@ -221,7 +221,6 @@ public class HomeController extends BaseController { | |||
| logger.debug(map.toString()); | |||
| String tenantId = map.get("tenantId"); | |||
| String subTenantId = map.get("subTenantId"); | |||
| String parentTenantId = map.get("parentTenantId"); | |||
| if (StringUtils.isBlank(tenantId)) { | |||
| @@ -229,13 +228,19 @@ public class HomeController extends BaseController { | |||
| } | |||
| MallUserInfo userInfo = getUser(); | |||
| if (userInfo.getTenantId().equalsIgnoreCase(tenantId)) { | |||
| Session session = SecurityUtils.getSubject().getSession(); | |||
| if (StringUtils.isNotBlank(subTenantId)) { | |||
| session.setAttribute(UserSession.tenantId, subTenantId); | |||
| session.setAttribute(UserSession.parentTenantId, tenantId); | |||
| if(StringUtils.isBlank(parentTenantId)){ | |||
| if(!userInfo.getTenantId().equals(tenantId)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| parentTenantId = null; | |||
| }else{ | |||
| if(!userInfo.getTenantId().equals(parentTenantId)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| } | |||
| Session session = SecurityUtils.getSubject().getSession(); | |||
| session.setAttribute(UserSession.tenantId, tenantId); | |||
| session.setAttribute(UserSession.parentTenantId, parentTenantId); | |||
| return new ResultData(); | |||
| } | |||
| @@ -88,7 +88,6 @@ public class ChartDataSchedule { | |||
| WxChartDataEntity wxChartDataEntity = new WxChartDataEntity(); | |||
| wxChartDataEntity.setQuerytime(date); | |||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||
| dto.setStartTime(date); | |||
| dto.setEndTime(endDate); | |||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||
| @@ -99,29 +98,56 @@ public class ChartDataSchedule { | |||
| wxChartDataEntity.setType(EnumChartType.WX_USER.getCode()); | |||
| int count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("微信用户数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| logger.info("微信用户总数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long wxUserCount = cuserFactory.getCUserService(EnumAppPlat.WX).findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(wxUserCount), EnumChartType.WX_USER.getCode(), date, createtime); | |||
| } | |||
| wxChartDataEntity.setType(EnumChartType.TT_USER.getCode()); | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("抖音用户数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| logger.info("抖音用户总数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long ttUserCount = cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(ttUserCount), EnumChartType.TT_USER.getCode(), date, createtime); | |||
| } | |||
| // wxChartDataEntity.setType(EnumChartType.ALI_USER.getCode()); | |||
| // count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| // if (count == 0) { | |||
| // logger.info("支付宝用户>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| // logger.info("支付宝用户总数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| // } | |||
| wxChartDataEntity.setType(EnumChartType.BASIC_USER.getCode()); | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("会员数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| logger.info("会员总数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long basicUserCount = wxCUserBasicInfoService.findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(basicUserCount), EnumChartType.BASIC_USER.getCode(), date, createtime); | |||
| } | |||
| dto.setStartTime(date); | |||
| wxChartDataEntity.setType(EnumChartType.WX_USER_ADD.getCode()); | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("微信用户增加数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long wxUserCount = cuserFactory.getCUserService(EnumAppPlat.WX).findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(wxUserCount), EnumChartType.WX_USER_ADD.getCode(), date, createtime); | |||
| } | |||
| wxChartDataEntity.setType(EnumChartType.TT_USER_ADD.getCode()); | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("抖音用户增加数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long ttUserCount = cuserFactory.getCUserService(EnumAppPlat.TOUTIAO).findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(ttUserCount), EnumChartType.TT_USER_ADD.getCode(), date, createtime); | |||
| } | |||
| // wxChartDataEntity.setType(EnumChartType.ALI_USER_ADD.getCode()); | |||
| // count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| // if (count == 0) { | |||
| // logger.info("支付宝用户增加数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| // } | |||
| wxChartDataEntity.setType(EnumChartType.BASIC_USER_ADD.getCode()); | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("会员增加数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| long basicUserCount = wxCUserBasicInfoService.findCount(dto); | |||
| addChartData(tenantEntity, String.valueOf(basicUserCount), EnumChartType.BASIC_USER_ADD.getCode(), date, createtime); | |||
| } | |||
| } | |||
| } | |||
| @@ -109,6 +109,7 @@ public class WxMall extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer surplusDay;//距离过期还剩天数 | |||
| @TableField(exist = false) | |||
| private boolean validPrompt;//到期提醒 | |||
| @TableField(exist = false) | |||
| @@ -15,10 +15,15 @@ public enum EnumChartType { | |||
| SALE_COUPON_PRICE(8, "销售总交易额"), | |||
| MERCHANT_TRADE(9, "解单金额"), | |||
| WX_USER(11,"微信用户"), | |||
| TT_USER(12,"抖音用户"), | |||
| ALI_USER(13,"Ali用户"), | |||
| BASIC_USER(14,"会员"); | |||
| WX_USER(11,"微信用户总数"), | |||
| WX_USER_ADD(12,"微信用户总增加"), | |||
| TT_USER(13,"抖音用户总数"), | |||
| TT_USER_ADD(14,"抖音用户增加"), | |||
| ALI_USER(15,"Ali用户总数"), | |||
| ALI_USER_ADD(16,"Ali用户增加"), | |||
| BASIC_USER(17,"会员总数"), | |||
| BASIC_USER_ADD(18,"会员增加"), | |||
| ; | |||
| public static EnumChartType getEnum(Integer code) { | |||
| for (EnumChartType value : values()) { | |||
| @@ -5,6 +5,7 @@ import com.iformall.common.ResultData; | |||
| import java.util.Map; | |||
| public interface WxChartDataService { | |||
| ResultData queryData(Map<String, String> params); | |||
| } | |||