|
|
|
|
@ -1,15 +1,13 @@
|
|
|
|
|
package com.flossom.miniProgram.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.flossom.common.core.domain.entity.SiteInfo;
|
|
|
|
|
import com.flossom.common.core.domain.entity.SiteLog;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserMember;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxUserTag;
|
|
|
|
|
import com.flossom.common.core.domain.entity.*;
|
|
|
|
|
import com.flossom.common.core.enums.SiteOpenTypeEnum;
|
|
|
|
|
import com.flossom.common.core.enums.SitePushTypeEnum;
|
|
|
|
|
import com.flossom.common.core.enums.SiteTypeEnum;
|
|
|
|
|
import com.flossom.common.core.enums.TagTypeStatus;
|
|
|
|
|
import com.flossom.common.core.exception.ServiceException;
|
|
|
|
|
import com.flossom.common.core.mapper.SiteInfoMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.SiteInfoTagMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.SiteLogMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxUserTagMapper;
|
|
|
|
|
import com.flossom.common.core.utils.DateUtils;
|
|
|
|
|
@ -41,6 +39,9 @@ public class SiteInfoServiceImpl implements ISiteInfoService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private WxUserTagMapper wxUserTagMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SiteInfoTagMapper siteInfoTagMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SiteInfo> popupList(Integer openType) {
|
|
|
|
|
@ -152,52 +153,45 @@ public class SiteInfoServiceImpl implements ISiteInfoService {
|
|
|
|
|
userWecomTageIdList = userWecomTags.stream().map(WxUserTag::getTagId).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 4.2、禁止小程序标签
|
|
|
|
|
String forbidWechatTagId = info.getForbidWechatTagId();
|
|
|
|
|
if (StringUtils.isNotBlank(forbidWechatTagId)) {
|
|
|
|
|
List<String> forbidWechatTagIdList = Arrays.asList(forbidWechatTagId.split(","));
|
|
|
|
|
if (forbidWechatTagIdList != null && forbidWechatTagIdList.size() > 0) {
|
|
|
|
|
if (userMiniTageIdList.size() > 0) {
|
|
|
|
|
for (Long tagid : userMiniTageIdList) {
|
|
|
|
|
if (forbidWechatTagIdList.contains(tagid)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 4.2、禁止标签
|
|
|
|
|
SiteInfoTag siteInfoTag = new SiteInfoTag();
|
|
|
|
|
siteInfoTag.setSiteId(info.getId());
|
|
|
|
|
siteInfoTag.setStatus(1L);
|
|
|
|
|
List<SiteInfoTag> forbidSiteInfoTags = siteInfoTagMapper.selectSiteInfoTagList(siteInfoTag);
|
|
|
|
|
if (forbidSiteInfoTags != null && forbidSiteInfoTags.size() > 0) {
|
|
|
|
|
List<Long> forbidTagIdList = forbidSiteInfoTags.stream().map(SiteInfoTag::getTagId).collect(Collectors.toList());
|
|
|
|
|
if (userMiniTageIdList.size() > 0) {
|
|
|
|
|
for (Long tagid : userMiniTageIdList) {
|
|
|
|
|
if (forbidTagIdList.contains(tagid)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 4.3、禁止企微标签
|
|
|
|
|
String forbidCompanyTagId = info.getForbidCompanyTagId();
|
|
|
|
|
if (StringUtils.isNotBlank(forbidCompanyTagId)) {
|
|
|
|
|
List<String> forbidCompanyTagIdList = Arrays.asList(forbidCompanyTagId.split(","));
|
|
|
|
|
if (forbidCompanyTagIdList != null && forbidCompanyTagIdList.size() > 0) {
|
|
|
|
|
if (userWecomTageIdList.size() > 0) {
|
|
|
|
|
for (Long tagid : userWecomTageIdList) {
|
|
|
|
|
if (forbidCompanyTagIdList.contains(tagid)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (forbidTagIdList.contains(tagid)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 4.4、可见小程序标签
|
|
|
|
|
String showWechatTagId = info.getShowWechatTagId();
|
|
|
|
|
if (StringUtils.isNotBlank(showWechatTagId)) {
|
|
|
|
|
List<String> showWechatTagIdList = Arrays.asList(showWechatTagId.split(","));
|
|
|
|
|
if (showWechatTagIdList != null && userMiniTageIdList.size() > 0) {
|
|
|
|
|
if (!userMiniTageIdList.containsAll(showWechatTagIdList)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
siteInfoTag.setSiteId(info.getId());
|
|
|
|
|
siteInfoTag.setTagType(1);
|
|
|
|
|
siteInfoTag.setStatus(0L);
|
|
|
|
|
List<SiteInfoTag> showWechatSiteInfoTags = siteInfoTagMapper.selectSiteInfoTagList(siteInfoTag);
|
|
|
|
|
if (showWechatSiteInfoTags != null && showWechatSiteInfoTags.size() > 0) {
|
|
|
|
|
List<Long> showWechatTagIdList = showWechatSiteInfoTags.stream().map(SiteInfoTag::getTagId).collect(Collectors.toList());
|
|
|
|
|
if (userMiniTageIdList == null || !userMiniTageIdList.containsAll(showWechatTagIdList)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 4.5、可见企微标签
|
|
|
|
|
String showCompanyTagId = info.getShowCompanyTagId();
|
|
|
|
|
if (StringUtils.isNotBlank(showCompanyTagId)) {
|
|
|
|
|
List<String> showCompanyTagIdList = Arrays.asList(showCompanyTagId.split(","));
|
|
|
|
|
if (userWecomTageIdList != null && userWecomTageIdList.size() > 0) {
|
|
|
|
|
if (!userWecomTageIdList.containsAll(showCompanyTagIdList)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
siteInfoTag.setSiteId(info.getId());
|
|
|
|
|
siteInfoTag.setTagType(2);
|
|
|
|
|
siteInfoTag.setStatus(0L);
|
|
|
|
|
List<SiteInfoTag> showCompanySiteInfoTags = siteInfoTagMapper.selectSiteInfoTagList(siteInfoTag);
|
|
|
|
|
if (showCompanySiteInfoTags != null && showCompanySiteInfoTags.size() > 0) {
|
|
|
|
|
List<Long> showCompanyTagIdList = showCompanySiteInfoTags.stream().map(SiteInfoTag::getTagId).collect(Collectors.toList());
|
|
|
|
|
if (userWecomTageIdList == null || !userWecomTageIdList.containsAll(showCompanyTagIdList)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|