提交 bde157fd 作者: obcy

Merge branch 'event_new' of http://1.95.78.131:8090/ChenShiQiang/event into event_new

# Conflicts:
#	src/main/java/com/zzsn/event/service/IInfoSourceService.java
#	src/main/java/com/zzsn/event/service/impl/InfoSourceServiceImpl.java
#	src/main/java/com/zzsn/event/service/impl/SubjectServiceImpl.java
......@@ -95,7 +95,7 @@ public class SubjectManageController {
private KafkaTemplate<String, String> kafkaTemplate;
@Autowired
private PythonUtil pythonUtil;
@Autowired
@Autowired(required = false)
private RemoteModelService remoteModelService;
......@@ -735,7 +735,7 @@ public class SubjectManageController {
public Result<?> subjectBindDirectSourcePageList(@RequestParam String subjectId,
@RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "10") Integer pageSize) {
IPage<Map<String, Object>> page = infoSourceService.subjectBindDirectSourcePageList(subjectId, pageNo, pageSize);
IPage<SubjectBindDirectSourceVO> page = infoSourceService.subjectBindDirectSourcePageList(subjectId, pageNo, pageSize);
return Result.OK(page);
}
......@@ -752,24 +752,7 @@ public class SubjectManageController {
public Result<?> directSourcePageList(@RequestParam(required = false) String searchWord,
@RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "10") Integer pageSize) {
IPage<String> page = infoSourceService.directSourcePageList(searchWord, pageNo, pageSize);
return Result.OK(page);
}
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
@GetMapping("/directInfoSourceColumnPageList")
public Result<?> directSourceColumnPageList(String webSiteName,
@RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "10") Integer pageSize) {
IPage<InfoSource> page = infoSourceService.directSourceColumnPageList(webSiteName, pageNo, pageSize);
IPage<SubjectBindDirectSourceVO> page = infoSourceService.directSourcePageList(searchWord, pageNo, pageSize);
return Result.OK(page);
}
......@@ -782,17 +765,38 @@ public class SubjectManageController {
*/
@PostMapping("/bindDirectInfoSource")
public Result<?> bindDirectInfoSource(@RequestBody SubjectSourceVO subjectSourceVO) {
List<InfoSource> infoSources = infoSourceService.directSourceColumnList(subjectSourceVO.getWebSiteName());
if (CollectionUtils.isNotEmpty(infoSources)) {
List<SubjectInfoSourceMap> dataList = new ArrayList<>();
for (InfoSource source : infoSources) {
SubjectInfoSourceMap subjectInfoSourceMap = new SubjectInfoSourceMap();
subjectInfoSourceMap.setSubjectId(subjectSourceVO.getSubjectId());
subjectInfoSourceMap.setSourceId(source.getId());
subjectInfoSourceMap.setType(1);
dataList.add(subjectInfoSourceMap);
List<String> sourceIdList = subjectSourceVO.getSourceIdList();
if (CollectionUtils.isEmpty(sourceIdList)) {
LambdaQueryWrapper<InfoSource> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.select(InfoSource::getId,InfoSource::getSiteName,InfoSource::getSiteUri)
.in(InfoSource::getWebSiteName, subjectSourceVO.getWebSiteNameList())
.groupBy(InfoSource::getId);
List<InfoSource> infoSources = infoSourceService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(infoSources)) {
sourceIdList = infoSources.stream().map(InfoSource::getId).collect(Collectors.toList());
}
}
if (CollectionUtils.isNotEmpty(sourceIdList)) {
LambdaQueryWrapper<SubjectInfoSourceMap> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(SubjectInfoSourceMap::getSubjectId, subjectSourceVO.getSubjectId())
.in(SubjectInfoSourceMap::getSourceId, sourceIdList)
.eq(SubjectInfoSourceMap::getType, 1);
List<SubjectInfoSourceMap> list = subjectInfoSourceMapService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(list)) {
List<String> existSourceIdList = list.stream().map(SubjectInfoSourceMap::getSourceId).collect(Collectors.toList());
sourceIdList.removeAll(existSourceIdList);
}
if (CollectionUtils.isNotEmpty(sourceIdList)) {
List<SubjectInfoSourceMap> dataList = new ArrayList<>();
for (String sourceId : sourceIdList) {
SubjectInfoSourceMap subjectInfoSourceMap = new SubjectInfoSourceMap();
subjectInfoSourceMap.setSubjectId(subjectSourceVO.getSubjectId());
subjectInfoSourceMap.setSourceId(sourceId);
subjectInfoSourceMap.setType(1);
dataList.add(subjectInfoSourceMap);
}
subjectInfoSourceMapService.saveBatch(dataList);
}
subjectInfoSourceMapService.saveBatch(dataList);
}
return Result.OK();
}
......@@ -848,17 +852,29 @@ public class SubjectManageController {
* @date 2025/1/9
*/
@PostMapping("/removeDirectInfoSource")
public Result<?> removeDirectInfoSource(@RequestBody List<JSONObject> params){
for (JSONObject param : params) {
String subjectId = param.get("subjectId").toString();
String webSiteName = param.get("webSiteName").toString();
String status = param.get("status").toString();
if ("1".equals(status)) {
List<InfoSource> infoSources = infoSourceService.directSourceColumnList(webSiteName);
List<String> sourceIds = infoSources.stream().map(InfoSource::getId).collect(Collectors.toList());
subjectInfoSourceMapService.remove(new LambdaQueryWrapper<SubjectInfoSourceMap>().eq(SubjectInfoSourceMap::getSubjectId, subjectId).in(SubjectInfoSourceMap::getSourceId, sourceIds));
} else if ("0".equals(status)) {
subjectInfoSourceMiddleMapService.remove(new LambdaQueryWrapper<SubjectInfoSourceMiddleMap>().eq(SubjectInfoSourceMiddleMap::getSubjectId, subjectId).eq(SubjectInfoSourceMiddleMap::getInfoSourceName, webSiteName));
public Result<?> removeDirectInfoSource(@RequestBody List<SubjectBindDirectSourceVO> params){
for (SubjectBindDirectSourceVO param : params) {
String subjectId = param.getSubjectId();
String webSiteName = param.getWebSiteName();
Integer status = param.getStatus();
if (status == 1) {
List<String> sourceIdList;
List<InfoSource> children = param.getChildren();
if (CollectionUtils.isNotEmpty(children)) {
sourceIdList = children.stream().map(InfoSource::getId).collect(Collectors.toList());
} else {
List<String> webSiteNameList = new ArrayList<>();
webSiteNameList.add(webSiteName);
List<InfoSource> infoSources = infoSourceService.subjectBindSourceColumnList(subjectId,webSiteNameList);
sourceIdList = infoSources.stream().map(InfoSource::getId).collect(Collectors.toList());
}
subjectInfoSourceMapService.remove(new LambdaQueryWrapper<SubjectInfoSourceMap>()
.eq(SubjectInfoSourceMap::getSubjectId, subjectId)
.in(SubjectInfoSourceMap::getSourceId, sourceIdList));
} else if (status == 0) {
subjectInfoSourceMiddleMapService.remove(new LambdaQueryWrapper<SubjectInfoSourceMiddleMap>()
.eq(SubjectInfoSourceMiddleMap::getSubjectId, subjectId)
.eq(SubjectInfoSourceMiddleMap::getInfoSourceName, webSiteName));
}
}
return Result.OK();
......
......@@ -104,7 +104,6 @@ public class Subject implements Serializable {
/**是否是平台创建的专题(0否--外部创建 1是--平台创建 )*/
private String isPlatform;
/**第一次启用时间*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date firstOpenTime;
......
package com.zzsn.event.entity.arrange;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
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-11-14
* @Version: V1.0
*/
@Data
@TableName("clb_model_arrange")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="clb_model_arrange对象", description="流程编排")
public class ClbModelArrange implements Serializable {
/**主键id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private String id;
/**分组id*/
@Excel(name = "分组id", width = 15)
@ApiModelProperty(value = "分组id")
private String groupId;
/**流程名*/
@Excel(name = "流程名", width = 15)
@ApiModelProperty(value = "流程名")
private String name;
/**流程编码*/
@Excel(name = "流程编码", width = 15)
@ApiModelProperty(value = "流程编码")
private String code;
/**流程编码*/
@Excel(name = "流程编排信息", width = 15)
@ApiModelProperty(value = "流程编排信息")
private String conf;
/**状态*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private Integer status;
/**0:正常 1:删除*/
@TableLogic
@Excel(name = "0:正常 1:删除", width = 15)
@ApiModelProperty(value = "0:正常 1:删除")
private Integer delFlag;
/**创建人*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@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")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@Excel(name = "更新人", width = 15)
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@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")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
@TableField(exist = false)
private String subjectId;
/**流程编码*/
@Excel(name = "数据来源分类", width = 15)
@ApiModelProperty(value = "数据来源分类")
@TableField(exist = false)
private String type;
}
package com.zzsn.event.enums;
import java.util.ArrayList;
import java.util.List;
public enum SourceTypeEnum {
BASE_DATE_TO_SUBJECT_ORI("baseDateToSubjectOri" ,"定向信息源","定向信息源"),
BASE_DATE_TO_SUBJECT("baseDateToSubject", "通用信息源","通用信息源"),
BASE_DATE_TO_SUBJECT_IGNORE_KW("baseDateToSubjectIgnoreKw", "通用信息源(免过关键词信息源)","通用信息源(免过关键词信息源)"),
BASE_DATE_TO_SUBJECT_VIDEO("baseDateToSubjectVideo", "视频数据","专题绑定的所有信息源的视频数据"),
SUBJECT_TO_SUBJECT("subjectToSubject", "专题库","专题到专题来源"),
ENTERPRISE_TO_SUBJECT_TYPE_OTHER("enterpriseToSubjectTypeOther", "企业库-其他","企业库源研报、公告、动态数据来源"),
ENTERPRISE_TO_SUBJECT_TYPE_YEAR("enterpriseToSubjectTypeYear", "企业库-年报","企业库年报来源"),
POLICY_TO_SUBJECT("policyToSubject", "政策库","政策法规来源"),
YJZX_PLATFORM_TO_SUBJECT("yjzxPlatFormToSubject", "平台数据","平台数据来源"),
KEYWORDS_TO_SUBJECT("keyWordsToSubject", "采集词","配置的采集词组来源");
private final String value;
private final String description;
private final String valueName;
SourceTypeEnum(String value, String valueName, String description) {
this.value = value;
this.description = description;
this.valueName = valueName;
}
public String getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getValueName() {
return valueName;
}
public static String getDescriptionByValue(String value) {
for (SourceTypeEnum enumValue : values()) {
if (enumValue.getValue().equals(value)) {
return enumValue.getDescription();
}
}
return null;
}
public static String getValueNameByValue(String value) {
for (SourceTypeEnum enumValue : values()) {
if (enumValue.getValue().equals(value)) {
return enumValue.getValueName();
}
}
return null;
}
public static List<String> getAllValues() {
List<String> values = new ArrayList<>();
for (SourceTypeEnum enumValue : values()) {
values.add(enumValue.getValue());
}
return values;
}
public static List<String> getbaseDateSourceType() {
List<String> values = new ArrayList<>();
values.add(SourceTypeEnum.BASE_DATE_TO_SUBJECT.getValue());
values.add(SourceTypeEnum.BASE_DATE_TO_SUBJECT_ORI.getValue());
values.add(SourceTypeEnum.BASE_DATE_TO_SUBJECT_IGNORE_KW.getValue());
values.add(SourceTypeEnum.BASE_DATE_TO_SUBJECT_VIDEO.getValue());
values.add(SourceTypeEnum.KEYWORDS_TO_SUBJECT.getValue());
return values;
}
public static List<String> getEnterpriseSourceType() {
List<String> values = new ArrayList<>();
values.add(SourceTypeEnum.ENTERPRISE_TO_SUBJECT_TYPE_OTHER.getValue());
values.add(SourceTypeEnum.ENTERPRISE_TO_SUBJECT_TYPE_OTHER.getValue());
return values;
}
}
......@@ -78,7 +78,8 @@ public class EsService {
private LabelEntityService labelEntityService;
@Autowired
private ISubjectKeywordsMapService subjectKeywordsMapService;
@Autowired
private CommonService commonService;
/**
* 获取专题下的资讯
......@@ -1787,12 +1788,38 @@ public class EsService {
if (StringUtils.isNotBlank(crawler)) {
boolQuery.must(QueryBuilders.termQuery("source.keyword", crawler));
}
//关联标签id集合
List<String> labelIds = searchCondition.getLabelIds();
if (CollectionUtils.isNotEmpty(labelIds)) {
Set<String> relationIdSet = new HashSet<>(labelIds);
TermsQueryBuilder relationIdQuery = QueryBuilders.termsQuery("labels.relationId", relationIdSet);
boolQuery.must(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
}
//正面标签
String tendencyLabelId = searchCondition.getTendencyLabelId();
if (StringUtils.isNotBlank(tendencyLabelId)) {
TermQueryBuilder relationIdQuery = QueryBuilders.termQuery("labels.relationId", tendencyLabelId);
boolQuery.must(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
}
//地域标签
List<String> areaLabelIds = searchCondition.getAreaLabelIds();
if (CollectionUtils.isNotEmpty(areaLabelIds)) {
Set<String> relationIdSet = new HashSet<>(areaLabelIds);
TermsQueryBuilder relationIdQuery = QueryBuilders.termsQuery("labels.relationId", relationIdSet);
boolQuery.must(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
}
//企业标签
List<String> enterpriseLabelTypeIds = searchCondition.getEnterpriseLabelTypeIds();
List<String> socialCreditCodeList = searchCondition.getSocialCreditCodeList();
if (CollectionUtils.isNotEmpty(socialCreditCodeList) || CollectionUtils.isNotEmpty(enterpriseLabelTypeIds)) {
if (CollectionUtils.isEmpty(socialCreditCodeList)) {
socialCreditCodeList = commonService.codesByLabels(enterpriseLabelTypeIds);
}
Set<String> codeSet = new HashSet<>(socialCreditCodeList);
TermsQueryBuilder relationIdQuery = QueryBuilders.termsQuery("labels.relationId", codeSet);
boolQuery.must(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
}
//信息源标签
List<Label> labelList = searchCondition.getLabelList();
if (CollectionUtils.isNotEmpty(labelList)) {
List<String> collect = labelList.stream().map(label -> label.getLabelMark() + "-" + label.getRelationId()).collect(Collectors.toList());
......
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.arrange.ClbModelArrange;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 流程编排
* @Author: jeecg-boot
* @Date: 2024-11-14
* @Version: V1.0
*/
@Mapper
public interface ClbModelArrangeMapper extends BaseMapper<ClbModelArrange> {
List<ClbModelArrange> listBySubjectIds(@Param("idList") List<String> idList);
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.event.vo.InfoSourceCondition;
import com.zzsn.event.vo.InfoSourceVo;
import com.zzsn.event.entity.InfoSource;
import com.zzsn.event.vo.SubjectBindDirectSourceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -38,7 +39,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2024/5/7
*/
List<InfoSourceVo> queryInfoSource(@Param("sourceIdList") List<String> sourceIdList,@Param("subjectIds") List<String> subjectIds);
List<InfoSourceVo> queryInfoSource(@Param("sourceIdList") List<String> sourceIdList, @Param("subjectIds") List<String> subjectIds);
/**
* 专题绑定的信息源集合
......@@ -68,7 +69,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/2/6
*/
List<InfoSourceVo> bindGroupSourceIdList(@Param("subjectIds") List<String> subjectIds, @Param("sourceIds")List<String> sourceIds);
List<InfoSourceVo> bindGroupSourceIdList(@Param("subjectIds") List<String> subjectIds, @Param("sourceIds") List<String> sourceIds);
/**
* 专题直接屏蔽的信息源列表(不包括专题屏蔽的信息源组下的信息源)
......@@ -88,7 +89,7 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/1/6
*/
Page<Map<String, Object>> subjectBindDirectInfoSourceList(@Param("subjectId") String subjectId, Page<Map<String, Object>> page);
Page<SubjectBindDirectSourceVO> subjectBindDirectInfoSourceList(@Param("subjectId") String subjectId, Page<Map<String, Object>> page);
/**
......@@ -99,35 +100,18 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
Page<String> infoSourcePageList(@Param("searchWord") String searchWord, Page<String> page);
Page<SubjectBindDirectSourceVO> infoSourcePageList(@Param("searchWord") String searchWord, Page<String> page);
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用-研究中心)
* 信息源下专题绑定的栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @param page 分页参数
* @param subjectId 专题id
* @param webSiteNames 信息源名称
* @author lkg
* @date 2025/1/4
*/
Page<InfoSource> directSourceColumnList(@Param("webSiteName") String webSiteName, Page<InfoSource> page);
List<InfoSource> subjectBindSourceColumnList(@Param("subjectId") String subjectId, @Param("webSiteNames") List<String> webSiteNames);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @author lkg
* @date 2025/1/4
*/
List<InfoSource> directSourceColumnList(@Param("webSiteName") String webSiteName);
/**
* 信息源下栏目id列表(校验专题配置时使用-研究中心)
*
* @param webSiteNames 信息源名称集合
* @author lkg
* @date 2025/1/4
*/
Set<String> directSourceColumnSet(@Param("webSiteNames") List<String> webSiteNames);
IPage<InfoSourceVo> bindSourceIdPageList(Page<InfoSourceVo> page, @Param("infoSourceVo") InfoSourceCondition infoSourceCondition, @Param("subjectIds") List<String> subjectIds);
......
<?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="com.zzsn.event.mapper.ClbModelArrangeMapper">
<select id="listBySubjectIds" resultType="com.zzsn.event.entity.arrange.ClbModelArrange">
SELECT ag.id,ag.group_id,ag.name,ag.code,ag.status,ag.create_by,mp.subject_id,mp.type FROM clb_model_arrange_subject_map mp
INNER JOIN clb_model_arrange ag on mp.arrange_id = ag.id and ag.del_flag = 0 and mp.del_flag = 0
WHERE mp.subject_id in
<if test="idList!=null and idList.size()>0">
<foreach collection="idList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -334,7 +334,7 @@
</select>
<select id="subjectBindDirectInfoSourceList" resultType="Map">
<select id="subjectBindDirectInfoSourceList" resultType="com.zzsn.event.vo.SubjectBindDirectSourceVO">
select a.*
from (
select iso.web_site_name as webSiteName, 1 as `status`
......@@ -351,32 +351,27 @@
order by a.status desc, a.webSiteName asc
</select>
<select id="infoSourcePageList" resultType="String">
<select id="infoSourcePageList" resultType="com.zzsn.event.vo.SubjectBindDirectSourceVO">
select iso.web_site_name
from info_source iso where 1=1
<if test="searchWord!=null and searchWord != ''">
and (
iso.web_site_name like CONCAT('%',#{searchWord},'%')
)
and iso.web_site_name like CONCAT('%',#{searchWord},'%')
</if>
group by iso.web_site_name
</select>
<select id="directSourceColumnList" resultType="com.zzsn.event.entity.InfoSource">
select iso.id, iso.site_name, iso.site_uri
<select id="subjectBindSourceColumnList" resultType="com.zzsn.event.entity.InfoSource">
select iso.id, iso.web_site_name,iso.site_name, iso.site_uri
from info_source iso
where iso.web_site_name = #{webSiteName}
</select>
<select id="directSourceColumnSet" resultType="String">
select iso.id from info_source iso
where 1=1
inner join subject_info_source_map sm on iso.id = sm.source_id and sm.type = 1
where sm.subject_id = #{subjectId}
<if test="webSiteNames != null and webSiteNames.size() > 0">
and iso.web_site_name in
<foreach collection="webSiteNames" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by iso.id
</select>
<select id="listIdByGroupIds" resultType="java.lang.String">
SELECT a.id
......
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.arrange.ClbModelArrange;
import java.util.List;
/**
* @Description: 流程编排
* @Author: jeecg-boot
* @Date: 2024-11-14
* @Version: V1.0
*/
public interface IClbModelArrangeService extends IService<ClbModelArrange> {
List<ClbModelArrange> listBySubjectIds(List<String> idList);
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.vo.InfoSourceCondition;
import com.zzsn.event.vo.InfoSourceVo;
import com.zzsn.event.entity.InfoSource;
import com.zzsn.event.vo.SubjectBindDirectSourceVO;
import java.util.List;
import java.util.Map;
......@@ -64,7 +65,7 @@ public interface IInfoSourceService extends IService<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
IPage<Map<String, Object>> subjectBindDirectSourcePageList(String subjectId, Integer pageNo, Integer pageSize);
IPage<SubjectBindDirectSourceVO> subjectBindDirectSourcePageList(String subjectId, Integer pageNo, Integer pageSize);
/**
* 信息源分页列表(专题绑定定向信息源时使用-研究中心)
......@@ -75,39 +76,21 @@ public interface IInfoSourceService extends IService<InfoSource> {
* @author lkg
* @date 2025/1/4
*/
IPage<String> directSourcePageList(String searchWord, Integer pageNo, Integer pageSize);
IPage<SubjectBindDirectSourceVO> directSourcePageList(String searchWord, Integer pageNo, Integer pageSize);
/**
* 信息源下栏目分页列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2025/1/4
*/
IPage<InfoSource> directSourceColumnPageList(String webSiteName, Integer pageNo, Integer pageSize);
/**
* 信息源下栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param webSiteName 信息源名称
* @author lkg
* @date 2025/1/4
*/
List<InfoSource> directSourceColumnList(String webSiteName);
IPage<InfoSourceVo> bindInfoSourcePageList(InfoSourceCondition infoSourceCondition, List<String> subjectIdList, Integer pageNo, Integer pageSize);
/**
* 信息源下栏目id列表(校验专题配置时使用-研究中心)
* 信息源下专题绑定的栏目列表(专题绑定定向信息源时使用-研究中心)
*
* @param subjectId 专题id
* @param webSiteNames 信息源名称集合
* @author lkg
* @date 2025/1/4
* @date 2025/2/12
*/
Set<String> directSourceColumnSet(List<String> webSiteNames);
IPage<InfoSourceVo> bindInfoSourcePageList(InfoSourceCondition infoSourceCondition, List<String> subjectIdList, Integer pageNo, Integer pageSize);
List<InfoSource> subjectBindSourceColumnList(String subjectId,List<String> webSiteNames);
List<String> listByGroupIds(List<String> groupIds);
......
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.arrange.ClbModelArrange;
import com.zzsn.event.mapper.ClbModelArrangeMapper;
import com.zzsn.event.service.IClbModelArrangeService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description: 流程编排
* @Author: jeecg-boot
* @Date: 2024-11-14
* @Version: V1.0
*/
@Service
public class ClbModelArrangeServiceImpl extends ServiceImpl<ClbModelArrangeMapper, ClbModelArrange> implements IClbModelArrangeService {
@Override
public List<ClbModelArrange> listBySubjectIds(List<String> idList) {
return baseMapper.listBySubjectIds(idList);
}
}
......@@ -4,7 +4,9 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.InfoSource;
......@@ -14,6 +16,7 @@ import com.zzsn.event.service.IInfoSourceService;
import com.zzsn.event.vo.InfoSourceCondition;
import com.zzsn.event.vo.InfoSourceVo;
import com.zzsn.event.vo.NumVO;
import com.zzsn.event.vo.SubjectBindDirectSourceVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -124,31 +127,43 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
@Override
public IPage<Map<String, Object>> subjectBindDirectSourcePageList(String subjectId, Integer pageNo, Integer pageSize) {
public IPage<SubjectBindDirectSourceVO> subjectBindDirectSourcePageList(String subjectId, Integer pageNo, Integer pageSize) {
Page<Map<String, Object>> page = new Page<>(pageNo, pageSize);
return baseMapper.subjectBindDirectInfoSourceList(subjectId, page);
Page<SubjectBindDirectSourceVO> pageList = baseMapper.subjectBindDirectInfoSourceList(subjectId, page);
List<SubjectBindDirectSourceVO> records = pageList.getRecords();
if (CollectionUtils.isNotEmpty(records)) {
List<String> webSiteNames = records.stream().map(SubjectBindDirectSourceVO::getWebSiteName).collect(Collectors.toList());
List<InfoSource> bindSourceColumnList = this.subjectBindSourceColumnList(subjectId, webSiteNames);
Map<String, List<InfoSource>> webSiteNameMap = bindSourceColumnList.stream().collect(Collectors.groupingBy(InfoSource::getWebSiteName));
for (SubjectBindDirectSourceVO subjectBindDirectSourceVO : records) {
Integer status = subjectBindDirectSourceVO.getStatus();
if (status == 1) {
List<InfoSource> infoSources = webSiteNameMap.get(subjectBindDirectSourceVO.getWebSiteName());
subjectBindDirectSourceVO.setChildren(infoSources);
}
}
}
return pageList;
}
@Override
public IPage<String> directSourcePageList(String searchWord, Integer pageNo, Integer pageSize) {
public IPage<SubjectBindDirectSourceVO> directSourcePageList(String searchWord, Integer pageNo, Integer pageSize) {
Page<String> page = new Page<>(pageNo, pageSize);
return baseMapper.infoSourcePageList(searchWord, page);
}
@Override
public IPage<InfoSource> directSourceColumnPageList(String webSiteName, Integer pageNo, Integer pageSize) {
Page<InfoSource> page = new Page<>(pageNo, pageSize);
return baseMapper.directSourceColumnList(webSiteName, page);
}
@Override
public List<InfoSource> directSourceColumnList(String webSiteName) {
return baseMapper.directSourceColumnList(webSiteName);
}
@Override
public Set<String> directSourceColumnSet(List<String> webSiteNames) {
return baseMapper.directSourceColumnSet(webSiteNames);
Page<SubjectBindDirectSourceVO> pageList = baseMapper.infoSourcePageList(searchWord, page);
List<SubjectBindDirectSourceVO> records = pageList.getRecords();
if (CollectionUtils.isNotEmpty(records)) {
List<String> webSiteNames = records.stream().map(SubjectBindDirectSourceVO::getWebSiteName).collect(Collectors.toList());
LambdaQueryWrapper<InfoSource> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.select(InfoSource::getId,InfoSource::getWebSiteName,InfoSource::getSiteName,InfoSource::getSiteUri)
.in(InfoSource::getWebSiteName, webSiteNames);
List<InfoSource> children = this.list(queryWrapper);
Map<String, List<InfoSource>> webSiteNameMap = children.stream().collect(Collectors.groupingBy(InfoSource::getWebSiteName));
for (SubjectBindDirectSourceVO subjectBindDirectSourceVO : records) {
List<InfoSource> infoSources = webSiteNameMap.get(subjectBindDirectSourceVO.getWebSiteName());
subjectBindDirectSourceVO.setChildren(infoSources);
}
}
return pageList;
}
@Override
......@@ -217,6 +232,11 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
}
@Override
public List<InfoSource> subjectBindSourceColumnList(String subjectId, List<String> webSiteNames) {
return baseMapper.subjectBindSourceColumnList(subjectId, webSiteNames);
}
@Override
public List<String> listByGroupIds(List<String> groupIds) {
return baseMapper.listIdByGroupIds(groupIds);
......
......@@ -117,13 +117,6 @@ public class InformationServiceImpl implements InformationService {
subjectIdList = subjectTypeMapService.selectEventByTypeIds(typeIds);
}
}
List<String> relationIds = searchCondition.getLabelIds();
List<String> labelTypeIds = searchCondition.getLabelTypeIds();
if (CollectionUtils.isNotEmpty(labelTypeIds)) {
List<String> socialCreditCodeList = commonService.codesByLabels(labelTypeIds);
relationIds.addAll(socialCreditCodeList);
}
searchCondition.setLabelIds(relationIds);
try {
IPage<SpecialInformation> specialInformationIPage = esService.pageListByCondition(searchCondition,subjectIdList);
long total = specialInformationIPage.getTotal();
......
......@@ -16,8 +16,10 @@ import com.zzsn.clb.common.model.task.dto.titr.KeyWordsDTO;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.*;
import com.zzsn.event.entity.arrange.ClbModelArrange;
import com.zzsn.event.enums.BindTypeEnum;
import com.zzsn.event.enums.CodePrefixEnum;
import com.zzsn.event.enums.SourceTypeEnum;
import com.zzsn.event.mapper.SubjectMapper;
import com.zzsn.event.service.*;
import com.zzsn.event.util.CodeGenerateUtil;
......@@ -90,7 +92,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
private ClbModelArrangeSubjectMapService clbModelArrangeSubjectMapService;
@Autowired
private IKeyWordsService iKeyWordsService;
@Autowired
private IClbModelArrangeService clbModelArrangeService;
@Value("${python.subjectProcessorUrl}")
private String subjectProcessorUrl;
......@@ -131,6 +134,16 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
subjectPage1.setInfoSourceNum(infoSourceNum);
subjectPage1.setKeyWordsNum(keyWordsNum);
}
//查询绑定的流程
List<ClbModelArrange> clbModelArranges = clbModelArrangeService.listBySubjectIds(idList);
if (CollectionUtil.isNotEmpty(clbModelArranges)){
clbModelArranges.forEach(e -> e.setType(SourceTypeEnum.getValueNameByValue(e.getType())));
Map<String, List<ClbModelArrange>> collect = clbModelArranges.stream().collect(Collectors.groupingBy(ClbModelArrange::getSubjectId));
records.forEach(e -> {
e.setClbModelArranges(collect.get(e.getId()));
});
}
}
return pageList;
}
......
......@@ -120,7 +120,7 @@ public class PythonUtil {
if (isHandleSuccess.equals("true")) {
log.info("专题-{},清空数据,调用python接口清空去重服务历史数据请求发送成功",subjectId);
} else {
log.info("python清空去重服务历史数据接口异常");
log.info("python清空去重服务历史数据接口异常:{}",jsonObject.getString("logs"));
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -61,11 +61,19 @@ public class InfoDataSearchCondition {
private String isSubject = "1";
//爬虫类型
private String crawler;
/**----企业类标签筛选----**/
//企业类标签id集合
private List<String> labelTypeIds;
private List<String> enterpriseLabelTypeIds;
//企业信用代码集合
private List<String> socialCreditCodeList;
/**----企业类标签id集合----**/
//关联标签值id集合
private List<String> labelIds;
//关联标签集合
//正负面标签
private String tendencyLabelId;
//地域标签id集合
private List<String> areaLabelIds;
//关联信息源标签集合
private List<Label> labelList;
//信息源id
private String sourceId;
......
package com.zzsn.event.vo;
import com.zzsn.event.entity.InfoSource;
import lombok.Data;
import java.util.List;
/**
* 专题绑定信息源
*
* @author lkg
* @date 2025/2/12
*/
@Data
public class SubjectBindDirectSourceVO {
/**专题id*/
private String subjectId;
/**信息源名称*/
private String webSiteName;
/**状态(1-已配置;0-待配置)*/
private Integer status;
/**信息源栏目集合*/
private List<InfoSource> children;
}
package com.zzsn.event.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzsn.event.entity.arrange.ClbModelArrange;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -158,4 +159,6 @@ public class SubjectPage {
/**预估状态*/
private String estimateStatus;
private List<ClbModelArrange> clbModelArranges;
}
......@@ -19,9 +19,6 @@ public class SubjectParamsCheckVO {
/**信息源标签*/
private SubjectSourceTagVO subjectSourceTagVO;
/**信息源名称列表*/
private List<String> infoSourceWebSiteNames;
/**信息源id列表-推荐信息源*/
private List<String> infoSourceIds;
/**定向信息源是否发生变化*/
private boolean directSourceChange;
}
......@@ -2,6 +2,8 @@ package com.zzsn.event.vo;
import lombok.Data;
import java.util.List;
/**
*
*
......@@ -14,6 +16,10 @@ public class SubjectSourceVO {
private String sourceId;
private Integer count;
//绑定定向信息源时使用(研究中心)
/**---绑定定向信息源时使用(研究中心)---**/
private List<String> webSiteNameList;
private List<String> sourceIdList;
private String webSiteName;
/**---绑定定向信息源时使用(研究中心)---**/
}
......@@ -134,11 +134,25 @@ scoreRule:
translate:
url: http://114.116.116.241:8018/translate/getTranslateInfoWithTag
python:
#python打分接口
#python打分接口-弃用
scoreModelUrl: http://114.116.36.231:8080/score
#python开始执行接口
#python开始执行接口--弃用
subjectProcessorUrl: http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl: http://114.116.36.231:8080/subject/judg_duplicate
judgeDuplicateUrl: http://1.95.13.40:8080/subject/judg_duplicate
#抽取关键词
keyWordsExtractUrl: http://1.95.91.200:7006/get_phrase/
\ No newline at end of file
keyWordsExtractUrl: http://1.95.91.200:7006/get_phrase/
#清空去重服务历史数据
clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data
jeecg:
shiro:
excludeUrls:
kafka:
topic:
subject:
run: subjectModelTest
clb:
subject:
default:
processing:
advanceMonth: 6
\ No newline at end of file
......@@ -130,4 +130,27 @@ scoreRule:
yearScore: 3
beforeYearScore: 1
translate:
url: http://114.116.116.241:8018/translate/getTranslateInfoWithTag
\ No newline at end of file
url: http://114.116.116.241:8018/translate/getTranslateInfoWithTag
python:
#python打分接口-弃用
scoreModelUrl: http://114.116.36.231:8080/score
#python开始执行接口--弃用
subjectProcessorUrl: http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl: http://1.95.13.40:8080/subject/judg_duplicate
#抽取关键词
keyWordsExtractUrl: http://1.95.91.200:7006/get_phrase/
#清空去重服务历史数据
clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data
jeecg:
shiro:
excludeUrls:
kafka:
topic:
subject:
run: subjectModelTest
clb:
subject:
default:
processing:
advanceMonth: 6
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论