| @@ -59,8 +59,7 @@ public class WxMallController extends BaseController { | |||||
| logger.error("未配置相应的mall"); | logger.error("未配置相应的mall"); | ||||
| return new ResultData(Result.ERROR, "未配置相应的mall"); | return new ResultData(Result.ERROR, "未配置相应的mall"); | ||||
| } | } | ||||
| if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && | |||||
| StringUtils.isBlank(mall.getParentTenantId())) { | |||||
| if (wxMallService.isgroupSupport(mall)) { | |||||
| mall.setSubMalls(wxMallService.getSubByParentTenantId(mall.getTenantId())); | mall.setSubMalls(wxMallService.getSubByParentTenantId(mall.getTenantId())); | ||||
| } | } | ||||
| mall.setValidPrompt(wxMallService.mallValid(getUserId(),mall)); | mall.setValidPrompt(wxMallService.mallValid(getUserId(),mall)); | ||||
| @@ -684,10 +684,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| // } | // } | ||||
| TenantEntity tenantEntity = new TenantEntity(); | TenantEntity tenantEntity = new TenantEntity(); | ||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | |||||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||||
| if(!wxMallService.isgroupSupport(tenantEntity)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| wxProjectConfigService.initSubmall(tenantId,subTenantIds); | wxProjectConfigService.initSubmall(tenantId,subTenantIds); | ||||
| @@ -721,10 +718,7 @@ public class WxProjectConfigController extends BaseController { | |||||
| TenantEntity tenantEntity = new TenantEntity(); | TenantEntity tenantEntity = new TenantEntity(); | ||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| WxMall parentWxMall = wxMallService.getByTenantInfo(tenantEntity); | |||||
| if(parentWxMall == null || parentWxMall.getSaleType() != 100 | |||||
| || !parentWxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| || StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ | |||||
| if(!wxMallService.isgroupSupport(tenantEntity)){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| StringBuilder sb = new StringBuilder(); | StringBuilder sb = new StringBuilder(); | ||||
| @@ -58,9 +58,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| wxScoreRules.updateTenantInfo(tenantEntity); | wxScoreRules.updateTenantInfo(tenantEntity); | ||||
| }else if(wxScoreRules.getType().equals(EnumScoreRules.CREDIT_DOUBLE.getCode())){ | }else if(wxScoreRules.getType().equals(EnumScoreRules.CREDIT_DOUBLE.getCode())){ | ||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| WxMall mall = wxMallService.getByTenantId(getUser().getTenantId()); | |||||
| if(mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| && StringUtils.isBlank(mall.getParentTenantId())){ | |||||
| if(wxMallService.isgroupSupport(tenantEntity)){ | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | ||||
| } | } | ||||
| wxScoreRules.updateTenantInfo(tenantEntity); | wxScoreRules.updateTenantInfo(tenantEntity); | ||||
| @@ -88,9 +86,7 @@ public class WxScoreRulesController extends BaseController { | |||||
| @SystemControllerLog(description = "积分-配置") | @SystemControllerLog(description = "积分-配置") | ||||
| public ResultData creditDoubleRulesList() { | public ResultData creditDoubleRulesList() { | ||||
| logger.debug("[" + getIpAddr() + "] creditDoubleRulesList::list"); | logger.debug("[" + getIpAddr() + "] creditDoubleRulesList::list"); | ||||
| WxMall mall = wxMallService.getByTenantId(getUser().getTenantId()); | |||||
| if(mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) | |||||
| && StringUtils.isBlank(mall.getParentTenantId())){ | |||||
| if(wxMallService.isgroupSupport(getUser())){ | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); | ||||
| } | } | ||||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditDoubleRules(getTenantInfo().getTenantId()); | WxScoreRules scoreRules = wxScoreRulesService.getCreditDoubleRules(getTenantInfo().getTenantId()); | ||||
| @@ -74,7 +74,7 @@ public class WxMallController extends BaseController { | |||||
| if (mall == null) { | if (mall == null) { | ||||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | ||||
| } | } | ||||
| if (mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode())) { | |||||
| if (wxMallService.isgroupSupport(mall)) { | |||||
| List<WxMall> mallList = wxMallService.getSubByParentTenantId(mall.getTenantId()); | List<WxMall> mallList = wxMallService.getSubByParentTenantId(mall.getTenantId()); | ||||
| mall.setSubMalls(mallList); | mall.setSubMalls(mallList); | ||||
| } | } | ||||
| @@ -206,7 +206,7 @@ public class WxUserGrantController extends BaseController { | |||||
| if(StringUtils.isNotBlank(wxMall.getParentTenantId())){ | if(StringUtils.isNotBlank(wxMall.getParentTenantId())){ | ||||
| mallList = mallService.getSubByParentTenantId(wxMall.getParentTenantId()); | mallList = mallService.getSubByParentTenantId(wxMall.getParentTenantId()); | ||||
| } | } | ||||
| if (wxMall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode())) { | |||||
| if (mallService.isgroupSupport(wxMall)) { | |||||
| mallList = mallService.getSubByParentTenantId(wxMall.getTenantId()); | mallList = mallService.getSubByParentTenantId(wxMall.getTenantId()); | ||||
| } | } | ||||
| if(mallList != null && mallList.size() >0){ | if(mallList != null && mallList.size() >0){ | ||||
| @@ -134,9 +134,9 @@ 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 record); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto record); | |||||
| /** | /** | ||||
| * 停车会员记录导出 | * 停车会员记录导出 | ||||
| * @param record | * @param record | ||||
| @@ -202,7 +202,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| String date = DateUtils.getTimeBefore(1, new Date()); | String date = DateUtils.getTimeBefore(1, new Date()); | ||||
| chartDataQ.setQuerytime(DateUtils.stringToDate(date)); | chartDataQ.setQuerytime(DateUtils.stringToDate(date)); | ||||
| List<WxChartDataEntity> list = wxChartDataMapper.findList(chartDataQ); | List<WxChartDataEntity> list = wxChartDataMapper.findList(chartDataQ); | ||||
| Integer carCount = list.stream().map(e -> Integer.parseInt(e.getResult())).reduce(Integer::sum).get(); | |||||
| int carCount = 0; | |||||
| if(list != null && list.size() > 0){ | |||||
| carCount = list.stream().map(e -> Integer.parseInt(e.getResult())).reduce(Integer::sum).get(); | |||||
| } | |||||
| HashMap<String, Object> carMap = new HashMap<>(); | HashMap<String, Object> carMap = new HashMap<>(); | ||||
| carMap.put("carCount",carCount); | carMap.put("carCount",carCount); | ||||
| @@ -22,6 +22,7 @@ import org.apache.commons.compress.utils.Lists; | |||||
| import org.apache.commons.lang3.StringUtils; | 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.BeanUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.data.redis.core.StringRedisTemplate; | import org.springframework.data.redis.core.StringRedisTemplate; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -1173,7 +1174,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long findCount(WxCUserBasicInfoDto dto) { | |||||
| public long findCount(WxCUserBasicInfoDto record) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| BeanUtils.copyProperties(record,dto); | |||||
| if(wxMallService.isgroupSupport(dto)){ | if(wxMallService.isgroupSupport(dto)){ | ||||
| dto.setParentTenantId(dto.getTenantId()); | dto.setParentTenantId(dto.getTenantId()); | ||||
| dto.setTenantId(null); | dto.setTenantId(null); | ||||
| @@ -1182,8 +1185,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto dto) { | |||||
| return wxCUserBasicInfoMapper.findCountHistory(dto); | |||||
| public List<UserCountVo> findCountHistory(WxCUserBasicInfoDto record) { | |||||
| return wxCUserBasicInfoMapper.findCountHistory(record); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -11,6 +11,7 @@ import com.iformall.service.WxMallService; | |||||
| import com.iformall.service.WxUserVisitService; | import com.iformall.service.WxUserVisitService; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.BeanUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| @@ -65,10 +66,12 @@ public class WxUserVisitServiceImpl implements WxUserVisitService { | |||||
| @Override | @Override | ||||
| public Long queryVisitUv(WxUserVisit record) { | public Long queryVisitUv(WxUserVisit record) { | ||||
| if(wxMallService.isgroupSupport(record)){ | |||||
| record.setParentTenantId(record.getTenantId()); | |||||
| record.setTenantId(null); | |||||
| WxUserVisit wuv = new WxUserVisit(); | |||||
| BeanUtils.copyProperties(record,wuv); | |||||
| if(wxMallService.isgroupSupport(wuv)){ | |||||
| wuv.setParentTenantId(wuv.getTenantId()); | |||||
| wuv.setTenantId(null); | |||||
| } | } | ||||
| return wxUserVisitMapper.queryVisitUv(record); | |||||
| return wxUserVisitMapper.queryVisitUv(wuv); | |||||
| } | } | ||||
| } | } | ||||