|
@@ -13,6 +13,7 @@ import jakarta.annotation.Resource;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.constant.CacheConstant;
|
|
|
import org.jeecg.common.system.vo.DictPropertyModel;
|
|
@@ -182,7 +183,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
.eq(AdwebPublicEnquiryRule::getIsEnable, 1)
|
|
|
.eq(AdwebPublicEnquiryRule::getBlackOrWhiteList, blackOrWhite)
|
|
|
.eq(AdwebPublicEnquiryRule::getUseStatus, useStatus));
|
|
|
- if (ListUtil.notEmpty(AdwebPublicEnquiryRuleList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(AdwebPublicEnquiryRuleList)) {
|
|
|
blackWordList = AdwebPublicEnquiryRuleList.stream().map(AdwebPublicEnquiryRule::getWord).toList();
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -209,10 +210,10 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
Map<String, String> principalEmailMap = new HashMap<>();
|
|
|
List<String> subAccountIdList = masterSubAccountRelationService.getSubAccountIdByMaster(String.valueOf(adwebSite.getUid()));
|
|
|
log.info("获取的子账户id:{}", FastJsonUtil.toJSONString(subAccountIdList));
|
|
|
- if (ListUtil.notEmpty(subAccountIdList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(subAccountIdList)) {
|
|
|
subAccountIdList.add(String.valueOf(adwebSite.getUid()));
|
|
|
List<SysUser> principalEmailList = sysUserService.list(new QueryWrapper<SysUser>().in("id", subAccountIdList).eq("del_flag", 0).isNotNull("email").ne("email", "").select("id", "email"));
|
|
|
- if (ListUtil.notEmpty(principalEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(principalEmailList)) {
|
|
|
principalEmailMap = principalEmailList.stream().collect(Collectors.toMap(SysUser::getId, SysUser::getEmail));
|
|
|
|
|
|
}
|
|
@@ -270,7 +271,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
* @param principalEmailMap
|
|
|
*/
|
|
|
private void sendValidateEmail(List<AdwebEnquiry> enquiryList, AdwebSite adwebSite, Map<String, String> principalEmailMap) {
|
|
|
- if (ListUtil.isEmpty(enquiryList)) {
|
|
|
+ if (CollectionUtils.isEmpty(enquiryList)) {
|
|
|
log.info("未获取到需要发送邮件的询盘");
|
|
|
return;
|
|
|
}
|
|
@@ -278,7 +279,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
|
|
|
//特殊站点发送邮件
|
|
|
List<DictPropertyModel> siteRes = sysAdwebApiImpl.queryDictInfoByDictCode("turn_inquiry_site_code");
|
|
|
- if (ListUtil.notEmpty(siteRes) && siteRes.get(0).getValue().equals(adwebSite.getCode())) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteRes) && siteRes.get(0).getValue().equals(adwebSite.getCode())) {
|
|
|
specialSendEmail(enquiryList, adwebSite, principalEmailMap);
|
|
|
} else {
|
|
|
String emailStr = adwebSite.getEnquiryEmailList();
|
|
@@ -290,7 +291,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
log.info("发送询盘邮件--子账户邮箱:{}", FastJsonUtil.toJSONString(principalEmailMap));
|
|
|
|
|
|
List<String> emailList = JSON.parseArray(emailStr, String.class);
|
|
|
- if (ListUtil.isEmpty(emailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(emailList)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -457,12 +458,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
log.info("=======发送询盘邮件======");
|
|
|
enquiryEmailMessageList.forEach(e -> System.out.println(e.getEmail()));
|
|
|
log.info("需要添加的询盘邮件:{}", FastJsonUtil.toJSONString(enquiryEmailMessageList));
|
|
|
- if (ListUtil.notEmpty(enquiryEmailMessageList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryEmailMessageList)) {
|
|
|
QueryWrapper<EnquiryEmailMessage> enquiryEmailMessageQueryWrapper = new QueryWrapper<>();
|
|
|
enquiryEmailMessageQueryWrapper.eq("site_code", adwebSite.getCode());
|
|
|
List<EnquiryEmailMessage> enquiryEmailMessages = enquiryEmailMessageService.list(enquiryEmailMessageQueryWrapper);
|
|
|
List<EnquiryEmailMessage> sameEnquiryEmailMessageList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(enquiryEmailMessages)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryEmailMessages)) {
|
|
|
for (EnquiryEmailMessage enquiryEmailMessage : enquiryEmailMessages) {
|
|
|
for (EnquiryEmailMessage enquiryEmailMessage1 : enquiryEmailMessageList) {
|
|
|
if (enquiryEmailMessage.getEnquiryId().equals(enquiryEmailMessage1.getEnquiryId()) && enquiryEmailMessage.getEmail().equals(enquiryEmailMessage1.getEmail())) {
|
|
@@ -502,7 +503,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
|
|
|
sysUserQueryWrapper.eq("is_inquiry", 2);
|
|
|
sysUserQueryWrapper.eq("status", 1);
|
|
|
- if (ListUtil.notEmpty(idList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(idList)) {
|
|
|
sysUserQueryWrapper.in("id", idList);
|
|
|
}
|
|
|
List<SysUser> sysUsers = sysUserService.list(sysUserQueryWrapper);
|
|
@@ -515,7 +516,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
SysUser sysUser = new SysUser();
|
|
|
|
|
|
//如果没有子账号,则只给主账号发送邮件
|
|
|
- if (ListUtil.isEmpty(sysUsers)) {
|
|
|
+ if (CollectionUtils.isEmpty(sysUsers)) {
|
|
|
//获取主账号
|
|
|
SysUser mainUser = sysUserService.getById(adwebSite.getUid());
|
|
|
//主账号邮件信息添加
|
|
@@ -527,12 +528,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
enquiryEmailMessageList.forEach(e -> System.out.println(e.getEmail()));
|
|
|
|
|
|
log.info("需要添加的询盘邮件:{}", FastJsonUtil.toJSONString(enquiryEmailMessageList));
|
|
|
- if (ListUtil.notEmpty(enquiryEmailMessageList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryEmailMessageList)) {
|
|
|
QueryWrapper<EnquiryEmailMessage> enquiryEmailMessageQueryWrapper = new QueryWrapper<>();
|
|
|
enquiryEmailMessageQueryWrapper.eq("site_code", adwebSite.getCode());
|
|
|
List<EnquiryEmailMessage> enquiryEmailMessages = enquiryEmailMessageService.list(enquiryEmailMessageQueryWrapper);
|
|
|
List<EnquiryEmailMessage> sameEnquiryEmailMessageList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(enquiryEmailMessages)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryEmailMessages)) {
|
|
|
for (EnquiryEmailMessage enquiryEmailMessage : enquiryEmailMessages) {
|
|
|
for (EnquiryEmailMessage enquiryEmailMessage1 : enquiryEmailMessageList) {
|
|
|
if (enquiryEmailMessage.getEnquiryId().equals(enquiryEmailMessage1.getEnquiryId()) && enquiryEmailMessage.getEmail().equals(enquiryEmailMessage1.getEmail())) {
|
|
@@ -685,7 +686,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
Map<String, JSONObject> formObj = FastJsonUtil.parseObject(form, Map.class);
|
|
|
if (formObj == null || formObj.size() == 0) {
|
|
|
List<JSONObject> formList = FastJsonUtil.parseObject(form, List.class);
|
|
|
- if (ListUtil.notEmpty(formList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(formList)) {
|
|
|
formItems = formList;
|
|
|
}
|
|
|
} else {
|
|
@@ -780,7 +781,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
|
|
|
private boolean contains(List<String> keys, String key) {
|
|
|
- if (ListUtil.isEmpty(keys) || StringUtil.isEmpty(key)) {
|
|
|
+ if (CollectionUtils.isEmpty(keys) || StringUtil.isEmpty(key)) {
|
|
|
return false;
|
|
|
}
|
|
|
key = key.replace(":", "").replace(":", "").replaceAll(" {2,}", " ").toLowerCase().trim();
|
|
@@ -802,7 +803,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
List<SysDictItem> dictItems = sysAdwebApiImpl.selectItemsByDictCode(dictCode);
|
|
|
List<String> keys = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(dictItems)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(dictItems)) {
|
|
|
for (SysDictItem item : dictItems) {
|
|
|
String value = item.getItemValue();
|
|
|
if (StringUtil.isEmpty(value)) {
|
|
@@ -831,17 +832,17 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
//邮箱 黑名单
|
|
|
//先获取对应站点的邮箱黑名单
|
|
|
List<String> siteBlackEmailList = (List<String>) adwebRedisUtil.get(SiteBlackEmailKey + "::" + adwebSite.getId());
|
|
|
- if (ListUtil.isEmpty(siteBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(siteBlackEmailList)) {
|
|
|
enquirySiteBlackEmailService.saveRedisSiteBlackEmailBySiteId(adwebSite.getId(), 0);
|
|
|
siteBlackEmailList = (List<String>) adwebRedisUtil.get(SiteBlackEmailKey + "::" + adwebSite.getId());
|
|
|
- if (ListUtil.isEmpty(siteBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(siteBlackEmailList)) {
|
|
|
siteBlackEmailList = new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//邮箱 公共黑名单
|
|
|
List<String> publicBlackEmailList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
|
|
|
- if (ListUtil.isEmpty(publicBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(publicBlackEmailList)) {
|
|
|
List<AdwebPublicBlackEmail> enquiryPublicBlackEmailList = adwebPublicBlackEmailService
|
|
|
.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>()
|
|
|
.ne(AdwebPublicBlackEmail::getStatus, 0)
|
|
@@ -849,7 +850,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
.isNotNull(AdwebPublicBlackEmail::getEmail)
|
|
|
.select(AdwebPublicBlackEmail::getEmail));
|
|
|
|
|
|
- if (ListUtil.notEmpty(enquiryPublicBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryPublicBlackEmailList)) {
|
|
|
publicBlackEmailList = enquiryPublicBlackEmailList.stream().map(AdwebPublicBlackEmail::getEmail).filter(StringUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(BlackEmailKey, publicBlackEmailList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -859,12 +860,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
publicBlackEmailList = publicBlackEmailList.stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
|
|
}
|
|
|
List<String> allBlackEmailList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(siteBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteBlackEmailList)) {
|
|
|
allBlackEmailList = new ArrayList<>(siteBlackEmailList);
|
|
|
}
|
|
|
allBlackEmailList.addAll(publicBlackEmailList);
|
|
|
List<String> blackEmailList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(allBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(allBlackEmailList)) {
|
|
|
HashSet<String> blackEmailHashSet = new HashSet<String>(allBlackEmailList);
|
|
|
blackEmailList = new ArrayList<>(blackEmailHashSet);
|
|
|
}
|
|
@@ -874,13 +875,13 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
//邮箱 白名单
|
|
|
//先获取对应站点的邮箱白名单
|
|
|
List<String> siteWhiteEmailList = (List<String>) adwebRedisUtil.get(SiteWhiteEmailListKey + "::" + adwebSite.getId());
|
|
|
- if (ListUtil.isEmpty(siteWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(siteWhiteEmailList)) {
|
|
|
enquirySiteBlackEmailService.saveRedisSiteBlackEmailBySiteId(adwebSite.getId(), 1);
|
|
|
siteWhiteEmailList = (List<String>) adwebRedisUtil.get(SiteWhiteEmailListKey + "::" + adwebSite.getId());
|
|
|
}
|
|
|
//公共邮箱白名单数据
|
|
|
List<String> publicWhiteEmailList = (List<String>) adwebRedisUtil.get(WhiteEmailListKey);
|
|
|
- if (ListUtil.isEmpty(publicWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isEmpty(publicWhiteEmailList)) {
|
|
|
List<AdwebPublicBlackEmail> enquiryPublicWhiteEmailList = adwebPublicBlackEmailService
|
|
|
.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>()
|
|
|
.ne(AdwebPublicBlackEmail::getStatus, 0)
|
|
@@ -888,7 +889,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
.isNotNull(AdwebPublicBlackEmail::getEmail)
|
|
|
.select(AdwebPublicBlackEmail::getEmail));
|
|
|
|
|
|
- if (ListUtil.notEmpty(enquiryPublicWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryPublicWhiteEmailList)) {
|
|
|
publicWhiteEmailList = enquiryPublicWhiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).filter(StringUtil::isNotEmpty).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(WhiteEmailListKey, publicWhiteEmailList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -898,12 +899,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
publicWhiteEmailList = publicWhiteEmailList.stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());
|
|
|
}
|
|
|
List<String> allWhiteEmailList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(siteWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteWhiteEmailList)) {
|
|
|
allWhiteEmailList = new ArrayList<>(siteWhiteEmailList);
|
|
|
}
|
|
|
allWhiteEmailList.addAll(publicWhiteEmailList);
|
|
|
List<String> whiteEmailList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(allWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(allWhiteEmailList)) {
|
|
|
HashSet<String> whiteEmailHashSet = new HashSet<String>(allWhiteEmailList);
|
|
|
whiteEmailList = new ArrayList<>(whiteEmailHashSet);
|
|
|
}
|
|
@@ -914,13 +915,13 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
//Ip黑名单
|
|
|
//公共ip黑名单
|
|
|
List<String> publicBlackIpList = (List<String>) adwebRedisUtil.get(BlackIpKey);
|
|
|
- if (ListUtil.isEmpty(publicBlackIpList)) {
|
|
|
+ if (CollectionUtils.isEmpty(publicBlackIpList)) {
|
|
|
List<AdwebPublicBlackIp> enquiryPublicBlackIpList = adwebPublicBlackIpService
|
|
|
.list(new LambdaQueryWrapper<AdwebPublicBlackIp>()
|
|
|
.ne(AdwebPublicBlackIp::getStatus, 0)
|
|
|
.eq(AdwebPublicBlackIp::getBlackOrWhite, 0)
|
|
|
.select(AdwebPublicBlackIp::getIp));
|
|
|
- if (ListUtil.notEmpty(enquiryPublicBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryPublicBlackIpList)) {
|
|
|
publicBlackIpList = enquiryPublicBlackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(BlackIpKey, publicBlackIpList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -929,14 +930,14 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
//站点ip黑名单
|
|
|
List<String> siteBlackIpList = (List<String>) adwebRedisUtil.get(SiteBlackIpKey + "::" + adwebSite.getId());
|
|
|
- if (ListUtil.isEmpty(siteBlackIpList)) {
|
|
|
+ if (CollectionUtils.isEmpty(siteBlackIpList)) {
|
|
|
List<AdwebSiteBlackIp> enquirySiteBlackIpList = adwebSiteBlackIpService
|
|
|
.list(new LambdaQueryWrapper<AdwebSiteBlackIp>()
|
|
|
.ne(AdwebSiteBlackIp::getStatus, 0)
|
|
|
.eq(AdwebSiteBlackIp::getBlackOrWhite, 0)
|
|
|
.eq(AdwebSiteBlackIp::getSiteId, adwebSite.getId())
|
|
|
.select(AdwebSiteBlackIp::getIp));
|
|
|
- if (ListUtil.notEmpty(enquirySiteBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquirySiteBlackIpList)) {
|
|
|
siteBlackIpList = enquirySiteBlackIpList.stream().map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSite.getId(), siteBlackIpList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -944,12 +945,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
}
|
|
|
List<String> allBlackIpList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(siteBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteBlackIpList)) {
|
|
|
allBlackIpList = new ArrayList<>(siteBlackIpList);
|
|
|
}
|
|
|
allBlackIpList.addAll(publicBlackIpList);
|
|
|
List<String> blackIpList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(allBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(allBlackIpList)) {
|
|
|
HashSet<String> blackIpHashSet = new HashSet<String>(allBlackIpList);
|
|
|
blackIpList = new ArrayList<>(blackIpHashSet);
|
|
|
}
|
|
@@ -966,7 +967,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
.ne(AdwebPublicBlackIp::getStatus, 0)
|
|
|
.eq(AdwebPublicBlackIp::getBlackOrWhite, 1)
|
|
|
.select(AdwebPublicBlackIp::getIp));
|
|
|
- if (ListUtil.notEmpty(enquiryPublicWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquiryPublicWhiteIpList)) {
|
|
|
publicWhiteIpList = enquiryPublicWhiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(WhiteIpListKey, publicWhiteIpList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -975,14 +976,14 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
//站点Ip白名单, 基于站点查询
|
|
|
List<String> siteWhiteIpList = (List<String>) adwebRedisUtil.get(SiteWhiteIpListKey + "::" + adwebSite.getId());
|
|
|
- if (ListUtil.isEmpty(siteWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isEmpty(siteWhiteIpList)) {
|
|
|
List<AdwebSiteBlackIp> enquirySiteWhiteIpList = adwebSiteBlackIpService
|
|
|
.list(new LambdaQueryWrapper<AdwebSiteBlackIp>()
|
|
|
.ne(AdwebSiteBlackIp::getStatus, 0)
|
|
|
.eq(AdwebSiteBlackIp::getBlackOrWhite, 1)
|
|
|
.eq(AdwebSiteBlackIp::getSiteId, adwebSite.getId())
|
|
|
.select(AdwebSiteBlackIp::getIp));
|
|
|
- if (ListUtil.notEmpty(enquirySiteWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(enquirySiteWhiteIpList)) {
|
|
|
siteWhiteIpList = enquirySiteWhiteIpList.stream().map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
|
|
|
adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSite.getId(), siteWhiteIpList, 60 * 60 * 24);
|
|
|
} else {
|
|
@@ -990,12 +991,12 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
}
|
|
|
List<String> allWhiteIpList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(siteWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteWhiteIpList)) {
|
|
|
allWhiteIpList = new ArrayList<>(siteWhiteIpList);
|
|
|
}
|
|
|
allWhiteIpList.addAll(publicWhiteIpList);
|
|
|
List<String> whiteIpList = new ArrayList<>();
|
|
|
- if (ListUtil.notEmpty(allWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(allWhiteIpList)) {
|
|
|
HashSet<String> whiteIpHashSet = new HashSet<String>(allWhiteIpList);
|
|
|
whiteIpList = new ArrayList<>(whiteIpHashSet);
|
|
|
}
|
|
@@ -1031,7 +1032,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
isJudgeWasteEnquiry = adwebEnquiry;
|
|
|
|
|
|
// 判断 询盘邮箱黑名单
|
|
|
- if (ListUtil.notEmpty(blackEmailList) || StringUtils.isNotBlank(adwebEnquiry.getEmail())) {
|
|
|
+ if (CollectionUtils.isNotEmpty(blackEmailList) || StringUtils.isNotBlank(adwebEnquiry.getEmail())) {
|
|
|
|
|
|
String email = adwebEnquiry.getEmail().toLowerCase();
|
|
|
|
|
@@ -1054,7 +1055,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
//黑名单
|
|
|
String containPublicBlackStr = "";
|
|
|
boolean isContainPublicBlack = false;
|
|
|
- if (ListUtil.notEmpty(publicBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(publicBlackEmailList)) {
|
|
|
for (String blackEmail : publicBlackEmailList) {
|
|
|
String allBlackEmail = blackEmail;
|
|
|
if (allBlackEmail.contains("*")) {
|
|
@@ -1080,7 +1081,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
boolean isSiteAllContain = true;
|
|
|
String containSiteWhiteStr = "";
|
|
|
//白名单
|
|
|
- if (ListUtil.notEmpty(siteWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteWhiteEmailList)) {
|
|
|
for (String whiteEmail : siteWhiteEmailList) {
|
|
|
String compareWhiteEmail = whiteEmail;
|
|
|
if (compareWhiteEmail.contains("*")) {
|
|
@@ -1108,7 +1109,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
//黑名单
|
|
|
boolean isContainSiteBlack = false;
|
|
|
String containSiteBlackStr = "";
|
|
|
- if (ListUtil.notEmpty(siteBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteBlackEmailList)) {
|
|
|
for (String blackEmail : siteBlackEmailList) {
|
|
|
String allBlackEmail = blackEmail;
|
|
|
if (allBlackEmail.contains("*")) {
|
|
@@ -1175,7 +1176,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
// @see http://52.83.154.198:8082/browse/ADWEBV2-12
|
|
|
// 垃圾询盘过滤时IP按照客户IP去使用黑名单过滤而不再使用来源IP
|
|
|
// 判断是否为ip黑名单
|
|
|
- if (ListUtil.notEmpty(blackIpList) || StringUtils.isNotBlank(adwebEnquiry.getCustomerIp())) {
|
|
|
+ if (CollectionUtils.isNotEmpty(blackIpList) || StringUtils.isNotBlank(adwebEnquiry.getCustomerIp())) {
|
|
|
String ip = adwebEnquiry.getCustomerIp();
|
|
|
//公共ip黑名单
|
|
|
boolean isPublicIp = false;
|
|
@@ -1229,7 +1230,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if (ListUtil.notEmpty(urlList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(urlList)) {
|
|
|
adwebEnquiry.setWasteEnquiry(1);
|
|
|
adwebEnquiry.setUserEffective(0);
|
|
|
adwebEnquiry.setWasteEnquiryType("other");
|
|
@@ -1243,7 +1244,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
// 判断询盘是否包含关键词
|
|
|
String message = adwebEnquiry.getMessage().replaceAll("[\\n\\t]",
|
|
|
" ").replaceAll(" {2,}", " ").toLowerCase();
|
|
|
- if (ListUtil.notEmpty(blackWordList) || ListUtil.notEmpty(siteBlackRuleList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(blackWordList) || CollectionUtils.isNotEmpty(siteBlackRuleList)) {
|
|
|
//公共关键词黑名单
|
|
|
boolean isPublicWord = false;
|
|
|
String isBlackWord = "";
|
|
@@ -1324,29 +1325,29 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
|
|
|
//更新redis
|
|
|
//站点
|
|
|
- if (ListUtil.notEmpty(siteBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteBlackEmailList)) {
|
|
|
adwebRedisUtil.set(SiteBlackEmailKey + "::" + adwebSite.getId(), siteBlackEmailList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(siteBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteBlackIpList)) {
|
|
|
adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSite.getId(), siteBlackIpList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(siteWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteWhiteEmailList)) {
|
|
|
adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + adwebSite.getId(), siteWhiteEmailList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(siteWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(siteWhiteIpList)) {
|
|
|
adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSite.getId(), siteWhiteIpList, 86400);
|
|
|
}
|
|
|
//公共
|
|
|
- if (ListUtil.notEmpty(publicBlackEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(publicBlackEmailList)) {
|
|
|
adwebRedisUtil.set(BlackEmailKey, publicBlackEmailList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(publicBlackIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(publicBlackIpList)) {
|
|
|
adwebRedisUtil.set(BlackIpKey, publicBlackIpList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(publicWhiteEmailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(publicWhiteEmailList)) {
|
|
|
adwebRedisUtil.set(WhiteEmailListKey, publicWhiteEmailList, 86400);
|
|
|
}
|
|
|
- if (ListUtil.notEmpty(publicWhiteIpList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(publicWhiteIpList)) {
|
|
|
adwebRedisUtil.set(WhiteIpListKey, publicWhiteIpList, 86400);
|
|
|
}
|
|
|
}
|
|
@@ -1371,7 +1372,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
Pattern pattern1 = Pattern.compile("(https?|ftp|file)://([-a-zA-Z0-9]+\\.)+[a-zA-Z0-9]+");
|
|
|
List<String> domainPatterns = getFormKeys("enquiry_domain_pattern");
|
|
|
String domainPattern = "";
|
|
|
- if (ListUtil.notEmpty(domainPatterns)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(domainPatterns)) {
|
|
|
domainPattern = domainPatterns.get(0);
|
|
|
}
|
|
|
if (StringUtil.isEmpty(domainPattern)) {
|
|
@@ -1415,7 +1416,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
}
|
|
|
|
|
|
// 如果邮箱和 URL 都存在,并且 URL 中不包含 http 和 https,则从 URL 中删除邮箱
|
|
|
- if (ListUtil.notEmpty(emailList)) {
|
|
|
+ if (CollectionUtils.isNotEmpty(emailList)) {
|
|
|
Set<String> urlSet = new HashSet<>(urls);
|
|
|
urlSet.removeAll(emailList.stream()
|
|
|
.filter(email -> urlSet.contains(email) && !email.contains("http") && !email.contains("https"))
|
|
@@ -1435,7 +1436,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
log.info("上一封邮件为垃圾询盘,处理中...");
|
|
|
boolean emailFlag = false;
|
|
|
String isJudgeWasteEnquiryEmail = isJudgeWasteEnquiry.getEmail().toLowerCase();
|
|
|
- if (StringUtils.isNotBlank(isJudgeWasteEnquiryEmail) && ListUtil.notEmpty(blackEmailList)) {
|
|
|
+ if (StringUtils.isNotBlank(isJudgeWasteEnquiryEmail) && CollectionUtils.isNotEmpty(blackEmailList)) {
|
|
|
for (String blackEmail : blackEmailList) {
|
|
|
if (isJudgeWasteEnquiry.getEmail().equals(blackEmail)) {
|
|
|
emailFlag = false;
|
|
@@ -1507,7 +1508,7 @@ public class AdwebEnquiryServiceImpl extends ServiceImpl<AdwebEnquiryMapper, Adw
|
|
|
log.info("上一封邮件为垃圾询盘,处理中...");
|
|
|
boolean emailFlag = false;
|
|
|
String isJudgeWasteEnquiryEmail = isJudgeWasteEnquiry.getEmail().toLowerCase();
|
|
|
- if (StringUtils.isNotBlank(isJudgeWasteEnquiryEmail) && ListUtil.notEmpty(siteBlackEmailList)) {
|
|
|
+ if (StringUtils.isNotBlank(isJudgeWasteEnquiryEmail) && CollectionUtils.isNotEmpty(siteBlackEmailList)) {
|
|
|
for (String blackEmail : siteBlackEmailList) {
|
|
|
if (isJudgeWasteEnquiry.getEmail().equals(blackEmail)) {
|
|
|
emailFlag = false;
|