Browse Source

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

wangfan 2 months ago
parent
commit
e58a84b2d2
57 changed files with 1591 additions and 1341 deletions
  1. 13 11
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/controller/AdwebProductController.java
  2. 16 32
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/dto/ProductDTO.java
  3. 24 16
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/service/impl/AdwebProductServiceImpl.java
  4. 45 37
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java
  5. 11 12
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsRankController.java
  6. 4 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsSerpController.java
  7. 10 5
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoMonthPdfController.java
  8. 134 127
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoPlanSubscriptionController.java
  9. 2 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/dto/AvesApiSearchKeywordsDTO.java
  10. 10 27
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/dto/ComprehensiveStatistics.java
  11. 9 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsRankService.java
  12. 4 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsSerpService.java
  13. 36 19
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsService.java
  14. 2 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoPlanSubscriptionService.java
  15. 7 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsRankServiceImpl.java
  16. 4 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsSerpServiceImpl.java
  17. 105 59
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsServiceImpl.java
  18. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoMonthPdfServiceImpl.java
  19. 51 23
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoPlanSubscriptionServiceImpl.java
  20. 7 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/vo/ServerTimeVO.java
  21. 13 11
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/controller/AdwebServerController.java
  22. 1 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/service/IAdwebServerService.java
  23. 3 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/service/impl/AdwebServerServiceImpl.java
  24. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/constant/WordPressConstants.java
  25. 53 43
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteController.java
  26. 59 37
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteManageController.java
  27. 18 22
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/WPSiteController.java
  28. 13 35
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/WordPressConfig.java
  29. 1 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteOrderPost.java
  30. 1 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteStepDTO.java
  31. 9 28
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/result/SiteBasicInfo.java
  32. 2 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebSiteService.java
  33. 4 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebUserWpsiteService.java
  34. 332 235
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteService.java
  35. 30 32
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteServiceCommon.java
  36. 67 43
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SiteManageService.java
  37. 3 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/Sohoeb2bOrderService.java
  38. 56 45
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java
  39. 21 13
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebUserWpsiteServiceImpl.java
  40. 51 27
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/SiteUserPermissionServiceImpl.java
  41. 40 42
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscribePlan/controller/SubscribePlanController.java
  42. 5 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscribePlan/service/impl/SubscribePlanServiceImpl.java
  43. 33 23
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/controller/SystemAdwebController.java
  44. 6 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/IMasterSubAccountRelationService.java
  45. 2 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/ISysExceptionService.java
  46. 2 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java
  47. 15 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/MasterSubAccountRelationServiceImpl.java
  48. 19 24
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/SysAdwebApiImpl.java
  49. 3 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/SysExceptionServiceImpl.java
  50. 136 135
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/theme/controller/AdwebThemeController.java
  51. 78 84
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/controller/AdwebUserCountryController.java
  52. 0 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/DistributeCountryParam.java
  53. 1 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/SubUser.java
  54. 1 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/TreeOption.java
  55. 3 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebUserCountryService.java
  56. 3 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebCountryServiceImpl.java
  57. 11 10
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebUserCountryServiceImpl.java

+ 13 - 11
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/controller/AdwebProductController.java

@@ -32,8 +32,7 @@ import java.util.Arrays;
 @RequestMapping("/adweb/adwebProduct")
 @Slf4j
 public class AdwebProductController extends JeecgController<AdwebProduct, IAdwebProductService> {
-    @Autowired
-    private IAdwebProductService adwebProductService;
+    @Autowired private IAdwebProductService adwebProductService;
 
     /**
      * 分页列表查询
@@ -44,14 +43,16 @@ public class AdwebProductController extends JeecgController<AdwebProduct, IAdweb
      * @param req
      * @return
      */
-    //@AutoLog(value = "wp站点产品-分页列表查询")
+    // @AutoLog(value = "wp站点产品-分页列表查询")
     @Operation(summary = "wp站点产品-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<AdwebProduct>> queryPageList(AdwebProduct adwebProduct,
-                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                     HttpServletRequest req) {
-        QueryWrapper<AdwebProduct> queryWrapper = QueryGenerator.initQueryWrapper(adwebProduct, req.getParameterMap());
+    public Result<IPage<AdwebProduct>> queryPageList(
+            AdwebProduct adwebProduct,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebProduct> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebProduct, req.getParameterMap());
         Page<AdwebProduct> page = new Page<AdwebProduct>(pageNo, pageSize);
         IPage<AdwebProduct> pageList = adwebProductService.page(page, queryWrapper);
         return Result.OK(pageList);
@@ -81,7 +82,9 @@ public class AdwebProductController extends JeecgController<AdwebProduct, IAdweb
     @AutoLog(value = "wp站点产品-编辑")
     @Operation(summary = "wp站点产品-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_product:edit')")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdwebProduct adwebProduct) {
         adwebProductService.updateById(adwebProduct);
         return Result.OK("编辑成功!");
@@ -123,7 +126,7 @@ public class AdwebProductController extends JeecgController<AdwebProduct, IAdweb
      * @param id
      * @return
      */
-    //@AutoLog(value = "wp站点产品-通过id查询")
+    // @AutoLog(value = "wp站点产品-通过id查询")
     @Operation(summary = "wp站点产品-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AdwebProduct> queryById(@RequestParam(name = "id", required = true) String id) {
@@ -158,5 +161,4 @@ public class AdwebProductController extends JeecgController<AdwebProduct, IAdweb
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebProduct.class);
     }
-
 }

+ 16 - 32
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/dto/ProductDTO.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.product.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+
 import lombok.Data;
 
 import java.util.Date;
@@ -10,56 +11,39 @@ import java.util.Date;
  */
 @Data
 public class ProductDTO {
-    /**
-     *
-     */
+    /** */
     private Integer productId;
 
-    /**
-     * adwebpro or woocommerce
-     */
+    /** adwebpro or woocommerce */
     private String productType;
 
-    /**
-     * add, edit, delete
-     */
+    /** add, edit, delete */
     private String actionType;
 
-    @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 requestTime;
-    /**
-     *
-     */
+
+    /** */
     private String productName;
 
-    /**
-     *
-     */
+    /** */
     private String productNameZh;
 
-    /**
-     *
-     */
+    /** */
     private String productImage;
 
-    /**
-     *
-     */
+    /** */
     private String[] productGalleryImage;
 
-    /**
-     *
-     */
+    /** */
     private String categoryName;
 
-    /**
-     *
-     */
+    /** */
     private String authorName;
 
-    /**
-     * siteHost
-     */
-
+    /** siteHost */
     private String siteHost;
 }

+ 24 - 16
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/product/service/impl/AdwebProductServiceImpl.java

@@ -4,11 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.codec.Base64Encoder;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
+
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.product.dto.ProductDTO;
 import org.jeecg.modules.adweb.product.entity.AdwebProduct;
@@ -32,7 +35,8 @@ import java.net.URL;
  */
 @Service
 @Slf4j
-public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, AdwebProduct> implements IAdwebProductService {
+public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, AdwebProduct>
+        implements IAdwebProductService {
 
     private final String SOHOEB2B_PUSH_PRODUCT_API = "https://admin.etcpu.com/api/product/product/";
 
@@ -52,7 +56,6 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
         }
 
         pushSohoeB2BProduct(productDTO, adwebSites);
-
     }
 
     private void handleUpdate(ProductDTO productDTO, AdwebSite adwebSites) {
@@ -79,7 +82,11 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
 
         try {
             boolean isUpdated = this.update(productQuery);
-            log.info("MQ消息删除产品成功, 网站:{}, 产品ID:{}, 是否更新成功:{}", adwebSites.getCode(), productDTO.getProductId(), isUpdated);
+            log.info(
+                    "MQ消息删除产品成功, 网站:{}, 产品ID:{}, 是否更新成功:{}",
+                    adwebSites.getCode(),
+                    productDTO.getProductId(),
+                    isUpdated);
         } catch (Exception e) {
             log.error("MQ消息删除产品失败:{}", e.getMessage(), e);
         }
@@ -122,8 +129,8 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
 
     /**
      * 异步向苏豪通推送产品消息队列
-     * <p>
-     * TODO 待确定,是否在V3产品中加入推送到苏豪是否成功的状态
+     *
+     * <p>TODO 待确定,是否在V3产品中加入推送到苏豪是否成功的状态
      */
     @Async
     protected void pushSohoeB2BProduct(ProductDTO productDTO, AdwebSite adwebSites) {
@@ -141,12 +148,14 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
 
             log.info("向苏豪推送产品消息,api地址:{}, 参数:{}", SOHOEB2B_PUSH_PRODUCT_API, params);
             try {
-                HttpResponse response = HttpRequest
-                        .post(SOHOEB2B_PUSH_PRODUCT_API)
-                        .header("Content-Type", "application/json")
-                        .header("Authorization", "Token f354b8a705c862abeae1f4f96dc55999fb9b3579")
-                        .body(params.toString())
-                        .execute(true);
+                HttpResponse response =
+                        HttpRequest.post(SOHOEB2B_PUSH_PRODUCT_API)
+                                .header("Content-Type", "application/json")
+                                .header(
+                                        "Authorization",
+                                        "Token f354b8a705c862abeae1f4f96dc55999fb9b3579")
+                                .body(params.toString())
+                                .execute(true);
 
                 if (response != null && response.getStatus() == 200) {
                     log.info("推送产品到苏豪成功:{}", response.body());
@@ -155,7 +164,6 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
                 }
             } catch (Exception e) {
                 log.info("推送产品到苏豪失败:{}", e.getMessage());
-
             }
         }
     }
@@ -173,13 +181,13 @@ public class AdwebProductServiceImpl extends ServiceImpl<AdwebProductMapper, Adw
             is = httpUrl.getInputStream();
 
             outStream = new ByteArrayOutputStream();
-            //创建一个Buffer字符串
+            // 创建一个Buffer字符串
             byte[] buffer = new byte[1024];
-            //每次读取的字符串长度,如果为-1,代表全部读取完毕
+            // 每次读取的字符串长度,如果为-1,代表全部读取完毕
             int len = 0;
-            //使用一个输入流从buffer里把数据读取出来
+            // 使用一个输入流从buffer里把数据读取出来
             while ((len = is.read(buffer)) != -1) {
-                //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
+                // 用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
                 outStream.write(buffer, 0, len);
             }
             // 对字节数组Base64编码

+ 45 - 37
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java

@@ -58,30 +58,27 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 
 /**
- * @Description: 关键词 @Author: jeecg-boot @Date: 2024-10-15 @Version: V1.0
+ * @Description: 关键词
+ * @Author: jeecg-boot
+ * @Date: 2024-10-15
+ * @Version: V1.0
  */
 @Tag(name = "关键词")
 @RestController
 @RequestMapping("/seo/seoKeywords")
 @Slf4j
 public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeywordsService> {
-    @Autowired
-    private ISeoKeywordsService seoKeywordsService;
+    @Autowired private ISeoKeywordsService seoKeywordsService;
 
-    @Autowired
-    ISeoKeywordsRankService seoKeywordsRankService;
+    @Autowired ISeoKeywordsRankService seoKeywordsRankService;
 
-    @Autowired
-    ISeoKeywordsRankService seoKpiStatisticsService;
+    @Autowired ISeoKeywordsRankService seoKpiStatisticsService;
 
-    @Autowired
-    private SysAdwebApi sysAdwebApi;
+    @Autowired private SysAdwebApi sysAdwebApi;
 
-    @Autowired
-    private IAdwebSiteService adwebSiteService;
+    @Autowired private IAdwebSiteService adwebSiteService;
 
-    @Autowired
-    private ISeoPlanSubscriptionService seoPlanSubscriptionService;
+    @Autowired private ISeoPlanSubscriptionService seoPlanSubscriptionService;
 
     @Value("${jeecg.path.upload}")
     private String uploadUrl;
@@ -110,14 +107,17 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         if (StringUtil.isNotEmpty(seoKeywords.getKeywords())) {
             queryWrapper.like(SeoKeywords::getKeywords, "%" + seoKeywords.getKeywords() + "%");
         }
-//        queryWrapper.eq("related_keyword_id", seoKeywords.getRelatedKeywordId());
-//        queryWrapper.eq("subscription_id", seoKeywords.getSubscriptionId());
+        //        queryWrapper.eq("related_keyword_id", seoKeywords.getRelatedKeywordId());
+        //        queryWrapper.eq("subscription_id", seoKeywords.getSubscriptionId());
         queryWrapper.eq(SeoKeywords::getSiteCode, seoKeywords.getSiteCode());
         if (seoKeywords.getKeywordType() != null) {
             queryWrapper.eq(SeoKeywords::getKeywordType, seoKeywords.getKeywordType());
         }
         queryWrapper.ne(SeoKeywords::getStatus, 0);
-        queryWrapper.orderByAsc(SeoKeywords::getPriority).orderByDesc(SeoKeywords::getOptimizeProcess).orderByDesc(SeoKeywords::getCreateTime);
+        queryWrapper
+                .orderByAsc(SeoKeywords::getPriority)
+                .orderByDesc(SeoKeywords::getOptimizeProcess)
+                .orderByDesc(SeoKeywords::getCreateTime);
         Page<SeoKeywords> page = new Page<SeoKeywords>(pageNo, pageSize);
         IPage<SeoKeywords> pageList = seoKeywordsService.page(page, queryWrapper);
         return Result.OK(pageList);
@@ -134,16 +134,16 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
     @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:add')")
     @PostMapping(value = "/add")
     public Result<String> add(@RequestBody SeoKeywords seoKeywords) {
-//        AdwebSite siteByCode = adwebSiteService.getSiteByCode(seoKeywords.getSiteCode());
-//        if (siteByCode == null) {
-//            return Result.error("未找到对应站点");
-//        }
+        //        AdwebSite siteByCode = adwebSiteService.getSiteByCode(seoKeywords.getSiteCode());
+        //        if (siteByCode == null) {
+        //            return Result.error("未找到对应站点");
+        //        }
         seoKeywords.setAppKey(AdwebConstant.APPKEY);
         // 根据siteCode获取站点域名
-//        String domain = siteByCode.getDomain();
-//        seoKeywords.setDomain(domain);
+        //        String domain = siteByCode.getDomain();
+        //        seoKeywords.setDomain(domain);
         seoKeywords.setStatus(1);
-//        seoKeywords.setLang("en");
+        //        seoKeywords.setLang("en");
         seoKeywordsService.save(seoKeywords);
         return Result.OK("添加成功!");
     }
@@ -223,9 +223,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         return super.exportXls(request, seoKeywords, SeoKeywords.class, "关键词");
     }
 
-    /**
-     * 关键词排名页面 - 列表数据
-     */
+    /** 关键词排名页面 - 列表数据 */
     @AutoLog(value = "营销推广-SEO-关键词排名统计查询接口")
     @RequestMapping(value = "/keywordList")
     public Result<?> queryRankInfoList(
@@ -234,9 +232,9 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
             @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
             HttpServletRequest req)
             throws Exception {
-//        if (sysBaseAPI.isNotOwnSite(avesApiSearchKeywordsDTO.getSiteCode())) {
-//            return Result.OK(new Page<>());
-//        }
+        //        if (sysBaseAPI.isNotOwnSite(avesApiSearchKeywordsDTO.getSiteCode())) {
+        //            return Result.OK(new Page<>());
+        //        }
         // 参数判断
         IPage<SeoKeywords> pageList = new Page<>();
         String siteCode = req.getParameter("siteCode");
@@ -365,7 +363,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                     "Content-Disposition",
                     "attachment;filename="
                             + new String(
-                            (fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
+                                    (fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
             out = response.getOutputStream();
             log.info("导出数据:" + list);
             writer.write(list, true);
@@ -404,7 +402,8 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         if (StringUtil.isEmpty(site.getDomain())) {
             return Result.error("站点域名未设置!");
         }
-        SeoPlanSubscription currentSeoAndSiteSubscription = seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(site.getId());
+        SeoPlanSubscription currentSeoAndSiteSubscription =
+                seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(site.getId());
 
         if (currentSeoAndSiteSubscription == null) {
             return Result.error("当前站点没有有效的订阅套餐!");
@@ -419,7 +418,10 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
             try {
                 SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
                 String formattedDate = dateFormat.format(now);
-                File realFile = new File(uploadUrl, formattedDate + RandomStringUtils.random(4, true, true) + ".xlsx");
+                File realFile =
+                        new File(
+                                uploadUrl,
+                                formattedDate + RandomStringUtils.random(4, true, true) + ".xlsx");
                 file.transferTo(realFile);
                 stream = new FileInputStream(realFile);
                 XSSFWorkbook workbook = new XSSFWorkbook(stream);
@@ -472,14 +474,15 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                     list.add(seoKeywords);
                 }
 
-                //新增关键词本身去重
+                // 新增关键词本身去重
                 Integer originalSize = list.size();
                 List<SeoKeywords> listNew = distinct(list);
                 // 去重
                 LambdaQueryWrapper<SeoKeywords> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.eq(SeoKeywords::getSiteCode, site.getCode());
                 queryWrapper.ne(SeoKeywords::getStatus, 0);
-                queryWrapper.eq(SeoKeywords::getSubscriptionId, currentSeoAndSiteSubscription.getId());
+                queryWrapper.eq(
+                        SeoKeywords::getSubscriptionId, currentSeoAndSiteSubscription.getId());
                 List<SeoKeywords> existingKeywordList = seoKeywordsService.list(queryWrapper);
                 if (CollectionUtil.isNotEmpty(existingKeywordList)) {
                     List<String> existingKeywords = new ArrayList<>();
@@ -500,10 +503,16 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 
                 String msg = "关键词导入成功!关键词个数:" + listNew.size();
                 if (originalSize > listNew.size()) {
-                    msg = "关键词导入成功!关键词个数:" + listNew.size() + ",重复关键词已去除!重复个数:" + (originalSize - listNew.size());
+                    msg =
+                            "关键词导入成功!关键词个数:"
+                                    + listNew.size()
+                                    + ",重复关键词已去除!重复个数:"
+                                    + (originalSize - listNew.size());
                 }
 
-                return seoKeywordsService.saveBatch(listNew) ? Result.OK(msg) : Result.error("关键词导入失败!");
+                return seoKeywordsService.saveBatch(listNew)
+                        ? Result.OK(msg)
+                        : Result.error("关键词导入失败!");
 
             } catch (Exception e) {
                 log.error(e.getMessage(), e);
@@ -519,7 +528,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         return Result.error("文件导入失败!");
     }
 
-
     /**
      * @param seoKeywords
      * @return

+ 11 - 12
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsRankController.java

@@ -17,7 +17,10 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Description: adweb_seo_keywords_rank @Author: jeecg-boot @Date: 2024-10-09 @Version: V1.0
+ * @Description: adweb_seo_keywords_rank
+ * @Author: jeecg-boot
+ * @Date: 2024-10-09
+ * @Version: V1.0
  */
 @Tag(name = "adweb_seo_keywords_rank")
 @RestController
@@ -33,27 +36,23 @@ public class SeoKeywordsRankController {
         return Result.OK(allSites);
     }
 
-    /**
-     * 根据 站点code 获取 站点的 订阅Id
-     */
+    /** 根据 站点code 获取 站点的 订阅Id */
     @GetMapping(value = "/getSubscriptionIdBySiteCode")
-    public Result<List<SeoPlanSubscription>> getSubscriptionIdBySiteCode(@RequestParam String siteCode) {
-        final List<SeoPlanSubscription> subscriptionIdBySiteCode = seoKeywordsRankService.getSubscriptionIdBySiteCode(siteCode);
+    public Result<List<SeoPlanSubscription>> getSubscriptionIdBySiteCode(
+            @RequestParam String siteCode) {
+        final List<SeoPlanSubscription> subscriptionIdBySiteCode =
+                seoKeywordsRankService.getSubscriptionIdBySiteCode(siteCode);
         return Result.OK(subscriptionIdBySiteCode);
     }
 
-    /**
-     * 获得综合统计信息
-     */
+    /** 获得综合统计信息 */
     @GetMapping(value = "/comprehensiveInfo")
     public Result<?> getComprehensiveInfo(@RequestParam String siteCode) throws ParseException {
         ComprehensiveStatistics statistics = seoKeywordsRankService.getComprehensiveInfo(siteCode);
         return Result.OK(statistics);
     }
 
-    /**
-     * 获取关键字排名信息
-     */
+    /** 获取关键字排名信息 */
     @GetMapping(value = "/getRankInfo")
     public Result<?> getRankInfo(@RequestParam("siteCode") String siteCode) throws ParseException {
         Map map = seoKeywordsRankService.getRankInfo(siteCode);

+ 4 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsSerpController.java

@@ -26,7 +26,10 @@ import org.springframework.web.servlet.ModelAndView;
 import java.util.Arrays;
 
 /**
- * @Description: SEO关键词搜索排名 @Author: jeecg-boot @Date: 2024-10-15 @Version: V1.0
+ * @Description: SEO关键词搜索排名
+ * @Author: jeecg-boot
+ * @Date: 2024-10-15
+ * @Version: V1.0
  */
 @Tag(name = "SEO关键词搜索排名")
 @RestController

+ 10 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoMonthPdfController.java

@@ -21,15 +21,18 @@ import org.springframework.web.bind.annotation.*;
 import java.util.*;
 
 /**
- * @Description: seo_month_pdf @Author: jeecg-boot @Date: 2023-07-06 @Version: V1.0
+ * @Description: seo_month_pdf
+ * @Author: jeecg-boot
+ * @Date: 2023-07-06
+ * @Version: V1.0
  */
 @RestController
 @RequestMapping("/seo/seoMonthPdf")
 @Slf4j
 public class SeoMonthPdfController {
-    
+
     @Autowired private SysAdwebApi sysAdwebApi;
-    
+
     @Autowired private ISysDictItemService sysDictItemService;
 
     @Autowired private ISeoMonthPdfService seoMonthPdfService;
@@ -82,9 +85,11 @@ public class SeoMonthPdfController {
     }
 
     @GetMapping("/getSeoKeywordsRank")
-    public Result<?> getSeoKeywordsRank(@RequestParam String siteCode, @RequestParam String exportMonth) {
+    public Result<?> getSeoKeywordsRank(
+            @RequestParam String siteCode, @RequestParam String exportMonth) {
         log.info("siteCode:{},exportMonth:{}", siteCode, exportMonth);
-        MonthPdfKeywordsRankVO seoKeywordsRank = seoMonthPdfService.getSeoKeywordsRank(siteCode, exportMonth);
+        MonthPdfKeywordsRankVO seoKeywordsRank =
+                seoMonthPdfService.getSeoKeywordsRank(siteCode, exportMonth);
         log.info("seoKeywordsRank:{}", seoKeywordsRank);
         return Result.OK(seoKeywordsRank);
     }

+ 134 - 127
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoPlanSubscriptionController.java

@@ -1,164 +1,171 @@
 package org.jeecg.modules.adweb.seo.controller;
 
-import java.util.Arrays;
+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.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
-import org.jeecg.modules.adweb.seo.service.ISeoPlanSubscriptionService;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
+import org.jeecg.modules.adweb.seo.service.ISeoPlanSubscriptionService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.springframework.security.access.prepost.PreAuthorize;
 
- /**
+import java.util.Arrays;
+
+/**
  * @Description: seo套餐订购
  * @Author: jeecg-boot
- * @Date:   2024-10-15
+ * @Date: 2024-10-15
  * @Version: V1.0
  */
-@Tag(name="seo套餐订购")
+@Tag(name = "seo套餐订购")
 @RestController
 @RequestMapping("/serp/seoPlanSubscription")
 @Slf4j
-public class SeoPlanSubscriptionController extends JeecgController<SeoPlanSubscription, ISeoPlanSubscriptionService> {
-	@Autowired
-	private ISeoPlanSubscriptionService seoPlanSubscriptionService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param seoPlanSubscription
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "seo套餐订购-分页列表查询")
-	@Operation(summary="seo套餐订购-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<SeoPlanSubscription>> queryPageList(SeoPlanSubscription seoPlanSubscription,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<SeoPlanSubscription> queryWrapper = QueryGenerator.initQueryWrapper(seoPlanSubscription, req.getParameterMap());
-		Page<SeoPlanSubscription> page = new Page<SeoPlanSubscription>(pageNo, pageSize);
-		IPage<SeoPlanSubscription> pageList = seoPlanSubscriptionService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param seoPlanSubscription
-	 * @return
-	 */
-	@AutoLog(value = "seo套餐订购-添加")
-	@Operation(summary="seo套餐订购-添加")
-	@PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:add')")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody SeoPlanSubscription seoPlanSubscription) {
-		seoPlanSubscriptionService.save(seoPlanSubscription);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param seoPlanSubscription
-	 * @return
-	 */
-	@AutoLog(value = "seo套餐订购-编辑")
-	@Operation(summary="seo套餐订购-编辑")
+public class SeoPlanSubscriptionController
+        extends JeecgController<SeoPlanSubscription, ISeoPlanSubscriptionService> {
+    @Autowired private ISeoPlanSubscriptionService seoPlanSubscriptionService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param seoPlanSubscription
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    // @AutoLog(value = "seo套餐订购-分页列表查询")
+    @Operation(summary = "seo套餐订购-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<SeoPlanSubscription>> queryPageList(
+            SeoPlanSubscription seoPlanSubscription,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<SeoPlanSubscription> queryWrapper =
+                QueryGenerator.initQueryWrapper(seoPlanSubscription, req.getParameterMap());
+        Page<SeoPlanSubscription> page = new Page<SeoPlanSubscription>(pageNo, pageSize);
+        IPage<SeoPlanSubscription> pageList = seoPlanSubscriptionService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param seoPlanSubscription
+     * @return
+     */
+    @AutoLog(value = "seo套餐订购-添加")
+    @Operation(summary = "seo套餐订购-添加")
+    @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:add')")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody SeoPlanSubscription seoPlanSubscription) {
+        seoPlanSubscriptionService.save(seoPlanSubscription);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param seoPlanSubscription
+     * @return
+     */
+    @AutoLog(value = "seo套餐订购-编辑")
+    @Operation(summary = "seo套餐订购-编辑")
     @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:edit')")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody SeoPlanSubscription seoPlanSubscription) {
-		seoPlanSubscriptionService.updateById(seoPlanSubscription);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "seo套餐订购-通过id删除")
-	@Operation(summary="seo套餐订购-通过id删除")
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody SeoPlanSubscription seoPlanSubscription) {
+        seoPlanSubscriptionService.updateById(seoPlanSubscription);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "seo套餐订购-通过id删除")
+    @Operation(summary = "seo套餐订购-通过id删除")
     @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:delete')")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		seoPlanSubscriptionService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "seo套餐订购-批量删除")
-	@Operation(summary="seo套餐订购-批量删除")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        seoPlanSubscriptionService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "seo套餐订购-批量删除")
+    @Operation(summary = "seo套餐订购-批量删除")
     @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:deleteBatch')")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.seoPlanSubscriptionService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "seo套餐订购-通过id查询")
-	@Operation(summary="seo套餐订购-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<SeoPlanSubscription> queryById(@RequestParam(name="id",required=true) String id) {
-		SeoPlanSubscription seoPlanSubscription = seoPlanSubscriptionService.getById(id);
-		if(seoPlanSubscription==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(seoPlanSubscription);
-	}
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.seoPlanSubscriptionService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param seoPlanSubscription
-    */
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    // @AutoLog(value = "seo套餐订购-通过id查询")
+    @Operation(summary = "seo套餐订购-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<SeoPlanSubscription> queryById(
+            @RequestParam(name = "id", required = true) String id) {
+        SeoPlanSubscription seoPlanSubscription = seoPlanSubscriptionService.getById(id);
+        if (seoPlanSubscription == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(seoPlanSubscription);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param seoPlanSubscription
+     */
     @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:exportXls')")
     @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, SeoPlanSubscription seoPlanSubscription) {
+    public ModelAndView exportXls(
+            HttpServletRequest request, SeoPlanSubscription seoPlanSubscription) {
         return super.exportXls(request, seoPlanSubscription, SeoPlanSubscription.class, "seo套餐订购");
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @PreAuthorize("@jps.requiresPermissions('serp:seo_plan_subscription:importExcel')")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, SeoPlanSubscription.class);
     }
-
 }

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/dto/AvesApiSearchKeywordsDTO.java

@@ -16,8 +16,10 @@ import java.util.Date;
 public class AvesApiSearchKeywordsDTO {
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date startTime;
+
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date endTime;
+
     private Integer keywordType;
     private String keywords;
     private Integer rankStart;

+ 10 - 27
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/dto/ComprehensiveStatistics.java

@@ -3,48 +3,31 @@ package org.jeecg.modules.adweb.seo.dto;
 import lombok.Data;
 
 /**
- * @author Zenas
- * 综合统计类
+ * @author Zenas 综合统计类
  */
-
 @Data
 public class ComprehensiveStatistics {
-    /**
-     * 套餐指定词
-     */
+    /** 套餐指定词 */
     private Integer planAppointKeywordNum;
 
-    /**
-     * 套餐长尾词
-     */
+    /** 套餐长尾词 */
     private Integer planLongTailKeywordNum;
 
-    /**
-     * 套餐外链数
-     */
+    /** 套餐外链数 */
     private Integer planOuterLinkNum;
 
-    /**
-     * 套餐文章数
-     */
+    /** 套餐文章数 */
     private Integer planArticleNum;
-    /**
-     * 指定词
-     */
+
+    /** 指定词 */
     private Integer appointKeywordNum;
 
-    /**
-     * 长尾词
-     */
+    /** 长尾词 */
     private Integer longTailKeywordNum;
 
-    /**
-     * 外链数
-     */
+    /** 外链数 */
     private Integer outerLinkNum;
 
-    /**
-     * 文章数
-     */
+    /** 文章数 */
     private Integer articleNum;
 }

+ 9 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsRankService.java

@@ -14,7 +14,7 @@ import java.util.Map;
 /**
  * @Description: seo_kpi_statistics
  * @Author: jeecg-boot
- * @Date:   2024-10-09
+ * @Date: 2024-10-09
  * @Version: V1.0
  */
 public interface ISeoKeywordsRankService {
@@ -25,10 +25,15 @@ public interface ISeoKeywordsRankService {
 
     Map getRankInfo(String siteCode) throws ParseException;
 
-    List<SeoRankInfoVO> getSeoRankInfo(String siteCode, String historyId)
-            throws ParseException;
+    List<SeoRankInfoVO> getSeoRankInfo(String siteCode, String historyId) throws ParseException;
 
-    void addRankInfoByIntervalTimeByType(List<SeoKeywords> keywordList, Integer keywordType, String siteCode, String historyId, List<String> dateList) throws Exception;
+    void addRankInfoByIntervalTimeByType(
+            List<SeoKeywords> keywordList,
+            Integer keywordType,
+            String siteCode,
+            String historyId,
+            List<String> dateList)
+            throws Exception;
 
     void setSizeColumn(Sheet sheet, int size);
 

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

@@ -1,13 +1,15 @@
 package org.jeecg.modules.adweb.seo.service;
 
-import org.jeecg.modules.adweb.seo.entity.SeoKeywordsSerp;
 import com.baomidou.mybatisplus.extension.service.IService;
+
+import org.jeecg.modules.adweb.seo.entity.SeoKeywordsSerp;
+
 import java.util.Date;
 
 /**
  * @Description: SEO关键词搜索排名
  * @Author: jeecg-boot
- * @Date:   2024-10-15
+ * @Date: 2024-10-15
  * @Version: V1.0
  */
 public interface ISeoKeywordsSerpService extends IService<SeoKeywordsSerp> {

+ 36 - 19
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsService.java

@@ -13,29 +13,46 @@ import java.util.List;
 /**
  * @Description: 关键词
  * @Author: jeecg-boot
- * @Date:   2024-10-15
+ * @Date: 2024-10-15
  * @Version: V1.0
  */
 public interface ISeoKeywordsService extends IService<SeoKeywords> {
 
     List<String> getKeywordsLastSevenDays(String userFlag, Integer keywordType, String historyId);
 
-    RankInfoVO getSeoRankInfo(String siteCode, String historyId, Integer rankStart, Integer rankEnd, String dateStr, String keywordType);
-
-    IPage<SeoKeywords> getKeywordList(IPage<SeoKeywords> page,
-                                      Integer rankStart,
-                                      Integer rankEnd,
-                                      String keyword,
-                                      String siteCode,
-                                      Integer keywordType,
-                                      boolean reachStandard,
-                                      String historyId,
-                                      String column,
-                                      String order,
-                                      String buttonColumn,
-                                      String buttonSort,
-                                      List<String> dateList) throws ParseException;
-
-    IPage<SeoKeywords> pageList(Page<SeoKeywords> page, String siteCode, String keywords, String subscriptionId, String lastSearchTime, String createTime, Integer keywordType,
-                                String column, String order, Integer keywordRank);
+    RankInfoVO getSeoRankInfo(
+            String siteCode,
+            String historyId,
+            Integer rankStart,
+            Integer rankEnd,
+            String dateStr,
+            String keywordType);
+
+    IPage<SeoKeywords> getKeywordList(
+            IPage<SeoKeywords> page,
+            Integer rankStart,
+            Integer rankEnd,
+            String keyword,
+            String siteCode,
+            Integer keywordType,
+            boolean reachStandard,
+            String historyId,
+            String column,
+            String order,
+            String buttonColumn,
+            String buttonSort,
+            List<String> dateList)
+            throws ParseException;
+
+    IPage<SeoKeywords> pageList(
+            Page<SeoKeywords> page,
+            String siteCode,
+            String keywords,
+            String subscriptionId,
+            String lastSearchTime,
+            String createTime,
+            Integer keywordType,
+            String column,
+            String order,
+            Integer keywordRank);
 }

+ 2 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoPlanSubscriptionService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.seo.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
@@ -32,8 +33,6 @@ public interface ISeoPlanSubscriptionService extends IService<SeoPlanSubscriptio
      */
     boolean addNewSubscription(SeoPlanSubscription seoPlanSubscription, SubscribePlan marketPlan);
 
-    /**
-     * 获取正在使用中的SEO套餐,如果没有使用中的SEO和建站套餐,则查询过期的SEO和建站套餐
-     */
+    /** 获取正在使用中的SEO套餐,如果没有使用中的SEO和建站套餐,则查询过期的SEO和建站套餐 */
     SeoPlanSubscription getCurrentSeoAndSiteSubscription(Integer siteId);
 }

+ 7 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsRankServiceImpl.java

@@ -2,8 +2,11 @@ package org.jeecg.modules.adweb.seo.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xkcoding.http.util.StringUtil;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
@@ -37,7 +40,10 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 /**
- * @Description: seo_kpi_statistics @Author: jeecg-boot @Date: 2024-10-09 @Version: V1.0
+ * @Description: seo_kpi_statistics
+ * @Author: jeecg-boot
+ * @Date: 2024-10-09
+ * @Version: V1.0
  */
 @Service
 @Slf4j

+ 4 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsSerpServiceImpl.java

@@ -19,7 +19,10 @@ import java.util.List;
 import java.util.Objects;
 
 /**
- * @Description: SEO关键词搜索排名 @Author: jeecg-boot @Date: 2024-10-15 @Version: V1.0
+ * @Description: SEO关键词搜索排名
+ * @Author: jeecg-boot
+ * @Date: 2024-10-15
+ * @Version: V1.0
  */
 @Slf4j
 @Service

+ 105 - 59
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsServiceImpl.java

@@ -1,64 +1,47 @@
 package org.jeecg.modules.adweb.seo.service.impl;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
-import com.xkcoding.http.util.StringUtil;
 import jakarta.annotation.Resource;
 
-import jakarta.servlet.http.HttpServletRequest;
 import org.apache.commons.collections4.CollectionUtils;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.adweb.common.constant.NumConstant;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
 import org.jeecg.modules.adweb.seo.mapper.SeoKeywordsMapper;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
 import org.jeecg.modules.adweb.seo.vo.RankInfoVO;
-import org.jeecg.modules.adweb.site.entity.AdwebSite;
-import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
 import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description: 关键词
  * @Author: jeecg-boot
- * @Date:   2024-10-15
+ * @Date: 2024-10-15
  * @Version: V1.0
  */
 @Service
-public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKeywords> implements ISeoKeywordsService {
+public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKeywords>
+        implements ISeoKeywordsService {
 
     @Resource private SeoKeywordsMapper seoKeywordsMapper;
 
     /**
      * 获取对应站点关键词最新七天时间
+     *
      * @param userFlag
      * @param keywordType
      * @param historyId
      * @return
      */
     @Override
-    public List<String> getKeywordsLastSevenDays(String userFlag, Integer keywordType, String historyId){
-        //获取对应站点最近七天
-        List<String> dateList = seoKeywordsMapper.getKeywordsLastSevenDays(userFlag, historyId,keywordType);
+    public List<String> getKeywordsLastSevenDays(
+            String userFlag, Integer keywordType, String historyId) {
+        // 获取对应站点最近七天
+        List<String> dateList =
+                seoKeywordsMapper.getKeywordsLastSevenDays(userFlag, historyId, keywordType);
         return dateList;
     }
 
@@ -69,29 +52,39 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
      * @return 关键词排名数量
      */
     @Override
-    public RankInfoVO getSeoRankInfo(String siteCode, String historyId, Integer rankStart, Integer rankEnd, String dateStr, String keywordType) {
-        //指定词
-        return seoKeywordsMapper.queryKeywordNumByRankRange(siteCode, historyId,rankStart,rankEnd,dateStr,keywordType);
+    public RankInfoVO getSeoRankInfo(
+            String siteCode,
+            String historyId,
+            Integer rankStart,
+            Integer rankEnd,
+            String dateStr,
+            String keywordType) {
+        // 指定词
+        return seoKeywordsMapper.queryKeywordNumByRankRange(
+                siteCode, historyId, rankStart, rankEnd, dateStr, keywordType);
     }
 
     /**
      * 获取关键词列表
+     *
      * @return 关键词列表
      */
     @Override
-    public IPage<SeoKeywords> getKeywordList(IPage<SeoKeywords> page,
-                                             Integer rankStart,
-                                             Integer rankEnd,
-                                             String keyword,
-                                             String siteCode,
-                                             Integer keywordType,
-                                             boolean reachStandard,
-                                             String historyId,
-                                             String column,
-                                             String order,
-                                             String buttonColumn,
-                                             String buttonSort,
-                                             List<String> dateList) throws ParseException {
+    public IPage<SeoKeywords> getKeywordList(
+            IPage<SeoKeywords> page,
+            Integer rankStart,
+            Integer rankEnd,
+            String keyword,
+            String siteCode,
+            Integer keywordType,
+            boolean reachStandard,
+            String historyId,
+            String column,
+            String order,
+            String buttonColumn,
+            String buttonSort,
+            List<String> dateList)
+            throws ParseException {
         if (reachStandard) {
             rankStart = 1;
             int standard = 10;
@@ -104,24 +97,38 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
         boolean isCustomer = true;
 
         String datesStr = "";
-        if(CollectionUtils.isEmpty(dateList)){
+        if (CollectionUtils.isEmpty(dateList)) {
             return null;
-        }else{
-            for(int i = 0; i < dateList.size(); i++){
-                if(i == dateList.size() - 1){
-                    datesStr +=  "'" + dateList.get(i) + "'";
-                }else{
-                    datesStr +=  "'" + dateList.get(i) + "'" + ",";
+        } else {
+            for (int i = 0; i < dateList.size(); i++) {
+                if (i == dateList.size() - 1) {
+                    datesStr += "'" + dateList.get(i) + "'";
+                } else {
+                    datesStr += "'" + dateList.get(i) + "'" + ",";
                 }
             }
             datesStr = "(" + datesStr + ")";
         }
 
-        return seoKeywordsMapper.getKeywordList(page, rankStart, rankEnd, isCustomer, keyword, siteCode, keywordType, datesStr, historyId,column,order,buttonColumn,buttonSort);
+        return seoKeywordsMapper.getKeywordList(
+                page,
+                rankStart,
+                rankEnd,
+                isCustomer,
+                keyword,
+                siteCode,
+                keywordType,
+                datesStr,
+                historyId,
+                column,
+                order,
+                buttonColumn,
+                buttonSort);
     }
 
     /**
      * 关键词管理列表数据
+     *
      * @param page
      * @param siteCode
      * @param keywords
@@ -135,19 +142,58 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
      * @return
      */
     @Override
-    public IPage<SeoKeywords> pageList(Page<SeoKeywords> page, String siteCode, String keywords, String historyId, String lastSearchTime, String createTime, Integer keywordType,
-                                       String column, String order, Integer keywordRank){
-        if(column.equals("createTime")){
+    public IPage<SeoKeywords> pageList(
+            Page<SeoKeywords> page,
+            String siteCode,
+            String keywords,
+            String historyId,
+            String lastSearchTime,
+            String createTime,
+            Integer keywordType,
+            String column,
+            String order,
+            Integer keywordRank) {
+        if (column.equals("createTime")) {
             column = "create_time";
-            return seoKeywordsMapper.getPageListByCreateTime(page,siteCode,keywords,historyId,lastSearchTime,createTime,keywordType,column,order,keywordRank);
-        }else if(column.equals("lastSearchTime")){
+            return seoKeywordsMapper.getPageListByCreateTime(
+                    page,
+                    siteCode,
+                    keywords,
+                    historyId,
+                    lastSearchTime,
+                    createTime,
+                    keywordType,
+                    column,
+                    order,
+                    keywordRank);
+        } else if (column.equals("lastSearchTime")) {
             column = "last_search_time";
-            return seoKeywordsMapper.getPageListByCreateTime(page,siteCode,keywords,historyId,lastSearchTime,createTime,keywordType,column,order,keywordRank);
-        }else if (column.equals("lastRank")){
+            return seoKeywordsMapper.getPageListByCreateTime(
+                    page,
+                    siteCode,
+                    keywords,
+                    historyId,
+                    lastSearchTime,
+                    createTime,
+                    keywordType,
+                    column,
+                    order,
+                    keywordRank);
+        } else if (column.equals("lastRank")) {
             column = "last_rank";
-        } else if (column.equals("keywords")){
+        } else if (column.equals("keywords")) {
             column = "keywords";
         }
-        return seoKeywordsMapper.getPageList(page,siteCode,keywords,historyId,lastSearchTime,createTime,keywordType,column,order,keywordRank);
+        return seoKeywordsMapper.getPageList(
+                page,
+                siteCode,
+                keywords,
+                historyId,
+                lastSearchTime,
+                createTime,
+                keywordType,
+                column,
+                order,
+                keywordRank);
     }
 }

+ 1 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoMonthPdfServiceImpl.java

@@ -25,7 +25,7 @@ public class SeoMonthPdfServiceImpl implements ISeoMonthPdfService {
 
     @Override
     public MonthPdfKeywordsRankVO getSeoKeywordsRank(String siteCode, String exportMonth) {
-//        String lastDayOfMonth = getLastDayOfMonth(exportMonth);
+        //        String lastDayOfMonth = getLastDayOfMonth(exportMonth);
         String lastDayOfMonth = "2024-11-25";
         List<KeywordsInfoVO> seoKeywordsRank =
                 seoKeywordsSerpMapper.getSeoKeywordsRank(siteCode, lastDayOfMonth, 1, 50);

+ 51 - 23
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoPlanSubscriptionServiceImpl.java

@@ -2,9 +2,12 @@ package org.jeecg.modules.adweb.seo.service.impl;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUnit;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import jakarta.annotation.Resource;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
@@ -26,13 +29,15 @@ import java.util.List;
  * @Version: V1.0
  */
 @Service
-public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscriptionMapper, SeoPlanSubscription> implements ISeoPlanSubscriptionService {
+public class SeoPlanSubscriptionServiceImpl
+        extends ServiceImpl<SeoPlanSubscriptionMapper, SeoPlanSubscription>
+        implements ISeoPlanSubscriptionService {
 
-    @Resource
-    private ISubscribePlanService subscribePlanService;
+    @Resource private ISubscribePlanService subscribePlanService;
 
     @Override
-    public Result<?> addSeoPlanSubscription(SeoPlanSubscription seoPurchaseHistory, LoginUser sysUser) {
+    public Result<?> addSeoPlanSubscription(
+            SeoPlanSubscription seoPurchaseHistory, LoginUser sysUser) {
         boolean result = false;
 
         SubscribePlan marketPlan = subscribePlanService.getById(seoPurchaseHistory.getPlanId());
@@ -46,7 +51,7 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
             seoPurchaseHistory.setCreateBy("system_auto");
         }
 
-        //如果不是续费客户(就是新客户)的话,直接入库,套餐开启时间即是现在
+        // 如果不是续费客户(就是新客户)的话,直接入库,套餐开启时间即是现在
         if (seoPurchaseHistory.getIsRenew() == null || seoPurchaseHistory.getIsRenew() == 0) {
             LambdaQueryWrapper<SeoPlanSubscription> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(SeoPlanSubscription::getSiteId, seoPurchaseHistory.getSiteId());
@@ -56,8 +61,8 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
                 return Result.error("站点存在使用中套餐,请到期后绑定!");
             }
             result = this.addNewSubscription(seoPurchaseHistory, marketPlan);
-        } else {//续费
-            //判断是否有正在使用的套餐,如果没有,新建status为1的套餐
+        } else { // 续费
+            // 判断是否有正在使用的套餐,如果没有,新建status为1的套餐
             LambdaQueryWrapper<SeoPlanSubscription> oldQueryWrapper = new LambdaQueryWrapper<>();
             oldQueryWrapper.eq(SeoPlanSubscription::getSiteId, seoPurchaseHistory.getSiteId());
             oldQueryWrapper.eq(SeoPlanSubscription::getStatus, 1);
@@ -75,12 +80,26 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
 
                 if (seoPurchaseHistory.getIsCustom() == 0) {
                     // ->不是自定义服务开启时间 需找到多个套餐服务结束时间最大的那个
-                    //此站点所有对应的套餐的最大服务结束时间
-                    SeoPlanSubscription history = this.getOne(new LambdaQueryWrapper<SeoPlanSubscription>()
-                            .eq(SeoPlanSubscription::getSiteId, seoPurchaseHistory.getSiteId())
-                            .and(wrapper -> wrapper.eq(SeoPlanSubscription::getStatus, 1)
-                                    .or().eq(SeoPlanSubscription::getStatus, 2))
-                            .orderByDesc(SeoPlanSubscription::getServiceEndTime).last("limit 1"));
+                    // 此站点所有对应的套餐的最大服务结束时间
+                    SeoPlanSubscription history =
+                            this.getOne(
+                                    new LambdaQueryWrapper<SeoPlanSubscription>()
+                                            .eq(
+                                                    SeoPlanSubscription::getSiteId,
+                                                    seoPurchaseHistory.getSiteId())
+                                            .and(
+                                                    wrapper ->
+                                                            wrapper.eq(
+                                                                            SeoPlanSubscription
+                                                                                    ::getStatus,
+                                                                            1)
+                                                                    .or()
+                                                                    .eq(
+                                                                            SeoPlanSubscription
+                                                                                    ::getStatus,
+                                                                            2))
+                                            .orderByDesc(SeoPlanSubscription::getServiceEndTime)
+                                            .last("limit 1"));
                     Date maxEndTime = null;
                     if (history == null || history.getServiceEndTime() == null) {
                         maxEndTime = new Date();
@@ -96,18 +115,23 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
                     seoPurchaseHistory.setPlanType(marketPlan.getMarketType());
                     seoPurchaseHistory.setServiceMonth(marketPlan.getServiceTime());
                     result = this.save(seoPurchaseHistory);
-                } else if (seoPurchaseHistory.getIsCustom() == 1) {//是自定义套餐开启时间
+                } else if (seoPurchaseHistory.getIsCustom() == 1) { // 是自定义套餐开启时间
                     seoPurchaseHistory.setCreateTime(new Date());
                     seoPurchaseHistory.setPlanName(marketPlan.getPlanName());
                     seoPurchaseHistory.setPlanCode(marketPlan.getPlanCode());
                     seoPurchaseHistory.setPlanPrice(marketPlan.getPrice());
                     seoPurchaseHistory.setPlanType(marketPlan.getMarketType());
                     DateTime today = cn.hutool.core.date.DateUtil.date();
-                    long betweenTime = cn.hutool.core.date.DateUtil.between(seoPurchaseHistory.getPlanStartTime(), today, DateUnit.DAY, false);
+                    long betweenTime =
+                            cn.hutool.core.date.DateUtil.between(
+                                    seoPurchaseHistory.getPlanStartTime(),
+                                    today,
+                                    DateUnit.DAY,
+                                    false);
                     if (betweenTime > 0) {
                         return Result.error("自定义时间请选择于今天之后!");
                     } else {
-                        //如果有正在使用的套餐,才能设置为2,否则设置为1
+                        // 如果有正在使用的套餐,才能设置为2,否则设置为1
                         seoPurchaseHistory.setStatus(2);
                     }
                     seoPurchaseHistory.setServiceMonth(marketPlan.getServiceTime());
@@ -125,13 +149,14 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
     }
 
     @Override
-    public boolean addNewSubscription(SeoPlanSubscription seoPurchaseHistory, SubscribePlan marketPlan) {
+    public boolean addNewSubscription(
+            SeoPlanSubscription seoPurchaseHistory, SubscribePlan marketPlan) {
         boolean result = false;
         try {
             Date startTime = new Date();
             seoPurchaseHistory.setCreateTime(startTime);
             seoPurchaseHistory.setPlanStartTime(startTime);
-            seoPurchaseHistory.setStatus(1);//使用中
+            seoPurchaseHistory.setStatus(1); // 使用中
             seoPurchaseHistory.setPlanName(marketPlan.getPlanName());
             seoPurchaseHistory.setPlanCode(marketPlan.getPlanCode());
             seoPurchaseHistory.setPlanPrice(marketPlan.getPrice());
@@ -144,16 +169,19 @@ public class SeoPlanSubscriptionServiceImpl extends ServiceImpl<SeoPlanSubscript
         return result;
     }
 
-    /**
-     * 获取正在使用中的SEO套餐,如果没有使用中的SEO和建站套餐,则查询过期的SEO和建站套餐
-     */
+    /** 获取正在使用中的SEO套餐,如果没有使用中的SEO和建站套餐,则查询过期的SEO和建站套餐 */
     @Override
     public SeoPlanSubscription getCurrentSeoAndSiteSubscription(Integer siteId) {
         LambdaQueryWrapper<SeoPlanSubscription> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SeoPlanSubscription::getSiteId, siteId);
-        queryWrapper.and(wrapper -> wrapper.eq(SeoPlanSubscription::getPlanType, "SEO").or().eq(SeoPlanSubscription::getPlanType, "STATIONCONSTRUCTION"));
+        queryWrapper.and(
+                wrapper ->
+                        wrapper.eq(SeoPlanSubscription::getPlanType, "SEO")
+                                .or()
+                                .eq(SeoPlanSubscription::getPlanType, "STATIONCONSTRUCTION"));
         queryWrapper.in(SeoPlanSubscription::getStatus, Arrays.asList(1, -1));
-        queryWrapper.orderByDesc(SeoPlanSubscription::getStatus, SeoPlanSubscription::getCreateTime);
+        queryWrapper.orderByDesc(
+                SeoPlanSubscription::getStatus, SeoPlanSubscription::getCreateTime);
         List<SeoPlanSubscription> histories = this.list(queryWrapper);
         if (CollectionUtils.isNotEmpty(histories)) {
             return histories.get(0);

+ 7 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/vo/ServerTimeVO.java

@@ -6,12 +6,12 @@ import java.util.Date;
 
 @Data
 public class ServerTimeVO {
-	private String reachStandardTime;
-	private int reachStandardDays;
-	private int remainServerDays;
+    private String reachStandardTime;
+    private int reachStandardDays;
+    private int remainServerDays;
 
-	// 是否自定义结束日期 0:否 1:是
-	private int planServiceEndStatus;
-	//套餐开启时间
-	private Date planStartTime;
+    // 是否自定义结束日期 0:否 1:是
+    private int planServiceEndStatus;
+    // 套餐开启时间
+    private Date planStartTime;
 }

+ 13 - 11
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/controller/AdwebServerController.java

@@ -32,8 +32,7 @@ import java.util.Arrays;
 @RequestMapping("/adweb/adwebServer")
 @Slf4j
 public class AdwebServerController extends JeecgController<AdwebServer, IAdwebServerService> {
-    @Autowired
-    private IAdwebServerService adwebServerService;
+    @Autowired private IAdwebServerService adwebServerService;
 
     /**
      * 分页列表查询
@@ -44,14 +43,16 @@ public class AdwebServerController extends JeecgController<AdwebServer, IAdwebSe
      * @param req
      * @return
      */
-    //@AutoLog(value = "wp站点服务器配置信息-分页列表查询")
+    // @AutoLog(value = "wp站点服务器配置信息-分页列表查询")
     @Operation(summary = "wp站点服务器配置信息-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<AdwebServer>> queryPageList(AdwebServer adwebServer,
-                                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                    HttpServletRequest req) {
-        QueryWrapper<AdwebServer> queryWrapper = QueryGenerator.initQueryWrapper(adwebServer, req.getParameterMap());
+    public Result<IPage<AdwebServer>> queryPageList(
+            AdwebServer adwebServer,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebServer> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebServer, req.getParameterMap());
         Page<AdwebServer> page = new Page<AdwebServer>(pageNo, pageSize);
         IPage<AdwebServer> pageList = adwebServerService.page(page, queryWrapper);
         return Result.OK(pageList);
@@ -81,7 +82,9 @@ public class AdwebServerController extends JeecgController<AdwebServer, IAdwebSe
     @AutoLog(value = "wp站点服务器配置信息-编辑")
     @Operation(summary = "wp站点服务器配置信息-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_server:edit')")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdwebServer adwebServer) {
         adwebServerService.updateById(adwebServer);
         return Result.OK("编辑成功!");
@@ -123,7 +126,7 @@ public class AdwebServerController extends JeecgController<AdwebServer, IAdwebSe
      * @param id
      * @return
      */
-    //@AutoLog(value = "wp站点服务器配置信息-通过id查询")
+    // @AutoLog(value = "wp站点服务器配置信息-通过id查询")
     @Operation(summary = "wp站点服务器配置信息-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AdwebServer> queryById(@RequestParam(name = "id", required = true) String id) {
@@ -158,5 +161,4 @@ public class AdwebServerController extends JeecgController<AdwebServer, IAdwebSe
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebServer.class);
     }
-
 }

+ 1 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/service/IAdwebServerService.java

@@ -9,6 +9,4 @@ import org.jeecg.modules.adweb.server.entity.AdwebServer;
  * @Date: 2025-01-02
  * @Version: V1.0
  */
-public interface IAdwebServerService extends IService<AdwebServer> {
-
-}
+public interface IAdwebServerService extends IService<AdwebServer> {}

+ 3 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/server/service/impl/AdwebServerServiceImpl.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.server.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import org.jeecg.modules.adweb.server.entity.AdwebServer;
 import org.jeecg.modules.adweb.server.mapper.AdwebServerMapper;
 import org.jeecg.modules.adweb.server.service.IAdwebServerService;
@@ -13,6 +14,5 @@ import org.springframework.stereotype.Service;
  * @Version: V1.0
  */
 @Service
-public class AdwebServerServiceImpl extends ServiceImpl<AdwebServerMapper, AdwebServer> implements IAdwebServerService {
-
-}
+public class AdwebServerServiceImpl extends ServiceImpl<AdwebServerMapper, AdwebServer>
+        implements IAdwebServerService {}

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

@@ -9,6 +9,6 @@ public class WordPressConstants {
     // dev-ci2
     public static final String DEV_CI2 = "52.83.132.56";
 
-    //prod-server-wp
+    // prod-server-wp
     public static final String PROD_WP_SERVER_IP = "44.227.32.118";
 }

+ 53 - 43
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteController.java

@@ -6,13 +6,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 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.netty.util.internal.StringUtil;
 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;
@@ -53,29 +57,21 @@ import java.util.Map;
 @Slf4j
 public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteService> {
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private ISitePermissionService sitePermissionService;
+    @Resource private ISitePermissionService sitePermissionService;
 
-    @Resource
-    private SeoPlanSubscriptionMapper seoPlanSubscriptionMapper;
+    @Resource private SeoPlanSubscriptionMapper seoPlanSubscriptionMapper;
 
-    @Resource
-    private SelfWebSiteService selfWebSiteService;
+    @Resource private SelfWebSiteService selfWebSiteService;
 
-    @Resource
-    private BaseCommonService baseCommonService;
+    @Resource private BaseCommonService baseCommonService;
 
-    @Resource
-    private Sohoeb2bOrderService sohoeb2bOrderService;
+    @Resource private Sohoeb2bOrderService sohoeb2bOrderService;
 
     /**
      * 分页列表查询
@@ -86,14 +82,16 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
      * @param req
      * @return
      */
-    //@AutoLog(value = "adweb站点配置表单-分页列表查询")
+    // @AutoLog(value = "adweb站点配置表单-分页列表查询")
     @Operation(summary = "adweb站点配置表单-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<AdwebSite>> queryPageList(AdwebSite adwebSite,
-                                                  @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                  HttpServletRequest req) {
-        QueryWrapper<AdwebSite> queryWrapper = QueryGenerator.initQueryWrapper(adwebSite, req.getParameterMap());
+    public Result<IPage<AdwebSite>> queryPageList(
+            AdwebSite adwebSite,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebSite> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebSite, req.getParameterMap());
 
         Page<AdwebSite> page = new Page<AdwebSite>(pageNo, pageSize);
 
@@ -105,8 +103,11 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         // 给站点增加营销计划信息
         List<AdwebSite> siteList = pageList.getRecords();
         for (AdwebSite site : siteList) {
-            Map<String, String> marketPlan = seoPlanSubscriptionMapper.getSubscribePlanBySiteId(site.getId());
-            JSONObject object = FastJsonUtil.parseObject(FastJsonUtil.toJSONString(marketPlan), JSONObject.class);
+            Map<String, String> marketPlan =
+                    seoPlanSubscriptionMapper.getSubscribePlanBySiteId(site.getId());
+            JSONObject object =
+                    FastJsonUtil.parseObject(
+                            FastJsonUtil.toJSONString(marketPlan), JSONObject.class);
             site.setSubscribePlan(object);
 
             // 设置建站进度
@@ -127,7 +128,6 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
             if (sohoeb2bOrder != null) {
                 adwebSite.setOrderUrl(sohoeb2bOrder.getOrderUrl());
                 adwebSite.setOrderUrlID(String.valueOf(sohoeb2bOrder.getId()));
-
             }
         }
 
@@ -158,7 +158,9 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
     @AutoLog(value = "adweb站点配置表单-编辑")
     @Operation(summary = "adweb站点配置表单-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_site:edit')")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdwebSite adwebSite) {
         adwebSiteService.updateById(adwebSite);
         return Result.OK("编辑成功!");
@@ -178,7 +180,8 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         AdwebSite adwebSite = adwebSiteService.getById(id);
 
         // 删除站点权限
-        LambdaQueryWrapper<AdwebSitePermission> queryWrapper = new LambdaQueryWrapper<AdwebSitePermission>();
+        LambdaQueryWrapper<AdwebSitePermission> queryWrapper =
+                new LambdaQueryWrapper<AdwebSitePermission>();
         queryWrapper.eq(AdwebSitePermission::getSiteCode, adwebSite.getCode());
         sitePermissionService.remove(queryWrapper);
 
@@ -190,7 +193,10 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         adwebSiteService.removeById(id);
 
         // 记录删除站点操作日志
-        baseCommonService.addLog("站点" + adwebSite.getDomain() + "资源已被删除,将在服务器自动备份15天,之后将自动清空:", CommonConstant.LOG_TYPE_2, 3);
+        baseCommonService.addLog(
+                "站点" + adwebSite.getDomain() + "资源已被删除,将在服务器自动备份15天,之后将自动清空:",
+                CommonConstant.LOG_TYPE_2,
+                3);
 
         return Result.ok("该站点资源已经不存在, 站点信息将从系统中删除!");
     }
@@ -216,7 +222,7 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
      * @param id
      * @return
      */
-    //@AutoLog(value = "adweb站点配置表单-通过id查询")
+    // @AutoLog(value = "adweb站点配置表单-通过id查询")
     @Operation(summary = "adweb站点配置表单-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AdwebSite> queryById(@RequestParam(name = "id", required = true) String id) {
@@ -252,18 +258,23 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         return super.importExcel(request, response, AdwebSite.class);
     }
 
-    /**
-     * 根据uid获取所属一级站点信息
-     * "id", "name", "code", "domain","domain_dev","status"
-     */
+    /** 根据uid获取所属一级站点信息 "id", "name", "code", "domain","domain_dev","status" */
     @GetMapping("/getSiteListByUid")
     public Result<?> getAllSites() {
         LambdaQueryWrapper<AdwebSite> queryWrapper = new LambdaQueryWrapper<>();
         // 处理多租户过滤站点列表
         processTenantFilter(queryWrapper);
 
-        queryWrapper.ne(AdwebSite::getStatus, AdwebConstant.SITE_DEL).isNull(AdwebSite::getParentGroupCode);
-        queryWrapper.select(AdwebSite::getId, AdwebSite::getName, AdwebSite::getCode, AdwebSite::getDomain, AdwebSite::getDomainDev, AdwebSite::getStatus);
+        queryWrapper
+                .ne(AdwebSite::getStatus, AdwebConstant.SITE_DEL)
+                .isNull(AdwebSite::getParentGroupCode);
+        queryWrapper.select(
+                AdwebSite::getId,
+                AdwebSite::getName,
+                AdwebSite::getCode,
+                AdwebSite::getDomain,
+                AdwebSite::getDomainDev,
+                AdwebSite::getStatus);
         List<AdwebSite> siteList = adwebSiteService.list(queryWrapper);
 
         // 处理域名,全部改为绝对路径
@@ -285,20 +296,19 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
     /**
      * 更新site表现阶段
      *
-     * @param siteStepDTO
-     * @Author: 陈培庆
-     * @Date: 2024/11/26
+     * @param siteStepDTO @Author: 陈培庆 @Date: 2024/11/26
      */
     @RequestMapping(value = "/finishOrRollbackStep")
     public Result<?> finishOrRollbackStep(SiteStepDTO siteStepDTO) {
 
-
         // 更新流程步骤和状态
         LambdaUpdateWrapper<AdwebSite> siteUpdateWrapper = new LambdaUpdateWrapper<>();
         siteUpdateWrapper.eq(AdwebSite::getCode, siteStepDTO.getSiteCode());
 
-        //建站流程
-        siteUpdateWrapper.set(AdwebSite::getSiteCurrentStep, siteStepDTO.getCurrentStep()).set(AdwebSite::getSiteFlowStatus, siteStepDTO.getStepFlowId());
+        // 建站流程
+        siteUpdateWrapper
+                .set(AdwebSite::getSiteCurrentStep, siteStepDTO.getCurrentStep())
+                .set(AdwebSite::getSiteFlowStatus, siteStepDTO.getStepFlowId());
 
         adwebSiteService.update(siteUpdateWrapper);
         return Result.OK();
@@ -311,12 +321,12 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
 
         } else if (sysAdwebApi.isChannelAdmin()) {
             List<String> channelGroupUids = sysAdwebApi.getChannelGroupUids();
-            List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+            List<String> codeList =
+                    siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
             queryWrapper.in(AdwebSite::getCode, codeList);
         } else {
             List<String> codeList = siteUserPermissionService.getSiteCodeList(sysUser.getId());
             queryWrapper.in(AdwebSite::getCode, codeList);
         }
     }
-
 }

+ 59 - 37
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteManageController.java

@@ -1,13 +1,17 @@
 package org.jeecg.modules.adweb.site.controller;
 
-
 import cn.hutool.core.bean.BeanUtil;
+
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -48,27 +52,19 @@ import java.util.stream.Collectors;
 @Slf4j
 public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdwebSiteService> {
 
-    @Lazy
-    @Resource
-    private IAdwebSiteService adwebSiteManageService;
+    @Lazy @Resource private IAdwebSiteService adwebSiteManageService;
 
-    @Resource
-    private CommonMapper commonMapper;
+    @Resource private CommonMapper commonMapper;
 
-    @Resource
-    private SiteManageService siteManageService;
+    @Resource private SiteManageService siteManageService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private ISysUserTenantService sysUserTenantService;
+    @Resource private ISysUserTenantService sysUserTenantService;
 
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private Sohoeb2bOrderService sohoeb2bOrderService;
+    @Resource private Sohoeb2bOrderService sohoeb2bOrderService;
 
     /**
      * 查询wordpress站点配置
@@ -83,7 +79,8 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
             return Result.noauth("您没有权限访问该站点");
         }
 
-        WordPressConfig config = this.adwebSiteManageService.queryWordPressConfig(wordPressConfig.getSiteCode());
+        WordPressConfig config =
+                this.adwebSiteManageService.queryWordPressConfig(wordPressConfig.getSiteCode());
         return Result.OK(config);
     }
 
@@ -101,7 +98,8 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
                 queryWrapper.in(SysUserTenant::getTenantId, user.getRelTenantIds());
 
                 // 查询出和登录用户具有相同租户的userID
-                List<SysUserTenant> sysUserTenants = sysUserTenantService.getBaseMapper().selectList(queryWrapper);
+                List<SysUserTenant> sysUserTenants =
+                        sysUserTenantService.getBaseMapper().selectList(queryWrapper);
                 List<String> userIds;
 
                 if (sysUserTenants != null) {
@@ -112,7 +110,10 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
 
                 // 对查出的adwebVIP 用户进行租户过滤, 并将自己加入到返回结果中
                 List<SysUser> filterUserList = new ArrayList<>();
-                filterUserList = userList.stream().filter(sysUser -> userIds.contains(sysUser.getId())).collect(Collectors.toList());
+                filterUserList =
+                        userList.stream()
+                                .filter(sysUser -> userIds.contains(sysUser.getId()))
+                                .collect(Collectors.toList());
                 SysUser currentUser = new SysUser();
                 BeanUtil.copyProperties(user, currentUser);
                 filterUserList.add(currentUser);
@@ -120,18 +121,17 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
                 return Result.ok(filterUserList);
             } else {
                 // 对查出的 adwebVIP 用户进行租户过滤
-                return Result.ok(userList.stream().filter(sysUser -> sysUser.getId().equals(user.getId())).collect(Collectors.toList()));
+                return Result.ok(
+                        userList.stream()
+                                .filter(sysUser -> sysUser.getId().equals(user.getId()))
+                                .collect(Collectors.toList()));
             }
-
         }
 
-
         return Result.OK(userList);
     }
 
-    /**
-     * 获得综合统计信息
-     */
+    /** 获得综合统计信息 */
     @AutoLog(value = "首页仪表盘综合统计信息")
     @GetMapping(value = "/siteBasicInfo")
     public Result<?> getSiteBasicInfo(String siteCode) {
@@ -144,13 +144,14 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
     }
 
     @PostMapping(value = "/setEnquiryEmailListBySiteCode")
-    public Result<?> setEnquiryEmailListBySiteCode(String siteCode, String companyName, @RequestParam List<String> emailList) {
+    public Result<?> setEnquiryEmailListBySiteCode(
+            String siteCode, String companyName, @RequestParam List<String> emailList) {
 
         if (StringUtils.isBlank(siteCode)) {
             return Result.error("参数错误");
         }
 
-        //判断emailList是否存在重复
+        // 判断emailList是否存在重复
         if (emailList.size() != new HashSet<>(emailList).size()) {
             return Result.error("邮箱列表存在重复");
         }
@@ -158,17 +159,27 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
         // 去除邮箱前后空格
         emailList.replaceAll(String::trim);
 
-        int count = (int) adwebSiteManageService.count(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, siteCode));
+        int count =
+                (int)
+                        adwebSiteManageService.count(
+                                new LambdaQueryWrapper<AdwebSite>()
+                                        .eq(AdwebSite::getCode, siteCode));
         if (count == 0) {
             return Result.error("站点不存在");
         }
 
         log.info("设置站点询盘邮箱列表,站点code:{},邮箱列表:{}", siteCode, emailList);
 
-        boolean update = adwebSiteManageService.update(new LambdaUpdateWrapper<AdwebSite>()
-                .set(AdwebSite::getCompanyName, companyName)
-                .set(AdwebSite::getEnquiryEmailList, CollectionUtils.isEmpty(emailList) ? null : JSON.toJSONString(emailList))
-                .eq(AdwebSite::getCode, siteCode));
+        boolean update =
+                adwebSiteManageService.update(
+                        new LambdaUpdateWrapper<AdwebSite>()
+                                .set(AdwebSite::getCompanyName, companyName)
+                                .set(
+                                        AdwebSite::getEnquiryEmailList,
+                                        CollectionUtils.isEmpty(emailList)
+                                                ? null
+                                                : JSON.toJSONString(emailList))
+                                .eq(AdwebSite::getCode, siteCode));
 
         return update ? Result.OK("设置成功") : Result.error("设置失败");
     }
@@ -182,11 +193,14 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
     @PostMapping(value = "/set/order/url")
     public Result<?> setOrderUrl(@RequestBody Sohoeb2bOrder sohoeb2bOrder) {
 
-        if (StringUtils.isBlank(sohoeb2bOrder.getOrderUrl()) || StringUtils.isBlank(sohoeb2bOrder.getDomainName()) || StringUtils.isBlank(sohoeb2bOrder.getSiteCode())) {
+        if (StringUtils.isBlank(sohoeb2bOrder.getOrderUrl())
+                || StringUtils.isBlank(sohoeb2bOrder.getDomainName())
+                || StringUtils.isBlank(sohoeb2bOrder.getSiteCode())) {
             return Result.error("参数不完整,请重试!");
         }
 
-        String newDomainName = sohoeb2bOrder.getDomainName().replace("http://", "").replace("https://", "");
+        String newDomainName =
+                sohoeb2bOrder.getDomainName().replace("http://", "").replace("https://", "");
         sohoeb2bOrder.setDomainName(newDomainName);
         if (sohoeb2bOrder.getId() != null) {
             sohoeb2bOrderService.update(sohoeb2bOrder);
@@ -212,7 +226,15 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
         Sohoeb2bOrder siteOrderPost = sohoeb2bOrderService.getBySiteCode(siteCode);
         log.info("siteOrderPost:{}", siteOrderPost);
         if (siteOrderPost != null) {
-            resultMap.put("orderUrl", siteOrderPost.getOrderUrl() + "&master=" + (adwebSiteManageService.hasSub(loginUser) ? 1 : 0) + "&username=" + loginUser.getUsername() + "&time=" + DateUtil.getDate().getTime());
+            resultMap.put(
+                    "orderUrl",
+                    siteOrderPost.getOrderUrl()
+                            + "&master="
+                            + (adwebSiteManageService.hasSub(loginUser) ? 1 : 0)
+                            + "&username="
+                            + loginUser.getUsername()
+                            + "&time="
+                            + DateUtil.getDate().getTime());
             resultMap.put("orderInitUrl", siteOrderPost.getOrderUrl());
             resultMap.put("orderID", siteOrderPost.getId());
             return Result.OK(resultMap);
@@ -236,7 +258,8 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
                 return false;
             }
 
-            List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+            List<String> codeList =
+                    siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
             if (codeList == null) {
                 return false;
             }
@@ -250,6 +273,5 @@ public class AdwebSiteManageController extends JeecgController<AdwebSite, IAdweb
 
             return codeList.contains(code);
         }
-
     }
 }

+ 18 - 22
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/WPSiteController.java

@@ -2,7 +2,9 @@ package org.jeecg.modules.adweb.site.controller;
 
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletRequest;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.shiro.SecurityUtils;
@@ -32,29 +34,24 @@ import java.util.List;
 @RequestMapping("/wpWebSite")
 public class WPSiteController {
 
-    @Resource
-    private SelfWebSiteService selfWebSiteService;
+    @Resource private SelfWebSiteService selfWebSiteService;
 
-    @Resource
-    private AdwebRedisUtil adwebRedisUtil;
+    @Resource private AdwebRedisUtil adwebRedisUtil;
 
-    @Resource
-    private SiteManageService siteManageService;
+    @Resource private SiteManageService siteManageService;
 
-    @Resource
-    private DomainService domainService;
+    @Resource private DomainService domainService;
 
-    @Resource
-    private IResourceQuotaService resourceQuotaService;
+    @Resource private IResourceQuotaService resourceQuotaService;
 
     /**
      * 创建站点
      *
      * @param templateId 模板id
-     * @param planId     域名
-     * @param name       站点名称
-     * @param uid        站点所属用户名称
-     * @param request    请求信息
+     * @param planId 域名
+     * @param name 站点名称
+     * @param uid 站点所属用户名称
+     * @param request 请求信息
      * @return 创建的站点信息
      */
     @RequestMapping("addWebsite")
@@ -106,9 +103,9 @@ public class WPSiteController {
      *
      * <p>该方法通过接收服务器ID、域名和站点代码来申请发布一个网站 用户通过该接口提交发布申请,实际的发布操作由后台异步处理
      *
-     * @param request  HttpServletRequest对象,用于获取请求相关信息
+     * @param request HttpServletRequest对象,用于获取请求相关信息
      * @param serverId 服务器ID,标识要发布的服务器
-     * @param domain   域名,标识要发布的网站域名
+     * @param domain 域名,标识要发布的网站域名
      * @param siteCode 站点代码,用于识别和验证要发布的站点
      * @return 返回一个Result对象,包含发布申请的结果信息
      */
@@ -168,15 +165,14 @@ public class WPSiteController {
 
     /**
      * 检查域名是否有效
-     * <p>
-     * 此方法用于验证提交的域名是否符合特定条件它首先检查域名是否与CNAME或IP地址相同,
-     * 然后检查域名是否已被使用接下来,它验证域名是否以http开头,
+     *
+     * <p>此方法用于验证提交的域名是否符合特定条件它首先检查域名是否与CNAME或IP地址相同, 然后检查域名是否已被使用接下来,它验证域名是否以http开头,
      * 最后检查域名是否指向CNAME或IP地址如果所有条件都满足,则域名被视为有效
      *
      * @param request HttpServletRequest对象,用于获取请求信息
-     * @param cname   用户的CNAME
-     * @param ip      用户的IP地址
-     * @param domain  用户提交的域名
+     * @param cname 用户的CNAME
+     * @param ip 用户的IP地址
+     * @param domain 用户提交的域名
      * @return 返回一个Result对象,包含验证结果和相关信息
      */
     @RequestMapping(value = "/check/domain", method = RequestMethod.POST)

+ 13 - 35
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/WordPressConfig.java

@@ -6,65 +6,43 @@ import java.io.Serializable;
 import java.util.List;
 
 /**
- * @Description: wordpress 配置信息
- * @Author:
+ * @Description: wordpress 配置信息 @Author:
+ *
  * @date
  */
 @Data
 public class WordPressConfig implements Serializable {
 
-    /**
-     * 站点code
-     */
+    /** 站点code */
     private String siteCode;
 
-    /**
-     * wp站点域名
-     */
+    /** wp站点域名 */
     private String domain;
 
-    /**
-     * 物料模块是否嵌入WordPress,0:否;1:是
-     */
+    /** 物料模块是否嵌入WordPress,0:否;1:是 */
     private Integer wordpressSwitch;
 
-    /**
-     * WordPress登录账户
-     */
+    /** WordPress登录账户 */
     private String wordpressName;
 
-    /**
-     * WordPress登录token
-     */
+    /** WordPress登录token */
     private String wordpressToken;
 
-    /**
-     * WordPress站点状态
-     */
+    /** WordPress站点状态 */
     private Integer status;
 
-    /**
-     * ssoResKey
-     */
+    /** ssoResKey */
     private String ssoResKey;
 
-    /**
-     * wordpress配置
-     */
+    /** wordpress配置 */
     private String wordpressSetting;
 
-    /**
-     * openSetting
-     */
+    /** openSetting */
     private List<String> openSetting;
 
-    /**
-     * productType   WP中产品类型
-     */
+    /** productType WP中产品类型 */
     private String productType;
 
-    /**
-     * 是否按用户划分
-     */
+    /** 是否按用户划分 */
     private Integer userAccount;
 }

+ 1 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteOrderPost.java

@@ -9,11 +9,10 @@ import lombok.Data;
 public class SiteOrderPost {
 
     private String id;
-    
+
     private String siteCode;
 
     private String domainName;
 
     private String orderUrl;
-
 }

+ 1 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/param/SiteStepDTO.java

@@ -7,7 +7,7 @@ import lombok.Data;
  */
 @Data
 public class SiteStepDTO {
-    //站点code,关联站点表
+    // 站点code,关联站点表
     private String siteCode;
 
     // 当前进度ID
@@ -15,5 +15,4 @@ public class SiteStepDTO {
 
     // 当前进度名称
     private String currentStep;
-
 }

+ 9 - 28
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/dto/result/SiteBasicInfo.java

@@ -1,52 +1,33 @@
 package org.jeecg.modules.adweb.site.dto.result;
 
-
 import lombok.Data;
 
-/**
- * 综合统计类
- */
+/** 综合统计类 */
 @Data
 public class SiteBasicInfo {
 
-    /**
-     * 套餐名称
-     */
+    /** 套餐名称 */
     private String planName;
 
-    /**
-     * 创建时间
-     */
+    /** 创建时间 */
     private String createTime;
 
-    /**
-     * 到期时间
-     */
+    /** 到期时间 */
     private String endTime;
 
-    /**
-     * 运行状态
-     */
+    /** 运行状态 */
     private Integer runStatus;
 
-    /**
-     * 交付状态
-     */
+    /** 交付状态 */
     private String deliveryProgress;
 
-    /**
-     * 运行天数
-     */
+    /** 运行天数 */
     private int runDays;
 
-    /**
-     * 赠送天数
-     */
+    /** 赠送天数 */
     private Integer giveDay;
 
-    /**
-     * 补偿天数
-     */
+    /** 补偿天数 */
     private Integer compensateDay;
 
     private int percentage;

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

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.site.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.adweb.site.dto.WordPressConfig;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
@@ -15,7 +16,6 @@ import java.util.List;
  */
 public interface IAdwebSiteService extends IService<AdwebSite> {
 
-
     /**
      * 查询wordpress站点配置
      *
@@ -63,9 +63,7 @@ public interface IAdwebSiteService extends IService<AdwebSite> {
      */
     List<Integer> getAllSiteIdByUid(String uid);
 
-    /**
-     * 查询全部有效的站点code
-     */
+    /** 查询全部有效的站点code */
     List<String> getAllActiveSiteCodes();
 
     boolean updateSiteFlow(String siteCode);

+ 4 - 1
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/IAdwebUserWpsiteService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.site.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.site.entity.AdwebUserWpsite;
 
 import java.util.List;
@@ -8,7 +9,7 @@ import java.util.List;
 /**
  * @Description: adweb_user_wpsite
  * @Author: jeecg-boot
- * @Date:   2023-08-18
+ * @Date: 2023-08-18
  * @Version: V1.0
  */
 public interface IAdwebUserWpsiteService extends IService<AdwebUserWpsite> {
@@ -16,6 +17,7 @@ public interface IAdwebUserWpsiteService extends IService<AdwebUserWpsite> {
 
     /**
      * 查找相同数据
+     *
      * @param wpUsername
      * @param siteId
      * @return
@@ -26,6 +28,7 @@ public interface IAdwebUserWpsiteService extends IService<AdwebUserWpsite> {
 
     /**
      * 根据站点id获取wp站点用户信息
+     *
      * @param siteId
      * @return
      */

+ 332 - 235
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteService.java

@@ -1,7 +1,9 @@
 package org.jeecg.modules.adweb.site.service;
 
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.SymbolConstant;
@@ -34,64 +36,67 @@ import java.util.Date;
 @EnableAsync
 public class SelfWebSiteService {
 
-    @Resource
-    private IAdwebSiteService siteService;
-
-    /**
-     * 远程脚本执行服务类
-     */
-    @Resource
-    private ShellService shellService;
+    @Resource private IAdwebSiteService siteService;
 
+    /** 远程脚本执行服务类 */
+    @Resource private ShellService shellService;
 
-    @Resource
-    private SelfWebSiteServiceCommon selfWebSiteServiceCommon;
+    @Resource private SelfWebSiteServiceCommon selfWebSiteServiceCommon;
 
-    @Resource
-    private WebSocketService webSocketService;
+    @Resource private WebSocketService webSocketService;
 
-    @Resource
-    private IAdwebServerService serverService;
+    @Resource private IAdwebServerService serverService;
 
     @Value("${AdwebSiteConnect.host}")
     private String host;
+
     @Value("${AdwebSiteConnect.port}")
     private int port;
+
     @Value("${AdwebSiteConnect.username}")
     private String username;
+
     @Value("${AdwebSiteConnect.password}")
     private String password;
 
     @Value(value = "${jeecg.path.upload}")
     private String uploadpath;
 
-    @Resource
-    private FeishuService openFeishuMsgService;
+    @Resource private FeishuService openFeishuMsgService;
 
-    @Resource
-    private ISysExceptionService sysExceptionService;
+    @Resource private ISysExceptionService sysExceptionService;
 
     private String errorMsg = "";
 
     /**
      * 创建站点的方法
      *
-     * @param user          当前登录用户
-     * @param tempId        模板ID
-     * @param uid           用户ID
-     * @param name          站点名称
-     * @param planId        套餐ID
-     * @param sysUser       系统用户
-     * @param giveDay       赠送天数
+     * @param user 当前登录用户
+     * @param tempId 模板ID
+     * @param uid 用户ID
+     * @param name 站点名称
+     * @param planId 套餐ID
+     * @param sysUser 系统用户
+     * @param giveDay 赠送天数
      * @param compensateDay 补偿天数
      */
     @Async
-    public void createSite(LoginUser user, Long tempId, String uid, String name, String planId, LoginUser sysUser, Integer giveDay, Integer compensateDay) {
+    public void createSite(
+            LoginUser user,
+            Long tempId,
+            String uid,
+            String name,
+            String planId,
+            LoginUser sysUser,
+            Integer giveDay,
+            Integer compensateDay) {
         // 创建站点信息,生成code,拼接域名等,并将站点信息写入数据库
 
         AdwebSite adwebSite = null;
         try {
-            adwebSite = selfWebSiteServiceCommon.saveNewSiteInfo(tempId, uid, name, planId, sysUser, giveDay, compensateDay);
+            adwebSite =
+                    selfWebSiteServiceCommon.saveNewSiteInfo(
+                            tempId, uid, name, planId, sysUser, giveDay, compensateDay);
         } catch (Exception e) {
             log.error("新建站点时保存站点信息失败", e);
         }
@@ -99,38 +104,51 @@ public class SelfWebSiteService {
         try {
 
             // 执行临时服务器shell脚本,生成临时站点
-            String cmd = "sh /opt/adweb3/shell/auto-wpsite " + adwebSite.getCode() + " " + adwebSite.getParentCode();
+            String cmd =
+                    "sh /opt/adweb3/shell/auto-wpsite "
+                            + adwebSite.getCode()
+                            + " "
+                            + adwebSite.getParentCode();
 
             AdwebSite finalAdwebSite = adwebSite;
-            shellService.createShareSiteByPwd(cmd, host, port, username, password, new ShellSSH2Util.StdoutListener() {
-                @Override
-                public void stdout(String line) {
-                    log.info("标准 :{}", line);
-
-                    if (line.startsWith("执行命令成功")) {
-                        log.info("站点创建成功!更新站点状态");
-
-                        // 更新站点流程状态
-                        siteService.updateSiteFlow(finalAdwebSite.getCode());
-
-                        // 临时站点创建成功
-                        finalAdwebSite.setStatus(2);
-                        siteService.updateById(finalAdwebSite);
-
-                        String[] userIds = {user.getId()};
-                        // 给该站点所属的用户发送消息
-                        log.info("发送创建站点通知");
-                        webSocketService.sendMessage(userIds, "站点创建完成通知", "您的站点已经创建成功,请在站点管理中查看该站点详细信息", WebsocketConst.CMD_MANAGE_SITE);
-                    }
-                }
-
-                @Override
-                public void stderr(String line) {
-                    log.info("错误 :{}", line);
-                    errorMsg += line;
-                }
-            });
-
+            shellService.createShareSiteByPwd(
+                    cmd,
+                    host,
+                    port,
+                    username,
+                    password,
+                    new ShellSSH2Util.StdoutListener() {
+                        @Override
+                        public void stdout(String line) {
+                            log.info("标准 :{}", line);
+
+                            if (line.startsWith("执行命令成功")) {
+                                log.info("站点创建成功!更新站点状态");
+
+                                // 更新站点流程状态
+                                siteService.updateSiteFlow(finalAdwebSite.getCode());
+
+                                // 临时站点创建成功
+                                finalAdwebSite.setStatus(2);
+                                siteService.updateById(finalAdwebSite);
+
+                                String[] userIds = {user.getId()};
+                                // 给该站点所属的用户发送消息
+                                log.info("发送创建站点通知");
+                                webSocketService.sendMessage(
+                                        userIds,
+                                        "站点创建完成通知",
+                                        "您的站点已经创建成功,请在站点管理中查看该站点详细信息",
+                                        WebsocketConst.CMD_MANAGE_SITE);
+                            }
+                        }
+
+                        @Override
+                        public void stderr(String line) {
+                            log.info("错误 :{}", line);
+                            errorMsg += line;
+                        }
+                    });
 
             if (StringUtils.isNotBlank(errorMsg)) {
                 createSiteFailed(adwebSite, errorMsg, 4);
@@ -143,11 +161,10 @@ public class SelfWebSiteService {
 
     /**
      * 删除指定的广告网站
-     * <p>
-     * 此方法通过执行远程服务器上的Shell脚本来删除广告网站资源,并在删除成功后通知用户
-     * 如果删除失败,会记录错误信息并抛出异常
      *
-     * @param user      当前操作的用户,用于发送通知
+     * <p>此方法通过执行远程服务器上的Shell脚本来删除广告网站资源,并在删除成功后通知用户 如果删除失败,会记录错误信息并抛出异常
+     *
+     * @param user 当前操作的用户,用于发送通知
      * @param adwebSite 要删除的广告网站对象,包含网站代码和域名等信息
      */
     @Async
@@ -158,28 +175,37 @@ public class SelfWebSiteService {
             String cmd = "sh /opt/adweb3/shell/remove-and-bak-wpsite.sh " + adwebSite.getCode();
 
             AdwebSite finalAdwebSite = adwebSite;
-            shellService.createShareSiteByPwd(cmd, host, port, username, password, new ShellSSH2Util.StdoutListener() {
-                @Override
-                public void stdout(String line) {
-                    log.info("标准 :{}", line);
-
-                    if (line.startsWith("执行命令成功")) {
-                        log.info("站点资源删除成功!");
-
-                        String[] userIds = {user.getId()};
-                        // 给该站点所属的用户发送消息
-                        log.info("发送删除站点资源通知");
-                        webSocketService.sendMessage(userIds, "站点删除通知", "站点资源" + finalAdwebSite.getDomain() + "已经从系统删除!", WebsocketConst.CMD_MANAGE_SITE);
-                    }
-                }
-
-                @Override
-                public void stderr(String line) {
-                    log.info("错误 :{}", line);
-                    errorMsg += line;
-                }
-            });
-
+            shellService.createShareSiteByPwd(
+                    cmd,
+                    host,
+                    port,
+                    username,
+                    password,
+                    new ShellSSH2Util.StdoutListener() {
+                        @Override
+                        public void stdout(String line) {
+                            log.info("标准 :{}", line);
+
+                            if (line.startsWith("执行命令成功")) {
+                                log.info("站点资源删除成功!");
+
+                                String[] userIds = {user.getId()};
+                                // 给该站点所属的用户发送消息
+                                log.info("发送删除站点资源通知");
+                                webSocketService.sendMessage(
+                                        userIds,
+                                        "站点删除通知",
+                                        "站点资源" + finalAdwebSite.getDomain() + "已经从系统删除!",
+                                        WebsocketConst.CMD_MANAGE_SITE);
+                            }
+                        }
+
+                        @Override
+                        public void stderr(String line) {
+                            log.info("错误 :{}", line);
+                            errorMsg += line;
+                        }
+                    });
 
             if (StringUtils.isNotBlank(errorMsg)) {
                 exceShellFailed("删除站点资源", adwebSite, errorMsg);
@@ -193,27 +219,29 @@ public class SelfWebSiteService {
     /**
      * 当执行Shell命令失败时调用此方法记录错误信息
      *
-     * @param cmd       执行的Shell命令,用于标识操作
+     * @param cmd 执行的Shell命令,用于标识操作
      * @param adwebSite 发生错误的广告网站实例,包含站点信息
-     * @param errorMsg  错误信息描述,详细说明执行失败的原因
+     * @param errorMsg 错误信息描述,详细说明执行失败的原因
      */
     private void exceShellFailed(String cmd, AdwebSite adwebSite, String errorMsg) {
         SysException sysException = new SysException();
 
         sysException.setType(1);
         sysException.setFunctionModule(cmd);
-        sysException.setExceptionDetail(String.format("站点code:%s, 站点名称:%s,临时连接:%s", adwebSite.getCode(), adwebSite.getName(), adwebSite.getDomain()));
+        sysException.setExceptionDetail(
+                String.format(
+                        "站点code:%s, 站点名称:%s,临时连接:%s",
+                        adwebSite.getCode(), adwebSite.getName(), adwebSite.getDomain()));
         sysException.setExceptionDescription(errorMsg);
 
         sysExceptionService.save(sysException);
     }
 
     /**
-     * 处理临时站点创建失败的逻辑
-     * 当临时站点创建失败时,此方法会被调用,更新站点状态并记录错误信息
+     * 处理临时站点创建失败的逻辑 当临时站点创建失败时,此方法会被调用,更新站点状态并记录错误信息
      *
      * @param adwebSite 代表临时站点的对象,包含站点的相关信息
-     * @param errorMsg  描述创建失败的错误信息
+     * @param errorMsg 描述创建失败的错误信息
      */
     private void createSiteFailed(AdwebSite adwebSite, String errorMsg, int status) {
         adwebSite.setStatus(status); // 临时站点创建失败 或者正式站点创建失败
@@ -223,19 +251,21 @@ public class SelfWebSiteService {
 
         sysException.setType(1); // 业务错误
         sysException.setFunctionModule("拉取站点错误");
-        sysException.setExceptionDetail(String.format("站点code:%s, 站点名称:%s,临时连接:%s", adwebSite.getCode(), adwebSite.getName(), adwebSite.getDomain()));
+        sysException.setExceptionDetail(
+                String.format(
+                        "站点code:%s, 站点名称:%s,临时连接:%s",
+                        adwebSite.getCode(), adwebSite.getName(), adwebSite.getDomain()));
         sysException.setExceptionDescription(errorMsg);
 
         sysExceptionService.save(sysException);
     }
 
-
     /**
      * 发布站点到生产环境
      *
-     * @param user     当前登录用户
+     * @param user 当前登录用户
      * @param serverId 服务器ID,未在方法体内使用
-     * @param domain   域名,用于站点发布
+     * @param domain 域名,用于站点发布
      * @param siteCode 站点代码,标识特定的站点
      */
     @Async
@@ -253,30 +283,53 @@ public class SelfWebSiteService {
 
         String serverShellPath = "/opt/adweb3/shell";
 
-        //原始域名
+        // 原始域名
         String originDomain = domain;
-        //检验域名是否以www开头
+        // 检验域名是否以www开头
         if (domain.startsWith("www.")) {
             domain = domain.replace("www.", "");
         }
         String dbName = domain.replaceAll("[^a-zA-Z0-9]", "") + "_" + adwebSite.getCode();
 
-        log.info("===== releaseSite domain:{}, siteCode:{},originDomain:{},domain:{},dbName:{} ====", domain, siteCode, originDomain, domain, dbName);
-
-        String cmd = "sudo sh " + serverShellPath + "/publish_wp_site.sh " + adwebSite.getCode() + " " + domain + " " + dbName;
-
-        log.info("===== releaseSite originDomain:{},domain:{},siteCode:{},cmd:{} ====", originDomain, domain, siteCode, cmd);
+        log.info(
+                "===== releaseSite domain:{}, siteCode:{},originDomain:{},domain:{},dbName:{} ====",
+                domain,
+                siteCode,
+                originDomain,
+                domain,
+                dbName);
+
+        String cmd =
+                "sudo sh "
+                        + serverShellPath
+                        + "/publish_wp_site.sh "
+                        + adwebSite.getCode()
+                        + " "
+                        + domain
+                        + " "
+                        + dbName;
+
+        log.info(
+                "===== releaseSite originDomain:{},domain:{},siteCode:{},cmd:{} ====",
+                originDomain,
+                domain,
+                siteCode,
+                cmd);
 
         try {
             if (StringUtils.isBlank(adwebServer.getServerPem())) {
                 String[] userIds = {user.getId()};
                 // 给该站点所属的用户发送消息
                 log.info("生产服务器:{},未配置连接秘钥", adwebServer.getServerName());
-                webSocketService.sendMessage(userIds, "站点发布失败通知", "该站点发布失败,请联系管理员配置服务器连接秘钥", WebsocketConst.CMD_MANAGE_SITE);
+                webSocketService.sendMessage(
+                        userIds,
+                        "站点发布失败通知",
+                        "该站点发布失败,请联系管理员配置服务器连接秘钥",
+                        WebsocketConst.CMD_MANAGE_SITE);
                 return;
             }
 
-            adwebSite.setStatus(5); //正式站点正在创建
+            adwebSite.setStatus(5); // 正式站点正在创建
             siteService.updateById(adwebSite);
 
             String pemPath = adwebServer.getServerPem().replace("..", "").replace("../", "");
@@ -287,28 +340,40 @@ public class SelfWebSiteService {
             String filePath = uploadpath + File.separator + pemPath;
             adwebServer.setServerPem(filePath); // 设置秘钥绝对路径
 
-            shellService.exceShell(cmd, new ShellSSH2Util.StdoutListener() {
-                @Override
-                public void stdout(String line) {
-                    log.info("标准 :{}", line);
-
-                    if ("[Creation completed]".equals(line)) {
-                        log.info("======网站上线成功======");
-                        statusSuccess.append("ok");
-                    }
-                }
-
-                @Override
-                public void stderr(String line) {
-                    log.info("错误 :{}", line);
-                    statusFail.append(line);
-                }
-            }, adwebServer);
-
-
-            //正式域名
-            log.info("===== releaseSite originDomain:{},domain:{},siteCode:{},statusSuccess:{} ====", originDomain, domain, siteCode, statusSuccess);
-            log.info("===== releaseSite originDomain:{},domain:{},siteCode:{},statusFail:{} ====", originDomain, domain, siteCode, statusFail);
+            shellService.exceShell(
+                    cmd,
+                    new ShellSSH2Util.StdoutListener() {
+                        @Override
+                        public void stdout(String line) {
+                            log.info("标准 :{}", line);
+
+                            if ("[Creation completed]".equals(line)) {
+                                log.info("======网站上线成功======");
+                                statusSuccess.append("ok");
+                            }
+                        }
+
+                        @Override
+                        public void stderr(String line) {
+                            log.info("错误 :{}", line);
+                            statusFail.append(line);
+                        }
+                    },
+                    adwebServer);
+
+            // 正式域名
+            log.info(
+                    "===== releaseSite originDomain:{},domain:{},siteCode:{},statusSuccess:{} ====",
+                    originDomain,
+                    domain,
+                    siteCode,
+                    statusSuccess);
+            log.info(
+                    "===== releaseSite originDomain:{},domain:{},siteCode:{},statusFail:{} ====",
+                    originDomain,
+                    domain,
+                    siteCode,
+                    statusFail);
             if (StringUtils.isNotEmpty(statusFail.toString())) {
                 String title = "网站域名:" + originDomain + " 站点发布失败";
                 String message = "**站点CODE:** " + siteCode + "\n";
@@ -330,23 +395,25 @@ public class SelfWebSiteService {
                 String[] userIds = {user.getId()};
                 // 给该站点所属的用户发送消息
                 log.info("发布站点成功通知");
-                webSocketService.sendMessage(userIds, "站点发布完成通知", "您的站点已经发布成功,请在站点管理中查看该站点详细信息", WebsocketConst.CMD_MANAGE_SITE);
+                webSocketService.sendMessage(
+                        userIds,
+                        "站点发布完成通知",
+                        "您的站点已经发布成功,请在站点管理中查看该站点详细信息",
+                        WebsocketConst.CMD_MANAGE_SITE);
 
                 // 创建站点完成-操作
                 adwebSite.setDomain(originDomain);
                 adwebSite.setIsDomain(1);
-                //添加发布时间
+                // 添加发布时间
                 adwebSite.setIssueTime(new Date());
-                //发布成功后修改状态为发布成功状态 :1
+                // 发布成功后修改状态为发布成功状态 :1
                 adwebSite.setStatus(1);
                 adwebSite.setProdServerIp(adwebServer.getServerIp());
                 siteService.updateById(adwebSite);
-
             }
         } catch (Exception e) {
             log.error("站点发布失败,退出执行;{}", e.getMessage(), e);
             createSiteFailed(adwebSite, e.getMessage(), 6);
-
         }
     }
 
@@ -362,57 +429,69 @@ public class SelfWebSiteService {
         StringBuilder delFail = new StringBuilder();
         AdwebSite adwebSite = siteService.getById(siteId);
         String usWest118ServerShellPath = "/home/ci-user/shell";
-        //检验域名是否以www开头
+        // 检验域名是否以www开头
         if (domain.startsWith("www.")) {
             domain = domain.replace("www.", "");
         }
         // 删除已发布的站点,重新发布
         if (adwebSite.getStatus() == 5) {
-            String cmd = "sudo sh " + usWest118ServerShellPath + "/adweb-remove_prod_site.sh " + domain;
-            log.info("===== delReleaseWebsite domain:{},siteId:{},cmd:{} ====", domain, siteId, cmd);
+            String cmd =
+                    "sudo sh " + usWest118ServerShellPath + "/adweb-remove_prod_site.sh " + domain;
+            log.info(
+                    "===== delReleaseWebsite domain:{},siteId:{},cmd:{} ====", domain, siteId, cmd);
             try {
                 String finalDomain = domain;
-//                shellService.exceShellByUsWest118(cmd, new ShellSSH2Util.StdoutListener() {
-//                    @Override
-//                    public void stdout(String line) {
-//                        log.info("标准 :" + line);
-//                        if ("remove site success".equals(line) || "remove site nginx success".equals(line)) {
-//                            log.info("======执行删除旧站点,成功通知======");
-//                            String title = "网站域名:" + finalDomain + " 删除发布失败的旧站点成功";
-//                            String message = "**站点ID:** " + siteId + "\n";
-//                            message += "**临时域名:** " + adwebSite.getDomainDev() + "\n";
-//                            message += "**服务器IP:** " + adwebSite.getDevServerIp() + "\n";
-//                            sendAdWebV3FeiShuMsg(title, message);
-//
-//                            delSuccess.append(line);
-//                        }
-//
-//                        if ("remove site failed".equals(line) || "remove site nginx failed".equals(line)) {
-//                            log.info("======执行删除旧站点,失败通知======");
-//                            String title = "网站域名:" + finalDomain + " 删除发布失败的旧站点失败";
-//                            String message = "**站点ID:** " + siteId + "\n";
-//                            message += "**临时域名:** " + adwebSite.getDomainDev() + "\n";
-//                            message += "**服务器IP:** " + adwebSite.getDevServerIp() + "\n";
-//                            message += "**错误信息:** " + line + "\n";
-//                            sendAdWebV3FeiShuMsg(title, message);
-//
-//                            delFail.append(line);
-//                        }
-//                    }
-//
-//                    @Override
-//                    public void stderr(String line) {
-//                        log.info("错误 :" + line);
-//                        String title = "网站域名:" + finalDomain + " 删除发布失败的旧站点失败";
-//                        String message = "**站点ID:** " + siteId + "\n";
-//                        message += "**临时域名:** " + adwebSite.getDomainDev() + "\n";
-//                        message += "**服务器IP:** " + adwebSite.getDevServerIp() + "\n";
-//                        message += "**错误信息:** " + line + "\n";
-//                        sendAdWebV3FeiShuMsg(title, message);
-//
-//                        delFail.append(line);
-//                    }
-//                });
+                //                shellService.exceShellByUsWest118(cmd, new
+                // ShellSSH2Util.StdoutListener() {
+                //                    @Override
+                //                    public void stdout(String line) {
+                //                        log.info("标准 :" + line);
+                //                        if ("remove site success".equals(line) || "remove site
+                // nginx success".equals(line)) {
+                //                            log.info("======执行删除旧站点,成功通知======");
+                //                            String title = "网站域名:" + finalDomain + "
+                // 删除发布失败的旧站点成功";
+                //                            String message = "**站点ID:** " + siteId + "\n";
+                //                            message += "**临时域名:** " + adwebSite.getDomainDev() +
+                // "\n";
+                //                            message += "**服务器IP:** " + adwebSite.getDevServerIp()
+                // + "\n";
+                //                            sendAdWebV3FeiShuMsg(title, message);
+                //
+                //                            delSuccess.append(line);
+                //                        }
+                //
+                //                        if ("remove site failed".equals(line) || "remove site
+                // nginx failed".equals(line)) {
+                //                            log.info("======执行删除旧站点,失败通知======");
+                //                            String title = "网站域名:" + finalDomain + "
+                // 删除发布失败的旧站点失败";
+                //                            String message = "**站点ID:** " + siteId + "\n";
+                //                            message += "**临时域名:** " + adwebSite.getDomainDev() +
+                // "\n";
+                //                            message += "**服务器IP:** " + adwebSite.getDevServerIp()
+                // + "\n";
+                //                            message += "**错误信息:** " + line + "\n";
+                //                            sendAdWebV3FeiShuMsg(title, message);
+                //
+                //                            delFail.append(line);
+                //                        }
+                //                    }
+                //
+                //                    @Override
+                //                    public void stderr(String line) {
+                //                        log.info("错误 :" + line);
+                //                        String title = "网站域名:" + finalDomain + " 删除发布失败的旧站点失败";
+                //                        String message = "**站点ID:** " + siteId + "\n";
+                //                        message += "**临时域名:** " + adwebSite.getDomainDev() + "\n";
+                //                        message += "**服务器IP:** " + adwebSite.getDevServerIp() +
+                // "\n";
+                //                        message += "**错误信息:** " + line + "\n";
+                //                        sendAdWebV3FeiShuMsg(title, message);
+                //
+                //                        delFail.append(line);
+                //                    }
+                //                });
             } catch (Exception e) {
                 log.error("删除发布失败的旧站点失败,退出执行;" + e.getMessage(), e);
                 delFail.append(e.getMessage());
@@ -428,7 +507,6 @@ public class SelfWebSiteService {
         }
     }
 
-
     /**
      * 站点启动/停止
      *
@@ -468,23 +546,29 @@ public class SelfWebSiteService {
      * @return
      */
     private boolean startSiteLocal(LoginUser sysUser, AdwebSite adwebSite) {
-        //站点启动
+        // 站点启动
         String cmd = "/home/ci-user/shell/start_site " + adwebSite.getCode() + " ";
-        shellService.exceShellByPwd(cmd, host, port, username, password, new ShellSSH2Util.StdoutListener() {
-            @Override
-            public void stdout(String line) {
-                log.info("标准 :" + line);
-                if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
-                    // TODO ----
-                    log.error("恢复测试站点异常:" + line);
-                }
-            }
+        shellService.exceShellByPwd(
+                cmd,
+                host,
+                port,
+                username,
+                password,
+                new ShellSSH2Util.StdoutListener() {
+                    @Override
+                    public void stdout(String line) {
+                        log.info("标准 :" + line);
+                        if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
+                            // TODO ----
+                            log.error("恢复测试站点异常:" + line);
+                        }
+                    }
 
-            @Override
-            public void stderr(String line) {
-                log.info("错误 :" + line);
-            }
-        });
+                    @Override
+                    public void stderr(String line) {
+                        log.info("错误 :" + line);
+                    }
+                });
         return siteStatusUpdate(sysUser, adwebSite, 0);
     }
 
@@ -497,21 +581,27 @@ public class SelfWebSiteService {
      */
     private boolean stopSiteLocal(LoginUser sysUser, AdwebSite adwebSite) {
         String cmd = "/home/ci-user/shell/stop_site " + adwebSite.getCode() + " ";
-        shellService.exceShellByPwd(cmd, host, port, username, password, new ShellSSH2Util.StdoutListener() {
-            @Override
-            public void stdout(String line) {
-                log.info("标准 :" + line);
-                if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
-                    // TODO ----
-                    log.error("停止测试站点异常:" + line);
-                }
-            }
+        shellService.exceShellByPwd(
+                cmd,
+                host,
+                port,
+                username,
+                password,
+                new ShellSSH2Util.StdoutListener() {
+                    @Override
+                    public void stdout(String line) {
+                        log.info("标准 :" + line);
+                        if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
+                            // TODO ----
+                            log.error("停止测试站点异常:" + line);
+                        }
+                    }
 
-            @Override
-            public void stderr(String line) {
-                log.info("错误 :" + line);
-            }
-        });
+                    @Override
+                    public void stderr(String line) {
+                        log.info("错误 :" + line);
+                    }
+                });
         return siteStatusUpdate(sysUser, adwebSite, 3);
     }
 
@@ -523,23 +613,27 @@ public class SelfWebSiteService {
      * @return
      */
     private boolean startSite(LoginUser sysUser, AdwebSite adwebSite, AdwebServer serverInfo) {
-        //站点启动
-        String cmd = "./shell/start_site " + serverInfo.getServerIp() + " " + adwebSite.getCode() + " ";
-        shellService.exceShell(cmd, new ShellSSH2Util.StdoutListener() {
-            @Override
-            public void stdout(String line) {
-                log.info("MJJ控制台 :" + line);
-                if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
-                    // TODO ----
-                    log.error("恢复站点异常:" + line);
-                }
-            }
+        // 站点启动
+        String cmd =
+                "./shell/start_site " + serverInfo.getServerIp() + " " + adwebSite.getCode() + " ";
+        shellService.exceShell(
+                cmd,
+                new ShellSSH2Util.StdoutListener() {
+                    @Override
+                    public void stdout(String line) {
+                        log.info("MJJ控制台 :" + line);
+                        if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
+                            // TODO ----
+                            log.error("恢复站点异常:" + line);
+                        }
+                    }
 
-            @Override
-            public void stderr(String line) {
-                log.info("错误 :" + line);
-            }
-        }, serverInfo);
+                    @Override
+                    public void stderr(String line) {
+                        log.info("错误 :" + line);
+                    }
+                },
+                serverInfo);
         return siteStatusUpdate(sysUser, adwebSite, 0);
     }
 
@@ -551,26 +645,29 @@ public class SelfWebSiteService {
      * @return
      */
     private boolean stopSite(LoginUser sysUser, AdwebSite adwebSite, AdwebServer serverInfo) {
-        String cmd = "./shell/stop_site " + serverInfo.getServerIp() + " " + adwebSite.getCode() + " ";
-        shellService.exceShell(cmd, new ShellSSH2Util.StdoutListener() {
-            @Override
-            public void stdout(String line) {
-                log.info("MJJ控制台 :" + line);
-                if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
-                    // TODO ----
-                    log.error("停止站点异常:" + line);
-                }
-            }
+        String cmd =
+                "./shell/stop_site " + serverInfo.getServerIp() + " " + adwebSite.getCode() + " ";
+        shellService.exceShell(
+                cmd,
+                new ShellSSH2Util.StdoutListener() {
+                    @Override
+                    public void stdout(String line) {
+                        log.info("MJJ控制台 :" + line);
+                        if ("ERROR:FILE_NAME IS EXISTS".equals(line)) {
+                            // TODO ----
+                            log.error("停止站点异常:" + line);
+                        }
+                    }
 
-            @Override
-            public void stderr(String line) {
-                log.info("错误 :" + line);
-            }
-        }, serverInfo);
+                    @Override
+                    public void stderr(String line) {
+                        log.info("错误 :" + line);
+                    }
+                },
+                serverInfo);
         return siteStatusUpdate(sysUser, adwebSite, 3);
     }
 
-
     /**
      * 站点状态更改
      *

+ 30 - 32
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteServiceCommon.java

@@ -34,37 +34,34 @@ public class SelfWebSiteServiceCommon {
     @Value("${AdwebSiteConnect.tempDomain}")
     private String tempDomain;
 
-
     @Value("${serverIp.test}")
     private String newServerIp;
 
-    @Resource
-    private ISiteUserPermissionService siteUserPermissionService;
-
+    @Resource private ISiteUserPermissionService siteUserPermissionService;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private SiteManageService siteManageService;
+    @Resource private SiteManageService siteManageService;
 
-    @Resource
-    private IAdwebSiteService siteService;
+    @Resource private IAdwebSiteService siteService;
 
-    @Resource
-    private IAdwebThemeService adwebThemeService;
+    @Resource private IAdwebThemeService adwebThemeService;
 
-    @Resource
-    private ISeoPlanSubscriptionService seoPlanSubscriptionService;
+    @Resource private ISeoPlanSubscriptionService seoPlanSubscriptionService;
 
-    @Resource
-    private ISubscribePlanService subscribePlanService;
+    @Resource private ISubscribePlanService subscribePlanService;
 
-    @Resource
-    private ISysUserTenantService relationService;
+    @Resource private ISysUserTenantService relationService;
 
     @Transactional
-    public AdwebSite saveNewSiteInfo(Long tempId, String uid, String name, String planId, LoginUser sysUser, Integer giveDay, Integer compensateDay) {
+    public AdwebSite saveNewSiteInfo(
+            Long tempId,
+            String uid,
+            String name,
+            String planId,
+            LoginUser sysUser,
+            Integer giveDay,
+            Integer compensateDay) {
         AdwebTheme adwebTheme = adwebThemeService.getById(tempId);
         if (adwebTheme == null) {
             log.error("未查询到模板数据退出执行,模板ID={}", tempId);
@@ -73,13 +70,13 @@ public class SelfWebSiteServiceCommon {
         // 站点CODE
         String siteCode = siteManageService.getSiteCode(null); // 自动生成临时站点code
         String domain = siteCode + "." + tempDomain;
-        //站点对象
+        // 站点对象
         AdwebSite adwebSite = new AdwebSite();
         // 有效期  默认当前时间加1年
         Date endTime = DateUtil.addYear(DateUtil.getDate(), 1);
 
         adwebSite.setUid(uid);
-        //站点名称改为创建站点时必填字段
+        // 站点名称改为创建站点时必填字段
 
         adwebSite.setEtime(endTime);
 
@@ -88,10 +85,10 @@ public class SelfWebSiteServiceCommon {
         adwebSite.setTemplateDomain(adwebTheme.getDomain());
         adwebSite.setCreateType("wp");
         adwebSite.setName(name);
-        //域名
+        // 域名
         adwebSite.setDomain("https://" + domain);
         adwebSite.setDomainDev(domain);
-        //站点code,此处保存
+        // 站点code,此处保存
         adwebSite.setCode(siteCode);
         adwebSite.setInCode(adwebTheme.getCode());
         adwebSite.setIsDomain(0);
@@ -101,20 +98,22 @@ public class SelfWebSiteServiceCommon {
         adwebSite.setDevServerIp(newServerIp);
         adwebSite.setEnquirySendEmailType("ALL");
 
-        //wordpress 嵌入站默认配置
-        adwebSite.setWordpressSetting("{\"userAccount\":2,\"open\":\"\",\"productType\":\"adwebpro\",\"setting\":\"all\"}");
+        // wordpress 嵌入站默认配置
+        adwebSite.setWordpressSetting(
+                "{\"userAccount\":2,\"open\":\"\",\"productType\":\"adwebpro\",\"setting\":\"all\"}");
         adwebSite.setWordpressName("adweb-user");
 
-        //设置seo_job_status默认值为1(可见)
+        // 设置seo_job_status默认值为1(可见)
         adwebSite.setSeoJobStatus(1);
 
-        //租户状态,用户id,租户用户关系状态
-        //查询用户的租户ids
+        // 租户状态,用户id,租户用户关系状态
+        // 查询用户的租户ids
         List<String> tenantStatus = new ArrayList<>();
         tenantStatus.add("1");
 
         try {
-            List<SysUserTenantVo> sysTenant = relationService.getTenantListByUserId(uid, tenantStatus);
+            List<SysUserTenantVo> sysTenant =
+                    relationService.getTenantListByUserId(uid, tenantStatus);
             if (sysTenant != null && !sysTenant.isEmpty()) {
                 // 渠道商信息入库
                 SysUserTenantVo firstTenant = sysTenant.get(0);
@@ -165,13 +164,12 @@ public class SelfWebSiteServiceCommon {
         List<AdwebSite> list = adwebSiteService.list(queryWrapper);
         if (CollectionUtils.isNotEmpty(list)) {
             siteName = list.get(0).getName();
-            siteUserPermissionService.insertSiteUserPermission(adwebSite.getUid(), adwebSite.getCode(), siteName);
+            siteUserPermissionService.insertSiteUserPermission(
+                    adwebSite.getUid(), adwebSite.getCode(), siteName);
         } else {
             log.error("更新站点权限失败,该站点不存在,站点code为 {}", siteCode);
         }
 
-
         return adwebSite;
     }
-
 }

+ 67 - 43
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SiteManageService.java

@@ -1,9 +1,13 @@
 package org.jeecg.modules.adweb.site.service;
 
 import cn.hutool.core.util.RandomUtil;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.modules.adweb.common.util.DateUtil;
 import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
@@ -20,27 +24,20 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
-/**
- * 站点管理服务类
- */
+/** 站点管理服务类 */
 @Slf4j
 @Service
 public class SiteManageService {
 
     protected Logger logger = LoggerFactory.getLogger(SiteManageService.class);
 
-    @Resource
-    private AdwebSiteMapper adwebSiteMapper;
+    @Resource private AdwebSiteMapper adwebSiteMapper;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private ISeoPlanSubscriptionService seoPlanSubscriptionService;
-
-    @Resource
-    private SysDictMapper sysDictMapper;
+    @Resource private ISeoPlanSubscriptionService seoPlanSubscriptionService;
 
+    @Resource private SysDictMapper sysDictMapper;
 
     public String getSiteCode(String siteCode) {
         if (StringUtils.isEmpty(siteCode)) {
@@ -66,7 +63,9 @@ public class SiteManageService {
     public SiteBasicInfo getSiteBasicInfo(String userFlag) {
         SiteBasicInfo siteBasicInfo = new SiteBasicInfo();
 
-        AdwebSite adwebSite = adwebSiteService.getOne(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, userFlag));
+        AdwebSite adwebSite =
+                adwebSiteService.getOne(
+                        new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, userFlag));
         if (adwebSite == null) {
             return siteBasicInfo;
         }
@@ -93,18 +92,20 @@ public class SiteManageService {
             siteStatus++;
         }
 
-
         siteBasicInfo.setSiteStatus(siteStatus);
         siteBasicInfo.setPercentage(siteStatus * 100 / 6);
 
         // 获取绑定的套餐信息
-        SeoPlanSubscription history = seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(adwebSite.getId());
+        SeoPlanSubscription history =
+                seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(adwebSite.getId());
         String defaultPlanName = sysDictMapper.getDefaultPlanName();
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 
         // 绑定时间(提单时间)
         // 如果没有绑定套餐或绑定的为默认建站套餐
-        if (history == null || (StringUtils.isNotEmpty(defaultPlanName) && defaultPlanName.equals(history.getPlanName()))) {
+        if (history == null
+                || (StringUtils.isNotEmpty(defaultPlanName)
+                        && defaultPlanName.equals(history.getPlanName()))) {
             siteBasicInfo.setCreateTime(dateFormat.format(adwebSite.getCreateTime()));
         } else {
             siteBasicInfo.setCreateTime(dateFormat.format(history.getCreateTime()));
@@ -130,11 +131,21 @@ public class SiteManageService {
                 int giveDay = history.getGiveDay();
                 int compensateDay = history.getCompensateDay();
                 int totalGiveAndCompensateDay = giveDay + compensateDay;
-                log.info("getSiteBasicInfo -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}", history.getId(), giveDay, compensateDay, totalGiveAndCompensateDay);
+                log.info(
+                        "getSiteBasicInfo -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}",
+                        history.getId(),
+                        giveDay,
+                        compensateDay,
+                        totalGiveAndCompensateDay);
                 Date serveEndTime = DateUtil.addDays(now, remainServerDays);
-                log.info("getSiteBasicInfo -- 原来的serverEndTime:{}", DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
+                log.info(
+                        "getSiteBasicInfo -- 原来的serverEndTime:{}",
+                        DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
                 serveEndTime = DateUtil.addDays(serveEndTime, totalGiveAndCompensateDay);
-                log.info("getSiteBasicInfo -- 增加赠、补天数:{},增加赠送天数、补偿天数后的serverEndTime:{}", totalGiveAndCompensateDay, DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
+                log.info(
+                        "getSiteBasicInfo -- 增加赠、补天数:{},增加赠送天数、补偿天数后的serverEndTime:{}",
+                        totalGiveAndCompensateDay,
+                        DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
                 siteBasicInfo.setEndTime(dateFormat.format(serveEndTime));
             } else {
                 siteBasicInfo.setEndTime("服务已到期");
@@ -144,10 +155,20 @@ public class SiteManageService {
             int giveDay = history.getGiveDay();
             int compensateDay = history.getCompensateDay();
             int totalGiveAndCompensateDay = giveDay + compensateDay;
-            log.info("getSiteBasicInfo -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}", history.getId(), giveDay, compensateDay, totalGiveAndCompensateDay);
-            log.info("getSiteBasicInfo -- 原来的serverEndTime:{}", DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
+            log.info(
+                    "getSiteBasicInfo -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}",
+                    history.getId(),
+                    giveDay,
+                    compensateDay,
+                    totalGiveAndCompensateDay);
+            log.info(
+                    "getSiteBasicInfo -- 原来的serverEndTime:{}",
+                    DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
             serveEndTime = DateUtil.addDays(serveEndTime, totalGiveAndCompensateDay);
-            log.info("getSiteBasicInfo -- 增加赠、补天数:{},赠送天数、补偿天数后的serverEndTime:{}", totalGiveAndCompensateDay, DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
+            log.info(
+                    "getSiteBasicInfo -- 增加赠、补天数:{},赠送天数、补偿天数后的serverEndTime:{}",
+                    totalGiveAndCompensateDay,
+                    DateUtil.formatDate(serveEndTime, DateUtil.DATE_FORMAT));
             boolean isExpire = serveEndTime.compareTo(new Date()) <= 0;
             if (isExpire) {
                 siteBasicInfo.setEndTime("服务已到期");
@@ -163,10 +184,9 @@ public class SiteManageService {
      * 获取站点剩下的服务天数
      *
      * @param serverMonth 套餐的服务天数
-     * @param siteCode    站点的code
+     * @param siteCode 站点的code
      * @return
      */
-
     public int getRemainServerDays(int serverMonth, String siteCode, String historyId) {
         int serverDay = (serverMonth * 30) + (serverMonth / 2);
         int reachStandardDays = this.getReachStandardDays(siteCode, historyId);
@@ -176,30 +196,34 @@ public class SiteManageService {
     /**
      * 查询关键词达标天数
      *
-     * @param siteCode  站点code
+     * @param siteCode 站点code
      * @param historyId 绑定的套餐
      * @return 关键词达标天数
      */
     public int getReachStandardDays(String siteCode, String historyId) {
         // 查询关键词达标天数
-//        int specifyKeywordNum = 0;
-//        int longTailKeywordNum = 0;
-//        QueryWrapper<SeoKpiStatistics> statisticsQueryWrapper = new QueryWrapper<>();
-//        statisticsQueryWrapper.eq("host_code", siteCode);
-//        statisticsQueryWrapper.eq("history_id", historyId);
-//        statisticsQueryWrapper.eq("del_flag", 0);
-//        statisticsQueryWrapper.eq("type", 1);
-//        List<SeoKpiStatistics> seoKpiStatisticsList = seoKpiStatisticsService.list(statisticsQueryWrapper);
-//        if (ListUtil.notEmpty(seoKpiStatisticsList)) {
-//            for (SeoKpiStatistics kpiStatistics : seoKpiStatisticsList) {
-//                if ("APPOINT_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-//                    specifyKeywordNum = kpiStatistics.getKpiTarget() != null ? kpiStatistics.getKpiTarget() : 0;
-//                } else if ("LONG_TAIL_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-//                    longTailKeywordNum = kpiStatistics.getKpiTarget() != null ? kpiStatistics.getKpiTarget() : 0;
-//                }
-//            }
-//        }
-//        return commonMapper.getReachStandardDayNum(historyId, commonMapper.getKeywordStandard(siteCode), specifyKeywordNum, longTailKeywordNum);
+        //        int specifyKeywordNum = 0;
+        //        int longTailKeywordNum = 0;
+        //        QueryWrapper<SeoKpiStatistics> statisticsQueryWrapper = new QueryWrapper<>();
+        //        statisticsQueryWrapper.eq("host_code", siteCode);
+        //        statisticsQueryWrapper.eq("history_id", historyId);
+        //        statisticsQueryWrapper.eq("del_flag", 0);
+        //        statisticsQueryWrapper.eq("type", 1);
+        //        List<SeoKpiStatistics> seoKpiStatisticsList =
+        // seoKpiStatisticsService.list(statisticsQueryWrapper);
+        //        if (ListUtil.notEmpty(seoKpiStatisticsList)) {
+        //            for (SeoKpiStatistics kpiStatistics : seoKpiStatisticsList) {
+        //                if ("APPOINT_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
+        //                    specifyKeywordNum = kpiStatistics.getKpiTarget() != null ?
+        // kpiStatistics.getKpiTarget() : 0;
+        //                } else if ("LONG_TAIL_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
+        //                    longTailKeywordNum = kpiStatistics.getKpiTarget() != null ?
+        // kpiStatistics.getKpiTarget() : 0;
+        //                }
+        //            }
+        //        }
+        //        return commonMapper.getReachStandardDayNum(historyId,
+        // commonMapper.getKeywordStandard(siteCode), specifyKeywordNum, longTailKeywordNum);
         return 0;
     }
 

+ 3 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/Sohoeb2bOrderService.java

@@ -1,8 +1,9 @@
 package org.jeecg.modules.adweb.site.service;
 
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
 import jakarta.annotation.Resource;
+
 import org.jeecg.modules.adweb.site.entity.Sohoeb2bOrder;
 import org.jeecg.modules.adweb.site.mapper.Sohoeb2bOrderMapper;
 import org.springframework.stereotype.Service;
@@ -13,8 +14,7 @@ import org.springframework.stereotype.Service;
 @Service
 public class Sohoeb2bOrderService {
 
-    @Resource
-    private Sohoeb2bOrderMapper sohoeb2bOrderMapper;
+    @Resource private Sohoeb2bOrderMapper sohoeb2bOrderMapper;
 
     /**
      * @param sohoeb2bOrder

+ 56 - 45
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebSiteServiceImpl.java

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xkcoding.http.util.StringUtil;
+
 import jakarta.annotation.Resource;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
@@ -40,24 +42,18 @@ import java.util.Map;
  * @Version: V1.0
  */
 @Service
-public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite> implements IAdwebSiteService {
-
+public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite>
+        implements IAdwebSiteService {
 
-    @Resource
-    private SysUserRoleMapper sysUserRoleMapper;
+    @Resource private SysUserRoleMapper sysUserRoleMapper;
 
-    @Autowired
-    private IAdwebUserWpsiteService adwebUserWpsiteService;
+    @Autowired private IAdwebUserWpsiteService adwebUserWpsiteService;
 
-    @Autowired
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Autowired private ISiteUserPermissionService siteUserPermissionService;
 
-    @Lazy
-    @Resource
-    private IMasterSubAccountRelationService masterSubAccountRelationService;
+    @Lazy @Resource private IMasterSubAccountRelationService masterSubAccountRelationService;
 
-    @Resource
-    private ISysBaseAPI sysBaseAPI;
+    @Resource private ISysBaseAPI sysBaseAPI;
 
     private final RedisUtil redisUtil;
 
@@ -78,8 +74,8 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
             return config;
         }
         try {
-            List<AdwebSite> list = this.list(new LambdaQueryWrapper<AdwebSite>()
-                    .eq(AdwebSite::getCode, siteCode));
+            List<AdwebSite> list =
+                    this.list(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, siteCode));
             if (!list.isEmpty()) {
                 AdwebSite adwebSite = list.get(0);
                 BeanUtils.copyProperties(adwebSite, config);
@@ -98,21 +94,33 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
                 }
 
                 config.setWordpressName("adweb-user");
-                //处理WordPress配置数据
+                // 处理WordPress配置数据
                 if (StringUtils.isNotBlank(adwebSite.getWordpressSetting())) {
-                    Map<String, Object> wordpressSettingMap = FastJsonUtil.parseObject(adwebSite.getWordpressSetting(), Map.class);
+                    Map<String, Object> wordpressSettingMap =
+                            FastJsonUtil.parseObject(adwebSite.getWordpressSetting(), Map.class);
                     int userAccount = 2;
 
                     if (wordpressSettingMap.get("userAccount") != null) {
-                        userAccount = Integer.parseInt(wordpressSettingMap.get("userAccount").toString());
+                        userAccount =
+                                Integer.parseInt(wordpressSettingMap.get("userAccount").toString());
                         if (userAccount == 1) {
                             if (loginUser != null) {
-                                List<String> role = sysUserRoleMapper.getRoleByUserName(loginUser.getUsername());
-                                if (role.toString().contains("adweb_sub_vip") || role.toString().contains("adweb_vip")) {
-                                    List<AdwebUserWpsite> adwebUserWpsites = adwebUserWpsiteService.getSitesByUid(loginUser.getId());
-                                    config.setWordpressName(adwebUserWpsites.get(0).getWpUsername());
-                                } else if (role.toString().contains("admin") || role.toString().contains("adweb_seo_manager") || role.toString().contains("adweb_site_manager") || role.toString().contains("adweb_oem")) {
-                                    List<AdwebUserWpsite> sites = adwebUserWpsiteService.getSitesByUid(adwebSite.getUid());
+                                List<String> role =
+                                        sysUserRoleMapper.getRoleByUserName(
+                                                loginUser.getUsername());
+                                if (role.toString().contains("adweb_sub_vip")
+                                        || role.toString().contains("adweb_vip")) {
+                                    List<AdwebUserWpsite> adwebUserWpsites =
+                                            adwebUserWpsiteService.getSitesByUid(loginUser.getId());
+                                    config.setWordpressName(
+                                            adwebUserWpsites.get(0).getWpUsername());
+                                } else if (role.toString().contains("admin")
+                                        || role.toString().contains("adweb_seo_manager")
+                                        || role.toString().contains("adweb_site_manager")
+                                        || role.toString().contains("adweb_oem")) {
+                                    List<AdwebUserWpsite> sites =
+                                            adwebUserWpsiteService.getSitesByUid(
+                                                    adwebSite.getUid());
                                     config.setWordpressName(sites.get(0).getWpUsername());
                                 }
                             }
@@ -123,17 +131,18 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
                         config.setProductType(wordpressSettingMap.get("productType").toString());
                     } else {
                         config.setWordpressSetting(wordpressSettingMap.get("setting").toString());
-                        List<String> open = FastJsonUtil.parseList(wordpressSettingMap.get("open").toString(), String.class);
+                        List<String> open =
+                                FastJsonUtil.parseList(
+                                        wordpressSettingMap.get("open").toString(), String.class);
                         if (CollectionUtils.isNotEmpty(open)) {
                             config.setOpenSetting(open);
                         }
                         if (wordpressSettingMap.size() > 2) {
-                            config.setProductType(wordpressSettingMap.get("productType").toString());
+                            config.setProductType(
+                                    wordpressSettingMap.get("productType").toString());
                         }
                     }
-
                 }
-
             }
         } catch (Exception e) {
             log.error("查询wordpress站点配置失败", e);
@@ -206,9 +215,11 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
     @Override
     public AdwebSite getSiteByCode(String siteCode) {
         try {
-            List<AdwebSite> adwebSites = this.list(new LambdaQueryWrapper<AdwebSite>()
-                    .eq(AdwebSite::getCode, siteCode)
-                    .ne(AdwebSite::getStatus, 0));
+            List<AdwebSite> adwebSites =
+                    this.list(
+                            new LambdaQueryWrapper<AdwebSite>()
+                                    .eq(AdwebSite::getCode, siteCode)
+                                    .ne(AdwebSite::getStatus, 0));
             if (!adwebSites.isEmpty()) {
                 return adwebSites.get(0);
             }
@@ -229,8 +240,11 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
         List<AdwebSite> siteList = null;
         try {
             List<String> codeList = siteUserPermissionService.getSiteCodeList(uid);
-            siteList = this.list(new LambdaQueryWrapper<AdwebSite>()
-                    .ne(AdwebSite::getStatus, 0).in(AdwebSite::getCode, codeList));
+            siteList =
+                    this.list(
+                            new LambdaQueryWrapper<AdwebSite>()
+                                    .ne(AdwebSite::getStatus, 0)
+                                    .in(AdwebSite::getCode, codeList));
         } catch (Exception e) {
             log.error("查询用户站点失败");
         }
@@ -242,9 +256,7 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
         return siteIds;
     }
 
-    /**
-     * 查询全部有效的站点code
-     */
+    /** 查询全部有效的站点code */
     @Override
     public List<String> getAllActiveSiteCodes() {
         return this.list(
@@ -256,18 +268,16 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
                 .toList();
     }
 
-    /**
-     * 给站点创建建站流程
-     *
-     * @Author: chenpeiqing
-     * @Date: 2024/11/25
-     */
+    /** 给站点创建建站流程 @Author: chenpeiqing @Date: 2024/11/25 */
     @Override
     public boolean updateSiteFlow(String siteCode) {
         List<DictModel> dictModels = sysBaseAPI.getDictItems("build_website_status");
 
-        DictModel currentDictModel = dictModels.stream().filter(dictModel -> dictModel.getValue().equals("1")).toList().get(0);
-
+        DictModel currentDictModel =
+                dictModels.stream()
+                        .filter(dictModel -> dictModel.getValue().equals("1"))
+                        .toList()
+                        .get(0);
 
         LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(AdwebSite::getCode, siteCode);
@@ -283,7 +293,8 @@ public class AdwebSiteServiceImpl extends ServiceImpl<AdwebSiteMapper, AdwebSite
      */
     @Override
     public boolean hasSub(LoginUser loginUser) {
-        List<String> idList = masterSubAccountRelationService.getSubAccountIdByMaster(loginUser.getId());
+        List<String> idList =
+                masterSubAccountRelationService.getSubAccountIdByMaster(loginUser.getId());
         return CollectionUtils.isNotEmpty(idList);
     }
 }

+ 21 - 13
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/AdwebUserWpsiteServiceImpl.java

@@ -1,46 +1,52 @@
 package org.jeecg.modules.adweb.site.service.impl;
 
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import jakarta.annotation.Resource;
+
+import org.jeecg.modules.adweb.common.constant.NumConstant;
 import org.jeecg.modules.adweb.site.entity.AdwebUserWpsite;
 import org.jeecg.modules.adweb.site.mapper.AdwebUserWpsiteMapper;
 import org.jeecg.modules.adweb.site.service.IAdwebUserWpsiteService;
 import org.springframework.stereotype.Service;
-import org.jeecg.modules.adweb.common.constant.NumConstant;
 
 import java.util.List;
 
 /**
  * @Description: adweb_user_wpsite
  * @Author: jeecg-boot
- * @Date:   2023-08-18
+ * @Date: 2023-08-18
  * @Version: V1.0
  */
 @Service
-public class AdwebUserWpsiteServiceImpl extends ServiceImpl<AdwebUserWpsiteMapper, AdwebUserWpsite> implements IAdwebUserWpsiteService {
+public class AdwebUserWpsiteServiceImpl extends ServiceImpl<AdwebUserWpsiteMapper, AdwebUserWpsite>
+        implements IAdwebUserWpsiteService {
+
+    @Resource private AdwebUserWpsiteMapper adwebUserWpsiteMapper;
 
-    @Resource
-    private AdwebUserWpsiteMapper adwebUserWpsiteMapper;
     @Override
     public List<AdwebUserWpsite> getSitesByUid(String uid) {
-        List<AdwebUserWpsite> adwebUserWpsites = adwebUserWpsiteMapper.selectList(new LambdaQueryWrapper<AdwebUserWpsite>()
-                .eq(AdwebUserWpsite::getUid,uid));
+        List<AdwebUserWpsite> adwebUserWpsites =
+                adwebUserWpsiteMapper.selectList(
+                        new LambdaQueryWrapper<AdwebUserWpsite>().eq(AdwebUserWpsite::getUid, uid));
         return adwebUserWpsites;
     }
 
     @Override
     public List<AdwebUserWpsite> getByWpUsername(String wpUsername, Integer siteId) {
-        List<AdwebUserWpsite> adwebUserWpsites = adwebUserWpsiteMapper.selectList(new LambdaQueryWrapper<AdwebUserWpsite>()
-                .eq(AdwebUserWpsite::getWpUsername, wpUsername)
-                .eq(AdwebUserWpsite::getSiteId, siteId));
+        List<AdwebUserWpsite> adwebUserWpsites =
+                adwebUserWpsiteMapper.selectList(
+                        new LambdaQueryWrapper<AdwebUserWpsite>()
+                                .eq(AdwebUserWpsite::getWpUsername, wpUsername)
+                                .eq(AdwebUserWpsite::getSiteId, siteId));
         return adwebUserWpsites;
     }
 
     @Override
     public List<AdwebUserWpsite> getByUserID(String userId) {
-        LambdaQueryWrapper<AdwebUserWpsite> adwebUserWpsiteQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AdwebUserWpsite> adwebUserWpsiteQueryWrapper =
+                new LambdaQueryWrapper<>();
         adwebUserWpsiteQueryWrapper.eq(AdwebUserWpsite::getUid, userId);
         adwebUserWpsiteQueryWrapper.eq(AdwebUserWpsite::getStatus, NumConstant.ONE);
         List<AdwebUserWpsite> adwebUserWpsites = this.list(adwebUserWpsiteQueryWrapper);
@@ -49,12 +55,14 @@ public class AdwebUserWpsiteServiceImpl extends ServiceImpl<AdwebUserWpsiteMappe
 
     /**
      * 根据站点id获取wp站点用户信息
+     *
      * @param siteId
      * @return
      */
     @Override
     public List<AdwebUserWpsite> getUserBySiteId(Integer siteId) {
-        LambdaQueryWrapper<AdwebUserWpsite> adwebUserWpsiteQueryWrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<AdwebUserWpsite> adwebUserWpsiteQueryWrapper =
+                new LambdaQueryWrapper<>();
         adwebUserWpsiteQueryWrapper.eq(AdwebUserWpsite::getSiteId, siteId);
         adwebUserWpsiteQueryWrapper.eq(AdwebUserWpsite::getStatus, NumConstant.ONE);
         return this.list(adwebUserWpsiteQueryWrapper);

+ 51 - 27
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/impl/SiteUserPermissionServiceImpl.java

@@ -1,10 +1,12 @@
 package org.jeecg.modules.adweb.site.service.impl;
 
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.jeecg.modules.adweb.common.util.SnowflakeIdUtil;
 import org.jeecg.modules.adweb.site.entity.AdwebSitePermission;
@@ -27,23 +29,24 @@ import java.util.stream.Collectors;
  */
 @Service
 @Slf4j
-public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissionMapper, AdwebSiteUserPermission> implements ISiteUserPermissionService {
+public class SiteUserPermissionServiceImpl
+        extends ServiceImpl<SiteUserPermissionMapper, AdwebSiteUserPermission>
+        implements ISiteUserPermissionService {
 
-    @Resource
-    private ISitePermissionService sitePermissionService;
+    @Resource private ISitePermissionService sitePermissionService;
 
-
-    @Resource
-    private SnowflakeIdUtil snowflakeIdUtil;
+    @Resource private SnowflakeIdUtil snowflakeIdUtil;
 
     @Override
     public List<String> getSiteCodeList(String uid) {
         List<String> codeList = new ArrayList<>();
         List<AdwebSiteUserPermission> AdwebSiteUserPermissionList = null;
         try {
-            AdwebSiteUserPermissionList = this.list(new LambdaQueryWrapper<AdwebSiteUserPermission>()
-                    .eq(AdwebSiteUserPermission::getUid, uid)
-                    .eq(AdwebSiteUserPermission::getStatus, 1));
+            AdwebSiteUserPermissionList =
+                    this.list(
+                            new LambdaQueryWrapper<AdwebSiteUserPermission>()
+                                    .eq(AdwebSiteUserPermission::getUid, uid)
+                                    .eq(AdwebSiteUserPermission::getStatus, 1));
         } catch (Exception e) {
             log.error("通过uid获取站点权限失败", e);
         }
@@ -51,13 +54,23 @@ public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissio
             codeList.add("-1");
             return codeList;
         }
-        List<String> permissionsList = AdwebSiteUserPermissionList.stream().map(AdwebSiteUserPermission::getPermissionCode).collect(Collectors.toList());
+        List<String> permissionsList =
+                AdwebSiteUserPermissionList.stream()
+                        .map(AdwebSiteUserPermission::getPermissionCode)
+                        .collect(Collectors.toList());
 
         try {
-            codeList = sitePermissionService.list(new LambdaQueryWrapper<AdwebSitePermission>()
-                            .in(AdwebSitePermission::getPermissionCode, permissionsList)
-                            .eq(AdwebSitePermission::getStatus, 1))
-                    .stream().map(AdwebSitePermission::getSiteCode).collect(Collectors.toList());
+            codeList =
+                    sitePermissionService
+                            .list(
+                                    new LambdaQueryWrapper<AdwebSitePermission>()
+                                            .in(
+                                                    AdwebSitePermission::getPermissionCode,
+                                                    permissionsList)
+                                            .eq(AdwebSitePermission::getStatus, 1))
+                            .stream()
+                            .map(AdwebSitePermission::getSiteCode)
+                            .collect(Collectors.toList());
         } catch (Exception e) {
             log.error("通过站点权限获取站点code失败", e);
         }
@@ -73,9 +86,11 @@ public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissio
         List<String> codeList = new ArrayList<>();
         List<AdwebSiteUserPermission> AdwebSiteUserPermissionList = null;
         try {
-            AdwebSiteUserPermissionList = this.list(new LambdaQueryWrapper<AdwebSiteUserPermission>()
-                    .in(AdwebSiteUserPermission::getUid, list)
-                    .eq(AdwebSiteUserPermission::getStatus, 1));
+            AdwebSiteUserPermissionList =
+                    this.list(
+                            new LambdaQueryWrapper<AdwebSiteUserPermission>()
+                                    .in(AdwebSiteUserPermission::getUid, list)
+                                    .eq(AdwebSiteUserPermission::getStatus, 1));
         } catch (Exception e) {
             log.error("通过uid获取站点权限失败", e);
         }
@@ -83,12 +98,22 @@ public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissio
             codeList.add("-1");
             return codeList;
         }
-        List<String> permissionsList = AdwebSiteUserPermissionList.stream().map(AdwebSiteUserPermission::getPermissionCode).collect(Collectors.toList());
+        List<String> permissionsList =
+                AdwebSiteUserPermissionList.stream()
+                        .map(AdwebSiteUserPermission::getPermissionCode)
+                        .collect(Collectors.toList());
         try {
-            codeList = sitePermissionService.list(new LambdaQueryWrapper<AdwebSitePermission>()
-                            .in(AdwebSitePermission::getPermissionCode, permissionsList)
-                            .eq(AdwebSitePermission::getStatus, 1))
-                    .stream().map(AdwebSitePermission::getSiteCode).collect(Collectors.toList());
+            codeList =
+                    sitePermissionService
+                            .list(
+                                    new LambdaQueryWrapper<AdwebSitePermission>()
+                                            .in(
+                                                    AdwebSitePermission::getPermissionCode,
+                                                    permissionsList)
+                                            .eq(AdwebSitePermission::getStatus, 1))
+                            .stream()
+                            .map(AdwebSitePermission::getSiteCode)
+                            .collect(Collectors.toList());
         } catch (Exception e) {
             log.error("通过站点权限获取站点code失败", e);
         }
@@ -102,9 +127,7 @@ public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissio
     /**
      * 根据uid和siteCode向site_user_permission表中插入一条记录
      *
-     * @return:
-     * @Author: luxiaoxiao
-     * @Date: 2021/4/22
+     * @return: @Author: luxiaoxiao @Date: 2021/4/22
      */
     @Override
     public void insertSiteUserPermission(String uid, String siteCode, String siteName) {
@@ -113,7 +136,8 @@ public class SiteUserPermissionServiceImpl extends ServiceImpl<SiteUserPermissio
         try {
             LambdaQueryWrapper<AdwebSiteUserPermission> queryWrapper = new LambdaQueryWrapper<>();
 
-            queryWrapper.eq(AdwebSiteUserPermission::getUid, uid)
+            queryWrapper
+                    .eq(AdwebSiteUserPermission::getUid, uid)
                     .eq(AdwebSiteUserPermission::getStatus, 1);
 
             siteUserPermissionList = this.list(queryWrapper);

+ 40 - 42
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscribePlan/controller/SubscribePlanController.java

@@ -36,11 +36,10 @@ import java.util.List;
 @RequestMapping("/adweb/subscribePlan")
 @Slf4j
 public class SubscribePlanController extends JeecgController<SubscribePlan, ISubscribePlanService> {
-    @Autowired
-    private ISubscribePlanService seoMarketPlanService;
+    @Autowired private ISubscribePlanService seoMarketPlanService;
 
-//    @Autowired
-//	private IAdwebMaterialCheckService checkService;
+    //    @Autowired
+    //	private IAdwebMaterialCheckService checkService;
 
     /**
      * 分页列表查询
@@ -51,14 +50,16 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      * @param req
      * @return
      */
-    //@AutoLog(value = "网站营销方案套餐表-分页列表查询")
+    // @AutoLog(value = "网站营销方案套餐表-分页列表查询")
     @Operation(summary = "网站营销方案套餐表-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<IPage<SubscribePlan>> queryPageList(SubscribePlan subscribePlan,
-                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                      HttpServletRequest req) {
-        QueryWrapper<SubscribePlan> queryWrapper = QueryGenerator.initQueryWrapper(subscribePlan, req.getParameterMap());
+    public Result<IPage<SubscribePlan>> queryPageList(
+            SubscribePlan subscribePlan,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<SubscribePlan> queryWrapper =
+                QueryGenerator.initQueryWrapper(subscribePlan, req.getParameterMap());
         Page<SubscribePlan> page = new Page<SubscribePlan>(pageNo, pageSize);
         IPage<SubscribePlan> pageList = seoMarketPlanService.page(page, queryWrapper);
         return Result.OK(pageList);
@@ -104,7 +105,9 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
     @AutoLog(value = "网站营销方案套餐表-编辑")
     @Operation(summary = "网站营销方案套餐表-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:seo_market_plan:edit')")
-    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody SubscribePlan subscribePlan) {
         seoMarketPlanService.updateById(subscribePlan);
         return Result.OK("编辑成功!");
@@ -146,7 +149,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      * @param id
      * @return
      */
-    //@AutoLog(value = "网站营销方案套餐表-通过id查询")
+    // @AutoLog(value = "网站营销方案套餐表-通过id查询")
     @Operation(summary = "网站营销方案套餐表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<SubscribePlan> queryById(@RequestParam(name = "id", required = true) String id) {
@@ -182,12 +185,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
         return super.importExcel(request, response, SubscribePlan.class);
     }
 
-    /**
-     * 获取随机字符串作为planCode
-     *
-     * @Author: luxiaoxiao
-     * @Date: 2021/11/16
-     */
+    /** 获取随机字符串作为planCode @Author: luxiaoxiao @Date: 2021/11/16 */
     private String getPlanCode() {
         String planCode = RandomUtil.randomStringUpper(4);
         planCode = planCode.toUpperCase();
@@ -197,29 +195,29 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
         return count > 0 ? getPlanCode() : planCode;
     }
 
-//	/**
-//	 * 物料完整性检测模板设置
-//	 *
-//	 * @Author:yangjingwen
-//	 * @Date:2022/5/7
-//	 */
-//	@GetMapping(value="/integrityChecking")
-//	public Result<?> integrityChecking(String planId){
-//		QueryWrapper<AdwebMaterialCheck> queryWrapper=new QueryWrapper<>();
-//		queryWrapper.eq("plan_id",planId).orderByAsc("sort");
-//		List<AdwebMaterialCheck> checkList = checkService.list(queryWrapper);
-//		if(!checkList.isEmpty()){
-//			return Result.OK(checkList);
-//		}
-//		//查出模板数据
-//		QueryWrapper<AdwebMaterialCheck> queryWrapper1 = new QueryWrapper<>();
-//		queryWrapper1.isNull("plan_id").orderByAsc("sort");
-//		List<AdwebMaterialCheck> checkTemplateList = checkService.list(queryWrapper1);
-//		checkTemplateList.forEach(check -> {
-//			check.setPlanId(planId);
-//		});
-//		checkService.saveBatch(checkTemplateList);
-//		return Result.OK(checkTemplateList);
-//	}
+    //	/**
+    //	 * 物料完整性检测模板设置
+    //	 *
+    //	 * @Author:yangjingwen
+    //	 * @Date:2022/5/7
+    //	 */
+    //	@GetMapping(value="/integrityChecking")
+    //	public Result<?> integrityChecking(String planId){
+    //		QueryWrapper<AdwebMaterialCheck> queryWrapper=new QueryWrapper<>();
+    //		queryWrapper.eq("plan_id",planId).orderByAsc("sort");
+    //		List<AdwebMaterialCheck> checkList = checkService.list(queryWrapper);
+    //		if(!checkList.isEmpty()){
+    //			return Result.OK(checkList);
+    //		}
+    //		//查出模板数据
+    //		QueryWrapper<AdwebMaterialCheck> queryWrapper1 = new QueryWrapper<>();
+    //		queryWrapper1.isNull("plan_id").orderByAsc("sort");
+    //		List<AdwebMaterialCheck> checkTemplateList = checkService.list(queryWrapper1);
+    //		checkTemplateList.forEach(check -> {
+    //			check.setPlanId(planId);
+    //		});
+    //		checkService.saveBatch(checkTemplateList);
+    //		return Result.OK(checkTemplateList);
+    //	}
 
 }

+ 5 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscribePlan/service/impl/SubscribePlanServiceImpl.java

@@ -1,20 +1,21 @@
 package org.jeecg.modules.adweb.subscribePlan.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import org.jeecg.modules.adweb.subscribePlan.entity.SubscribePlan;
 import org.jeecg.modules.adweb.subscribePlan.mapper.SubscribePlanMapper;
 import org.jeecg.modules.adweb.subscribePlan.service.ISubscribePlanService;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
 /**
  * @Description: 网站营销方案套餐表
  * @Author: jeecg-boot
- * @Date:   2024-09-27
+ * @Date: 2024-09-27
  * @Version: V1.0
  */
 @Service
-public class SubscribePlanServiceImpl extends ServiceImpl<SubscribePlanMapper, SubscribePlan> implements ISubscribePlanService {
+public class SubscribePlanServiceImpl extends ServiceImpl<SubscribePlanMapper, SubscribePlan>
+        implements ISubscribePlanService {
 
     @Override
     public SubscribePlan getSubscribePlanBySiteId(Integer siteId) {

+ 33 - 23
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/controller/SystemAdwebController.java

@@ -1,10 +1,14 @@
 package org.jeecg.modules.adweb.system.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
 import io.swagger.v3.oas.annotations.tags.Tag;
+
 import jakarta.annotation.PostConstruct;
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.adweb.common.jedis.ObjectUtil;
 import org.jeecg.modules.adweb.common.util.JedisUtil;
@@ -38,23 +42,17 @@ import java.util.stream.Collectors;
 @Slf4j
 public class SystemAdwebController {
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Resource private SysAdwebApi sysAdwebApi;
 
-    @Resource
-    private ISysUserService iSysUserService;
+    @Resource private ISysUserService iSysUserService;
 
-    @Resource
-    private ISysRoleService iSysRoleService;
+    @Resource private ISysRoleService iSysRoleService;
 
-    @Resource
-    private ISysUserRoleService iSysUserRoleService;
+    @Resource private ISysUserRoleService iSysUserRoleService;
 
-    @Resource
-    private EnquiryRedisService enquiryRedisService;
+    @Resource private EnquiryRedisService enquiryRedisService;
 
-    @Resource
-    private IEnquiryEmailMessageService enquiryEmailMessageService;
+    @Resource private IEnquiryEmailMessageService enquiryEmailMessageService;
 
     private static final byte[] redisKey = EnquiryConstants.ENQUIRY_EMAIL.getBytes();
 
@@ -68,20 +66,31 @@ public class SystemAdwebController {
         List<SysUser> userList = null;
         // 只针对admin 获取 渠道商列表
         if (sysAdwebApi.isAdmin()) {
-            //获取role表里角色编码为adweb_oem的角色的id
-            List<SysRole> sysRoleList = iSysRoleService.list(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "adweb_oem"));
+            // 获取role表里角色编码为adweb_oem的角色的id
+            List<SysRole> sysRoleList =
+                    iSysRoleService.list(
+                            new LambdaQueryWrapper<SysRole>()
+                                    .eq(SysRole::getRoleCode, "adweb_oem"));
             if (sysRoleList.isEmpty()) {
                 return Result.error("获取渠道商列表失败");
             }
             SysRole role = sysRoleList.get(0);
-            //根据adweb_oem的角色的id去查user_role中间表中所有为此角色id的user_id
-            List<SysUserRole> sysUserRoleList = iSysUserRoleService.list(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getRoleId, role.getId()));
+            // 根据adweb_oem的角色的id去查user_role中间表中所有为此角色id的user_id
+            List<SysUserRole> sysUserRoleList =
+                    iSysUserRoleService.list(
+                            new LambdaQueryWrapper<SysUserRole>()
+                                    .eq(SysUserRole::getRoleId, role.getId()));
             if (sysUserRoleList.isEmpty()) {
                 return Result.error("获取渠道商列表失败");
             }
-            List<String> userIdList = sysUserRoleList.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
-            //查询user表中所有上面查询出的user_id的数据
-            userList = iSysUserService.list(new LambdaQueryWrapper<SysUser>().in(SysUser::getId, userIdList));
+            List<String> userIdList =
+                    sysUserRoleList.stream()
+                            .map(SysUserRole::getUserId)
+                            .collect(Collectors.toList());
+            // 查询user表中所有上面查询出的user_id的数据
+            userList =
+                    iSysUserService.list(
+                            new LambdaQueryWrapper<SysUser>().in(SysUser::getId, userIdList));
         }
         return Result.OK(userList);
     }
@@ -89,7 +98,8 @@ public class SystemAdwebController {
     @PostConstruct
     public void startEnquiryRedisListener() {
         enquiryRedisService.init();
-        enquiryRedisService.startEnquiryEmailMessageListener(EnquiryConstants.ENQUIRY_EMAIL_CHANNEL, enquiryEmailMessageService);
+        enquiryRedisService.startEnquiryEmailMessageListener(
+                EnquiryConstants.ENQUIRY_EMAIL_CHANNEL, enquiryEmailMessageService);
     }
 
     /**
@@ -101,14 +111,14 @@ public class SystemAdwebController {
     public Result<?> testSendEmail() {
         try {
             JedisUtil.lpush(redisKey, ObjectUtil.object2Bytes(1311742895508602880L));
-            JedisUtil.publishMsg(EnquiryConstants.ENQUIRY_EMAIL_CHANNEL, EnquiryConstants.ENQUIRY_EMAIL);
+            JedisUtil.publishMsg(
+                    EnquiryConstants.ENQUIRY_EMAIL_CHANNEL, EnquiryConstants.ENQUIRY_EMAIL);
         } catch (IOException e) {
             log.info("测试发送监听发送邮件的消息失败");
         }
 
-//        enquiryEmailMessageService.sendEnquiryEmail(1311742895508602880L);
+        //        enquiryEmailMessageService.sendEnquiryEmail(1311742895508602880L);
 
         return Result.OK("");
     }
-
 }

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

@@ -1,16 +1,16 @@
 package org.jeecg.modules.adweb.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.system.entity.MasterSubAccountRelation;
 
 import java.util.List;
 
-/**
- * “Adweb会员”主账户和子账户对应关系
- */
+/** “Adweb会员”主账户和子账户对应关系 */
 public interface IMasterSubAccountRelationService extends IService<MasterSubAccountRelation> {
     /**
      * 通过子账户ID获取主账户ID
+     *
      * @param subId
      * @return
      */
@@ -18,6 +18,7 @@ public interface IMasterSubAccountRelationService extends IService<MasterSubAcco
 
     /**
      * 通过子账户ID获取主账户名
+     *
      * @param subId
      * @return
      */
@@ -25,6 +26,7 @@ public interface IMasterSubAccountRelationService extends IService<MasterSubAcco
 
     /**
      * 通过主账户ID获取子账户ID
+     *
      * @param masterId
      * @return
      */
@@ -32,6 +34,7 @@ public interface IMasterSubAccountRelationService extends IService<MasterSubAcco
 
     /**
      * 保存主账户和子账户ID
+     *
      * @param relation
      */
     void insertAccountRelation(MasterSubAccountRelation relation);

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

@@ -6,9 +6,7 @@ import org.jeecg.modules.adweb.system.entity.SysException;
 /**
  * @Description: sys_exception
  * @Author: jeecg-boot
- * @Date:   2023-01-13
+ * @Date: 2023-01-13
  * @Version: V1.0
  */
-public interface ISysExceptionService extends IService<SysException> {
-
-}
+public interface ISysExceptionService extends IService<SysException> {}

+ 2 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/SysAdwebApi.java

@@ -30,15 +30,10 @@ public interface SysAdwebApi {
      */
     boolean isNotOwnSite(String siteCode);
 
-
-    /**
-     * 判断一个用户是否是adweb会员
-     */
+    /** 判断一个用户是否是adweb会员 */
     boolean isAdwebVip();
 
-    /**
-     * 判断一个用户是否是adweb子会员
-     */
+    /** 判断一个用户是否是adweb子会员 */
     boolean isAdwebSubVip();
 
     /**

+ 15 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/MasterSubAccountRelationServiceImpl.java

@@ -2,8 +2,11 @@ package org.jeecg.modules.adweb.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.jeecg.modules.adweb.system.entity.MasterSubAccountRelation;
 import org.jeecg.modules.adweb.system.mapper.MasterSubAccountRelationMapper;
@@ -19,11 +22,11 @@ import java.util.stream.Collectors;
 
 @Service
 @Slf4j
-public class MasterSubAccountRelationServiceImpl extends ServiceImpl<MasterSubAccountRelationMapper, MasterSubAccountRelation> implements IMasterSubAccountRelationService {
+public class MasterSubAccountRelationServiceImpl
+        extends ServiceImpl<MasterSubAccountRelationMapper, MasterSubAccountRelation>
+        implements IMasterSubAccountRelationService {
 
-    @Lazy
-    @Resource
-    private SysAdwebApi sysAdwebApi;
+    @Lazy @Resource private SysAdwebApi sysAdwebApi;
 
     @Override
     public String getMasterAccountIdBySub(String subId) {
@@ -73,7 +76,10 @@ public class MasterSubAccountRelationServiceImpl extends ServiceImpl<MasterSubAc
         } catch (Exception e) {
             log.error("通过主账户ID获取子账户ID失败");
         }
-        subIdList = relationList.stream().map(MasterSubAccountRelation::getSubId).collect(Collectors.toList());
+        subIdList =
+                relationList.stream()
+                        .map(MasterSubAccountRelation::getSubId)
+                        .collect(Collectors.toList());
         return subIdList;
     }
 
@@ -118,9 +124,11 @@ public class MasterSubAccountRelationServiceImpl extends ServiceImpl<MasterSubAc
         if (CollectionUtils.isEmpty(relations)) {
             return defaultList;
         }
-        List<String> uidList = relations.stream().map(MasterSubAccountRelation::getSubId).collect(Collectors.toList());
+        List<String> uidList =
+                relations.stream()
+                        .map(MasterSubAccountRelation::getSubId)
+                        .collect(Collectors.toList());
         uidList.add(masterId);
         return uidList;
     }
-
 }

+ 19 - 24
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/system/service/impl/SysAdwebApiImpl.java

@@ -2,8 +2,11 @@ package org.jeecg.modules.adweb.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xkcoding.http.util.StringUtil;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.api.ISysBaseAPI;
@@ -32,35 +35,27 @@ import java.util.List;
 @Slf4j
 @Service
 public class SysAdwebApiImpl implements SysAdwebApi {
-    @Resource
-    private SysUserRoleMapper sysUserRoleMapper;
+    @Resource private SysUserRoleMapper sysUserRoleMapper;
 
-    @Resource
-    private SysUserMapper userMapper;
+    @Resource private SysUserMapper userMapper;
 
-    @Resource
-    private SysDictItemMapper sysDictItemMapper;
+    @Resource private SysDictItemMapper sysDictItemMapper;
 
-    @Autowired
-    private ISiteUserPermissionService siteUserPermissionService;
+    @Autowired private ISiteUserPermissionService siteUserPermissionService;
 
-    @Autowired
-    private IAdwebSiteService adwebSiteService;
+    @Autowired private IAdwebSiteService adwebSiteService;
 
-    @Autowired
-    private ISysBaseAPI sysBaseAPI;
+    @Autowired private ISysBaseAPI sysBaseAPI;
 
-    @Autowired
-    private ISysDictService sysDictService;
+    @Autowired private ISysDictService sysDictService;
 
-    @Autowired
-    private ISysUserTenantService sysUserTenantService;
+    @Autowired private ISysUserTenantService sysUserTenantService;
 
     @Override
     public boolean isAdmin() {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String username = sysUser.getUsername();
-        List<String> adminRoleIdList = new ArrayList<>();    // 管理员角色id列表
+        List<String> adminRoleIdList = new ArrayList<>(); // 管理员角色id列表
         adminRoleIdList.add("admin");
         adminRoleIdList.add("adweb_admin");
         adminRoleIdList.add("seo_admin");
@@ -79,8 +74,8 @@ public class SysAdwebApiImpl implements SysAdwebApi {
     public boolean isChannelAdmin() {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String username = sysUser.getUsername();
-//        List<String> adminRoleIdList = new ArrayList<>();    // 管理员角色id列表
-//        adminRoleIdList.add("adweb_oem");
+        //        List<String> adminRoleIdList = new ArrayList<>();    // 管理员角色id列表
+        //        adminRoleIdList.add("adweb_oem");
         List<String> roles = sysUserRoleMapper.getRoleByUserName(username);
         for (String role : roles) {
             if ("adweb_channel_admin".equals(role)) {
@@ -123,7 +118,8 @@ public class SysAdwebApiImpl implements SysAdwebApi {
 
         if (this.isChannelAdmin()) {
             List<String> channelGroupUids = this.getChannelGroupUids();
-            List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+            List<String> codeList =
+                    siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
             queryWrapper.in(AdwebSite::getCode, codeList);
         } else if (!this.isAdmin()) {
             LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -155,7 +151,8 @@ public class SysAdwebApiImpl implements SysAdwebApi {
 
         if (this.isChannelAdmin()) {
             List<String> channelGroupUids = this.getChannelGroupUids();
-            List<String> codeList = siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
+            List<String> codeList =
+                    siteUserPermissionService.getSiteCodeListByUids(channelGroupUids);
             queryWrapper.in(AdwebSite::getCode, codeList);
         } else if (!this.isAdmin()) {
             LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -171,9 +168,7 @@ public class SysAdwebApiImpl implements SysAdwebApi {
         return true;
     }
 
-    /**
-     * 判断一个用户是否是adweb会员
-     */
+    /** 判断一个用户是否是adweb会员 */
     @Override
     public boolean isAdwebVip() {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();

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

@@ -9,10 +9,9 @@ import org.springframework.stereotype.Service;
 /**
  * @Description: sys_exception
  * @Author: jeecg-boot
- * @Date:   2023-01-13
+ * @Date: 2023-01-13
  * @Version: V1.0
  */
 @Service
-public class SysExceptionServiceImpl extends ServiceImpl<SysExceptionMapper, SysException> implements ISysExceptionService {
-
-}
+public class SysExceptionServiceImpl extends ServiceImpl<SysExceptionMapper, SysException>
+        implements ISysExceptionService {}

+ 136 - 135
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/theme/controller/AdwebThemeController.java

@@ -1,148 +1,152 @@
 package org.jeecg.modules.adweb.theme.controller;
 
-import java.util.Arrays;
+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.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.adweb.theme.entity.AdwebTheme;
-import org.jeecg.modules.adweb.theme.service.IAdwebThemeService;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.adweb.theme.entity.AdwebTheme;
+import org.jeecg.modules.adweb.theme.service.IAdwebThemeService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.jeecg.modules.adweb.theme.dto.AdwebTemplateTagDto;
 
- /**
+import java.util.Arrays;
+
+/**
  * @Description: adweb主题库
  * @Author: jeecg-boot
- * @Date:   2024-09-30
+ * @Date: 2024-09-30
  * @Version: V1.0
  */
-@Tag(name="adweb主题库")
+@Tag(name = "adweb主题库")
 @RestController
 @RequestMapping("/adweb/adwebTheme")
 @Slf4j
 public class AdwebThemeController extends JeecgController<AdwebTheme, IAdwebThemeService> {
-	@Autowired
-	private IAdwebThemeService adwebThemeService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param adwebTheme
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "adweb主题库-分页列表查询")
-	@Operation(summary="adweb主题库-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<AdwebTheme>> queryPageList(AdwebTheme adwebTheme,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<AdwebTheme> queryWrapper = QueryGenerator.initQueryWrapper(adwebTheme, req.getParameterMap());
-		Page<AdwebTheme> page = new Page<AdwebTheme>(pageNo, pageSize);
-		IPage<AdwebTheme> pageList = adwebThemeService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param adwebTheme
-	 * @return
-	 */
-	@AutoLog(value = "adweb主题库-添加")
-	@Operation(summary="adweb主题库-添加")
-	@PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:add')")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody AdwebTheme adwebTheme) {
-		adwebThemeService.save(adwebTheme);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param adwebTheme
-	 * @return
-	 */
-	@AutoLog(value = "adweb主题库-编辑")
-	@Operation(summary="adweb主题库-编辑")
+    @Autowired private IAdwebThemeService adwebThemeService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param adwebTheme
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    // @AutoLog(value = "adweb主题库-分页列表查询")
+    @Operation(summary = "adweb主题库-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<AdwebTheme>> queryPageList(
+            AdwebTheme adwebTheme,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebTheme> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebTheme, req.getParameterMap());
+        Page<AdwebTheme> page = new Page<AdwebTheme>(pageNo, pageSize);
+        IPage<AdwebTheme> pageList = adwebThemeService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param adwebTheme
+     * @return
+     */
+    @AutoLog(value = "adweb主题库-添加")
+    @Operation(summary = "adweb主题库-添加")
+    @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:add')")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody AdwebTheme adwebTheme) {
+        adwebThemeService.save(adwebTheme);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param adwebTheme
+     * @return
+     */
+    @AutoLog(value = "adweb主题库-编辑")
+    @Operation(summary = "adweb主题库-编辑")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:edit')")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody AdwebTheme adwebTheme) {
-		adwebThemeService.updateById(adwebTheme);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "adweb主题库-通过id删除")
-	@Operation(summary="adweb主题库-通过id删除")
+    @RequestMapping(
+            value = "/edit",
+            method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody AdwebTheme adwebTheme) {
+        adwebThemeService.updateById(adwebTheme);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "adweb主题库-通过id删除")
+    @Operation(summary = "adweb主题库-通过id删除")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:delete')")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		adwebThemeService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "adweb主题库-批量删除")
-	@Operation(summary="adweb主题库-批量删除")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        adwebThemeService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "adweb主题库-批量删除")
+    @Operation(summary = "adweb主题库-批量删除")
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:deleteBatch')")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.adwebThemeService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "adweb主题库-通过id查询")
-	@Operation(summary="adweb主题库-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<AdwebTheme> queryById(@RequestParam(name="id",required=true) String id) {
-		AdwebTheme adwebTheme = adwebThemeService.getById(id);
-		if(adwebTheme==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(adwebTheme);
-	}
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.adwebThemeService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    // @AutoLog(value = "adweb主题库-通过id查询")
+    @Operation(summary = "adweb主题库-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<AdwebTheme> queryById(@RequestParam(name = "id", required = true) String id) {
+        AdwebTheme adwebTheme = adwebThemeService.getById(id);
+        if (adwebTheme == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(adwebTheme);
+    }
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param adwebTheme
-    */
+     * 导出excel
+     *
+     * @param request
+     * @param adwebTheme
+     */
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:exportXls')")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AdwebTheme adwebTheme) {
@@ -150,27 +154,24 @@ public class AdwebThemeController extends JeecgController<AdwebTheme, IAdwebThem
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @PreAuthorize("@jps.requiresPermissions('adweb:adweb_theme:importExcel')")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebTheme.class);
     }
 
-	 /**
-	  *
-	  * @return
-	  */
-	 @GetMapping(value = "/getTemplateTags")
-	 public Result<?> getTemplateTags() {
-
-
-		 return Result.OK("");
-	 }
+    /**
+     * @return
+     */
+    @GetMapping(value = "/getTemplateTags")
+    public Result<?> getTemplateTags() {
 
+        return Result.OK("");
+    }
 }

+ 78 - 84
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/controller/AdwebUserCountryController.java

@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 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.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
@@ -52,29 +55,22 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/usercountry")
 @Slf4j
-public class AdwebUserCountryController extends JeecgController<AdwebUserCountry, IAdwebUserCountryService> {
+public class AdwebUserCountryController
+        extends JeecgController<AdwebUserCountry, IAdwebUserCountryService> {
 
-    @Resource
-    private IAdwebUserCountryService adwebUserCountryService;
+    @Resource private IAdwebUserCountryService adwebUserCountryService;
 
-    @Resource
-    private IAdwebSiteService adwebSiteService;
+    @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource
-    private AdwebUserCountryMapper adwebUserCountryMapper;
+    @Resource private AdwebUserCountryMapper adwebUserCountryMapper;
 
-    @Resource
-    private IAdwebCountryService admpCountryService;
+    @Resource private IAdwebCountryService admpCountryService;
 
-    @Resource
-    private IAdwebEnquiryService adwebEnquiryService;
+    @Resource private IAdwebEnquiryService adwebEnquiryService;
 
-    @Resource
-    private SysAdwebApi sysAdwebApi;
-
-    @Resource
-    private ISysUserService sysUserService;
+    @Resource private SysAdwebApi sysAdwebApi;
 
+    @Resource private ISysUserService sysUserService;
 
     /**
      * 分页列表查询
@@ -88,19 +84,19 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
     @AutoLog(value = "adweb_user_country-分页列表查询")
     @Operation(summary = "adweb_user_country-分页列表查询")
     @GetMapping(value = "/list")
-    public Result<?> queryPageList(AdwebUserCountry adwebUserCountry,
-                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                   HttpServletRequest req) {
-        QueryWrapper<AdwebUserCountry> queryWrapper = QueryGenerator.initQueryWrapper(adwebUserCountry, req.getParameterMap());
+    public Result<?> queryPageList(
+            AdwebUserCountry adwebUserCountry,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+            HttpServletRequest req) {
+        QueryWrapper<AdwebUserCountry> queryWrapper =
+                QueryGenerator.initQueryWrapper(adwebUserCountry, req.getParameterMap());
         Page<AdwebUserCountry> page = new Page<AdwebUserCountry>(pageNo, pageSize);
         IPage<AdwebUserCountry> pageList = adwebUserCountryService.page(page, queryWrapper);
         return Result.OK(pageList);
     }
 
-    /**
-     * 查询未分配地区
-     */
+    /** 查询未分配地区 */
     @GetMapping(value = "/undistribute")
     public Result<?> undistribute() {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -109,24 +105,23 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         queryWrapper.eq(AdwebUserCountry::getStatus, 1);
         List<AdwebUserCountry> userCountries = adwebUserCountryService.list(queryWrapper);
         List<AdwebCountry> countries = null;
-        if (CollectionUtils.isEmpty(userCountries)) {
+        if (CollectionUtils.isEmpty(userCountries)) {}
 
-        }
         return Result.OK();
     }
 
-    /**
-     * 获取子账户列表
-     */
+    /** 获取子账户列表 */
     @AutoLog(value = "询盘管理-询盘分配-子账户列表")
     @GetMapping(value = "/subAccounts")
-    public Result<?> subAccounts(@RequestParam(name = "siteId") Integer siteId,
-                                 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                 @RequestParam(name = "pageSize", defaultValue = "15") Integer pageSize) {
+    public Result<?> subAccounts(
+            @RequestParam(name = "siteId") Integer siteId,
+            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+            @RequestParam(name = "pageSize", defaultValue = "15") Integer pageSize) {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(siteId);
         Page<SubUser> page = new Page<>(pageNo, pageSize);
-        IPage<SubUser> pageList = adwebUserCountryMapper.getSubUserList(page, loginUser.getId(), siteIds);
+        IPage<SubUser> pageList =
+                adwebUserCountryMapper.getSubUserList(page, loginUser.getId(), siteIds);
         LambdaQueryWrapper<AdwebEnquiry> enquiryQueryWrapper = new LambdaQueryWrapper<>();
         enquiryQueryWrapper.eq(AdwebEnquiry::getStatus, 1);
         enquiryQueryWrapper.in(AdwebEnquiry::getSiteId, siteIds);
@@ -143,9 +138,7 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK(pageList);
     }
 
-    /**
-     * 获取子账户列表
-     */
+    /** 获取子账户列表 */
     @GetMapping(value = "/subAccounts/options")
     public Result<?> subAccounts2(Integer siteId, String siteCode) {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -156,7 +149,10 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
             if (siteId != null) {
                 site = adwebSiteService.getById(siteId);
             } else {
-                site = adwebSiteService.getOne(new LambdaQueryWrapper<AdwebSite>().eq(AdwebSite::getCode, siteCode));
+                site =
+                        adwebSiteService.getOne(
+                                new LambdaQueryWrapper<AdwebSite>()
+                                        .eq(AdwebSite::getCode, siteCode));
             }
             if (site == null) {
                 return Result.OK(new ArrayList<SubUser>());
@@ -183,16 +179,15 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK(list);
     }
 
-    /**
-     * 获取子账户负责的国家
-     */
+    /** 获取子账户负责的国家 */
     @GetMapping(value = "/country/charge")
     public Result<?> chargeCountry(@RequestParam String id, @RequestParam Integer siteId) {
         LambdaQueryWrapper<AdwebUserCountry> userCountryQueryWrapper = new LambdaQueryWrapper<>();
         userCountryQueryWrapper.eq(AdwebUserCountry::getUid, id);
         userCountryQueryWrapper.eq(AdwebUserCountry::getSiteId, siteId);
         userCountryQueryWrapper.eq(AdwebUserCountry::getStatus, 1);
-        List<AdwebUserCountry> userCountries = adwebUserCountryService.list(userCountryQueryWrapper);
+        List<AdwebUserCountry> userCountries =
+                adwebUserCountryService.list(userCountryQueryWrapper);
         if (CollectionUtils.isEmpty(userCountries)) {
             return Result.OK();
         }
@@ -213,7 +208,8 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         Map<String, List<AdwebCountry>> map = new HashMap<>();
         for (AdwebCountry country : countries) {
             String continentCode = country.getContinentCode();
-            List<AdwebCountry> countryList = map.computeIfAbsent(continentCode, k -> new ArrayList<>());
+            List<AdwebCountry> countryList =
+                    map.computeIfAbsent(continentCode, k -> new ArrayList<>());
             countryList.add(country);
         }
 
@@ -238,9 +234,7 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK(options);
     }
 
-    /**
-     * 获取未分配的国家
-     */
+    /** 获取未分配的国家 */
     @GetMapping(value = "/country/uncontribute")
     public Result<?> uncontributeCountry(Integer siteId) {
         LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -248,7 +242,8 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         userCountryQueryWrapper.eq(AdwebUserCountry::getMasterUid, loginUser.getId());
         userCountryQueryWrapper.eq(AdwebUserCountry::getStatus, 1);
         userCountryQueryWrapper.eq(AdwebUserCountry::getSiteId, siteId);
-        List<AdwebUserCountry> userCountries = adwebUserCountryService.list(userCountryQueryWrapper);
+        List<AdwebUserCountry> userCountries =
+                adwebUserCountryService.list(userCountryQueryWrapper);
 
         List<AdwebCountry> countries;
         if (CollectionUtils.isEmpty(userCountries)) {
@@ -271,7 +266,8 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         Map<String, List<AdwebCountry>> map = new HashMap<>();
         for (AdwebCountry country : countries) {
             String continentCode = country.getContinentCode();
-            List<AdwebCountry> countryList = map.computeIfAbsent(continentCode, k -> new ArrayList<>());
+            List<AdwebCountry> countryList =
+                    map.computeIfAbsent(continentCode, k -> new ArrayList<>());
             countryList.add(country);
         }
 
@@ -296,15 +292,13 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK(options);
     }
 
-    /**
-     * 分配国家
-     */
+    /** 分配国家 */
     @PostMapping(value = "/contribute/add")
     public Result<?> contributeCountry(@RequestBody DistributeCountryParam param) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if(sysUser.isPerform()){
-//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-//        }
+        //        if(sysUser.isPerform()){
+        //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+        //        }
         String uid = param.getUid();
         String countryIds = param.getCountryIds();
         String[] countryIdArr = countryIds.split(",");
@@ -329,7 +323,10 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         LambdaQueryWrapper<AdwebCountry> countryQueryWrapper = new LambdaQueryWrapper<>();
         countryQueryWrapper.in(AdwebCountry::getGeonameId, countryIdArr);
         List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
-        List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
+        List<String> countryCodes =
+                countries.stream()
+                        .map(AdwebCountry::getCountryIsoCode)
+                        .collect(Collectors.toList());
 
         List<Integer> siteIds = adwebSiteService.getAllSiteIdByParentId(param.getSiteId());
         LambdaUpdateWrapper<AdwebEnquiry> enquiryUpdateWrapper = new LambdaUpdateWrapper<>();
@@ -349,15 +346,13 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return false;
     }
 
-    /**
-     * 分配国家
-     */
+    /** 分配国家 */
     @PostMapping(value = "/contribute/delete")
     public Result<?> delete(@RequestBody DistributeCountryParam param) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if(sysUser.isPerform()){
-//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-//        }
+        //        if(sysUser.isPerform()){
+        //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+        //        }
         String uid = param.getUid();
         String countryIds = param.getCountryIds();
         List<String> countryIdList = new ArrayList<>();
@@ -381,7 +376,10 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
             LambdaQueryWrapper<AdwebCountry> countryQueryWrapper = new LambdaQueryWrapper<>();
             countryQueryWrapper.in(AdwebCountry::getGeonameId, countryIdList);
             List<AdwebCountry> countries = admpCountryService.list(countryQueryWrapper);
-            List<String> countryCodes = countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
+            List<String> countryCodes =
+                    countries.stream()
+                            .map(AdwebCountry::getCountryIsoCode)
+                            .collect(Collectors.toList());
             enquiryUpdateWrapper.notIn(AdwebEnquiry::getCountryCode, countryCodes);
         }
         enquiryUpdateWrapper.in(AdwebEnquiry::getSiteId, siteIds);
@@ -392,16 +390,15 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK();
     }
 
-    /**
-     * 更改分配方式
-     */
+    /** 更改分配方式 */
     @AutoLog(value = "询盘管理-询盘分配-分配规则切换")
     @PostMapping(value = "/updateDistributeType")
-    public Result<?> updateDistributeType(@RequestParam Integer siteId, @RequestParam String distributeType) {
+    public Result<?> updateDistributeType(
+            @RequestParam Integer siteId, @RequestParam String distributeType) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if(sysUser.isPerform()){
-//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-//        }
+        //        if(sysUser.isPerform()){
+        //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+        //        }
         LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(AdwebSite::getId, siteId);
         updateWrapper.set(AdwebSite::getEnquiryDistributeType, distributeType);
@@ -424,16 +421,15 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK();
     }
 
-    /**
-     * 更改询盘发送规则
-     */
+    /** 更改询盘发送规则 */
     @AutoLog(value = "询盘管理-询盘分配-更改询盘发送规则")
     @PostMapping(value = "/updateSendEmailType")
-    public Result<?> updateSendEmailType(@RequestParam Integer siteId, @RequestParam String sendEmailType) {
+    public Result<?> updateSendEmailType(
+            @RequestParam Integer siteId, @RequestParam String sendEmailType) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if(sysUser.isPerform()){
-//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-//        }
+        //        if(sysUser.isPerform()){
+        //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+        //        }
         LambdaUpdateWrapper<AdwebSite> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(AdwebSite::getId, siteId);
         updateWrapper.set(AdwebSite::getEnquirySendEmailType, sendEmailType);
@@ -442,9 +438,7 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
         return Result.OK();
     }
 
-    /**
-     * 根据站点id获取站点信息
-     */
+    /** 根据站点id获取站点信息 */
     @GetMapping(value = "/getSiteBySiteId")
     public Result<?> getSiteBySiteId(Integer siteId) {
         AdwebSite site = adwebSiteService.getById(siteId);
@@ -462,9 +456,9 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
     @PostMapping(value = "/add")
     public Result<?> add(@RequestBody AdwebUserCountry adwebUserCountry) {
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if(sysUser.isPerform()){
-//            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
-//        }
+        //        if(sysUser.isPerform()){
+        //            return Result.FORBIDDEN("\"演示版\"没有操作权限,如果需要操作,请切换到\"正式版\"再操作!");
+        //        }
         adwebUserCountryService.save(adwebUserCountry);
         return Result.OK("添加成功!");
     }
@@ -536,7 +530,8 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
      */
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AdwebUserCountry adwebUserCountry) {
-        return super.exportXls(request, adwebUserCountry, AdwebUserCountry.class, "adweb_user_country");
+        return super.exportXls(
+                request, adwebUserCountry, AdwebUserCountry.class, "adweb_user_country");
     }
 
     /**
@@ -550,5 +545,4 @@ public class AdwebUserCountryController extends JeecgController<AdwebUserCountry
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, AdwebUserCountry.class);
     }
-
 }

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.adweb.userCountry.dto;
 
-
 import lombok.Data;
 
 @Data

+ 1 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/SubUser.java

@@ -2,9 +2,7 @@ package org.jeecg.modules.adweb.userCountry.dto;
 
 import lombok.Data;
 
-/**
- * 子账户
- */
+/** 子账户 */
 @Data
 public class SubUser {
 
@@ -18,4 +16,3 @@ public class SubUser {
 
     private int EnquiryNum;
 }
-

+ 1 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/dto/TreeOption.java

@@ -4,9 +4,7 @@ import lombok.Data;
 
 import java.util.List;
 
-/**
- * 国家选项的结构
- */
+/** 国家选项的结构 */
 @Data
 public class TreeOption {
 
@@ -17,5 +15,4 @@ public class TreeOption {
     private String title;
 
     private List<TreeOption> children;
-
 }

+ 3 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/IAdwebUserCountryService.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.adweb.userCountry.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+
 import org.jeecg.modules.adweb.userCountry.entity.AdwebUserCountry;
 
 import java.util.List;
@@ -8,7 +9,7 @@ import java.util.List;
 /**
  * @Description: adweb_user_country
  * @Author: jeecg-boot
- * @Date:   2022-08-19
+ * @Date: 2022-08-19
  * @Version: V1.0
  */
 public interface IAdwebUserCountryService extends IService<AdwebUserCountry> {
@@ -24,10 +25,9 @@ public interface IAdwebUserCountryService extends IService<AdwebUserCountry> {
     /**
      * 根据子账户的id获取分配给其负责的国家列表
      *
-     * @param id     子账户id
+     * @param id 子账户id
      * @param siteId 站点id
      * @return 国家code列表
      */
     List<String> getCountryCodesBySubId(String id, Integer siteId);
-
 }

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

@@ -9,10 +9,9 @@ import org.springframework.stereotype.Service;
 /**
  * @Description: admp_country
  * @Author: jeecg-boot
- * @Date:   2021-11-16
+ * @Date: 2021-11-16
  * @Version: V1.0
  */
 @Service
-public class AdwebCountryServiceImpl extends ServiceImpl<AdwebCountryMapper, AdwebCountry> implements IAdwebCountryService {
-
-}
+public class AdwebCountryServiceImpl extends ServiceImpl<AdwebCountryMapper, AdwebCountry>
+        implements IAdwebCountryService {}

+ 11 - 10
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/userCountry/service/impl/AdwebUserCountryServiceImpl.java

@@ -18,14 +18,15 @@ import java.util.stream.Collectors;
 /**
  * @Description: adweb_user_country
  * @Author: jeecg-boot
- * @Date:   2022-08-19
+ * @Date: 2022-08-19
  * @Version: V1.0
  */
 @Service
-public class AdwebUserCountryServiceImpl extends ServiceImpl<AdwebUserCountryMapper, AdwebUserCountry> implements IAdwebUserCountryService {
+public class AdwebUserCountryServiceImpl
+        extends ServiceImpl<AdwebUserCountryMapper, AdwebUserCountry>
+        implements IAdwebUserCountryService {
 
-    @Resource
-    private IAdwebCountryService adwebCountryService;
+    @Resource private IAdwebCountryService adwebCountryService;
 
     /**
      * 根据子账户的id获取分配给其负责的国家列表
@@ -35,10 +36,11 @@ public class AdwebUserCountryServiceImpl extends ServiceImpl<AdwebUserCountryMap
      */
     @Override
     public List<Integer> getCountryIdsBySubId(String id) {
-        LambdaQueryWrapper<AdwebUserCountry> queryWrapper = new LambdaQueryWrapper<AdwebUserCountry>()
-                .select(AdwebUserCountry::getCountryId)
-                .eq(AdwebUserCountry::getUid, id)
-                .eq(AdwebUserCountry::getStatus, 1);
+        LambdaQueryWrapper<AdwebUserCountry> queryWrapper =
+                new LambdaQueryWrapper<AdwebUserCountry>()
+                        .select(AdwebUserCountry::getCountryId)
+                        .eq(AdwebUserCountry::getUid, id)
+                        .eq(AdwebUserCountry::getStatus, 1);
         List<AdwebUserCountry> list = this.list(queryWrapper);
         if (CollectionUtils.isEmpty(list)) {
             return new ArrayList<>();
@@ -49,7 +51,7 @@ public class AdwebUserCountryServiceImpl extends ServiceImpl<AdwebUserCountryMap
     /**
      * 根据子账户的id获取分配给其负责的国家列表
      *
-     * @param id     子账户id
+     * @param id 子账户id
      * @param siteId 站点id
      * @return 国家code列表
      */
@@ -64,5 +66,4 @@ public class AdwebUserCountryServiceImpl extends ServiceImpl<AdwebUserCountryMap
         List<AdwebCountry> countries = adwebCountryService.list(queryWrapper);
         return countries.stream().map(AdwebCountry::getCountryIsoCode).collect(Collectors.toList());
     }
-
 }