Commit f154f56c by shenjunjie

Merge branch 'feature' into 'master'

Feature

See merge request !70
parents eb4d6d46 f60b13c1
package com.zhiwei.brandkbs2.controller;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.external.BrandkbsChannelConfig;
import com.zhiwei.brandkbs2.pojo.external.BrandkbsHotEventConfig;
import com.zhiwei.brandkbs2.pojo.external.BrandkbsYuQingConfig;
import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.service.ProjectWarnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -40,4 +42,28 @@ public class InterfaceController {
return ResponseResult.success(projectService.getUserAllProjectsPrimary(userId));
}
@ApiOperation("获取舆情动态-预警结果")
@PostMapping("/warn/yuqing")
public ResponseResult getYuqingWaring(@RequestBody JSONObject json) {
String projectId = json.getString("projectId");
BrandkbsYuQingConfig config = json.getObject("config", BrandkbsYuQingConfig.class);
return projectWarnService.getYuqingWaring(projectId, config);
}
@ApiOperation("获取渠道参与-预警结果")
@PostMapping("/warn/channel")
public ResponseResult getChannelWaring(@RequestBody JSONObject json) {
String projectId = json.getString("projectId");
BrandkbsChannelConfig config = json.getObject("config", BrandkbsChannelConfig.class);
return projectWarnService.getChannelWaring(projectId, config);
}
@ApiOperation("获取热点事件-预警结果")
@PostMapping("/warn/hotEvent")
public ResponseResult getHotEventWaring(@RequestBody JSONObject json) {
String projectId = json.getString("projectId");
BrandkbsHotEventConfig config = json.getObject("config", BrandkbsHotEventConfig.class);
return projectWarnService.getHotEventWaring(projectId, config);
}
}
......@@ -176,7 +176,7 @@ public class EsQueryTools {
BoolQueryBuilder contendQuery = QueryBuilders.boolQuery();
// 主品牌一定参与
// contendQuery.should(QueryBuilders.termQuery("contend_id.keyword", "0"));
if (null == contends) {
if (CollectionUtils.isEmpty(contends)) {
return;
}
for (String contendId : contends) {
......@@ -210,6 +210,20 @@ public class EsQueryTools {
}
/**
* 针对微博平台转发 查询语句
*
* @param isForward
* @return
*/
public static BoolQueryBuilder assembleForwardQuery(boolean isForward) {
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
BoolQueryBuilder notWeiboCondition = QueryBuilders.boolQuery();
queryBuilder.should(notWeiboCondition.mustNot(QueryBuilders.termQuery("platform_id", "5d02236e6395002a7c380b79")));
queryBuilder.should(QueryBuilders.termQuery("is_forward", isForward));
return queryBuilder;
}
/**
* 字段不拆封,多字段 同关键词
*
* @param @param boolQueryBuilder
......
package com.zhiwei.brandkbs2.pojo.external;
import com.zhiwei.brandkbs2.pojo.BaseMap;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* @ClassName: BaseMapCompound
* @Description BaseMapCompound
* @author: sjj
* @date: 2022-11-02 16:21
*/
@Data
@AllArgsConstructor
public class BaseMapCompound {
/**
* 基础字段
*/
private BaseMap baseMap;
/**
* 标签列表
*/
private List<String> tags;
}
\ No newline at end of file
package com.zhiwei.brandkbs2.pojo.external;
import lombok.Data;
import java.util.List;
@Data
public class BrandkbsChannelConfig {
private String configName;
/**
* 友好渠道
*/
private Boolean friendlyChannel;
/**
* 阈值
*/
private int threshold;
/**
* 自定义渠道
*/
private String channel;
/**
* 是否转发
*/
private List<Boolean> primary;
/**
* 舆情标签
*/
private List<String> markerTags;
/**
* 是否去重
*/
private Boolean duplicate;
/**
* pushInterval 推送间隔
*/
private Long pushInterval;
private boolean used;
public BrandkbsChannelConfig() {
this.used = false;
this.pushInterval = 10 * 60 * 1000L;
}
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* @ClassName: BrandkbsChannelWarn
* @Description BrandkbsChannelWarn
* @author: sjj
* @date: 2022-11-02 16:45
*/
@Data
@AllArgsConstructor
public class BrandkbsChannelWarn {
/**
* 基础数据
*/
private List<BaseMapCompound> list;
/**
* 预警理由
*/
private String channelWarnReason;
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* @ClassName: BrandkbsHotEventWarn
* @Description BrandkbsHotEventWarn
* @author: sjj
* @date: 2022-11-02 16:49
*/
@Data
@AllArgsConstructor
public class BrandkbsHotEventWarn {
private List<HotEvent> hotEventList;
@Data
public static class HotEvent{
/**
* 类别名称
*/
private String type;
/**
* 事件标题
*/
private String title;
/**
* 事件情感倾向
*/
private String emotion;
/**
* 总传播量
*/
private Long totalDisseminationVolume;
/**
* 参与渠道数
*/
private Long totalChannelVolume;
/**
* 开始时间
*/
private Long startTime;
/**
* 影响力
*/
private double influence;
/**
* 标签列表
*/
private List<String> tagList;
}
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.Data;
import java.util.List;
@Data
public class BrandkbsHotTopConfig {
private String configName;
/**
* 预警关键字
*/
private String warnKeyword;
/**
* 过滤词
*/
private String filterKeyword;
/**
* 榜单类型
*/
private List<String> listType;
/**
* 预警类型 首次上榜
*/
private Boolean firstTop;
/**
*
*/
private Boolean newHeight;
/**
* 新高
*/
private int topNewHeight;
/**
* 再一次上榜
*/
private Boolean topOnceAgain;
private Boolean introduction;
/**
* pushInterval 推送间隔
*/
private Long pushInterval;
private boolean used;
public BrandkbsHotTopConfig() {
this.used = false;
this.pushInterval = 5 * 60 * 1000L;
}
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.AllArgsConstructor;
import lombok.Data;
/**
* @ClassName: BrandkbsWarnTemplate
* @Description BrandkbsWarnTemplate
* @author: sjj
* @date: 2022-11-03 13:48
*/
@Data
@AllArgsConstructor
public class BrandkbsWarnTemplate<T> {
int firstCount;
String keyword1;
String keyword2;
String keyword3;
String keyword4;
T warnDetails;
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.Data;
import java.util.List;
@Data
public class BrandkbsYuQingConfig {
private String configName;
/**
* 发声渠道
*/
private List<String> channelTypes;
/**
* 文章类型
*/
private List<Boolean> primary;
/**
* 本品舆情
*/
private List<String> markerTags;
/**
* 竞品舆情
*/
private List<String> contends;
/**
* 是否去重
*/
private Boolean duplicate;
/**
* 关键字命中
*/
private String keyword;
/**
* pushInterval 推送间隔
*/
private Long pushInterval;
private boolean used;
public BrandkbsYuQingConfig() {
this.used = false;
this.pushInterval = 60 * 60 * 1000L;
}
}
package com.zhiwei.brandkbs2.pojo.external;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
/**
* @ClassName: BrandkbsYuQingWarn
* @Description BrandkbsYuQingWarn
* @author: sjj
* @date: 2022-11-02 16:10
*/
@Data
@AllArgsConstructor
public class BrandkbsYuQingWarn {
/**
* 基础数据
*/
private List<BaseMapCompound> list;
}
......@@ -876,7 +876,11 @@ public class MarkDataServiceImpl implements MarkDataService {
@Override
public List<JSONObject> searchMarkDataByEvent(Event event) {
String linkedGroupId = projectService.getProjectByContendId(event.getProjectId(), event.getContendId()).getBrandLinkedGroupId();
return searchMarkDataByTime(event.getProjectId(), linkedGroupId, event.getContendId(), event.getStartTime(), event.getEndTime(), EVENT_FETCH_SOURCE);
Long endTime = null;
if (event.isEndStatus()) {
endTime = event.getEndTime();
}
return searchMarkDataByTime(event.getProjectId(), linkedGroupId, event.getContendId(), event.getStartTime(), endTime, EVENT_FETCH_SOURCE);
}
@Override
......
......@@ -79,4 +79,15 @@ istarshine.addIStarShineKSData.url=https://istarshine-service.zhiweidata.com/ist
istarshine.getIStarShineKSInfoData.url=https://istarshine-service.zhiweidata.com/istarshine/ks/getIStarShineKSInfoData?taskId={1}&appId=6183571e0d710000f6003a12
whole.search.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/yuqing
whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/pt
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
\ No newline at end of file
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/channel/{1}
warn.hotEvent.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/enable/used
\ No newline at end of file
......@@ -81,4 +81,15 @@ istarshine.addIStarShineKSData.url=https://istarshine-service.zhiweidata.com/ist
istarshine.getIStarShineKSInfoData.url=https://istarshine-service.zhiweidata.com/istarshine/ks/getIStarShineKSInfoData?taskId={1}&appId=6183571e0d710000f6003a12
whole.search.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/yuqing
whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/pt
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
\ No newline at end of file
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url=http://192.168.0.225:11003/qbjc/pushTask/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=http://192.168.0.225:11003/qbjc/pushTask/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=http://192.168.0.225:11003/qbjc/pushTask/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/config/channel/{1}
warn.hotEvent.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url=http://192.168.0.225:11003/qbjc/pushTask/interface/brandkbs/enable/used
\ No newline at end of file
......@@ -79,4 +79,15 @@ istarshine.addIStarShineKSData.url=https://istarshine-service.zhiweidata.com/ist
istarshine.getIStarShineKSInfoData.url=https://istarshine-service.zhiweidata.com/istarshine/ks/getIStarShineKSInfoData?taskId={1}&appId=6183571e0d710000f6003a12
whole.search.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/yuqing
whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/pt
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
\ No newline at end of file
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/project?projectId={1}&projectName={2}
warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
warn.channel.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/channel/{1}
warn.hotEvent.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/hotEvent/{1}
warn.hotTop.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/hotTop/{1}
warn.yuQing.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/config/yuQing/{1}
warn.taskSwitch.url=https://auto-push.zhiweidata.com/qbjc/pushTask/interface/brandkbs/enable/used
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment