Просмотр исходного кода

Merge branch 'cpq-dev-temp' of wangfan/adweb3-server into master

chenpeiqing 4 месяцев назад
Родитель
Сommit
1f43d851da

+ 24 - 24
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicBlackEmailController.java

@@ -15,7 +15,7 @@ import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.util.RedisUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackEmail;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackEmailService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,7 +41,7 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
     private IAdwebPublicBlackEmailService adwebPublicBlackEmailService;
 
     @Resource
-    private RedisUtil redisUtil;
+    private AdwebRedisUtil adwebRedisUtil;
 
     // Email Redis key
     private static final String EmailTenMinKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_10_MIN::";
@@ -109,17 +109,17 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         if (CollectionUtils.isNotEmpty(emailList)) {
             List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackEmailKey);
+            adwebRedisUtil.del(BlackEmailKey);
         }
         List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
             List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteEmailListKey);
+            adwebRedisUtil.del(WhiteEmailListKey);
         }
         return Result.OK("添加成功!");
     }
@@ -154,17 +154,17 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         if (CollectionUtils.isNotEmpty(emailList)) {
             List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackEmailKey);
+            adwebRedisUtil.del(BlackEmailKey);
         }
         List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
             List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteEmailListKey);
+            adwebRedisUtil.del(WhiteEmailListKey);
         }
         return Result.OK("编辑成功!");
     }
@@ -194,25 +194,25 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         adwebPublicBlackEmailService.updateById(enquiryPublicBlackEmail);
 
-        redisUtil.del(EmailTenMinKey + enquiryPublicBlackEmail.getEmail());
-        redisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
-        redisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
+        adwebRedisUtil.del(EmailTenMinKey + enquiryPublicBlackEmail.getEmail());
+        adwebRedisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
+        adwebRedisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
 
         List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 0));
 
         if (CollectionUtils.isNotEmpty(emailList)) {
             List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackEmailKey);
+            adwebRedisUtil.del(BlackEmailKey);
         }
         List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
             List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteEmailListKey);
+            adwebRedisUtil.del(WhiteEmailListKey);
         }
 
         return Result.OK("删除成功!");
@@ -245,25 +245,25 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         //删除redis中的数据
         for (AdwebPublicBlackEmail enquiryPublicBlackEmail : list) {
-            redisUtil.del(EmailTenMinKey + enquiryPublicBlackEmail.getEmail());
-            redisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
-            redisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
+            adwebRedisUtil.del(EmailTenMinKey + enquiryPublicBlackEmail.getEmail());
+            adwebRedisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
+            adwebRedisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
         }
         List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 0));
 
         if (emailList != null) {
             List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackEmailKey);
+            adwebRedisUtil.del(BlackEmailKey);
         }
         List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().ne("status", 0).eq("black_or_white", 1));
 
         if (whiteEmailList != null) {
             List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-            redisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteEmailListKey);
+            adwebRedisUtil.del(WhiteEmailListKey);
         }
 
         return update ? Result.OK("删除成功!") : Result.error("删除失败!");

+ 24 - 24
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicBlackIpController.java

@@ -14,7 +14,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.util.RedisUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackIp;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackIpService;
 import org.springframework.web.bind.annotation.*;
@@ -40,7 +40,7 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
     private IAdwebPublicBlackIpService adwebBlackIpService;
 
     @Resource
-    private RedisUtil redisUtil;
+    private AdwebRedisUtil adwebRedisUtil;
 
     private static final String IpTenMinKey = "JUDGE_WASTE_ENQUIRY_IP_BY_10_MIN::";
     private static final String IpOneDayKey = "JUDGE_WASTE_ENQUIRY_IP_BY_ONE_DAY::";
@@ -101,18 +101,18 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
             List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackIpKey);
+            adwebRedisUtil.del(BlackIpKey);
         }
 
         List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
             List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteIpListKey);
+            adwebRedisUtil.del(WhiteIpListKey);
         }
         return Result.OK("添加成功!");
     }
@@ -147,18 +147,18 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
             List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackIpKey);
+            adwebRedisUtil.del(BlackIpKey);
         }
 
         List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
             List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteIpListKey);
+            adwebRedisUtil.del(WhiteIpListKey);
         }
         return Result.OK("编辑成功!");
     }
@@ -189,26 +189,26 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
 
         adwebBlackIpService.updateById(adwebBlackIp);
 
-        redisUtil.del(IpTenMinKey + adwebBlackIp.getIp());
-        redisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
-        redisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
+        adwebRedisUtil.del(IpTenMinKey + adwebBlackIp.getIp());
+        adwebRedisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
+        adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
 
         List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
             List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackIpKey);
+            adwebRedisUtil.del(BlackIpKey);
         }
 
         List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
             List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteIpListKey);
+            adwebRedisUtil.del(WhiteIpListKey);
         }
 
         return Result.OK("删除成功!");
@@ -239,27 +239,27 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
         adwebBlackIpService.update(new UpdateWrapper<AdwebPublicBlackIp>().in("id", idList).set("status", 0));
 
         for (AdwebPublicBlackIp adwebBlackIp : list) {
-            redisUtil.del(IpTenMinKey + adwebBlackIp.getIp());
-            redisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
-            redisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
+            adwebRedisUtil.del(IpTenMinKey + adwebBlackIp.getIp());
+            adwebRedisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
+            adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
         }
 
         List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
             List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(BlackIpKey);
+            adwebRedisUtil.del(BlackIpKey);
         }
 
         List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).eq("black_or_white", 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
             List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-            redisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
+            adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
-            redisUtil.del(WhiteIpListKey);
+            adwebRedisUtil.del(WhiteIpListKey);
         }
 
 

+ 34 - 34
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebSiteBlackEmailController.java

@@ -18,7 +18,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.RedisUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryBlacklist;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackEmail;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteBlackEmail;
@@ -49,7 +49,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
     @Resource
     private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
     @Resource
-    private RedisUtil redisUtil;
+    private AdwebRedisUtil adwebRedisUtil;
     @Resource
     private ISysBaseAPI sysBaseAPI;
 
@@ -182,16 +182,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
 
         //处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            redisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
         //处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            redisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
         return Result.OK("添加成功!");
     }
@@ -239,7 +239,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             List<AdwebPublicBlackEmail> emailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
             List<String> pubicBlackEmailList = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
 
-            List<String> publicBlackList = (List<String>) redisUtil.get(BlackEmailKey);
+            List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
 
             publicBlackList.removeAll(pubicBlackEmailList);
             if (CollectionUtils.isNotEmpty(publicBlackList)) {
@@ -254,7 +254,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                     }
                 }
                 pubicBlackEmailList.addAll(publicBlackList);
-                redisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
             }
         }
 
@@ -275,16 +275,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
 
         //处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            redisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
         //处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            redisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
         //处理站点改变的数据缓存
@@ -294,16 +294,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             List<String> oldWhiteEmailList = oldAdwebSiteBlackEmailListMap.get("white");
             //处理对应站点的黑名单
             if (CollectionUtils.isNotEmpty(oldEmailList)) {
-                redisUtil.set(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldEmailList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
+                adwebRedisUtil.del(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
             }
 
             //处理对应站点的白名单
             if (CollectionUtils.isNotEmpty(oldWhiteEmailList)) {
-                redisUtil.set(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldWhiteEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldWhiteEmailList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
+                adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
             }
         }
 
@@ -335,7 +335,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
         List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
         List<String> pubicBlackEmailList = pubicEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
 
-        List<String> publicBlackList = (List<String>) redisUtil.get(BlackEmailKey);
+        List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
 
         if (CollectionUtils.isNotEmpty(publicBlackList)) {
             if (CollectionUtils.isNotEmpty(pubicBlackEmailList)) {
@@ -354,15 +354,15 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                 }
             }
             pubicBlackEmailList.addAll(publicBlackList);
-            redisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
         }
         enquirySiteBlackEmail.setStatus(0);
         enquirySiteBlackEmail.setUpdateTime(new Date());
         enquirySiteBlackEmailService.updateById(enquirySiteBlackEmail);
 
-        redisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-        redisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-        redisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+        adwebRedisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+        adwebRedisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+        adwebRedisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
 
         QueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new QueryWrapper<>();
         siteAllEmailQueryWrapper.ne("status", 0);
@@ -393,16 +393,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
         }
         //处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            redisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
         //处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            redisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
+            adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
         return Result.OK("删除成功!");
@@ -442,7 +442,7 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             List<AdwebPublicBlackEmail> pubicEmailList = enquiryPublicBlackEmailService.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1).eq("black_or_white", 0));
             List<String> pubicBlackEmailList = pubicEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
 
-            List<String> publicBlackList = (List<String>) redisUtil.get(BlackEmailKey);
+            List<String> publicBlackList = (List<String>) adwebRedisUtil.get(BlackEmailKey);
 
             if (CollectionUtils.isNotEmpty(publicBlackList)) {
                 if (CollectionUtils.isNotEmpty(pubicBlackEmailList)) {
@@ -461,12 +461,12 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                     }
                 }
                 pubicBlackEmailList.addAll(publicBlackList);
-                redisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
             }
 
-            redisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-            redisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-            redisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+            adwebRedisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+            adwebRedisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
+            adwebRedisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
             siteList.add(enquirySiteBlackEmail.getSiteId());
         }
 
@@ -501,16 +501,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             }
             //处理对应站点的黑名单
             if (CollectionUtils.isNotEmpty(emailList)) {
-                redisUtil.set(SiteBlackEmailKey + "::" + siteId, emailList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteBlackEmailKey + "::" + siteId, emailList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteBlackEmailKey + "::" + siteId);
+                adwebRedisUtil.del(SiteBlackEmailKey + "::" + siteId);
             }
 
             //处理对应站点的白名单
             if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-                redisUtil.set(SiteWhiteEmailListKey + "::" + siteId, whiteEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + siteId, whiteEmailList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteWhiteEmailListKey + "::" + siteId);
+                adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + siteId);
             }
         }
         return update ? Result.OK("批量删除成功!") : Result.error("批量删除失败!");

+ 34 - 34
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebSiteBlackIpController.java

@@ -18,7 +18,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.common.util.RedisUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteBlackIp;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebSiteBlackIpService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
@@ -51,7 +51,7 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
     private ISysBaseAPI sysBaseAPI;
 
     @Resource
-    private RedisUtil redisUtil;
+    private AdwebRedisUtil adwebRedisUtil;
 
     private static final String SiteIpTenMinKey = "JUDGE_WASTE_ENQUIRY_SITE_IP_BY_10_MIN::";
     private static final String SiteIpOneDayKey = "JUDGE_WASTE_ENQUIRY_SITE_IP_BY_ONE_DAY::";
@@ -140,23 +140,23 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new QueryWrapper<AdwebSiteBlackIp>().eq("status", 1).eq("site_id", adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
             return Result.OK("编辑成功!");
         }
 
         List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            redisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
         List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            redisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
         return Result.OK("添加成功!");
     }
@@ -181,31 +181,31 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         }
         AdwebSiteBlackIp oldSiteBlackIp = adwebSiteBlackIpService.getById(adwebSiteBlackIp.getId());
         if (!oldSiteBlackIp.getSiteId().equals(adwebSiteBlackIp.getSiteId())) {
-            redisUtil.del(SiteBlackIpKey + "::" + oldSiteBlackIp.getSiteId());
-            redisUtil.del(SiteWhiteIpListKey + "::" + oldSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + oldSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + oldSiteBlackIp.getSiteId());
         }
         adwebSiteBlackIpService.updateById(adwebSiteBlackIp);
 
         List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new QueryWrapper<AdwebSiteBlackIp>().eq("status", 1).eq("site_id", adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
             return Result.OK("编辑成功!");
         }
 
         List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            redisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
         List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            redisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
         return Result.OK("编辑成功!");
     }
@@ -236,30 +236,30 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         adwebSiteBlackIp.setStatus(0);
         adwebSiteBlackIpService.updateById(adwebSiteBlackIp);
 
-        redisUtil.del(SiteIpTenMinKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-        redisUtil.del(SiteIpOneDayKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-        redisUtil.del(NotSiteBlackIpWasteEnquiryKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+        adwebRedisUtil.del(SiteIpTenMinKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+        adwebRedisUtil.del(SiteIpOneDayKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+        adwebRedisUtil.del(NotSiteBlackIpWasteEnquiryKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
 
         List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new QueryWrapper<AdwebSiteBlackIp>().eq("status", 1).eq("site_id", adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
             return Result.OK("编辑成功!");
         }
 
         List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            redisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
         List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            redisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
         } else {
-            redisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
         return Result.OK("删除成功!");
@@ -295,9 +295,9 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
 
         HashSet<Integer> siteIdHashSet = new HashSet<Integer>();
         for (AdwebSiteBlackIp adwebSiteBlackIp : list) {
-            redisUtil.del(SiteIpTenMinKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-            redisUtil.del(SiteIpOneDayKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-            redisUtil.del(NotSiteBlackIpWasteEnquiryKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+            adwebRedisUtil.del(SiteIpTenMinKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+            adwebRedisUtil.del(SiteIpOneDayKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
+            adwebRedisUtil.del(NotSiteBlackIpWasteEnquiryKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
             siteIdHashSet.add(adwebSiteBlackIp.getSiteId());
         }
 
@@ -305,23 +305,23 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new QueryWrapper<AdwebSiteBlackIp>().eq("status", 1).eq("site_id", siteId));
 
             if (CollectionUtils.isEmpty(siteBlackIpList)) {
-                redisUtil.del(SiteBlackIpKey + "::" + siteId);
-                redisUtil.del(SiteWhiteIpListKey + "::" + siteId);
+                adwebRedisUtil.del(SiteBlackIpKey + "::" + siteId);
+                adwebRedisUtil.del(SiteWhiteIpListKey + "::" + siteId);
                 return Result.OK("编辑成功!");
             }
 
             List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(blackIpList)) {
-                redisUtil.set(SiteBlackIpKey + "::" + siteId, blackIpList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteBlackIpKey + "::" + siteId, blackIpList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteBlackIpKey + "::" + siteId);
+                adwebRedisUtil.del(SiteBlackIpKey + "::" + siteId);
             }
 
             List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(whiteIpList)) {
-                redisUtil.set(SiteWhiteIpListKey + "::" + siteId, whiteIpList, 60 * 60 * 24);
+                adwebRedisUtil.set(SiteWhiteIpListKey + "::" + siteId, whiteIpList, 60 * 60 * 24);
             } else {
-                redisUtil.del(SiteWhiteIpListKey + "::" + siteId);
+                adwebRedisUtil.del(SiteWhiteIpListKey + "::" + siteId);
             }
         }
 

+ 9 - 9
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackEmailServiceImpl.java

@@ -27,7 +27,7 @@ public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBla
 //    @Resource
 //    private IAdwebPublicBlackIpService adwebPublicBlackIpService;
 //    @Resource
-//    private RedisUtil redisUtil;
+//    private AdwebRedisUtil adwebRedisUtil;
 
     @Value("${judge_waste_enquiry.ip.delOrdIpDate}")
     private Integer delOrdIpDate;
@@ -48,8 +48,8 @@ public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBla
     AdwebPublicBlackEmailMapper adwebPublicBlackEmailMapper;
 
     @Override
-    public IPage<AdwebPublicBlackEmail> pageList(Page<AdwebPublicBlackEmail> page, String email, Integer blackOrWhite,String column,String order) {
-        return adwebPublicBlackEmailMapper.pageList(page,email,blackOrWhite,column,order);
+    public IPage<AdwebPublicBlackEmail> pageList(Page<AdwebPublicBlackEmail> page, String email, Integer blackOrWhite, String column, String order) {
+        return adwebPublicBlackEmailMapper.pageList(page, email, blackOrWhite, column, order);
     }
 
     //定时器执行
@@ -64,8 +64,8 @@ public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBla
 //
 //        List<String> whiteEmailList = emailList.stream().filter(e -> e.getBlackOrWhite() == 1).map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
 //
-//        redisUtil.set(BlackEmailKey, blackEmailList, 60 * 60 * 24);
-//        redisUtil.set(WhiteEmailListKey, whiteEmailList, 60 * 60 * 24);
+//        adwebRedisUtil.set(BlackEmailKey, blackEmailList, 60 * 60 * 24);
+//        adwebRedisUtil.set(WhiteEmailListKey, whiteEmailList, 60 * 60 * 24);
 //
 //        log.info("更新email黑名单成功,黑名单数量为:{},白名单数量为{}", blackEmailList.size(), whiteEmailList.size());
 //
@@ -78,8 +78,8 @@ public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBla
 //
 //        List<String> whiteIpList = ipList.stream().filter(e -> e.getBlackOrWhite() == 1).map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
 //
-//        redisUtil.set(BlackIpKey, blackIpList, 60 * 60 * 24);
-//        redisUtil.set(WhiteIpListKey, whiteIpList, 60 * 60 * 24);
+//        adwebRedisUtil.set(BlackIpKey, blackIpList, 60 * 60 * 24);
+//        adwebRedisUtil.set(WhiteIpListKey, whiteIpList, 60 * 60 * 24);
 //
 //        log.info("更新ip黑名单成功,黑名单数量为:{},白名单数量为{}", blackIpList.size(), whiteIpList.size());
 //
@@ -103,8 +103,8 @@ public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBla
 //    }
 
     /**
-    * 定时器执行
-    */
+     * 定时器执行
+     */
 //    @Override
 //    public void updateEnquiryBlackList() {
 //        List<AdwebEnquiry> enquiryListByTenMin = adwebEnquiryService.list(new QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT email").groupBy("email,UNIX_TIMESTAMP( record_ctime ) DIV 600 ").having("count(id) > "+emailTenMinNum));

+ 21 - 21
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteBlackIpServiceImpl.java

@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
 import jakarta.annotation.Resource;
-
 import org.apache.commons.collections4.CollectionUtils;
-import org.jeecg.common.util.RedisUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteBlackIp;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebSiteBlackIpMapper;
@@ -23,7 +21,7 @@ import java.util.stream.Collectors;
 /**
  * @Description: adweb_site_black_ip
  * @Author: jeecg-boot
- * @Date:   2023-08-31
+ * @Date: 2023-08-31
  * @Version: V1.0
  */
 @Service
@@ -32,7 +30,7 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
     @Resource
     private AdwebSiteBlackIpMapper adwebSiteBlackIpMapper;
     @Resource
-    private RedisUtil redisUtil;
+    private AdwebRedisUtil adwebRedisUtil;
 
     private static final String SiteIpTenMinKey = "JUDGE_WASTE_ENQUIRY_SITE_IP_BY_10_MIN::";
     private static final String SiteIpOneDayKey = "JUDGE_WASTE_ENQUIRY_SITE_IP_BY_ONE_DAY::";
@@ -42,10 +40,11 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
 
     /**
      * 更改为垃圾询盘处理ip黑名单
+     *
      * @param effectiveEnquiryParamDto
      */
     @Override
-    public void addBlackIpByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto){
+    public void addBlackIpByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
         //排查添加的ip是否已有
         QueryWrapper<AdwebSiteBlackIp> adwebSiteBlackIpQueryWrapper = new QueryWrapper<>();
         adwebSiteBlackIpQueryWrapper.eq("ip", effectiveEnquiryParamDto.getWasteEnquirySeason());
@@ -53,10 +52,10 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
         adwebSiteBlackIpQueryWrapper.eq("site_code", effectiveEnquiryParamDto.getSiteCode());
         adwebSiteBlackIpQueryWrapper.eq("status", 1);
         List<AdwebSiteBlackIp> adwebSiteBlackIpList = list(adwebSiteBlackIpQueryWrapper);
-        if(!adwebSiteBlackIpList.isEmpty()){
+        if (!adwebSiteBlackIpList.isEmpty()) {
             //如果有白名单 先删除原数据,后添加新的黑名单数据
             AdwebSiteBlackIp adwebSiteBlackIp = adwebSiteBlackIpList.get(0);
-            if(adwebSiteBlackIp.getBlackOrWhite() == 1){
+            if (adwebSiteBlackIp.getBlackOrWhite() == 1) {
                 adwebSiteBlackIp.setStatus(0);
                 updateById(adwebSiteBlackIp);
 
@@ -69,7 +68,7 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
                 newSiteBlackIp.setCreateTime(new Date());
                 save(newSiteBlackIp);
             }
-        }else{
+        } else {
             AdwebSiteBlackIp newSiteBlackIp = new AdwebSiteBlackIp();
             newSiteBlackIp.setIp(effectiveEnquiryParamDto.getWasteEnquirySeason());
             newSiteBlackIp.setBlackOrWhite(0);
@@ -88,22 +87,22 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
         List<AdwebSiteBlackIp> redisList = list(redisWrapper);
 
         if (!redisList.isEmpty()) {
-            redisUtil.del(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId());
-            redisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
+            adwebRedisUtil.del(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId());
+            adwebRedisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
         }
-        if(CollectionUtils.isNotEmpty(redisList)){
+        if (CollectionUtils.isNotEmpty(redisList)) {
             List<String> blackIpList = redisList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
-            if(CollectionUtils.isNotEmpty(blackIpList)){
-                redisUtil.set(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId(), blackIpList, 60 * 60 * 24);
-            } else{
-                redisUtil.del(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId());
+            if (CollectionUtils.isNotEmpty(blackIpList)) {
+                adwebRedisUtil.set(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId(), blackIpList, 60 * 60 * 24);
+            } else {
+                adwebRedisUtil.del(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId());
             }
 
             List<String> whiteIpList = redisList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
-            if(CollectionUtils.isNotEmpty(whiteIpList)){
-                redisUtil.set(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId(), whiteIpList, 60 * 60 * 24);
-            } else{
-                redisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
+            if (CollectionUtils.isNotEmpty(whiteIpList)) {
+                adwebRedisUtil.set(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId(), whiteIpList, 60 * 60 * 24);
+            } else {
+                adwebRedisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
             }
         }
 
@@ -111,13 +110,14 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
 
     /**
      * 获取分页列表数据
+     *
      * @param page
      * @param adwebSiteBlackIp
      * @param codeList
      * @return
      */
     @Override
-    public IPage<AdwebSiteBlackIp> pageList(Page<AdwebSiteBlackIp> page, AdwebSiteBlackIp adwebSiteBlackIp, List<String> codeList, String column, String order){
+    public IPage<AdwebSiteBlackIp> pageList(Page<AdwebSiteBlackIp> page, AdwebSiteBlackIp adwebSiteBlackIp, List<String> codeList, String column, String order) {
         return adwebSiteBlackIpMapper.getPageList(page, adwebSiteBlackIp, codeList, column, order);
     }
 }