提交 7ef7f858 作者: chenshiqiang

commit 3.30

上级 0bbacb7c
......@@ -2,6 +2,8 @@ package com.zzsn.event.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -123,4 +125,16 @@ public class Event {
private Integer mediaHot;
private Integer wechatHot;
private Integer otherHot;
private Integer publishStatus;
private String relationEvents;
@TableField(exist = false)
private String startDate;
@TableField(exist = false)
private String endDate;
@TableField(exist = false)
private List<Event> relatedEventList;
@TableField(exist = false)
private EventTag eventTag;
}
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.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* @Description: EventTag
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Data
@TableName("event_tag")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="EventTag对象", description="事件")
public class EventTag {
/**ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID")
private String id;
private String eventId;
private String extractIndustryTag;
private String extractCompanyTag;
private String extractPersonTag;
private String extractSentimentTag;
private String extractKeywordsTag;
private String extractLocationTag;
private String extractTimeTag;
}
......@@ -2,6 +2,7 @@ package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.Event;
import com.zzsn.event.entity.LabelEntity;
import com.zzsn.event.vo.SubjectKafkaVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -25,4 +26,6 @@ public interface EventMapper extends BaseMapper<Event> {
Integer totalCount(@Param("event") Event event);
List<SubjectKafkaVo> prosessList(Date disableDate);
List<LabelEntity> listByType(String labelTypeId);
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.EventTag;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Mapper
public interface EventTagMapper extends BaseMapper<EventTag> {
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.xxljob.entity.InfoSource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 信息源表
* @Author: jeecg-boot
* @Date: 2022-01-18
* @Version: V1.0
*/
@Mapper
public interface InfoSourceMapper extends BaseMapper<InfoSource> {
String getNatureName(@Param("id") String id);
}
......@@ -19,6 +19,13 @@
<if test="event.eventType!=null and event.eventType != ''">
and t1.event_type = #{event.eventType}
</if>
<if test="event.startDate!=null and event.startDate != ''">
and t1.create_time >= #{event.startDate}
</if>
<if test="event.endDate!=null and event.endDate != ''">
and t1.create_time <![CDATA[ <= ]]> #{event.endDate}
</if>
order by t1.create_time desc
limit #{offset}, #{pageSize}
</select>
<select id="totalCount" resultType="java.lang.Integer">
......@@ -31,15 +38,27 @@
<if test="event.eventType!=null and event.eventType != ''">
and t1.event_type = #{event.eventType}
</if>
<if test="event.startDate!=null and event.startDate != ''">
and t1.create_time >= #{event.startDate}
</if>
<if test="event.endDate!=null and event.endDate != ''">
and t1.create_time <![CDATA[ <= ]]> #{event.endDate}
</if>
</select>
<select id="prosessList" resultType="com.zzsn.event.vo.SubjectKafkaVo">
select s.id,s.event_name as subject_name,s.start_time as time_enable,s.end_time as time_disable,s.incre_ana_rule,
s.total_ana_rule,s.time_ana_rule,s.analysis_time,s.event_time
from event s
where 1=1
where 1=1 and id='1702575766171996162'
<if test="endDate != null">
and (s.end_time is null or s.end_time <![CDATA[ >= ]]> #{endDate})
</if>
</select>
<select id="listByType" resultType="com.zzsn.event.entity.LabelEntity">
SELECT e.id, e.name
FROM label_entity e
inner join sys_base_label_type_map m on e.id = m.relation_id
where m.label_id = #{labelTypeId}
</select>
</mapper>
\ No newline at end of file
<?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.InfoSourceMapper">
<select id="getNatureName" resultType="String">
select nature_name from info_source_nature where id = #{id}
</select>
</mapper>
......@@ -144,4 +144,6 @@ public interface EsStatisticsService {
* @date 2024/2/29
*/
Page<NegativeDataVO> labelPageList(String labelId, String startTime, String endTime, Integer pageNo, Integer pageSize);
CountVO flowData(String subjectId, String startTime, String endTime, Integer type);
}
......@@ -3,6 +3,7 @@ package com.zzsn.event.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zzsn.event.entity.Event;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.LabelEntity;
import com.zzsn.event.vo.AddEventParam;
import com.zzsn.event.vo.KeyWordsPage;
import com.zzsn.event.vo.SubjectKafkaVo;
......@@ -43,4 +44,6 @@ public interface IEventService extends IService<Event> {
void deleteMain(String id);
String upload(MultipartFile file);
List<LabelEntity> listByType(String labelTypeId);
}
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.EventTag;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
public interface IEventTagService extends IService<EventTag> {
}
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.xxljob.entity.InfoSource;
/**
* @Description: 信息源表
* @Author: jeecg-boot
* @Date: 2022-01-18
* @Version: V1.0
*/
public interface IInfoSourceService extends IService<InfoSource> {
String getNatureName(String id);
}
package com.zzsn.event.service;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.util.DateUtil;
import com.zzsn.event.util.EsDateUtil;
import com.zzsn.event.util.EsIndexUtil;
import com.zzsn.event.vo.DisplayInfo;
import com.zzsn.event.vo.SubjectInfoVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Slf4j
@Service
public class SubjectDisplayServive {
@Autowired
private RestHighLevelClient client;
/**
* 分页获取数据
*
* @param subjectInfo 查询条件封装
* @param offset 页数
* @param pageSize 每页条数
* @param labelIds
* @param socialCreditCodeList 企业信用代码集合
* @param sourceId
* @throws Exception 异常
*/
public IPage<DisplayInfo> frontListByPage(String objectType, String objectId, String userId, SubjectInfoVo subjectInfo, String video, int offset, int pageSize,
String column, String order, String crawler, String isSubject, String subjectType, String labelIds, List<String> socialCreditCodeList, String sourceId, Integer isCustomer) throws Exception {
String[] indexs = EsIndexUtil.getIndexIntervalYear(Constants.ES_DATA_FOR_SUBJECT, subjectInfo.getStartTime(), subjectInfo.getEndTime());
SearchRequest searchRequest = new SearchRequest(Constants.ES_DATA_FOR_SUBJECT);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
//设置分页参数
searchSourceBuilder.size(pageSize);
searchSourceBuilder.from((offset - 1) * pageSize);
//默认按照置顶以及时间倒序排列
//根据topNum正序查找,查询置顶数据
searchSourceBuilder.sort("topNum", SortOrder.DESC);
if (column.equals("score")) {
if (order.equals("asc")) {
searchSourceBuilder.sort("score", SortOrder.ASC);
searchSourceBuilder.sort("publishDate", SortOrder.ASC);
} else if (order.equals("desc")) {
searchSourceBuilder.sort("score", SortOrder.DESC);
searchSourceBuilder.sort("publishDate", SortOrder.DESC);
}
} else if (column.equals("publishDate")) {
if (order.equals("desc")) {
searchSourceBuilder.sort("publishDate", SortOrder.DESC);
searchSourceBuilder.sort("score", SortOrder.DESC);
} else if (order.equals("asc")) {
searchSourceBuilder.sort("publishDate", SortOrder.ASC);
searchSourceBuilder.sort("score", SortOrder.ASC);
}
}
//默认最大数量是10000,设置为true后,显示准确数量
searchSourceBuilder.trackTotalHits(true);
//创建查询对象
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.matchQuery("subjectId", subjectInfo.getSubjectId()));
if (StringUtils.isNotEmpty(subjectInfo.getSearch())) {
boolQuery.must(QueryBuilders.multiMatchQuery(subjectInfo.getSearch(), "title", "content"));
}
if (StringUtils.isNotEmpty(subjectInfo.getContent())) {
boolQuery.must(QueryBuilders.matchPhraseQuery("content", subjectInfo.getContent()));
}
if (StringUtils.isNotEmpty(subjectInfo.getTitle())) {
boolQuery.must(QueryBuilders.matchPhraseQuery("title", subjectInfo.getTitle()));
}
if (StringUtils.isNotEmpty(subjectInfo.getOrigin())) {
boolQuery.must(QueryBuilders.matchPhraseQuery("origin", subjectInfo.getOrigin()));
}
if (StringUtils.isNotEmpty(subjectInfo.getSourceAddress())) {
boolQuery.must(QueryBuilders.termQuery("sourceAddress", subjectInfo.getSourceAddress()));
}
if (StringUtils.isNotEmpty(subjectInfo.getId())) {
boolQuery.must(QueryBuilders.termQuery("id", subjectInfo.getId()));
}
if (subjectInfo.getCheckStatusList() != null && subjectInfo.getCheckStatusList().size() > 0) {
List<Integer> list = new ArrayList<>();
list = subjectInfo.getCheckStatusList();
if (list.size() == 1 && list.contains(4)) {
//
} else {
boolQuery.must(QueryBuilders.termsQuery("checkStatus", subjectInfo.getCheckStatusList()));
}
}
if (StringUtils.isNotBlank(video)) {
boolQuery.must(QueryBuilders.matchQuery("type", "video"));
} else {
boolQuery.mustNot(QueryBuilders.matchQuery("type", "video"));
}
//只查询主条目
boolQuery.mustNot(QueryBuilders.matchQuery("flag", "0"));
//删除状态查询
if (subjectInfo.getDeleteFlag() != 0) {
boolQuery.must(QueryBuilders.matchQuery("deleteFlag", "1"));
} else {
boolQuery.mustNot(QueryBuilders.matchQuery("deleteFlag", "1"));
}
//专题库类别筛选
if (subjectInfo.getClassificationType() != null) {
boolQuery.must(QueryBuilders.termQuery("classificationType", subjectInfo.getClassificationType()));
}
//正负面
if (subjectInfo.getOrientation() != null) {
boolQuery.must(QueryBuilders.termQuery("orientation", subjectInfo.getOrientation()));
}
//时间过滤筛选
if (StringUtils.isNotBlank(subjectInfo.getStartTime())) {
boolQuery.filter(QueryBuilders.rangeQuery("publishDate").gte(EsDateUtil.esFieldDateFormat(subjectInfo.getStartTime())));
}
if (StringUtils.isNotBlank(subjectInfo.getEndTime())) {
boolQuery.filter(QueryBuilders.rangeQuery("publishDate").lte(EsDateUtil.esFieldDateFormat(subjectInfo.getEndTime())));
} else {
boolQuery.filter(QueryBuilders.rangeQuery("publishDate").lte(EsDateUtil.esFieldDateFormat(DateUtil.dateToString(new Date()))));
}
if (StringUtils.isNotBlank(crawler)) {
boolQuery.must(QueryBuilders.matchQuery("source", crawler));
}
Set<String> relationIds = new HashSet<>();
if (StringUtils.isNotEmpty(labelIds)) {
relationIds.add(labelIds);
}
if (CollectionUtils.isNotEmpty(socialCreditCodeList)) {
relationIds.addAll(socialCreditCodeList);
}
if (CollectionUtils.isNotEmpty(relationIds)) {
BoolQueryBuilder nestedBoolQueryBuilder = QueryBuilders.boolQuery();
for (String relationId : relationIds) {
TermQueryBuilder relationIdQuery = QueryBuilders.termQuery("labels.relationId", relationId);
nestedBoolQueryBuilder.should(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
}
boolQuery.must(nestedBoolQueryBuilder);
}
if (subjectInfo.getLabelName() != null) {
BoolQueryBuilder nestedBoolQueryBuilder = QueryBuilders.boolQuery();
TermQueryBuilder relationIdQuery = QueryBuilders.termQuery("labels.relationName", subjectInfo.getLabelName());
nestedBoolQueryBuilder.should(QueryBuilders.nestedQuery("labels", relationIdQuery, ScoreMode.None));
boolQuery.must(nestedBoolQueryBuilder);
}
if (StringUtils.isNotBlank(sourceId)) {
boolQuery.must(QueryBuilders.termQuery("sid", sourceId));
}
searchSourceBuilder.query(boolQuery);
searchRequest.source(searchSourceBuilder);
SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
SearchHit[] searchHits = searchResponse.getHits().getHits();
List<DisplayInfo> list = new ArrayList<>();
int i = 0;
for (SearchHit hit : searchHits) {
i++;
String queryInfo = hit.getSourceAsString();
DisplayInfo info = JSONUtil.toBean(queryInfo, DisplayInfo.class);
info.setPublishDate(EsDateUtil.esFieldDateMapping(info.getPublishDate()));
String index = hit.getIndex();
info.setIndex(index);
list.add(info);
}
IPage<DisplayInfo> pageData = new Page<>(offset, pageSize, searchResponse.getHits().getTotalHits().value);
pageData.setRecords(list);
return pageData;
}
}
......@@ -530,11 +530,6 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
*/
private SearchSourceBuilder formatSourceBuilder(String subjectId, String relationId, String startTime, String endTime, Integer type) {
SpecialInformationParam param = new SpecialInformationParam();
if (StringUtils.isNotEmpty(subjectId)) {
param.setSubjectId(subjectId);
} else {
param.setDataType("yqjc");
}
if (StringUtils.isNotEmpty(relationId)) {
param.setSearchLabelIds(relationId);
}
......@@ -587,4 +582,43 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
return percentage;
}
@Override
public CountVO flowData(String subjectId,String startTime, String endTime, Integer type) {
CountVO countVO = new CountVO();
SearchRequest searchRequest = new SearchRequest(Constants.ES_DATA_FOR_SUBJECT);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime, null);
searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true);
DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_day")
.field("publishDate");
if (type == 1) {
aggregation.calendarInterval(DateHistogramInterval.HOUR).format("yyyy-MM-dd HH");
} else if (type == 2) {
aggregation.calendarInterval(DateHistogramInterval.DAY).format("yyyy-MM-dd");
}
searchSourceBuilder.aggregation(aggregation);
searchRequest.source(searchSourceBuilder);
try {
SearchResponse response = client.search(searchRequest, RequestOptions.DEFAULT);
long value = response.getHits().getTotalHits().value;
countVO.setValue(value);
List<CountVO> list = new ArrayList<>();
Aggregations aggregations = response.getAggregations();
ParsedDateHistogram groupHour = aggregations.get("group_day");
List<? extends Histogram.Bucket> buckets = groupHour.getBuckets();
if (CollectionUtils.isNotEmpty(buckets)) {
for (Histogram.Bucket bucket : buckets) {
CountVO vo = new CountVO();
vo.setName(bucket.getKeyAsString());
vo.setValue(bucket.getDocCount());
list.add(vo);
}
}
countVO.setChildren(list);
} catch (Exception e) {
e.printStackTrace();
}
return countVO;
}
}
......@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.entity.Event;
import com.zzsn.event.entity.EventTag;
import com.zzsn.event.entity.LabelEntity;
import com.zzsn.event.enums.CodePrefixEnum;
import com.zzsn.event.mapper.EventMapper;
import com.zzsn.event.producer.ProduceInfo;
......@@ -59,6 +61,8 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
@Autowired
private ProduceInfo produceInfo;
@Autowired
private IEventTagService eventTagService;
@Autowired
private RedisUtil redisUtil;
@Value("${files.storage}")
String filesStorage;
......@@ -181,6 +185,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
cron = CronUtil.getRandomCron();
event.setCron(cron);
baseMapper.insert(event);
eventTagService.save(EventTag.builder().eventId(event.getId()).build());
return event;
}
......@@ -246,6 +251,11 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
return null;
}
@Override
public List<LabelEntity> listByType(String labelTypeId) {
return baseMapper.listByType(labelTypeId);
}
//生成文件夹路径
private String getFilePath() {
LocalDate currentDate = LocalDate.now();
......
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.EventTag;
import com.zzsn.event.mapper.EventTagMapper;
import com.zzsn.event.service.IEventTagService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Description: 事件
* @Author: jeecg-boot
* @Date: 2024-03-14
* @Version: V1.0
*/
@Service
@Slf4j
public class EventTagServiceImpl extends ServiceImpl<EventTagMapper, EventTag> implements IEventTagService {
}
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.mapper.InfoSourceMapper;
import com.zzsn.event.service.IInfoSourceService;
import com.zzsn.event.xxljob.entity.InfoSource;
import org.springframework.stereotype.Service;
/**
* @Description: 信息源表
* @Author: jeecg-boot
* @Date: 2022-01-18
* @Version: V1.0
*/
@Service
public class InfoSourceServiceImpl extends ServiceImpl<InfoSourceMapper, InfoSource> implements IInfoSourceService {
@Override
public String getNatureName(String id) {
return baseMapper.getNatureName(id);
}
}
......@@ -60,8 +60,8 @@ public class AnalysisTask {
* 每天凌晨0点执行一次
* 按天发送kafka 获取进行中(未结束)的事件专题列表
*/
@Scheduled(cron = "0 0 0 * * ?")
// @Scheduled(cron = "0 * * * * ?")
// @Scheduled(cron = "0 0 0 * * ?")
@Scheduled(cron = "0 * * * * ?")
public void subjectList() {
List<SubjectKafkaVo> data = new ArrayList<>();
Date today = new Date();
......
......@@ -25,6 +25,11 @@ public class DateUtil {
return format.format(date);
}
public static String dateToString(Date date) {
format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return format.format(date);
}
/**
* String转Date
*
......
package com.zzsn.event.util;
import org.apache.commons.lang3.StringUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* @Version 1.0
* @Author: ZhangJingKun
* @Date: 2023/11/28 16:20
* @Content: 获取索引名称的工具类
*/
public class EsIndexUtil {
/**
* 根据索引名称获取带有当前年的索引名称 subjectdatabase --> subjectdatabase_2023
* @param index
* @return
*/
public static String getIndexYear(String index){
return index + "_" + LocalDateTime.now().getYear();
}
/**
* 获取最近两年的索引名称 subjectdatabase --> subjectdatabase_2023
* 并返回数组
* @param index
* @return
*/
public static String[] getIndexLatelyTwoYear(String index){
String[] indexs;
Integer year = LocalDateTime.now().getYear();
if(year <= 2023){//索引年份是从2023年开始的
indexs = new String[]{index + "_2023"};
} else {
String index_1 = index + "_" + year;
String index_2 = index + "_" + (year-1);
indexs = new String[]{index_1, index_2};
}
return indexs;
}
/**
* 获取两个时间之间的所有年份
* 并返回数组
* @param startYear 搜索范围开始年份
* @param endYear 搜索范围结束年份
* @return
*/
public static String[] getIndexIntervalYear(String index, Integer startYear, Integer endYear){
if(startYear < 2023){
startYear = 2023; //索引年份是从2023年开始的
}
int nowYear = LocalDateTime.now().getYear();
if(endYear > nowYear) {
endYear = nowYear;
}
String[] indexs;
if(endYear <= 2023){//索引年份是从2023年开始的
indexs = new String[]{index + "_2023"};
} else {
List<String> result = new ArrayList<>();
while (startYear <= endYear) {
result.add(index + "_" + startYear);
startYear++;
}
indexs = result.toArray(new String[0]);
}
if(indexs.length == 0) {
indexs = new String[]{index};
}
return indexs;
}
/**
* 获取两个时间之间的所有年份
* 并返回数组
* @param startDate 搜索范围开始年份
* @param endDate 搜索范围结束年份
* @return
*/
public static String[] getIndexIntervalYear(String index, String startDate, String endDate){
Integer startYear;
Integer endYear;
if (StringUtils.isNotBlank(startDate)) {
try {
String s = startDate.substring(0, 4);
startYear = Integer.parseInt(s);
} catch (Exception e1) {
startYear = LocalDateTime.now().getYear()-1;
}
} else {
startYear = LocalDateTime.now().getYear()-1;
}
if (StringUtils.isNotBlank(endDate)) {
try {
String s = endDate.substring(0, 4);
endYear = Integer.parseInt(s);
} catch (Exception e1) {
endYear = LocalDateTime.now().getYear();
}
} else {
endYear = LocalDateTime.now().getYear();
}
String[] indexs = getIndexIntervalYear(index,startYear,endYear);
return indexs;
}
}
......@@ -13,6 +13,10 @@ import java.util.List;
@Data
public class CountVO {
//key值
private String key;
//数量/价格
private String count;
/**排序*/
private Integer order;
/**名称*/
......
package com.zzsn.event.vo;
import lombok.Data;
import java.util.List;
@Data
public class DisplayInfo {
//说明:...Raw 表示原文,即原语言
//作者
private String author;
private String authorRaw;
//正文
private String content;
private String contentRaw;
//带标签正文
private String contentWithTag;
private String contentWithTagRaw;
//入库时间
private String createDate;
//信息id
private String id;
//信息来源id(信息源或者关键词)
private String sid;
//语言
private String lang;
private String langRaw;
//来源(信息来源)
private String origin;
private String originRaw;
//发布时间
private String publishDate;
//原始时间(网页上,没有解析之前的时间)
private String originalTime;
//发布地址
private String sourceAddress;
//摘要
private String summary;
private String summaryRaw;
//关键词
private String keyWords;
//标题
private String title;
private String titleRaw;
//采集来源(如通用、定制、微信公众号等)
private String source;
//附加字段
private String type;
//标签信息
private List<Label> labels;
//视频下载链接
private String downLoadUrl;
//视频链接(原链接 网页版)
private String videoUrl;
//视频链接(原链接 手机版)
private String videoPhoneUrl;
//视频时长
private Long videoTime;
//视频第一帧图片
private String videoImg;
//自定义标签
private List<String> customLabel;
private Double score;
//专题库类型(0: 其它 1:政策;2:领导讲话;3:专家观点;4:企业案例)
private Integer classificationType;
//置顶排位(默认为0)
private Integer topNum;
//删除标记(1:删除;0:保留)
private Integer deleteFlag;
private String subjectId;
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private Integer checkStatus;
//阅读数
private Long readNum = 0L;
//是否收藏
private boolean ynCollect = false;
//重复id
private String repeatId;
//(1:主条目 0:非主条目)
private String flag;
//关联的主条目id
private String masterEntryId;
//原始id(去重服务生成的id,因为一条信息可以属于多个专题,原始id会发生改变,所以存储一个原始id,找寻对应关系)
private String originalId;
//快照地址
private String screenShotImg;
//资讯更新时间
private String updateDate;
//信息类别(1:报刊 2:博客 3:客户端 4:论坛 5:视频 6:外媒 7:网站 8:微博 9:微信 10:新闻 11:政务 12:其它)
private String infoSourceType;
//数据类型 qbyw:情报要闻 qbnc:情报内参
private String dataType;
//abi报表地址
private String abiUrl;
//abi报表id
private String abiId;
//栏目code列表
private List<String> programaIds;
//数据库code列表
private List<String> databaseIds;
//是否风险
private Integer isRisk;
//风险类型
private List<String> riskTypes;
//资讯关联的附件id
private List<String> attachmentIds;
//是否为资讯(true:资讯 false:附件类)
private Boolean ynArticle = true;
//法规号
private String contentNo;
//来源 (政策发文机关)
private String organ;
//政策文件分类
private String topicClassification;
//发文字号
private String issuedNumber;
//成文时间
private String writtenDate;
//数据所在的索引名称
private String index;
/**
* 是否是主条目,0为非主条目,1为主条目
*/
private Integer ismain;
}
package com.zzsn.event.vo;
import lombok.Data;
/**
* 基础信息打上标签的实体对象
*/
@Data
public class Label {
//命中标识
private String hitRemarks;
//标签标识
private String labelMark;
//标签备注
private String labelRemarks;
//项目标签id
private String projectLabelId;
//关联标签id
private String relationId;
//关联标签名称
private String relationName;
//审核状态
private Integer status;
}
......@@ -23,4 +23,10 @@ public class MediaVO {
private Long mediaNum;
//热门媒体
private List<String> hotList;
//媒体性质
private String key;
//数据量
private Long count;
//序号
private Integer order;
}
package com.zzsn.event.vo;
import lombok.Data;
/**
* 报告资讯列表数据封装
*
* @author lkg
* @date 2023/3/29
*/
@Data
public class ReportDataVo {
private String title;
private String summary;
private String origin;
private String publishDate;
private String sourceAddress;
}
package com.zzsn.event.vo;
import lombok.Data;
import java.util.List;
@Data
public class SubjectInfoVo {
private String id;
//专题id
private String subjectId;
//文章链接
private String url;
//搜索时,全部情况下,,搜索传值
private String search;
//专题标题
private String title;
//专题摘要
private String summary;
//内容
private String content;
//作者
private String author;
//发布时间
private String publishDate;
//来源
private String origin;
//得分
private String score;
//企业名称
private String enterpriseName;
//倾向性
private String orientation;
//风险类型
private String riskType;
//企业性质
private String enterpriseNature;
//区域
private String area;
//行业
private String trade;
//信息类型
private String InfoType;
//专题库类型
private String libraryType;
//ids
private List<String> ids;
//置顶标识(0取消置顶 1置顶)
private Integer type;
private String sourceAddress;
//开始时间
private String startTime;
//结束时间
private String endTime;
//倾向性(前端交互参数约定 0:中性 1:负面 2:正面)
private Integer tendency;
//专题库类型(1:政策;2:领导讲话;3:专家观点;4:企业案例)
private Integer classificationType;
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private List<Integer> checkStatusList;
private Integer checkStatus;
//删除标记(1:删除;0:保留)
private Integer deleteFlag = 0;
//国家
private String countryIds;
//城市
private String cityIds;
//企业
private String enterpriseIds;
//人物
private String characterIds;
//字段
private String fields;
//操作类型 add .update
private String action;
//日期最大值
private String maxValue;
//关键词检索范围 1标题 2正文 3 全部
private Integer searchScope;
//精确度("精确"| --)
private String searchAccuracy;
//数据所在的索引名称
private String index;
private String operateStartTime;
private String operateEndTime;
private String labelName;
}
package com.zzsn.event.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class SysLabelVo {
/**
* 主键
*/
private String id;
/**
* 名称
*/
private String name;
/**
* 近义词
*/
private String synonym;
/**
* 说明
*/
private String explanation;
/**
* 层级
*/
private Integer level;
/**
* 一级主键id
*/
private String topId;
/**
* 所有id
*/
private String pathIds;
/**
* 状态
*/
private Integer status;
/**
* 排序
*/
private Integer sort;
/**
* 创建人
*/
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**
* 所属部门
*/
private String sysOrgCode;
/**
* 父级节点
*/
private String pid;
/**
* 是否有子节点
*/
private String hasChild;
/**
* 属于哪个标签(表sys_base_label_type的主键id)
*/
private String labelTypeId;
/**
* 标签类别(如企业、自定义等)
*/
private String labelType;
/**
* 标签标识
*/
private String labelMark;
/**
* 下级节点
*/
private List<SysLabelVo> children;
private Boolean isLeaf;
/**
* 具体标签的id集合
*/
private List<String> labelIdList;
private String queryParam;
private String dataType = "";
/**
* 专题字段
*/
private Integer category;
/**
* 词条名称
*/
private String itemText;
/**
* 词条代码
*/
private String itemValue;
/**
* 描述
*/
private String description;
/**
* 排序值
*/
private String sortOrder;
/**
* 字典id
*/
private String dictId;
/**唯一编码(前端回显)*/
private String code;
private Integer pageNo=1;
private Integer pageSize=10;
}
......@@ -55,9 +55,12 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
elasticsearch:
rest:
uris: ["114.116.90.53:9200"]
uris: ["114.115.215.250:9700","114.116.19.92:9700","114.116.54.108:9200"]
#uris: ["192.168.0.149:9700","192.168.0.35:9700","192.168.200.108:9200"]
username: elastic
password: elastic
password: zzsn9988
connection-timeout: 300000
socket-timeout: 300000
cloud:
stream:
kafka:
......@@ -112,9 +115,15 @@ mybatis-plus:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
map-underscore-to-camel-case: true
serviceProject:
url: https://clb.ciglobal.cn/clb-api/
# url: https://clb.ciglobal.cn/clb-api/datapull/
url: http://127.0.0.1:9988/datapull/
#热词抽取地址
hotWords:
extractUrl: http://114.116.99.6:8055/task/dispose/extractKeyword
files:
storage: D:/event/
\ No newline at end of file
storage: D:/event/
scoreRule:
weekScore: 1
monthScore: 2
yearScore: 3
beforeYearScore: 3
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论