|
@@ -23,7 +23,6 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
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.modules.adweb.common.constant.AdwebConstant;
|
|
|
import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
|
|
@@ -35,6 +34,7 @@ import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
|
|
|
import org.jeecg.modules.adweb.seo.service.ISeoPlanSubscriptionService;
|
|
|
import org.jeecg.modules.adweb.site.entity.AdwebSite;
|
|
|
import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
|
|
|
+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;
|
|
@@ -60,17 +60,23 @@ import static cn.hutool.core.collection.CollUtil.distinct;
|
|
|
@RequestMapping("/seo/seoKeywords")
|
|
|
@Slf4j
|
|
|
public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeywordsService> {
|
|
|
- @Autowired private ISeoKeywordsService seoKeywordsService;
|
|
|
+ @Autowired
|
|
|
+ private ISeoKeywordsService seoKeywordsService;
|
|
|
|
|
|
- @Autowired ISeoKeywordsRankService seoKeywordsRankService;
|
|
|
+ @Autowired
|
|
|
+ ISeoKeywordsRankService seoKeywordsRankService;
|
|
|
|
|
|
- @Autowired ISeoKeywordsRankService seoKpiStatisticsService;
|
|
|
+ @Autowired
|
|
|
+ ISeoKeywordsRankService seoKpiStatisticsService;
|
|
|
|
|
|
- @Autowired private ISysBaseAPI sysBaseAPI;
|
|
|
+ @Autowired
|
|
|
+ private SysAdwebApi sysAdwebApi;
|
|
|
|
|
|
- @Autowired private IAdwebSiteService adwebSiteService;
|
|
|
+ @Autowired
|
|
|
+ private IAdwebSiteService adwebSiteService;
|
|
|
|
|
|
- @Autowired private ISeoPlanSubscriptionService seoPlanSubscriptionService;
|
|
|
+ @Autowired
|
|
|
+ private ISeoPlanSubscriptionService seoPlanSubscriptionService;
|
|
|
|
|
|
@Value("${jeecg.path.upload}")
|
|
|
private String uploadUrl;
|
|
@@ -212,7 +218,9 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
return super.exportXls(request, seoKeywords, SeoKeywords.class, "关键词");
|
|
|
}
|
|
|
|
|
|
- /** 关键词排名页面 - 列表数据 */
|
|
|
+ /**
|
|
|
+ * 关键词排名页面 - 列表数据
|
|
|
+ */
|
|
|
@AutoLog(value = "营销推广-SEO-关键词排名统计查询接口")
|
|
|
@RequestMapping(value = "/keywordList")
|
|
|
public Result<?> queryRankInfoList(
|
|
@@ -297,7 +305,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
}
|
|
|
ArrayList<String> columns = null;
|
|
|
// 表头信息
|
|
|
- if (sysBaseAPI.isAdmin()) {
|
|
|
+ if (sysAdwebApi.isAdmin()) {
|
|
|
columns = new ArrayList<>(Arrays.asList("序号", "关键词", "url", "关键词类型"));
|
|
|
} else {
|
|
|
columns = new ArrayList<>(Arrays.asList("序号", "关键词", "关键词类型"));
|
|
@@ -310,7 +318,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
List<String> dates = pageList.getRecords().get(0).getDateList();
|
|
|
columns.addAll(dates);
|
|
|
|
|
|
- boolean isAdmin = sysBaseAPI.isAdmin();
|
|
|
+ boolean isAdmin = sysAdwebApi.isAdmin();
|
|
|
|
|
|
for (int i = 0; i < enquiryList.size(); i++) {
|
|
|
SeoKeywords seoKeywords = enquiryList.get(i);
|
|
@@ -352,7 +360,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
"Content-Disposition",
|
|
|
"attachment;filename="
|
|
|
+ new String(
|
|
|
- (fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
|
|
|
+ (fileName + ".xlsx").getBytes(), StandardCharsets.ISO_8859_1));
|
|
|
out = response.getOutputStream();
|
|
|
log.info("导出数据:" + list);
|
|
|
writer.write(list, true);
|
|
@@ -406,7 +414,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
try {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
|
|
|
String formattedDate = dateFormat.format(now);
|
|
|
- File realFile = new File(uploadUrl, formattedDate + RandomStringUtils.random(4,true,true) + ".xlsx");
|
|
|
+ File realFile = new File(uploadUrl, formattedDate + RandomStringUtils.random(4, true, true) + ".xlsx");
|
|
|
file.transferTo(realFile);
|
|
|
stream = new FileInputStream(realFile);
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook(stream);
|
|
@@ -460,7 +468,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
}
|
|
|
|
|
|
//新增关键词本身去重
|
|
|
- Integer originalSize = list.size();
|
|
|
+ Integer originalSize = list.size();
|
|
|
List<SeoKeywords> listNew = distinct(list);
|
|
|
// 去重
|
|
|
QueryWrapper<SeoKeywords> queryWrapper = new QueryWrapper<>();
|
|
@@ -486,8 +494,8 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
}
|
|
|
|
|
|
String msg = "关键词导入成功!关键词个数:" + listNew.size();
|
|
|
- if(originalSize>listNew.size()){
|
|
|
- msg = "关键词导入成功!关键词个数:" + listNew.size()+",重复关键词已去除!重复个数:"+(originalSize-listNew.size());
|
|
|
+ if (originalSize > listNew.size()) {
|
|
|
+ msg = "关键词导入成功!关键词个数:" + listNew.size() + ",重复关键词已去除!重复个数:" + (originalSize - listNew.size());
|
|
|
}
|
|
|
|
|
|
return seoKeywordsService.saveBatch(listNew) ? Result.OK(msg) : Result.error("关键词导入失败!");
|
|
@@ -507,7 +515,6 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @param seoKeywords
|
|
|
* @return
|