提交 4bee6077 作者: 925993793@qq.com

增加事件挖掘逻辑;研究中心门户逻辑修改

上级 93eff245
...@@ -30,7 +30,7 @@ public class Constants { ...@@ -30,7 +30,7 @@ public class Constants {
//kafka 发送 伪事件脉络所需信息 主题 //kafka 发送 伪事件脉络所需信息 主题
public static final String FAKE_EVENT_CONTEXT_SEND_TOPIC = "fake_event_context_send_data"; public static final String FAKE_EVENT_CONTEXT_SEND_TOPIC = "fake_event_context_send_data";
//kafka 发送 事件挖掘信息 主题 //kafka 发送 事件挖掘信息 主题
public static final String EVENT_DIG_SEND_TOPIC = "event_dig_send_data_test"; public static final String EVENT_DIG_SEND_TOPIC = "event_dig_send_data";
//kafka 接收 观点分析结果 主题 //kafka 接收 观点分析结果 主题
......
...@@ -109,7 +109,7 @@ public class EventDataController { ...@@ -109,7 +109,7 @@ public class EventDataController {
if (category == 1){ if (category == 1){
pageList = eventService.frontAllPageList(projectId, eventName, eventType, labelField, labelName, order, orderType, pageNo, pageSize); pageList = eventService.frontAllPageList(projectId, eventName, eventType, labelField, labelName, order, orderType, pageNo, pageSize);
} else if (category == 2) { } else if (category == 2) {
pageList = eventExtractService.frontPageList(projectId,eventName,eventType,pageNo,pageSize); pageList = eventExtractService.frontDigPageList(projectId,eventName,eventType,pageNo,pageSize);
} else if (category == 3) { } else if (category == 3) {
pageList = eventService.frontOwnerPageList(projectId, eventName, eventType, labelField, labelName, order, orderType, pageNo, pageSize); pageList = eventService.frontOwnerPageList(projectId, eventName, eventType, labelField, labelName, order, orderType, pageNo, pageSize);
} }
...@@ -210,6 +210,7 @@ public class EventDataController { ...@@ -210,6 +210,7 @@ public class EventDataController {
/** /**
* 事件资讯分页列表 * 事件资讯分页列表
* *
* @param projectId 项目id
* @param subjectId 事件id * @param subjectId 事件id
* @param searchWord 搜索词 * @param searchWord 搜索词
* @param position 搜索位置(title-标题;content-内容) * @param position 搜索位置(title-标题;content-内容)
...@@ -223,7 +224,8 @@ public class EventDataController { ...@@ -223,7 +224,8 @@ public class EventDataController {
*/ */
@ApiOperation(value = "专题信息列表-分页列表查询", notes = "专题信息列表-分页列表查询") @ApiOperation(value = "专题信息列表-分页列表查询", notes = "专题信息列表-分页列表查询")
@GetMapping(value = "/listArticle") @GetMapping(value = "/listArticle")
public Result<?> queryPageList(@RequestParam(name = "subjectId", required = false) String subjectId, public Result<?> queryPageList(@RequestParam(name = "projectId", defaultValue = "1476527644425682945") String projectId,
@RequestParam(name = "subjectId", required = false) String subjectId,
@RequestParam(name = "searchWord", required = false) String searchWord, @RequestParam(name = "searchWord", required = false) String searchWord,
@RequestParam(name = "position", required = false) String position, @RequestParam(name = "position", required = false) String position,
@RequestParam(name = "category", required = false) Integer category, @RequestParam(name = "category", required = false) Integer category,
...@@ -231,11 +233,13 @@ public class EventDataController { ...@@ -231,11 +233,13 @@ public class EventDataController {
@RequestParam(name = "order", defaultValue = "desc") String order, @RequestParam(name = "order", defaultValue = "desc") String order,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
UserVo currentUser = UserUtil.getLoginUser();
String username = currentUser.getUsername();
List<String> subjectIdList = new ArrayList<>(); List<String> subjectIdList = new ArrayList<>();
if (StringUtils.isNotEmpty(subjectId)) { if (StringUtils.isNotEmpty(subjectId)) {
subjectIdList.add(subjectId); subjectIdList.add(subjectId);
} else { } else {
List<EventExcelVO> frontList = eventService.frontList(null, null); List<EventExcelVO> frontList = eventService.frontAllList(projectId,username, null,null);
frontList.forEach(e -> subjectIdList.add(e.getId())); frontList.forEach(e -> subjectIdList.add(e.getId()));
} }
//获取数据 //获取数据
......
...@@ -8,6 +8,8 @@ import com.zzsn.event.service.IEventService; ...@@ -8,6 +8,8 @@ import com.zzsn.event.service.IEventService;
import com.zzsn.event.util.DateUtil; import com.zzsn.event.util.DateUtil;
import com.zzsn.event.util.ExcelExportUtil; import com.zzsn.event.util.ExcelExportUtil;
import com.zzsn.event.util.Utility; import com.zzsn.event.util.Utility;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.EventExcelVO; import com.zzsn.event.vo.EventExcelVO;
import com.zzsn.event.vo.ExportParam; import com.zzsn.event.vo.ExportParam;
import com.zzsn.event.vo.SubjectDataVo; import com.zzsn.event.vo.SubjectDataVo;
...@@ -51,8 +53,10 @@ public class EventExportController { ...@@ -51,8 +53,10 @@ public class EventExportController {
*/ */
@PostMapping("/eventList") @PostMapping("/eventList")
public void exportEventList(@RequestBody ExportParam exportParam, HttpServletResponse response) { public void exportEventList(@RequestBody ExportParam exportParam, HttpServletResponse response) {
UserVo currentUser = UserUtil.getLoginUser();
String username = currentUser.getUsername();
String[] headers = new String[]{"id", "事件名称", "事件描述", "发布时间", "热度"}; String[] headers = new String[]{"id", "事件名称", "事件描述", "发布时间", "热度"};
List<EventExcelVO> eventList = eventService.frontList(exportParam.getEventIdList(), exportParam.getSize()); List<EventExcelVO> eventList = getEventList(exportParam.getClassify(),exportParam.getProjectId(),username,exportParam.getEventIdList(),exportParam.getSize());
if (CollectionUtils.isNotEmpty(eventList)) { if (CollectionUtils.isNotEmpty(eventList)) {
String name = "event.xlsx"; String name = "event.xlsx";
List<List<String>> dataList = new ArrayList<>(); List<List<String>> dataList = new ArrayList<>();
...@@ -79,12 +83,14 @@ public class EventExportController { ...@@ -79,12 +83,14 @@ public class EventExportController {
*/ */
@PostMapping("/dataList") @PostMapping("/dataList")
public void exportDataList(@RequestBody ExportParam exportParam, HttpServletResponse response) { public void exportDataList(@RequestBody ExportParam exportParam, HttpServletResponse response) {
UserVo currentUser = UserUtil.getLoginUser();
String username = currentUser.getUsername();
OutputStream outputstream = null; OutputStream outputstream = null;
ByteArrayOutputStream bos = null; ByteArrayOutputStream bos = null;
try { try {
List<String> eventIdList = exportParam.getEventIdList(); List<String> eventIdList = exportParam.getEventIdList();
if (CollectionUtils.isEmpty(eventIdList)) { if (CollectionUtils.isEmpty(eventIdList)) {
List<EventExcelVO> frontList = eventService.frontList(null, null); List<EventExcelVO> frontList = getEventList(exportParam.getClassify(),exportParam.getProjectId(),username,exportParam.getEventIdList(),null);
frontList.forEach(e -> eventIdList.add(e.getId())); frontList.forEach(e -> eventIdList.add(e.getId()));
} }
List<SubjectDataVo> exportDataList = esService.exportDataList(eventIdList, exportParam.getSearchWord(), exportParam.getPosition(), exportParam.getCategory(), List<SubjectDataVo> exportDataList = esService.exportDataList(eventIdList, exportParam.getSearchWord(), exportParam.getPosition(), exportParam.getCategory(),
...@@ -126,6 +132,17 @@ public class EventExportController { ...@@ -126,6 +132,17 @@ public class EventExportController {
} }
} }
private List<EventExcelVO> getEventList(Integer category,String projectId,String createBy,List<String> eventIdList,Integer size){
List<EventExcelVO> eventList = new ArrayList<>();
if (category == 1) {
eventList = eventService.frontAllList(projectId,createBy,eventIdList,size);
} else if (category == 3) {
eventList = eventService.frontOwnerList(projectId, createBy, eventIdList, size);
}
return eventList;
}
/** /**
* 格式化ftl文件所需要的数据格式 * 格式化ftl文件所需要的数据格式
* *
......
package com.zzsn.event.controller; package com.zzsn.event.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.Event;
import com.zzsn.event.service.EsStatisticsService; import com.zzsn.event.service.EsStatisticsService;
import com.zzsn.event.service.IEventService; import com.zzsn.event.service.IEventService;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.EventExcelVO;
import com.zzsn.event.vo.EventRegionVO; import com.zzsn.event.vo.EventRegionVO;
import com.zzsn.event.vo.EventTopVO; import com.zzsn.event.vo.EventTopVO;
import com.zzsn.event.constant.Result;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -41,17 +42,18 @@ public class EventHomeController { ...@@ -41,17 +42,18 @@ public class EventHomeController {
/** /**
* 事件数据统计-首页 * 事件数据统计-首页
* *
* @param projectId 项目id
* @author lkg * @author lkg
* @date 2024/1/12 * @date 2024/9/18
*/ */
@GetMapping(value = "/eventData") @GetMapping(value = "/eventData")
public Result<?> eventData() { public Result<?> eventData(@RequestParam(defaultValue = "1476527644425682945") String projectId) {
UserVo loginUser = UserUtil.getLoginUser();
String username = loginUser.getUsername();
Map<String, Integer> map = new HashMap<>(); Map<String, Integer> map = new HashMap<>();
List<Event> list = eventService.list(new LambdaQueryWrapper<Event>() List<EventExcelVO> eventList = eventService.frontAllList(projectId, username, null, null);
.eq(Event::getFacePublic,1) map.put("eventCount", eventList.size());
.eq(Event::getPublishStatus,1)); List<String> eventIdList = eventList.stream().map(EventExcelVO::getId).collect(Collectors.toList());
map.put("eventCount", list.size());
List<String> eventIdList = list.stream().map(Event::getId).collect(Collectors.toList());
long total = esStatisticsService.totalCount(eventIdList, null, null); long total = esStatisticsService.totalCount(eventIdList, null, null);
map.put("total", (int) total); map.put("total", (int) total);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
...@@ -66,34 +68,44 @@ public class EventHomeController { ...@@ -66,34 +68,44 @@ public class EventHomeController {
/** /**
* 热点事件-前10 * 热点事件-前10
* *
* @param projectId 项目id
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param type 分类(1-按发布时间;2.按热度) * @param type 分类(1-按发布时间;2.按热度)
* @param size 返回个数 * @param size 返回个数
* @author lkg * @author lkg
* @date 2024/4/8 * @date 2024/9/18
*/ */
@GetMapping("/hotEventFlow") @GetMapping("/hotEventFlow")
public Result<?> hotEventFlow(@RequestParam(required = false) String startTime, public Result<?> hotEventFlow(@RequestParam(defaultValue = "1476527644425682945") String projectId,
@RequestParam(required = false) String startTime,
@RequestParam(required = false) String endTime, @RequestParam(required = false) String endTime,
@RequestParam Integer type, @RequestParam Integer type,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer size) {
List<EventTopVO> list = eventService.topEventList(startTime, endTime, type, size); UserVo loginUser = UserUtil.getLoginUser();
String username = loginUser.getUsername();
List<EventTopVO> list = eventService.topEventList(projectId, username, startTime, endTime, type, size);
return Result.OK(list); return Result.OK(list);
} }
/** /**
* 事件按地域分析 * 事件按地域分析
* *
* @param projectId 项目id
* @param type 地域类型(1-国际;2-国内) * @param type 地域类型(1-国际;2-国内)
* @param regionName 地域名称 * @param regionName 地域名称
* @author lkg * @author lkg
* @date 2024/4/10 * @date 2024/9/18
*/ */
@GetMapping("/region") @GetMapping("/region")
public Result<?> region(@RequestParam Integer type, @RequestParam(required = false) String regionName) { public Result<?> region(@RequestParam(defaultValue = "1476527644425682945") String projectId,
@RequestParam Integer type,
@RequestParam(required = false) String regionName) {
UserVo loginUser = UserUtil.getLoginUser();
String username = loginUser.getUsername();
List<Map<String, Object>> dataList = new ArrayList<>(); List<Map<String, Object>> dataList = new ArrayList<>();
List<EventRegionVO> eventRegionVOList = eventService.listByRegion(type, regionName); List<EventRegionVO> eventRegionVOList = eventService.listByRegion(projectId,username,type, regionName);
Map<String, List<EventRegionVO>> map = eventRegionVOList.stream().collect(Collectors.groupingBy(EventRegionVO::getRegionName)); Map<String, List<EventRegionVO>> map = eventRegionVOList.stream().collect(Collectors.groupingBy(EventRegionVO::getRegionName));
for (Map.Entry<String, List<EventRegionVO>> entry : map.entrySet()) { for (Map.Entry<String, List<EventRegionVO>> entry : map.entrySet()) {
Map<String, Object> regionMap = new HashMap<>(); Map<String, Object> regionMap = new HashMap<>();
......
...@@ -166,6 +166,7 @@ public class EventManageController { ...@@ -166,6 +166,7 @@ public class EventManageController {
iXxlJobInfoService.keyWordsInsert(redisKeywordDTO); iXxlJobInfoService.keyWordsInsert(redisKeywordDTO);
//为了立即响应,关键词新增时放入消息队列 //为了立即响应,关键词新增时放入消息队列
kafkaTemplate.send(Constants.KEY_WORDS_COLLECT_TOPIC, JSON.toJSONString(redisKeywordDTO)); kafkaTemplate.send(Constants.KEY_WORDS_COLLECT_TOPIC, JSON.toJSONString(redisKeywordDTO));
}); });
return Result.OK(); return Result.OK();
} else { } else {
......
...@@ -116,6 +116,9 @@ public class EsService { ...@@ -116,6 +116,9 @@ public class EsService {
} }
boolQuery.filter(rangeQueryBuilder); boolQuery.filter(rangeQueryBuilder);
} }
boolQuery.must(QueryBuilders.termQuery("origin.keyword",""));
//未删除状态查询
boolQuery.mustNot(QueryBuilders.matchQuery("deleteFlag", "1"));
List<SubjectDataVo> subjectDataVos = formatData(getEsResult(searchSourceBuilder, boolQuery, subjectId)); List<SubjectDataVo> subjectDataVos = formatData(getEsResult(searchSourceBuilder, boolQuery, subjectId));
if (subjectDataVos.size() < size) { if (subjectDataVos.size() < size) {
flag.set(false); flag.set(false);
......
...@@ -68,7 +68,7 @@ public interface EventExtractMapper extends BaseMapper<EventExtract> { ...@@ -68,7 +68,7 @@ public interface EventExtractMapper extends BaseMapper<EventExtract> {
* @author lkg * @author lkg
* @date 2024/9/9 * @date 2024/9/9
*/ */
List<EventFrontVO> frontPageList(@Param("projectId") String projectId, @Param("eventName") String eventName, List<EventFrontVO> frontDigPageList(@Param("projectId") String projectId, @Param("eventName") String eventName,
@Param("eventTypes") List<String> eventTypes, @Param("eventTypes") List<String> eventTypes,
@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
...@@ -81,7 +81,7 @@ public interface EventExtractMapper extends BaseMapper<EventExtract> { ...@@ -81,7 +81,7 @@ public interface EventExtractMapper extends BaseMapper<EventExtract> {
* @author lkg * @author lkg
* @date 2024/9/9 * @date 2024/9/9
*/ */
Long frontTotalCount(@Param("projectId") String projectId, @Param("eventName") String eventName, Long frontDigTotalCount(@Param("projectId") String projectId, @Param("eventName") String eventName,
@Param("eventTypes") List<String> eventTypes); @Param("eventTypes") List<String> eventTypes);
} }
......
...@@ -45,7 +45,7 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -45,7 +45,7 @@ public interface EventMapper extends BaseMapper<Event> {
* @date 2024/4/8 * @date 2024/4/8
*/ */
List<EventManageVO> pageList(@Param("eventName") String eventName, @Param("eventType") Integer eventType, List<EventManageVO> pageList(@Param("eventName") String eventName, @Param("eventType") Integer eventType,
@Param("facePublic") Integer facePublic,@Param("publishStatus") Integer publishStatus, @Param("facePublic") Integer facePublic, @Param("publishStatus") Integer publishStatus,
@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("order") String order, @Param("orderType") String orderType, @Param("order") String order, @Param("orderType") String orderType,
@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
...@@ -61,7 +61,7 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -61,7 +61,7 @@ public interface EventMapper extends BaseMapper<Event> {
* @date 2024/4/8 * @date 2024/4/8
*/ */
Integer totalCount(@Param("eventName") String eventName, @Param("eventType") Integer eventType, Integer totalCount(@Param("eventName") String eventName, @Param("eventType") Integer eventType,
@Param("facePublic") Integer facePublic,@Param("publishStatus") Integer publishStatus, @Param("facePublic") Integer facePublic, @Param("publishStatus") Integer publishStatus,
@Param("startTime") String startTime, @Param("endTime") String endTime); @Param("startTime") String startTime, @Param("endTime") String endTime);
/** /**
...@@ -189,6 +189,8 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -189,6 +189,8 @@ public interface EventMapper extends BaseMapper<Event> {
/** /**
* 热点事件列表-前10 * 热点事件列表-前10
* *
* @param projectId 项目id
* @param createBy 创建人
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param type 分类(1-按发布时间;2.按热度) * @param type 分类(1-按发布时间;2.按热度)
...@@ -197,7 +199,8 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -197,7 +199,8 @@ public interface EventMapper extends BaseMapper<Event> {
* @author lkg * @author lkg
* @date 2024/4/8 * @date 2024/4/8
*/ */
List<EventTopVO> topEventList(@Param("startTime") String startTime, @Param("endTime") String endTime, List<EventTopVO> topEventList(@Param("projectId") String projectId, @Param("createBy") String createBy,
@Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("type") Integer type, @Param("type") Integer type,
@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
...@@ -210,17 +213,31 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -210,17 +213,31 @@ public interface EventMapper extends BaseMapper<Event> {
* @author lkg * @author lkg
* @date 2024/4/10 * @date 2024/4/10
*/ */
List<EventRegionVO> listByRegion(@Param("type") Integer type, @Param("name") String name); List<EventRegionVO> listByRegion(@Param("projectId") String projectId, @Param("createBy") String createBy,@Param("type") Integer type, @Param("name") String name);
/** /**
* 公开且发布的事件信息集合 * 公开且发布的事件信息集合
* *
* @param projectId 项目id
* @param createBy 创建人
* @param eventIdList 事件id集合 * @param eventIdList 事件id集合
* @param size 数量 * @param size 数量
* @author lkg * @author lkg
* @date 2024/4/10 * @date 2024/4/10
*/ */
List<EventExcelVO> frontList(@Param("eventIdList") List<String> eventIdList, @Param("size") Integer size); List<EventExcelVO> frontAllList(@Param("projectId") String projectId, @Param("createBy") String createBy, @Param("eventIdList") List<String> eventIdList, @Param("size") Integer size);
/**
* 默认创建的,公开且发布的事件信息集合
*
* @param projectId 项目id
* @param createBy 创建人
* @param eventIdList 事件id集合
* @param size 数量
* @author lkg
* @date 2024/4/10
*/
List<EventExcelVO> frontOwnerList(@Param("projectId") String projectId, @Param("createBy") String createBy, @Param("eventIdList") List<String> eventIdList, @Param("size") Integer size);
/** /**
* 模型信息列表 * 模型信息列表
......
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
</if> </if>
</select> </select>
<select id="frontPageList" resultType="com.zzsn.event.vo.EventFrontVO"> <select id="frontDigPageList" resultType="com.zzsn.event.vo.EventFrontVO">
select t2.type_name,t1.id,t1.event_name,t1.extract_time as publishDate select t2.type_name,t1.id,t1.event_name,t1.extract_time as publishDate
from event_extract t1 from event_extract t1
inner join event_category t2 on t1.event_type =t2.id inner join event_category t2 on t1.event_type =t2.id
where t1.check_status = 1 where t1.check_status = 1 and t1.delete_status = 0
<if test="projectId!=null and projectId != ''"> <if test="projectId!=null and projectId != ''">
and t1.project_id = #{projectId} and t1.project_id = #{projectId}
</if> </if>
...@@ -96,9 +96,9 @@ ...@@ -96,9 +96,9 @@
order by t1.extract_time desc order by t1.extract_time desc
limit #{offset}, #{pageSize} limit #{offset}, #{pageSize}
</select> </select>
<select id="frontTotalCount" resultType="Long"> <select id="frontDigTotalCount" resultType="Long">
select count(1) from event_extract t1 select count(1) from event_extract t1
where t1.check_status = 1 where t1.check_status = 1 and t1.delete_status = 0
<if test="projectId!=null and projectId != ''"> <if test="projectId!=null and projectId != ''">
and t1.project_id = #{projectId} and t1.project_id = #{projectId}
</if> </if>
......
...@@ -104,18 +104,18 @@ ...@@ -104,18 +104,18 @@
<select id="frontAllPageList" resultType="com.zzsn.event.vo.EventFrontVO"> <select id="frontAllPageList" resultType="com.zzsn.event.vo.EventFrontVO">
select distinct a.* from (select select distinct a.* from (select
t1.id,t1.event_name,t1.event_icon,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label, t1.id,t1.event_name,t1.event_icon,t1.event_type,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label,
t1.total_hot,t1.create_by,t1.category, t1.total_hot,t1.create_by,t1.category,
t2.type_name, t2.type_name,
t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag, t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag,
t3.extract_keywords_tag,t3.extract_time_tag,t3.extract_location_tag t3.extract_keywords_tag,t3.extract_time_tag,t3.extract_location_tag
from event t1 inner join event_category t2 on t1.event_type =t2.id from event t1 inner join event_category t2 on t1.event_type =t2.id
left join event_tag t3 on t1.id=t3.event_id left join event_tag t3 on t1.id=t3.event_id
where t1.publish_status = 1 and t1.face_public = 1 and t1.category = 1 where t1.publish_status = 1 and t1.face_public = 1 and t1.category = 1
union union
select select
t1.id,t1.event_name,t1.event_icon,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label, t1.id,t1.event_name,t1.event_icon,t1.event_type,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label,
t1.total_hot,t1.create_by,t1.category, t1.total_hot,t1.create_by,t1.category,
t2.type_name, t2.type_name,
t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag, t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag,
t3.extract_keywords_tag,t3.extract_time_tag,t3.extract_location_tag t3.extract_keywords_tag,t3.extract_time_tag,t3.extract_location_tag
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
<select id="frontAllCount" resultType="java.lang.Integer"> <select id="frontAllCount" resultType="java.lang.Integer">
select count(1) from ( select count(1) from (
select distinct a.*,m.project_id from (select select distinct a.*,m.project_id from (select
t1.id,t1.event_name,t1.event_icon,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label, t1.id,t1.event_name,t1.event_icon,t1.event_type,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label,
t1.total_hot,t1.create_by,t1.category, t1.total_hot,t1.create_by,t1.category,
t2.type_name, t2.type_name,
t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag, t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag,
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
where t1.publish_status = 1 and t1.face_public = 1 and t1.category = 1 where t1.publish_status = 1 and t1.face_public = 1 and t1.category = 1
union union
select select
t1.id,t1.event_name,t1.event_icon,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label, t1.id,t1.event_name,t1.event_icon,t1.event_type,t1.start_time,t1.end_time,t1.publish_date,t1.event_describe,t1.event_label,
t1.total_hot,t1.create_by,t1.category, t1.total_hot,t1.create_by,t1.category,
t2.type_name, t2.type_name,
t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag, t3.extract_industry_tag,t3.extract_company_tag,t3.extract_person_tag,t3.extract_sentiment_tag,
...@@ -488,23 +488,29 @@ ...@@ -488,23 +488,29 @@
</select> </select>
<select id="topEventList" resultType="com.zzsn.event.vo.EventTopVO"> <select id="topEventList" resultType="com.zzsn.event.vo.EventTopVO">
select distinct a.* from(
select t.id,t.event_name,t.start_time,t.end_time,t.publish_date,t.total_hot,ec.type_name select t.id,t.event_name,t.start_time,t.end_time,t.publish_date,t.total_hot,ec.type_name
from event t from event t inner join event_category ec on t.event_type = ec.id
inner join event_category ec on t.event_type = ec.id
where t.publish_status = 1 and t.face_public = 1 where t.publish_status = 1 and t.face_public = 1
union
select e.id,e.event_name,e.start_time,e.end_time,e.publish_date,e.total_hot,ec.type_name
from event e inner join event_category ec on e.event_type = ec.id
where e.publish_status = 1 and e.create_by = #{createBy}
) a inner join project_subject_map m on a.id = m.subject_id
where m.project_id = #{projectId}
<if test="startTime!=null and startTime != ''"> <if test="startTime!=null and startTime != ''">
and t.publish_date >= #{startTime} and a.publish_date >= #{startTime}
</if> </if>
<if test="endTime!=null and endTime != ''"> <if test="endTime!=null and endTime != ''">
and t.publish_date <![CDATA[ <= ]]> #{endTime} and a.publish_date <![CDATA[ <= ]]> #{endTime}
</if> </if>
order by order by
<choose> <choose>
<when test="type == 1"> <when test="type == 1">
t.publish_date a.publish_date
</when> </when>
<otherwise> <otherwise>
t.total_hot a.total_hot
</otherwise> </otherwise>
</choose> </choose>
desc desc
...@@ -524,14 +530,21 @@ ...@@ -524,14 +530,21 @@
<select id="listByRegion" resultType="com.zzsn.event.vo.EventRegionVO"> <select id="listByRegion" resultType="com.zzsn.event.vo.EventRegionVO">
SELECT SELECT
e.id AS eventId, b.id AS eventId,
e.event_name, b.event_name,
e.start_time, b.start_time,
e.end_time, b.end_time,
r.name_cn AS regionName r.name_cn AS regionName
FROM FROM
( SELECT id, event_name,start_time,end_time FROM event WHERE publish_status = 1 AND face_public = 1 ) e (
INNER JOIN event_region_map m ON e.id = m.event_id select distinct a.* from(
select t.id,t.event_name,t.start_time,t.end_time from event t where t.publish_status = 1 and t.face_public = 1
union
select e.id,e.event_name,e.start_time,e.end_time from event e where e.publish_status = 1 and e.create_by = #{createBy}
) a inner join project_subject_map m on a.id = m.subject_id
where m.project_id = #{projectId}
) b
INNER JOIN event_region_map m ON b.id = m.event_id
INNER JOIN sys_base_region r ON m.top_region_id = r.id INNER JOIN sys_base_region r ON m.top_region_id = r.id
WHERE m.type = #{type} WHERE m.type = #{type}
<if test="name != null and name !=''"> <if test="name != null and name !=''">
...@@ -539,17 +552,39 @@ ...@@ -539,17 +552,39 @@
</if> </if>
</select> </select>
<select id="frontList" resultType="com.zzsn.event.vo.EventExcelVO"> <select id="frontAllList" resultType="com.zzsn.event.vo.EventExcelVO">
select id,event_name,event_describe,publish_date,total_hot from event select distinct a.* from (
where publish_status = 1 and face_public = 1 select e.id,e.event_name,e.event_describe,e.publish_date,e.total_hot from event e
where e.publish_status = 1 and e.face_public = 1
union
select e.id,e.event_name,e.event_describe,e.publish_date,e.total_hot from event e
where e.publish_status = 1 and e.create_by = #{createBy}
) a inner join project_subject_map m on a.id = m.subject_id
where m.project_id = #{projectId}
<if test="eventIdList != null and eventIdList.size() > 0">
and a.id in
<foreach collection="eventIdList" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</if>
<if test="size != null">
order by a.publish_date desc
limit #{size}
</if>
</select>
<select id="frontOwnerList" resultType="com.zzsn.event.vo.EventExcelVO">
select id,event_name,event_describe,publish_date,total_hot from event e
inner join project_subject_map m on e.id = m.subject_id
where e.publish_status = 1 and e.face_public = 1
and e.create_by = #{createBy} and m.project_id = #{projectId}
<if test="eventIdList != null and eventIdList.size() > 0"> <if test="eventIdList != null and eventIdList.size() > 0">
and id in and e.id in
<foreach collection="eventIdList" open="(" separator="," close=")" item="item"> <foreach collection="eventIdList" open="(" separator="," close=")" item="item">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="size != null"> <if test="size != null">
order by publish_date desc order by e.publish_date desc
limit #{size} limit #{size}
</if> </if>
</select> </select>
......
...@@ -43,5 +43,5 @@ public interface EventExtractService extends IService<EventExtract> { ...@@ -43,5 +43,5 @@ public interface EventExtractService extends IService<EventExtract> {
* @author lkg * @author lkg
* @date 2024/9/9 * @date 2024/9/9
*/ */
IPage<EventFrontVO> frontPageList(String projectId, String eventName, String eventType, Integer pageNo, Integer pageSize); IPage<EventFrontVO> frontDigPageList(String projectId, String eventName, String eventType, Integer pageNo, Integer pageSize);
} }
package com.zzsn.event.service; package com.zzsn.event.service;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.entity.*; import com.zzsn.event.entity.*;
import com.zzsn.event.enums.CodePrefixEnum; import com.zzsn.event.enums.CodePrefixEnum;
import com.zzsn.event.util.CodeGenerateUtil; import com.zzsn.event.util.CodeGenerateUtil;
...@@ -37,12 +38,12 @@ public class EventSimpleService { ...@@ -37,12 +38,12 @@ public class EventSimpleService {
private ISubjectTypeMapService subjectTypeMapService; private ISubjectTypeMapService subjectTypeMapService;
@Autowired @Autowired
private IProjectSubjectMapService projectSubjectMapService; private IProjectSubjectMapService projectSubjectMapService;
@Autowired @Autowired
private IEventTagService eventTagService; private IEventTagService eventTagService;
@Autowired @Autowired
private EventRegionMapService eventRegionMapService; private EventRegionMapService eventRegionMapService;
@Autowired
private EventExtractService eventExtractService;
//默认搜索引擎 //默认搜索引擎
...@@ -81,6 +82,12 @@ public class EventSimpleService { ...@@ -81,6 +82,12 @@ public class EventSimpleService {
eventService.save(event); eventService.save(event);
String eventId = event.getId(); String eventId = event.getId();
CompletableFuture.runAsync(()->{ CompletableFuture.runAsync(()->{
//删除伪事件
Integer category = addEventVO.getCategory();
if (category == 2) {
eventExtractService.update(Wrappers.<EventExtract>lambdaUpdate().set(EventExtract::getDeleteStatus, 1)
.eq(EventExtract::getId, addEventVO.getFakeEventId()));
}
saveMapMain(eventId); saveMapMain(eventId);
//事件标签 //事件标签
eventTagService.save(EventTag.builder().eventId(eventId).build()); eventTagService.save(EventTag.builder().eventId(eventId).build());
......
...@@ -44,7 +44,7 @@ public interface IEventService extends IService<Event> { ...@@ -44,7 +44,7 @@ public interface IEventService extends IService<Event> {
* @author lkg * @author lkg
* @date 2024/4/8 * @date 2024/4/8
*/ */
IPage<EventManageVO> pageList(String eventName, Integer eventType,Integer facePublic,Integer publishStatus, String startTime, String endTime, IPage<EventManageVO> pageList(String eventName, Integer eventType, Integer facePublic, Integer publishStatus, String startTime, String endTime,
String order, String orderType, Integer pageNo, Integer pageSize); String order, String orderType, Integer pageNo, Integer pageSize);
/** /**
...@@ -114,7 +114,7 @@ public interface IEventService extends IService<Event> { ...@@ -114,7 +114,7 @@ public interface IEventService extends IService<Event> {
* @author lkg * @author lkg
* @date 2024/4/8 * @date 2024/4/8
*/ */
List<EventTopVO> topEventList(String startTime, String endTime, Integer type, Integer pageSize); List<EventTopVO> topEventList(String projectId, String createBy,String startTime, String endTime, Integer type, Integer pageSize);
/** /**
* 根据地域获取事件信息列表 * 根据地域获取事件信息列表
...@@ -124,7 +124,7 @@ public interface IEventService extends IService<Event> { ...@@ -124,7 +124,7 @@ public interface IEventService extends IService<Event> {
* @author lkg * @author lkg
* @date 2024/4/10 * @date 2024/4/10
*/ */
List<EventRegionVO> listByRegion(Integer type, String name); List<EventRegionVO> listByRegion(String projectId, String createBy,Integer type, String name);
Event saveMain(AddEventParam addEventParam); Event saveMain(AddEventParam addEventParam);
...@@ -139,12 +139,26 @@ public interface IEventService extends IService<Event> { ...@@ -139,12 +139,26 @@ public interface IEventService extends IService<Event> {
/** /**
* 公开且发布的事件信息集合 * 公开且发布的事件信息集合
* *
* @param projectId 项目id
* @param createBy 创建人
* @param eventIdList 事件id集合 * @param eventIdList 事件id集合
* @param size 数量 * @param size 数量
* @author lkg * @author lkg
* @date 2024/4/10 * @date 2024/4/10
*/ */
List<EventExcelVO> frontList(List<String> eventIdList, Integer size); List<EventExcelVO> frontAllList(String projectId, String createBy, List<String> eventIdList, Integer size);
/**
* 默认创建的,公开且发布的事件信息集合
*
* @param projectId 项目id
* @param createBy 创建人
* @param eventIdList 事件id集合
* @param size 数量
* @author lkg
* @date 2024/4/10
*/
List<EventExcelVO> frontOwnerList(String projectId, String createBy, List<String> eventIdList, Integer size);
/** /**
* 模型信息列表 * 模型信息列表
......
...@@ -55,7 +55,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -55,7 +55,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
long max = 0L; long max = 0L;
String maxTime = null; String maxTime = null;
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime, false);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_hour").field("publishDate"); DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_hour").field("publishDate");
...@@ -103,7 +103,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -103,7 +103,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
countVO.setName(name); countVO.setName(name);
long count = 0L; long count = 0L;
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, labelId, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, labelId, startTime, endTime, false);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
searchRequest.source(searchSourceBuilder); searchRequest.source(searchSourceBuilder);
...@@ -132,7 +132,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -132,7 +132,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
LabelEntity labelEntity = labelEntityService.getById(labelId); LabelEntity labelEntity = labelEntityService.getById(labelId);
countVO.setName(labelEntity.getName()); countVO.setName(labelEntity.getName());
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, labelId, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, labelId, startTime, endTime, false);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_day") DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_day")
...@@ -171,7 +171,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -171,7 +171,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
public List<CountVO> origin(String subjectId, String startTime, String endTime) { public List<CountVO> origin(String subjectId, String startTime, String endTime) {
List<CountVO> list = new ArrayList<>(); List<CountVO> list = new ArrayList<>();
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime, true);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("group_origin") TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("group_origin")
...@@ -290,9 +290,9 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -290,9 +290,9 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
} }
@Override @Override
public List<CountVO> flowData(String subjectId, String startTime, String endTime,Integer type) { public List<CountVO> flowData(String subjectId, String startTime, String endTime, Integer type) {
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(subjectId, null, startTime, endTime, false);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_day") DateHistogramAggregationBuilder aggregation = AggregationBuilders.dateHistogram("group_day")
...@@ -329,7 +329,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -329,7 +329,7 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
long count = 0; long count = 0;
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX); SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
String eventIds = String.join(",", eventIdList); String eventIds = String.join(",", eventIdList);
SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(eventIds, null, startTime, endTime); SearchSourceBuilder searchSourceBuilder = formatSourceBuilder(eventIds, null, startTime, endTime, false);
searchSourceBuilder.size(0); searchSourceBuilder.size(0);
searchSourceBuilder.trackTotalHits(true); searchSourceBuilder.trackTotalHits(true);
searchRequest.source(searchSourceBuilder); searchRequest.source(searchSourceBuilder);
...@@ -350,10 +350,11 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -350,10 +350,11 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
* @param relationId 关联id(可以是标签id,企业信用代码等) * @param relationId 关联id(可以是标签id,企业信用代码等)
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @param originFlag 是否过滤来源字段(origin)为空的数据
* @author lkg * @author lkg
* @date 2024/1/23 * @date 2024/1/23
*/ */
private SearchSourceBuilder formatSourceBuilder(String subjectId, String relationId, String startTime, String endTime) { private SearchSourceBuilder formatSourceBuilder(String subjectId, String relationId, String startTime, String endTime, Boolean originFlag) {
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
//创建查询对象 //创建查询对象
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery(); BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
...@@ -373,6 +374,9 @@ public class EsStatisticsServiceImpl implements EsStatisticsService { ...@@ -373,6 +374,9 @@ public class EsStatisticsServiceImpl implements EsStatisticsService {
if (StringUtils.isNotBlank(endTime)) { if (StringUtils.isNotBlank(endTime)) {
boolQuery.filter(QueryBuilders.rangeQuery("publishDate").lte(EsDateUtil.esFieldDateFormat(endTime))); boolQuery.filter(QueryBuilders.rangeQuery("publishDate").lte(EsDateUtil.esFieldDateFormat(endTime)));
} }
if (originFlag) {
boolQuery.must(QueryBuilders.termQuery("origin.keyword", ""));
}
//未删除状态查询 //未删除状态查询
boolQuery.mustNot(QueryBuilders.matchQuery("deleteFlag", "1")); boolQuery.mustNot(QueryBuilders.matchQuery("deleteFlag", "1"));
searchSourceBuilder.query(boolQuery); searchSourceBuilder.query(boolQuery);
......
...@@ -43,15 +43,15 @@ public class EventExtractServiceImpl extends ServiceImpl<EventExtractMapper, Eve ...@@ -43,15 +43,15 @@ public class EventExtractServiceImpl extends ServiceImpl<EventExtractMapper, Eve
} }
@Override @Override
public IPage<EventFrontVO> frontPageList(String projectId, String eventName, String eventType, Integer pageNo, Integer pageSize) { public IPage<EventFrontVO> frontDigPageList(String projectId, String eventName, String eventType, Integer pageNo, Integer pageSize) {
int offset = (pageNo - 1) * pageSize; int offset = (pageNo - 1) * pageSize;
List<String> eventTypes = new ArrayList<>(); List<String> eventTypes = new ArrayList<>();
if (StringUtils.isNotEmpty(eventType)) { if (StringUtils.isNotEmpty(eventType)) {
List<Node> nodes = eventCategoryService.categoryList(); List<Node> nodes = eventCategoryService.categoryList();
eventTypes = TreeUtil.belowList(nodes, eventType, true); eventTypes = TreeUtil.belowList(nodes, eventType, true);
} }
List<EventFrontVO> pageList = baseMapper.frontPageList(projectId, eventName, eventTypes, offset, pageSize); List<EventFrontVO> pageList = baseMapper.frontDigPageList(projectId, eventName, eventTypes, offset, pageSize);
Long count = baseMapper.frontTotalCount(projectId, eventName, eventTypes); Long count = baseMapper.frontDigTotalCount(projectId, eventName, eventTypes);
IPage<EventFrontVO> pageData = new Page<>(pageNo, pageSize, count); IPage<EventFrontVO> pageData = new Page<>(pageNo, pageSize, count);
pageData.setRecords(pageList); pageData.setRecords(pageList);
return pageData; return pageData;
......
...@@ -91,6 +91,8 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -91,6 +91,8 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
private SubjectAnalysisService subjectAnalysisService; private SubjectAnalysisService subjectAnalysisService;
@Autowired @Autowired
private EventAnalysisReportService eventAnalysisReportService; private EventAnalysisReportService eventAnalysisReportService;
@Autowired
private EventExtractService eventExtractService;
@Resource @Resource
private RestHighLevelClient client; private RestHighLevelClient client;
...@@ -241,13 +243,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -241,13 +243,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
@Override @Override
public List<EventTopVO> topEventList(String startTime, String endTime, Integer type, Integer pageSize) { public List<EventTopVO> topEventList(String projectId, String createBy,String startTime, String endTime, Integer type, Integer pageSize) {
return baseMapper.topEventList(startTime, endTime, type, 0, pageSize); return baseMapper.topEventList(projectId,createBy,startTime, endTime, type, 0, pageSize);
} }
@Override @Override
public List<EventRegionVO> listByRegion(Integer type, String name) { public List<EventRegionVO> listByRegion(String projectId, String createBy,Integer type, String name) {
return baseMapper.listByRegion(type, name); return baseMapper.listByRegion(projectId,createBy,type, name);
} }
private Map<String, String> getFirstMap(List<EventFrontVO> pageList) { private Map<String, String> getFirstMap(List<EventFrontVO> pageList) {
...@@ -313,6 +315,12 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -313,6 +315,12 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
baseMapper.insert(event); baseMapper.insert(event);
String eventId = event.getId(); String eventId = event.getId();
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
//删除伪事件
Integer category = addEventParam.getCategory();
if (category == 2) {
eventExtractService.update(Wrappers.<EventExtract>lambdaUpdate().set(EventExtract::getDeleteStatus, 1)
.eq(EventExtract::getId, addEventParam.getFakeEventId()));
}
//插入专题-类别、项目的绑定关系 //插入专题-类别、项目的绑定关系
saveMapMain(event, addEventParam); saveMapMain(event, addEventParam);
//事件标签 //事件标签
...@@ -418,8 +426,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -418,8 +426,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
@Override @Override
public List<EventExcelVO> frontList(List<String> eventIdList, Integer size) { public List<EventExcelVO> frontAllList(String projectId,String createBy, List<String> eventIdList, Integer size) {
return baseMapper.frontList(eventIdList, size); return baseMapper.frontAllList(projectId,createBy,eventIdList, size);
}
@Override
public List<EventExcelVO> frontOwnerList(String projectId, String createBy, List<String> eventIdList, Integer size) {
return baseMapper.frontOwnerList(projectId,createBy,eventIdList,size);
} }
@Override @Override
......
...@@ -54,8 +54,8 @@ public class AnalysisTask { ...@@ -54,8 +54,8 @@ public class AnalysisTask {
@Autowired @Autowired
private SubjectAnalysisService subjectAnalysisService; private SubjectAnalysisService subjectAnalysisService;
private static final String queryString = "{\"bool\":{\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}}],\"must_not\":[{\"match\":{\"flag\":\"0\"}},{\"match\":{\"deleteFlag\":\"1\"}}]}}"; private static final String queryString = "{\"bool\":{\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}}],\"must_not\":[{\"match\":{\"deleteFlag\":\"1\"}}]}}";
private static final String beforeQueryString = "{\"bool\":{\"filter\":[{\"range\":{\"publishDate\":{\"gte\":\"start_time\",\"lte\":\"end_time\"}}}],\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}}],\"must_not\":[{\"match\":{\"flag\":\"0\"}},{\"match\":{\"deleteFlag\":\"1\"}}]}}"; private static final String beforeQueryString = "{\"bool\":{\"filter\":[{\"range\":{\"publishDate\":{\"gte\":\"start_time\",\"lte\":\"end_time\"}}}],\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}}],\"must_not\":[{\"match\":{\"deleteFlag\":\"1\"}}]}}";
private static final String repeatNumQueryString = "{\"bool\":{\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}},{\"match\":{\"masterEntryId\":\"data_id\"}}],\"must_not\":[{\"match\":{\"id\":\"data_id\"}}]}}"; private static final String repeatNumQueryString = "{\"bool\":{\"must\":[{\"match\":{\"subjectId\":\"subject_id\"}},{\"match\":{\"masterEntryId\":\"data_id\"}}],\"must_not\":[{\"match\":{\"id\":\"data_id\"}}]}}";
/** /**
......
...@@ -73,10 +73,10 @@ public class EventDigTask { ...@@ -73,10 +73,10 @@ public class EventDigTask {
//分批发送 //分批发送
List<List<EventDigDataVO>> partition = ListUtils.partition(eventDigDataVOS, 30); List<List<EventDigDataVO>> partition = ListUtils.partition(eventDigDataVOS, 30);
partition.forEach(e -> { partition.forEach(e -> {
Map<String,Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
dataMap.put("taskId",taskId); dataMap.put("taskId", taskId);
dataMap.put("projectId",projectId); dataMap.put("projectId", projectId);
dataMap.put("dataList",e); dataMap.put("dataList", e);
kafkaTemplate.send(Constants.EVENT_DIG_SEND_TOPIC, JSON.toJSONString(dataMap)); kafkaTemplate.send(Constants.EVENT_DIG_SEND_TOPIC, JSON.toJSONString(dataMap));
}); });
String processDate = eventDigDataVOS.get(eventDigDataVOS.size() - 1).getProcessDate(); String processDate = eventDigDataVOS.get(eventDigDataVOS.size() - 1).getProcessDate();
......
...@@ -15,4 +15,7 @@ public class AddEventParam extends Event { ...@@ -15,4 +15,7 @@ public class AddEventParam extends Event {
private String projectId; private String projectId;
/**关键词*/ /**关键词*/
private KeywordsVO keywordsVO; private KeywordsVO keywordsVO;
/**伪事件id*/
private String fakeEventId;
} }
...@@ -39,9 +39,14 @@ public class AddEventVO { ...@@ -39,9 +39,14 @@ public class AddEventVO {
private String eventLabel; private String eventLabel;
/**是否公开*/ /**是否公开*/
private Integer facePublic; private Integer facePublic;
/**事件创建方式(1-用户直接创建;2-基于挖掘的事件创建)*/
private Integer category;
/**事件地域信息*/ /**事件地域信息*/
List<RegionVO> regionList; List<RegionVO> regionList;
/**关键词*/ /**关键词*/
private KeywordsVO keywordsVO; private KeywordsVO keywordsVO;
/**伪事件id*/
private String fakeEventId;
} }
...@@ -13,6 +13,10 @@ import java.util.List; ...@@ -13,6 +13,10 @@ import java.util.List;
@Data @Data
public class ExportParam { public class ExportParam {
//数据范围(1-全部;3-我的)
private Integer classify;
//项目id,默认研究中心
private String projectId = "1476527644425682945";
//事件id集合 //事件id集合
private List<String> eventIdList; private List<String> eventIdList;
//搜索词 //搜索词
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论