Bladeren bron

Merge branch 'lambda' of wangfan/adweb3-server into master

wangfan 2 maanden geleden
bovenliggende
commit
65c071ad68
43 gewijzigde bestanden met toevoegingen van 1982 en 1093 verwijderingen
  1. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryConstants.java
  2. 0 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryDistributeTypeConstant.java
  3. 47 35
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryBlacklistController.java
  4. 186 126
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryController.java
  5. 21 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryRecordController.java
  6. 137 39
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicBlackEmailController.java
  7. 120 34
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicBlackIpController.java
  8. 119 35
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicEnquriyRuleController.java
  9. 240 99
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebSiteBlackEmailController.java
  10. 170 53
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebSiteBlackIpController.java
  11. 39 24
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebSiteEnquiryRuleController.java
  12. 9 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/EnquiryDTO.java
  13. 1 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/IndependentEnquiryDto.java
  14. 1 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EffectiveEnquiryParamDto.java
  15. 1 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquiryListSearchDto.java
  16. 7 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquirySearchDto.java
  17. 24 31
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java
  18. 2 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquirySpecialFields.java
  19. 12 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/AdwebOpenApiService.java
  20. 4 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/EnquiryRedisService.java
  21. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryBlacklistService.java
  22. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryFormService.java
  23. 3 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryService.java
  24. 10 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicBlackEmailService.java
  25. 8 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicBlackIpService.java
  26. 10 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicEnquiryRuleService.java
  27. 10 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebSiteBlackEmailService.java
  28. 9 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebSiteBlackIpService.java
  29. 12 13
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IEnquiryEmailMessageService.java
  30. 1 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/ISubUserEmailService.java
  31. 12 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryBlacklistServiceImpl.java
  32. 4 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryFormServiceImpl.java
  33. 4 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryRecordServiceImpl.java
  34. 338 224
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java
  35. 170 122
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackEmailServiceImpl.java
  36. 14 6
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackIpServiceImpl.java
  37. 29 18
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicEnquiryRuleServiceImpl.java
  38. 51 32
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteBlackEmailServiceImpl.java
  39. 46 21
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteBlackIpServiceImpl.java
  40. 16 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteEnquiryRuleServiceImpl.java
  41. 80 68
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/EnquiryEmailMessageServiceImpl.java
  42. 5 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/SubUserEmailServiceImpl.java
  43. 7 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/listener/EnquiryEmailSenderListener.java

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryConstants.java

@@ -9,6 +9,6 @@ public class EnquiryConstants {
 
     public static final String ENQUIRY_EMAIL_CHANNEL = "enquiry_email_channel";
 
-    //独立询盘
+    // 独立询盘
     public static final String ENQUIRY_MODULAR_INDEPENDENT = "independent";
 }

+ 0 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/constant/EnquiryDistributeTypeConstant.java

@@ -7,5 +7,4 @@ public class EnquiryDistributeTypeConstant {
     public static final String ALL = "ALL";
 
     public static final String REGION = "REGION";
-
 }

+ 47 - 35
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryBlacklistController.java

@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-import kotlin.jvm.internal.Lambda;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -49,27 +52,21 @@ import java.util.List;
 @RestController
 @RequestMapping("/enquiry/blacklist")
 @Slf4j
-public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquiryBlacklist, IAdwebEnquiryBlacklistService> {
-    @Resource
-    private IAdwebEnquiryBlacklistService adwebEnquiryBlacklistService;
+public class AdwebEnquiryBlacklistController
+        extends JeecgController<AdwebEnquiryBlacklist, IAdwebEnquiryBlacklistService> {
+    @Resource private IAdwebEnquiryBlacklistService adwebEnquiryBlacklistService;
 
-    @Resource
-    private IAdwebEnquiryService adwebEnquiryService;
+    @Resource private IAdwebEnquiryService adwebEnquiryService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
+    @Resource private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
 
-    @Resource
-    private IAdwebUserCountryService adwebUserCountryService;
+    @Resource private IAdwebUserCountryService adwebUserCountryService;
 
     /**
      * 分页列表查询
@@ -77,10 +74,11 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
      * @param queryParam 查询参数,邮箱/姓名/国家
      */
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(String queryParam,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   Integer siteId) {
+    public Result<?> queryPageList(
+            String queryParam,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            Integer siteId) {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         LambdaQueryWrapper<AdwebEnquiryBlacklist> queryWrapper = new LambdaQueryWrapper<>();
         if (siteId != null) {
@@ -90,7 +88,8 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
             if (sysAdwebApi.isChannelAdmin()) {
                 List<String> channelGroupUids = sysAdwebApi.getChannelGroupUids();
 
-                List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+                List<String> codeList =
+                        siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
                 LambdaQueryWrapper<AdwebSite> queryWrapper1 = new LambdaQueryWrapper<>();
                 queryWrapper1.ne(AdwebSite::getStatus, 0);
                 queryWrapper1.in(AdwebSite::getCode, codeList);
@@ -106,9 +105,13 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
             }
         }
         if (StringUtils.isNotBlank(queryParam)) {
-            queryWrapper.and(wrapper -> wrapper.like(AdwebEnquiryBlacklist::getEmail, queryParam)
-                    .or().like(AdwebEnquiryBlacklist::getName, queryParam)
-                    .or().like(AdwebEnquiryBlacklist::getCountryName, queryParam));
+            queryWrapper.and(
+                    wrapper ->
+                            wrapper.like(AdwebEnquiryBlacklist::getEmail, queryParam)
+                                    .or()
+                                    .like(AdwebEnquiryBlacklist::getName, queryParam)
+                                    .or()
+                                    .like(AdwebEnquiryBlacklist::getCountryName, queryParam));
         }
 
         if (sysAdwebApi.isAdwebSubVip()) {
@@ -118,7 +121,8 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
                 return Result.OK(new Page<>(pageNo, pageSize));
             }
             if (EnquiryDistributeTypeConstant.REGION.equals(distributeType)) {
-                List<String> countryCodes = adwebUserCountryService.getCountryCodesBySubId(loginUser.getId(), siteId);
+                List<String> countryCodes =
+                        adwebUserCountryService.getCountryCodesBySubId(loginUser.getId(), siteId);
                 if (CollectionUtils.isEmpty(countryCodes)) {
                     return Result.OK(new Page<>(pageNo, pageSize));
                 }
@@ -129,7 +133,8 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
         queryWrapper.eq(AdwebEnquiryBlacklist::getStatus, 1);
         queryWrapper.orderByDesc(AdwebEnquiryBlacklist::getCreateTime);
         Page<AdwebEnquiryBlacklist> page = new Page<AdwebEnquiryBlacklist>(pageNo, pageSize);
-        IPage<AdwebEnquiryBlacklist> pageList = adwebEnquiryBlacklistService.page(page, queryWrapper);
+        IPage<AdwebEnquiryBlacklist> pageList =
+                adwebEnquiryBlacklistService.page(page, queryWrapper);
 
         return Result.OK(pageList);
     }
@@ -158,13 +163,16 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
     public Result<?> addBlacklist(@RequestBody EnquiryListDto adwebEnquiry) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-
-        //判断站点询盘黑名单是否存在添加进来的黑名单
-        LambdaQueryWrapper<AdwebSiteBlackEmail> enquirySiteBlackEmailQueryWrapper = new LambdaQueryWrapper<>();
-        enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, adwebEnquiry.getSiteId());
+        // 判断站点询盘黑名单是否存在添加进来的黑名单
+        LambdaQueryWrapper<AdwebSiteBlackEmail> enquirySiteBlackEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
+        enquirySiteBlackEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getSiteId, adwebEnquiry.getSiteId());
         enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getStatus, 1);
-        enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getEmail, adwebEnquiry.getFromEmail());
-        List<AdwebSiteBlackEmail> enquirySiteBlackEmailList = enquirySiteBlackEmailService.list(enquirySiteBlackEmailQueryWrapper);
+        enquirySiteBlackEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getEmail, adwebEnquiry.getFromEmail());
+        List<AdwebSiteBlackEmail> enquirySiteBlackEmailList =
+                enquirySiteBlackEmailService.list(enquirySiteBlackEmailQueryWrapper);
 
         if (CollectionUtils.isNotEmpty(enquirySiteBlackEmailList)) {
             Integer blackOrWhite = enquirySiteBlackEmailList.get(0).getBlackOrWhite();
@@ -280,8 +288,13 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
      * @param adwebEnquiryBlacklist
      */
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebEnquiryBlacklist adwebEnquiryBlacklist) {
-        return super.exportXls(request, adwebEnquiryBlacklist, AdwebEnquiryBlacklist.class, "adweb_enquiry_blacklist");
+    public ModelAndView exportXls(
+            HttpServletRequest request, AdwebEnquiryBlacklist adwebEnquiryBlacklist) {
+        return super.exportXls(
+                request,
+                adwebEnquiryBlacklist,
+                AdwebEnquiryBlacklist.class,
+                "adweb_enquiry_blacklist");
     }
 
     /**
@@ -295,5 +308,4 @@ public class AdwebEnquiryBlacklistController extends JeecgController<AdwebEnquir
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebEnquiryBlacklist.class);
     }
-
 }

+ 186 - 126
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryController.java

@@ -4,12 +4,16 @@ 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
@@ -32,7 +36,6 @@ import org.jeecg.modules.adweb.enquiry.dto.param.EnquirySearchDto;
 import org.jeecg.modules.adweb.enquiry.dto.result.EnquiryListDto;
 import org.jeecg.modules.adweb.enquiry.dto.result.EnquirySpecialFields;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
-import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryBlacklist;
 import org.jeecg.modules.adweb.enquiry.entity.EnquiryEmailMessage;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryMapper;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryService;
@@ -69,32 +72,25 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
 
     @Value("${enquiry.disable-admin-read:true}")
     private Boolean disableAdminRead;
+
     @Value("${enquiry.demoFlag:false}")
     private Boolean demoFlag;
 
-    @Resource
-    private IAdwebEnquiryService adwebEnquiryService;
+    @Resource private IAdwebEnquiryService adwebEnquiryService;
 
-    @Resource
-    private AdwebEnquiryMapper adwebEnquiryMapper;
+    @Resource private AdwebEnquiryMapper adwebEnquiryMapper;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private ISysDictService sysDictService;
+    @Resource private ISysDictService sysDictService;
 
-    @Resource
-    private AwsTranslateUtils awsTranslateUtils;
+    @Resource private AwsTranslateUtils awsTranslateUtils;
 
-    @Resource
-    private ISysUserService sysUserService;
+    @Resource private ISysUserService sysUserService;
 
     /**
      * 分页列表查询
@@ -105,13 +101,14 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
      * @param principalUid
      * @return
      */
-    //@AutoLog(value = "询盘信息存储表单-分页列表查询")
+    // @AutoLog(value = "询盘信息存储表单-分页列表查询")
     @Operation(summary = "询盘信息存储表单-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(EnquiryListSearchDto searchDto,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   String principalUid) {
+    public Result<?> queryPageList(
+            EnquiryListSearchDto searchDto,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            String principalUid) {
 
         if (sysAdwebApi.isNotOwnSite(searchDto.getSiteId())) {
             return Result.OK(new Page<>());
@@ -140,16 +137,21 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
             String siteCode = adwebSiteService.getSiteCodeById(searchDto.getSiteId());
             if (StringUtils.isNotBlank(siteCode)) {
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.eq(AdwebSite::getId, searchDto.getSiteId()).or().eq(AdwebSite::getParentGroupCode, siteCode);
+                queryWrapper
+                        .eq(AdwebSite::getId, searchDto.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());
+                codeList =
+                        adwebSiteService.list(queryWrapper).stream()
+                                .map(AdwebSite::getCode)
+                                .collect(Collectors.toList());
             }
         } else {
             codeList = siteCodeList;
         }
 
-
         String dateType = searchDto.getDateType();
         Date start = searchDto.getStart();
         Date end = searchDto.getEnd();
@@ -170,9 +172,20 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
 
         String userEfftecive = "(" + searchDto.getUserEffective() + ")";
 
-
-        IPage<EnquiryListDto> pageList = adwebEnquiryMapper.selectEnquiryList(page, codeList, userEfftecive, searchDto.getWasteEnquiryType(),
-                searchDto.getSearchText(), searchDto.getSearchContent(), start, end, searchDto.getWhatsApp(), searchDto.getReadStatus(), principalUid, selfPrincipalUid);
+        IPage<EnquiryListDto> pageList =
+                adwebEnquiryMapper.selectEnquiryList(
+                        page,
+                        codeList,
+                        userEfftecive,
+                        searchDto.getWasteEnquiryType(),
+                        searchDto.getSearchText(),
+                        searchDto.getSearchContent(),
+                        start,
+                        end,
+                        searchDto.getWhatsApp(),
+                        searchDto.getReadStatus(),
+                        principalUid,
+                        selfPrincipalUid);
 
         if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
             dealInfo(pageList.getRecords());
@@ -190,56 +203,64 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
             return;
         }
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        List<DictModel> userEffectiveDict = sysDictService.queryDictItemsByCode(AdwebConstant.ENQUIRY_EFFECTIVE);
+        List<DictModel> userEffectiveDict =
+                sysDictService.queryDictItemsByCode(AdwebConstant.ENQUIRY_EFFECTIVE);
         AtomicInteger atomicInteger = new AtomicInteger();
 
-        enquiryList.forEach(enquiry -> {
-            // 来源页面如果以 / 结尾,去掉最后一个字符
-            String fromPage = enquiry.getFromPage();
-            if (StringUtils.isNotBlank(fromPage)) {
-                if (fromPage.endsWith("/")) {
-                    enquiry.setFromPage(fromPage.substring(0, fromPage.length() - 1));
-                }
-            }
-            atomicInteger.getAndIncrement();
-            enquiry.setDataIndex(atomicInteger.get());
-
-            // 示例关键信息脱敏
-            if (demoFlag) {
-                enquiry.setFormCompany("**********");
-                enquiry.setFromEmail("**********");
-                enquiry.setWhatsApp("**********");
-                enquiry.setPhone("**********");
-                String siteName = enquiry.getSiteName();
-                enquiry.setSiteName(siteName.substring(0, 2) + "**********" + siteName.substring(siteName.length() - 2));
-            }
+        enquiryList.forEach(
+                enquiry -> {
+                    // 来源页面如果以 / 结尾,去掉最后一个字符
+                    String fromPage = enquiry.getFromPage();
+                    if (StringUtils.isNotBlank(fromPage)) {
+                        if (fromPage.endsWith("/")) {
+                            enquiry.setFromPage(fromPage.substring(0, fromPage.length() - 1));
+                        }
+                    }
+                    atomicInteger.getAndIncrement();
+                    enquiry.setDataIndex(atomicInteger.get());
+
+                    // 示例关键信息脱敏
+                    if (demoFlag) {
+                        enquiry.setFormCompany("**********");
+                        enquiry.setFromEmail("**********");
+                        enquiry.setWhatsApp("**********");
+                        enquiry.setPhone("**********");
+                        String siteName = enquiry.getSiteName();
+                        enquiry.setSiteName(
+                                siteName.substring(0, 2)
+                                        + "**********"
+                                        + siteName.substring(siteName.length() - 2));
+                    }
 
-            /**********************字典数据处理***********************/
-            if (CollectionUtils.isNotEmpty(userEffectiveDict)) {
-                userEffectiveDict.forEach(dict -> {
-                    if (dict.getValue().equals(enquiry.getUserEffective() + "")) {
-                        enquiry.setUserEffectiveStr(dict.getLabel());
+                    /**********************字典数据处理***********************/
+                    if (CollectionUtils.isNotEmpty(userEffectiveDict)) {
+                        userEffectiveDict.forEach(
+                                dict -> {
+                                    if (dict.getValue().equals(enquiry.getUserEffective() + "")) {
+                                        enquiry.setUserEffectiveStr(dict.getLabel());
+                                    }
+                                });
                     }
-                });
-            }
 
-            // 询盘中用户自定义的字段处理
-            if (StringUtils.isNotBlank(enquiry.getSpecialField())) {
-                List<EnquirySpecialFields> specialFieldsList = FastJsonUtil.parseList(enquiry.getSpecialField(), EnquirySpecialFields.class);
-                enquiry.setSpecialFieldList(specialFieldsList);
-                enquiry.setSpecialField(null);
-            }
+                    // 询盘中用户自定义的字段处理
+                    if (StringUtils.isNotBlank(enquiry.getSpecialField())) {
+                        List<EnquirySpecialFields> specialFieldsList =
+                                FastJsonUtil.parseList(
+                                        enquiry.getSpecialField(), EnquirySpecialFields.class);
+                        enquiry.setSpecialFieldList(specialFieldsList);
+                        enquiry.setSpecialField(null);
+                    }
 
-            if (StringUtils.isNotBlank(enquiry.getContext())) {
-                String context = enquiry.getContext();
-                Pattern CRLF = Pattern.compile("(\r\n|\r|\n|\n\r)");
-                Matcher m = CRLF.matcher(context);
-                if (m.find()) {
-                    context = m.replaceAll("<br/>");
-                }
-                enquiry.setContext(context);
-            }
-        });
+                    if (StringUtils.isNotBlank(enquiry.getContext())) {
+                        String context = enquiry.getContext();
+                        Pattern CRLF = Pattern.compile("(\r\n|\r|\n|\n\r)");
+                        Matcher m = CRLF.matcher(context);
+                        if (m.find()) {
+                            context = m.replaceAll("<br/>");
+                        }
+                        enquiry.setContext(context);
+                    }
+                });
     }
 
     /**
@@ -266,7 +287,9 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
     @AutoLog(value = "询盘信息存储表单-编辑")
     @Operation(summary = "询盘信息存储表单-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_enquiry:edit')")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdwebEnquiry adwebEnquiry) {
         adwebEnquiryService.updateById(adwebEnquiry);
         return Result.OK("编辑成功!");
@@ -308,7 +331,7 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
      * @param id
      * @return
      */
-    //@AutoLog(value = "询盘信息存储表单-通过id查询")
+    // @AutoLog(value = "询盘信息存储表单-通过id查询")
     @Operation(summary = "询盘信息存储表单-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AdwebEnquiry> queryById(@RequestParam(name = "id", required = true) String id) {
@@ -344,12 +367,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         return super.importExcel(request, response, AdwebEnquiry.class);
     }
 
-    /**
-     * 获取需要轮流询盘的站点code
-     */
+    /** 获取需要轮流询盘的站点code */
     @GetMapping("/getTurnInquiryCode")
     public Result<?> getTurnInquiryCode() {
-        List<DictPropertyModel> siteRes = sysAdwebApi.queryDictInfoByDictCode("turn_inquiry_site_code");
+        List<DictPropertyModel> siteRes =
+                sysAdwebApi.queryDictInfoByDictCode("turn_inquiry_site_code");
         if (CollectionUtils.isNotEmpty(siteRes)) {
             return Result.OK(siteRes);
         }
@@ -361,7 +383,8 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
      */
     @GetMapping(value = "/getEnquiryCatalog")
     public Result<?> getEnquiryCatalog() {
-        List<DictPropertyModel> userEffectiveDict = sysAdwebApi.queryDictInfoByDictCode(AdwebConstant.ENQUIRY_EFFECTIVE);
+        List<DictPropertyModel> userEffectiveDict =
+                sysAdwebApi.queryDictInfoByDictCode(AdwebConstant.ENQUIRY_EFFECTIVE);
         return Result.OK(FastJsonUtil.toJSONString(userEffectiveDict));
     }
 
@@ -372,10 +395,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
      * @return 数量信息
      */
     @GetMapping("getEnquiryNums")
-    public Result<?> getEnquiryNums(Integer siteId,
-                                    String dateType,
-                                    @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
-                                    @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
+    public Result<?> getEnquiryNums(
+            Integer siteId,
+            String dateType,
+            @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
+            @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         if (StringUtils.isNotBlank(dateType)) {
             Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
@@ -387,7 +411,10 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         if (siteId != null) {
             String siteCode = adwebSiteService.getSiteCodeById(siteId);
             LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(AdwebSite::getCode, siteCode).or().eq(AdwebSite::getParentGroupCode, siteCode);
+            queryWrapper
+                    .eq(AdwebSite::getCode, siteCode)
+                    .or()
+                    .eq(AdwebSite::getParentGroupCode, siteCode);
             queryWrapper.ne(AdwebSite::getStatus, 0);
             List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
             siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
@@ -399,14 +426,16 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
                 siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
             } else if (sysAdwebApi.isChannelAdmin()) {
                 List<String> channelGroupUids = sysAdwebApi.getChannelGroupUids();
-                List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+                List<String> codeList =
+                        siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.in(AdwebSite::getCode, codeList);
                 queryWrapper.ne(AdwebSite::getStatus, 0);
                 List<AdwebSite> sites = adwebSiteService.list(queryWrapper);
                 siteIds = sites.stream().map(AdwebSite::getId).collect(Collectors.toList());
             } else {
-                List<String> codeList = siteUserPermissionService.getSiteCodeList(loginUser.getId());
+                List<String> codeList =
+                        siteUserPermissionService.getSiteCodeList(loginUser.getId());
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.in(AdwebSite::getCode, codeList);
                 queryWrapper.ne(AdwebSite::getStatus, 0);
@@ -433,7 +462,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         }
         if (StringUtils.isNotBlank(principalUid)) {
             String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper.and(wrapper -> wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid).or().eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+            enquiryQueryWrapper.and(
+                    wrapper ->
+                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                                    .or()
+                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
         }
         enquiryQueryWrapper.ne(AdwebEnquiry::getUserEffective, 0);
         int all = (int) adwebEnquiryService.count(enquiryQueryWrapper);
@@ -452,7 +485,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         enquiryQueryWrapper1.eq(AdwebEnquiry::getReadStatus, 0);
         if (StringUtils.isNotBlank(principalUid)) {
             String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper1.and(wrapper -> wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid).or().eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+            enquiryQueryWrapper1.and(
+                    wrapper ->
+                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                                    .or()
+                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
         }
         enquiryQueryWrapper1.ne(AdwebEnquiry::getUserEffective, 0);
         int noRead = (int) adwebEnquiryService.count(enquiryQueryWrapper1);
@@ -471,7 +508,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         enquiryQueryWrapper2.eq(AdwebEnquiry::getUserEffective, 1);
         if (StringUtils.isNotBlank(principalUid)) {
             String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper2.and(wrapper -> wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid).or().eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+            enquiryQueryWrapper2.and(
+                    wrapper ->
+                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                                    .or()
+                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
         }
         enquiryQueryWrapper2.ne(AdwebEnquiry::getUserEffective, 0);
         int product = (int) adwebEnquiryService.count(enquiryQueryWrapper2);
@@ -490,7 +531,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         enquiryQueryWrapper3.eq(AdwebEnquiry::getUserEffective, 2);
         if (StringUtils.isNotBlank(principalUid)) {
             String finalPrincipalUid = principalUid;
-            enquiryQueryWrapper3.and(wrapper -> wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid).or().eq(AdwebEnquiry::getPrincipalUid, "ALL"));
+            enquiryQueryWrapper3.and(
+                    wrapper ->
+                            wrapper.eq(AdwebEnquiry::getPrincipalUid, finalPrincipalUid)
+                                    .or()
+                                    .eq(AdwebEnquiry::getPrincipalUid, "ALL"));
         }
         enquiryQueryWrapper3.ne(AdwebEnquiry::getUserEffective, 0);
         int wait = (int) adwebEnquiryService.count(enquiryQueryWrapper3);
@@ -538,9 +583,7 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         return Result.ok(text);
     }
 
-    /**
-     * 更改询盘用户有效性
-     */
+    /** 更改询盘用户有效性 */
     @PostMapping("/update/user/effective")
     public Result<?> updateUserEffective(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -552,12 +595,11 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         return Result.error("fail");
     }
 
-    /**
-     * 转发询盘
-     */
+    /** 转发询盘 */
     @AutoLog(value = "转发询盘")
     @GetMapping(value = "/setForward")
-    public Result<?> setForward(@RequestParam String ids, @RequestParam String uid, @RequestParam String code) {
+    public Result<?> setForward(
+            @RequestParam String ids, @RequestParam String uid, @RequestParam String code) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
         SysUser user = sysUserService.getById(uid);
@@ -579,28 +621,28 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
         adwebSiteQueryWrapper.eq(AdwebSite::getCode, code);
         AdwebSite adwebSite = adwebSiteService.getOne(adwebSiteQueryWrapper);
 
-        //返回跟进人名称
+        // 返回跟进人名称
         for (String id : idList) {
             AdwebEnquiry adwebEnquiry = adwebEnquiryService.getById(id);
 
             adwebEnquiryService.specialSendEmail(adwebEnquiry, adwebSite);
             if (adwebEnquiry != null && StringUtils.isNotBlank(adwebEnquiry.getRecordId())) {
-                adwebEnquiryService.returnSalesperson(code, adwebEnquiry.getRecordId(), user.getUsername());
+                adwebEnquiryService.returnSalesperson(
+                        code, adwebEnquiry.getRecordId(), user.getUsername());
             }
         }
         return Result.OK();
     }
 
-    /**
-     * 回收站列表接口
-     */
+    /** 回收站列表接口 */
     @AutoLog(value = "adweb_enquiry-分页列表查询")
     @GetMapping(value = "/queryWasteEnquiryList")
-    public Result<?> queryWasteEnquiryList(Integer siteId,
-                                           String searchText,
-                                           String enquiryType,
-                                           @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                           @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize) {
+    public Result<?> queryWasteEnquiryList(
+            Integer siteId,
+            String searchText,
+            String enquiryType,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize) {
         if (sysAdwebApi.isNotOwnSite(siteId)) {
             return Result.OK(new Page<>());
         }
@@ -622,10 +664,19 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
             siteCodeList = siteUserPermissionService.getSiteCodeListByUids(uidList);
         }
 
-        codeList = adwebSiteService.list(new LambdaQueryWrapper<AdwebSite>()
-                .eq(siteId != null, AdwebSite::getId, siteId)
-                .in(!sysAdwebApi.isAdmin(), AdwebSite::getCode, siteCodeList)
-                .ne(AdwebSite::getStatus, 0)).stream().map(AdwebSite::getCode).collect(Collectors.toList());
+        codeList =
+                adwebSiteService
+                        .list(
+                                new LambdaQueryWrapper<AdwebSite>()
+                                        .eq(siteId != null, AdwebSite::getId, siteId)
+                                        .in(
+                                                !sysAdwebApi.isAdmin(),
+                                                AdwebSite::getCode,
+                                                siteCodeList)
+                                        .ne(AdwebSite::getStatus, 0))
+                        .stream()
+                        .map(AdwebSite::getCode)
+                        .collect(Collectors.toList());
 
         String principalUid = null;
         if (sysAdwebApi.isAdwebSubVip()) {
@@ -635,7 +686,17 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
             searchText = searchText.trim();
         }
         enquiryType = "(" + enquiryType + ")";
-        IPage<EnquiryListDto> pageList = adwebEnquiryMapper.queryWasteEnquiryList(page, codeList, "", enquiryType, searchText, null, null, null, principalUid);
+        IPage<EnquiryListDto> pageList =
+                adwebEnquiryMapper.queryWasteEnquiryList(
+                        page,
+                        codeList,
+                        "",
+                        enquiryType,
+                        searchText,
+                        null,
+                        null,
+                        null,
+                        principalUid);
         if (CollectionUtils.isNotEmpty(pageList.getRecords())) {
             dealInfo(pageList.getRecords());
             return Result.OK(pageList);
@@ -679,29 +740,29 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
     }
 
     @GetMapping("/getWastedEnquiry")
-    public Result<List<EnquiryListDto>> getWastedEnquiry(EnquiryListSearchDto enquiryListSearchDto) {
-
-        List<EnquiryListDto> wasterEnquiries = adwebEnquiryMapper.getWastedEnquiry(
-                enquiryListSearchDto.getWasteEnquiryType()
-                , enquiryListSearchDto.getIp()
-                , enquiryListSearchDto.getEmail()
-                , enquiryListSearchDto.getKeyword()
-                , enquiryListSearchDto.getSearchText()
-                , enquiryListSearchDto.getType()
-                , enquiryListSearchDto.getSiteId()
-        );
+    public Result<List<EnquiryListDto>> getWastedEnquiry(
+            EnquiryListSearchDto enquiryListSearchDto) {
+
+        List<EnquiryListDto> wasterEnquiries =
+                adwebEnquiryMapper.getWastedEnquiry(
+                        enquiryListSearchDto.getWasteEnquiryType(),
+                        enquiryListSearchDto.getIp(),
+                        enquiryListSearchDto.getEmail(),
+                        enquiryListSearchDto.getKeyword(),
+                        enquiryListSearchDto.getSearchText(),
+                        enquiryListSearchDto.getType(),
+                        enquiryListSearchDto.getSiteId());
 
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
         return Result.OK(wasterEnquiries);
     }
 
-
     /**
      * 根据询盘信息创建邮件发送记录
      *
      * @param adwebEnquiry 询盘信息
-     * @param email        接收邮箱
+     * @param email 接收邮箱
      * @return
      */
     private static EnquiryEmailMessage newEmail(AdwebEnquiry adwebEnquiry, String email) {
@@ -716,5 +777,4 @@ public class AdwebEnquiryController extends JeecgController<AdwebEnquiry, IAdweb
 
         return enquiryEmailMessage;
     }
-
 }

+ 21 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebEnquiryRecordController.java

@@ -3,12 +3,16 @@ package org.jeecg.modules.adweb.enquiry.controller;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -37,13 +41,12 @@ import java.util.List;
 @RestController
 @RequestMapping("/adweb/adwebEnquiryRecord")
 @Slf4j
-public class AdwebEnquiryRecordController extends JeecgController<AdwebEnquiryRecord, IAdwebEnquiryRecordService> {
+public class AdwebEnquiryRecordController
+        extends JeecgController<AdwebEnquiryRecord, IAdwebEnquiryRecordService> {
 
-    @Autowired
-    private IAdwebEnquiryRecordService adwebEnquiryRecordService;
+    @Autowired private IAdwebEnquiryRecordService adwebEnquiryRecordService;
 
-    @Resource
-    private AdwebEnquiryRecordMapper adwebEnquiryRecordMapper;
+    @Resource private AdwebEnquiryRecordMapper adwebEnquiryRecordMapper;
 
     /**
      * 分页列表查询
@@ -57,11 +60,13 @@ public class AdwebEnquiryRecordController extends JeecgController<AdwebEnquiryRe
     @AutoLog(value = "adweb_enquiry_record-分页列表查询")
     @Operation(summary = "adweb_enquiry_record-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebEnquiryRecord adwebEnquiryRecord,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
-        QueryWrapper<AdwebEnquiryRecord> queryWrapper = QueryGenerator.initQueryWrapper(adwebEnquiryRecord, req.getParameterMap());
+    public Result<?> queryPageList(
+            AdwebEnquiryRecord adwebEnquiryRecord,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebEnquiryRecord> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebEnquiryRecord, req.getParameterMap());
         Page<AdwebEnquiryRecord> page = new Page<AdwebEnquiryRecord>(pageNo, pageSize);
         IPage<AdwebEnquiryRecord> pageList = adwebEnquiryRecordService.page(page, queryWrapper);
         return Result.OK(pageList);
@@ -74,7 +79,8 @@ public class AdwebEnquiryRecordController extends JeecgController<AdwebEnquiryRe
     @GetMapping(value = "/enquiryRecordList")
     public Result<?> enquiryRecordList(AdwebEnquiryRecord adwebEnquiryRecord) {
         QueryWrapper<AdwebEnquiryRecord> queryWrapper = new QueryWrapper<>();
-        List<AdwebEnquiryRecord> pageList = adwebEnquiryRecordMapper.getEnquiryRecord(adwebEnquiryRecord);
+        List<AdwebEnquiryRecord> pageList =
+                adwebEnquiryRecordMapper.getEnquiryRecord(adwebEnquiryRecord);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
         return Result.OK(pageList);
@@ -172,8 +178,10 @@ public class AdwebEnquiryRecordController extends JeecgController<AdwebEnquiryRe
      * @param adwebEnquiryRecord
      */
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebEnquiryRecord adwebEnquiryRecord) {
-        return super.exportXls(request, adwebEnquiryRecord, AdwebEnquiryRecord.class, "adweb_enquiry_record");
+    public ModelAndView exportXls(
+            HttpServletRequest request, AdwebEnquiryRecord adwebEnquiryRecord) {
+        return super.exportXls(
+                request, adwebEnquiryRecord, AdwebEnquiryRecord.class, "adweb_enquiry_record");
     }
 
     /**
@@ -189,5 +197,4 @@ public class AdwebEnquiryRecordController extends JeecgController<AdwebEnquiryRe
 
         return super.importExcel(request, response, AdwebEnquiryRecord.class);
     }
-
 }

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

@@ -4,12 +4,16 @@ 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
@@ -36,18 +40,18 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/adweb/enquiryPublicBlackEmail")
 @Slf4j
-public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublicBlackEmail, IAdwebPublicBlackEmailService> {
-    @Autowired
-    private IAdwebPublicBlackEmailService adwebPublicBlackEmailService;
+public class AdwebPublicBlackEmailController
+        extends JeecgController<AdwebPublicBlackEmail, IAdwebPublicBlackEmailService> {
+    @Autowired private IAdwebPublicBlackEmailService adwebPublicBlackEmailService;
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource private AdwebRedisUtil adwebRedisUtil;
 
     // Email Redis key
     private static final String EmailTenMinKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_10_MIN::";
     private static final String EmailOneDayKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_ONE_DAY::";
     private static final String BlackEmailKey = "BLACK_EMAIL_LIST";
-    private static final String NotBlackEmailWasteEnquiryKey = "NOT_BLACK_EMAIL_WASTE_ENQUIRY_MAP::";
+    private static final String NotBlackEmailWasteEnquiryKey =
+            "NOT_BLACK_EMAIL_WASTE_ENQUIRY_MAP::";
     private static final String WhiteEmailListKey = "WHITE_EMAIL_LIST";
 
     /**
@@ -62,19 +66,31 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
     @AutoLog(value = "询盘公共邮箱黑名单-分页列表查询")
     @Operation(summary = "询盘公共邮箱黑名单-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebPublicBlackEmail enquiryPublicBlackEmail,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebPublicBlackEmail enquiryPublicBlackEmail,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
         Page<AdwebPublicBlackEmail> page = new Page<>(pageNo, pageSize);
         String column = req.getParameter("column");
         String order = req.getParameter("order");
-        IPage<AdwebPublicBlackEmail> pageList = getPageList(page, enquiryPublicBlackEmail, column, order);
+        IPage<AdwebPublicBlackEmail> pageList =
+                getPageList(page, enquiryPublicBlackEmail, column, order);
         return Result.OK(pageList);
     }
 
-    public IPage<AdwebPublicBlackEmail> getPageList(Page<AdwebPublicBlackEmail> page, AdwebPublicBlackEmail enquiryPublicBlackEmail, String column, String order) {
-        IPage<AdwebPublicBlackEmail> pageList = adwebPublicBlackEmailService.pageList(page, enquiryPublicBlackEmail.getEmail(), enquiryPublicBlackEmail.getBlackOrWhite(), column, order);
+    public IPage<AdwebPublicBlackEmail> getPageList(
+            Page<AdwebPublicBlackEmail> page,
+            AdwebPublicBlackEmail enquiryPublicBlackEmail,
+            String column,
+            String order) {
+        IPage<AdwebPublicBlackEmail> pageList =
+                adwebPublicBlackEmailService.pageList(
+                        page,
+                        enquiryPublicBlackEmail.getEmail(),
+                        enquiryPublicBlackEmail.getBlackOrWhite(),
+                        column,
+                        order);
         return pageList;
     }
 
@@ -93,10 +109,17 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
             return Result.error("邮箱不能为空");
         }
 
-        //将邮箱转换为小写
+        // 将邮箱转换为小写
         enquiryPublicBlackEmail.setEmail(enquiryPublicBlackEmail.getEmail().trim().toLowerCase());
 
-        int count = (int) adwebPublicBlackEmailService.count(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getEmail, enquiryPublicBlackEmail.getEmail()));
+        int count =
+                (int)
+                        adwebPublicBlackEmailService.count(
+                                new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                        .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                        .eq(
+                                                AdwebPublicBlackEmail::getEmail,
+                                                enquiryPublicBlackEmail.getEmail()));
 
         if (count > 0) {
             return Result.error("邮箱已存在");
@@ -105,18 +128,32 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
         enquiryPublicBlackEmail.setStatus(1);
         adwebPublicBlackEmailService.save(enquiryPublicBlackEmail);
 
-        List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
+        List<AdwebPublicBlackEmail> emailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(emailList)) {
-            List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    emailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackEmailKey);
         }
-        List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
+        List<AdwebPublicBlackEmail> whiteEmailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    whiteEmailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteEmailListKey);
@@ -139,10 +176,20 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
             return Result.error("邮箱不能为空");
         }
 
-        //将邮箱转换为小写
+        // 将邮箱转换为小写
         enquiryPublicBlackEmail.setEmail(enquiryPublicBlackEmail.getEmail().trim().toLowerCase());
 
-        int count = (int) adwebPublicBlackEmailService.count(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getEmail, enquiryPublicBlackEmail.getEmail()).ne(AdwebPublicBlackEmail::getId, enquiryPublicBlackEmail.getId()));
+        int count =
+                (int)
+                        adwebPublicBlackEmailService.count(
+                                new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                        .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                        .eq(
+                                                AdwebPublicBlackEmail::getEmail,
+                                                enquiryPublicBlackEmail.getEmail())
+                                        .ne(
+                                                AdwebPublicBlackEmail::getId,
+                                                enquiryPublicBlackEmail.getId()));
 
         if (count > 0) {
             return Result.error("邮箱已存在");
@@ -150,18 +197,32 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         adwebPublicBlackEmailService.updateById(enquiryPublicBlackEmail);
 
-        List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
+        List<AdwebPublicBlackEmail> emailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(emailList)) {
-            List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    emailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackEmailKey);
         }
-        List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
+        List<AdwebPublicBlackEmail> whiteEmailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    whiteEmailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteEmailListKey);
@@ -198,18 +259,32 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
         adwebRedisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
         adwebRedisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
 
-        List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
+        List<AdwebPublicBlackEmail> emailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(emailList)) {
-            List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    emailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackEmailKey);
         }
-        List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
+        List<AdwebPublicBlackEmail> whiteEmailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    whiteEmailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteEmailListKey);
@@ -235,32 +310,54 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
 
         List<String> idList = Arrays.asList(ids.split(","));
 
-        List<AdwebPublicBlackEmail> list = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().in(AdwebPublicBlackEmail::getId, idList).ne(AdwebPublicBlackEmail::getStatus, 0));
+        List<AdwebPublicBlackEmail> list =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .in(AdwebPublicBlackEmail::getId, idList)
+                                .ne(AdwebPublicBlackEmail::getStatus, 0));
 
         if (list.isEmpty()) {
             return Result.error("未找到对应数据");
         }
 
-        boolean update = adwebPublicBlackEmailService.update(new LambdaUpdateWrapper<AdwebPublicBlackEmail>().in(AdwebPublicBlackEmail::getId, idList).set(AdwebPublicBlackEmail::getStatus, 0));
+        boolean update =
+                adwebPublicBlackEmailService.update(
+                        new LambdaUpdateWrapper<AdwebPublicBlackEmail>()
+                                .in(AdwebPublicBlackEmail::getId, idList)
+                                .set(AdwebPublicBlackEmail::getStatus, 0));
 
-        //删除redis中的数据
+        // 删除redis中的数据
         for (AdwebPublicBlackEmail enquiryPublicBlackEmail : list) {
             adwebRedisUtil.del(EmailTenMinKey + enquiryPublicBlackEmail.getEmail());
             adwebRedisUtil.del(EmailOneDayKey + enquiryPublicBlackEmail.getEmail());
             adwebRedisUtil.del(NotBlackEmailWasteEnquiryKey + enquiryPublicBlackEmail.getEmail());
         }
-        List<AdwebPublicBlackEmail> emailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
+        List<AdwebPublicBlackEmail> emailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 0));
 
         if (emailList != null) {
-            List<String> collect = emailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    emailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackEmailKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackEmailKey);
         }
-        List<AdwebPublicBlackEmail> whiteEmailList = adwebPublicBlackEmailService.list(new LambdaQueryWrapper<AdwebPublicBlackEmail>().ne(AdwebPublicBlackEmail::getStatus, 0).eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
+        List<AdwebPublicBlackEmail> whiteEmailList =
+                adwebPublicBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackEmail>()
+                                .ne(AdwebPublicBlackEmail::getStatus, 0)
+                                .eq(AdwebPublicBlackEmail::getBlackOrWhite, 1));
 
         if (whiteEmailList != null) {
-            List<String> collect = whiteEmailList.stream().map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+            List<String> collect =
+                    whiteEmailList.stream()
+                            .map(AdwebPublicBlackEmail::getEmail)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteEmailListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteEmailListKey);
@@ -299,8 +396,10 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
      * @param enquiryPublicBlackEmail
      */
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebPublicBlackEmail enquiryPublicBlackEmail) {
-        return super.exportXls(request, enquiryPublicBlackEmail, AdwebPublicBlackEmail.class, "询盘公共邮箱黑名单");
+    public ModelAndView exportXls(
+            HttpServletRequest request, AdwebPublicBlackEmail enquiryPublicBlackEmail) {
+        return super.exportXls(
+                request, enquiryPublicBlackEmail, AdwebPublicBlackEmail.class, "询盘公共邮箱黑名单");
     }
 
     /**
@@ -314,5 +413,4 @@ public class AdwebPublicBlackEmailController extends JeecgController<AdwebPublic
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebPublicBlackEmail.class);
     }
-
 }

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

@@ -4,12 +4,16 @@ 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
@@ -34,13 +38,12 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/blackip/adwebBlackIp")
 @Slf4j
-public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBlackIp, IAdwebPublicBlackIpService> {
+public class AdwebPublicBlackIpController
+        extends JeecgController<AdwebPublicBlackIp, IAdwebPublicBlackIpService> {
 
-    @Resource
-    private IAdwebPublicBlackIpService adwebBlackIpService;
+    @Resource private IAdwebPublicBlackIpService adwebBlackIpService;
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource 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::";
@@ -60,14 +63,17 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
     @AutoLog(value = "IP黑名单-分页列表查询")
     @Operation(summary = "IP黑名单-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebPublicBlackIp adwebBlackIp,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebPublicBlackIp adwebBlackIp,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
         Page<AdwebPublicBlackIp> page = new Page<AdwebPublicBlackIp>(pageNo, pageSize);
         String column = req.getParameter("column");
         String order = req.getParameter("order");
-        IPage<AdwebPublicBlackIp> pageList = adwebBlackIpService.pageList(page, adwebBlackIp.getIp(), adwebBlackIp.getBlackOrWhite(), column, order);
+        IPage<AdwebPublicBlackIp> pageList =
+                adwebBlackIpService.pageList(
+                        page, adwebBlackIp.getIp(), adwebBlackIp.getBlackOrWhite(), column, order);
         return Result.OK(pageList);
     }
 
@@ -89,7 +95,12 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
             return Result.error("IP长度不能超过15");
         }
 
-        int count = (int) adwebBlackIpService.count(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp()).eq(AdwebPublicBlackIp::getStatus, 1));
+        int count =
+                (int)
+                        adwebBlackIpService.count(
+                                new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                        .eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp())
+                                        .eq(AdwebPublicBlackIp::getStatus, 1));
 
         if (count > 0) {
             return Result.error("该IP已存在");
@@ -97,19 +108,33 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
 
         adwebBlackIp.setStatus(1);
         adwebBlackIpService.save(adwebBlackIp);
-        List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
+        List<AdwebPublicBlackIp> blackIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    blackIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackIpKey);
         }
 
-        List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
+        List<AdwebPublicBlackIp> whiteIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    whiteIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteIpListKey);
@@ -135,7 +160,13 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
             return Result.error("IP长度不能超过15");
         }
 
-        int count = (int) adwebBlackIpService.count(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp()).eq(AdwebPublicBlackIp::getStatus, 1).ne(AdwebPublicBlackIp::getId, adwebBlackIp.getId()));
+        int count =
+                (int)
+                        adwebBlackIpService.count(
+                                new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                        .eq(AdwebPublicBlackIp::getIp, adwebBlackIp.getIp())
+                                        .eq(AdwebPublicBlackIp::getStatus, 1)
+                                        .ne(AdwebPublicBlackIp::getId, adwebBlackIp.getId()));
 
         if (count > 0) {
             return Result.error("该IP已存在");
@@ -143,19 +174,33 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
 
         adwebBlackIpService.updateById(adwebBlackIp);
 
-        List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
+        List<AdwebPublicBlackIp> blackIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    blackIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackIpKey);
         }
 
-        List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
+        List<AdwebPublicBlackIp> whiteIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    whiteIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteIpListKey);
@@ -178,7 +223,11 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
             return Result.error("ID不能为空");
         }
 
-        List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getId, id).eq(AdwebPublicBlackIp::getStatus, 1));
+        List<AdwebPublicBlackIp> list =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getId, id)
+                                .eq(AdwebPublicBlackIp::getStatus, 1));
 
         if (list.size() == 0) {
             return Result.error("该IP不存在");
@@ -193,19 +242,33 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
         adwebRedisUtil.del(IpOneDayKey + adwebBlackIp.getIp());
         adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
 
-        List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
+        List<AdwebPublicBlackIp> blackIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    blackIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackIpKey);
         }
 
-        List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
+        List<AdwebPublicBlackIp> whiteIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    whiteIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteIpListKey);
@@ -230,13 +293,20 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
         }
         List<String> idList = Arrays.asList(ids.split(","));
 
-        List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).in(AdwebPublicBlackIp::getId, idList));
+        List<AdwebPublicBlackIp> list =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .in(AdwebPublicBlackIp::getId, idList));
 
         if (list.size() == 0) {
             return Result.error("该IP不存在");
         }
 
-        adwebBlackIpService.update(new LambdaUpdateWrapper<AdwebPublicBlackIp>().in(AdwebPublicBlackIp::getId, idList).set(AdwebPublicBlackIp::getStatus, 0));
+        adwebBlackIpService.update(
+                new LambdaUpdateWrapper<AdwebPublicBlackIp>()
+                        .in(AdwebPublicBlackIp::getId, idList)
+                        .set(AdwebPublicBlackIp::getStatus, 0));
 
         for (AdwebPublicBlackIp adwebBlackIp : list) {
             adwebRedisUtil.del(IpTenMinKey + adwebBlackIp.getIp());
@@ -244,25 +314,38 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
             adwebRedisUtil.del(NotBlackIpWasteEnquiryKey + adwebBlackIp.getIp());
         }
 
-        List<AdwebPublicBlackIp> blackIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
+        List<AdwebPublicBlackIp> blackIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 0));
 
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            List<String> collect = blackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    blackIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(BlackIpKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(BlackIpKey);
         }
 
-        List<AdwebPublicBlackIp> whiteIpList = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getStatus, 1).eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
+        List<AdwebPublicBlackIp> whiteIpList =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getStatus, 1)
+                                .eq(AdwebPublicBlackIp::getBlackOrWhite, 1));
 
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            List<String> collect = whiteIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+            List<String> collect =
+                    whiteIpList.stream()
+                            .map(AdwebPublicBlackIp::getIp)
+                            .collect(Collectors.toList());
             adwebRedisUtil.set(WhiteIpListKey, collect, 60 * 60 * 24);
         } else {
             adwebRedisUtil.del(WhiteIpListKey);
         }
 
-
         return Result.OK("批量删除成功!");
     }
 
@@ -281,7 +364,11 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
             return Result.error("ID不能为空");
         }
 
-        List<AdwebPublicBlackIp> list = adwebBlackIpService.list(new LambdaQueryWrapper<AdwebPublicBlackIp>().eq(AdwebPublicBlackIp::getId, id).eq(AdwebPublicBlackIp::getStatus, 1));
+        List<AdwebPublicBlackIp> list =
+                adwebBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebPublicBlackIp>()
+                                .eq(AdwebPublicBlackIp::getId, id)
+                                .eq(AdwebPublicBlackIp::getStatus, 1));
 
         if (list.size() == 0) {
             return Result.error("该IP不存在");
@@ -312,5 +399,4 @@ public class AdwebPublicBlackIpController extends JeecgController<AdwebPublicBla
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebPublicBlackIp.class);
     }
-
 }

+ 119 - 35
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/controller/AdwebPublicEnquriyRuleController.java

@@ -4,17 +4,22 @@ import cn.hutool.core.io.IoUtil;
 import cn.hutool.poi.excel.ExcelReader;
 import cn.hutool.poi.excel.ExcelUtil;
 import cn.hutool.poi.excel.ExcelWriter;
+
 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.ServletOutputStream;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -44,9 +49,9 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/adweb/adwebEnquiryRule")
 @Slf4j
-public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPublicEnquiryRule, IAdwebPublicEnquiryRuleService> {
-    @Resource
-    private IAdwebPublicEnquiryRuleService adwebEnquiryRuleService;
+public class AdwebPublicEnquriyRuleController
+        extends JeecgController<AdwebPublicEnquiryRule, IAdwebPublicEnquiryRuleService> {
+    @Resource private IAdwebPublicEnquiryRuleService adwebEnquiryRuleService;
 
     /**
      * 分页列表查询
@@ -60,10 +65,11 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
     @AutoLog(value = "用于询盘规则过滤-分页列表查询")
     @Operation(summary = "用于询盘规则过滤-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebPublicEnquiryRule adwebEnquiryRule,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebPublicEnquiryRule adwebEnquiryRule,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
         Page<AdwebPublicEnquiryRule> page = new Page<AdwebPublicEnquiryRule>(pageNo, pageSize);
         String column = req.getParameter("column");
         String order = req.getParameter("order");
@@ -71,8 +77,20 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
         return Result.OK(pageList);
     }
 
-    public IPage<AdwebPublicEnquiryRule> getPageList(Page<AdwebPublicEnquiryRule> page, AdwebPublicEnquiryRule adwebEnquiryRule, String column, String order) {
-        IPage<AdwebPublicEnquiryRule> pageList = adwebEnquiryRuleService.pageList(page, adwebEnquiryRule.getWord(), adwebEnquiryRule.getBlackOrWhiteList(), adwebEnquiryRule.getIsEnable(), adwebEnquiryRule.getUseStatus(), column, order);
+    public IPage<AdwebPublicEnquiryRule> getPageList(
+            Page<AdwebPublicEnquiryRule> page,
+            AdwebPublicEnquiryRule adwebEnquiryRule,
+            String column,
+            String order) {
+        IPage<AdwebPublicEnquiryRule> pageList =
+                adwebEnquiryRuleService.pageList(
+                        page,
+                        adwebEnquiryRule.getWord(),
+                        adwebEnquiryRule.getBlackOrWhiteList(),
+                        adwebEnquiryRule.getIsEnable(),
+                        adwebEnquiryRule.getUseStatus(),
+                        column,
+                        order);
         return pageList;
     }
 
@@ -90,9 +108,20 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
             return Result.error("规则关键词不能为空");
         }
 
-        adwebEnquiryRule.setWord(adwebEnquiryRule.getWord().replaceAll(" {2,}", " ").trim().toLowerCase());
-
-        int count = (int) adwebEnquiryRuleService.count(new LambdaQueryWrapper<AdwebPublicEnquiryRule>().eq(AdwebPublicEnquiryRule::getWord, adwebEnquiryRule.getWord()).ne(AdwebPublicEnquiryRule::getStatus, 0).eq(AdwebPublicEnquiryRule::getUseStatus, adwebEnquiryRule.getUseStatus()));
+        adwebEnquiryRule.setWord(
+                adwebEnquiryRule.getWord().replaceAll(" {2,}", " ").trim().toLowerCase());
+
+        int count =
+                (int)
+                        adwebEnquiryRuleService.count(
+                                new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
+                                        .eq(
+                                                AdwebPublicEnquiryRule::getWord,
+                                                adwebEnquiryRule.getWord())
+                                        .ne(AdwebPublicEnquiryRule::getStatus, 0)
+                                        .eq(
+                                                AdwebPublicEnquiryRule::getUseStatus,
+                                                adwebEnquiryRule.getUseStatus()));
         if (count > 0) {
             return Result.error("规则关键词已存在");
         }
@@ -116,9 +145,21 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
             return Result.error("规则关键词不能为空");
         }
 
-        adwebEnquiryRule.setWord(adwebEnquiryRule.getWord().replaceAll(" {2,}", " ").trim().toLowerCase());
-
-        int count = (int) adwebEnquiryRuleService.count(new LambdaQueryWrapper<AdwebPublicEnquiryRule>().eq(AdwebPublicEnquiryRule::getWord, adwebEnquiryRule.getWord()).ne(AdwebPublicEnquiryRule::getStatus, 0).ne(AdwebPublicEnquiryRule::getId, adwebEnquiryRule.getId()).eq(AdwebPublicEnquiryRule::getUseStatus, adwebEnquiryRule.getUseStatus()));
+        adwebEnquiryRule.setWord(
+                adwebEnquiryRule.getWord().replaceAll(" {2,}", " ").trim().toLowerCase());
+
+        int count =
+                (int)
+                        adwebEnquiryRuleService.count(
+                                new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
+                                        .eq(
+                                                AdwebPublicEnquiryRule::getWord,
+                                                adwebEnquiryRule.getWord())
+                                        .ne(AdwebPublicEnquiryRule::getStatus, 0)
+                                        .ne(AdwebPublicEnquiryRule::getId, adwebEnquiryRule.getId())
+                                        .eq(
+                                                AdwebPublicEnquiryRule::getUseStatus,
+                                                adwebEnquiryRule.getUseStatus()));
 
         if (count > 0) {
             return Result.error("规则关键词已存在");
@@ -142,7 +183,11 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
         if (id == null) {
             return Result.error("参数不识别!");
         }
-        boolean update = adwebEnquiryRuleService.update(new LambdaUpdateWrapper<AdwebPublicEnquiryRule>().set(AdwebPublicEnquiryRule::getStatus, 0).eq(AdwebPublicEnquiryRule::getId, id));
+        boolean update =
+                adwebEnquiryRuleService.update(
+                        new LambdaUpdateWrapper<AdwebPublicEnquiryRule>()
+                                .set(AdwebPublicEnquiryRule::getStatus, 0)
+                                .eq(AdwebPublicEnquiryRule::getId, id));
 
         return update ? Result.OK("删除成功!") : Result.error("删除失败!");
     }
@@ -161,7 +206,11 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
             return Result.error("参数不识别!");
         }
         List<String> idList = Arrays.asList(ids.split(","));
-        boolean update = adwebEnquiryRuleService.update(new LambdaUpdateWrapper<AdwebPublicEnquiryRule>().set(AdwebPublicEnquiryRule::getStatus, 0).in(AdwebPublicEnquiryRule::getId, idList));
+        boolean update =
+                adwebEnquiryRuleService.update(
+                        new LambdaUpdateWrapper<AdwebPublicEnquiryRule>()
+                                .set(AdwebPublicEnquiryRule::getStatus, 0)
+                                .in(AdwebPublicEnquiryRule::getId, idList));
         return update ? Result.OK("批量删除成功!") : Result.error("批量删除失败!");
     }
 
@@ -193,14 +242,19 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
      * @param adwebEnquiryRule
      */
     @RequestMapping(value = "/exportXls")
-    public void exportXls(HttpServletRequest request, AdwebPublicEnquiryRule adwebEnquiryRule, HttpServletResponse response) {
+    public void exportXls(
+            HttpServletRequest request,
+            AdwebPublicEnquiryRule adwebEnquiryRule,
+            HttpServletResponse response) {
         Page<AdwebPublicEnquiryRule> page = new Page<AdwebPublicEnquiryRule>(1, -1);
         String column = request.getParameter("column");
         String order = request.getParameter("order");
-        List<AdwebPublicEnquiryRule> list = getPageList(page, adwebEnquiryRule, column, order).getRecords();
-//		QueryWrapper<AdwebPublicEnquiryRule> queryWrapper = QueryGenerator.initQueryWrapper(adwebEnquiryRule, request.getParameterMap());
-//		queryWrapper.ne("status", 0);
-//		List<AdwebPublicEnquiryRule> list = adwebEnquiryRuleService.list(queryWrapper);
+        List<AdwebPublicEnquiryRule> list =
+                getPageList(page, adwebEnquiryRule, column, order).getRecords();
+        //		QueryWrapper<AdwebPublicEnquiryRule> queryWrapper =
+        // QueryGenerator.initQueryWrapper(adwebEnquiryRule, request.getParameterMap());
+        //		queryWrapper.ne("status", 0);
+        //		List<AdwebPublicEnquiryRule> list = adwebEnquiryRuleService.list(queryWrapper);
         // 通过工具类创建writer,默认创建xls格式
         ExcelWriter writer = ExcelUtil.getWriter(true);
 
@@ -223,7 +277,11 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
             sheet.setDefaultColumnWidth(12);
             sheet.setDefaultRowHeightInPoints(20);
             // 设置请求头属性
-            response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
+            response.setHeader(
+                    "Content-Disposition",
+                    "attachment;filename="
+                            + new String(
+                                    (fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
             out = response.getOutputStream();
             writer.write(list, true);
             AdaptiveWidthUtils.setSizeColumn(sheet, 3);
@@ -247,11 +305,11 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(@RequestParam("file") MultipartFile file) {
         try {
-            //字节输入流
+            // 字节输入流
             InputStream inputStream = file.getInputStream();
-            //通过输入流创建ExcelReader 对象
+            // 通过输入流创建ExcelReader 对象
             ExcelReader reader = ExcelUtil.getReader(inputStream);
-            //这个同上导入
+            // 这个同上导入
             reader.addHeaderAlias("关键词", "word");
             reader.addHeaderAlias("关键词翻译", "translateWord");
             reader.addHeaderAlias("黑白名单", "blackOrWhiteList");
@@ -265,30 +323,56 @@ public class AdwebPublicEnquriyRuleController extends JeecgController<AdwebPubli
             }
 
             for (AdwebPublicEnquiryRule adwebEnquiryRule : rulesList) {
-                LambdaUpdateWrapper<AdwebPublicEnquiryRule> updateWrapper = new LambdaUpdateWrapper();
+                LambdaUpdateWrapper<AdwebPublicEnquiryRule> updateWrapper =
+                        new LambdaUpdateWrapper();
                 updateWrapper.eq(AdwebPublicEnquiryRule::getWord, adwebEnquiryRule.getWord());
                 updateWrapper.ne(AdwebPublicEnquiryRule::getStatus, 0);
                 updateWrapper.eq(AdwebPublicEnquiryRule::getUseStatus, 0);
-                updateWrapper.set(AdwebPublicEnquiryRule::getTranslateWord, adwebEnquiryRule.getTranslateWord());
+                updateWrapper.set(
+                        AdwebPublicEnquiryRule::getTranslateWord,
+                        adwebEnquiryRule.getTranslateWord());
                 adwebEnquiryRuleService.update(updateWrapper);
             }
 
-            List<String> wordList = rulesList.stream().map(AdwebPublicEnquiryRule::getWord).collect(Collectors.toList());
-            List<AdwebPublicEnquiryRule> adwebEnquiryRules = adwebEnquiryRuleService.list(new LambdaQueryWrapper<AdwebPublicEnquiryRule>().in(AdwebPublicEnquiryRule::getWord, wordList).ne(AdwebPublicEnquiryRule::getStatus, 0).select(AdwebPublicEnquiryRule::getWord).eq(AdwebPublicEnquiryRule::getUseStatus, 0));
-            List<String> adwebEnquiryRuleList = adwebEnquiryRules.stream().map(AdwebPublicEnquiryRule::getWord).collect(Collectors.toList());
-
-            List<AdwebPublicEnquiryRule> collect = rulesList.stream().filter(adwebEnquiryRule -> !adwebEnquiryRuleList.contains(adwebEnquiryRule.getWord())).collect(Collectors.toList());
+            List<String> wordList =
+                    rulesList.stream()
+                            .map(AdwebPublicEnquiryRule::getWord)
+                            .collect(Collectors.toList());
+            List<AdwebPublicEnquiryRule> adwebEnquiryRules =
+                    adwebEnquiryRuleService.list(
+                            new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
+                                    .in(AdwebPublicEnquiryRule::getWord, wordList)
+                                    .ne(AdwebPublicEnquiryRule::getStatus, 0)
+                                    .select(AdwebPublicEnquiryRule::getWord)
+                                    .eq(AdwebPublicEnquiryRule::getUseStatus, 0));
+            List<String> adwebEnquiryRuleList =
+                    adwebEnquiryRules.stream()
+                            .map(AdwebPublicEnquiryRule::getWord)
+                            .collect(Collectors.toList());
+
+            List<AdwebPublicEnquiryRule> collect =
+                    rulesList.stream()
+                            .filter(
+                                    adwebEnquiryRule ->
+                                            !adwebEnquiryRuleList.contains(
+                                                    adwebEnquiryRule.getWord()))
+                            .collect(Collectors.toList());
 
             collect.forEach(adwebEnquiryRule -> adwebEnquiryRule.setStatus(1));
 
             if (CollectionUtils.isNotEmpty(collect)) {
                 adwebEnquiryRuleService.saveBatch(collect);
             }
-            return Result.OK("文件导入成功!数据行数:" + rulesList.size() + ",重复数据行数:" + adwebEnquiryRules.size() + ",导入数据行数:" + collect.size());
+            return Result.OK(
+                    "文件导入成功!数据行数:"
+                            + rulesList.size()
+                            + ",重复数据行数:"
+                            + adwebEnquiryRules.size()
+                            + ",导入数据行数:"
+                            + collect.size());
         } catch (IOException e) {
             e.printStackTrace();
             return Result.error("文件导入失败!失败信息:" + e.getMessage());
         }
     }
-
 }

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

@@ -4,12 +4,16 @@ 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -44,35 +48,30 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/adweb/enquirySiteBlackEmail")
 @Slf4j
-public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlackEmail, IAdwebSiteBlackEmailService> {
-
-    @Resource
-    private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
+public class AdwebSiteBlackEmailController
+        extends JeecgController<AdwebSiteBlackEmail, IAdwebSiteBlackEmailService> {
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource private IAdwebSiteBlackEmailService enquirySiteBlackEmailService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private AdwebRedisUtil adwebRedisUtil;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
-    @Resource
-    private IAdwebPublicBlackEmailService enquiryPublicBlackEmailService;
-    @Resource
-    private IAdwebEnquiryBlacklistService adwebEnquiryBlacklistService;
+    @Resource private SysAdwebApi sysAdwebApi;
 
+    @Resource private IAdwebSiteService adwebSiteService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
+    @Resource private IAdwebPublicBlackEmailService enquiryPublicBlackEmailService;
+    @Resource private IAdwebEnquiryBlacklistService adwebEnquiryBlacklistService;
 
     private static final String SiteBlackEmailKey = "SITE_BLACK_EMAIL_LIST";
     private static final String SiteWhiteEmailListKey = "SITE_WHITE_EMAIL_LIST";
     private static final String SiteEmailTenMinKey = "JUDGE_WASTE_SITE_ENQUIRY_EMAIL_BY_10_MIN::";
     private static final String SiteEmailOneDayKey = "JUDGE_WASTE_SITE_ENQUIRY_EMAIL_BY_ONE_DAY::";
-    private static final String NotBlackEmailWasteSiteEnquiryKey = "NOT_BLACK_EMAIL_WASTE_SITE_ENQUIRY_MAP::";
+    private static final String NotBlackEmailWasteSiteEnquiryKey =
+            "NOT_BLACK_EMAIL_WASTE_SITE_ENQUIRY_MAP::";
     //	private static final String EmailTenMinKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_10_MIN::";
-//	private static final String EmailOneDayKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_ONE_DAY::";
-//	private static final String NotBlackEmailWasteEnquiryKey = "NOT_BLACK_EMAIL_WASTE_ENQUIRY_MAP::";
+    //	private static final String EmailOneDayKey = "JUDGE_WASTE_ENQUIRY_EMAIL_BY_ONE_DAY::";
+    //	private static final String NotBlackEmailWasteEnquiryKey =
+    // "NOT_BLACK_EMAIL_WASTE_ENQUIRY_MAP::";
     private static final String BlackEmailKey = "BLACK_EMAIL_LIST";
 
     /**
@@ -87,10 +86,11 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
     @AutoLog(value = "adweb_site_black_email-分页列表查询")
     @Operation(summary = "adweb_site_black_email-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebSiteBlackEmail enquirySiteBlackEmail,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebSiteBlackEmail enquirySiteBlackEmail,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
         Page<AdwebSiteBlackEmail> page = new Page<AdwebSiteBlackEmail>(pageNo, pageSize);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         List<String> codeList = null;
@@ -112,24 +112,33 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             String siteCode = adwebSiteService.getSiteCodeById(enquirySiteBlackEmail.getSiteId());
             if (StringUtils.isNotBlank(siteCode)) {
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.eq(AdwebSite::getId, enquirySiteBlackEmail.getSiteId()).or().eq(AdwebSite::getParentGroupCode, siteCode);
+                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());
+                codeList =
+                        adwebSiteService.list(queryWrapper).stream()
+                                .map(AdwebSite::getCode)
+                                .collect(Collectors.toList());
             }
         } else {
             codeList = siteCodeList;
         }
         String column = req.getParameter("column");
         String order = req.getParameter("order");
-        IPage<AdwebSiteBlackEmail> pageList = enquirySiteBlackEmailService.pageList(page, enquirySiteBlackEmail, codeList, column, order);
+        IPage<AdwebSiteBlackEmail> pageList =
+                enquirySiteBlackEmailService.pageList(
+                        page, enquirySiteBlackEmail, codeList, column, order);
         List<AdwebSiteBlackEmail> record = pageList.getRecords();
 
         if (CollectionUtils.isNotEmpty(record)) {
             for (AdwebSiteBlackEmail enquirySiteBlackEmail1 : record) {
                 if (enquirySiteBlackEmail1.getType().equals("0")) {
                     if (enquirySiteBlackEmail1.getWasteGeneralEnquiryNum() != null) {
-                        enquirySiteBlackEmail1.setWasteEnquiryNum(enquirySiteBlackEmail1.getWasteGeneralEnquiryNum());
+                        enquirySiteBlackEmail1.setWasteEnquiryNum(
+                                enquirySiteBlackEmail1.getWasteGeneralEnquiryNum());
                     }
                 }
             }
@@ -153,22 +162,38 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             return Result.error("邮箱不能为空");
         }
 
-        //将邮箱转换为小写
+        // 将邮箱转换为小写
         enquirySiteBlackEmail.setEmail(enquirySiteBlackEmail.getEmail().trim().toLowerCase());
 
-        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()));
+        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("邮箱已存在");
         }
 
-        //判断站点询盘黑名单是否存在添加进来的黑名单
-        LambdaQueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new LambdaQueryWrapper<>();
-        adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getSiteId, enquirySiteBlackEmail.getSiteId());
+        // 判断站点询盘黑名单是否存在添加进来的黑名单
+        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);
+        adwebEnquiryBlacklistQueryWrapper.eq(
+                AdwebEnquiryBlacklist::getEmail, enquirySiteBlackEmail.getEmail());
+        List<AdwebEnquiryBlacklist> enquiryBlacklists =
+                adwebEnquiryBlacklistService.list(adwebEnquiryBlacklistQueryWrapper);
 
         if (CollectionUtils.isNotEmpty(enquiryBlacklists)) {
             return Result.error("在拒收的邮箱黑名单中已存在!");
@@ -178,20 +203,28 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
         enquirySiteBlackEmail.setCreateTime(new Date());
         enquirySiteBlackEmailService.save(enquirySiteBlackEmail);
 
-        Map<String, List<String>> enquirySiteBlackEmailListMap = enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(enquirySiteBlackEmail.getSiteId());
+        Map<String, List<String>> enquirySiteBlackEmailListMap =
+                enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(
+                        enquirySiteBlackEmail.getSiteId());
         List<String> emailList = enquirySiteBlackEmailListMap.get("black");
         List<String> whiteEmailList = enquirySiteBlackEmailListMap.get("white");
 
-        //处理对应站点的黑名单
+        // 处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    emailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
-        //处理对应站点的白名单
+        // 处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    whiteEmailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
@@ -214,32 +247,60 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             return Result.error("邮箱不能为空");
         }
 
-        //将邮箱转换为小写
+        // 将邮箱转换为小写
         enquirySiteBlackEmail.setEmail(enquirySiteBlackEmail.getEmail().trim().toLowerCase());
 
-        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()));
+        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("邮箱已存在");
         }
 
-        //判断站点询盘黑名单是否存在添加进来的黑名单
-        LambdaQueryWrapper<AdwebEnquiryBlacklist> adwebEnquiryBlacklistQueryWrapper = new LambdaQueryWrapper<>();
-        adwebEnquiryBlacklistQueryWrapper.eq(AdwebEnquiryBlacklist::getSiteId, enquirySiteBlackEmail.getSiteId());
+        // 判断站点询盘黑名单是否存在添加进来的黑名单
+        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);
+        adwebEnquiryBlacklistQueryWrapper.eq(
+                AdwebEnquiryBlacklist::getEmail, enquirySiteBlackEmail.getEmail());
+        List<AdwebEnquiryBlacklist> enquiryBlacklists =
+                adwebEnquiryBlacklistService.list(adwebEnquiryBlacklistQueryWrapper);
 
         if (CollectionUtils.isNotEmpty(enquiryBlacklists)) {
             return Result.error("在拒收的邮箱黑名单中已存在!");
         }
 
-        AdwebSiteBlackEmail oldAdwebSiteBlackEmail = enquirySiteBlackEmailService.getById(enquirySiteBlackEmail.getId());
+        AdwebSiteBlackEmail oldAdwebSiteBlackEmail =
+                enquirySiteBlackEmailService.getById(enquirySiteBlackEmail.getId());
 
-        //判断公共询盘缓存的是否包含历史的黑名单数据
+        // 判断公共询盘缓存的是否包含历史的黑名单数据
         if (!oldAdwebSiteBlackEmail.getEmail().equals(enquirySiteBlackEmail.getEmail())) {
-            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<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,53 +324,72 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
         enquirySiteBlackEmail.setUpdateTime(new Date());
         enquirySiteBlackEmailService.updateById(enquirySiteBlackEmail);
 
-        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
         siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
-        siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
-        List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
+        siteAllEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
+        List<AdwebSiteBlackEmail> allEmailList =
+                enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
         if (CollectionUtils.isEmpty(allEmailList)) {
             log.info("未获取到对应站点的黑白名单数据");
         }
 
-        Map<String, List<String>> enquirySiteBlackEmailListMap = enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(enquirySiteBlackEmail.getSiteId());
+        Map<String, List<String>> enquirySiteBlackEmailListMap =
+                enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(
+                        enquirySiteBlackEmail.getSiteId());
         List<String> emailList = enquirySiteBlackEmailListMap.get("black");
         List<String> whiteEmailList = enquirySiteBlackEmailListMap.get("white");
 
-        //处理对应站点的黑名单
+        // 处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    emailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
-        //处理对应站点的白名单
+        // 处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    whiteEmailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
-        //处理站点改变的数据缓存
+        // 处理站点改变的数据缓存
         if (!oldAdwebSiteBlackEmail.getSiteId().equals(enquirySiteBlackEmail.getSiteId())) {
-            Map<String, List<String>> oldAdwebSiteBlackEmailListMap = enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(oldAdwebSiteBlackEmail.getSiteId());
+            Map<String, List<String>> oldAdwebSiteBlackEmailListMap =
+                    enquirySiteBlackEmailService.getSiteBlackEmailListBySiteId(
+                            oldAdwebSiteBlackEmail.getSiteId());
             List<String> oldEmailList = oldAdwebSiteBlackEmailListMap.get("black");
             List<String> oldWhiteEmailList = oldAdwebSiteBlackEmailListMap.get("white");
-            //处理对应站点的黑名单
+            // 处理对应站点的黑名单
             if (CollectionUtils.isNotEmpty(oldEmailList)) {
-                adwebRedisUtil.set(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(
+                        SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId(),
+                        oldEmailList,
+                        60 * 60 * 24);
             } else {
                 adwebRedisUtil.del(SiteBlackEmailKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
             }
 
-            //处理对应站点的白名单
+            // 处理对应站点的白名单
             if (CollectionUtils.isNotEmpty(oldWhiteEmailList)) {
-                adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId(), oldWhiteEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(
+                        SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId(),
+                        oldWhiteEmailList,
+                        60 * 60 * 24);
             } else {
-                adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
+                adwebRedisUtil.del(
+                        SiteWhiteEmailListKey + "::" + oldAdwebSiteBlackEmail.getSiteId());
             }
         }
 
-
         return Result.OK("编辑成功!");
     }
 
@@ -333,9 +413,16 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
             return Result.error("未找到对应数据");
         }
 
-        //判断公共询盘缓存的是否包含历史的黑名单数据
-        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<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);
 
@@ -362,14 +449,29 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
         enquirySiteBlackEmail.setUpdateTime(new Date());
         enquirySiteBlackEmailService.updateById(enquirySiteBlackEmail);
 
-        adwebRedisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-        adwebRedisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-        adwebRedisUtil.del(NotBlackEmailWasteSiteEnquiryKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-
-        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
+        adwebRedisUtil.del(
+                SiteEmailTenMinKey
+                        + enquirySiteBlackEmail.getSiteId()
+                        + "::"
+                        + enquirySiteBlackEmail.getEmail());
+        adwebRedisUtil.del(
+                SiteEmailOneDayKey
+                        + enquirySiteBlackEmail.getSiteId()
+                        + "::"
+                        + enquirySiteBlackEmail.getEmail());
+        adwebRedisUtil.del(
+                NotBlackEmailWasteSiteEnquiryKey
+                        + enquirySiteBlackEmail.getSiteId()
+                        + "::"
+                        + enquirySiteBlackEmail.getEmail());
+
+        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
         siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
-        siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
-        List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
+        siteAllEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getSiteId, enquirySiteBlackEmail.getSiteId());
+        List<AdwebSiteBlackEmail> allEmailList =
+                enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
         if (CollectionUtils.isEmpty(allEmailList)) {
             log.info("未获取到对应站点的黑白名单数据");
         }
@@ -393,16 +495,22 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                 }
             }
         }
-        //处理对应站点的黑名单
+        // 处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            adwebRedisUtil.set(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    emailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackEmailKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
 
-        //处理对应站点的白名单
+        // 处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId(),
+                    whiteEmailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + enquirySiteBlackEmail.getSiteId());
         }
@@ -428,21 +536,36 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
 
         List<String> idList = Arrays.asList(ids.split(","));
 
-        List<AdwebSiteBlackEmail> list = enquirySiteBlackEmailService.list(new LambdaQueryWrapper<AdwebSiteBlackEmail>().in(AdwebSiteBlackEmail::getId, idList).ne(AdwebSiteBlackEmail::getStatus, 0));
+        List<AdwebSiteBlackEmail> list =
+                enquirySiteBlackEmailService.list(
+                        new LambdaQueryWrapper<AdwebSiteBlackEmail>()
+                                .in(AdwebSiteBlackEmail::getId, idList)
+                                .ne(AdwebSiteBlackEmail::getStatus, 0));
 
         if (list.isEmpty()) {
             return Result.error("未找到对应数据");
         }
 
-        boolean update = enquirySiteBlackEmailService.update(new LambdaUpdateWrapper<AdwebSiteBlackEmail>().in(AdwebSiteBlackEmail::getId, idList).set(AdwebSiteBlackEmail::getStatus, 0));
+        boolean update =
+                enquirySiteBlackEmailService.update(
+                        new LambdaUpdateWrapper<AdwebSiteBlackEmail>()
+                                .in(AdwebSiteBlackEmail::getId, idList)
+                                .set(AdwebSiteBlackEmail::getStatus, 0));
 
         HashSet<Integer> siteList = new HashSet<>();
-        //删除redis中的数据
+        // 删除redis中的数据
         for (AdwebSiteBlackEmail enquirySiteBlackEmail : list) {
 
-            //判断公共询盘缓存的是否包含历史的黑名单数据
-            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<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);
 
@@ -466,18 +589,31 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                 adwebRedisUtil.set(BlackEmailKey, pubicBlackEmailList, 60 * 60 * 24);
             }
 
-            adwebRedisUtil.del(SiteEmailTenMinKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-            adwebRedisUtil.del(SiteEmailOneDayKey + enquirySiteBlackEmail.getSiteId() + "::" + enquirySiteBlackEmail.getEmail());
-            adwebRedisUtil.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());
         }
 
-
         for (Integer siteId : siteList) {
-            LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
+            LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper =
+                    new LambdaQueryWrapper<>();
             siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
             siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, siteId);
-            List<AdwebSiteBlackEmail> allEmailList = enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
+            List<AdwebSiteBlackEmail> allEmailList =
+                    enquirySiteBlackEmailService.list(siteAllEmailQueryWrapper);
             if (CollectionUtils.isEmpty(allEmailList)) {
                 log.info("未获取到对应站点的黑白名单数据");
             }
@@ -501,16 +637,17 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
                     }
                 }
             }
-            //处理对应站点的黑名单
+            // 处理对应站点的黑名单
             if (CollectionUtils.isNotEmpty(emailList)) {
                 adwebRedisUtil.set(SiteBlackEmailKey + "::" + siteId, emailList, 60 * 60 * 24);
             } else {
                 adwebRedisUtil.del(SiteBlackEmailKey + "::" + siteId);
             }
 
-            //处理对应站点的白名单
+            // 处理对应站点的白名单
             if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-                adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + siteId, whiteEmailList, 60 * 60 * 24);
+                adwebRedisUtil.set(
+                        SiteWhiteEmailListKey + "::" + siteId, whiteEmailList, 60 * 60 * 24);
             } else {
                 adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + siteId);
             }
@@ -542,8 +679,13 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
      * @param enquirySiteBlackEmail
      */
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebSiteBlackEmail enquirySiteBlackEmail) {
-        return super.exportXls(request, enquirySiteBlackEmail, AdwebSiteBlackEmail.class, "adweb_site_black_email");
+    public ModelAndView exportXls(
+            HttpServletRequest request, AdwebSiteBlackEmail enquirySiteBlackEmail) {
+        return super.exportXls(
+                request,
+                enquirySiteBlackEmail,
+                AdwebSiteBlackEmail.class,
+                "adweb_site_black_email");
     }
 
     /**
@@ -557,5 +699,4 @@ public class AdwebSiteBlackEmailController extends JeecgController<AdwebSiteBlac
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebSiteBlackEmail.class);
     }
-
 }

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

@@ -4,12 +4,16 @@ 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;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -40,23 +44,20 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/adweb/adwebSiteBlackIp")
 @Slf4j
-public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp, IAdwebSiteBlackIpService> {
-    @Resource
-    private IAdwebSiteBlackIpService adwebSiteBlackIpService;
-    @Resource
-    private IAdwebSiteService adwebSiteService;
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+public class AdwebSiteBlackIpController
+        extends JeecgController<AdwebSiteBlackIp, IAdwebSiteBlackIpService> {
+    @Resource private IAdwebSiteBlackIpService adwebSiteBlackIpService;
+    @Resource private IAdwebSiteService adwebSiteService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource 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::";
-    private static final String NotSiteBlackIpWasteEnquiryKey = "NOT_SITE_BLACK_IP_WASTE_ENQUIRY_MAP::";
+    private static final String NotSiteBlackIpWasteEnquiryKey =
+            "NOT_SITE_BLACK_IP_WASTE_ENQUIRY_MAP::";
     private static final String SiteBlackIpKey = "SITE_BLACK_IP_LIST";
     private static final String SiteWhiteIpListKey = "SITE_WHITE_IP_LIST";
 
@@ -72,10 +73,11 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
     @AutoLog(value = "adweb_site_black_ip-分页列表查询")
     @Operation(summary = "adweb_site_black_ip-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebSiteBlackIp adwebSiteBlackIp,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebSiteBlackIp adwebSiteBlackIp,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
 
         Page<AdwebSiteBlackIp> page = new Page<AdwebSiteBlackIp>(pageNo, pageSize);
 
@@ -99,10 +101,16 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             String siteCode = adwebSiteService.getSiteCodeById(adwebSiteBlackIp.getSiteId());
             if (StringUtils.isNotBlank(siteCode)) {
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.eq(AdwebSite::getId, adwebSiteBlackIp.getSiteId()).or().eq(AdwebSite::getParentGroupCode, siteCode);
+                queryWrapper
+                        .eq(AdwebSite::getId, adwebSiteBlackIp.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());
+                codeList =
+                        adwebSiteService.list(queryWrapper).stream()
+                                .map(AdwebSite::getCode)
+                                .collect(Collectors.toList());
             }
         } else {
             codeList = siteCodeList;
@@ -110,7 +118,8 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
 
         String column = req.getParameter("column");
         String order = req.getParameter("order");
-        IPage<AdwebSiteBlackIp> pageList = adwebSiteBlackIpService.pageList(page, adwebSiteBlackIp, codeList, column, order);
+        IPage<AdwebSiteBlackIp> pageList =
+                adwebSiteBlackIpService.pageList(page, adwebSiteBlackIp, codeList, column, order);
         List<AdwebSiteBlackIp> record = pageList.getRecords();
 
         return Result.OK(pageList);
@@ -128,8 +137,15 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
     public Result<?> add(@RequestBody AdwebSiteBlackIp adwebSiteBlackIp) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-        int count = (int) adwebSiteBlackIpService.count(new LambdaQueryWrapper<AdwebSiteBlackIp>().ne(AdwebSiteBlackIp::getStatus, 0).eq(AdwebSiteBlackIp::getIp, adwebSiteBlackIp.getIp())
-                .eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
+        int count =
+                (int)
+                        adwebSiteBlackIpService.count(
+                                new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                        .ne(AdwebSiteBlackIp::getStatus, 0)
+                                        .eq(AdwebSiteBlackIp::getIp, adwebSiteBlackIp.getIp())
+                                        .eq(
+                                                AdwebSiteBlackIp::getSiteId,
+                                                adwebSiteBlackIp.getSiteId()));
 
         if (count > 0) {
             return Result.error("当前站点已存在此ip");
@@ -138,7 +154,11 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         adwebSiteBlackIp.setCreateTime(new Date());
         adwebSiteBlackIpService.save(adwebSiteBlackIp);
 
-        List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getStatus, 1).eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
+        List<AdwebSiteBlackIp> siteBlackIpList =
+                adwebSiteBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                .eq(AdwebSiteBlackIp::getStatus, 1)
+                                .eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
@@ -146,16 +166,30 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             return Result.OK("编辑成功!");
         }
 
-        List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> blackIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    blackIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
-        List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> whiteIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    whiteIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
@@ -174,8 +208,16 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
     public Result<?> edit(@RequestBody AdwebSiteBlackIp adwebSiteBlackIp) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
-        int count = (int) adwebSiteBlackIpService.count(new LambdaQueryWrapper<AdwebSiteBlackIp>().ne(AdwebSiteBlackIp::getStatus, 0).eq(AdwebSiteBlackIp::getIp, adwebSiteBlackIp.getIp())
-                .eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()).ne(AdwebSiteBlackIp::getId, adwebSiteBlackIp.getId()));
+        int count =
+                (int)
+                        adwebSiteBlackIpService.count(
+                                new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                        .ne(AdwebSiteBlackIp::getStatus, 0)
+                                        .eq(AdwebSiteBlackIp::getIp, adwebSiteBlackIp.getIp())
+                                        .eq(
+                                                AdwebSiteBlackIp::getSiteId,
+                                                adwebSiteBlackIp.getSiteId())
+                                        .ne(AdwebSiteBlackIp::getId, adwebSiteBlackIp.getId()));
 
         if (count > 0) {
             return Result.error("当前站点已存在此ip");
@@ -187,7 +229,11 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         }
         adwebSiteBlackIpService.updateById(adwebSiteBlackIp);
 
-        List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getStatus, 1).eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
+        List<AdwebSiteBlackIp> siteBlackIpList =
+                adwebSiteBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                .eq(AdwebSiteBlackIp::getStatus, 1)
+                                .eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
@@ -195,16 +241,30 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             return Result.OK("编辑成功!");
         }
 
-        List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> blackIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    blackIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
-        List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> whiteIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    whiteIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
@@ -227,7 +287,11 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             return Result.error("id不能为空");
         }
 
-        List<AdwebSiteBlackIp> list = adwebSiteBlackIpService.list(new LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getId, id).eq(AdwebSiteBlackIp::getStatus, 1));
+        List<AdwebSiteBlackIp> list =
+                adwebSiteBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                .eq(AdwebSiteBlackIp::getId, id)
+                                .eq(AdwebSiteBlackIp::getStatus, 1));
 
         if (list.size() == 0) {
             return Result.error("该IP不存在");
@@ -237,11 +301,21 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         adwebSiteBlackIp.setStatus(0);
         adwebSiteBlackIpService.updateById(adwebSiteBlackIp);
 
-        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 LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getStatus, 1).eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
+        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 LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                .eq(AdwebSiteBlackIp::getStatus, 1)
+                                .eq(AdwebSiteBlackIp::getSiteId, adwebSiteBlackIp.getSiteId()));
 
         if (CollectionUtils.isEmpty(siteBlackIpList)) {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
@@ -249,16 +323,30 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
             return Result.OK("编辑成功!");
         }
 
-        List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> blackIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(blackIpList)) {
-            adwebRedisUtil.set(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(), blackIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    blackIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackIpKey + "::" + adwebSiteBlackIp.getSiteId());
         }
 
-        List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+        List<String> whiteIpList =
+                siteBlackIpList.stream()
+                        .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1))
+                        .map(AdwebSiteBlackIp::getIp)
+                        .collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(whiteIpList)) {
-            adwebRedisUtil.set(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(), whiteIpList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId(),
+                    whiteIpList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteIpListKey + "::" + adwebSiteBlackIp.getSiteId());
         }
@@ -283,27 +371,48 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
         }
         List<String> idList = Arrays.asList(ids.split(","));
 
-        List<AdwebSiteBlackIp> list = adwebSiteBlackIpService.list(new LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getStatus, 1).in(AdwebSiteBlackIp::getId, idList));
+        List<AdwebSiteBlackIp> list =
+                adwebSiteBlackIpService.list(
+                        new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                .eq(AdwebSiteBlackIp::getStatus, 1)
+                                .in(AdwebSiteBlackIp::getId, idList));
 
         if (list.size() == 0) {
             return Result.error("该IP不存在");
         }
 
-        LambdaUpdateWrapper<AdwebSiteBlackIp> adwebSiteBlackIpUpdateWrapper = new LambdaUpdateWrapper<>();
+        LambdaUpdateWrapper<AdwebSiteBlackIp> adwebSiteBlackIpUpdateWrapper =
+                new LambdaUpdateWrapper<>();
         adwebSiteBlackIpUpdateWrapper.in(AdwebSiteBlackIp::getId, idList);
         adwebSiteBlackIpUpdateWrapper.set(AdwebSiteBlackIp::getStatus, 0);
         adwebSiteBlackIpService.update(adwebSiteBlackIpUpdateWrapper);
 
         HashSet<Integer> siteIdHashSet = new HashSet<Integer>();
         for (AdwebSiteBlackIp adwebSiteBlackIp : list) {
-            adwebRedisUtil.del(SiteIpTenMinKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-            adwebRedisUtil.del(SiteIpOneDayKey + adwebSiteBlackIp.getSiteId() + "::" + adwebSiteBlackIp.getIp());
-            adwebRedisUtil.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());
         }
 
         for (Integer siteId : siteIdHashSet) {
-            List<AdwebSiteBlackIp> siteBlackIpList = adwebSiteBlackIpService.list(new LambdaQueryWrapper<AdwebSiteBlackIp>().eq(AdwebSiteBlackIp::getStatus, 1).eq(AdwebSiteBlackIp::getSiteId, siteId));
+            List<AdwebSiteBlackIp> siteBlackIpList =
+                    adwebSiteBlackIpService.list(
+                            new LambdaQueryWrapper<AdwebSiteBlackIp>()
+                                    .eq(AdwebSiteBlackIp::getStatus, 1)
+                                    .eq(AdwebSiteBlackIp::getSiteId, siteId));
 
             if (CollectionUtils.isEmpty(siteBlackIpList)) {
                 adwebRedisUtil.del(SiteBlackIpKey + "::" + siteId);
@@ -311,14 +420,22 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
                 return Result.OK("编辑成功!");
             }
 
-            List<String> blackIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+            List<String> blackIpList =
+                    siteBlackIpList.stream()
+                            .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0))
+                            .map(AdwebSiteBlackIp::getIp)
+                            .collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(blackIpList)) {
                 adwebRedisUtil.set(SiteBlackIpKey + "::" + siteId, blackIpList, 60 * 60 * 24);
             } else {
                 adwebRedisUtil.del(SiteBlackIpKey + "::" + siteId);
             }
 
-            List<String> whiteIpList = siteBlackIpList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+            List<String> whiteIpList =
+                    siteBlackIpList.stream()
+                            .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1))
+                            .map(AdwebSiteBlackIp::getIp)
+                            .collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(whiteIpList)) {
                 adwebRedisUtil.set(SiteWhiteIpListKey + "::" + siteId, whiteIpList, 60 * 60 * 24);
             } else {
@@ -354,7 +471,8 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
      */
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AdwebSiteBlackIp adwebSiteBlackIp) {
-        return super.exportXls(request, adwebSiteBlackIp, AdwebSiteBlackIp.class, "adweb_site_black_ip");
+        return super.exportXls(
+                request, adwebSiteBlackIp, AdwebSiteBlackIp.class, "adweb_site_black_ip");
     }
 
     /**
@@ -368,5 +486,4 @@ public class AdwebSiteBlackIpController extends JeecgController<AdwebSiteBlackIp
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebSiteBlackIp.class);
     }
-
 }

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

@@ -3,12 +3,16 @@ package org.jeecg.modules.adweb.enquiry.controller;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -41,17 +45,13 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/adweb/adwebEnquirySiteRule")
 @Slf4j
-public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnquiryRule, IAdwebSiteEnquiryRuleService> {
-    @Resource
-    private IAdwebSiteEnquiryRuleService adwebSiteEnquiryRuleService;
-    @Resource
-    private AdwebSiteEnquiryRuleMapper adwebEnquirySiteRuleMapper;
-    @Resource
-    private IAdwebSiteService adwebSiteService;
-    @Resource
-    private SysAdwebApi sysAdwebApi;
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+public class AdwebSiteEnquiryRuleController
+        extends JeecgController<AdwebSiteEnquiryRule, IAdwebSiteEnquiryRuleService> {
+    @Resource private IAdwebSiteEnquiryRuleService adwebSiteEnquiryRuleService;
+    @Resource private AdwebSiteEnquiryRuleMapper adwebEnquirySiteRuleMapper;
+    @Resource private IAdwebSiteService adwebSiteService;
+    @Resource private SysAdwebApi sysAdwebApi;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
     /**
      * 分页列表查询
@@ -65,10 +65,11 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
     @AutoLog(value = "adweb_site_enquiry_rule-分页列表查询")
     @Operation(summary = "adweb_site_enquiry_rule-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebSiteEnquiryRule adwebEnquirySiteRule,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
+    public Result<?> queryPageList(
+            AdwebSiteEnquiryRule adwebEnquirySiteRule,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         List<String> codeList = null;
         List<String> uidList = null;
@@ -89,10 +90,16 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
             String siteCode = adwebSiteService.getSiteCodeById(adwebEnquirySiteRule.getSiteId());
             if (StringUtils.isNotBlank(siteCode)) {
                 LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
-                queryWrapper.eq(AdwebSite::getId, adwebEnquirySiteRule.getSiteId()).or().eq(AdwebSite::getParentGroupCode, siteCode);
+                queryWrapper
+                        .eq(AdwebSite::getId, adwebEnquirySiteRule.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());
+                codeList =
+                        adwebSiteService.list(queryWrapper).stream()
+                                .map(AdwebSite::getCode)
+                                .collect(Collectors.toList());
             }
         } else {
             codeList = siteCodeList;
@@ -104,9 +111,13 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
         return Result.OK(pageList);
     }
 
-    public IPage<AdwebSiteEnquiryRule> getPageList(Page<AdwebSiteEnquiryRule> page, AdwebSiteEnquiryRule adwebEnquirySiteRule, List<String> codeList) {
+    public IPage<AdwebSiteEnquiryRule> getPageList(
+            Page<AdwebSiteEnquiryRule> page,
+            AdwebSiteEnquiryRule adwebEnquirySiteRule,
+            List<String> codeList) {
 
-        IPage<AdwebSiteEnquiryRule> pageList = adwebEnquirySiteRuleMapper.pageList(page, adwebEnquirySiteRule, codeList);
+        IPage<AdwebSiteEnquiryRule> pageList =
+                adwebEnquirySiteRuleMapper.pageList(page, adwebEnquirySiteRule, codeList);
         return pageList;
     }
 
@@ -162,7 +173,7 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
         AdwebSiteEnquiryRule adwebEnquirySiteRule = adwebSiteEnquiryRuleService.getById(id);
         adwebEnquirySiteRule.setStatus(0);
         adwebSiteEnquiryRuleService.updateById(adwebEnquirySiteRule);
-//		adwebSiteEnquiryRuleService.removeById(id);
+        //		adwebSiteEnquiryRuleService.removeById(id);
         return Result.OK("删除成功!");
     }
 
@@ -184,7 +195,7 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
             adwebEnquirySiteRule.setStatus(0);
             adwebSiteEnquiryRuleService.updateById(adwebEnquirySiteRule);
         }
-//		this.adwebSiteEnquiryRuleService.removeByIds(Arrays.asList(ids.split(",")));
+        //		this.adwebSiteEnquiryRuleService.removeByIds(Arrays.asList(ids.split(",")));
         return Result.OK("批量删除成功!");
     }
 
@@ -212,8 +223,13 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
      * @param adwebEnquirySiteRule
      */
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AdwebSiteEnquiryRule adwebEnquirySiteRule) {
-        return super.exportXls(request, adwebEnquirySiteRule, AdwebSiteEnquiryRule.class, "adweb_site_enquiry_rule");
+    public ModelAndView exportXls(
+            HttpServletRequest request, AdwebSiteEnquiryRule adwebEnquirySiteRule) {
+        return super.exportXls(
+                request,
+                adwebEnquirySiteRule,
+                AdwebSiteEnquiryRule.class,
+                "adweb_site_enquiry_rule");
     }
 
     /**
@@ -227,5 +243,4 @@ public class AdwebSiteEnquiryRuleController extends JeecgController<AdwebSiteEnq
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebSiteEnquiryRule.class);
     }
-
 }

+ 9 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/EnquiryDTO.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.enquiry.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+
 import lombok.Data;
 
 import java.util.Date;
@@ -10,7 +11,7 @@ import java.util.Date;
  */
 @Data
 public class EnquiryDTO {
-    //站点code,关联站点表
+    // 站点code,关联站点表
     private String siteCode;
     private String fromEmail;
     private Object forms;
@@ -18,12 +19,16 @@ public class EnquiryDTO {
     private String fromIp;
     private String siteHost;
 
-    @JsonFormat(shape = JsonFormat.Shape.STRING, timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(
+            shape = JsonFormat.Shape.STRING,
+            timezone = "GMT+8",
+            pattern = "yyyy-MM-dd HH:mm:ss")
     private Date recordCtime;
+
     private String recordId;
-    //访问人id
+    // 访问人id
     private String visitId;
-    //站点id
+    // 站点id
     private Integer siteId;
     private String siteToken;
     private String formName;

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/IndependentEnquiryDto.java

@@ -20,6 +20,7 @@ public class IndependentEnquiryDto {
     private String path;
     private String country;
     private String whatsApp;
+
     public String dealFromPage() {
         return this.pageTitle + " " + this.pageHref;
     }

+ 1 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EffectiveEnquiryParamDto.java

@@ -2,9 +2,7 @@ package org.jeecg.modules.adweb.enquiry.dto.param;
 
 import lombok.Data;
 
-/**
- * 有效询盘参数
- */
+/** 有效询盘参数 */
 @Data
 public class EffectiveEnquiryParamDto {
     private String id;

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquiryListSearchDto.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.enquiry.dto.param;
 
 import lombok.Data;
+
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;

+ 7 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/param/EnquirySearchDto.java

@@ -4,19 +4,19 @@ import lombok.Data;
 
 @Data
 public class EnquirySearchDto {
-    //询盘模块类型
+    // 询盘模块类型
     private String modular;
-    //阶段
+    // 阶段
     private String phase;
-    //跟进状态
+    // 跟进状态
     private String trackStatus;
-    //跟进人id
+    // 跟进人id
     private Long tracker;
-    //是否系统有效
+    // 是否系统有效
     private Integer isSysEffective;
-    //获取回复状态
+    // 获取回复状态
     private String replayStatus;
-    //获取用户有效性
+    // 获取用户有效性
     private Integer userEffective;
     private String siteCode;
     private Integer siteId;
@@ -24,7 +24,6 @@ public class EnquirySearchDto {
     private String ctimeBegin;
     private String ctimeEnd;
 
-
     private String whatsApp;
 
     private String wasteEnquiryType;

+ 24 - 31
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquiryListDto.java

@@ -11,28 +11,29 @@ import java.util.List;
 public class EnquiryListDto {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
-    //询盘编号(系统生成)
+
+    // 询盘编号(系统生成)
     private String no;
     private String noOut;
-    //询盘创建时间(发起时间)
+    // 询盘创建时间(发起时间)
     private Date recordCtime;
     // 询盘入库时间
     private Date ctime;
-    //询盘业务模块
+    // 询盘业务模块
     private String modular;
-    //询盘联系人
+    // 询盘联系人
     private String contact;
-    //询盘内容
+    // 询盘内容
     private String context;
-    //询盘发送邮箱
+    // 询盘发送邮箱
     private String fromEmail;
-    //国家/地区
+    // 国家/地区
     private String country;
-    //发送询盘的站点
+    // 发送询盘的站点
     private String siteHost;
-    //用户有效性
+    // 用户有效性
     private Integer userEffective;
-    //回复状态
+    // 回复状态
     private String replayStatus;
     private Integer status;
     private Integer siteId;
@@ -41,29 +42,27 @@ public class EnquiryListDto {
     private List<String> job;
     // 简历路径
     private String path;
-    /**
-     * 后台处理字段
-     */
 
-    //来源页面
+    /** 后台处理字段 */
+
+    // 来源页面
     private String fromPage;
-    //电话
+
+    // 电话
     private String phone;
-    //表单公司
+    // 表单公司
     private String formCompany;
-    //用户有效性
+    // 用户有效性
     private String userEffectiveStr;
-    //敏感词
+    // 敏感词
     private String sensitiveMessage;
-    //系统有效性
+    // 系统有效性
     private Integer sysEffective;
     private String siteName;
     private String transContent;
     private String cartItems;
 
-    /**
-     * 用于前端默认展示第一行数据
-     */
+    /** 用于前端默认展示第一行数据 */
     private Integer dataIndex;
 
     private String whatsApp;
@@ -84,21 +83,15 @@ public class EnquiryListDto {
 
     private String principalUid;
 
-    /**
-     * 特殊字段名
-     */
+    /** 特殊字段名 */
     private String specialField;
 
     private List<EnquirySpecialFields> specialFieldList;
 
-    /**
-     * 疑似垃圾询盘理由
-     */
+    /** 疑似垃圾询盘理由 */
     private String effectiveReason;
 
-    /**
-     * 询盘来源插件名称
-     */
+    /** 询盘来源插件名称 */
     private String pluginName;
 
     private String wasteEnquiryType;

+ 2 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/dto/result/EnquirySpecialFields.java

@@ -5,13 +5,9 @@ import lombok.Data;
 @Data
 public class EnquirySpecialFields {
 
-    /**
-     * 特殊字段名
-     */
+    /** 特殊字段名 */
     private String field;
 
-    /**
-     * 特殊字段值
-     */
+    /** 特殊字段值 */
     private String value;
 }

+ 12 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/AdwebOpenApiService.java

@@ -22,13 +22,11 @@ import java.util.List;
 @Service
 @Slf4j
 public class AdwebOpenApiService {
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
     @Value("${server.servlet.context-path}")
     public String contextPath;
 
-
     /**
      * @param siteCode
      * @return
@@ -50,7 +48,7 @@ public class AdwebOpenApiService {
         List<AdwebSite> adwebSites = selectBySiteCode(siteCode);
         if (CollectionUtils.isNotEmpty(adwebSites)) {
             AdwebSite adwebSite = adwebSites.get(0);
-            if(adwebSite.getDayEnquiryCount()!= null){
+            if (adwebSite.getDayEnquiryCount() != null) {
                 code = adwebSite.getDayEnquiryCount() + 1;
             } else {
                 code = 1;
@@ -61,14 +59,14 @@ public class AdwebOpenApiService {
         return String.format("%04d", code);
     }
 
-//    public String loadOutNoByUser(String uid) {
-//        if (StringUtils.isEmpty(uid)) {
-//            return "000";
-//        }
-//        Date todayZero = DateUtil.formatDate(new Date(), DateUtil.DATE_PATTERN);
-//        QueryWrapper<AdwebEnquiry> queryWrapper = new QueryWrapper<>();
-//        queryWrapper.eq("uid", uid).gt("ctime", todayZero);
-//        int count = (int) adwebEnquiryService.count(queryWrapper);
-//        return String.format("%03d", count + 1);
-//    }
+    //    public String loadOutNoByUser(String uid) {
+    //        if (StringUtils.isEmpty(uid)) {
+    //            return "000";
+    //        }
+    //        Date todayZero = DateUtil.formatDate(new Date(), DateUtil.DATE_PATTERN);
+    //        QueryWrapper<AdwebEnquiry> queryWrapper = new QueryWrapper<>();
+    //        queryWrapper.eq("uid", uid).gt("ctime", todayZero);
+    //        int count = (int) adwebEnquiryService.count(queryWrapper);
+    //        return String.format("%03d", count + 1);
+    //    }
 }

+ 4 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/EnquiryRedisService.java

@@ -11,8 +11,10 @@ public class EnquiryRedisService {
 
     @Value(value = "${spring.data.redis.host}")
     private String JEDIS_IP;
+
     @Value(value = "${spring.data.redis.port}")
     private int JEDIS_PORT;
+
     @Value(value = "${spring.data.redis.password:#{null}}")
     private String JEDIS_PASSWORD;
 
@@ -21,10 +23,10 @@ public class EnquiryRedisService {
     }
 
     @Async
-    public void startEnquiryEmailMessageListener(String channel, IEnquiryEmailMessageService enquiryEmailMessageService) {
+    public void startEnquiryEmailMessageListener(
+            String channel, IEnquiryEmailMessageService enquiryEmailMessageService) {
         EnquiryEmailSenderListener listener = new EnquiryEmailSenderListener();
         listener.setEnquiryEmailMessageService(enquiryEmailMessageService);
         JedisUtil.subscribeMsg(listener, channel);
     }
-
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryBlacklistService.java

@@ -7,7 +7,7 @@ import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryBlacklist;
 /**
  * @Description: adweb_enquiry_blacklist
  * @Author: jeecg-boot
- * @Date:   2022-08-05
+ * @Date: 2022-08-05
  * @Version: V1.0
  */
 public interface IAdwebEnquiryBlacklistService extends IService<AdwebEnquiryBlacklist> {

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryFormService.java

@@ -6,7 +6,7 @@ import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryForm;
 /**
  * @Description: adweb_enquiry_form
  * @Author: jeecg-boot
- * @Date:   2022-08-03
+ * @Date: 2022-08-03
  * @Version: V1.0
  */
 public interface IAdwebEnquiryFormService extends IService<AdwebEnquiryForm> {

+ 3 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebEnquiryService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.enquiry.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.enquiry.dto.EnquiryDTO;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
@@ -18,14 +19,10 @@ public interface IAdwebEnquiryService extends IService<AdwebEnquiry> {
 
     void addEnquiry(EnquiryDTO enquiryDTO, String plugin, List<AdwebSite> adwebSites);
 
-    /**
-     * 返回用户名称
-     */
+    /** 返回用户名称 */
     void returnSalesperson(String siteCode, String inquiryId, String sales);
 
-    /**
-     * 根据地区更新询盘跟进人
-     */
+    /** 根据地区更新询盘跟进人 */
     void updatePrincipalUidByRegion(Integer siteId);
 
     /**

+ 10 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicBlackEmailService.java

@@ -8,14 +8,18 @@ import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackEmail;
 /**
  * @Description: 询盘公共邮箱黑名单
  * @Author: jeecg-boot
- * @Date:   2024-10-17
+ * @Date: 2024-10-17
  * @Version: V1.0
- *
  */
 public interface IAdwebPublicBlackEmailService extends IService<AdwebPublicBlackEmail> {
-    IPage<AdwebPublicBlackEmail> pageList(Page<AdwebPublicBlackEmail> page, String email, Integer blackOrWhite,String column,String order);
+    IPage<AdwebPublicBlackEmail> pageList(
+            Page<AdwebPublicBlackEmail> page,
+            String email,
+            Integer blackOrWhite,
+            String column,
+            String order);
 
-//    void updateBlackListByEmailAndIp();
-//
-//    void updateEnquiryBlackList();
+    //    void updateBlackListByEmailAndIp();
+    //
+    //    void updateEnquiryBlackList();
 }

+ 8 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicBlackIpService.java

@@ -3,14 +3,20 @@ package org.jeecg.modules.adweb.enquiry.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackIp;
 
 /**
  * @Description: IP黑名单
  * @Author: jeecg-boot
- * @Date:   2023-02-20
+ * @Date: 2023-02-20
  * @Version: V1.0
  */
 public interface IAdwebPublicBlackIpService extends IService<AdwebPublicBlackIp> {
-    IPage<AdwebPublicBlackIp> pageList(Page<AdwebPublicBlackIp> page, String ip, Integer blackOrWhite,String column,String order);
+    IPage<AdwebPublicBlackIp> pageList(
+            Page<AdwebPublicBlackIp> page,
+            String ip,
+            Integer blackOrWhite,
+            String column,
+            String order);
 }

+ 10 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebPublicEnquiryRuleService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.adweb.enquiry.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicEnquiryRule;
 
 import java.util.List;
@@ -10,7 +11,7 @@ import java.util.List;
 /**
  * @Description: 用于询盘规则过滤
  * @Author: jeecg-boot
- * @Date:   2024-10-17
+ * @Date: 2024-10-17
  * @Version: V1.0
  */
 public interface IAdwebPublicEnquiryRuleService extends IService<AdwebPublicEnquiryRule> {
@@ -19,6 +20,12 @@ public interface IAdwebPublicEnquiryRuleService extends IService<AdwebPublicEnqu
 
     List<String> getEnquiryBlackList();
 
-    IPage<AdwebPublicEnquiryRule> pageList(Page<AdwebPublicEnquiryRule> page, String word, Integer blackOrWhiteList, Integer isEnable, Integer useStatus, String column, String order);
-
+    IPage<AdwebPublicEnquiryRule> pageList(
+            Page<AdwebPublicEnquiryRule> page,
+            String word,
+            Integer blackOrWhiteList,
+            Integer isEnable,
+            Integer useStatus,
+            String column,
+            String order);
 }

+ 10 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IAdwebSiteBlackEmailService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.adweb.enquiry.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteBlackEmail;
 
@@ -16,14 +17,11 @@ import java.util.Map;
  * @Version: V1.0
  */
 public interface IAdwebSiteBlackEmailService extends IService<AdwebSiteBlackEmail> {
-    /**
-     * 根据站点id获取并存取黑名单数据到redis
-     */
+
+    /** 根据站点id获取并存取黑名单数据到redis */
     void saveRedisSiteBlackEmailBySiteId(Integer siteId, Integer blackOrWhite);
 
-    /**
-     * 根据站点id获取对应所有的黑白名单数据
-     */
+    /** 根据站点id获取对应所有的黑白名单数据 */
     Map<String, List<String>> getSiteBlackEmailListBySiteId(Integer siteId);
 
     /**
@@ -34,7 +32,12 @@ public interface IAdwebSiteBlackEmailService extends IService<AdwebSiteBlackEmai
      * @param codeList
      * @return
      */
-    IPage<AdwebSiteBlackEmail> pageList(Page<AdwebSiteBlackEmail> page, AdwebSiteBlackEmail enquirySiteBlackEmail, List<String> codeList, String column, String order);
+    IPage<AdwebSiteBlackEmail> pageList(
+            Page<AdwebSiteBlackEmail> page,
+            AdwebSiteBlackEmail enquirySiteBlackEmail,
+            List<String> codeList,
+            String column,
+            String order);
 
     /**
      * 更改为垃圾询盘处理邮箱黑名单

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

@@ -11,23 +11,30 @@ import java.util.List;
 /**
  * @Description: adweb_site_black_ip
  * @Author: jeecg-boot
- * @Date:   2023-08-31
+ * @Date: 2023-08-31
  * @Version: V1.0
  */
 public interface IAdwebSiteBlackIpService extends IService<AdwebSiteBlackIp> {
 
     /**
      * 更改为垃圾询盘处理ip黑名单
+     *
      * @param effectiveEnquiryParamDto
      */
     void addBlackIpByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto);
 
     /**
      * 获取分页列表数据
+     *
      * @param page
      * @param adwebSiteBlackIp
      * @param codeList
      * @return
      */
-    IPage<AdwebSiteBlackIp> pageList(Page<AdwebSiteBlackIp> page, AdwebSiteBlackIp adwebSiteBlackIp, List<String> codeList, String column, String order);
+    IPage<AdwebSiteBlackIp> pageList(
+            Page<AdwebSiteBlackIp> page,
+            AdwebSiteBlackIp adwebSiteBlackIp,
+            List<String> codeList,
+            String column,
+            String order);
 }

+ 12 - 13
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/IEnquiryEmailMessageService.java

@@ -10,28 +10,27 @@ import java.util.List;
 /**
  * @Description: adweb_enquiry_email_message
  * @Author: jeecg-boot
- * @Date:   2023-02-01
+ * @Date: 2023-02-01
  * @Version: V1.0
  */
 public interface IEnquiryEmailMessageService extends IService<EnquiryEmailMessage> {
 
-     void sendEnquiryEmail(Long enquiryId);
+    void sendEnquiryEmail(Long enquiryId);
 
-     void sendEmailByMessage(EnquiryEmailMessage message);
+    void sendEmailByMessage(EnquiryEmailMessage message);
 
-     /**
-      * 获取待发送询盘
-      * 1、首次发送失败的
-      * 2、超过timeout分钟未处理的
-      *
-      * @param timeout 留给首次实时处理的时间,单位分钟,超过这个时间则认为首次邮件发送失败,应该由定时器处理
-      * @param num     获取邮件数量
-      * @return 邮件列表
-      */
-     List<EnquiryEmailMessage> getWaitSendEmail(int timeout, int num);
+    /**
+     * 获取待发送询盘 1、首次发送失败的 2、超过timeout分钟未处理的
+     *
+     * @param timeout 留给首次实时处理的时间,单位分钟,超过这个时间则认为首次邮件发送失败,应该由定时器处理
+     * @param num 获取邮件数量
+     * @return 邮件列表
+     */
+    List<EnquiryEmailMessage> getWaitSendEmail(int timeout, int num);
 
     /**
      * 添加并发送询盘邮件
+     *
      * @param adwebEnquiry
      */
     Result<?> addAndEnquiryEmailMsg(AdwebEnquiry adwebEnquiry, String uid);

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/ISubUserEmailService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.enquiry.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.enquiry.entity.SubUserEmail;
 
 /**

+ 12 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryBlacklistServiceImpl.java

@@ -1,11 +1,11 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xkcoding.http.util.StringUtil;
+
 import jakarta.annotation.Resource;
-import kotlin.jvm.internal.Lambda;
+
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiry;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryBlacklist;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryBlacklistMapper;
@@ -18,14 +18,15 @@ import java.util.List;
 /**
  * @Description: adweb_enquiry_blacklist
  * @Author: jeecg-boot
- * @Date:   2022-08-05
+ * @Date: 2022-08-05
  * @Version: V1.0
  */
 @Service
-public class AdwebEnquiryBlacklistServiceImpl extends ServiceImpl<AdwebEnquiryBlacklistMapper, AdwebEnquiryBlacklist> implements IAdwebEnquiryBlacklistService {
+public class AdwebEnquiryBlacklistServiceImpl
+        extends ServiceImpl<AdwebEnquiryBlacklistMapper, AdwebEnquiryBlacklist>
+        implements IAdwebEnquiryBlacklistService {
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
     /**
      * 判断询盘是否是处于黑名单中,根据手机号和邮箱进行匹配,两个都不为空且都相同才算匹配上
@@ -44,7 +45,11 @@ public class AdwebEnquiryBlacklistServiceImpl extends ServiceImpl<AdwebEnquiryBl
         LambdaQueryWrapper<AdwebEnquiryBlacklist> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(AdwebEnquiryBlacklist::getSiteId, siteIds);
         queryWrapper.eq(AdwebEnquiryBlacklist::getStatus, 1);
-        queryWrapper.and(wrapper -> wrapper.eq(AdwebEnquiryBlacklist::getEmail, email).or().eq(AdwebEnquiryBlacklist::getPhone, phone));
+        queryWrapper.and(
+                wrapper ->
+                        wrapper.eq(AdwebEnquiryBlacklist::getEmail, email)
+                                .or()
+                                .eq(AdwebEnquiryBlacklist::getPhone, phone));
         return this.count(queryWrapper) > 0;
     }
 }

+ 4 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryFormServiceImpl.java

@@ -10,11 +10,13 @@ import org.springframework.stereotype.Service;
 /**
  * @Description: adweb_enquiry_form
  * @Author: jeecg-boot
- * @Date:   2022-08-03
+ * @Date: 2022-08-03
  * @Version: V1.0
  */
 @Service
-public class AdwebEnquiryFormServiceImpl extends ServiceImpl<AdwebEnquiryFormMapper, AdwebEnquiryForm> implements IAdwebEnquiryFormService {
+public class AdwebEnquiryFormServiceImpl
+        extends ServiceImpl<AdwebEnquiryFormMapper, AdwebEnquiryForm>
+        implements IAdwebEnquiryFormService {
 
     @Override
     public AdwebEnquiryForm getByEnquiryId(long enquiryId) {
@@ -22,5 +24,4 @@ public class AdwebEnquiryFormServiceImpl extends ServiceImpl<AdwebEnquiryFormMap
         queryWrapper.eq(AdwebEnquiryForm::getEnquiryId, enquiryId);
         return getOne(queryWrapper);
     }
-
 }

+ 4 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryRecordServiceImpl.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import org.jeecg.modules.adweb.enquiry.entity.AdwebEnquiryRecord;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebEnquiryRecordMapper;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebEnquiryRecordService;
@@ -13,6 +14,6 @@ import org.springframework.stereotype.Service;
  * @Version: V1.0
  */
 @Service
-public class AdwebEnquiryRecordServiceImpl extends ServiceImpl<AdwebEnquiryRecordMapper, AdwebEnquiryRecord> implements IAdwebEnquiryRecordService {
-
-}
+public class AdwebEnquiryRecordServiceImpl
+        extends ServiceImpl<AdwebEnquiryRecordMapper, AdwebEnquiryRecord>
+        implements IAdwebEnquiryRecordService {}

File diff suppressed because it is too large
+ 338 - 224
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebEnquiryServiceImpl.java


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

@@ -3,15 +3,17 @@ package org.jeecg.modules.adweb.enquiry.service.impl;
 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 lombok.extern.slf4j.Slf4j;
+
 import org.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackEmail;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebPublicBlackEmailMapper;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackEmailService;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-
 /**
  * @Description: 询盘公共邮箱黑名单
  * @Author: jeecg-boot
@@ -20,147 +22,193 @@ import org.springframework.stereotype.Service;
  */
 @Slf4j
 @Service
-public class AdwebPublicBlackEmailServiceImpl extends ServiceImpl<AdwebPublicBlackEmailMapper, AdwebPublicBlackEmail> implements IAdwebPublicBlackEmailService {
+public class AdwebPublicBlackEmailServiceImpl
+        extends ServiceImpl<AdwebPublicBlackEmailMapper, AdwebPublicBlackEmail>
+        implements IAdwebPublicBlackEmailService {
 
-//    @Resource
-//    private IAdwebEnquiryService adwebEnquiryService;
-//    @Resource
-//    private IAdwebPublicBlackIpService adwebPublicBlackIpService;
-//    @Resource
-//    private AdwebRedisUtil adwebRedisUtil;
+    //    @Resource
+    //    private IAdwebEnquiryService adwebEnquiryService;
+    //    @Resource
+    //    private IAdwebPublicBlackIpService adwebPublicBlackIpService;
+    //    @Resource
+    //    private AdwebRedisUtil adwebRedisUtil;
 
     @Value("${judge_waste_enquiry.ip.delOrdIpDate}")
     private Integer delOrdIpDate;
+
     @Value("${judge_waste_enquiry.email.tenMinNum}")
     private Integer emailTenMinNum;
+
     @Value("${judge_waste_enquiry.email.oneDayNum}")
     private Integer emailOneDayNum;
+
     @Value("${judge_waste_enquiry.ip.tenMinNum}")
     private Integer ipTenMinNum;
+
     @Value("${judge_waste_enquiry.ip.oneDayNum}")
     private Integer ipOneDayNum;
+
     private static final String BlackEmailKey = "BLACK_EMAIL_LIST";
     private static final String WhiteEmailListKey = "WHITE_EMAIL_LIST";
     private static final String WhiteIpListKey = "WHITE_IP_LIST";
     private static final String BlackIpKey = "BLACK_IP_LIST";
 
-    @Resource
-    AdwebPublicBlackEmailMapper adwebPublicBlackEmailMapper;
+    @Resource AdwebPublicBlackEmailMapper adwebPublicBlackEmailMapper;
 
     @Override
-    public IPage<AdwebPublicBlackEmail> pageList(Page<AdwebPublicBlackEmail> page, String email, Integer blackOrWhite, String column, String order) {
+    public IPage<AdwebPublicBlackEmail> pageList(
+            Page<AdwebPublicBlackEmail> page,
+            String email,
+            Integer blackOrWhite,
+            String column,
+            String order) {
         return adwebPublicBlackEmailMapper.pageList(page, email, blackOrWhite, column, order);
     }
 
-    //定时器执行
-//    @Override
-//    public void updateBlackListByEmailAndIp() {
-//
-//        List<AdwebPublicBlackEmail> emailList = this.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1));
-//
-//        log.info("获取到的email黑名单数量为:{}", emailList.size());
-//
-//        List<String> blackEmailList = emailList.stream().filter(e -> e.getBlackOrWhite() == 0).map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-//
-//        List<String> whiteEmailList = emailList.stream().filter(e -> e.getBlackOrWhite() == 1).map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
-//
-//        adwebRedisUtil.set(BlackEmailKey, blackEmailList, 60 * 60 * 24);
-//        adwebRedisUtil.set(WhiteEmailListKey, whiteEmailList, 60 * 60 * 24);
-//
-//        log.info("更新email黑名单成功,黑名单数量为:{},白名单数量为{}", blackEmailList.size(), whiteEmailList.size());
-//
-//        //90天内的ip
-//        List<AdwebPublicBlackIp> ipList = adwebPublicBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).gt("create_time", DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)));
-//
-//        log.info("获取到的ip黑名单数量为:{}", ipList.size());
-//
-//        List<String> blackIpList = ipList.stream().filter(e -> e.getBlackOrWhite() == 0).map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-//
-//        List<String> whiteIpList = ipList.stream().filter(e -> e.getBlackOrWhite() == 1).map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
-//
-//        adwebRedisUtil.set(BlackIpKey, blackIpList, 60 * 60 * 24);
-//        adwebRedisUtil.set(WhiteIpListKey, whiteIpList, 60 * 60 * 24);
-//
-//        log.info("更新ip黑名单成功,黑名单数量为:{},白名单数量为{}", blackIpList.size(), whiteIpList.size());
-//
-//        List<AdwebPublicBlackIp> ordBlackIpList = adwebPublicBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time", DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)));
-//
-//        if (ordBlackIpList.size() == 0) {
-//            log.info("没有需要删除的ip黑名单");
-//            return;
-//        }
-//
-//        List<AdwebEnquiry> list = adwebEnquiryService.list(new QueryWrapper<AdwebEnquiry>().eq("status", 1).eq("user_effective", 0).in("from_ip", ordBlackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList())).select("DISTINCT id,from_ip"));
-//
-//        //删除90天前并且期间没有发过询盘
-//        if (list.size() > 0) {
-//            adwebPublicBlackIpService.update(new UpdateWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time", DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)).notIn("ip", list.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList())).set("status", 0));
-//            return;
-//        }
-//        adwebPublicBlackIpService.update(new UpdateWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time", DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)).set("status", 0).in("ip", ordBlackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList())));
-//
-//        log.info("删除90天前的ip黑名单成功");
-//    }
-
-    /**
-     * 定时器执行
-     */
-//    @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));
-//
-//        List<AdwebEnquiry> enquiryListByOneDay = adwebEnquiryService.list(new QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT email").groupBy("email,UNIX_TIMESTAMP( record_ctime ) DIV 3600 ").having("count(id) > "+emailOneDayNum));
-//
-//        List<AdwebEnquiry> enquiryListByIpTenMin = adwebEnquiryService.list(new QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT from_ip").groupBy("from_ip,UNIX_TIMESTAMP( record_ctime ) DIV 600 ").having("count(id) > "+ipTenMinNum));
-//
-//        List<AdwebEnquiry> enquiryListByIpOneDay = adwebEnquiryService.list(new QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT from_ip").groupBy("from_ip,UNIX_TIMESTAMP( record_ctime ) DIV 3600 ").having("count(id) > "+ipOneDayNum));
-//
-//        Set<String> emailSet = new HashSet<>();
-//        emailSet.addAll(enquiryListByTenMin.stream().map(AdwebEnquiry::getEmail).collect(Collectors.toList()));
-//        emailSet.addAll(enquiryListByOneDay.stream().map(AdwebEnquiry::getEmail).collect(Collectors.toList()));
-//
-//        Set<String> ipSet = new HashSet<>();
-//        ipSet.addAll(enquiryListByIpTenMin.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList()));
-//        ipSet.addAll(enquiryListByIpOneDay.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList()));
-//
-//        List<AdwebPublicBlackEmail> emailList = this.list(new QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1));
-//
-//        List<AdwebPublicBlackIp> ipList = adwebPublicBlackIpService.list(new QueryWrapper<AdwebPublicBlackIp>().eq("status", 1));
-//
-//
-//        List<AdwebPublicBlackEmail> blackEmailList = new ArrayList<>();
-//        List<AdwebPublicBlackIp> blackIpList = new ArrayList<>();
-//
-//        //判断是否在存在
-//        for (String email : emailSet) {
-//            if (emailList.stream().noneMatch(e -> e.getEmail().equals(email))) {
-//                AdwebPublicBlackEmail blackEmail = new AdwebPublicBlackEmail();
-//                blackEmail.setEmail(email);
-//                blackEmail.setBlackOrWhite(0);
-//                blackEmail.setStatus(1);
-//                blackEmail.setCreateTime(new Date());
-//                blackEmailList.add(blackEmail);
-//            }
-//        }
-//
-//        //判断是否在存在
-//        for (String ip : ipSet) {
-//            if (ipList.stream().noneMatch(e -> e.getIp().equals(ip))) {
-//                AdwebPublicBlackIp blackIp = new AdwebPublicBlackIp();
-//                blackIp.setIp(ip);
-//                blackIp.setBlackOrWhite(0);
-//                blackIp.setStatus(1);
-//                blackIp.setCreateTime(new Date());
-//                blackIpList.add(blackIp);
-//            }
-//        }
-//
-//        if (blackEmailList.size() > 0) {
-//            this.saveBatch(blackEmailList);
-//        }
-//        if (blackIpList.size() > 0) {
-//            adwebPublicBlackIpService.saveBatch(blackIpList);
-//        }
-//        log.info("从询盘更新Email和IP黑名单成功,新增Email黑名单数量为:" + blackEmailList.size() + ",新增IP黑名单数量为" + blackIpList.size());
-//    }
+    // 定时器执行
+    //    @Override
+    //    public void updateBlackListByEmailAndIp() {
+    //
+    //        List<AdwebPublicBlackEmail> emailList = this.list(new
+    // QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1));
+    //
+    //        log.info("获取到的email黑名单数量为:{}", emailList.size());
+    //
+    //        List<String> blackEmailList = emailList.stream().filter(e -> e.getBlackOrWhite() ==
+    // 0).map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+    //
+    //        List<String> whiteEmailList = emailList.stream().filter(e -> e.getBlackOrWhite() ==
+    // 1).map(AdwebPublicBlackEmail::getEmail).collect(Collectors.toList());
+    //
+    //        adwebRedisUtil.set(BlackEmailKey, blackEmailList, 60 * 60 * 24);
+    //        adwebRedisUtil.set(WhiteEmailListKey, whiteEmailList, 60 * 60 * 24);
+    //
+    //        log.info("更新email黑名单成功,黑名单数量为:{},白名单数量为{}", blackEmailList.size(),
+    // whiteEmailList.size());
+    //
+    //        //90天内的ip
+    //        List<AdwebPublicBlackIp> ipList = adwebPublicBlackIpService.list(new
+    // QueryWrapper<AdwebPublicBlackIp>().eq("status", 1).gt("create_time",
+    // DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)));
+    //
+    //        log.info("获取到的ip黑名单数量为:{}", ipList.size());
+    //
+    //        List<String> blackIpList = ipList.stream().filter(e -> e.getBlackOrWhite() ==
+    // 0).map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+    //
+    //        List<String> whiteIpList = ipList.stream().filter(e -> e.getBlackOrWhite() ==
+    // 1).map(AdwebPublicBlackIp::getIp).collect(Collectors.toList());
+    //
+    //        adwebRedisUtil.set(BlackIpKey, blackIpList, 60 * 60 * 24);
+    //        adwebRedisUtil.set(WhiteIpListKey, whiteIpList, 60 * 60 * 24);
+    //
+    //        log.info("更新ip黑名单成功,黑名单数量为:{},白名单数量为{}", blackIpList.size(), whiteIpList.size());
+    //
+    //        List<AdwebPublicBlackIp> ordBlackIpList = adwebPublicBlackIpService.list(new
+    // QueryWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time",
+    // DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)));
+    //
+    //        if (ordBlackIpList.size() == 0) {
+    //            log.info("没有需要删除的ip黑名单");
+    //            return;
+    //        }
+    //
+    //        List<AdwebEnquiry> list = adwebEnquiryService.list(new
+    // QueryWrapper<AdwebEnquiry>().eq("status", 1).eq("user_effective", 0).in("from_ip",
+    // ordBlackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList())).select("DISTINCT id,from_ip"));
+    //
+    //        //删除90天前并且期间没有发过询盘
+    //        if (list.size() > 0) {
+    //            adwebPublicBlackIpService.update(new
+    // UpdateWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time",
+    // DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)).notIn("ip",
+    // list.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList())).set("status", 0));
+    //            return;
+    //        }
+    //        adwebPublicBlackIpService.update(new
+    // UpdateWrapper<AdwebPublicBlackIp>().eq("black_or_white", 0).eq("status", 1).lt("create_time",
+    // DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -delOrdIpDate)).set("status", 0).in("ip",
+    // ordBlackIpList.stream().map(AdwebPublicBlackIp::getIp).collect(Collectors.toList())));
+    //
+    //        log.info("删除90天前的ip黑名单成功");
+    //    }
+
+    /** 定时器执行 */
+    //    @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));
+    //
+    //        List<AdwebEnquiry> enquiryListByOneDay = adwebEnquiryService.list(new
+    // QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT
+    // email").groupBy("email,UNIX_TIMESTAMP( record_ctime ) DIV 3600 ").having("count(id) >
+    // "+emailOneDayNum));
+    //
+    //        List<AdwebEnquiry> enquiryListByIpTenMin = adwebEnquiryService.list(new
+    // QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT
+    // from_ip").groupBy("from_ip,UNIX_TIMESTAMP( record_ctime ) DIV 600 ").having("count(id) >
+    // "+ipTenMinNum));
+    //
+    //        List<AdwebEnquiry> enquiryListByIpOneDay = adwebEnquiryService.list(new
+    // QueryWrapper<AdwebEnquiry>().eq("user_effective", 0).eq("status", 1).select("DISTINCT
+    // from_ip").groupBy("from_ip,UNIX_TIMESTAMP( record_ctime ) DIV 3600 ").having("count(id) >
+    // "+ipOneDayNum));
+    //
+    //        Set<String> emailSet = new HashSet<>();
+    //
+    // emailSet.addAll(enquiryListByTenMin.stream().map(AdwebEnquiry::getEmail).collect(Collectors.toList()));
+    //
+    // emailSet.addAll(enquiryListByOneDay.stream().map(AdwebEnquiry::getEmail).collect(Collectors.toList()));
+    //
+    //        Set<String> ipSet = new HashSet<>();
+    //
+    // ipSet.addAll(enquiryListByIpTenMin.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList()));
+    //
+    // ipSet.addAll(enquiryListByIpOneDay.stream().map(AdwebEnquiry::getFromIp).collect(Collectors.toList()));
+    //
+    //        List<AdwebPublicBlackEmail> emailList = this.list(new
+    // QueryWrapper<AdwebPublicBlackEmail>().eq("status", 1));
+    //
+    //        List<AdwebPublicBlackIp> ipList = adwebPublicBlackIpService.list(new
+    // QueryWrapper<AdwebPublicBlackIp>().eq("status", 1));
+    //
+    //
+    //        List<AdwebPublicBlackEmail> blackEmailList = new ArrayList<>();
+    //        List<AdwebPublicBlackIp> blackIpList = new ArrayList<>();
+    //
+    //        //判断是否在存在
+    //        for (String email : emailSet) {
+    //            if (emailList.stream().noneMatch(e -> e.getEmail().equals(email))) {
+    //                AdwebPublicBlackEmail blackEmail = new AdwebPublicBlackEmail();
+    //                blackEmail.setEmail(email);
+    //                blackEmail.setBlackOrWhite(0);
+    //                blackEmail.setStatus(1);
+    //                blackEmail.setCreateTime(new Date());
+    //                blackEmailList.add(blackEmail);
+    //            }
+    //        }
+    //
+    //        //判断是否在存在
+    //        for (String ip : ipSet) {
+    //            if (ipList.stream().noneMatch(e -> e.getIp().equals(ip))) {
+    //                AdwebPublicBlackIp blackIp = new AdwebPublicBlackIp();
+    //                blackIp.setIp(ip);
+    //                blackIp.setBlackOrWhite(0);
+    //                blackIp.setStatus(1);
+    //                blackIp.setCreateTime(new Date());
+    //                blackIpList.add(blackIp);
+    //            }
+    //        }
+    //
+    //        if (blackEmailList.size() > 0) {
+    //            this.saveBatch(blackEmailList);
+    //        }
+    //        if (blackIpList.size() > 0) {
+    //            adwebPublicBlackIpService.saveBatch(blackIpList);
+    //        }
+    //        log.info("从询盘更新Email和IP黑名单成功,新增Email黑名单数量为:" + blackEmailList.size() + ",新增IP黑名单数量为" +
+    // blackIpList.size());
+    //    }
 }

+ 14 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicBlackIpServiceImpl.java

@@ -3,7 +3,9 @@ package org.jeecg.modules.adweb.enquiry.service.impl;
 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.jeecg.modules.adweb.enquiry.entity.AdwebPublicBlackIp;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebPublicBlackIpMapper;
 import org.jeecg.modules.adweb.enquiry.service.IAdwebPublicBlackIpService;
@@ -12,17 +14,23 @@ import org.springframework.stereotype.Service;
 /**
  * @Description: IP黑名单
  * @Author: jeecg-boot
- * @Date:   2023-02-20
+ * @Date: 2023-02-20
  * @Version: V1.0
  */
 @Service
-public class AdwebPublicBlackIpServiceImpl extends ServiceImpl<AdwebPublicBlackIpMapper, AdwebPublicBlackIp> implements IAdwebPublicBlackIpService {
+public class AdwebPublicBlackIpServiceImpl
+        extends ServiceImpl<AdwebPublicBlackIpMapper, AdwebPublicBlackIp>
+        implements IAdwebPublicBlackIpService {
 
-    @Resource
-    private AdwebPublicBlackIpMapper adwebPublicBlackIpMapper;
+    @Resource private AdwebPublicBlackIpMapper adwebPublicBlackIpMapper;
 
     @Override
-    public IPage<AdwebPublicBlackIp> pageList(Page<AdwebPublicBlackIp> page, String ip, Integer blackOrWhite,String column,String order) {
-        return adwebPublicBlackIpMapper.pageList(page,ip,blackOrWhite,column,order);
+    public IPage<AdwebPublicBlackIp> pageList(
+            Page<AdwebPublicBlackIp> page,
+            String ip,
+            Integer blackOrWhite,
+            String column,
+            String order) {
+        return adwebPublicBlackIpMapper.pageList(page, ip, blackOrWhite, column, order);
     }
 }

+ 29 - 18
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebPublicEnquiryRuleServiceImpl.java

@@ -1,6 +1,5 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -20,27 +19,38 @@ import java.util.stream.Collectors;
 /**
  * @Description: 用于询盘规则过滤
  * @Author: cpq
- * @Date:   2024-10-17
+ * @Date: 2024-10-17
  * @Version: V1.0
  */
 @Service
-public class AdwebPublicEnquiryRuleServiceImpl extends ServiceImpl<AdwebPublicEnquiryRuleMapper, AdwebPublicEnquiryRule> implements IAdwebPublicEnquiryRuleService {
+public class AdwebPublicEnquiryRuleServiceImpl
+        extends ServiceImpl<AdwebPublicEnquiryRuleMapper, AdwebPublicEnquiryRule>
+        implements IAdwebPublicEnquiryRuleService {
 
-    @Resource
-    private AdwebPublicEnquiryRuleMapper adwebPublicEnquiryRuleMapper;
+    @Resource private AdwebPublicEnquiryRuleMapper adwebPublicEnquiryRuleMapper;
 
     @Override
-    public IPage<AdwebPublicEnquiryRule> pageList(Page<AdwebPublicEnquiryRule> page, String word, Integer blackOrWhiteList, Integer isEnable, Integer useStatus,String column,String order) {
-        return adwebPublicEnquiryRuleMapper.pageList(page, word, blackOrWhiteList, isEnable, useStatus,column,order);
+    public IPage<AdwebPublicEnquiryRule> pageList(
+            Page<AdwebPublicEnquiryRule> page,
+            String word,
+            Integer blackOrWhiteList,
+            Integer isEnable,
+            Integer useStatus,
+            String column,
+            String order) {
+        return adwebPublicEnquiryRuleMapper.pageList(
+                page, word, blackOrWhiteList, isEnable, useStatus, column, order);
     }
 
     @Override
     public List<String> getOpenAiBlackList() {
-        List<AdwebPublicEnquiryRule> list = this.list(new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
-                .eq(AdwebPublicEnquiryRule::getStatus, 1)
-                .eq(AdwebPublicEnquiryRule::getUseStatus, 1)
-                .eq(AdwebPublicEnquiryRule::getIsEnable, 1)
-                .eq(AdwebPublicEnquiryRule::getBlackOrWhiteList, 0));
+        List<AdwebPublicEnquiryRule> list =
+                this.list(
+                        new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
+                                .eq(AdwebPublicEnquiryRule::getStatus, 1)
+                                .eq(AdwebPublicEnquiryRule::getUseStatus, 1)
+                                .eq(AdwebPublicEnquiryRule::getIsEnable, 1)
+                                .eq(AdwebPublicEnquiryRule::getBlackOrWhiteList, 0));
         if (CollectionUtils.isEmpty(list)) {
             return null;
         }
@@ -49,15 +59,16 @@ public class AdwebPublicEnquiryRuleServiceImpl extends ServiceImpl<AdwebPublicEn
 
     @Override
     public List<String> getEnquiryBlackList() {
-        List<AdwebPublicEnquiryRule> list = this.list(new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
-                .eq(AdwebPublicEnquiryRule::getStatus, 1)
-                .eq(AdwebPublicEnquiryRule::getUseStatus, 0)
-                .eq(AdwebPublicEnquiryRule::getIsEnable, 1)
-                .eq(AdwebPublicEnquiryRule::getBlackOrWhiteList, 0));
+        List<AdwebPublicEnquiryRule> list =
+                this.list(
+                        new LambdaQueryWrapper<AdwebPublicEnquiryRule>()
+                                .eq(AdwebPublicEnquiryRule::getStatus, 1)
+                                .eq(AdwebPublicEnquiryRule::getUseStatus, 0)
+                                .eq(AdwebPublicEnquiryRule::getIsEnable, 1)
+                                .eq(AdwebPublicEnquiryRule::getBlackOrWhiteList, 0));
         if (CollectionUtils.isEmpty(list)) {
             return null;
         }
         return list.stream().map(AdwebPublicEnquiryRule::getWord).collect(Collectors.toList());
     }
-
 }

+ 51 - 32
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteBlackEmailServiceImpl.java

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
@@ -22,25 +24,25 @@ import java.util.*;
  * @Version: V1.0
  */
 @Service
-public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEmailMapper, AdwebSiteBlackEmail> implements IAdwebSiteBlackEmailService {
+public class AdwebSiteBlackEmailServiceImpl
+        extends ServiceImpl<AdwebSiteBlackEmailMapper, AdwebSiteBlackEmail>
+        implements IAdwebSiteBlackEmailService {
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
-    @Resource
-    private AdwebSiteBlackEmailMapper enquirySiteBlackEmailMapper;
+    @Resource private AdwebRedisUtil adwebRedisUtil;
+    @Resource private AdwebSiteBlackEmailMapper enquirySiteBlackEmailMapper;
 
     private static final String SiteBlackEmailKey = "SITE_BLACK_EMAIL_LIST";
     private static final String SiteWhiteEmailListKey = "SITE_WHITE_EMAIL_LIST";
     private static final String SiteEmailTenMinKey = "JUDGE_WASTE_SITE_ENQUIRY_EMAIL_BY_10_MIN::";
     private static final String SiteEmailOneDayKey = "JUDGE_WASTE_SITE_ENQUIRY_EMAIL_BY_ONE_DAY::";
-    private static final String NotBlackEmailWasteSiteEnquiryKey = "NOT_BLACK_EMAIL_WASTE_SITE_ENQUIRY_MAP::";
+    private static final String NotBlackEmailWasteSiteEnquiryKey =
+            "NOT_BLACK_EMAIL_WASTE_SITE_ENQUIRY_MAP::";
 
-    /**
-     * 根据站点id获取并存取黑名单数据到redis
-     */
+    /** 根据站点id获取并存取黑名单数据到redis */
     @Override
     public void saveRedisSiteBlackEmailBySiteId(Integer siteId, Integer blackOrWhite) {
-        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
         siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
         siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, siteId);
         siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getBlackOrWhite, blackOrWhite);
@@ -59,7 +61,7 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
                 }
             }
         }
-        //处理对应站点的黑名单
+        // 处理对应站点的黑名单
         if (blackOrWhite == 0) {
             if (CollectionUtils.isNotEmpty(emailList)) {
                 adwebRedisUtil.set(SiteBlackEmailKey + "::" + siteId, emailList, 60 * 60 * 24);
@@ -73,15 +75,13 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
                 adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + siteId);
             }
         }
-
     }
 
-    /**
-     * 根据站点id获取对应所有的黑白名单数据
-     */
+    /** 根据站点id获取对应所有的黑白名单数据 */
     @Override
     public Map<String, List<String>> getSiteBlackEmailListBySiteId(Integer siteId) {
-        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AdwebSiteBlackEmail> siteAllEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
         siteAllEmailQueryWrapper.ne(AdwebSiteBlackEmail::getStatus, 0);
         siteAllEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, siteId);
         List<AdwebSiteBlackEmail> allEmailList = list(siteAllEmailQueryWrapper);
@@ -124,8 +124,14 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
      * @return
      */
     @Override
-    public IPage<AdwebSiteBlackEmail> pageList(Page<AdwebSiteBlackEmail> page, AdwebSiteBlackEmail enquirySiteBlackEmail, List<String> codeList, String column, String order) {
-        return enquirySiteBlackEmailMapper.getPageList(page, enquirySiteBlackEmail, codeList, column, order);
+    public IPage<AdwebSiteBlackEmail> pageList(
+            Page<AdwebSiteBlackEmail> page,
+            AdwebSiteBlackEmail enquirySiteBlackEmail,
+            List<String> codeList,
+            String column,
+            String order) {
+        return enquirySiteBlackEmailMapper.getPageList(
+                page, enquirySiteBlackEmail, codeList, column, order);
     }
 
     /**
@@ -135,15 +141,20 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
      */
     @Override
     public void addBlackEmailByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
-        //排查添加的邮箱是否已有
-        LambdaQueryWrapper<AdwebSiteBlackEmail> enquirySiteBlackEmailQueryWrapper = new LambdaQueryWrapper<>();
-        enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getEmail, effectiveEnquiryParamDto.getWasteEnquirySeason());
-        enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteId, effectiveEnquiryParamDto.getSiteId());
-        enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
+        // 排查添加的邮箱是否已有
+        LambdaQueryWrapper<AdwebSiteBlackEmail> enquirySiteBlackEmailQueryWrapper =
+                new LambdaQueryWrapper<>();
+        enquirySiteBlackEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getEmail, effectiveEnquiryParamDto.getWasteEnquirySeason());
+        enquirySiteBlackEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getSiteId, effectiveEnquiryParamDto.getSiteId());
+        enquirySiteBlackEmailQueryWrapper.eq(
+                AdwebSiteBlackEmail::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
         enquirySiteBlackEmailQueryWrapper.eq(AdwebSiteBlackEmail::getStatus, 1);
-        List<AdwebSiteBlackEmail> enquirySiteBlackEmailList = list(enquirySiteBlackEmailQueryWrapper);
+        List<AdwebSiteBlackEmail> enquirySiteBlackEmailList =
+                list(enquirySiteBlackEmailQueryWrapper);
         if (CollectionUtils.isNotEmpty(enquirySiteBlackEmailList)) {
-            //如果有白名单 先删除原数据,后添加新的黑名单数据
+            // 如果有白名单 先删除原数据,后添加新的黑名单数据
             for (AdwebSiteBlackEmail enquirySiteBlackEmail : enquirySiteBlackEmailList) {
                 if (enquirySiteBlackEmail.getBlackOrWhite() == 1) {
                     if (enquirySiteBlackEmail.getType().equals("1")) {
@@ -153,7 +164,8 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
                     }
 
                     AdwebSiteBlackEmail newEnquirySiteBlackEmail = new AdwebSiteBlackEmail();
-                    newEnquirySiteBlackEmail.setEmail(effectiveEnquiryParamDto.getWasteEnquirySeason());
+                    newEnquirySiteBlackEmail.setEmail(
+                            effectiveEnquiryParamDto.getWasteEnquirySeason());
                     newEnquirySiteBlackEmail.setBlackOrWhite(0);
                     newEnquirySiteBlackEmail.setType("1");
                     newEnquirySiteBlackEmail.setSiteId(effectiveEnquiryParamDto.getSiteId());
@@ -175,21 +187,28 @@ public class AdwebSiteBlackEmailServiceImpl extends ServiceImpl<AdwebSiteBlackEm
             save(enquirySiteBlackEmail);
         }
 
-        //重新处理站点的黑名单redis缓存
-        Map<String, List<String>> enquirySiteBlackEmailListMap = getSiteBlackEmailListBySiteId(effectiveEnquiryParamDto.getSiteId());
+        // 重新处理站点的黑名单redis缓存
+        Map<String, List<String>> enquirySiteBlackEmailListMap =
+                getSiteBlackEmailListBySiteId(effectiveEnquiryParamDto.getSiteId());
         List<String> emailList = enquirySiteBlackEmailListMap.get("black");
         List<String> whiteEmailList = enquirySiteBlackEmailListMap.get("white");
 
-        //处理对应站点的黑名单
+        // 处理对应站点的黑名单
         if (CollectionUtils.isNotEmpty(emailList)) {
-            adwebRedisUtil.set(SiteBlackEmailKey + "::" + effectiveEnquiryParamDto.getSiteId(), emailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteBlackEmailKey + "::" + effectiveEnquiryParamDto.getSiteId(),
+                    emailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteBlackEmailKey + "::" + effectiveEnquiryParamDto.getSiteId());
         }
 
-        //处理对应站点的白名单
+        // 处理对应站点的白名单
         if (CollectionUtils.isNotEmpty(whiteEmailList)) {
-            adwebRedisUtil.set(SiteWhiteEmailListKey + "::" + effectiveEnquiryParamDto.getSiteId(), whiteEmailList, 60 * 60 * 24);
+            adwebRedisUtil.set(
+                    SiteWhiteEmailListKey + "::" + effectiveEnquiryParamDto.getSiteId(),
+                    whiteEmailList,
+                    60 * 60 * 24);
         } else {
             adwebRedisUtil.del(SiteWhiteEmailListKey + "::" + effectiveEnquiryParamDto.getSiteId());
         }

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

@@ -1,11 +1,12 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
@@ -25,16 +26,17 @@ import java.util.stream.Collectors;
  * @Version: V1.0
  */
 @Service
-public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMapper, AdwebSiteBlackIp> implements IAdwebSiteBlackIpService {
+public class AdwebSiteBlackIpServiceImpl
+        extends ServiceImpl<AdwebSiteBlackIpMapper, AdwebSiteBlackIp>
+        implements IAdwebSiteBlackIpService {
 
-    @Resource
-    private AdwebSiteBlackIpMapper adwebSiteBlackIpMapper;
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource private AdwebSiteBlackIpMapper adwebSiteBlackIpMapper;
+    @Resource 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::";
-    private static final String NotSiteBlackIpWasteEnquiryKey = "NOT_SITE_BLACK_IP_WASTE_ENQUIRY_MAP::";
+    private static final String NotSiteBlackIpWasteEnquiryKey =
+            "NOT_SITE_BLACK_IP_WASTE_ENQUIRY_MAP::";
     private static final String SiteBlackIpKey = "SITE_BLACK_IP_LIST";
     private static final String SiteWhiteIpListKey = "SITE_WHITE_IP_LIST";
 
@@ -45,15 +47,19 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
      */
     @Override
     public void addBlackIpByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
-        //排查添加的ip是否已有
-        LambdaQueryWrapper<AdwebSiteBlackIp> adwebSiteBlackIpQueryWrapper = new LambdaQueryWrapper<>();
-        adwebSiteBlackIpQueryWrapper.eq(AdwebSiteBlackIp::getIp, effectiveEnquiryParamDto.getWasteEnquirySeason());
-        adwebSiteBlackIpQueryWrapper.eq(AdwebSiteBlackIp::getSiteId, effectiveEnquiryParamDto.getSiteId());
-        adwebSiteBlackIpQueryWrapper.eq(AdwebSiteBlackIp::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
+        // 排查添加的ip是否已有
+        LambdaQueryWrapper<AdwebSiteBlackIp> adwebSiteBlackIpQueryWrapper =
+                new LambdaQueryWrapper<>();
+        adwebSiteBlackIpQueryWrapper.eq(
+                AdwebSiteBlackIp::getIp, effectiveEnquiryParamDto.getWasteEnquirySeason());
+        adwebSiteBlackIpQueryWrapper.eq(
+                AdwebSiteBlackIp::getSiteId, effectiveEnquiryParamDto.getSiteId());
+        adwebSiteBlackIpQueryWrapper.eq(
+                AdwebSiteBlackIp::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
         adwebSiteBlackIpQueryWrapper.eq(AdwebSiteBlackIp::getStatus, 1);
         List<AdwebSiteBlackIp> adwebSiteBlackIpList = list(adwebSiteBlackIpQueryWrapper);
         if (!adwebSiteBlackIpList.isEmpty()) {
-            //如果有白名单 先删除原数据,后添加新的黑名单数据
+            // 如果有白名单 先删除原数据,后添加新的黑名单数据
             AdwebSiteBlackIp adwebSiteBlackIp = adwebSiteBlackIpList.get(0);
             if (adwebSiteBlackIp.getBlackOrWhite() == 1) {
                 adwebSiteBlackIp.setStatus(0);
@@ -79,7 +85,7 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
             save(newSiteBlackIp);
         }
 
-        //重新调整对应站点redis缓存
+        // 重新调整对应站点redis缓存
         LambdaQueryWrapper<AdwebSiteBlackIp> redisWrapper = new LambdaQueryWrapper<>();
         redisWrapper.eq(AdwebSiteBlackIp::getSiteId, effectiveEnquiryParamDto.getSiteId());
         redisWrapper.eq(AdwebSiteBlackIp::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
@@ -91,21 +97,35 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
             adwebRedisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
         }
         if (CollectionUtils.isNotEmpty(redisList)) {
-            List<String> blackIpList = redisList.stream().filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0)).map(AdwebSiteBlackIp::getIp).collect(Collectors.toList());
+            List<String> blackIpList =
+                    redisList.stream()
+                            .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(0))
+                            .map(AdwebSiteBlackIp::getIp)
+                            .collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(blackIpList)) {
-                adwebRedisUtil.set(SiteBlackIpKey + "::" + effectiveEnquiryParamDto.getSiteId(), blackIpList, 60 * 60 * 24);
+                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());
+            List<String> whiteIpList =
+                    redisList.stream()
+                            .filter(siteBlackIp -> siteBlackIp.getBlackOrWhite().equals(1))
+                            .map(AdwebSiteBlackIp::getIp)
+                            .collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(whiteIpList)) {
-                adwebRedisUtil.set(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId(), whiteIpList, 60 * 60 * 24);
+                adwebRedisUtil.set(
+                        SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId(),
+                        whiteIpList,
+                        60 * 60 * 24);
             } else {
-                adwebRedisUtil.del(SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
+                adwebRedisUtil.del(
+                        SiteWhiteIpListKey + "::" + effectiveEnquiryParamDto.getSiteId());
             }
         }
-
     }
 
     /**
@@ -117,7 +137,12 @@ public class AdwebSiteBlackIpServiceImpl extends ServiceImpl<AdwebSiteBlackIpMap
      * @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);
     }
 }

+ 16 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/AdwebSiteEnquiryRuleServiceImpl.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.adweb.enquiry.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import org.jeecg.modules.adweb.enquiry.dto.param.EffectiveEnquiryParamDto;
 import org.jeecg.modules.adweb.enquiry.entity.AdwebSiteEnquiryRule;
 import org.jeecg.modules.adweb.enquiry.mapper.AdwebSiteEnquiryRuleMapper;
@@ -18,7 +19,9 @@ import java.util.List;
  * @Version: V1.0
  */
 @Service
-public class AdwebSiteEnquiryRuleServiceImpl extends ServiceImpl<AdwebSiteEnquiryRuleMapper, AdwebSiteEnquiryRule> implements IAdwebSiteEnquiryRuleService {
+public class AdwebSiteEnquiryRuleServiceImpl
+        extends ServiceImpl<AdwebSiteEnquiryRuleMapper, AdwebSiteEnquiryRule>
+        implements IAdwebSiteEnquiryRuleService {
 
     /**
      * 更改为垃圾询盘处理关键词黑名单
@@ -27,15 +30,20 @@ public class AdwebSiteEnquiryRuleServiceImpl extends ServiceImpl<AdwebSiteEnquir
      */
     @Override
     public void addBlackKeywordByContent(EffectiveEnquiryParamDto effectiveEnquiryParamDto) {
-        //排查添加的关键词是否已有
-        LambdaQueryWrapper<AdwebSiteEnquiryRule> adwebEnquirySiteRuleQueryWrapper = new LambdaQueryWrapper<>();
-        adwebEnquirySiteRuleQueryWrapper.eq(AdwebSiteEnquiryRule::getWord, effectiveEnquiryParamDto.getWasteEnquirySeason());
-        adwebEnquirySiteRuleQueryWrapper.eq(AdwebSiteEnquiryRule::getSiteId, effectiveEnquiryParamDto.getSiteId());
-        adwebEnquirySiteRuleQueryWrapper.eq(AdwebSiteEnquiryRule::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
+        // 排查添加的关键词是否已有
+        LambdaQueryWrapper<AdwebSiteEnquiryRule> adwebEnquirySiteRuleQueryWrapper =
+                new LambdaQueryWrapper<>();
+        adwebEnquirySiteRuleQueryWrapper.eq(
+                AdwebSiteEnquiryRule::getWord, effectiveEnquiryParamDto.getWasteEnquirySeason());
+        adwebEnquirySiteRuleQueryWrapper.eq(
+                AdwebSiteEnquiryRule::getSiteId, effectiveEnquiryParamDto.getSiteId());
+        adwebEnquirySiteRuleQueryWrapper.eq(
+                AdwebSiteEnquiryRule::getSiteCode, effectiveEnquiryParamDto.getSiteCode());
         adwebEnquirySiteRuleQueryWrapper.eq(AdwebSiteEnquiryRule::getStatus, 1);
-        List<AdwebSiteEnquiryRule> adwebEnquirySiteRuleList = list(adwebEnquirySiteRuleQueryWrapper);
+        List<AdwebSiteEnquiryRule> adwebEnquirySiteRuleList =
+                list(adwebEnquirySiteRuleQueryWrapper);
         if (!adwebEnquirySiteRuleList.isEmpty()) {
-            //如果有白名单 先删除原数据,后添加新的黑名单数据
+            // 如果有白名单 先删除原数据,后添加新的黑名单数据
             AdwebSiteEnquiryRule adwebEnquirySiteRule = adwebEnquirySiteRuleList.get(0);
             if (adwebEnquirySiteRule.getBlackOrWhite() == 1) {
                 adwebEnquirySiteRule.setStatus(0);

+ 80 - 68
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/EnquiryEmailMessageServiceImpl.java

@@ -54,37 +54,29 @@ import java.util.stream.Collectors;
  * @Version: V1.0
  */
 @Service
-public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMessageMapper, EnquiryEmailMessage> implements IEnquiryEmailMessageService {
+public class EnquiryEmailMessageServiceImpl
+        extends ServiceImpl<EnquiryEmailMessageMapper, EnquiryEmailMessage>
+        implements IEnquiryEmailMessageService {
 
     private static byte[] redisKey = EnquiryConstants.ENQUIRY_EMAIL.getBytes();
 
-    @Resource
-    private EnquiryEmailMessageMapper enquiryEmailMessageMapper;
+    @Resource private EnquiryEmailMessageMapper enquiryEmailMessageMapper;
 
-    @Resource
-    private FeishuService feishuService;
+    @Resource private FeishuService feishuService;
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource private AdwebRedisUtil adwebRedisUtil;
 
-    @Resource
-    private ISysDictService sysDictService;
+    @Resource private ISysDictService sysDictService;
 
-    @Resource
-    private IAdwebEnquiryFormService adwebEnquiryFormService;
+    @Resource private IAdwebEnquiryFormService adwebEnquiryFormService;
 
-    @Resource
-    private ISysExceptionService sysExceptionService;
+    @Resource private ISysExceptionService sysExceptionService;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    @Lazy
-    private ISysUserService sysUserService;
+    @Resource @Lazy private ISysUserService sysUserService;
 
-    @Autowired
-    private IMasterSubAccountRelationService masterSubAccountRelationService;
+    @Autowired private IMasterSubAccountRelationService masterSubAccountRelationService;
 
     @Override
     public void sendEnquiryEmail(Long enquiryId) {
@@ -99,7 +91,11 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
         List<EnquiryEmailMessage> messageList = list(queryWrapper);
         if (CollUtil.isNotEmpty(messageList)) {
             LambdaUpdateWrapper<EnquiryEmailMessage> updateWrapper = new LambdaUpdateWrapper<>();
-            updateWrapper.in(EnquiryEmailMessage::getId, messageList.stream().map(EnquiryEmailMessage::getId).collect(Collectors.toList()));
+            updateWrapper.in(
+                    EnquiryEmailMessage::getId,
+                    messageList.stream()
+                            .map(EnquiryEmailMessage::getId)
+                            .collect(Collectors.toList()));
             updateWrapper.set(EnquiryEmailMessage::getSendStatus, EnquirySendStatus.SENDING);
             updateWrapper.set(EnquiryEmailMessage::getSendStartTime, new Date());
             this.update(updateWrapper);
@@ -114,10 +110,16 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     @Override
     public void sendEmailByMessage(EnquiryEmailMessage message) {
         try {
-            EmailSendMsgHandle sendMsgHandle = (EmailSendMsgHandle) Class.forName(SendMsgTypeEnum.EMAIL.getImplClass()).newInstance();
-            AdwebSite site = adwebSiteService.getOne(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, message.getSiteCode()));
+            EmailSendMsgHandle sendMsgHandle =
+                    (EmailSendMsgHandle)
+                            Class.forName(SendMsgTypeEnum.EMAIL.getImplClass()).newInstance();
+            AdwebSite site =
+                    adwebSiteService.getOne(
+                            new LambdaQueryWrapper<AdwebSite>()
+                                    .eq(AdwebSite::getCode, message.getSiteCode()));
             String fromName = Objects.toString(site.getCompanyName(), site.getName());
-            sendMsgHandle.sendMsg(message.getEmail(), fromName, getEmailContent(message.getEnquiryId()));
+            sendMsgHandle.sendMsg(
+                    message.getEmail(), fromName, getEmailContent(message.getEnquiryId()));
             dealSendSuccess(message);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -126,8 +128,7 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     }
 
     /**
-     * 处理发送时间超过10分钟的邮件消息
-     * 1、清除发送时间
+     * 处理发送时间超过10分钟的邮件消息 1、清除发送时间
      *
      * @return 如果返回true,需要重新发送
      */
@@ -142,24 +143,14 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     //     return false;
     // }
 
-    /**
-     * 邮件发送失败处理
-     * 1、更新发送状态
-     * 2、清除发送时间
-     */
+    /** 邮件发送失败处理 1、更新发送状态 2、清除发送时间 */
     private void dealSendSuccess(EnquiryEmailMessage message) {
         message.setSendStatus(EnquirySendStatus.SEND_SUCCESS);
         message.setSendStartTime(null);
         updateById(message);
     }
 
-    /**
-     * 邮件发送失败处理
-     * 1、增加错误次数
-     * 2、更新发送状态
-     * 3、清除发送时间
-     * 4、如果错误次数到达三次,发送飞书通知
-     */
+    /** 邮件发送失败处理 1、增加错误次数 2、更新发送状态 3、清除发送时间 4、如果错误次数到达三次,发送飞书通知 */
     private void dealSendFail(EnquiryEmailMessage message, String errorMsg) {
         if (StringUtils.isEmpty(errorMsg)) {
             errorMsg = "发送询盘邮件失败";
@@ -176,7 +167,8 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
         message.setSendErrorMsg(msg);
         updateById(message);
         if (message.getSendErrorNum() >= 3) {
-            feishuService.sendEnquiryEmailFailMsg(message.getEnquiryId(), message.getSiteCode(), message.getEmail(), errorMsg);
+            feishuService.sendEnquiryEmailFailMsg(
+                    message.getEnquiryId(), message.getSiteCode(), message.getEmail(), errorMsg);
         }
 
         // 异常入库
@@ -194,16 +186,18 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     private String getEmailContent(long enquiryId) throws IOException {
         String bodyTemplate =
                 Resources.toString(
-                        Objects.requireNonNull(this.getClass()
-                                .getClassLoader()
-                                .getResource("enquiry/email/body.tmpl")),
+                        Objects.requireNonNull(
+                                this.getClass()
+                                        .getClassLoader()
+                                        .getResource("enquiry/email/body.tmpl")),
                         StandardCharsets.UTF_8);
 
         String itemTemplate =
                 Resources.toString(
-                        Objects.requireNonNull(this.getClass()
-                                .getClassLoader()
-                                .getResource("enquiry/email/item.tmpl")),
+                        Objects.requireNonNull(
+                                this.getClass()
+                                        .getClassLoader()
+                                        .getResource("enquiry/email/item.tmpl")),
                         StandardCharsets.UTF_8);
         StringBuilder content = new StringBuilder();
 
@@ -219,7 +213,10 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
             String formItemValue = enquiryFormItem.getValue();
             String item1 = itemTemplate;
             item1 = item1.replace("{{title}}", formItemName);
-            item1 = item1.replace("{{content}}", formItemValue == null || formItemValue == "" ? " " : formItemValue);
+            item1 =
+                    item1.replace(
+                            "{{content}}",
+                            formItemValue == null || formItemValue == "" ? " " : formItemValue);
             if (i == 0) {
                 item1 = item1.replace("border-top:1px solid #dddddd;", "");
             }
@@ -230,12 +227,10 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     }
 
     /**
-     * 获取待发送询盘
-     * 1、首次发送失败的
-     * 2、超过timeout分钟未处理的
+     * 获取待发送询盘 1、首次发送失败的 2、超过timeout分钟未处理的
      *
      * @param timeout 留给首次实时处理的时间,单位分钟,超过这个时间则认为首次邮件发送失败,应该由定时器处理
-     * @param num     获取邮件数量
+     * @param num 获取邮件数量
      * @return 邮件列表
      */
     @Override
@@ -250,15 +245,27 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
      */
     @Override
     public Result<?> addAndEnquiryEmailMsg(AdwebEnquiry adwebEnquiry, String uid) {
-        //处理已有发送的询盘邮件
+        // 处理已有发送的询盘邮件
         List<String> emailList = new ArrayList<>();
         if ("ALL".equals(uid)) {
-            //获取子账户邮箱
-            List<String> subAccountIdList = masterSubAccountRelationService.getSubAccountIdByMaster(String.valueOf(adwebEnquiry.getUid()));
+            // 获取子账户邮箱
+            List<String> subAccountIdList =
+                    masterSubAccountRelationService.getSubAccountIdByMaster(
+                            String.valueOf(adwebEnquiry.getUid()));
             if (!subAccountIdList.isEmpty()) {
-                List<SysUser> principalEmailList = sysUserService.list(new LambdaQueryWrapper<SysUser>().in(SysUser::getId, subAccountIdList).eq(SysUser::getDelFlag, 0).isNotNull(SysUser::getEmail).ne(SysUser::getEmail, "").select(SysUser::getId, SysUser::getEmail));
+                List<SysUser> principalEmailList =
+                        sysUserService.list(
+                                new LambdaQueryWrapper<SysUser>()
+                                        .in(SysUser::getId, subAccountIdList)
+                                        .eq(SysUser::getDelFlag, 0)
+                                        .isNotNull(SysUser::getEmail)
+                                        .ne(SysUser::getEmail, "")
+                                        .select(SysUser::getId, SysUser::getEmail));
                 if (CollectionUtils.isNotEmpty(principalEmailList)) {
-                    emailList = principalEmailList.stream().map(SysUser::getEmail).collect(Collectors.toList());
+                    emailList =
+                            principalEmailList.stream()
+                                    .map(SysUser::getEmail)
+                                    .collect(Collectors.toList());
                 }
             }
         } else {
@@ -269,14 +276,21 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
         }
 
         if (CollectionUtils.isNotEmpty(emailList)) {
-            LambdaQueryWrapper<EnquiryEmailMessage> enquiryEmailMessageQueryWrapper = new LambdaQueryWrapper<>();
-            enquiryEmailMessageQueryWrapper.eq(EnquiryEmailMessage::getEnquiryId, adwebEnquiry.getId());
-            enquiryEmailMessageQueryWrapper.eq(EnquiryEmailMessage::getSiteCode, adwebEnquiry.getSiteCode());
+            LambdaQueryWrapper<EnquiryEmailMessage> enquiryEmailMessageQueryWrapper =
+                    new LambdaQueryWrapper<>();
+            enquiryEmailMessageQueryWrapper.eq(
+                    EnquiryEmailMessage::getEnquiryId, adwebEnquiry.getId());
+            enquiryEmailMessageQueryWrapper.eq(
+                    EnquiryEmailMessage::getSiteCode, adwebEnquiry.getSiteCode());
             enquiryEmailMessageQueryWrapper.in(EnquiryEmailMessage::getEmail, emailList);
-            List<EnquiryEmailMessage> enquiryEmailMessageList = list(enquiryEmailMessageQueryWrapper);
+            List<EnquiryEmailMessage> enquiryEmailMessageList =
+                    list(enquiryEmailMessageQueryWrapper);
 
             if (CollectionUtils.isNotEmpty(enquiryEmailMessageList)) {
-                List<String> oldEmailList = enquiryEmailMessageList.stream().map(EnquiryEmailMessage::getEmail).collect(Collectors.toList());
+                List<String> oldEmailList =
+                        enquiryEmailMessageList.stream()
+                                .map(EnquiryEmailMessage::getEmail)
+                                .collect(Collectors.toList());
                 List<String> noNeedEmailList = new ArrayList<>();
                 for (String email : emailList) {
                     if (oldEmailList.contains(email)) {
@@ -306,7 +320,9 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
                 if (result) {
                     try {
                         JedisUtil.lpush(redisKey, ObjectUtil.object2Bytes(adwebEnquiry.getId()));
-                        JedisUtil.publishMsg(EnquiryConstants.ENQUIRY_EMAIL_CHANNEL, EnquiryConstants.ENQUIRY_EMAIL);
+                        JedisUtil.publishMsg(
+                                EnquiryConstants.ENQUIRY_EMAIL_CHANNEL,
+                                EnquiryConstants.ENQUIRY_EMAIL);
                         return Result.OK();
                     } catch (Exception e) {
                         log.error("发送失败询盘id:" + adwebEnquiry.getId());
@@ -319,10 +335,7 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
         return Result.error("子账户邮箱没有配置,询盘邮件发送失败");
     }
 
-    /**
-     * 处理询盘发送信息
-     * wpform
-     */
+    /** 处理询盘发送信息 wpform */
     private List<EnquiryFormItem> dealWpformEnquiryForm(AdwebEnquiryForm adwebEnquiryForm) {
         String form = adwebEnquiryForm.getForm();
         Map<String, JSONObject> formObj = FastJsonUtil.parseObject(form, Map.class);
@@ -332,7 +345,8 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
             JSONObject formItem = formObj.get(key);
             EnquiryFormItem enquiryFormItem = new EnquiryFormItem();
             enquiryFormItem.setSort(Integer.parseInt(key));
-            if ("Country".equals(formItem.getString("name")) || "country".equals(formItem.getString("name"))) {
+            if ("Country".equals(formItem.getString("name"))
+                    || "country".equals(formItem.getString("name"))) {
                 countryFlag = false;
             }
             enquiryFormItem.setName(formItem.getString("name"));
@@ -352,7 +366,6 @@ public class EnquiryEmailMessageServiceImpl extends ServiceImpl<EnquiryEmailMess
     }
 }
 
-
 @Data
 class EnquiryFormItem {
 
@@ -361,5 +374,4 @@ class EnquiryFormItem {
     private String name;
 
     private String value;
-
 }

+ 5 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/enquiry/service/impl/SubUserEmailServiceImpl.java

@@ -1,7 +1,9 @@
 package org.jeecg.modules.adweb.enquiry.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import jakarta.annotation.Resource;
+
 import org.jeecg.modules.adweb.enquiry.entity.SubUserEmail;
 import org.jeecg.modules.adweb.enquiry.mapper.SubUserEmailMapper;
 import org.jeecg.modules.adweb.enquiry.service.ISubUserEmailService;
@@ -12,9 +14,9 @@ import org.springframework.stereotype.Service;
  * @Description
  */
 @Service
-public class SubUserEmailServiceImpl extends ServiceImpl<SubUserEmailMapper, SubUserEmail> implements ISubUserEmailService {
-    @Resource
-    private SubUserEmailMapper subUserEmailMapper;
+public class SubUserEmailServiceImpl extends ServiceImpl<SubUserEmailMapper, SubUserEmail>
+        implements ISubUserEmailService {
+    @Resource private SubUserEmailMapper subUserEmailMapper;
 
     @Override
     public boolean removeAll() {

+ 7 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/listener/EnquiryEmailSenderListener.java

@@ -2,10 +2,12 @@ package org.jeecg.modules.adweb.listener;
 
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
+
 import org.jeecg.modules.adweb.common.jedis.ObjectUtil;
 import org.jeecg.modules.adweb.common.util.JedisUtil;
 import org.jeecg.modules.adweb.enquiry.constant.EnquiryConstants;
 import org.jeecg.modules.adweb.enquiry.service.IEnquiryEmailMessageService;
+
 import redis.clients.jedis.JedisPubSub;
 
 @Setter
@@ -37,27 +39,24 @@ public class EnquiryEmailSenderListener extends JedisPubSub {
 
     // 初始化订阅时候的处理
     public void onSubscribe(String channel, int subscribedChannels) {
-        //log.info(channel + "=" + subscribedChannels);
+        // log.info(channel + "=" + subscribedChannels);
     }
 
     // 取消订阅时候的处理
     public void onUnsubscribe(String channel, int subscribedChannels) {
-        //log.info(channel + "=" + subscribedChannels);
+        // log.info(channel + "=" + subscribedChannels);
     }
 
     // 初始化按表达式的方式订阅时候的处理
     public void onPSubscribe(String pattern, int subscribedChannels) {
-        //log.info(pattern + "=" + subscribedChannels);
+        // log.info(pattern + "=" + subscribedChannels);
     }
 
     // 取消按表达式的方式订阅时候的处理
     public void onPUnsubscribe(String pattern, int subscribedChannels) {
-        //log.info(pattern + "=" + subscribedChannels);
+        // log.info(pattern + "=" + subscribedChannels);
     }
 
     // 取得按表达式的方式订阅的消息后的处理
-    public void onPMessage(String pattern, String channel, String message) {
-
-    }
-
+    public void onPMessage(String pattern, String channel, String message) {}
 }

Some files were not shown because too many files changed in this diff