1
0

68 Revīzijas 01177fe43a ... 010ea87199

Autors SHA1 Ziņojums Datums
  chenpeiqing 010ea87199 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wangfan 53107fc77a Merge branch 'apc' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 14b8f01bbd TradeSparq TTL 1 nedēļu atpakaļ
  wangfan d48a836197 Merge branch 'apc' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 62479ce409 Tradespqrq 1 nedēļu atpakaļ
  wfansh 6b767e203d ACP 1 nedēļu atpakaļ
  wangfan 9b63e6f93a Merge branch 'redis' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh bb76078d6b Redis TTL 1 nedēļu atpakaļ
  wangfan 2947897bc1 Merge branch 'redis' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 02d4ac420d TTL 1 nedēļu atpakaļ
  wangfan ff5f2e2b9e Merge branch 'redis' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 40bdcc151f Redis cache 1 nedēļu atpakaļ
  wangfan bf05b4cb5b Merge branch 'tradesparq' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh f69e8e3670 TradeSparq 1 nedēļu atpakaļ
  wangfan bff57bc996 Merge branch 'tradesparq' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh a464a24c83 外贸大数据 1 nedēļu atpakaļ
  wangfan 24f0cfe77e Merge branch 'tradesparq' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 0f46c2d911 tradesparq 1 nedēļu atpakaļ
  wangfan 8046560fff Merge branch 'mysql' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh c20155ca85 Tradespark data 1 nedēļu atpakaļ
  wangfan e8f0ed9b81 Merge branch 'mysql' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 379915c09a Resource quota 1 nedēļu atpakaļ
  wangfan 8bb1ae99ab Merge branch 'mysql' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh c0baea004b Mysql dump 1 nedēļu atpakaļ
  chenpeiqing c325aa9792 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wangfan dfa252c938 Merge branch 'mysql' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh c97012ca8f mysql 1 nedēļu atpakaļ
  wangfan 2e206a0f35 Merge branch 'mysql' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 43a20beb72 MySQL 1 nedēļu atpakaļ
  chenpeiqing b44d06ecf0 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  chenpeiqing ae9e5cbac1 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wangfan 39ee613008 Merge branch 'apc' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 96d26a147c Url encoder 1 nedēļu atpakaļ
  wangfan 9f6d2de787 Merge branch 'seo' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 412f2b4b0a MySQL 1 nedēļu atpakaļ
  wangfan ae1e35fd6f Merge branch 'seo' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh d1a565242d Minor fix 1 nedēļu atpakaļ
  wangfan e937167efb Merge branch 'seo' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  wfansh 5d1236d8a8 Fix bug 1 nedēļu atpakaļ
  zhangqiang 742750ec7d Merge branch 'dev-zenas-20241018' of wangfan/adweb3-server into master 1 nedēļu atpakaļ
  Zenas 1683ef7ffd 更新站点排序规则 1 nedēļu atpakaļ
  wangfan 6138256ee9 Merge branch 'seo' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 47af5fe67b Mysql 2 nedēļas atpakaļ
  wangfan 7908aba02c Merge branch 'seo' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 55978a2fbf SEO 2 nedēļas atpakaļ
  wangfan 9a38badf0d Merge branch 'seo' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh f4db6b9a00 Fix 2 nedēļas atpakaļ
  wangfan 8327c11fe1 Merge branch 'seo' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 5c4d0895c9 Keyword 2 nedēļas atpakaļ
  wangfan eabc1ac94c Merge branch 'payment' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 724fcfe853 Alibaba Pay 2 nedēļas atpakaļ
  chenpeiqing a43b952fde Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  chenpeiqing 9f5a394bbe Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  chenpeiqing 19e5ab9c20 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  chenpeiqing 143301c449 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wangfan 1efbb108bd Merge branch 'excel' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 871fcb7f2a Mysql dump 2 nedēļas atpakaļ
  wangfan 9864b73aec Merge branch 'excel' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 0c8e133d9d mysql 2 nedēļas atpakaļ
  wangfan 62a8983759 Merge branch 'excel' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 381dd5abaa Dump 2 nedēļas atpakaļ
  chenpeiqing fae34eccc4 Merge branch 'cpq-dev' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  zhangqiang f3f49adf22 Merge branch 'dev-zenas-20241018' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  zq940222 3a39acfba3 删除subscribe_id和plan_id字段 2 nedēļas atpakaļ
  zhangqiang a79ef396cc Merge branch 'dev-zenas-20241018' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  zq940222 d3e2f0f08d 修改数据不全问题 2 nedēļas atpakaļ
  wangfan 1d967633f7 Merge branch 'excel' of wangfan/adweb3-server into master 2 nedēļas atpakaļ
  wfansh 760197ea15 PreAuth 2 nedēļas atpakaļ
17 mainītis faili ar 358 papildinājumiem un 206 dzēšanām
  1. BIN
      conf/adweb_v3.sql.zip
  2. 97 68
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/dmp/controller/TradeSparqController.java
  3. 156 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/payment/controller/ACPController.java
  4. 25 28
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java
  5. 0 12
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKeywords.java
  6. 1 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoKeywordsMapper.java
  7. 1 21
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/SeoKeywordsMapper.xml
  8. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsRankService.java
  9. 1 4
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsService.java
  10. 39 37
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsRankServiceImpl.java
  11. 3 12
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsServiceImpl.java
  12. 1 1
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/controller/AdwebSiteController.java
  13. 6 7
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscription/controller/SubscribePlanController.java
  14. 9 3
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  15. 7 1
      jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml
  16. 9 3
      jeecg-module-system/jeecg-system-start/src/main/resources/application-test.yml
  17. 2 0
      jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/adweb/payment/APCTest.java

BIN
conf/adweb_v3.sql.zip


+ 97 - 68
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/dmp/controller/TradeSparqController.java

@@ -1,17 +1,19 @@
 package org.jeecg.modules.adweb.dmp.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
 
 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;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.FastJsonUtil;
+import org.jeecg.modules.adweb.common.util.AdwebRedisUtil;
 import org.jeecg.modules.adweb.quota.entity.ResourceQuota;
 import org.jeecg.modules.adweb.quota.service.IResourceQuotaService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +25,8 @@ import org.springframework.web.client.RestClientResponseException;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.Objects;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -34,6 +38,7 @@ import java.util.stream.Collectors;
 @RequestMapping(TradeSparqController.BASE_PATH)
 @Slf4j
 public class TradeSparqController {
+
     static final String BASE_PATH = "/tradesparq";
 
     @Value("${tradesparq.api.host}")
@@ -47,80 +52,102 @@ public class TradeSparqController {
 
     @Autowired private IResourceQuotaService resourceQuotaService;
 
-    private RestTemplate restTemplate = new RestTemplate();
+    @Autowired private AdwebRedisUtil adwebRedisUtil;
+
+    @Autowired private RestTemplate restTemplate;
+
+    // 用户级加锁,确保TradeSparq API串行调用,准确控制用户额度
+    private final Cache<String, Object> userLocks =
+            CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build();
 
     @PostMapping("/**")
     @ResponseBody
     public Result<JSONObject> forwardPost(
-            HttpServletRequest httpRequest, @RequestBody JSONObject requestBody) {
-        String uid = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
-
-        // 0. 校验用户资源额度
-        boolean isQuotaLimited = this.isQuotaLimited(httpRequest, requestBody);
-        if (isQuotaLimited) {
-            Pair<Integer, Integer> customsDataQuota = resourceQuotaService.getCustomsDataQuota(uid);
-            if (customsDataQuota.getLeft() <= customsDataQuota.getRight()) {
-                log.warn("用户 {} 海关查询资源额度不足", uid);
-                return Result.error(
-                        String.format(
-                                "查询失败。用户资源额度为%d,已使用%d",
-                                customsDataQuota.getLeft(), customsDataQuota.getRight()),
-                        null);
-            }
+            HttpServletRequest httpRequest, @RequestBody JSONObject requestBody)
+            throws ExecutionException {
+        LoginUser loginUser = ((LoginUser) SecurityUtils.getSubject().getPrincipal());
+        if (Objects.isNull(loginUser)) {
+            return Result.error("用户信息未找到");
         }
 
-        // 1. 生成签名
-        String sortedValues =
-                requestBody.keySet().stream()
-                        .sorted()
-                        .map(key -> FastJsonUtil.toJSONString(requestBody.get(key)))
-                        .collect(Collectors.joining());
-        String sign = DigestUtils.md5DigestAsHex((apiSecret + sortedValues).getBytes());
-
-        // 2. 构建并发送POST请求
-        String apiPath = httpRequest.getServletPath().split(BASE_PATH)[1]; // 获取TradeSparq API路径
-        RequestEntity<String> requestEntity =
-                RequestEntity.post(apiHost + apiPath)
-                        .headers(this.getHttpHeaders(sign))
-                        .body(requestBody.toJSONString());
-        try {
-            ResponseEntity<JSONObject> responseEntity =
-                    restTemplate.exchange(requestEntity, JSONObject.class);
-
-            // 2.1 记录资源额度消耗
-            if (isQuotaLimited) {
-                resourceQuotaService.consumeCustomsDataQuota(uid);
+        // 获取用户锁
+        Object userLock = userLocks.get(loginUser.getId(), Object::new);
+        synchronized (userLock) {
+            String apiPath = httpRequest.getServletPath().split(BASE_PATH)[1]; // 获取TradeSparq API路径
+            String sortedParams =
+                    requestBody.keySet().stream()
+                            .sorted()
+                            .map(key -> FastJsonUtil.toJSONString(requestBody.get(key)))
+                            .collect(Collectors.joining());
+
+            // 0. 检查Redis缓存
+            String redisKey =
+                    String.format(
+                            "tradesparq:%s:%s",
+                            apiPath, DigestUtils.md5DigestAsHex(sortedParams.getBytes()));
+            JSONObject cachedResult = (JSONObject) adwebRedisUtil.get(redisKey);
+            if (Objects.nonNull(cachedResult)) {
+                log.info(
+                        "TradeSparq返回Redis缓存数据,uid = {}, name = {}, path = {}, request body = {}",
+                        loginUser.getId(),
+                        loginUser.getUsername(),
+                        apiPath,
+                        requestBody);
+                return Result.ok(cachedResult);
             }
 
-            return Result.ok(responseEntity.getBody());
-        } catch (RestClientResponseException e) {
-            return Result.error(e.getStatusCode().value(), e.getMessage());
-        }
-    }
+            // 1. 校验用户资源额度
+            boolean isQuotaLimited = this.isQuotaLimited(httpRequest, requestBody);
+            if (isQuotaLimited) {
+                Pair<Integer, Integer> customsDataQuota =
+                        resourceQuotaService.getCustomsDataQuota(loginUser.getId());
+                if (customsDataQuota.getLeft() <= customsDataQuota.getRight()) {
+                    log.warn("用户 {} {} 海关查询资源额度不足", loginUser.getId(), loginUser.getUsername());
+                    return Result.error(
+                            String.format(
+                                    "查询失败。用户资源额度为%d,已使用%d",
+                                    customsDataQuota.getLeft(), customsDataQuota.getRight()),
+                            null);
+                }
+            }
 
-    @GetMapping("/**")
-    @ResponseBody
-    public Result<JSONObject> forwardGet(HttpServletRequest httpRequest) {
-        // 1. 生成签名
-        String apiPath = httpRequest.getServletPath().split(BASE_PATH)[1]; // 获取TradeSparq API路径
-        String queryString = httpRequest.getQueryString();
-        String apiUrl =
-                String.format(
-                        "%s%s%s",
-                        apiHost,
+            // 2. 生成签名
+            String sign = DigestUtils.md5DigestAsHex((apiSecret + sortedParams).getBytes());
+
+            // 3. 构建并发送POST请求
+            RequestEntity<String> requestEntity =
+                    RequestEntity.post(apiHost + apiPath)
+                            .headers(this.getHttpHeaders(sign))
+                            .body(requestBody.toJSONString());
+            try {
+                ResponseEntity<JSONObject> responseEntity =
+                        restTemplate.exchange(requestEntity, JSONObject.class);
+                log.info(
+                        "TradeSparq API调用成功,uid = {}, name = {}, path = {}, request body = {}",
+                        loginUser.getId(),
+                        loginUser.getUsername(),
                         apiPath,
-                        StringUtils.isNotBlank(queryString) ? "?" + queryString : "");
-        String sign = DigestUtils.md5DigestAsHex((apiSecret + apiUrl).getBytes());
-
-        // 2. 构建并发送GET请求
-        RequestEntity<?> requestEntity =
-                RequestEntity.get(apiUrl).headers(this.getHttpHeaders(sign)).build();
-        try {
-            ResponseEntity<JSONObject> responseEntity =
-                    restTemplate.exchange(requestEntity, JSONObject.class);
-            return Result.ok(responseEntity.getBody());
-        } catch (RestClientResponseException e) {
-            return Result.error(e.getStatusCode().value(), e.getMessage());
+                        requestBody);
+
+                // 3.1 记录资源额度消耗
+                if (isQuotaLimited) {
+                    resourceQuotaService.consumeCustomsDataQuota(loginUser.getId());
+                }
+
+                // 3.2 缓存到Redis,TTL为3小时
+                adwebRedisUtil.set(redisKey, responseEntity.getBody(), 60 * 60 * 6);
+
+                return Result.ok(responseEntity.getBody());
+            } catch (RestClientResponseException e) {
+                log.error(
+                        "TradeSparq API调用失败,uid = {}, name = {}, path = {}, request body = {}",
+                        loginUser.getId(),
+                        loginUser.getUsername(),
+                        apiPath,
+                        requestBody,
+                        e);
+                return Result.error(e.getStatusCode().value(), e.getMessage());
+            }
         }
     }
 
@@ -136,8 +163,10 @@ public class TradeSparqController {
     /** 判断TradeSparq API请求是否受资源额度限制 - {@link ResourceQuota} */
     private boolean isQuotaLimited(HttpServletRequest httpRequest, JSONObject requestBody) {
         // TODO: 假定当前只限制详单查询(/cds_v2/old_api/record)第一页请求
-        return StringUtils.endsWithIgnoreCase(
-                        httpRequest.getServletPath(), "/cds_v2/old_api/record")
-                && Objects.equals(requestBody.getInteger("page"), 1);
+        //        return StringUtils.endsWithIgnoreCase(
+        //                        httpRequest.getServletPath(), "/cds_v2/old_api/record")
+        //                && Objects.equals(requestBody.getInteger("page"), 1);
+
+        return true; // 所有API请求都受限
     }
 }

+ 156 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/payment/controller/ACPController.java

@@ -0,0 +1,156 @@
+package org.jeecg.modules.adweb.payment.controller;
+
+import com.google.common.collect.ImmutableMap;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.FastJsonUtil;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.*;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * Alibaba.com Pay
+ *
+ * <p>参考
+ * https://alidocs.dingtalk.com/i/nodes/Amq4vjg890j11711tjabv6j0J3kdP0wQ?utm_scene=person_space
+ *
+ * @author wfansh
+ */
+@RestController
+@RequestMapping("/payment/acp")
+@Slf4j
+public class ACPController {
+
+    @Value("${payment.apc.encrypt-key}")
+    private String encryptKey;
+
+    @Value("${payment.apc.sign-key}")
+    private String signKey;
+
+    @Autowired ISysUserService sysUserService;
+
+    /** 获取ACP URL里的参数 - 签名,加密 */
+    @GetMapping(value = "/getUrlParams")
+    @ResponseBody
+    public Result<List<String>> getUrlParams() throws Exception {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        SysUser sysUser = sysUserService.getById(loginUser.getId());
+
+        if (Objects.isNull(sysUser) || StringUtils.isBlank(sysUser.getSocialCreditCode())) {
+            return Result.error("当前用户未配置社会信用代码");
+        }
+
+        // 待签名及加密的数据
+        Map<String, String> params =
+                ImmutableMap.of(
+                        "mid",
+                        sysUser.getId(),
+                        "loginId",
+                        sysUser.getUsername(),
+                        "from",
+                        "suhaotong",
+                        "companyName",
+                        sysUser.getCompanyName(),
+                        "companyCode",
+                        sysUser.getSocialCreditCode(),
+                        "timestamp",
+                        Long.toString(System.currentTimeMillis()));
+
+        // 1. 签名
+        String content = this.getSignatureContent(params);
+        String signedParams = this.sign(content, signKey);
+
+        // 2. 加密
+        String encryptedParams = this.encrypt(FastJsonUtil.toJSONString(params), encryptKey);
+        encryptedParams = URLEncoder.encode(encryptedParams, StandardCharsets.UTF_8);
+
+        return Result.OK(List.of(signedParams, encryptedParams));
+    }
+
+    /**
+     * 1.1 根据参数生成用于加签的字符串
+     *
+     * @param params 参数
+     * @return 用于加签的字符串
+     */
+    private String getSignatureContent(Map<String, String> params) {
+        if (params == null) {
+            return null;
+        } else {
+            StringBuilder content = new StringBuilder();
+            List<String> keys = new ArrayList<>(params.keySet());
+            Collections.sort(keys);
+            for (int i = 0; i < keys.size(); ++i) {
+                String key = keys.get(i);
+                String value = MapUtils.getString(params, key);
+                content.append(i == 0 ? "" : "&").append(key).append("=").append(value);
+            }
+            return content.toString();
+        }
+    }
+
+    /**
+     * 1.2 生成字符串的SHA-256哈希签名
+     *
+     * @param content 原始字符串
+     * @param signKey 签名秘钥
+     * @return 十六进制格式的SHA-256哈希值
+     */
+    private String sign(String content, String signKey) throws NoSuchAlgorithmException {
+        // 创建MessageDigest实例
+        MessageDigest digest = MessageDigest.getInstance("SHA-256");
+
+        // 计算哈希值
+        byte[] hashBytes = digest.digest((content + signKey).getBytes(StandardCharsets.UTF_8));
+
+        String base64Hash = Base64.getEncoder().encodeToString(hashBytes);
+
+        return base64Hash;
+    }
+
+    /** 2. 加密方法 */
+    private String encrypt(String plainText, String encryptKey) throws Exception {
+        byte[] keyBytes = Base64.getDecoder().decode(encryptKey);
+
+        SecretKeySpec secretKeySpec = new SecretKeySpec(keyBytes, "AES");
+
+        // 生成随机IV
+        byte[] iv = new byte[16]; // 16 bytes for AES block
+        new SecureRandom().nextBytes(iv);
+        IvParameterSpec ivSpec = new IvParameterSpec(iv);
+
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec);
+
+        byte[] encrypted = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
+
+        // 将IV和加密数据拼接后编码为Base64
+        byte[] combined = new byte[iv.length + encrypted.length];
+        System.arraycopy(iv, 0, combined, 0, iv.length);
+        System.arraycopy(encrypted, 0, combined, iv.length, encrypted.length);
+
+        return Base64.getEncoder().encodeToString(combined);
+    }
+}

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

@@ -44,7 +44,6 @@ import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService
 import org.jeecg.modules.adweb.system.service.SysAdwebApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -58,10 +57,7 @@ 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
@@ -131,19 +127,26 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-添加")
     @Operation(summary = "关键词-添加")
-    @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:add')")
+    // @PreAuthorize("@jps.requiresPermissions('seo: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 site = adwebSiteService.getSiteByCode(seoKeywords.getSiteCode());
+        if (site == null) {
+            return Result.error("未找到对应站点");
+        }
+        if (StringUtil.isEmpty(site.getDomain()) || Objects.equals(site.getIsDomain(), 0)) {
+            return Result.error("站点域名未设置!");
+        }
+
         seoKeywords.setAppKey(AdwebConstant.APPKEY);
-        // 根据siteCode获取站点域名
-        //        String domain = siteByCode.getDomain();
-        //        seoKeywords.setDomain(domain);
+        seoKeywords.setDomain(site.getDomain());
         seoKeywords.setStatus(1);
-        //        seoKeywords.setLang("en");
+        seoKeywords.setPriority(3);
+        seoKeywords.setOptimizeProcess(0);
+        seoKeywords.setOptimizeStatus(0);
+        seoKeywords.setLastRank(0);
+        seoKeywords.setSearchStatus(0);
+
         seoKeywordsService.save(seoKeywords);
         return Result.OK("添加成功!");
     }
@@ -156,7 +159,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-编辑")
     @Operation(summary = "关键词-编辑")
-    @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:edit')")
+    // @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:edit')")
     @RequestMapping(
             value = "/edit",
             method = {RequestMethod.PUT, RequestMethod.POST})
@@ -173,7 +176,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-通过id删除")
     @Operation(summary = "关键词-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:delete')")
+    // @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:delete')")
     @DeleteMapping(value = "/delete")
     public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
         seoKeywordsService.removeById(id);
@@ -188,7 +191,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-批量删除")
     @Operation(summary = "关键词-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:deleteBatch')")
+    // @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:deleteBatch')")
     @DeleteMapping(value = "/deleteBatch")
     public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         this.seoKeywordsService.removeByIds(Arrays.asList(ids.split(",")));
@@ -217,7 +220,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      *
      * @param request
      */
-    @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:exportXls')")
+    // @PreAuthorize("@jps.requiresPermissions('seo:seo_keywords:exportXls')")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, SeoKeywords seoKeywords) {
         return super.exportXls(request, seoKeywords, SeoKeywords.class, "关键词");
@@ -253,8 +256,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         String buttonColumn = req.getParameter("buttonColmn");
         String buttonSort = req.getParameter("buttonSort");
         Page<SeoKeywords> page = new Page<SeoKeywords>(pageNo, pageSize);
-        List<String> dateList =
-                seoKeywordsService.getKeywordsLastSevenDays(siteCode, keywordType, subscriptionId);
+        List<String> dateList = seoKeywordsService.getKeywordsLastSevenDays(siteCode, keywordType);
         pageList =
                 seoKeywordsService.getKeywordList(
                         page,
@@ -265,7 +267,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                         keywordType,
                         avesApiSearchKeywordsDTO.getReachStandard() != null
                                 && avesApiSearchKeywordsDTO.getReachStandard() == 1,
-                        subscriptionId,
                         column,
                         order,
                         buttonColumn,
@@ -399,7 +400,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         if (site == null) {
             return Result.error("站点不存在!");
         }
-        if (StringUtil.isEmpty(site.getDomain())) {
+        if (StringUtil.isEmpty(site.getDomain()) || Objects.equals(site.getIsDomain(), 0)) {
             return Result.error("站点域名未设置!");
         }
         UserPlanSubscription currentSeoAndSiteSubscription =
@@ -454,7 +455,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                         continue;
                     }
                     SeoKeywords seoKeywords = new SeoKeywords();
-                    seoKeywords.setAppKey("adweb");
+                    seoKeywords.setAppKey(AdwebConstant.APPKEY);
                     seoKeywords.setSiteCode(site.getCode());
                     seoKeywords.setKeywords(value2);
                     seoKeywords.setDomain(site.getDomain());
@@ -470,7 +471,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                     }
                     seoKeywords.setLastRank(0);
                     seoKeywords.setSearchStatus(0);
-                    seoKeywords.setSubscriptionId(currentSeoAndSiteSubscription.getId());
                     list.add(seoKeywords);
                 }
 
@@ -481,8 +481,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
                 LambdaQueryWrapper<SeoKeywords> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.eq(SeoKeywords::getSiteCode, site.getCode());
                 queryWrapper.ne(SeoKeywords::getStatus, 0);
-                queryWrapper.eq(
-                        SeoKeywords::getSubscriptionId, currentSeoAndSiteSubscription.getId());
+
                 List<SeoKeywords> existingKeywordList = seoKeywordsService.list(queryWrapper);
                 if (CollectionUtil.isNotEmpty(existingKeywordList)) {
                     List<String> existingKeywords = new ArrayList<>();
@@ -538,7 +537,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         queryWrapper.eq(SeoKeywords::getKeywords, seoKeywords.getKeywords());
         queryWrapper.eq(SeoKeywords::getSiteCode, seoKeywords.getSiteCode());
         queryWrapper.ne(SeoKeywords::getStatus, 0);
-        queryWrapper.eq(SeoKeywords::getSubscriptionId, seoKeywords.getSubscriptionId());
         List<SeoKeywords> seoKeywordsList = seoKeywordsService.list(queryWrapper);
         if (!seoKeywordsList.isEmpty()) {
             return Result.OK(false);
@@ -563,7 +561,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
         if (type == 2) {
             LambdaQueryWrapper<SeoKeywords> queryWrapper2 = new LambdaQueryWrapper<>();
             queryWrapper2.ne(SeoKeywords::getStatus, 0);
-            queryWrapper2.eq(SeoKeywords::getSubscriptionId, temp.getSubscriptionId());
             queryWrapper2.eq(SeoKeywords::getRelatedKeywordId, id);
             if (seoKeywordsService.count(queryWrapper2) > 0) {
                 return Result.error("此关键词已经关联长尾词!");

+ 0 - 12
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKeywords.java

@@ -161,18 +161,6 @@ public class SeoKeywords implements Serializable {
     @Schema(description = "相关关键词关联的关键词的id")
     private Integer relatedKeywordId;
     /**
-     * 关键词对应套餐的ID
-     */
-    @Excel(name = "关键词对应套餐的ID", width = 15)
-    @Schema(description = "关键词对应套餐的ID")
-    private String planId;
-    /**
-     * 订购表ID
-     */
-    @Excel(name = "订购表ID", width = 15)
-    @Schema(description = "订购表ID")
-    private java.lang.String subscriptionId;
-    /**
      * 网站表ID
      */
     @Excel(name = "网站表ID", width = 15)

+ 1 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoKeywordsMapper.java

@@ -23,11 +23,10 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
      * 根据站点和套餐id
      *
      * @param siteCode
-     * @param subscriptionId
      * @return
      */
     List<String> getKeywordsLastSevenDays(
-            String siteCode, String subscriptionId, Integer keywordType);
+            String siteCode, Integer keywordType);
 
     /**
      * 查询关键词排名数据
@@ -37,7 +36,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
      */
     RankInfoVO queryKeywordNumByRankRange(
             @Param("siteCode") String siteCode,
-            @Param("subscriptionId") String subscriptionId,
             @Param("rankStart") Integer rankStart,
             @Param("rankEnd") Integer rankEnd,
             @Param("dateStr") String dateStr,
@@ -65,7 +63,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
             String siteCode,
             Integer keywordType,
             String datesStr,
-            String subscriptionId,
             String column,
             String order,
             String buttonColumn,
@@ -84,7 +81,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
      * @param page
      * @param siteCode
      * @param keywords
-     * @param subscriptionId
      * @param lastSearchTime
      * @param createTime
      * @param keywordType
@@ -97,7 +93,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
             Page<SeoKeywords> page,
             String siteCode,
             String keywords,
-            String subscriptionId,
             String lastSearchTime,
             String createTime,
             Integer keywordType,
@@ -111,7 +106,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
      * @param page
      * @param siteCode
      * @param keywords
-     * @param subscriptionId
      * @param lastSearchTime
      * @param createTime
      * @param keywordType
@@ -124,7 +118,6 @@ public interface SeoKeywordsMapper extends BaseMapper<SeoKeywords> {
             Page<SeoKeywords> page,
             String siteCode,
             String keywords,
-            String subscriptionId,
             String lastSearchTime,
             String createTime,
             Integer keywordType,

+ 1 - 21
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/SeoKeywordsMapper.xml

@@ -10,7 +10,6 @@
         AND t2.app_key = 'adweb'
         AND t2.site_code = #{siteCode}
         AND t2.keyword_type = #{keywordType}
-        AND t2.subscription_id = #{subscriptionId}
         GROUP BY t1.se_date
         ORDER BY t1.se_date DESC
         LIMIT 7
@@ -30,7 +29,6 @@
         t1.site_code = #{siteCode}
         AND `status` = 1
         AND keyword_type = #{keywordType}
-        AND subscription_id = #{subscriptionId}
         <if test="rankStart != null">
             AND t1.last_rank >= #{rankStart}
         </if>
@@ -61,9 +59,6 @@
         <if test="keywordType != null">
             AND t2.keyword_type = #{keywordType}
         </if>
-        <if test="!subscriptionId">
-            AND t2.subscription_id = #{subscriptionId}
-        </if>
         AND se_date IN ${dateStr}
         GROUP BY keywords_id
         ) t3
@@ -111,9 +106,6 @@
             </if>
             AND t1.app_key = 'adweb'
             AND t1.`status` = 1
-            <if test="!subscriptionId">
-                AND t1.subscription_id = #{subscriptionId}
-            </if>
             AND
             (
             id IN
@@ -137,9 +129,6 @@
             <if test="keywordType != null">
                 AND t2.keyword_type = #{keywordType}
             </if>
-            <if test="!subscriptionId">
-                AND t2.subscription_id = #{subscriptionId}
-            </if>
             AND se_date IN ${datesStr}
             GROUP BY keywords_id
             ) t3
@@ -169,7 +158,7 @@
         WHERE
         status = 1
         AND
-        search_status != 1
+        (search_status != 1 or search_status IS NULL)
         AND site_code IN
         <foreach collection="sideCodes" item="sideCode" open="(" separator="," close=")">
             #{sideCode}
@@ -203,9 +192,6 @@
         <if test="createTime != null and createTime != ''">
             AND t1.create_time LIKE CONCAT(#{createTime}, '%')
         </if>
-        <if test="subscriptionId != null and subscriptionId != ''">
-            AND t1.subscription_id = #{subscriptionId}
-        </if>
         <if test="lastSearchTime != null and lastSearchTime != ''">
             AND t1.last_search_time LIKE CONCAT(#{lastSearchTime}, '%')
         </if>
@@ -250,9 +236,6 @@
         <if test="createTime != null and createTime != ''">
             AND t1.create_time LIKE CONCAT(#{createTime}, '%')
         </if>
-        <if test="subscriptionId != null and subscriptionId != ''">
-            AND t1.subscription_id = #{subscriptionId}
-        </if>
         <if test="lastSearchTime != null and lastSearchTime != ''">
             AND t1.last_search_time LIKE CONCAT(#{lastSearchTime}, '%')
         </if>
@@ -297,9 +280,6 @@
         <if test="createTime != null and createTime != ''">
             AND t1.create_time LIKE CONCAT(#{createTime}, '%')
         </if>
-        <if test="subscriptionId != null and subscriptionId != ''">
-            AND t1.subscription_id = #{subscriptionId}
-        </if>
         <if test="lastSearchTime != null and lastSearchTime != ''">
             AND t1.last_search_time LIKE CONCAT(#{lastSearchTime}, '%')
         </if>

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

@@ -25,7 +25,7 @@ public interface ISeoKeywordsRankService {
 
     Map getRankInfo(String siteCode) throws ParseException;
 
-    List<SeoRankInfoVO> getSeoRankInfo(String siteCode, String subscriptionId)
+    List<SeoRankInfoVO> getSeoRankInfo(String siteCode)
             throws ParseException;
 
     void addRankInfoByIntervalTimeByType(

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

@@ -19,11 +19,10 @@ import java.util.List;
 public interface ISeoKeywordsService extends IService<SeoKeywords> {
 
     List<String> getKeywordsLastSevenDays(
-            String userFlag, Integer keywordType, String subscriptionId);
+            String userFlag, Integer keywordType);
 
     RankInfoVO getSeoRankInfo(
             String siteCode,
-            String subscriptionId,
             Integer rankStart,
             Integer rankEnd,
             String dateStr,
@@ -37,7 +36,6 @@ public interface ISeoKeywordsService extends IService<SeoKeywords> {
             String siteCode,
             Integer keywordType,
             boolean reachStandard,
-            String subscriptionId,
             String column,
             String order,
             String buttonColumn,
@@ -49,7 +47,6 @@ public interface ISeoKeywordsService extends IService<SeoKeywords> {
             Page<SeoKeywords> page,
             String siteCode,
             String keywords,
-            String subscriptionId,
             String lastSearchTime,
             String createTime,
             Integer keywordType,

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

@@ -1,6 +1,5 @@
 package org.jeecg.modules.adweb.seo.service.impl;
 
-import static org.jeecg.modules.adweb.seo.dto.ComprehensiveStatistics.KeywordRankStats;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xkcoding.http.util.StringUtil;
@@ -155,23 +154,24 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
             comprehensiveStatistics.setPlanLongTailKeywordNum(subscribePlan.getLongTailKeyword());
             comprehensiveStatistics.setPlanOuterLinkNum(subscribePlan.getExternalLinks());
             comprehensiveStatistics.setPlanArticleNum(subscribePlan.getArticle());
-        }
-        // 添加站点数据
-        // 1.获取站点指定词数量
-        List<KeywordRankStats> keywordRankStats =
-                seoKeywordsMapper.getKeywordsRankStats(
-                        siteCode,
-                        Optional.ofNullable(subscribePlan.getTarget()).orElse(10)); // 默认排名前10
-        for (KeywordRankStats rankStats : keywordRankStats) {
-            if (rankStats.getKeywordType() == 1) {
-                // 指定词
-                comprehensiveStatistics.setAppointKeywordNum(rankStats.getKeywordNum());
-                comprehensiveStatistics.setAchievedAppointKeywordNum(
-                        rankStats.getAchievedKeywordNum());
-            } else {
-                comprehensiveStatistics.setLongTailKeywordNum(rankStats.getKeywordNum());
-                comprehensiveStatistics.setAchievedLongTailKeywordNum(
-                        rankStats.getAchievedKeywordNum());
+
+            // 添加站点数据
+            // 1.获取站点指定词数量
+            List<ComprehensiveStatistics.KeywordRankStats> keywordRankStats =
+                    seoKeywordsMapper.getKeywordsRankStats(
+                            siteCode,
+                            Optional.ofNullable(subscribePlan.getTarget()).orElse(10)); // 默认排名前10
+            for (ComprehensiveStatistics.KeywordRankStats rankStats : keywordRankStats) {
+                if (rankStats.getKeywordType() == 1) {
+                    // 指定词
+                    comprehensiveStatistics.setAppointKeywordNum(rankStats.getKeywordNum());
+                    comprehensiveStatistics.setAchievedAppointKeywordNum(
+                            rankStats.getAchievedKeywordNum());
+                } else {
+                    comprehensiveStatistics.setLongTailKeywordNum(rankStats.getKeywordNum());
+                    comprehensiveStatistics.setAchievedLongTailKeywordNum(
+                            rankStats.getAchievedKeywordNum());
+                }
             }
         }
 
@@ -184,18 +184,20 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
         AdwebSite siteByCode = adwebSiteService.getSiteByCode(siteCode);
         UserPlanSubscription userPlanSubscription =
                 userPlanSubscriptionService.getCurrentSubscription(siteByCode.getId());
-        // 通过站点获取订阅id
-        List<SeoRankInfoVO> seoRankInfos =
-                this.getSeoRankInfo(siteCode, userPlanSubscription.getId());
         Map map = new HashMap<>();
-        map.put("appointKeyword", seoRankInfos.get(0));
-        map.put("longTailKeyword", seoRankInfos.get(1));
-
-        // TODO - 获取达标时间和剩余服务时间
-        if (userPlanSubscription.getKeywordsAchieveTime() == null) {
-            seoKeywordsSerpMapper.getAchieveDate(siteCode, 10, 10, 10);
+        if (userPlanSubscription != null) {
+            // 通过站点获取订阅id
+            List<SeoRankInfoVO> seoRankInfos =
+                    this.getSeoRankInfo(siteCode);
+            map.put("appointKeyword", seoRankInfos.get(0));
+            map.put("longTailKeyword", seoRankInfos.get(1));
+
+            // TODO - 获取达标时间和剩余服务时间
+            if (userPlanSubscription.getKeywordsAchieveTime() == null) {
+                seoKeywordsSerpMapper.getAchieveDate(siteCode, 10, 10, 10);
+            }
+            map.put("serviceTime", new ServiceTimeVO());
         }
-        map.put("serviceTime", new ServiceTimeVO());
         return map;
     }
 
@@ -206,13 +208,13 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
      * @return 关键词排名数量
      */
     @Override
-    public List<SeoRankInfoVO> getSeoRankInfo(String siteCode, String subscriptionId)
+    public List<SeoRankInfoVO> getSeoRankInfo(String siteCode)
             throws ParseException {
         // 排名信息
         SeoRankInfoVO appointRankInfo = new SeoRankInfoVO();
         SeoRankInfoVO longTailRankInfo = new SeoRankInfoVO();
         // 1-10
-        Map<String, Integer> first = dealKeywordsRankData(siteCode, subscriptionId, 1, 10);
+        Map<String, Integer> first = dealKeywordsRankData(siteCode, 1, 10);
         if (first.containsKey("appoint")) {
             appointRankInfo.setFirstNum(first.get("appoint"));
         }
@@ -221,7 +223,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
         }
 
         // 11-30
-        Map<String, Integer> second = dealKeywordsRankData(siteCode, subscriptionId, 11, 30);
+        Map<String, Integer> second = dealKeywordsRankData(siteCode, 11, 30);
         if (second.containsKey("appoint")) {
             appointRankInfo.setSecondNum(second.get("appoint"));
         }
@@ -229,7 +231,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
             longTailRankInfo.setSecondNum(second.get("longTail"));
         }
         // 31-100
-        Map<String, Integer> third = dealKeywordsRankData(siteCode, subscriptionId, 31, 100);
+        Map<String, Integer> third = dealKeywordsRankData(siteCode, 31, 100);
         if (third.containsKey("appoint")) {
             appointRankInfo.setThirdType(third.get("appoint"));
         }
@@ -243,12 +245,12 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
     }
 
     private Map<String, Integer> dealKeywordsRankData(
-            String siteCode, String subscriptionId, Integer rankStart, Integer rankEnd) {
+            String siteCode, Integer rankStart, Integer rankEnd) {
         Map<String, Integer> KeywordsRankMap = new HashMap<>();
 
         // 指定词
         List<String> appointDateList =
-                seoKeywordsService.getKeywordsLastSevenDays(siteCode, 1, subscriptionId);
+                seoKeywordsService.getKeywordsLastSevenDays(siteCode, 1);
         String appointDatesStr = "";
         if (CollectionUtils.isNotEmpty(appointDateList)) {
             for (int i = 0; i < appointDateList.size(); i++) {
@@ -263,7 +265,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
             // 指定词
             RankInfoVO appointRankInfo =
                     seoKeywordsMapper.queryKeywordNumByRankRange(
-                            siteCode, subscriptionId, rankStart, rankEnd, appointDatesStr, "1");
+                            siteCode, rankStart, rankEnd, appointDatesStr, "1");
             if (appointRankInfo != null) {
                 KeywordsRankMap.put("appoint", appointRankInfo.getKeywordNum());
             }
@@ -271,7 +273,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
 
         // 长尾词
         List<String> dateList =
-                seoKeywordsService.getKeywordsLastSevenDays(siteCode, 2, subscriptionId);
+                seoKeywordsService.getKeywordsLastSevenDays(siteCode, 2);
         String dateStr = "";
         if (CollectionUtils.isNotEmpty(dateList)) {
             for (int i = 0; i < dateList.size(); i++) {
@@ -284,7 +286,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
             dateStr = "(" + dateStr + ")";
             RankInfoVO longRankInfo =
                     seoKeywordsMapper.queryKeywordNumByRankRange(
-                            siteCode, subscriptionId, rankStart, rankEnd, dateStr, "2");
+                            siteCode, rankStart, rankEnd, dateStr, "2");
             if (longRankInfo != null) {
                 KeywordsRankMap.put("longTail", longRankInfo.getKeywordNum());
             }

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

@@ -33,15 +33,14 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
      *
      * @param userFlag
      * @param keywordType
-     * @param subscriptionId
      * @return
      */
     @Override
     public List<String> getKeywordsLastSevenDays(
-            String userFlag, Integer keywordType, String subscriptionId) {
+            String userFlag, Integer keywordType) {
         // 获取对应站点最近七天
         List<String> dateList =
-                seoKeywordsMapper.getKeywordsLastSevenDays(userFlag, subscriptionId, keywordType);
+                seoKeywordsMapper.getKeywordsLastSevenDays(userFlag, keywordType);
         return dateList;
     }
 
@@ -54,14 +53,13 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
     @Override
     public RankInfoVO getSeoRankInfo(
             String siteCode,
-            String subscriptionId,
             Integer rankStart,
             Integer rankEnd,
             String dateStr,
             String keywordType) {
         // 指定词
         return seoKeywordsMapper.queryKeywordNumByRankRange(
-                siteCode, subscriptionId, rankStart, rankEnd, dateStr, keywordType);
+                siteCode, rankStart, rankEnd, dateStr, keywordType);
     }
 
     /**
@@ -78,7 +76,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
             String siteCode,
             Integer keywordType,
             boolean reachStandard,
-            String subscriptionId,
             String column,
             String order,
             String buttonColumn,
@@ -119,7 +116,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
                 siteCode,
                 keywordType,
                 datesStr,
-                subscriptionId,
                 column,
                 order,
                 buttonColumn,
@@ -132,7 +128,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
      * @param page
      * @param siteCode
      * @param keywords
-     * @param subscriptionId
      * @param lastSearchTime
      * @param createTime
      * @param keywordType
@@ -146,7 +141,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
             Page<SeoKeywords> page,
             String siteCode,
             String keywords,
-            String subscriptionId,
             String lastSearchTime,
             String createTime,
             Integer keywordType,
@@ -159,7 +153,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
                     page,
                     siteCode,
                     keywords,
-                    subscriptionId,
                     lastSearchTime,
                     createTime,
                     keywordType,
@@ -172,7 +165,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
                     page,
                     siteCode,
                     keywords,
-                    subscriptionId,
                     lastSearchTime,
                     createTime,
                     keywordType,
@@ -188,7 +180,6 @@ public class SeoKeywordsServiceImpl extends ServiceImpl<SeoKeywordsMapper, SeoKe
                 page,
                 siteCode,
                 keywords,
-                subscriptionId,
                 lastSearchTime,
                 createTime,
                 keywordType,

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

@@ -259,7 +259,7 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
     queryWrapper
         .ne(AdwebSite::getStatus, AdwebConstant.SITE_DEL)
         .isNull(AdwebSite::getParentGroupCode)
-        .orderByDesc(AdwebSite::getUtime);
+        .orderByAsc(AdwebSite::getCreateTime);
     queryWrapper.select(
         AdwebSite::getId,
         AdwebSite::getName,

+ 6 - 7
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/subscription/controller/SubscribePlanController.java

@@ -22,7 +22,6 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.adweb.subscription.entity.SubscribePlan;
 import org.jeecg.modules.adweb.subscription.service.ISubscribePlanService;
 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;
 
@@ -78,7 +77,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      */
     @AutoLog(value = "网站营销方案套餐表-添加")
     @Operation(summary = "网站营销方案套餐表-添加")
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:add')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:add')")
     @PostMapping(value = "/add")
     public Result<String> add(@RequestBody SubscribePlan subscribePlan) {
 
@@ -109,7 +108,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      */
     @AutoLog(value = "网站营销方案套餐表-编辑")
     @Operation(summary = "网站营销方案套餐表-编辑")
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:edit')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:edit')")
     @RequestMapping(
             value = "/edit",
             method = {RequestMethod.PUT, RequestMethod.POST})
@@ -126,7 +125,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      */
     @AutoLog(value = "网站营销方案套餐表-通过id删除")
     @Operation(summary = "网站营销方案套餐表-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:delete')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:delete')")
     @DeleteMapping(value = "/delete")
     public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
         subscribePlanService.removeById(id);
@@ -141,7 +140,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      */
     @AutoLog(value = "网站营销方案套餐表-批量删除")
     @Operation(summary = "网站营销方案套餐表-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:deleteBatch')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:deleteBatch')")
     @DeleteMapping(value = "/deleteBatch")
     public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         this.subscribePlanService.removeByIds(Arrays.asList(ids.split(",")));
@@ -171,7 +170,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      * @param request
      * @param subscribePlan
      */
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:exportXls')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:exportXls')")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, SubscribePlan subscribePlan) {
         return super.exportXls(request, subscribePlan, SubscribePlan.class, "网站营销方案套餐表");
@@ -184,7 +183,7 @@ public class SubscribePlanController extends JeecgController<SubscribePlan, ISub
      * @param response
      * @return
      */
-    @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:importExcel')")
+    // @PreAuthorize("@jps.requiresPermissions('adweb:subscribe_plan:importExcel')")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, SubscribePlan.class);

+ 9 - 3
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -425,12 +425,18 @@ logistics:
   meiri56:
     token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInVzZXJuYW1lIjogInN1aGFvIiwKICAgICJzdWIiOiAibG9naW4iLAogICAgImlhdCI6IDE3MzIyNDcwOTAsCiAgICAiZXhwIjogMTczMjMzMzQ5MAp9.rI3IsN8qsfKiBqS6YQn45dQiTvPdoY_GcMJOR1FgKDk
 
+### 跨境支付 - PingPong,Alibaba Pay 等
+payment:
+  apc:
+    encrypt-key: QG+Y4ChKwPR9Ua7i/v9Lx/htPZP64R2eR1KBJ1BHofY=
+    sign-key: 2ce25a15426e4f1290bf5e4c3b5def1a
+
 ### 外贸大数据 - 外贸公社
 tradesparq:
   api:
     host: https://openapi.tradesparq.com
-    id: Sw5bYYe7
-    secret: j4ThjI10jiV3L3y7
+    id: fu3owEv4
+    secret: jdWcRMII70cSk07E
 
 ### 询盘列表配置
 enquiry:
@@ -472,4 +478,4 @@ serverIp:
 resource-quota:
   default-website-quota: 1
   default-ai-power-quota: 10
-  default-customs-data-quota: 10
+  default-customs-data-quota: 0

+ 7 - 1
jeecg-module-system/jeecg-system-start/src/main/resources/application-prod.yml

@@ -430,6 +430,12 @@ logistics:
   meiri56:
     token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInVzZXJuYW1lIjogInN1aGFvIiwKICAgICJzdWIiOiAibG9naW4iLAogICAgImlhdCI6IDE3MzIyNDcwOTAsCiAgICAiZXhwIjogMTczMjMzMzQ5MAp9.rI3IsN8qsfKiBqS6YQn45dQiTvPdoY_GcMJOR1FgKDk
 
+### 跨境支付 - PingPong,Alibaba Pay 等
+payment:
+  apc:
+    encrypt-key: gfdfX8qY/MlyIk3JvaIEJ38mViTCwqTJBacrBpfWj2c=
+    sign-key: 118c2fed89a9421dbf51bbbdd28486b5
+
 ### 外贸大数据 - 外贸公社
 tradesparq:
   api:
@@ -477,4 +483,4 @@ serverIp:
 resource-quota:
   default-website-quota: 1
   default-ai-power-quota: 200
-  default-customs-data-quota: 100
+  default-customs-data-quota: 0

+ 9 - 3
jeecg-module-system/jeecg-system-start/src/main/resources/application-test.yml

@@ -424,12 +424,18 @@ logistics:
   meiri56:
     token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICAgInVzZXJuYW1lIjogInN1aGFvIiwKICAgICJzdWIiOiAibG9naW4iLAogICAgImlhdCI6IDE3MzIyNDcwOTAsCiAgICAiZXhwIjogMTczMjMzMzQ5MAp9.rI3IsN8qsfKiBqS6YQn45dQiTvPdoY_GcMJOR1FgKDk
 
+### 跨境支付 - PingPong,Alibaba Pay 等
+payment:
+  apc:
+    encrypt-key: QG+Y4ChKwPR9Ua7i/v9Lx/htPZP64R2eR1KBJ1BHofY=
+    sign-key: 2ce25a15426e4f1290bf5e4c3b5def1a
+
 ### 外贸大数据 - 外贸公社
 tradesparq:
   api:
     host: https://openapi.tradesparq.com
-    id: Sw5bYYe7
-    secret: j4ThjI10jiV3L3y7
+    id: fu3owEv4
+    secret: jdWcRMII70cSk07E
 
 ### 询盘列表配置
 enquiry:
@@ -471,4 +477,4 @@ serverIp:
 resource-quota:
   default-website-quota: 1
   default-ai-power-quota: 10
-  default-customs-data-quota: 10
+  default-customs-data-quota: 0

+ 2 - 0
jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/adweb/payment/APCTest.java

@@ -0,0 +1,2 @@
+package org.jeecg.modules.adweb.payment;public class APCTest {
+}