Browse Source

Merge branch 'dev-zenas-20241018' of wangfan/adweb3-server into master

zhangqiang 5 months ago
parent
commit
bf7fea69d5
17 changed files with 87 additions and 892 deletions
  1. 0 166
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/HistoryReachStandardSiteController.java
  2. 15 51
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java
  3. 55 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsRankController.java
  4. 0 197
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKpiStatisticsController.java
  5. 2 2
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/dto/AvesApiSearchKeywordsDTO.java
  6. 0 59
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/HistoryReachStandardSite.java
  7. 8 5
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKeywords.java
  8. 0 116
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKpiStatistics.java
  9. 0 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/HistoryReachStandardSiteMapper.java
  10. 0 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoKpiStatisticsMapper.java
  11. 0 5
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/HistoryReachStandardSiteMapper.xml
  12. 0 5
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/SeoKpiStatisticsMapper.xml
  13. 0 14
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/IHistoryReachStandardSiteService.java
  14. 1 3
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/ISeoKeywordsRankService.java
  15. 0 19
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/HistoryReachStandardSiteServiceImpl.java
  16. 2 214
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SearchKeywordsServiceImpl.java
  17. 4 8
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsRankServiceImpl.java

+ 0 - 166
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/HistoryReachStandardSiteController.java

@@ -1,166 +0,0 @@
-package org.jeecg.modules.adweb.seo.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
-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.HistoryReachStandardSite;
-import org.jeecg.modules.adweb.seo.service.IHistoryReachStandardSiteService;
-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 java.util.Arrays;
-
-/**
- * @Description: 历史达标站点关键词达标数据表
- * @Author: jeecg-boot
- * @Date:   2024-10-16
- * @Version: V1.0
- */
-@Tag(name="历史达标站点关键词达标数据表")
-@RestController
-@RequestMapping("/serp/historyReachStandardSite")
-@Slf4j
-public class HistoryReachStandardSiteController extends JeecgController<HistoryReachStandardSite, IHistoryReachStandardSiteService> {
-	@Autowired
-	private IHistoryReachStandardSiteService historyReachStandardSiteService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param historyReachStandardSite
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "历史达标站点关键词达标数据表-分页列表查询")
-	@Operation(summary="历史达标站点关键词达标数据表-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<HistoryReachStandardSite>> queryPageList(HistoryReachStandardSite historyReachStandardSite,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-		QueryWrapper<HistoryReachStandardSite> queryWrapper = QueryGenerator.initQueryWrapper(historyReachStandardSite, req.getParameterMap());
-		Page<HistoryReachStandardSite> page = new Page<HistoryReachStandardSite>(pageNo, pageSize);
-		IPage<HistoryReachStandardSite> pageList = historyReachStandardSiteService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param historyReachStandardSite
-	 * @return
-	 */
-	@AutoLog(value = "历史达标站点关键词达标数据表-添加")
-	@Operation(summary="历史达标站点关键词达标数据表-添加")
-	@PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:add')")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody HistoryReachStandardSite historyReachStandardSite) {
-		historyReachStandardSiteService.save(historyReachStandardSite);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param historyReachStandardSite
-	 * @return
-	 */
-	@AutoLog(value = "历史达标站点关键词达标数据表-编辑")
-	@Operation(summary="历史达标站点关键词达标数据表-编辑")
-    @PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:edit')")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody HistoryReachStandardSite historyReachStandardSite) {
-		historyReachStandardSiteService.updateById(historyReachStandardSite);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "历史达标站点关键词达标数据表-通过id删除")
-	@Operation(summary="历史达标站点关键词达标数据表-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:delete')")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		historyReachStandardSiteService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "历史达标站点关键词达标数据表-批量删除")
-	@Operation(summary="历史达标站点关键词达标数据表-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:deleteBatch')")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.historyReachStandardSiteService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "历史达标站点关键词达标数据表-通过id查询")
-	@Operation(summary="历史达标站点关键词达标数据表-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<HistoryReachStandardSite> queryById(@RequestParam(name="id",required=true) String id) {
-		HistoryReachStandardSite historyReachStandardSite = historyReachStandardSiteService.getById(id);
-		if(historyReachStandardSite==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(historyReachStandardSite);
-	}
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param historyReachStandardSite
-    */
-    @PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:exportXls')")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HistoryReachStandardSite historyReachStandardSite) {
-        return super.exportXls(request, historyReachStandardSite, HistoryReachStandardSite.class, "历史达标站点关键词达标数据表");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @PreAuthorize("@jps.requiresPermissions('serp:history_reach_standard_site:importExcel')")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, HistoryReachStandardSite.class);
-    }
-
-}

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

@@ -3,6 +3,7 @@ package org.jeecg.modules.adweb.seo.controller;
 import cn.hutool.core.io.IoUtil;
 import cn.hutool.poi.excel.ExcelUtil;
 import cn.hutool.poi.excel.ExcelWriter;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -23,13 +24,11 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.adweb.common.util.ListUtil;
 import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
-import org.jeecg.modules.adweb.seo.entity.SeoKpiStatistics;
 import org.jeecg.modules.adweb.seo.service.ISearchKeywordsService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
-import org.jeecg.modules.adweb.seo.service.ISeoKpiStatisticsService;
+import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -47,14 +46,14 @@ import java.util.*;
  */
 @Tag(name="关键词")
 @RestController
-@RequestMapping("/serp/seoKeywords")
+@RequestMapping("/seo/seoKeywords")
 @Slf4j
 public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeywordsService> {
 	@Autowired
 	private ISeoKeywordsService seoKeywordsService;
 
 	@Autowired
-	ISeoKpiStatisticsService seoKpiStatisticsService;
+	ISeoKeywordsRankService seoKpiStatisticsService;
 
 	@Autowired
 	ISearchKeywordsService searchKeywordsService;
@@ -195,71 +194,36 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 										@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
 										@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 										HttpServletRequest req) throws Exception {
-		 if (sysBaseAPI.isNotOwnSite(avesApiSearchKeywordsDTO.getUserFlag())) {
+		 if (sysBaseAPI.isNotOwnSite(avesApiSearchKeywordsDTO.getSiteCode())) {
 			 return Result.OK(new Page<>());
 		 }
 		 // 参数判断
 		 IPage<SeoKeywords> pageList = new Page<>();
-		 String userFlag = req.getParameter("userFlag");
-		 if (StringUtil.isEmpty(userFlag)) {
-			 userFlag = avesApiSearchKeywordsDTO.getUserFlag();
-		 }
-		 if (StringUtil.isEmpty(userFlag)) {
-			 log.info("缺少用户flag参数");
-			 return Result.OK(pageList);
-		 }
-
-		 String historyId = avesApiSearchKeywordsDTO.getHistoryId();
-
-		 // 查询是否具有关键词优化指标
-		 boolean haveAppointKeyword = false;
-		 boolean haveLongTail = false;
-		 QueryWrapper<SeoKpiStatistics> statisticsQueryWrapper = new QueryWrapper<>();
-		 statisticsQueryWrapper.eq("host_code", userFlag);
-		 statisticsQueryWrapper.eq("del_flag", 0);
-		 statisticsQueryWrapper.eq("type", 1);
-		 statisticsQueryWrapper.eq("history_id", historyId);
-		 List<SeoKpiStatistics> seoKpiStatisticsList = seoKpiStatisticsService.list(statisticsQueryWrapper);
-		 if (ListUtil.isEmpty(seoKpiStatisticsList)) {
-			 return Result.OK(pageList);
-		 }
-		 for (SeoKpiStatistics kpiStatistics : seoKpiStatisticsList) {
-			 if (kpiStatistics.getKpiTarget() == null || kpiStatistics.getKpiTarget() == 0) {
-				 continue;
-			 }
-			 if ("APPOINT_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-				 haveAppointKeyword = true;
-			 } else if ("LONG_TAIL_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-				 haveLongTail = true;
-			 }
+		 String siteCode = req.getParameter("siteCode");
+		 if (StringUtil.isEmpty(siteCode)) {
+			 siteCode = avesApiSearchKeywordsDTO.getSiteCode();
 		 }
-
-		 if (!haveAppointKeyword && !haveLongTail) {
+		 if (StringUtil.isEmpty(siteCode)) {
+			 log.info("缺少siteCode参数");
 			 return Result.OK(pageList);
 		 }
-
+		 String subscriptionId = avesApiSearchKeywordsDTO.getSubscriptionId();
 		 Integer keywordType = avesApiSearchKeywordsDTO.getKeywordType();
-		 if (haveAppointKeyword && !haveLongTail) {
-			 keywordType = 1;
-		 } else if (!haveAppointKeyword && haveLongTail) {
-			 keywordType = 2;
-		 }
-
 		 // 查询关键词
 		 String column = req.getParameter("column");
 		 String order = req.getParameter("order");
 		 String buttonColumn = req.getParameter("buttonColmn");
 		 String buttonSort = req.getParameter("buttonSort");
 		 Page<SeoKeywords> page = new Page<SeoKeywords>(pageNo, pageSize);
-		 List<String> dateList = seoKeywordsService.getKeywordsLastSevenDays(userFlag,keywordType,historyId);
+		 List<String> dateList = seoKeywordsService.getKeywordsLastSevenDays(siteCode,keywordType,subscriptionId);
 		 pageList = seoKeywordsService.getKeywordList(page,
 				 avesApiSearchKeywordsDTO.getRankStart(),
 				 avesApiSearchKeywordsDTO.getRankEnd(),
 				 avesApiSearchKeywordsDTO.getKeywords(),
-				 userFlag,
+				 siteCode,
 				 keywordType,
 				 avesApiSearchKeywordsDTO.getReachStandard() != null && avesApiSearchKeywordsDTO.getReachStandard() == 1,
-				 historyId,
+				 subscriptionId,
 				 column,
 				 order,
 				 buttonColumn,
@@ -270,7 +234,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 		 if(pageList == null){
 			 return Result.error("未获取到关键词数据");
 		 }
-		 searchKeywordsService.addRankInfoByIntervalTimeByType(pageList.getRecords(), avesApiSearchKeywordsDTO.getKeywordType(),userFlag,historyId,dateList);
+		 searchKeywordsService.addRankInfoByIntervalTimeByType(pageList.getRecords(), avesApiSearchKeywordsDTO.getKeywordType(),siteCode,subscriptionId,dateList);
 		 log.info(pageList.toString());
 		 return Result.OK(pageList);
 	 }

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

@@ -0,0 +1,55 @@
+package org.jeecg.modules.adweb.seo.controller;
+
+import io.swagger.v3.oas.annotations.tags.Tag;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.adweb.seo.entity.ComprehensiveStatistics;
+import org.jeecg.modules.adweb.seo.service.ISearchKeywordsService;
+import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.ParseException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: seo_keywords_rank @Author: jeecg-boot @Date: 2024-10-09 @Version: V1.0
+ */
+@Tag(name = "seo_keywords_rank")
+@RestController
+@RequestMapping("/seo/seoKeywordsRank")
+@Slf4j
+public class SeoKeywordsRankController {
+    @Autowired private ISeoKeywordsRankService seoKeywordsRankService;
+
+    @Autowired private ISearchKeywordsService searchKeywordsService;
+
+    /** 获取当前用户管理的 父 站点信息 @CopyFrom: getAllSites */
+    @GetMapping("/getAllSites")
+    public Result<List<AdwebSite>> getAllSites() {
+        final List<AdwebSite> allSites = seoKeywordsRankService.getAllSites();
+        return Result.OK(allSites);
+    }
+
+    /**
+     * 获得综合统计信息
+     */
+    @GetMapping(value = "/comprehensiveInfo")
+    public Result<?> getComprehensiveInfo(@RequestParam String siteCode, @RequestParam String subscriptionId) throws ParseException {
+        ComprehensiveStatistics statistics = searchKeywordsService.getComprehensiveInfo(siteCode, subscriptionId);
+        return Result.OK(statistics);
+    }
+
+    /**
+     * 获取关键字排名信息
+     */
+    @GetMapping(value = "/getRankInfo")
+    public Result<?> getRankInfo(@RequestParam("siteCode") String siteCode, @RequestParam("subscriptionId") String subscriptionId) throws ParseException {
+        Map map = searchKeywordsService.getRankInfo(siteCode, subscriptionId);
+        return Result.OK(map);
+    }
+}

+ 0 - 197
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKpiStatisticsController.java

@@ -1,197 +0,0 @@
-package org.jeecg.modules.adweb.seo.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-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.ComprehensiveStatistics;
-import org.jeecg.modules.adweb.seo.entity.SeoKpiStatistics;
-import org.jeecg.modules.adweb.seo.service.ISearchKeywordsService;
-import org.jeecg.modules.adweb.seo.service.ISeoKpiStatisticsService;
-import org.jeecg.modules.adweb.site.entity.AdwebSite;
-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 java.text.ParseException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-
-/**
- * @Description: seo_kpi_statistics @Author: jeecg-boot @Date: 2024-10-09 @Version: V1.0
- */
-@Tag(name = "seo_kpi_statistics")
-@RestController
-@RequestMapping("/serp/seoKpiStatistics")
-@Slf4j
-public class SeoKpiStatisticsController
-        extends JeecgController<SeoKpiStatistics, ISeoKpiStatisticsService> {
-    @Autowired private ISeoKpiStatisticsService seoKpiStatisticsService;
-
-    @Autowired private ISearchKeywordsService searchKeywordsService;
-    /**
-     * 分页列表查询
-     *
-     * @param seoKpiStatistics
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-分页列表查询")
-    @Operation(summary = "seo_kpi_statistics-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<SeoKpiStatistics>> queryPageList(
-            SeoKpiStatistics seoKpiStatistics,
-            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-            HttpServletRequest req) {
-        QueryWrapper<SeoKpiStatistics> queryWrapper =
-                QueryGenerator.initQueryWrapper(seoKpiStatistics, req.getParameterMap());
-        Page<SeoKpiStatistics> page = new Page<SeoKpiStatistics>(pageNo, pageSize);
-        IPage<SeoKpiStatistics> pageList = seoKpiStatisticsService.page(page, queryWrapper);
-        return Result.OK(pageList);
-    }
-
-    /**
-     * 添加
-     *
-     * @param seoKpiStatistics
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-添加")
-    @Operation(summary = "seo_kpi_statistics-添加")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:add')")
-    @PostMapping(value = "/add")
-    public Result<String> add(@RequestBody SeoKpiStatistics seoKpiStatistics) {
-        seoKpiStatisticsService.save(seoKpiStatistics);
-        return Result.OK("添加成功!");
-    }
-
-    /**
-     * 编辑
-     *
-     * @param seoKpiStatistics
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-编辑")
-    @Operation(summary = "seo_kpi_statistics-编辑")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:edit')")
-    @RequestMapping(
-            value = "/edit",
-            method = {RequestMethod.PUT, RequestMethod.POST})
-    public Result<String> edit(@RequestBody SeoKpiStatistics seoKpiStatistics) {
-        seoKpiStatisticsService.updateById(seoKpiStatistics);
-        return Result.OK("编辑成功!");
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-通过id删除")
-    @Operation(summary = "seo_kpi_statistics-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:delete')")
-    @DeleteMapping(value = "/delete")
-    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
-        seoKpiStatisticsService.removeById(id);
-        return Result.OK("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-批量删除")
-    @Operation(summary = "seo_kpi_statistics-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:deleteBatch')")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        this.seoKpiStatisticsService.removeByIds(Arrays.asList(ids.split(",")));
-        return Result.OK("批量删除成功!");
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "seo_kpi_statistics-通过id查询")
-    @Operation(summary = "seo_kpi_statistics-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<SeoKpiStatistics> queryById(
-            @RequestParam(name = "id", required = true) String id) {
-        SeoKpiStatistics seoKpiStatistics = seoKpiStatisticsService.getById(id);
-        if (seoKpiStatistics == null) {
-            return Result.error("未找到对应数据");
-        }
-        return Result.OK(seoKpiStatistics);
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param seoKpiStatistics
-     */
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:exportXls')")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, SeoKpiStatistics seoKpiStatistics) {
-        return super.exportXls(
-                request, seoKpiStatistics, SeoKpiStatistics.class, "seo_kpi_statistics");
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_kpi_statistics:importExcel')")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, SeoKpiStatistics.class);
-    }
-
-    /** 获取当前用户管理的 父 站点信息 @CopyFrom: getAllSites */
-    @GetMapping("/getAllSitesBySeo")
-    public Result<List<AdwebSite>> getAllSitesBySeo() {
-        final List<AdwebSite> allSites = seoKpiStatisticsService.getAllSites();
-        return Result.OK(allSites);
-    }
-
-    /**
-     * 获得综合统计信息
-     */
-    @GetMapping(value = "/comprehensiveInfo")
-    public Result<?> getComprehensiveInfo(@RequestParam String userFlag, @RequestParam String historyId) throws ParseException {
-        ComprehensiveStatistics statistics = searchKeywordsService.getComprehensiveInfo(userFlag, historyId);
-        return Result.OK(statistics);
-    }
-
-    /**
-     * 获取关键字排名信息
-     */
-    @GetMapping(value = "/getRankInfo")
-    public Result<?> getRankInfo(@RequestParam("siteCode") String siteCode, @RequestParam("historyId") String historyId) throws ParseException {
-        Map map = searchKeywordsService.getRankInfo(siteCode, historyId);
-        return Result.OK(map);
-    }
-}

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

@@ -23,6 +23,6 @@ public class AvesApiSearchKeywordsDTO {
     private Integer rankStart;
     private Integer rankEnd;
     private Integer reachStandard;
-    private String userFlag;
-    private String historyId;
+    private String siteCode;
+    private String subscriptionId;
 }

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

@@ -1,59 +0,0 @@
-package org.jeecg.modules.adweb.seo.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * @Description: 历史达标站点关键词达标数据表
- * @Author: jeecg-boot
- * @Date:   2024-10-16
- * @Version: V1.0
- */
-@Data
-@TableName("history_reach_standard_site")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="历史达标站点关键词达标数据表")
-public class HistoryReachStandardSite implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**主键*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "主键")
-    private String id;
-	/**站点code*/
-	@Excel(name = "站点code", width = 15)
-    @Schema(description = "站点code")
-    private String siteCode;
-	/**达标时间*/
-	@Excel(name = "达标时间", width = 15)
-    @Schema(description = "达标时间")
-    private String reachStandardTime;
-	/**达标天数*/
-	@Excel(name = "达标天数", width = 15)
-    @Schema(description = "达标天数")
-    private Integer reachStandardDays;
-	/**服务天数*/
-	@Excel(name = "服务天数", width = 15)
-    @Schema(description = "服务天数")
-    private Integer remainServerDays;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-}

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

@@ -122,9 +122,14 @@ public class SeoKeywords implements Serializable {
 	@Excel(name = "关键词对应套餐的ID", width = 15)
     @Schema(description = "关键词对应套餐的ID")
     private String planId;
-	/**对应套餐绑定表ID*/
-	@Excel(name = "对应套餐绑定表ID", width = 15)
-    @Schema(description = "对应套餐绑定表ID")
+    /**订购表ID*/
+    @Excel(name = "订购表ID", width = 15)
+    @Schema(description = "订购表ID")
+    private java.lang.String subscriptionId;
+    /**网站表ID*/
+    @Excel(name = "网站表ID", width = 15)
+    @Schema(description = "网站表ID")
+    private java.lang.String siteId;
     private String historyId;
     @TableField(exist = false)
     private String ipAddress;
@@ -135,8 +140,6 @@ public class SeoKeywords implements Serializable {
     @TableField(exist = false)
     private Map<String, String> rankInfo;
     @TableField(exist = false)
-    private Integer siteId;
-    @TableField(exist = false)
     private String value;
     @TableField(exist = false)
     private String order;

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

@@ -1,116 +0,0 @@
-package org.jeecg.modules.adweb.seo.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import lombok.Data;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * @Description: seo_kpi_statistics
- * @Author: jeecg-boot
- * @Date:   2024-10-09
- * @Version: V1.0
- */
-@Data
-@TableName("seo_kpi_statistics")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="seo_kpi_statistics")
-public class SeoKpiStatistics implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**id*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "id")
-    private Integer id;
-	/**站点code或营销方案code*/
-	@Excel(name = "站点code或营销方案code", width = 15)
-    @Schema(description = "站点code或营销方案code")
-    private String hostCode;
-	/**营销方案name*/
-	@Excel(name = "营销方案name", width = 15)
-    @Schema(description = "营销方案name")
-    private String planName;
-	/**0营销方案,1站点*/
-	@Excel(name = "0营销方案,1站点", width = 15)
-    @Schema(description = "0营销方案,1站点")
-    private Integer type;
-	/**指标名称*/
-	@Excel(name = "指标名称", width = 15)
-    @Schema(description = "指标名称")
-    private String kpiName;
-	/**指标code*/
-	@Excel(name = "指标code", width = 15)
-    @Schema(description = "指标code")
-    private String kpiCode;
-	/**指标目标*/
-	@Excel(name = "指标目标", width = 15)
-    @Schema(description = "指标目标")
-    private Integer kpiTarget;
-	/**已完成目标*/
-	@Excel(name = "已完成目标", width = 15)
-    @Schema(description = "已完成目标")
-    private Integer finishTarget;
-	/**0未完成、1完成*/
-	@Excel(name = "0未完成、1完成", width = 15)
-    @Schema(description = "0未完成、1完成")
-    private Integer finishStatus;
-	/**完成时间*/
-	@Excel(name = "完成时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "完成时间")
-    private Date finishTime;
-	/**完成人的id*/
-	@Excel(name = "完成人的id", width = 15)
-    @Schema(description = "完成人的id")
-    private String finishUid;
-	/**服务开始时间*/
-	@Excel(name = "服务开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "服务开始时间")
-    private Date startTime;
-	/**服务结束时间*/
-	@Excel(name = "服务结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "服务结束时间")
-    private Date endTime;
-	/**比重,总和为100*/
-	@Excel(name = "比重,总和为100", width = 15)
-    @Schema(description = "比重,总和为100")
-    private Integer proportion;
-	/**排序*/
-	@Excel(name = "排序", width = 15)
-    @Schema(description = "排序")
-    private Double sort;
-	/**此纪录创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "此纪录创建时间")
-    private Date createTime;
-	/**0未删除、1已删除*/
-	@Excel(name = "0未删除、1已删除", width = 15)
-    @Schema(description = "0未删除、1已删除")
-    @TableLogic
-    private Integer delFlag;
-	/**套餐id*/
-	@Excel(name = "套餐id", width = 15)
-    @Schema(description = "套餐id")
-    private String planId;
-	/**对应套餐绑定表ID*/
-	@Excel(name = "对应套餐绑定表ID", width = 15)
-    @Schema(description = "对应套餐绑定表ID")
-    private String historyId;
-}

+ 0 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/HistoryReachStandardSiteMapper.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.adweb.seo.mapper;
-
-import org.jeecg.modules.adweb.seo.entity.HistoryReachStandardSite;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * @Description: 历史达标站点关键词达标数据表
- * @Author: jeecg-boot
- * @Date:   2024-10-16
- * @Version: V1.0
- */
-public interface HistoryReachStandardSiteMapper extends BaseMapper<HistoryReachStandardSite> {
-
-}

+ 0 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/SeoKpiStatisticsMapper.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.adweb.seo.mapper;
-
-import org.jeecg.modules.adweb.seo.entity.SeoKpiStatistics;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * @Description: seo_kpi_statistics
- * @Author: jeecg-boot
- * @Date:   2024-10-09
- * @Version: V1.0
- */
-public interface SeoKpiStatisticsMapper extends BaseMapper<SeoKpiStatistics> {
-
-}

+ 0 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/HistoryReachStandardSiteMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.adweb.seo.mapper.HistoryReachStandardSiteMapper">
-
-</mapper>

+ 0 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/mapper/xml/SeoKpiStatisticsMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.adweb.seo.mapper.SeoKpiStatisticsMapper">
-
-</mapper>

+ 0 - 14
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/IHistoryReachStandardSiteService.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.adweb.seo.service;
-
-import org.jeecg.modules.adweb.seo.entity.HistoryReachStandardSite;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @Description: 历史达标站点关键词达标数据表
- * @Author: jeecg-boot
- * @Date:   2024-10-16
- * @Version: V1.0
- */
-public interface IHistoryReachStandardSiteService extends IService<HistoryReachStandardSite> {
-
-}

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

@@ -1,7 +1,5 @@
 package org.jeecg.modules.adweb.seo.service;
 
-import org.jeecg.modules.adweb.seo.entity.SeoKpiStatistics;
-import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 
 import java.util.List;
@@ -12,7 +10,7 @@ import java.util.List;
  * @Date:   2024-10-09
  * @Version: V1.0
  */
-public interface ISeoKpiStatisticsService extends IService<SeoKpiStatistics> {
+public interface ISeoKeywordsRankService {
 
     List<AdwebSite> getAllSites();
 }

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

@@ -1,19 +0,0 @@
-package org.jeecg.modules.adweb.seo.service.impl;
-
-import org.jeecg.modules.adweb.seo.entity.HistoryReachStandardSite;
-import org.jeecg.modules.adweb.seo.mapper.HistoryReachStandardSiteMapper;
-import org.jeecg.modules.adweb.seo.service.IHistoryReachStandardSiteService;
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-/**
- * @Description: 历史达标站点关键词达标数据表
- * @Author: jeecg-boot
- * @Date:   2024-10-16
- * @Version: V1.0
- */
-@Service
-public class HistoryReachStandardSiteServiceImpl extends ServiceImpl<HistoryReachStandardSiteMapper, HistoryReachStandardSite> implements IHistoryReachStandardSiteService {
-
-}

+ 2 - 214
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SearchKeywordsServiceImpl.java

@@ -1,7 +1,6 @@
 package org.jeecg.modules.adweb.seo.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xkcoding.http.util.StringUtil;
 
 import jakarta.annotation.Resource;
@@ -12,21 +11,16 @@ import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
-import org.jeecg.common.util.FastJsonUtil;
-import org.jeecg.modules.adweb.common.util.DateUtil;
 import org.jeecg.modules.adweb.common.util.ListUtil;
 import org.jeecg.modules.adweb.seo.entity.*;
 import org.jeecg.modules.adweb.seo.mapper.SeoKeywordsMapper;
-import org.jeecg.modules.adweb.seo.mapper.SeoPlanSubscriptionMapper;
 import org.jeecg.modules.adweb.seo.service.*;
 import org.jeecg.modules.adweb.seo.vo.RankInfoVO;
 import org.jeecg.modules.adweb.seo.vo.SeoRankInfoVO;
-import org.jeecg.modules.adweb.seo.vo.ServerTimeVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -37,130 +31,33 @@ import java.util.stream.Collectors;
 @Service
 public class SearchKeywordsServiceImpl implements ISearchKeywordsService {
 
-    @Autowired private ISeoKpiStatisticsService seoKpiStatisticsService;
-
-    @Resource private SeoPlanSubscriptionMapper seoPlanSubscriptionMapper;
-
     @Resource private SeoKeywordsMapper seoKeywordsMapper;
 
     @Autowired private ISeoKeywordsService seoKeywordsService;
 
     @Autowired private ISeoKeywordsSerpService seoKeywordsSerpService;
 
-    @Autowired private ISeoPlanSubscriptionService seoPlanSubscriptionService;
-
-    @Autowired private IHistoryReachStandardSiteService historyReachStandardSiteService;
-
     /**
      * 获得综合统计的数据
      *
      * @param siteCode 站点code
-     * @param historyId 营销方案id
+     * @param subscriptionId 订阅表id
      * @return 综合统计的数据
      */
     @Override
-    public ComprehensiveStatistics getComprehensiveInfo(String siteCode, String historyId) {
+    public ComprehensiveStatistics getComprehensiveInfo(String siteCode, String subscriptionId) {
         ComprehensiveStatistics comprehensiveStatistics = new ComprehensiveStatistics();
 
-        // 查询指标
-        QueryWrapper<SeoKpiStatistics> statisticsQueryWrapper = new QueryWrapper<>();
-        statisticsQueryWrapper.eq("host_code", siteCode);
-        statisticsQueryWrapper.eq("del_flag", 0);
-        statisticsQueryWrapper.eq("type", 1);
-        statisticsQueryWrapper.eq("history_id", historyId);
-        List<SeoKpiStatistics> seoKpiStatisticsList =
-                seoKpiStatisticsService.list(statisticsQueryWrapper);
-        if (ListUtil.isEmpty(seoKpiStatisticsList)) {
-            return comprehensiveStatistics;
-        }
-
-        // 查询每个指标对应的完成数据
-        for (SeoKpiStatistics kpiStatistics : seoKpiStatisticsList) {
-            if (kpiStatistics.getKpiTarget() == null || kpiStatistics.getKpiTarget() == 0) {
-                continue;
-            }
-            if ("APPOINT_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-                Integer standard = seoPlanSubscriptionMapper.getKeywordStandard(siteCode);
-                String datesStr = "";
-                List<String> dateList =
-                        seoKeywordsService.getKeywordsLastSevenDays(siteCode, 1, historyId);
-                if (ListUtil.isEmpty(dateList)) {
-                    comprehensiveStatistics.setAppointKeywordNum(
-                            0 + " / " + kpiStatistics.getKpiTarget());
-                    continue;
-                } 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 + ")";
-                }
-                RankInfoVO rankInfo =
-                        seoKeywordsService.getSeoRankInfo(
-                                siteCode, historyId, 1, standard, datesStr, "1");
-                if (rankInfo != null) {
-                    comprehensiveStatistics.setAppointKeywordNum(
-                            rankInfo.getKeywordNum() + " / " + kpiStatistics.getKpiTarget());
-                } else {
-                    comprehensiveStatistics.setAppointKeywordNum(
-                            0 + " / " + kpiStatistics.getKpiTarget());
-                }
-            } else if ("LONG_TAIL_KEYWORDS".equals(kpiStatistics.getKpiCode())) {
-                String datesStr = "";
-                List<String> dateList =
-                        seoKeywordsService.getKeywordsLastSevenDays(siteCode, 2, historyId);
-                if (ListUtil.isEmpty(dateList)) {
-                    comprehensiveStatistics.setLongTailKeywordNum(
-                            0 + " / " + kpiStatistics.getKpiTarget());
-                    continue;
-                } 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 + ")";
-                }
-                RankInfoVO rankInfo =
-                        seoKeywordsService.getSeoRankInfo(
-                                siteCode, historyId, 1, 10, datesStr, "2");
-                if (rankInfo != null) {
-                    comprehensiveStatistics.setLongTailKeywordNum(
-                            rankInfo.getKeywordNum() + " / " + kpiStatistics.getKpiTarget());
-                } else {
-                    comprehensiveStatistics.setLongTailKeywordNum(
-                            0 + " / " + kpiStatistics.getKpiTarget());
-                }
-            } else if ("OUTER_CHAIN".equals(kpiStatistics.getKpiCode())) {
-                comprehensiveStatistics.setOuterLinkNum(
-                        kpiStatistics.getFinishTarget() + " / " + kpiStatistics.getKpiTarget());
-            } else if ("ARTICLE_INSITE".equals(kpiStatistics.getKpiCode())) {
-                log.info(
-                        "getComprehenInfo ---- ARTICLE_INSITE - kpiStatistics:{}",
-                        FastJsonUtil.toJSONString(kpiStatistics));
-
-                // 为了保持数据一致,只走定时器获取数据库中的数据 2023-09-08
-                comprehensiveStatistics.setArticleNum(
-                        kpiStatistics.getFinishTarget() + " / " + kpiStatistics.getKpiTarget());
-            }
-        }
         return comprehensiveStatistics;
     }
 
     @Override
     public Map getRankInfo(String siteCode, String historyId) throws ParseException {
         List<SeoRankInfoVO> seoRankInfos = this.getSeoRankInfo(siteCode, historyId);
-        ServerTimeVO ServerTimeVO = this.getServerTime(siteCode, historyId);
 
         Map map = new HashMap<>();
         map.put("appointKeyword", seoRankInfos.get(0));
         map.put("longTailKeyword", seoRankInfos.get(1));
-        map.put("ServerTime", ServerTimeVO);
         return map;
     }
 
@@ -207,115 +104,6 @@ public class SearchKeywordsServiceImpl implements ISearchKeywordsService {
         return list;
     }
 
-    /**
-     * 获取服务时间
-     *
-     * @param siteCode 站点code
-     * @param historyId 营销方案id
-     * @return 服务情况,达标时间以及剩余时间
-     */
-    private ServerTimeVO getServerTime(String siteCode, String historyId) {
-        ServerTimeVO ServerTimeVO = new ServerTimeVO();
-
-        // 获取套餐
-        SeoPlanSubscription history = seoPlanSubscriptionService.getById(historyId);
-        if (history == null) {
-            return ServerTimeVO;
-        }
-
-        // 判断是否自定义套餐结束,如果是自定义套餐,需要获得套餐开启时间
-        if (history.getServiceStatus() == 1) {
-            ServerTimeVO.setPlanServiceEndStatus(1);
-            ServerTimeVO.setPlanStartTime(history.getPlanStartTime());
-        }
-
-        // 达成时间
-        Date achieveTime = history.getKeywordsAchieveTime();
-        if (achieveTime != null) {
-            ServerTimeVO.setReachStandardTime(
-                    new SimpleDateFormat(DateUtil.DATE_PATTERN).format(achieveTime));
-        }
-
-        // 达成天数
-        int reachStandardDays = 0;
-        if (achieveTime != null) {
-            QueryWrapper<HistoryReachStandardSite> historyReachStandardSiteQueryWrapper =
-                    new QueryWrapper<>();
-            historyReachStandardSiteQueryWrapper.eq("site_code", siteCode);
-            List<HistoryReachStandardSite> historyReachStandardSiteList =
-                    historyReachStandardSiteService.list(historyReachStandardSiteQueryWrapper);
-            if (ListUtil.isEmpty(historyReachStandardSiteList)) {
-                reachStandardDays = (int) DateUtil.diffDays(achieveTime, new Date());
-            } else {
-                HistoryReachStandardSite historyReachStandardSite =
-                        historyReachStandardSiteList.get(0);
-                int newDays =
-                        (int)
-                                DateUtil.diffDays(
-                                        historyReachStandardSite.getCreateTime(), new Date());
-                reachStandardDays = historyReachStandardSite.getReachStandardDays() + newDays;
-            }
-        }
-        ServerTimeVO.setReachStandardDays(reachStandardDays);
-
-        // 剩余服务天数,0指定服务时长,1指定服务结束日期
-        int remainServerDays;
-        if (history.getServiceStatus() == 0) {
-            int serverMonth = history.getServiceMonth();
-            int serverDay = (serverMonth * 30) + (serverMonth / 2);
-            int giveDay = history.getGiveDay();
-            int compensateDay = history.getCompensateDay();
-            int totalGiveAndCompensateDay = giveDay + compensateDay;
-            log.info(
-                    "getServerTime -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}",
-                    history.getId(),
-                    giveDay,
-                    compensateDay,
-                    totalGiveAndCompensateDay);
-            remainServerDays = serverDay + totalGiveAndCompensateDay - reachStandardDays;
-            log.info(
-                    "getServerTime -- 剩余服务天数:{},服务天数:{},赠、补天数:{},达成天数:{}",
-                    remainServerDays,
-                    serverDay,
-                    totalGiveAndCompensateDay,
-                    reachStandardDays);
-            if (remainServerDays < 0) {
-                remainServerDays = 0;
-            }
-        } else {
-            int giveDay = history.getGiveDay();
-            int compensateDay = history.getCompensateDay();
-            int totalGiveAndCompensateDay = giveDay + compensateDay;
-            log.info(
-                    "getServerTime -- historyId:{},giveDay:{},compensateDay:{},totalGiveAndCompensateDay:{}",
-                    history.getId(),
-                    giveDay,
-                    compensateDay,
-                    totalGiveAndCompensateDay);
-            Date serverEndTime = history.getServiceEndTime();
-            log.info(
-                    "getServerTime -- 原来的serverEndTime:{}",
-                    new SimpleDateFormat(DateUtil.DATE_PATTERN).format(serverEndTime));
-            serverEndTime = DateUtil.addDays(serverEndTime, totalGiveAndCompensateDay);
-            log.info(
-                    "getServerTime -- 增加赠、补天数:{},赠送天数、补偿天数后的serverEndTime:{}",
-                    totalGiveAndCompensateDay,
-                    new SimpleDateFormat(DateUtil.DATE_PATTERN).format(serverEndTime));
-            if (serverEndTime.compareTo(new Date()) <= 0) {
-                remainServerDays = 0;
-            } else {
-                remainServerDays = (int) DateUtil.diffDays(serverEndTime, new Date());
-            }
-            log.info(
-                    "getServerTime -- 剩余服务天数:{},赠、补天数:{},达成天数:{}",
-                    remainServerDays,
-                    totalGiveAndCompensateDay,
-                    reachStandardDays);
-        }
-        ServerTimeVO.setRemainServerDays(remainServerDays);
-        return ServerTimeVO;
-    }
-
     private Map<String, Integer> dealKeywordsRankData(
             String siteCode, String historyId, Integer rankStart, Integer rankEnd) {
         Map<String, Integer> KeywordsRankMap = new HashMap<>();

+ 4 - 8
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKpiStatisticsServiceImpl.java → jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/service/impl/SeoKeywordsRankServiceImpl.java

@@ -1,16 +1,16 @@
 package org.jeecg.modules.adweb.seo.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
 import lombok.extern.slf4j.Slf4j;
+
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.common.util.ListUtil;
-import org.jeecg.modules.adweb.seo.entity.SeoKpiStatistics;
 import org.jeecg.modules.adweb.seo.entity.SeoPlanSubscription;
-import org.jeecg.modules.adweb.seo.mapper.SeoKpiStatisticsMapper;
-import org.jeecg.modules.adweb.seo.service.ISeoKpiStatisticsService;
+import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.jeecg.modules.adweb.seo.service.ISeoPlanSubscriptionService;
 import org.jeecg.modules.adweb.site.entity.AdwebSite;
 import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
@@ -18,8 +18,6 @@ import org.jeecg.modules.adweb.site.service.ISiteUserPermissionService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,9 +26,7 @@ import java.util.List;
  */
 @Service
 @Slf4j
-public class SeoKpiStatisticsServiceImpl
-        extends ServiceImpl<SeoKpiStatisticsMapper, SeoKpiStatistics>
-        implements ISeoKpiStatisticsService {
+public class SeoKeywordsRankServiceImpl implements ISeoKeywordsRankService {
 
     @Autowired private IAdwebSiteService adwebSiteService;