| | |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | } |
| | | } |
| | | //数据权限 |
| | | List<Long> userIdList = mgtBasePlatformDto.getUserIdList(); |
| | | List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); |
| | | if(null != userIdList){ |
| | | userIdList.addAll(userIds); |
| | | }else{ |
| | | userIdList = userIds; |
| | | } |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | |
| | | |
| | | List<Long> shopIdList = new ArrayList<>(); |
| | | if(mgtBasePlatformDto.getShopId()!=null){ |
| | | shopIdList.add(mgtBasePlatformDto.getShopId()); |
| | |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | } |
| | | } |
| | | //数据权限 |
| | | List<Long> userIdList = mgtBasePlatformDto.getUserIdList(); |
| | | List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); |
| | | if(null != userIdList){ |
| | | userIdList.addAll(userIds); |
| | | }else{ |
| | | userIdList = userIds; |
| | | } |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | |
| | | |
| | | MgtTotalOrderTotalVo mgtTotalOrderTotalVo = new MgtTotalOrderTotalVo(); |
| | | mgtTotalOrderTotalVo.setOrderTotal(0); |
| | | mgtTotalOrderTotalVo.setOnlineTotal(0); |
| | |
| | | if(mgtBasePlatformDto.getActivityFrom()!=null&&mgtBasePlatformDto.getActivityFrom()==2){ |
| | | return totalActivityTotalVo; |
| | | } |
| | | |
| | | List<Long> shopIdList = remoteShopService.listShopIdByPlTotal(mgtBasePlatformDto).getData(); |
| | | if (StringUtils.isNotBlank(mgtBasePlatformDto.getShopProvinceCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopCityCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopAreaCode())) { |
| | | if(shopIdList==null||shopIdList.isEmpty()){ |
| | |
| | | if(mgtBasePlatformDto.getShopId()!=null){ |
| | | shopIdList = new ArrayList<>(); |
| | | shopIdList.add(mgtBasePlatformDto.getShopId()); |
| | | } |
| | | //数据权限 |
| | | List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); |
| | | List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); |
| | | List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | if(null != shopIdList){ |
| | | shopIdList.addAll(collect); |
| | | }else{ |
| | | shopIdList = collect; |
| | | } |
| | | mgtBasePlatformDto.setShopIdList(shopIdList); |
| | | //获取基础统计 |
| | |
| | | totalActivityTotalVo.setOrderTotalValue(orderTotalValue); |
| | | totalActivityTotalVo.setOrderMoneyValue(orderMoneyValue); |
| | | } |
| | | |
| | | //参与人数 2023-09-06 另开接口 |
| | | /*List<MgtMapIntTotalVo> joinList = orderMapper.getMgtActivityMemberTotal(mgtBasePlatformDto); |
| | | // 将查询结果转为Map |
| | | Map<String, Integer> mgtMapIntTotalVoMap = new HashMap<>(); |
| | | if (joinList != null && !joinList.isEmpty()) { |
| | | mgtMapIntTotalVoMap = joinList.stream() |
| | | .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); |
| | | } |
| | | // 获取日期范围 |
| | | List<String> dateList = getDateRange(mgtBasePlatformDto.getStartDate(), mgtBasePlatformDto.getEndDate()); |
| | | int size = dateList.size(); |
| | | // 创建日期和成员总数的数组 |
| | | String[] joinMemberTotalKey = new String[size]; |
| | | Integer[] joinMemberTotalValue = new Integer[size]; |
| | | // 遍历日期列表,设置日期和成员总数的数组 |
| | | String str; |
| | | Integer value; |
| | | for (int i = 0; i < size; i++) { |
| | | str = dateList.get(i); |
| | | joinMemberTotalKey[i] = str; |
| | | value = mgtMapIntTotalVoMap.get(str); |
| | | joinMemberTotalValue[i] = (value != null) ? value : 0; |
| | | } |
| | | totalActivityTotalVo.setJoinMemberTotalKey(joinMemberTotalKey); |
| | | totalActivityTotalVo.setJoinMemberTotalValue(joinMemberTotalValue); |
| | | //获客人数 |
| | | List<MgtMapIntTotalVo> getList = orderMapper.getMgtActivityGetMemberTotal(mgtBasePlatformDto); |
| | | // 将查询结果转为Map |
| | | Map<String, Integer> getMemberMap = new HashMap<>(); |
| | | if (getList != null && !getList.isEmpty()) { |
| | | getMemberMap = getList.stream() |
| | | .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); |
| | | } |
| | | // 创建日期和成员总数的数组 |
| | | String[] getMemberTotalKey = new String[size]; |
| | | Integer[] getMemberTotalValue = new Integer[size]; |
| | | // 遍历日期列表,设置日期和成员总数的数组 |
| | | for (int i = 0; i < size; i++) { |
| | | str = dateList.get(i); |
| | | getMemberTotalKey[i] = str; |
| | | value = getMemberMap.get(str); |
| | | getMemberTotalValue[i] = (value != null) ? value : 0; |
| | | } |
| | | totalActivityTotalVo.setGetMemberTotalKey(getMemberTotalKey); |
| | | totalActivityTotalVo.setGetMemberTotalValue(getMemberTotalValue);*/ |
| | | return totalActivityTotalVo; |
| | | } |
| | | |
| | |
| | | if(mgtBasePlatformDto.getActivityFrom()!=null&&mgtBasePlatformDto.getActivityFrom()==2){ |
| | | return totalActivityTotalVo; |
| | | } |
| | | /*if(mgtBasePlatformDto.getActivityType()!=null&&mgtBasePlatformDto.getActivityType()!=1){ |
| | | return new MgtPlTotalActivityTotalVo(); |
| | | }*/ |
| | | //获取需要关联的用户id集合 |
| | | /*if (mgtBasePlatformDto.getDeptId() != null) { |
| | | List<Long> userIdList = new ArrayList<>(); |
| | | if (mgtBasePlatformDto.getUserId() != null) { |
| | | userIdList.add(mgtBasePlatformDto.getUserId()); |
| | | } else { |
| | | MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept(); |
| | | mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getUserId()); |
| | | mgtUserIdByDept = remoteConfigService.getUserIdByDept(mgtUserIdByDept).getData(); |
| | | userIdList = mgtUserIdByDept.getUserIdList(); |
| | | } |
| | | if (!userIdList.isEmpty()) { |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | } |
| | | }*/ |
| | | |
| | | List<Long> shopIdList = remoteShopService.listShopIdByPlTotal(mgtBasePlatformDto).getData(); |
| | | log.info("shopIdList1-----"+shopIdList.toString()); |
| | |
| | | if(mgtBasePlatformDto.getShopId()!=null){ |
| | | shopIdList = new ArrayList<>(); |
| | | shopIdList.add(mgtBasePlatformDto.getShopId()); |
| | | } |
| | | |
| | | List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); |
| | | List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); |
| | | List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | if(null != shopIdList){ |
| | | shopIdList.addAll(collect); |
| | | }else{ |
| | | shopIdList = collect; |
| | | } |
| | | mgtBasePlatformDto.setShopIdList(shopIdList); |
| | | if(mgtBasePlatformDto.getAgeType()!=null){ |
| | |
| | | if(mgtBasePlatformDto.getActivityFrom()!=null&&mgtBasePlatformDto.getActivityFrom()==2){ |
| | | return totalActivityTotalVo; |
| | | } |
| | | /*if(mgtBasePlatformDto.getActivityType()!=null&&mgtBasePlatformDto.getActivityType()!=1){ |
| | | return new MgtPlTotalActivityTotalVo(); |
| | | }*/ |
| | | //获取需要关联的用户id集合 |
| | | /*if (mgtBasePlatformDto.getDeptId() != null) { |
| | | List<Long> userIdList = new ArrayList<>(); |
| | | if (mgtBasePlatformDto.getUserId() != null) { |
| | | userIdList.add(mgtBasePlatformDto.getUserId()); |
| | | } else { |
| | | MgtUserIdByDept mgtUserIdByDept = new MgtUserIdByDept(); |
| | | mgtUserIdByDept.setDeptId(mgtBasePlatformDto.getUserId()); |
| | | mgtUserIdByDept = remoteConfigService.getUserIdByDept(mgtUserIdByDept).getData(); |
| | | userIdList = mgtUserIdByDept.getUserIdList(); |
| | | } |
| | | if (!userIdList.isEmpty()) { |
| | | mgtBasePlatformDto.setUserIdList(userIdList); |
| | | } |
| | | }*/ |
| | | List<Long> shopIdList = remoteShopService.listShopIdByPlTotal(mgtBasePlatformDto).getData(); |
| | | if (StringUtils.isNotBlank(mgtBasePlatformDto.getShopProvinceCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopCityCode()) || StringUtils.isNotBlank(mgtBasePlatformDto.getShopAreaCode())) { |
| | | if(shopIdList==null||shopIdList.isEmpty()){ |
| | |
| | | shopIdList = new ArrayList<>(); |
| | | shopIdList.add(mgtBasePlatformDto.getShopId()); |
| | | } |
| | | //数据权限 |
| | | List<Long> userIds = remoteUserService.getScopeOfAuthorityUserId(); |
| | | List<Shop> shopList = remoteShopService.getShopBySysUserIds(userIds); |
| | | List<Long> collect = shopList.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | if(null != shopIdList){ |
| | | shopIdList.addAll(collect); |
| | | }else{ |
| | | shopIdList = collect; |
| | | } |
| | | mgtBasePlatformDto.setShopIdList(shopIdList); |
| | | if(mgtBasePlatformDto.getAgeType()!=null){ |
| | | List<Long> userIdList = remoteMemberService.listUserIdByAgeType(mgtBasePlatformDto.getAgeType()).getData(); |