Merge branch 'master' of http://124.222.105.7:3000/dianliang/dl_site_system
# Conflicts: # dl_admin/ruoyi-admin/src/main/java/com/ruoyi/base/controller/WebController.java
This commit is contained in:
commit
19a68b314c
@ -20,6 +20,7 @@ import com.ruoyi.busi.service.*;
|
||||
import com.ruoyi.busi.utils.CommonUtils;
|
||||
import com.ruoyi.busi.vo.BusiCategoryVO;
|
||||
import com.ruoyi.busi.vo.ProdNewVO;
|
||||
import com.ruoyi.busi.vo.SiteMapVO;
|
||||
import com.ruoyi.busi.vo.WebDetailVO;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
@ -43,8 +44,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.constant.DictConstants.DATA_TYPE_NEWS;
|
||||
import static com.ruoyi.constant.DictConstants.DATA_TYPE_PRODUCT;
|
||||
import static com.ruoyi.constant.DictConstants.*;
|
||||
import static com.ruoyi.constant.DictConstants.CATG_TYPE_WZ;
|
||||
|
||||
/**
|
||||
* Web 专用Controller
|
||||
@ -250,7 +251,16 @@ public class WebController extends BaseController {
|
||||
queryWrapper.in(BusiProdNew::getCatgId, catgIdList);
|
||||
}
|
||||
queryWrapper.orderByDesc(BusiProdNew::getSort);
|
||||
return R.ok(prodNewService.page(page, queryWrapper));
|
||||
//查所有栏目
|
||||
BusiCategory category = new BusiCategory();
|
||||
category.setTenantId(tenantId);
|
||||
category.setCatgType(CATG_TYPE_CP);
|
||||
List<BusiCategoryVO> busiCategoryVOList = categoryService.treeCategory(category);
|
||||
//转map
|
||||
Map<String,String> catgMap = categoryService.dealFirstIdRtnMap(busiCategoryVOList);
|
||||
IPage<BusiProdNew> rtnPage = prodNewService.page(page,queryWrapper);
|
||||
rtnPage.getRecords().forEach(item->item.setMaxCatgId(catgMap.getOrDefault(item.getCatgId(),"")));
|
||||
return R.ok(rtnPage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -287,7 +297,16 @@ public class WebController extends BaseController {
|
||||
queryWrapper.in(BusiProdNew::getCatgId, catgIdList);
|
||||
}
|
||||
queryWrapper.orderByDesc(BusiProdNew::getSort);
|
||||
return R.ok(prodNewService.page(page, queryWrapper));
|
||||
//查所有栏目
|
||||
BusiCategory category = new BusiCategory();
|
||||
category.setTenantId(tenantId);
|
||||
category.setCatgType(CATG_TYPE_WZ);
|
||||
List<BusiCategoryVO> busiCategoryVOList = categoryService.treeCategory(category);
|
||||
//转map
|
||||
Map<String,String> catgMap = categoryService.dealFirstIdRtnMap(busiCategoryVOList);
|
||||
IPage<BusiProdNew> rtnPage = prodNewService.page(page, queryWrapper);
|
||||
rtnPage.getRecords().forEach(item->item.setMaxCatgId(catgMap.getOrDefault(item.getCatgId(),"")));
|
||||
return R.ok(rtnPage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,7 +320,6 @@ public class WebController extends BaseController {
|
||||
@ApiImplicitParam(name = "id", value = "产品或新闻ID", required = true, dataType = "string", paramType = "query", dataTypeClass = String.class)
|
||||
@GetMapping("/prodNewsInfo")
|
||||
public R<WebDetailVO> prodNewsInfo(@RequestParam(required = true) String id) {
|
||||
WebDetailVO webDetailVO = new WebDetailVO();
|
||||
return R.ok(prodNewService.getProdNewInfo(id));
|
||||
}
|
||||
|
||||
@ -452,4 +470,20 @@ public class WebController extends BaseController {
|
||||
googleKeywordService.test();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航栏接口--所有分类
|
||||
* @author vinjor-M
|
||||
* @date 10:04 2025/7/8
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
@ApiOperation("站点地图使用接口")
|
||||
@ApiImplicitParams(value = {
|
||||
@ApiImplicitParam(name = "catgType", value = "栏目类型", required = true, dataType = "string", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "tenantId", value = "站点编码", required = true, dataType = "string", paramType = "query", dataTypeClass = String.class)
|
||||
})
|
||||
@GetMapping("/siteMap")
|
||||
public R<List<SiteMapVO>> siteMap(@RequestParam(required = true) String tenantId, @RequestParam(required = true) String catgType){
|
||||
return R.ok(prodNewService.getSiteMap(tenantId,catgType));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.busi.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -115,4 +116,9 @@ public class BusiProdNew extends DlBaseEntity
|
||||
@ApiModelProperty("站点唯一编码(租户id)")
|
||||
private String tenantId;
|
||||
|
||||
/** 最父级分类id */
|
||||
@ApiModelProperty("最父级分类id")
|
||||
@TableField(exist = false)
|
||||
private String maxCatgId;
|
||||
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public class GoogleKeywordService {
|
||||
googleAdsClient.getLatestVersion().createKeywordPlanIdeaServiceClient()) {
|
||||
GenerateKeywordIdeasRequest.Builder requestBuilder = GenerateKeywordIdeasRequest.newBuilder()
|
||||
.setCustomerId(Long.toString(customerId))
|
||||
.setLanguage(language)
|
||||
.setLanguage(String.valueOf(1000))
|
||||
.addAllGeoTargetConstants(Collections.singletonList(geoTarget))
|
||||
.setKeywordPlanNetwork(KeywordPlanNetworkEnum.KeywordPlanNetwork.GOOGLE_SEARCH_AND_PARTNERS)
|
||||
.setKeywordAndUrlSeed(seed);
|
||||
|
@ -6,6 +6,7 @@ import com.ruoyi.busi.vo.BusiCategoryVO;
|
||||
import com.ruoyi.busi.vo.ProdNewVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 网站栏目Service接口
|
||||
@ -50,4 +51,13 @@ public interface IBusiCategoryService extends IService<BusiCategory> {
|
||||
* @return java.util.List<com.ruoyi.busi.vo.BusiCategoryVO>
|
||||
**/
|
||||
List<BusiCategoryVO> dealFirstId(List<BusiCategoryVO> busiCategoryVOList);
|
||||
|
||||
/**
|
||||
* 给所有子级设置最父级ID并且反回map格式
|
||||
* @author vinjor-M
|
||||
* @date 11:23 2025/7/19
|
||||
* @param busiCategoryVOList 栏目树
|
||||
* @return java.util.List<com.ruoyi.busi.vo.BusiCategoryVO>
|
||||
**/
|
||||
Map<String,String> dealFirstIdRtnMap(List<BusiCategoryVO> busiCategoryVOList);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.busi.domain.BusiProdNew;
|
||||
import com.ruoyi.busi.vo.ProdNewVO;
|
||||
import com.ruoyi.busi.vo.SiteMapVO;
|
||||
import com.ruoyi.busi.vo.WebDetailVO;
|
||||
|
||||
/**
|
||||
@ -83,4 +84,14 @@ public interface IBusiProdNewService extends IService<BusiProdNew>
|
||||
* @return java.util.List<com.ruoyi.busi.vo.ProdNewVO>
|
||||
**/
|
||||
List<ProdNewVO> checkContent(ProdNewVO prodNewVO);
|
||||
|
||||
/**
|
||||
* 获取站点分类地图
|
||||
* @author vinjor-M
|
||||
* @date 14:12 2025/8/4
|
||||
* @param tenantId 站点编码
|
||||
* @param catgType 栏目类型
|
||||
* @return java.util.List<com.ruoyi.busi.vo.SiteMapVO>
|
||||
**/
|
||||
List<SiteMapVO> getSiteMap(String tenantId, String catgType);
|
||||
}
|
||||
|
@ -226,4 +226,36 @@ public class BusiCategoryServiceImpl extends ServiceImpl<BusiCategoryMapper, Bus
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 给所有子级设置最父级ID并且反回map格式
|
||||
* @author vinjor-M
|
||||
* @date 11:23 2025/7/19
|
||||
* @param busiCategoryVOList 栏目树
|
||||
* @return java.util.List<com.ruoyi.busi.vo.BusiCategoryVO>
|
||||
**/
|
||||
@Override
|
||||
public Map<String,String> dealFirstIdRtnMap(List<BusiCategoryVO> busiCategoryVOList){
|
||||
Map<String,String> rtnMap = new HashMap<>();
|
||||
busiCategoryVOList.forEach(item->{
|
||||
String thisMaxParentId = item.getId();
|
||||
item.setMaxParentId(thisMaxParentId);
|
||||
rtnMap.put(item.getId(),thisMaxParentId);
|
||||
if(null!=item.getChildren() && !item.getChildren().isEmpty()){
|
||||
//有子级
|
||||
this.setChildMaxParentIdMap(item.getChildren(),thisMaxParentId,rtnMap);
|
||||
}
|
||||
});
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
private void setChildMaxParentIdMap(List<BusiCategoryVO> childList,String maxParentId,Map<String,String> rtnMap){
|
||||
childList.forEach(item->{
|
||||
item.setMaxParentId(maxParentId);
|
||||
rtnMap.put(item.getId(),maxParentId);
|
||||
if(null!=item.getChildren()&& !item.getChildren().isEmpty()){
|
||||
this.setChildMaxParentIdMap(item.getChildren(),maxParentId,rtnMap);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -5,18 +5,18 @@ import java.util.*;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.ruoyi.busi.domain.BusiCategory;
|
||||
import com.ruoyi.busi.domain.BusiProdRandom;
|
||||
import com.ruoyi.busi.mapper.BusiProdRandomMapper;
|
||||
import com.ruoyi.busi.service.IBusiCategoryService;
|
||||
import com.ruoyi.busi.utils.SimHash;
|
||||
import com.ruoyi.busi.utils.TextPreprocessor;
|
||||
import com.ruoyi.busi.vo.ProdNewVO;
|
||||
import com.ruoyi.busi.vo.ProdRandomVO;
|
||||
import com.ruoyi.busi.vo.WebDetailVO;
|
||||
import com.ruoyi.busi.vo.*;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -24,8 +24,7 @@ import com.ruoyi.busi.mapper.BusiProdNewMapper;
|
||||
import com.ruoyi.busi.domain.BusiProdNew;
|
||||
import com.ruoyi.busi.service.IBusiProdNewService;
|
||||
|
||||
import static com.ruoyi.constant.DictConstants.DATA_TYPE_NEWS;
|
||||
import static com.ruoyi.constant.DictConstants.DATA_TYPE_PRODUCT;
|
||||
import static com.ruoyi.constant.DictConstants.*;
|
||||
import static com.ruoyi.constant.StrConstants.HASH_BITS;
|
||||
import static com.ruoyi.constant.StrConstants.MAX_HAMMING_DISTANCE;
|
||||
|
||||
@ -155,7 +154,16 @@ public class BusiProdNewServiceImpl extends ServiceImpl<BusiProdNewMapper,BusiPr
|
||||
.eq(BusiProdNew::getIfPublic,true)
|
||||
.eq(BusiProdNew::getIfReco,ifHot)
|
||||
.orderByDesc(BusiProdNew::getSort);
|
||||
return this.page(page,queryWrapper).getRecords();
|
||||
//查所有栏目
|
||||
BusiCategory category = new BusiCategory();
|
||||
category.setTenantId(tenantId);
|
||||
category.setCatgType(DATA_TYPE_PRODUCT.equals(dateType)?CATG_TYPE_CP:CATG_TYPE_WZ);
|
||||
List<BusiCategoryVO> busiCategoryVOList = categoryService.treeCategory(category);
|
||||
//转map
|
||||
Map<String,String> catgMap = categoryService.dealFirstIdRtnMap(busiCategoryVOList);
|
||||
List<BusiProdNew> rtnList= this.page(page,queryWrapper).getRecords();
|
||||
rtnList.forEach(item->item.setMaxCatgId(catgMap.getOrDefault(item.getCatgId(),"")));
|
||||
return rtnList;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,7 +211,15 @@ public class BusiProdNewServiceImpl extends ServiceImpl<BusiProdNewMapper,BusiPr
|
||||
.or().like(BusiProdNew::getDescription,text)
|
||||
.or().like(BusiProdNew::getContent,text))
|
||||
.orderByDesc(BusiProdNew::getSort);
|
||||
return this.page(page,queryWrapper);
|
||||
IPage<BusiProdNew> rtnPage = this.page(page,queryWrapper);
|
||||
//查所有栏目
|
||||
BusiCategory category = new BusiCategory();
|
||||
category.setTenantId(tenantId);
|
||||
List<BusiCategoryVO> busiCategoryVOList = categoryService.treeCategory(category);
|
||||
//转map
|
||||
Map<String,String> catgMap = categoryService.dealFirstIdRtnMap(busiCategoryVOList);
|
||||
rtnPage.getRecords().forEach(item->item.setMaxCatgId(catgMap.getOrDefault(item.getCatgId(),"")));
|
||||
return rtnPage;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -241,4 +257,55 @@ public class BusiProdNewServiceImpl extends ServiceImpl<BusiProdNewMapper,BusiPr
|
||||
similarArticles.sort((a, b) -> Double.compare(b.getSimilarity(), a.getSimilarity()));
|
||||
return similarArticles;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点分类地图
|
||||
*
|
||||
* @param tenantId 站点编码
|
||||
* @param catgType 栏目类型
|
||||
* @return java.util.List<com.ruoyi.busi.vo.SiteMapVO>
|
||||
* @author vinjor-M
|
||||
* @date 14:12 2025/8/4
|
||||
**/
|
||||
@Override
|
||||
public List<SiteMapVO> getSiteMap(String tenantId, String catgType) {
|
||||
List<SiteMapVO> rtnList = new ArrayList<>();
|
||||
//查所有栏目
|
||||
BusiCategory category = new BusiCategory();
|
||||
category.setTenantId(tenantId);
|
||||
List<BusiCategoryVO> busiCategoryVOList = categoryService.treeCategory(category);
|
||||
//转map
|
||||
Map<String,String> catgMap = categoryService.dealFirstIdRtnMap(busiCategoryVOList);
|
||||
if(CATG_TYPE_XP.equals(catgType) || CATG_TYPE_DYM.equals(catgType)){
|
||||
//查所有询盘或单页面栏目
|
||||
LambdaQueryWrapper<BusiCategory> queryWrapper = new LambdaQueryWrapper<BusiCategory>()
|
||||
.eq(BusiCategory::getTenantId,tenantId)
|
||||
.eq(BusiCategory::getCatgType,catgType)
|
||||
.orderByDesc(BusiCategory::getSort);
|
||||
List<BusiCategory> list = categoryService.list(queryWrapper);
|
||||
list.forEach(item->{
|
||||
SiteMapVO siteMapVO = new SiteMapVO();
|
||||
siteMapVO.setId(item.getId());
|
||||
siteMapVO.setTitle(item.getCatgName());
|
||||
siteMapVO.setUpdateTime(item.getUpdateTime());
|
||||
siteMapVO.setMaxCatgId(catgMap.getOrDefault(item.getId(),""));
|
||||
rtnList.add(siteMapVO);
|
||||
});
|
||||
}else{
|
||||
//产品或文章
|
||||
LambdaQueryWrapper<BusiProdNew> queryWrapper = new LambdaQueryWrapper<BusiProdNew>()
|
||||
.eq(BusiProdNew::getTenantId,tenantId)
|
||||
.eq(BusiProdNew::getDataType,CATG_TYPE_CP.equals(catgType)?DATA_TYPE_PRODUCT:DATA_TYPE_NEWS)
|
||||
.eq(BusiProdNew::getIfPublic,true)
|
||||
.orderByDesc(BusiProdNew::getSort);
|
||||
List<BusiProdNew> list = this.list(queryWrapper);
|
||||
list.forEach(item->{
|
||||
SiteMapVO siteMapVO = new SiteMapVO();
|
||||
BeanUtils.copyProperties(item,siteMapVO);
|
||||
siteMapVO.setMaxCatgId(catgMap.getOrDefault(item.getCatgId(),""));
|
||||
rtnList.add(siteMapVO);
|
||||
});
|
||||
}
|
||||
return rtnList;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 站点地图使用VO
|
||||
* @author vinjor-M
|
||||
* @date 14:09 2025/8/4
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value = "SiteMapVO", description = "站点地图使用VO")
|
||||
public class SiteMapVO {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
private String id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
/**
|
||||
* 所属栏目id
|
||||
*/
|
||||
@ApiModelProperty("所属栏目id")
|
||||
private String catgId;
|
||||
/**
|
||||
* 最父级栏目ID
|
||||
*/
|
||||
@ApiModelProperty("最父级栏目ID")
|
||||
private String maxCatgId;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
@ApiModelProperty("最后更新时间")
|
||||
private Date updateTime;
|
||||
}
|
@ -71,6 +71,27 @@ public class DictConstants
|
||||
*/
|
||||
public static final String THIRD_SOFT_EMAIL ="Email";
|
||||
|
||||
/**
|
||||
* 栏目类型字典-KEY
|
||||
*/
|
||||
public static final String CATG_TYPE_KEY ="third_soft";
|
||||
/**
|
||||
* 栏目类型字典-产品
|
||||
*/
|
||||
public static final String CATG_TYPE_CP ="cp";
|
||||
/**
|
||||
* 栏目类型字典-文章
|
||||
*/
|
||||
public static final String CATG_TYPE_WZ ="wz";
|
||||
/**
|
||||
* 栏目类型字典-询盘
|
||||
*/
|
||||
public static final String CATG_TYPE_XP ="xp";
|
||||
/**
|
||||
* 栏目类型字典-单页面
|
||||
*/
|
||||
public static final String CATG_TYPE_DYM ="dym";
|
||||
|
||||
|
||||
/**
|
||||
* 是否字典--是
|
||||
|
@ -5,7 +5,7 @@ VUE_APP_TITLE = 成事达管理平台
|
||||
ENV = 'production'
|
||||
|
||||
# 成事达管理平台/生产环境
|
||||
VUE_APP_BASE_API = 'http://122.51.230.86:8099'
|
||||
VUE_APP_BASE_API = 'http://114.132.197.85:8099'
|
||||
|
||||
# websocket
|
||||
VUE_APP_WEBSOCKET = 'ws://122.51.230.86:8099/ws/asset/'
|
||||
VUE_APP_WEBSOCKET = 'ws://114.132.197.85:8099/ws/asset/'
|
||||
|
Loading…
Reference in New Issue
Block a user