Commit 2729ec69 by shenjunjie

渠道倾向及渠道影响力指数计算关闭

parent 204f125f
...@@ -994,69 +994,70 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -994,69 +994,70 @@ public class ChannelServiceImpl implements ChannelService {
@Override @Override
public Channel calculateChannelEmotionIndex(Channel channel) { public Channel calculateChannelEmotionIndex(Channel channel) {
try { // 渠道倾向及渠道影响力指数计算关闭
Project project = projectService.getProjectById(channel.getProjectId()); // try {
// 数据格式变化未含有contendId部分 // Project project = projectService.getProjectById(channel.getProjectId());
if (null == channel.getContendId()) { // // 数据格式变化未含有contendId部分
channel.setContendId("0"); // if (null == channel.getContendId()) {
} // channel.setContendId("0");
// 不做统计 // }
if (!hasEmotion(channel)) { // // 不做统计
return channel; // if (!hasEmotion(channel)) {
} // return channel;
// 该渠道发布正面稿件 // }
Long positiveCount = markCountByEmotion(channel, EmotionEnum.POSITIVE.getName()); // // 该渠道发布正面稿件
// 该渠道发布中性稿件 // Long positiveCount = markCountByEmotion(channel, EmotionEnum.POSITIVE.getName());
Long neutralCount = markCountByEmotion(channel, EmotionEnum.NEUTRAL.getName()); // // 该渠道发布中性稿件
// 该渠道发布负面稿件 // Long neutralCount = markCountByEmotion(channel, EmotionEnum.NEUTRAL.getName());
Long negativeCount = markCountByEmotion(channel, EmotionEnum.NEGATIVE.getName()); // // 该渠道发布负面稿件
// 是否友好渠道 // Long negativeCount = markCountByEmotion(channel, EmotionEnum.NEGATIVE.getName());
boolean isPositive = false; // // 是否友好渠道
boolean isNegative = false; // boolean isPositive = false;
long specNegativeCount = eventMiddlewareDao.getEventCount(new ChannelIndex(channel).getFid(), // boolean isNegative = false;
Arrays.asList(EmotionEnum.POSITIVE.getName(), EmotionEnum.NEUTRAL.getName()), // long specNegativeCount = eventMiddlewareDao.getEventCount(new ChannelIndex(channel).getFid(),
EmotionEnum.NEGATIVE.getName()); // Arrays.asList(EmotionEnum.POSITIVE.getName(), EmotionEnum.NEUTRAL.getName()),
long specPositiveCount = eventMiddlewareDao.getEventCount(new ChannelIndex(channel).getFid(), // EmotionEnum.NEGATIVE.getName());
Collections.singletonList(EmotionEnum.NEGATIVE.getName()), EmotionEnum.POSITIVE.getName()); // long specPositiveCount = eventMiddlewareDao.getEventCount(new ChannelIndex(channel).getFid(),
// 特殊情况:若皆有发布过反常稿件 // Collections.singletonList(EmotionEnum.NEGATIVE.getName()), EmotionEnum.POSITIVE.getName());
if (specNegativeCount > 0 && specPositiveCount > 0) { // // 特殊情况:若皆有发布过反常稿件
// 正面稿件数>负面稿件数,为正面 // if (specNegativeCount > 0 && specPositiveCount > 0) {
if (positiveCount > negativeCount) { // // 正面稿件数>负面稿件数,为正面
isPositive = true; // if (positiveCount > negativeCount) {
// 正面稿件数<负面稿件数,为负面 // isPositive = true;
} else if (positiveCount < negativeCount) { // // 正面稿件数<负面稿件数,为负面
isNegative = true; // } else if (positiveCount < negativeCount) {
} // isNegative = true;
} else { // }
// 在正/中性事件中发布负面稿件||负面报道数>正面报道数(满足任一条件) // } else {
if (negativeCount > positiveCount) { // // 在正/中性事件中发布负面稿件||负面报道数>正面报道数(满足任一条件)
isNegative = true; // if (negativeCount > positiveCount) {
// 如果有在正面事件中发布负面稿件 // isNegative = true;
} else if (specNegativeCount > 0) { // // 如果有在正面事件中发布负面稿件
// 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64 // } else if (specNegativeCount > 0) {
if (positiveCount > negativeCount && positiveCount >= neutralCount // // 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64
&& (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) { // if (positiveCount > negativeCount && positiveCount >= neutralCount
isPositive = true; // && (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) {
} else { // isPositive = true;
isNegative = true; // } else {
} // isNegative = true;
} else { // }
// 在负面事件中发布过正面稿件即满足 // } else {
if (specPositiveCount > 0) { // // 在负面事件中发布过正面稿件即满足
isPositive = true; // if (specPositiveCount > 0) {
// 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64 // isPositive = true;
} else if (positiveCount > negativeCount && positiveCount >= neutralCount // // 或满足三者复合条件:发布正面稿件>负面稿件&&正面稿件>=中性稿件&&月均参与正面事件数≥4.64
&& (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) { // } else if (positiveCount > negativeCount && positiveCount >= neutralCount
isPositive = true; // && (this.inEventCountMonthAverage(channel, EmotionEnum.POSITIVE.getName()) >= 4.64)) {
} // isPositive = true;
} // }
} // }
// 更新渠道指数,渠道等级,情感倾向并记录变化 // }
this.updateChannel(channel, project, positiveCount, neutralCount, negativeCount, isPositive, isNegative, // // 更新渠道指数,渠道等级,情感倾向并记录变化
specPositiveCount, specNegativeCount); // this.updateChannel(channel, project, positiveCount, neutralCount, negativeCount, isPositive, isNegative,
} catch (Exception e) { // specPositiveCount, specNegativeCount);
log.error("calculateChannelEmotionIndex-", e); // } catch (Exception e) {
} // log.error("calculateChannelEmotionIndex-", e);
// }
return channel; return channel;
} }
......
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