提交 cf973d72 作者: 925993793@qq.com

传播路径增加时间;事件脉络支持编辑

上级 95cee6cc
package com.zzsn.event.controller; package com.zzsn.event.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.constant.Result; import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.SubjectAnalysis; import com.zzsn.event.entity.SubjectAnalysis;
import com.zzsn.event.service.SubjectAnalysisService; import com.zzsn.event.service.SubjectAnalysisService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import java.util.List;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 事件相关分析维护 * 事件相关分析维护
...@@ -23,6 +24,22 @@ public class EventMaintenanceController { ...@@ -23,6 +24,22 @@ public class EventMaintenanceController {
private SubjectAnalysisService subjectAnalysisService; private SubjectAnalysisService subjectAnalysisService;
/** /**
* 专题事件脉络列表
*
* @param subjectId 专题id
* @author lkg
* @date 2024/5/27
*/
@GetMapping("/eventContextList")
public Result<?> eventContextList(@RequestParam String subjectId){
LambdaQueryWrapper<SubjectAnalysis> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(SubjectAnalysis::getSubjectId, subjectId).eq(SubjectAnalysis::getCategory, 2)
.orderByAsc(SubjectAnalysis::getPublishDate);
List<SubjectAnalysis> list = subjectAnalysisService.list(queryWrapper);
return Result.OK(list);
}
/**
* 事件脉络编辑 * 事件脉络编辑
* *
* @param subjectAnalysis 事件脉络信息 * @param subjectAnalysis 事件脉络信息
...@@ -34,4 +51,17 @@ public class EventMaintenanceController { ...@@ -34,4 +51,17 @@ public class EventMaintenanceController {
subjectAnalysisService.eventContextModify(subjectAnalysis); subjectAnalysisService.eventContextModify(subjectAnalysis);
return Result.OK(); return Result.OK();
} }
/**
* 删除事件脉络
*
* @param id 主键id
* @author lkg
* @date 2024/5/27
*/
@GetMapping("/eventContextRemove")
public Result<?> eventContextRemove(String id){
subjectAnalysisService.removeById(id);
return Result.OK();
}
} }
...@@ -17,7 +17,6 @@ import io.swagger.annotations.Api; ...@@ -17,7 +17,6 @@ import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -330,7 +329,7 @@ public class PlatEventManageController { ...@@ -330,7 +329,7 @@ public class PlatEventManageController {
} }
/** /**
* 件对应专题库的资讯分页列表 * 件对应专题库的资讯分页列表
* *
* @param subjectInfoVo 筛选条件 * @param subjectInfoVo 筛选条件
* @param userId 用户id * @param userId 用户id
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<select id="newPlatPageList" resultType="com.zzsn.event.vo.EventNewPlatVO"> <select id="newPlatPageList" resultType="com.zzsn.event.vo.EventNewPlatVO">
SELECT distinct d.id,d.event_name,d.start_time,d.end_time, m.type_name as subjectTypeName, n.project_name SELECT distinct d.id,d.event_name,d.start_time,d.end_time,d.status, m.type_name as subjectTypeName, n.project_name
from from
<choose> <choose>
<when test="subjectCondition.userId !=null and subjectCondition.userId != ''"> <when test="subjectCondition.userId !=null and subjectCondition.userId != ''">
......
...@@ -102,15 +102,18 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -102,15 +102,18 @@ public class AnalysisServiceImpl implements AnalysisService {
List<String> allOriginList = new ArrayList<>(); List<String> allOriginList = new ArrayList<>();
top = new PropagationPathVo(); top = new PropagationPathVo();
top.setName(subjectName); top.setName(subjectName);
top.setTime(DateUtil.dateToString(event.getStartTime()));
//获取发布时间最早的前10的资讯(来源不重复) //获取发布时间最早的前10的资讯(来源不重复)
List<PropagationPathVo> secondList = new ArrayList<>(); List<PropagationPathVo> secondList = new ArrayList<>();
List<SubjectDataVo> earlyList = topN(specialDataList,Constants.FAKE_NUM); List<SubjectDataVo> earlyList = topN(specialDataList,Constants.FAKE_NUM);
earlyList.forEach(e->allOriginList.add(e.getOrigin())); earlyList.forEach(e->allOriginList.add(e.getOrigin()));
for (SubjectDataVo subjectDataVo : earlyList) { for (SubjectDataVo subjectDataVo : earlyList) {
String origin = subjectDataVo.getOrigin(); String origin = subjectDataVo.getOrigin();
String time = subjectDataVo.getPublishDate();
if (StringUtils.isNotEmpty(origin)) { if (StringUtils.isNotEmpty(origin)) {
PropagationPathVo second = new PropagationPathVo(); PropagationPathVo second = new PropagationPathVo();
second.setName(origin); second.setName(origin);
second.setTime(time);
secondList.add(second); secondList.add(second);
List<String> thirdList = esService.groupByOrigin(subjectDataVo.getTitle(), subjectDataVo.getPublishDate()); List<String> thirdList = esService.groupByOrigin(subjectDataVo.getTitle(), subjectDataVo.getPublishDate());
thirdList.removeAll(allOriginList); thirdList.removeAll(allOriginList);
......
...@@ -14,6 +14,7 @@ public class EventNewPlatVO { ...@@ -14,6 +14,7 @@ public class EventNewPlatVO {
private String eventName; private String eventName;
private String startTime; private String startTime;
private String endTime; private String endTime;
private Integer status;
private Integer subjectInfoNum; private Integer subjectInfoNum;
private Integer unCheckNum; private Integer unCheckNum;
private Integer infoSourceNum; private Integer infoSourceNum;
......
...@@ -14,5 +14,6 @@ import java.util.List; ...@@ -14,5 +14,6 @@ import java.util.List;
public class PropagationPathVo implements Serializable { public class PropagationPathVo implements Serializable {
private String name; private String name;
private String time;
private List<PropagationPathVo> children; private List<PropagationPathVo> children;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论