1
0
wfansh 1 місяць тому
батько
коміт
09145567ba

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

@@ -35,12 +35,12 @@ import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
 import org.jeecg.modules.adweb.seo.dto.ChangeTypeDTO;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
-import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
-import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
+import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
+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;
@@ -78,7 +78,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 
     @Autowired private IAdwebSiteService adwebSiteService;
 
-    @Autowired private IUserPlanSubscriptionService seoPlanSubscriptionService;
+    @Autowired private IUserPlanSubscriptionService userPlanSubscriptionService;
 
     @Value("${jeecg.path.upload}")
     private String uploadUrl;
@@ -403,7 +403,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
             return Result.error("站点域名未设置!");
         }
         UserPlanSubscription currentSeoAndSiteSubscription =
-                seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(site.getId());
+                userPlanSubscriptionService.getCurrentSubscription(site.getId());
 
         if (currentSeoAndSiteSubscription == null) {
             return Result.error("当前站点没有有效的订阅套餐!");

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

@@ -20,19 +20,19 @@ import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.seo.dto.ComprehensiveStatistics;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywordsSerp;
-import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
 import org.jeecg.modules.adweb.seo.mapper.SeoKeywordsMapper;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsSerpService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
-import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.adweb.seo.vo.RankInfoVO;
 import org.jeecg.modules.adweb.seo.vo.SeoRankInfoVO;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
 import org.jeecg.modules.adweb.subscription.entity.SubscribePlan;
+import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
 import org.jeecg.modules.adweb.subscription.mapper.SubscribePlanMapper;
+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.stereotype.Service;
@@ -57,7 +57,7 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
 
     @Autowired private ISiteUserPermissionService siteUserPermissionService;
 
-    @Autowired private IUserPlanSubscriptionService seoPlanSubscriptionService;
+    @Autowired private IUserPlanSubscriptionService userPlanSubscriptionService;
 
     @Autowired private ISeoKeywordsService seoKeywordsService;
 
@@ -104,28 +104,29 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
             siteIds.add(site.getId());
         }
 
-        LambdaQueryWrapper<UserPlanSubscription> historyQueryWrapper = new LambdaQueryWrapper<>();
-        historyQueryWrapper.select(
+        LambdaQueryWrapper<UserPlanSubscription> subscriptionQueryWrapper =
+                new LambdaQueryWrapper<>();
+        subscriptionQueryWrapper.select(
                 UserPlanSubscription::getId,
                 UserPlanSubscription::getPlanId,
                 UserPlanSubscription::getSiteId,
                 UserPlanSubscription::getPlanName,
                 UserPlanSubscription::getPlanType);
-        historyQueryWrapper.in(UserPlanSubscription::getSiteId, siteIds);
-        historyQueryWrapper.eq(UserPlanSubscription::getStatus, 1);
-        List<UserPlanSubscription> seoPlanSubscriptions =
-                seoPlanSubscriptionService.list(historyQueryWrapper);
-        if (CollectionUtils.isEmpty(seoPlanSubscriptions)) {
+        subscriptionQueryWrapper.in(UserPlanSubscription::getSiteId, siteIds);
+        subscriptionQueryWrapper.eq(UserPlanSubscription::getStatus, 1);
+        List<UserPlanSubscription> userPlanSubscriptions =
+                userPlanSubscriptionService.list(subscriptionQueryWrapper);
+        if (CollectionUtils.isEmpty(userPlanSubscriptions)) {
             return;
         }
 
         for (AdwebSite site : siteList) {
-            for (UserPlanSubscription seoPlanSubscription : seoPlanSubscriptions) {
-                if (seoPlanSubscription.getSiteId().equals(site.getId() + "")) {
-                    site.setPlanId(seoPlanSubscription.getPlanId());
-                    site.setPlanName(seoPlanSubscription.getPlanName());
-                    site.setSubscriptionId(seoPlanSubscription.getId());
-                    site.setPlanType(seoPlanSubscription.getPlanType());
+            for (UserPlanSubscription userPlanSubscription : userPlanSubscriptions) {
+                if (userPlanSubscription.getSiteId().equals(site.getId() + "")) {
+                    site.setPlanId(userPlanSubscription.getPlanId());
+                    site.setPlanName(userPlanSubscription.getPlanName());
+                    site.setSubscriptionId(userPlanSubscription.getId());
+                    site.setPlanType(userPlanSubscription.getPlanType());
                 }
             }
         }
@@ -182,11 +183,11 @@ public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
     public Map getRankInfo(String siteCode) throws ParseException {
         // 通过站点code获取站点id
         AdwebSite siteByCode = adwebSiteService.getSiteByCode(siteCode);
-        UserPlanSubscription seoPlanSubscription =
-                seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(siteByCode.getId());
+        UserPlanSubscription userPlanSubscription =
+                userPlanSubscriptionService.getCurrentSubscription(siteByCode.getId());
         // 通过站点获取订阅id
         List<SeoRankInfoVO> seoRankInfos =
-                this.getSeoRankInfo(siteCode, seoPlanSubscription.getId());
+                this.getSeoRankInfo(siteCode, userPlanSubscription.getId());
         Map map = new HashMap<>();
         map.put("appointKeyword", seoRankInfos.get(0));
         map.put("longTailKeyword", seoRankInfos.get(1));

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

@@ -29,12 +29,12 @@ import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.config.security.utils.SecureUtil;
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
-import org.jeecg.modules.adweb.subscription.mapper.UserPlanSubscriptionMapper;
 import org.jeecg.modules.adweb.site.dto.param.SiteStepDTO;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.entity.AdwebSitePermission;
 import org.jeecg.modules.adweb.site.entity.Sohoeb2bOrder;
 import org.jeecg.modules.adweb.site.service.*;
+import org.jeecg.modules.adweb.subscription.mapper.UserPlanSubscriptionMapper;
 import org.jeecg.modules.adweb.system.service.SysAdwebApi;
 import org.jeecg.modules.base.service.BaseCommonService;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -65,7 +65,7 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
 
     @Resource private ISitePermissionService sitePermissionService;
 
-    @Resource private UserPlanSubscriptionMapper seoPlanSubscriptionMapper;
+    @Resource private UserPlanSubscriptionMapper userPlanSubscriptionMapper;
 
     @Resource private SelfWebSiteService selfWebSiteService;
 
@@ -104,7 +104,7 @@ public class AdwebSiteController extends JeecgController<AdwebSite, IAdwebSiteSe
         List<AdwebSite> siteList = pageList.getRecords();
         for (AdwebSite site : siteList) {
             Map<String, String> marketPlan =
-                    seoPlanSubscriptionMapper.getSubscribePlanBySiteId(site.getId());
+                    userPlanSubscriptionMapper.getSubscribePlanBySiteId(site.getId());
             JSONObject object =
                     FastJsonUtil.parseObject(
                             FastJsonUtil.toJSONString(marketPlan), JSONObject.class);

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

@@ -1,8 +1,11 @@
 package org.jeecg.modules.adweb.site.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+
 import jakarta.annotation.Resource;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.system.vo.LoginUser;
@@ -10,11 +13,11 @@ import org.jeecg.common.util.FastJsonUtil;
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.common.util.DateUtil;
 import org.jeecg.modules.adweb.enquiry.constant.EnquiryDistributeTypeConstant;
-import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
-import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.subscription.entity.SubscribePlan;
+import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
 import org.jeecg.modules.adweb.subscription.service.ISubscribePlanService;
+import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.adweb.theme.entity.AdwebTheme;
 import org.jeecg.modules.adweb.theme.service.IAdwebThemeService;
 import org.jeecg.modules.system.service.ISysUserTenantService;
@@ -22,11 +25,12 @@ import org.jeecg.modules.system.vo.SysUserTenantVo;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import javax.transaction.Transactional;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import javax.transaction.Transactional;
+
 @Service
 @Slf4j
 public class SelfWebSiteServiceCommon {
@@ -47,7 +51,7 @@ public class SelfWebSiteServiceCommon {
 
     @Resource private IAdwebThemeService adwebThemeService;
 
-    @Resource private IUserPlanSubscriptionService seoPlanSubscriptionService;
+    @Resource private IUserPlanSubscriptionService userPlanSubscriptionService;
 
     @Resource private ISubscribePlanService subscribePlanService;
 
@@ -152,7 +156,7 @@ public class SelfWebSiteServiceCommon {
             } else {
                 history.setCompensateDay(0);
             }
-            seoPlanSubscriptionService.addSeoPlanSubscription(history, sysUser);
+            userPlanSubscriptionService.addUserPlanSubscription(history, sysUser);
         }
 
         log.info("================新站点授权===============");

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

@@ -10,11 +10,11 @@ import lombok.extern.slf4j.Slf4j;
 
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.modules.adweb.common.util.DateUtil;
-import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
-import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.adweb.site.dto.result.SiteBasicInfo;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.mapper.AdwebSiteMapper;
+import org.jeecg.modules.adweb.subscription.entity.UserPlanSubscription;
+import org.jeecg.modules.adweb.subscription.service.IUserPlanSubscriptionService;
 import org.jeecg.modules.system.mapper.SysDictMapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,7 +35,7 @@ public class SiteManageService {
 
     @Resource private IAdwebSiteService adwebSiteService;
 
-    @Resource private IUserPlanSubscriptionService seoPlanSubscriptionService;
+    @Resource private IUserPlanSubscriptionService userPlanSubscriptionService;
 
     @Resource private SysDictMapper sysDictMapper;
 
@@ -97,7 +97,7 @@ public class SiteManageService {
 
         // 获取绑定的套餐信息
         UserPlanSubscription history =
-                seoPlanSubscriptionService.getCurrentSeoAndSiteSubscription(adwebSite.getId());
+                userPlanSubscriptionService.getCurrentSubscription(adwebSite.getId());
         String defaultPlanName = sysDictMapper.getDefaultPlanName();
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");