|
@@ -1,6 +1,6 @@
|
|
|
package org.jeecg.modules.adweb.enquiry.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -111,10 +111,10 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
if (enquirySiteBlackEmail.getSiteId() != null) {
|
|
|
String siteCode = adwebSiteService.getSiteCodeById(enquirySiteBlackEmail.getSiteId());
|
|
|
if (StringUtils.isNotBlank(siteCode)) {
|
|
|
- QueryWrapper<AdwebSite> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("id", enquirySiteBlackEmail.getSiteId()).or().eq("parent_group_code", siteCode);
|
|
|
- queryWrapper.ne("status", 0);
|
|
|
- queryWrapper.in(!sysAdwebApi.isAdmin(), "code", siteCodeList);
|
|
|
+ LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(AdwebSite::getId, enquirySiteBlackEmail.getSiteId()).or().eq(AdwebSite::getParentGroupCode, siteCode);
|
|
|
+ queryWrapper.ne(AdwebSite::getStatus, 0);
|
|
|
+ queryWrapper.in(!sysAdwebApi.isAdmin(), AdwebSite::getCode, siteCodeList);
|
|
|
codeList = adwebSiteService.list(queryWrapper).stream().map(AdwebSite::getCode).collect(Collectors.toList());
|
|
|
}
|
|
|
} else {
|
|
@@ -156,18 +156,18 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
//将邮箱转换为小写
|
|
|
enquirySiteBlackEmail.setEmail(enquirySiteBlackEmail.getEmail().trim().toLowerCase());
|
|
|
|
|
|
- int count = (int) enquirySiteBlackEmailService.count(new QueryWrapper<AdwebSiteBlackEmail>().ne("status", 0).eq("email", enquirySiteBlackEmail.getEmail())
|
|
|
- .eq("site_id", enquirySiteBlackEmail.getSiteId()).eq("type", enquirySiteBlackEmail.getType()));
|
|
|
+ int count = (int) enquirySiteBlackEmailService.count(new LambdaQueryWrapper<AdwebSiteBlackEmail>().ne(AdwebSiteBlackEmail::getStatus, 0).eq(AdwebSiteBlackEmail::getEmail, enquirySiteBlackEmail.getEmail())
|
|
|
+ .eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId()).eq(AdwebSiteBlackEmail::getType, enquirySiteBlackEmail.getType()));
|
|
|
|
|
|
if (count > 0) {
|
|
|
return Result.error("邮箱已存在");
|
|
|
}
|
|
|
|
|
|
//判断站点询盘黑名单是否存在添加进来的黑名单
|
|
|
- QueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new QueryWrapper<>();
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("site_id", enquirySiteBlackEmail.getSiteId());
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("status", 1);
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("email", enquirySiteBlackEmail.getEmail());
|
|
|
+ LambdaQueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getSiteId, enquirySiteBlackEmail.getSiteId());
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getStatus, 1);
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getEmail, enquirySiteBlackEmail.getEmail());
|
|
|
List<AdwebEnquiryBlacklist> enquiryBlacklists = adwebEnquiryBlacklistService.list(adwebEnquiryBlacklistQueryWrapper);
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(enquiryBlacklists)) {
|
|
@@ -217,17 +217,17 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
//将邮箱转换为小写
|
|
|
enquirySiteBlackEmail.setEmail(enquirySiteBlackEmail.getEmail().trim().toLowerCase());
|
|
|
|
|
|
- int count = (int) enquirySiteBlackEmailService.count(new QueryWrapper<AdwebSiteBlackEmail>().ne("status", 0).eq("email", enquirySiteBlackEmail.getEmail()).eq("site_id", enquirySiteBlackEmail.getSiteId()).eq("black_or_white", enquirySiteBlackEmail.getBlackOrWhite()).ne("id", enquirySiteBlackEmail.getId()));
|
|
|
+ int count = (int) enquirySiteBlackEmailService.count(new LambdaQueryWrapper<AdwebSiteBlackEmail>().ne(AdwebSiteBlackEmail::getStatus, 0).eq(AdwebSiteBlackEmail::getEmail, enquirySiteBlackEmail.getEmail()).eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId()).eq(AdwebSiteBlackEmail::getBlackOrWhite, enquirySiteBlackEmail.getBlackOrWhite()).ne(AdwebSiteBlackEmail::getId, enquirySiteBlackEmail.getId()));
|
|
|
|
|
|
if (count > 0) {
|
|
|
return Result.error("邮箱已存在");
|
|
|
}
|
|
|
|
|
|
//判断站点询盘黑名单是否存在添加进来的黑名单
|
|
|
- QueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new QueryWrapper<>();
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("site_id", enquirySiteBlackEmail.getSiteId());
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("status", 1);
|
|
|
- adwebEnquiryBlacklistQueryWrapper.eq("email", enquirySiteBlackEmail.getEmail());
|
|
|
+ LambdaQueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getSiteId, enquirySiteBlackEmail.getSiteId());
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getStatus, 1);
|
|
|
+ adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getEmail, enquirySiteBlackEmail.getEmail());
|
|
|
List<AdwebEnquiryBlacklist> enquiryBlacklists = adwebEnquiryBlacklistService.list(adwebEnquiryBlacklistQueryWrapper);
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(enquiryBlacklists)) {
|
|
@@ -238,7 +238,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
|
|
|
//判断公共询盘缓存的是否包含历史的黑名单数据
|
|
|
if (!oldAdwebSiteBlackEmail.getEmail().equals(enquirySiteBlackEmail.getEmail())) {
|
|
|
- List<AdwebPublicBlackEmail> emailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackEmail> emailList = enquiryPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().eq(AdwebPublicBlackEmail::getStatus, 1).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
|
|
|
List<String> pubicBlackEmailList = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
|
|
|
|
|
|
List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
|
|
@@ -263,9 +263,9 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
enquirySiteBlackEmail.setUpdateTime(new Date());
|
|
|
enquirySiteBlackEmailService.updateById(enquirySiteBlackEmail);
|
|
|
|
|
|
- QueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new QueryWrapper<>();
|
|
|
- siteAllEmailQueryWrapper.ne("status", 0);
|
|
|
- siteAllEmailQueryWrapper.eq("site_id", enquirySiteBlackEmail.getSiteId());
|
|
|
+ LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
|
|
|
+ siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
|
|
|
List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
|
|
|
if (CollectionUtils.isEmpty(allEmailList)) {
|
|
|
log.info("未获取到对应站点的黑白名单数据");
|
|
@@ -334,7 +334,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
}
|
|
|
|
|
|
//判断公共询盘缓存的是否包含历史的黑名单数据
|
|
|
- List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().eq(AdwebPublicBlackEmail::getStatus, 1).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
|
|
|
List<String> pubicBlackEmailList = pubicEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
|
|
|
|
|
|
List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
|
|
@@ -366,9 +366,9 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
adwebRedisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
|
|
|
adwebRedisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
|
|
|
|
|
|
- QueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new QueryWrapper<>();
|
|
|
- siteAllEmailQueryWrapper.ne("status", 0);
|
|
|
- siteAllEmailQueryWrapper.eq("site_id", enquirySiteBlackEmail.getSiteId());
|
|
|
+ LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
|
|
|
+ siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
|
|
|
List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
|
|
|
if (CollectionUtils.isEmpty(allEmailList)) {
|
|
|
log.info("未获取到对应站点的黑白名单数据");
|
|
@@ -428,7 +428,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
|
|
|
List<String> idList = Arrays.asList(ids.split(","));
|
|
|
|
|
|
- List<AdwebSiteBlackEmail> list = enquirySiteBlackEmailService.list(new QueryWrapper<AdwebSiteBlackEmail>().in("id", idList).ne("status", 0));
|
|
|
+ List<AdwebSiteBlackEmail> list = enquirySiteBlackEmailService.list(new LambdaQueryWrapper<AdwebSiteBlackEmail>().in(AdwebSiteBlackEmail::getSiteId, idList).ne(AdwebSiteBlackEmail::getStatus, 0));
|
|
|
|
|
|
if (list.isEmpty()) {
|
|
|
return Result.error("未找到对应数据");
|
|
@@ -441,7 +441,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
for (AdwebSiteBlackEmail enquirySiteBlackEmail : list) {
|
|
|
|
|
|
//判断公共询盘缓存的是否包含历史的黑名单数据
|
|
|
- List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
|
|
|
+ List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().eq(AdwebPublicBlackEmail::getStatus, 1).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
|
|
|
List<String> pubicBlackEmailList = pubicEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
|
|
|
|
|
|
List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
|
|
@@ -474,9 +474,9 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
|
|
|
|
|
|
|
|
|
for (Integer siteId : siteList) {
|
|
|
- QueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new QueryWrapper<>();
|
|
|
- siteAllEmailQueryWrapper.ne("status", 0);
|
|
|
- siteAllEmailQueryWrapper.eq("site_id", siteId);
|
|
|
+ LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
|
|
|
+ siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, siteId);
|
|
|
List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
|
|
|
if (CollectionUtils.isEmpty(allEmailList)) {
|
|
|
log.info("未获取到对应站点的黑白名单数据");
|