提交 90934160 作者: obcy

添加通知采集类

上级 65921aa6
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 信息源和标签关系表
* </p>
*
* @author obcy
* @since 2025-01-03
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("clb_label_info_source_map")
public class ClbLabelInfoSourceMap extends Model<ClbLabelInfoSourceMap> {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
* 创建人
*/
@TableField("create_by")
private String createBy;
/**
* 创建日期
*/
@TableField("create_time")
private Date createTime;
/**
* 更新人
*/
@TableField("update_by")
private String updateBy;
/**
* 更新日期
*/
@TableField("update_time")
private Date updateTime;
/**
* 实体唯一编码
*/
@TableField("entity_code")
private String entityCode;
/**
* 标签值唯一编码
*/
@TableField("label_item_code")
private String labelItemCode;
/**
* 标签唯一编码
*/
@TableField("label_code")
private String labelCode;
/**
* 标签附加属性
*/
@TableField("extra_code")
private String extraCode;
/**
* 业务口径(1自定义,2实体数仓表引用,3字典引用)
*/
@TableField("business_caliber")
private Integer businessCaliber;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.zzsn.event.enums; package com.zzsn.event.enums;
import java.util.ArrayList;
import java.util.List;
/** /**
* @author zs * @author zs
* @Description 信息源/信息源组 枚举 * @Description 信息源/信息源组 枚举
...@@ -7,15 +10,21 @@ package com.zzsn.event.enums; ...@@ -7,15 +10,21 @@ package com.zzsn.event.enums;
*/ */
public enum BindTypeEnum { public enum BindTypeEnum {
INFO_SOURCE(1,"绑定的信息源"),
INFO_SOURCE_GROUP(2,"绑定的信息源组"), INFO_SOURCE(1,"绑定的通用信息源"),
INFO_SOURCE_GROUP(2,"绑定的通用信息源组"),
EXCLUDE_INFO_SOURCE(3,"排除的信息源"), EXCLUDE_INFO_SOURCE(3,"排除的信息源"),
EXCLUDE_INFO_SOURCE_GROUP(4,"排除的信息源组"), EXCLUDE_INFO_SOURCE_GROUP(4,"排除的信息源组"),
DIRECTIONA_INFO_SOURCE_GROUP(5,"定向的信息源组"); DIRECTIONA_INFO_SOURCE_GROUP(5,"定向的信息源组"),
DIRECTIONA_INFO_SOURCE(6,"定向的信息源"),
INFO_SOURCE_LABEL(12,"通用信息源标签"),
EXCLUDE_INFO_SOURCE_LABEL(14,"排除信息源标签"),
DIRECTIONA_INFO_SOURCE_LABEL(15,"定向信息源标签")
;
private Integer value; private Integer value;
private String des; private String des;
...@@ -32,4 +41,42 @@ public enum BindTypeEnum { ...@@ -32,4 +41,42 @@ public enum BindTypeEnum {
public String getDes() { public String getDes() {
return des; return des;
} }
//定向、通用、屏蔽信息源组类型返回
public static List<Integer> getInfoSourceGroupType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE_GROUP.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE_GROUP.getvalue());
return values;
}
//定向、通用、屏蔽信息源类型返回
public static List<Integer> getInfoSourceType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE.getvalue());
return values;
}
//定向、通用、屏蔽 标签类型返回
public static List<Integer> getInfoSourceLabelType() {
List<Integer> values = new ArrayList<>();
values.add(BindTypeEnum.INFO_SOURCE_LABEL.getvalue());
values.add(BindTypeEnum.EXCLUDE_INFO_SOURCE_LABEL.getvalue());
values.add(BindTypeEnum.DIRECTIONA_INFO_SOURCE_LABEL.getvalue());
return values;
}
public static BindTypeEnum getEnumByValue(Integer value) {
for (BindTypeEnum bindTypeEnum : BindTypeEnum.values()) {
if (bindTypeEnum.getvalue().equals(value)) {
return bindTypeEnum;
}
}
return null;
}
} }
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.ClbLabelInfoSourceMap;
/**
* <p>
* 信息源和标签关系表 Mapper 接口
* </p>
*
* @author obcy
* @since 2025-01-03
*/
public interface ClbLabelInfoSourceMapMapper extends BaseMapper<ClbLabelInfoSourceMap> {
}
...@@ -130,4 +130,6 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> { ...@@ -130,4 +130,6 @@ public interface InfoSourceMapper extends BaseMapper<InfoSource> {
Set<String> directSourceColumnSet(@Param("webSiteNames") List<String> webSiteNames); Set<String> directSourceColumnSet(@Param("webSiteNames") List<String> webSiteNames);
IPage<InfoSourceVo> bindSourceIdPageList(Page<InfoSourceVo> page, @Param("infoSourceVo") InfoSourceCondition infoSourceCondition, @Param("subjectIds") List<String> subjectIds); IPage<InfoSourceVo> bindSourceIdPageList(Page<InfoSourceVo> page, @Param("infoSourceVo") InfoSourceCondition infoSourceCondition, @Param("subjectIds") List<String> subjectIds);
List<String> listIdByGroupIds(@Param("groupIds") List<String> groupIds);
} }
...@@ -61,4 +61,6 @@ public interface KeyWordsMapper extends BaseMapper<KeyWords> { ...@@ -61,4 +61,6 @@ public interface KeyWordsMapper extends BaseMapper<KeyWords> {
List<KeyWordsPage> pageListByTypeIdList(@Param("ids") List<String> ids, @Param("subjectId") String subjectId, @Param("status") int status, @Param("bindingType") String bindingType); List<KeyWordsPage> pageListByTypeIdList(@Param("ids") List<String> ids, @Param("subjectId") String subjectId, @Param("status") int status, @Param("bindingType") String bindingType);
Integer countByTypeAndIdList(@Param("finalIdList") List<String> finalIdList, @Param("subjectId") String subjectId); Integer countByTypeAndIdList(@Param("finalIdList") List<String> finalIdList, @Param("subjectId") String subjectId);
List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(@Param("subjectIds") List<String> ids, @Param("bindingType") String bindingType);
} }
<?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.ClbLabelInfoSourceMapMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zzsn.event.entity.ClbLabelInfoSourceMap">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="entity_code" property="entityCode" />
<result column="label_item_code" property="labelItemCode" />
<result column="label_code" property="labelCode" />
<result column="extra_code" property="extraCode" />
<result column="business_caliber" property="businessCaliber" />
</resultMap>
</mapper>
...@@ -378,4 +378,16 @@ ...@@ -378,4 +378,16 @@
</foreach> </foreach>
</if> </if>
</select> </select>
</mapper> <select id="listIdByGroupIds" resultType="java.lang.String">
SELECT a.id
from info_source a
INNER JOIN info_source_group_map b ON b.source_id = a.id
where 1=1
<if test="groupIds!=null and groupIds.size()>0">
and b.group_id in
<foreach collection="groupIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select></mapper>
...@@ -120,4 +120,22 @@ ...@@ -120,4 +120,22 @@
</foreach> </foreach>
and a.id not in (select keywords_id from subject_keywords_map where subject_id = #{subjectId}) and a.id not in (select keywords_id from subject_keywords_map where subject_id = #{subjectId})
</select> </select>
<select id="bindKeyWordsListByIdsAndBindType" resultType="com.zzsn.event.vo.KeyWordsPage">
SELECT b.*, d.id as keyWordsTypeId, d.type_name as keyWordTypeNames, a.type as type, a.id as subjectKeyWordId,a.binding_type FROM key_words b
LEFT JOIN subject_keywords_map a ON a.keywords_id = b.id
LEFT JOIN keywords_type_map c ON b.id = c.keywords_id
LEFT JOIN keywords_type d ON d.id = c.type_id
where 1=1
<if test="subjectIds != null and subjectIds.size() > 0">
and a.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="bindingType!=null and bindingType != ''">
and a.binding_type = #{bindingType}
</if>
group by b.id
</select>
</mapper> </mapper>
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.ClbLabelInfoSourceMap;
/**
* <p>
* 信息源和标签关系表 服务类
* </p>
*
* @author obcy
* @since 2025-01-03
*/
public interface ClbLabelInfoSourceMapService extends IService<ClbLabelInfoSourceMap> {
}
...@@ -108,4 +108,7 @@ public interface IInfoSourceService extends IService<InfoSource> { ...@@ -108,4 +108,7 @@ public interface IInfoSourceService extends IService<InfoSource> {
Set<String> directSourceColumnSet(List<String> webSiteNames); Set<String> directSourceColumnSet(List<String> webSiteNames);
IPage<InfoSourceVo> bindInfoSourcePageList(InfoSourceCondition infoSourceCondition, List<String> subjectIdList, Integer pageNo, Integer pageSize); IPage<InfoSourceVo> bindInfoSourcePageList(InfoSourceCondition infoSourceCondition, List<String> subjectIdList, Integer pageNo, Integer pageSize);
List<String> listByGroupIds(List<String> groupIds);
} }
...@@ -7,6 +7,7 @@ import com.zzsn.event.entity.Event; ...@@ -7,6 +7,7 @@ import com.zzsn.event.entity.Event;
import com.zzsn.event.entity.KeyWords; import com.zzsn.event.entity.KeyWords;
import com.zzsn.event.vo.KeyWordsPage; import com.zzsn.event.vo.KeyWordsPage;
import com.zzsn.event.vo.KeywordsVO; import com.zzsn.event.vo.KeywordsVO;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -87,4 +88,5 @@ public interface IKeyWordsService extends IService<KeyWords> { ...@@ -87,4 +88,5 @@ public interface IKeyWordsService extends IService<KeyWords> {
Integer countByTypeAndIdList(List<String> finalIdList, String subjectId); Integer countByTypeAndIdList(List<String> finalIdList, String subjectId);
List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType);
} }
...@@ -160,4 +160,6 @@ public interface SubjectService extends IService<Subject> { ...@@ -160,4 +160,6 @@ public interface SubjectService extends IService<Subject> {
* 发送消息 * 发送消息
*/ */
void send(String subjectId, String status); void send(String subjectId, String status);
List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType);
} }
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.ClbLabelInfoSourceMap;
import com.zzsn.event.mapper.ClbLabelInfoSourceMapMapper;
import com.zzsn.event.service.ClbLabelInfoSourceMapService;
import org.springframework.stereotype.Service;
/**
* <p>
* 信息源和标签关系表 服务实现类
* </p>
*
* @author obcy
* @since 2025-01-03
*/
@Service
public class ClbLabelInfoSourceMapServiceImpl extends ServiceImpl<ClbLabelInfoSourceMapMapper, ClbLabelInfoSourceMap> implements ClbLabelInfoSourceMapService {
}
...@@ -215,4 +215,10 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou ...@@ -215,4 +215,10 @@ public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSou
} }
return pageList; return pageList;
} }
@Override
public List<String> listByGroupIds(List<String> groupIds) {
return baseMapper.listIdByGroupIds(groupIds);
}
} }
...@@ -271,4 +271,8 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i ...@@ -271,4 +271,8 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
keywordsTypeMap.setSysOrgCode(keyWords.getSysOrgCode()); keywordsTypeMap.setSysOrgCode(keyWords.getSysOrgCode());
keywordsTypeMapService.save(keywordsTypeMap); keywordsTypeMapService.save(keywordsTypeMap);
} }
@Override
public List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType) {
return baseMapper.bindKeyWordsListByIdsAndBindType(ids,bindingType);
}
} }
...@@ -88,6 +88,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -88,6 +88,8 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
private IAlgorithmModelService modelService; private IAlgorithmModelService modelService;
@Autowired @Autowired
private ClbModelArrangeSubjectMapService clbModelArrangeSubjectMapService; private ClbModelArrangeSubjectMapService clbModelArrangeSubjectMapService;
@Autowired
private IKeyWordsService iKeyWordsService;
@Value("${python.subjectProcessorUrl}") @Value("${python.subjectProcessorUrl}")
...@@ -688,5 +690,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl ...@@ -688,5 +690,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
} }
} }
} }
@Override
public List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType) {
return iKeyWordsService.bindKeyWordsListByIdsAndBindType(ids,bindingType);
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论