|
@@ -4,7 +4,7 @@ import cn.hutool.core.io.IoUtil;
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.xkcoding.http.util.StringUtil;
|
|
import com.xkcoding.http.util.StringUtil;
|
|
@@ -23,8 +23,8 @@ import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
-import org.jeecg.common.util.FastJsonUtil;
|
|
|
|
import org.jeecg.config.security.utils.SecureUtil;
|
|
import org.jeecg.config.security.utils.SecureUtil;
|
|
import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
|
|
import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
|
|
import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
|
|
import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
|
|
@@ -79,54 +79,10 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
if ((seoKeywords.getSiteCode() == null || seoKeywords.getSiteCode().isEmpty())) {
|
|
if ((seoKeywords.getSiteCode() == null || seoKeywords.getSiteCode().isEmpty())) {
|
|
return Result.error("请选择站点");
|
|
return Result.error("请选择站点");
|
|
}
|
|
}
|
|
- // QueryWrapper<SeoKeywords> queryWrapper = QueryGenerator.initQueryWrapper(seoKeywords,
|
|
|
|
- // req.getParameterMap());
|
|
|
|
- // Page<SeoKeywords> page = new Page<SeoKeywords>(pageNo, pageSize);
|
|
|
|
- // IPage<SeoKeywords> pageList = seoKeywordsService.page(page, queryWrapper);
|
|
|
|
- // return Result.OK(pageList);
|
|
|
|
- String siteCode = null;
|
|
|
|
- String userFlag = req.getParameter("siteCode");
|
|
|
|
- if (StringUtil.isNotEmpty(userFlag)) {
|
|
|
|
- siteCode = userFlag;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 根据用户做筛选
|
|
|
|
- if (!sysBaseAPI.isAdmin()) {
|
|
|
|
- if (seoKeywords.getSiteId() != null) {
|
|
|
|
- JSONObject jsonObject = sysBaseAPI.getSiteInfoById(seoKeywords.getSiteId());
|
|
|
|
- log.info("jsonObject:{}", FastJsonUtil.toJSONString(jsonObject));
|
|
|
|
- siteCode = jsonObject.getString("code");
|
|
|
|
- } else {
|
|
|
|
- return Result.error("fail");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 根据关键词做筛选
|
|
|
|
- String keywords = req.getParameter("keywords");
|
|
|
|
-
|
|
|
|
- // 根据创建时间做筛选
|
|
|
|
- String createTime = req.getParameter("createTime");
|
|
|
|
-
|
|
|
|
- // 根据最后搜索时间查询
|
|
|
|
- String lastSearchTime = req.getParameter("lastSearchTime");
|
|
|
|
-
|
|
|
|
- // 根据订阅ID查询
|
|
|
|
- String subscriptionId = seoKeywords.getSubscriptionId();
|
|
|
|
- String order = seoKeywords.getOrder();
|
|
|
|
- String column = seoKeywords.getColumn();
|
|
|
|
- Page<SeoKeywords> page = new Page<>(pageNo, pageSize);
|
|
|
|
- IPage<SeoKeywords> pageList =
|
|
|
|
- seoKeywordsService.pageList(
|
|
|
|
- page,
|
|
|
|
- siteCode,
|
|
|
|
- keywords,
|
|
|
|
- subscriptionId,
|
|
|
|
- lastSearchTime,
|
|
|
|
- createTime,
|
|
|
|
- seoKeywords.getKeywordType(),
|
|
|
|
- column,
|
|
|
|
- order,
|
|
|
|
- seoKeywords.getKeywordRank());
|
|
|
|
|
|
+ QueryWrapper<SeoKeywords> queryWrapper =
|
|
|
|
+ QueryGenerator.initQueryWrapper(seoKeywords, req.getParameterMap());
|
|
|
|
+ Page<SeoKeywords> page = new Page<SeoKeywords>(pageNo, pageSize);
|
|
|
|
+ IPage<SeoKeywords> pageList = seoKeywordsService.page(page, queryWrapper);
|
|
return Result.OK(pageList);
|
|
return Result.OK(pageList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -448,4 +404,22 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param seoKeywords
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping(value = "/getSeoKeyword")
|
|
|
|
+ public Result<?> getSeoKeyword(SeoKeywords seoKeywords) {
|
|
|
|
+ QueryWrapper<SeoKeywords> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("keywords", seoKeywords.getKeywords());
|
|
|
|
+ queryWrapper.eq("site_code", seoKeywords.getSiteCode());
|
|
|
|
+ queryWrapper.ne("status", 0);
|
|
|
|
+ queryWrapper.eq("subscription_id", seoKeywords.getSubscriptionId());
|
|
|
|
+ List<SeoKeywords> seoKeywordsList = seoKeywordsService.list(queryWrapper);
|
|
|
|
+ if (!seoKeywordsList.isEmpty()) {
|
|
|
|
+ return Result.OK(false);
|
|
|
|
+ }
|
|
|
|
+ return Result.OK(true);
|
|
|
|
+ }
|
|
}
|
|
}
|