Commit 70a38d69 by 陈健智

小红书定制模块前台部分

parent f37c635a
...@@ -109,12 +109,18 @@ public class RedisKeyPrefix { ...@@ -109,12 +109,18 @@ public class RedisKeyPrefix {
*/ */
public static final String YUQING_ANALYZE_PROJECT_AVG_COUNT = "BRANDKBS:YUQING:ANALYZE:AMOUNT:AVG:"; public static final String YUQING_ANALYZE_PROJECT_AVG_COUNT = "BRANDKBS:YUQING:ANALYZE:AMOUNT:AVG:";
public static final String CUSTOM_YUQING_ANALYZE_AVG_COUNT = "BRANDKBS:CUSTOM:YUQING:ANALYZE:AMOUNT:AVG:";
public static final String YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG = "BRANDKBS:YUQING:ANALYZE:EMOTION:AVG:"; public static final String YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG = "BRANDKBS:YUQING:ANALYZE:EMOTION:AVG:";
public static final String CUSTOM_YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG = "BRANDKBS:CUSTOM:YUQING:ANALYZE:EMOTION:AVG:";
public static final String YUQING_ANALYZE_PLATFORM_AVG_COUNT = "BRANDKBS:YUQING:ANALYZE:PLATFORM:AVG:"; public static final String YUQING_ANALYZE_PLATFORM_AVG_COUNT = "BRANDKBS:YUQING:ANALYZE:PLATFORM:AVG:";
public static final String YUQING_ANALYZE_HIGH_WORD = "BRANDKBS:YUQING:ANALYZE:HIGH:WORD:"; public static final String YUQING_ANALYZE_HIGH_WORD = "BRANDKBS:YUQING:ANALYZE:HIGH:WORD:";
public static final String CUSTOM_YUQING_ANALYZE_HIGH_WORD = "BRANDKBS:CUSTOM:YUQING:ANALYZE:HIGH:WORD:";
public static final String SEARCH_KEYWORD = "BRANDKBS:SEARCH:KEYWORD:"; public static final String SEARCH_KEYWORD = "BRANDKBS:SEARCH:KEYWORD:";
public static String projectWarnHotTopKeyAll(String projectId, String type) { public static String projectWarnHotTopKeyAll(String projectId, String type) {
......
...@@ -154,18 +154,27 @@ public class BaseModuleController extends BaseController { ...@@ -154,18 +154,27 @@ public class BaseModuleController extends BaseController {
@ApiOperation("新增舆情分析小红书关键词(小红书定制模块)") @ApiOperation("新增舆情分析小红书关键词(小红书定制模块)")
@PostMapping("/highlightWord/add") @PostMapping("/xiaohongshuWord/add")
public ResponseResult addXiaohongshuWordList(@ApiParam(name = "info:{keyword:关键词, planName:方案名)") @RequestBody JSONObject info) { public ResponseResult addXiaohongshuWordList(@ApiParam(name = "info", value = "{keyword:关键词, planName:方案名)") @RequestBody JSONObject info) {
String keyword = info.getString("keyword"); String keyword = info.getString("keyword");
String planName = info.getString("planName"); String planName = info.getString("planName");
return xiaohongshuWordService.addWord(keyword, planName, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname()); return xiaohongshuWordService.addWord(keyword, planName, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname());
} }
@ApiOperation("删除舆情分析小红书关键词(小红书定制模块)") @ApiOperation("删除舆情分析小红书关键词(小红书定制模块)")
@PostMapping("/highlightWord/delete{id}") @PostMapping("/xiaohongshuWord/delete/{id}")
public ResponseResult deleteXiaohongshuWord(@PathVariable String id) { public ResponseResult deleteXiaohongshuWord(@PathVariable String id) {
xiaohongshuWordService.deleteWord(id); xiaohongshuWordService.deleteWord(id);
return ResponseResult.success(); return ResponseResult.success();
} }
@ApiOperation("更新舆情分析小红书关键词(小红书定制模块)")
@PostMapping("/xiaohongshuWord/update")
public ResponseResult updateXiaohongshuWordList(@ApiParam(name = "info", value = "{keyword:关键词, planName:方案名)") @RequestBody JSONObject info) {
String id = info.getString("id");
String keyword = info.getString("keyword");
String planName = info.getString("planName");
xiaohongshuWordService.updateWord(id, keyword, planName, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname());
return ResponseResult.success();
}
} }
...@@ -590,6 +590,67 @@ public class AppArticleController extends BaseController { ...@@ -590,6 +590,67 @@ public class AppArticleController extends BaseController {
return ResponseResult.success(markDataService.expandOriginRange(dto)); return ResponseResult.success(markDataService.expandOriginRange(dto));
} }
@ApiOperation("定制小红书平台舆情分析-舆情总量")
@PostMapping("/analyze/custom-xhs/amount")
// @LogRecord(description = "舆情库-舆情分析")
public ResponseResult getXhsCustomYuqingAmount(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomYuqingAmount(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-情感分布")
@PostMapping("/analyze/custom-xhs/emotion")
public ResponseResult getXhsCustomYuqingEmotionDistribution(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomYuqingEmotionDistribution(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-互动量指标")
@PostMapping("/analyze/custom-xhs/interaction-count")
public ResponseResult getXhsCustomYuqingInteractionCount(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomYuqingInteractionCount(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-舆情走势图")
@PostMapping("/analyze/custom-xhs/tendency")
public ResponseResult getXhsCustomSpreadTendency(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomSpreadTendency(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-高互动量发文")
@PostMapping("/analyze/custom-xhs/interaction-article")
public ResponseResult getXhsCustomInteractionArticle(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomInteractionArticle(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-负面舆情")
@PostMapping("/analyze/custom-xhs/negative-article")
public ResponseResult getXhsCustomNegativeArticle(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomNegativeArticle(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-ip分布、词云详情页舆情数据")
@PostMapping("/analyze/custom-xhs/mark-data")
public ResponseResult getXhsCustomArticleDetail(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomArticleDetail(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-ip分布")
@PostMapping("/analyze/custom-xhs/ip-located")
public ResponseResult getXhsCustomArticleIpLocated(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomArticleIpLocated(markSearchDTO));
}
@ApiOperation("定制小红书平台舆情分析-词云")
@PostMapping("/analyze/custom-xhs/high-word")
public ResponseResult getXhsCustomAnalyzeHighWord(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomAnalyzeHighWord(markSearchDTO, true));
}
@ApiOperation("定制小红书平台舆情分析-小红书实时热门词云")
@PostMapping("/analyze/custom-xhs/timely-high-word")
public ResponseResult getXhsCustomTimelyHighWord(@RequestBody MarkSearchDTO markSearchDTO) {
return ResponseResult.success(markDataService.getXhsCustomTimelyHighWord(markSearchDTO));
}
private boolean checkMTagIllegal(StringBuilder mtag) { private boolean checkMTagIllegal(StringBuilder mtag) {
List<MarkerTag> hitTags = projectService.getProjectById(UserThreadLocal.getProjectId()).getHitTags(); List<MarkerTag> hitTags = projectService.getProjectById(UserThreadLocal.getProjectId()).getHitTags();
if (!Tools.isEmpty(hitTags)) { if (!Tools.isEmpty(hitTags)) {
......
...@@ -41,8 +41,8 @@ public class XiaohongshuRecordDaoImpl extends BaseMongoDaoImpl<XiaohongshuRecord ...@@ -41,8 +41,8 @@ public class XiaohongshuRecordDaoImpl extends BaseMongoDaoImpl<XiaohongshuRecord
List<AggregationOperation> operations = new ArrayList<>(); List<AggregationOperation> operations = new ArrayList<>();
// operations区分先后顺序 // operations区分先后顺序
operations.add(Aggregation.match(criteria)); operations.add(Aggregation.match(criteria));
operations.add(Aggregation.project("currentCount").and("cTime").substring(0, norOfChars).as("cTime")); operations.add(Aggregation.project("usedCount").and("cTime").substring(0, norOfChars).as("cTime"));
operations.add(Aggregation.group("cTime").last("currentCount").as("count")); operations.add(Aggregation.group("cTime").sum("usedCount").as("count"));
operations.add(Aggregation.sort(Sort.by(Sort.Order.asc("_id")))); operations.add(Aggregation.sort(Sort.by(Sort.Order.asc("_id"))));
Aggregation aggregation = Aggregation.newAggregation(operations); Aggregation aggregation = Aggregation.newAggregation(operations);
// 聚合结果 // 聚合结果
......
...@@ -7,15 +7,18 @@ import com.zhiwei.brandkbs2.pojo.ChannelIndex; ...@@ -7,15 +7,18 @@ import com.zhiwei.brandkbs2.pojo.ChannelIndex;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.time.FastDateFormat;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.search.ClearScrollRequest; import org.elasticsearch.action.search.ClearScrollRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchScrollRequest; import org.elasticsearch.action.search.SearchScrollRequest;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient; import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.CountRequest; import org.elasticsearch.client.core.CountRequest;
...@@ -202,6 +205,27 @@ public class EsClientDao { ...@@ -202,6 +205,27 @@ public class EsClientDao {
return getAllIndexList(startTime, endTime).toArray(new String[0]); return getAllIndexList(startTime, endTime).toArray(new String[0]);
} }
public void batchUpdate(List<Pair<String, Map<String, Object>>> updateList) {
if (CollectionUtils.isEmpty(updateList)){
return;
}
retryTemplate.execute(context -> {
try {
BulkRequest bulkRequest = new BulkRequest();
for (Pair<String, Map<String, Object>> pair : updateList) {
Map<String, Object> map = pair.getRight();
String index = pair.getLeft();
bulkRequest.add(new UpdateRequest().index(index).id(map.get("id") + "").doc(map));
}
esClient.bulk(bulkRequest, RequestOptions.DEFAULT);
log.info("定制化舆情分析-互动量更新结果数据-批量更新es数据【{}】条", updateList.size());
} catch (Exception e) {
e.printStackTrace();
}
return null;
});
}
protected RestHighLevelClient getEsClient() { protected RestHighLevelClient getEsClient() {
return esClient; return esClient;
} }
......
...@@ -341,9 +341,11 @@ public class EsQueryTools { ...@@ -341,9 +341,11 @@ public class EsQueryTools {
* @param dataType 数据类型(1:长文本, 2:短文本, 3:问答, 5:视频) * @param dataType 数据类型(1:长文本, 2:短文本, 3:问答, 5:视频)
* @return * @return
*/ */
public static BoolQueryBuilder assembleC2Query(Integer dataType) { public static BoolQueryBuilder assembleC2Query(List<Integer> dataType) {
BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();
queryBuilder.should(QueryBuilders.termQuery(GenericAttribute.ES_C2, dataType << 23)); for (Integer type : dataType) {
queryBuilder.should(QueryBuilders.termQuery(GenericAttribute.ES_C2, type << 23));
}
return queryBuilder; return queryBuilder;
} }
......
...@@ -183,13 +183,17 @@ public class MarkSearchDTO { ...@@ -183,13 +183,17 @@ public class MarkSearchDTO {
*/ */
@ApiModelProperty(value = "屏蔽词检索字段:全文|标题") @ApiModelProperty(value = "屏蔽词检索字段:全文|标题")
private String filterType; private String filterType;
/** /**
* 方案id,仅非人工项目 * 非人工项目-方案id,仅非人工项目
*/ */
@ApiModelProperty(value = "方案id") @ApiModelProperty(value = "方案id")
private String planId; private String planId;
/** /**
* 定制化舆情分析页面-方案id
*/
@ApiModelProperty(value = "定制化舆情分析页面方案id")
private String customPlanId;
/**
* 内容类型(原创/转发),仅非人工项目 * 内容类型(原创/转发),仅非人工项目
*/ */
@ApiModelProperty(value = "内容类型(原创/转发)") @ApiModelProperty(value = "内容类型(原创/转发)")
...@@ -203,7 +207,7 @@ public class MarkSearchDTO { ...@@ -203,7 +207,7 @@ public class MarkSearchDTO {
* 数据类型(长文本/短文本/问答/视频),仅非人工项目 * 数据类型(长文本/短文本/问答/视频),仅非人工项目
*/ */
@ApiModelProperty(value = "数据类型(1:长文本, 2:短文本, 3:问答, 5:视频)") @ApiModelProperty(value = "数据类型(1:长文本, 2:短文本, 3:问答, 5:视频)")
private Integer dataType; private List<Integer> dataType;
/** /**
* ip地址 * ip地址
*/ */
......
...@@ -545,6 +545,8 @@ public interface MarkDataService { ...@@ -545,6 +545,8 @@ public interface MarkDataService {
*/ */
void countYuqingAmountAvg(Long startTime, Long endTime, String projectId, String planId) throws IOException; void countYuqingAmountAvg(Long startTime, Long endTime, String projectId, String planId) throws IOException;
void countCustomYuqingAmountAvg(Long startTime, Long endTime, String projectId, String customPlanId) throws IOException;
/** /**
* 计算近一年情感分布均值 * 计算近一年情感分布均值
* @param projectId * @param projectId
...@@ -553,6 +555,8 @@ public interface MarkDataService { ...@@ -553,6 +555,8 @@ public interface MarkDataService {
*/ */
void countEmotionDistributionAvg(Long startTime, Long endTime, String projectId, String planId) throws IOException; void countEmotionDistributionAvg(Long startTime, Long endTime, String projectId, String planId) throws IOException;
void countCustomEmotionDistributionAvg(Long startTime, Long endTime, String projectId, String customPlanId) throws IOException;
/** /**
* 计算项目近一年重点平台均值 * 计算项目近一年重点平台均值
* @param projectId * @param projectId
...@@ -636,6 +640,81 @@ public interface MarkDataService { ...@@ -636,6 +640,81 @@ public interface MarkDataService {
List<JSONObject> getSearchAnalyzeHighWord(MarkSearchDTO dto); List<JSONObject> getSearchAnalyzeHighWord(MarkSearchDTO dto);
/** /**
* 达达项目定制小红书平台舆情分析-舆情总量
* @param dto 标注数据搜索传输类
* @return
* @throws IOException
*/
JSONObject getXhsCustomYuqingAmount(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-情感分布
* @param dto 标注数据搜索传输类
* @return
* @throws IOException
*/
JSONObject getXhsCustomYuqingEmotionDistribution(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-互动量指标
* @param dto 标注数据搜索传输类
* @return
* @throws IOException
*/
JSONObject getXhsCustomYuqingInteractionCount(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-舆情走势图
* @param dto 标注数据搜索传输类
* @return
*/
JSONObject getXhsCustomSpreadTendency(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-高互动量发文
* @param dto 标注数据搜索传输类
* @return
*/
List<MarkFlowEntity> getXhsCustomInteractionArticle(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-负面舆情
* @param dto 标注数据搜索传输类
* @return
*/
PageVO<MarkFlowEntity> getXhsCustomNegativeArticle(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-ip分布、词云详情页舆情数据
* @param dto 标注数据搜索传输类
* @return
*/
PageVO<MarkFlowEntity> getXhsCustomArticleDetail(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-ip分布
* @param dto 标注数据搜索传输类
* @return
*/
List<JSONObject> getXhsCustomArticleIpLocated(MarkSearchDTO dto);
/**
* 达达项目定制小红书平台舆情分析-词云
* @param dto 标注数据搜索传输类
* @return
*/
List<JSONObject> getXhsCustomAnalyzeHighWord(MarkSearchDTO dto, boolean cache);
void cacheXhsCustomHighWord(Long startTime, Long endTime, String customPlanId);
/**
* 达达项目定制小红书平台舆情分析-小红书实时热门词云
* @param dto 标注数据搜索传输类
* @return
*/
List<JSONObject> getXhsCustomTimelyHighWord(MarkSearchDTO dto);
/**
* 新-舆情分析-高频标题 * 新-舆情分析-高频标题
* @param startTime * @param startTime
* @param endTime * @param endTime
......
...@@ -62,4 +62,14 @@ public interface TaskService{ ...@@ -62,4 +62,14 @@ public interface TaskService{
* 生成每日一报 * 生成每日一报
*/ */
void generateDailyReport(); void generateDailyReport();
/**
* 每月互动量更新 时间范围近六个月
*/
void monthlyCustomXhsInteractionUpdate();
/**
* 每日互动量更新 时间范围近10天
*/
void dailyCustomXhsInteractionUpdate();
} }
...@@ -42,6 +42,8 @@ public interface ToolsetService { ...@@ -42,6 +42,8 @@ public interface ToolsetService {
*/ */
ResponseResult urlInteractionUpdate(MultipartFile file); ResponseResult urlInteractionUpdate(MultipartFile file);
List<JSONObject> urlInteractionUpdate(List<String> urls);
/** /**
* 获取互动量更新剩余可用次数 * 获取互动量更新剩余可用次数
* @return * @return
......
...@@ -19,4 +19,6 @@ public interface XiaohongshuWordService extends TableWordService{ ...@@ -19,4 +19,6 @@ public interface XiaohongshuWordService extends TableWordService{
* @return * @return
*/ */
ResponseResult addWord(String keyword, String planName, String projectId, String submitter); ResponseResult addWord(String keyword, String planName, String projectId, String submitter);
void updateWord(String id, String keyword, String planName, String projectId, String submitter);
} }
...@@ -334,7 +334,7 @@ public class EsSearchServiceImpl implements EsSearchService { ...@@ -334,7 +334,7 @@ public class EsSearchServiceImpl implements EsSearchService {
} }
} }
// dataType // dataType
if (Objects.nonNull(dto.getDataType())){ if (CollectionUtils.isNotEmpty(dto.getDataType())){
postFilter.must(EsQueryTools.assembleC2Query(dto.getDataType())); postFilter.must(EsQueryTools.assembleC2Query(dto.getDataType()));
} }
// ip // ip
......
...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.dao.XiaohongshuRecordDao; ...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.dao.XiaohongshuRecordDao;
import com.zhiwei.brandkbs2.pojo.InteractionUpdateRecord; import com.zhiwei.brandkbs2.pojo.InteractionUpdateRecord;
import com.zhiwei.brandkbs2.pojo.Project; import com.zhiwei.brandkbs2.pojo.Project;
import com.zhiwei.brandkbs2.pojo.WholeSearchRecord; import com.zhiwei.brandkbs2.pojo.WholeSearchRecord;
import com.zhiwei.brandkbs2.pojo.vo.LineVO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.ExtraService; import com.zhiwei.brandkbs2.service.ExtraService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
...@@ -213,8 +214,10 @@ public class ExtraServiceImpl implements ExtraService { ...@@ -213,8 +214,10 @@ public class ExtraServiceImpl implements ExtraService {
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("projectId").is(UserThreadLocal.getProjectId())); query.addCriteria(Criteria.where("projectId").is(UserThreadLocal.getProjectId()));
query.addCriteria(Criteria.where("cTime").gte(new Date(startTime)).lt(new Date(endTime))); query.addCriteria(Criteria.where("cTime").gte(new Date(startTime)).lt(new Date(endTime)));
json.put("count", xiaohongshuRecordDao.count(query)); List<LineVO> lineList = xiaohongshuRecordDao.aggregateDayLastRecord(startTime, endTime, timeType);
json.put("trendList", xiaohongshuRecordDao.aggregateDayLastRecord(startTime, endTime, timeType)); long sum = lineList.stream().mapToLong(LineVO::getCount).sum();
json.put("count", sum);
json.put("trendList", lineList);
return json; return json;
} }
......
...@@ -271,11 +271,7 @@ public class ToolsetServiceImpl implements ToolsetService { ...@@ -271,11 +271,7 @@ public class ToolsetServiceImpl implements ToolsetService {
* @param urls 链接 * @param urls 链接
* @return * @return
*/ */
private List<JSONObject> urlInteractionUpdate(List<String> urls){ public List<JSONObject> urlInteractionUpdate(List<String> urls){
return urlInteractionUpdate(urls, null);
}
private List<JSONObject> urlInteractionUpdate(List<String> urls, String taskId){
// 通过url获取域名进而获取任务类型 // 通过url获取域名进而获取任务类型
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
urls.forEach(url -> map.compute(url, (key, value) -> { urls.forEach(url -> map.compute(url, (key, value) -> {
...@@ -299,10 +295,6 @@ public class ToolsetServiceImpl implements ToolsetService { ...@@ -299,10 +295,6 @@ public class ToolsetServiceImpl implements ToolsetService {
for (List<String> ids : ListUtils.partition(taskIdList, 50)) { for (List<String> ids : ListUtils.partition(taskIdList, 50)) {
result.addAll(getInteractionResult(ids)); result.addAll(getInteractionResult(ids));
} }
if (Objects.nonNull(taskId)) {
// 更新处理进度
addProcessSchedule(taskId, taskIdList.size());
}
} }
return result; return result;
} }
......
...@@ -69,4 +69,13 @@ public class XiaohongshuWordServiceImpl extends TableWordServiceImpl implements ...@@ -69,4 +69,13 @@ public class XiaohongshuWordServiceImpl extends TableWordServiceImpl implements
return ResponseResult.success(); return ResponseResult.success();
} }
@Override
public void updateWord(String id, String keyword, String planName, String projectId, String submitter) {
XiaohongshuWord xiaohongshuWord = xiaohongshuWordDao.findOneById(id);
xiaohongshuWord.setKeyword(keyword);
xiaohongshuWord.setPlanName(planName);
xiaohongshuWord.setSubmitter(submitter);
xiaohongshuWordDao.updateOne(xiaohongshuWord);
}
} }
...@@ -118,4 +118,30 @@ public class ControlCenter { ...@@ -118,4 +118,30 @@ public class ControlCenter {
log.info("定时生成每日一报-结束"); log.info("定时生成每日一报-结束");
} }
} }
@Async("scheduledExecutor")
@Scheduled(cron = "0 30 3 L * ?")
public void monthlyCustomXhsInteractionUpdate() {
log.info("每月互动量更新-启动");
try {
taskService.monthlyCustomXhsInteractionUpdate();
} catch (Exception e) {
log.error("每月互动量更新-出错", e);
} finally {
log.info("每月互动量更新-结束");
}
}
@Async("scheduledExecutor")
@Scheduled(cron = "0 0 5 * * ?")
public void dailyCustomXhsInteractionUpdate() {
log.info("每日互动量更新-启动");
try {
taskService.dailyCustomXhsInteractionUpdate();
} catch (Exception e) {
log.error("每日互动量更新-出错", e);
} finally {
log.info("每日互动量更新-结束");
}
}
} }
...@@ -91,18 +91,22 @@ public class RedisUtil { ...@@ -91,18 +91,22 @@ public class RedisUtil {
return RedisKeyPrefix.NON_MANUAL_PROJECT_MARK_MAX_GID + Tools.concat(projectId, planId, userId); return RedisKeyPrefix.NON_MANUAL_PROJECT_MARK_MAX_GID + Tools.concat(projectId, planId, userId);
} }
public static String getYuqingAnalyzeProjectAvgCountKey(String projectId, String contendId, String planId){ public static String getYuqingAnalyzeProjectAvgCountKey(String projectId, String contendId, String planId, String customPlanId, boolean isCustom){
if (Objects.isNull(planId)){ String keyPrefix = isCustom ? RedisKeyPrefix.CUSTOM_YUQING_ANALYZE_AVG_COUNT : RedisKeyPrefix.YUQING_ANALYZE_PROJECT_AVG_COUNT;
return RedisKeyPrefix.YUQING_ANALYZE_PROJECT_AVG_COUNT + Tools.concat(projectId, contendId); String finalPlanId = isCustom ? customPlanId : planId;
if (Objects.isNull(finalPlanId)){
return keyPrefix + Tools.concat(projectId, contendId);
} }
return RedisKeyPrefix.YUQING_ANALYZE_PROJECT_AVG_COUNT + Tools.concat(projectId, contendId, planId); return keyPrefix + Tools.concat(projectId, contendId, finalPlanId);
} }
public static String getYuqingAnalyzeEmotionDistributionAvgKey(String projectId, String contendId, String emotion, String planId){ public static String getYuqingAnalyzeEmotionDistributionAvgKey(String projectId, String contendId, String emotion, String planId, String customPlanId, boolean isCustom){
if (Objects.isNull(planId)){ String keyPrefix = isCustom ? RedisKeyPrefix.CUSTOM_YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG : RedisKeyPrefix.YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG;
return RedisKeyPrefix.YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG + Tools.concat(projectId, contendId, emotion); String finalPlanId = isCustom ? customPlanId : planId;
if (Objects.isNull(finalPlanId)){
return keyPrefix + Tools.concat(projectId, contendId, emotion);
} }
return RedisKeyPrefix.YUQING_ANALYZE_EMOTION_DISTRIBUTION_AVG + Tools.concat(projectId, contendId, emotion, planId); return keyPrefix + Tools.concat(projectId, contendId, emotion, finalPlanId);
} }
public static String getYuqingAnalyzePlatformAvgCountKey(String projectId, String contendId, String planId){ public static String getYuqingAnalyzePlatformAvgCountKey(String projectId, String contendId, String planId){
...@@ -112,11 +116,13 @@ public class RedisUtil { ...@@ -112,11 +116,13 @@ public class RedisUtil {
return RedisKeyPrefix.YUQING_ANALYZE_PLATFORM_AVG_COUNT + Tools.concat(projectId, contendId, planId); return RedisKeyPrefix.YUQING_ANALYZE_PLATFORM_AVG_COUNT + Tools.concat(projectId, contendId, planId);
} }
public static String getYuqingAnalyzeHighWordKey(String projectId, String contendId, String planId, Long startTime, Long endTime){ public static String getYuqingAnalyzeHighWordKey(String projectId, String contendId, String planId, Long startTime, Long endTime, String customPlanId, boolean isCustom){
if (Objects.isNull(planId)){ String keyPrefix = isCustom ? RedisKeyPrefix.CUSTOM_YUQING_ANALYZE_HIGH_WORD : RedisKeyPrefix.YUQING_ANALYZE_HIGH_WORD;
return RedisKeyPrefix.YUQING_ANALYZE_HIGH_WORD + Tools.concat(projectId, contendId, startTime, endTime); String finalPlanId = isCustom ? customPlanId : planId;
if (Objects.isNull(finalPlanId)){
return keyPrefix + Tools.concat(projectId, contendId, startTime, endTime);
} }
return RedisKeyPrefix.YUQING_ANALYZE_HIGH_WORD + Tools.concat(projectId, contendId, planId, startTime, endTime); return keyPrefix + Tools.concat(projectId, contendId, finalPlanId, startTime, endTime);
} }
public static String getSearchKeywordCacheKey(String projectId, String userId, String searchType){ public static String getSearchKeywordCacheKey(String projectId, String userId, String searchType){
......
...@@ -93,6 +93,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea ...@@ -93,6 +93,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
trend.nearYearWords.token=vo5ozWt861R125FMpEDCXxRkft3e5tVi3W4dG2hFLBViRFtGsmWtB5bx9MOlE6Vn
trends.nearYearWords.url=https://hotsearch-manage.zhiweidata.com/zhiwei-hot-words-web/brand/nearYearWords
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2} ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do
......
...@@ -102,7 +102,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea ...@@ -102,7 +102,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
trend.nearYearWords.token=vo5ozWt861R125FMpEDCXxRkft3e5tVi3W4dG2hFLBViRFtGsmWtB5bx9MOlE6Vn
trends.nearYearWords.url=https://hotsearch-manage.zhiweidata.com/zhiwei-hot-words-web/brand/nearYearWords
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}&size={3} ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}&size={3}
ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do
......
...@@ -93,6 +93,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea ...@@ -93,6 +93,8 @@ trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/sea
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
trend.nearYearWords.token=vo5ozWt861R125FMpEDCXxRkft3e5tVi3W4dG2hFLBViRFtGsmWtB5bx9MOlE6Vn
trends.nearYearWords.url=https://hotsearch-manage.zhiweidata.com/zhiwei-hot-words-web/brand/nearYearWords
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2} ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do
......
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