Commit c9291125 by 陈健智

工具库-事件影响力更新调整

parent c1036fc1
...@@ -138,4 +138,10 @@ public class AppToolsetController { ...@@ -138,4 +138,10 @@ public class AppToolsetController {
public ResponseResult getIfUnread(){ public ResponseResult getIfUnread(){
return ResponseResult.success(toolsetService.getIfUnread()); return ResponseResult.success(toolsetService.getIfUnread());
} }
@ApiOperation("工具库-获取项目工具库功能显示列表")
@GetMapping("/show-list")
public ResponseResult getProjectToolsetShowList(){
return ResponseResult.success(toolsetService.getProjectToolsetShowList());
}
} }
...@@ -9,7 +9,7 @@ import org.springframework.data.mongodb.core.query.Query; ...@@ -9,7 +9,7 @@ import org.springframework.data.mongodb.core.query.Query;
* @author: cjz * @author: cjz
* @date: 2023-10-17 09:30 * @date: 2023-10-17 09:30
*/ */
public interface BytedanceCustomEventUpdateTaskDao extends BaseMongoDao<BytedanceCustomEventUpdateTask>{ public interface BytedanceCustomEventUpdateTaskDao extends BaseMongoDao<BytedanceCustomEventUpdateTask>{
BytedanceCustomEventUpdateTask findOne(Query query); BytedanceCustomEventUpdateTask findOne(Query query);
} }
package com.zhiwei.brandkbs2.dao;
import com.zhiwei.brandkbs2.pojo.BytedanceCustomEventUpdateTaskData;
/**
* @ClassName: BytedanceCustomEventUpdateTaskDataDao
* @Description BytedanceCustomEventUpdateTaskDataDao
* @author: cjz
* @date: 2023-10-24 13:30
*/
public interface BytedanceCustomEventUpdateTaskDataDao extends BaseMongoDao<BytedanceCustomEventUpdateTaskData> {
}
package com.zhiwei.brandkbs2.dao.impl;
import com.zhiwei.brandkbs2.dao.BytedanceCustomEventUpdateTaskDataDao;
import com.zhiwei.brandkbs2.pojo.BytedanceCustomEventUpdateTaskData;
import org.springframework.stereotype.Component;
/**
* @ClassName: BytedanceCustomEventUpdateTaskDataDaoImpl
* @Description BytedanceCustomEventUpdateTaskDataDaoImpl
* @author: cjz
* @date: 2023-10-24 13:31
*/
@Component("bytedanceCustomEventUpdateTaskDataDao")
public class BytedanceCustomEventUpdateTaskDataDaoImpl extends BaseMongoDaoImpl<BytedanceCustomEventUpdateTaskData> implements BytedanceCustomEventUpdateTaskDataDao {
private static final String COLLECTION_NAME = "brandkbs_bytedance_custom_event_task_data";
public BytedanceCustomEventUpdateTaskDataDaoImpl() {
super(COLLECTION_NAME);
}
}
...@@ -3,6 +3,8 @@ package com.zhiwei.brandkbs2.easyexcel.listener; ...@@ -3,6 +3,8 @@ package com.zhiwei.brandkbs2.easyexcel.listener;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.zhiwei.brandkbs2.easyexcel.dto.UploadBytedanceEventDTO; import com.zhiwei.brandkbs2.easyexcel.dto.UploadBytedanceEventDTO;
import com.zhiwei.brandkbs2.pojo.BytedanceCustomEventUpdateTaskData;
import com.zhiwei.brandkbs2.util.Tools;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -17,22 +19,30 @@ import java.util.Objects; ...@@ -17,22 +19,30 @@ import java.util.Objects;
*/ */
public class BytedanceEventListener extends AnalysisEventListener<UploadBytedanceEventDTO> { public class BytedanceEventListener extends AnalysisEventListener<UploadBytedanceEventDTO> {
private Map<String, List<UploadBytedanceEventDTO>> map; private String taskId;
private List<BytedanceCustomEventUpdateTaskData> data;
public BytedanceEventListener(Map<String, List<UploadBytedanceEventDTO>> map){
this.map = map; public BytedanceEventListener(String taskId, List<BytedanceCustomEventUpdateTaskData> data){
this.taskId = taskId;
this.data = data;
} }
@Override @Override
public void invoke(UploadBytedanceEventDTO data, AnalysisContext context) { public void invoke(UploadBytedanceEventDTO dto, AnalysisContext context) {
if (map.containsKey(data.getEventName())){ BytedanceCustomEventUpdateTaskData taskData = new BytedanceCustomEventUpdateTaskData();
map.get(data.getEventName()).add(data); taskData.setTaskId(taskId);
}else { taskData.setEventName(dto.getEventName());
List<UploadBytedanceEventDTO> list = new ArrayList<>(); taskData.setChannel(dto.getChannel());
list.add(data); taskData.setPlatform(dto.getPlatform());
map.put(data.getEventName(), list); taskData.setUrl(dto.getUrl());
} taskData.setWeiboComment(dto.getWeiboComment());
taskData.setWeiboForward(dto.getWeiboForward());
taskData.setWeiboLike(dto.getWeiboLike());
taskData.setWechatRead(dto.getWechatRead());
taskData.setWechatReading(dto.getWechatReading());
data.add(taskData);
} }
@Override @Override
......
...@@ -42,11 +42,11 @@ public class BytedanceCustomEventUpdateTask extends AbstractBaseMongo{ ...@@ -42,11 +42,11 @@ public class BytedanceCustomEventUpdateTask extends AbstractBaseMongo{
/** /**
* 事件数据 * 事件数据
*/ */
private Map<String, List<UploadBytedanceEventDTO>> eventData; // private Map<String, List<UploadBytedanceEventDTO>> eventData;
/** /**
* 报错数据 * 报错数据
*/ */
private List<UploadBytedanceEventDTO> errorData; private List<BytedanceCustomEventUpdateTaskData> errorData;
/** /**
* 竞品影响力指数 * 竞品影响力指数
*/ */
...@@ -136,7 +136,7 @@ public class BytedanceCustomEventUpdateTask extends AbstractBaseMongo{ ...@@ -136,7 +136,7 @@ public class BytedanceCustomEventUpdateTask extends AbstractBaseMongo{
task.setTaskStatus(TaskStatus.CALCULATING.getStatus()); task.setTaskStatus(TaskStatus.CALCULATING.getStatus());
task.setProcessStatus(ProcessStatus.CHANNEL_MATCH.getStatus()); task.setProcessStatus(ProcessStatus.CHANNEL_MATCH.getStatus());
task.setExtraCompute(extraCompute); task.setExtraCompute(extraCompute);
task.setEventInfo(null); task.setEventInfo(new ArrayList<>());
task.setErrorData(new ArrayList<>()); task.setErrorData(new ArrayList<>());
task.setCancel(false); task.setCancel(false);
task.setProjectId(UserThreadLocal.getProjectId()); task.setProjectId(UserThreadLocal.getProjectId());
......
package com.zhiwei.brandkbs2.pojo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @ClassName: BytedanceCustomEventInfluenceTask
* @Description 字节定制事件影响力计算rw
* @author: cjz
* @date: 2023-10-16 15:12
*/
@Getter
@Setter
@NoArgsConstructor
public class BytedanceCustomEventUpdateTaskData extends AbstractBaseMongo {
private String taskId;
private String platform;
private String channel;
private String url;
private String eventName;
private Integer weiboForward;
private Integer weiboComment;
private Integer weiboLike;
private Integer wechatRead;
private Integer wechatReading;
}
...@@ -123,9 +123,7 @@ public class Project extends AbstractProject { ...@@ -123,9 +123,7 @@ public class Project extends AbstractProject {
projectVO.setContendList(this.getContendList()); projectVO.setContendList(this.getContendList());
// 模块配置 // 模块配置
projectVO.setModuleShowList(this.getModuleShowList()); projectVO.setModuleShowList(this.getModuleShowList());
if (Objects.nonNull(this.getToolsetShowList())){ projectVO.setToolsetShowList(this.getToolsetShowList());
projectVO.setToolsetShowList(this.getToolsetShowList());
}
projectVO.setChannelFileUrl(this.getChannelFileUrl()); projectVO.setChannelFileUrl(this.getChannelFileUrl());
projectVO.setNegativeChannelParams(this.getNegativeChannelParams()); projectVO.setNegativeChannelParams(this.getNegativeChannelParams());
projectVO.setPositiveChannelParams(this.getPositiveChannelParams()); projectVO.setPositiveChannelParams(this.getPositiveChannelParams());
......
...@@ -100,7 +100,7 @@ public class ProjectVO { ...@@ -100,7 +100,7 @@ public class ProjectVO {
* 工具库功能入口展示列表(目前有:摘要提取,互动量更新,词云,字节影响力计算,其中前三者默认开启) * 工具库功能入口展示列表(目前有:摘要提取,互动量更新,词云,字节影响力计算,其中前三者默认开启)
*/ */
@ApiModelProperty("工具库功能入口展示列表(目前有:摘要提取,互动量更新,词云,字节影响力计算,其中前三者默认开启)") @ApiModelProperty("工具库功能入口展示列表(目前有:摘要提取,互动量更新,词云,字节影响力计算,其中前三者默认开启)")
private List<String> toolsetShowList = Arrays.asList("articleSummary", "interactionUpdate", "highWord"); private List<String> toolsetShowList;
/** /**
* 黑渠道对应组 * 黑渠道对应组
*/ */
......
...@@ -148,4 +148,10 @@ public interface ToolsetService { ...@@ -148,4 +148,10 @@ public interface ToolsetService {
* @param taskId 任务id * @param taskId 任务id
*/ */
void cancelTask(String taskId); void cancelTask(String taskId);
/**
* 获取项目工具库功能显示列表
* @return
*/
List<String> getProjectToolsetShowList();
} }
...@@ -443,27 +443,27 @@ public class ProjectServiceImpl implements ProjectService { ...@@ -443,27 +443,27 @@ public class ProjectServiceImpl implements ProjectService {
@Override @Override
public PageVO<JSONObject> getToolsetBytedanceCustomInfo(int page, int size, String type) { public PageVO<JSONObject> getToolsetBytedanceCustomInfo(int page, int size, String type) {
Query query = new Query(); Query query = new Query();
long channelTotal = bytedanceCustomChannelDao.count(query);
long channelWeightTotal = bytedanceCustomPlatformWeightDao.count(query);
long channelInfluenceTotal = bytedanceCustomChannelInfluenceDao.count(query);
query.limit(size); query.limit(size);
query.skip((long) (page - 1) * size); query.skip((long) (page - 1) * size);
switch (type){ switch (type){
case "重要媒体": case "重要媒体":
long total = bytedanceCustomChannelDao.count(query); return PageVO.createPageVo(channelTotal, page, size, bytedanceCustomChannelDao.findList(query).stream().map(data ->{
return PageVO.createPageVo(total, page, size, bytedanceCustomChannelDao.findList(query).stream().map(data ->{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("channel", data.getChannel()); jsonObject.put("channel", data.getChannel());
return jsonObject; return jsonObject;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
case "平台权重": case "平台权重":
long total2 = bytedanceCustomPlatformWeightDao.count(query); return PageVO.createPageVo(channelWeightTotal, page, size, bytedanceCustomPlatformWeightDao.findList(query).stream().map(data ->{
return PageVO.createPageVo(total2, page, size, bytedanceCustomPlatformWeightDao.findList(query).stream().map(data ->{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("type", data.getType()); jsonObject.put("type", data.getType());
jsonObject.put("weight", data.getWeight()); jsonObject.put("weight", data.getWeight());
return jsonObject; return jsonObject;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
case "渠道影响力": case "渠道影响力":
long total3 = bytedanceCustomChannelInfluenceDao.count(query); return PageVO.createPageVo(channelInfluenceTotal, page, size, bytedanceCustomChannelInfluenceDao.findList(query).stream().map(data ->{
return PageVO.createPageVo(total3, page, size, bytedanceCustomChannelInfluenceDao.findList(query).stream().map(data ->{
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("platform", data.getPlatform()); jsonObject.put("platform", data.getPlatform());
jsonObject.put("channel", data.getChannel()); jsonObject.put("channel", data.getChannel());
......
application.name = brandkbs2 application.name = brandkbs2
server.port=8888 server.port=8888
spring.flyway.encoding=UTF-8 spring.flyway.encoding=UTF-8
#\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-file-size=10MB
#\u603B\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-request-size=20MB
server.servlet.context-path=/brandkbs server.servlet.context-path=/brandkbs
#jwt #jwt
jwt.key=Token jwt.key=Token
......
application.name = brandkbs2 application.name = brandkbs2
server.port=8888 server.port=8888
spring.flyway.encoding=UTF-8 spring.flyway.encoding=UTF-8
#\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-file-size=10MB
#\u603B\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-request-size=20MB
server.servlet.context-path=/brandkbs server.servlet.context-path=/brandkbs
#jwt #jwt
jwt.key=Token jwt.key=Token
jwt.hour=120 jwt.hour=120
#\u8DEF\u5F84\u5B58\u653E #\u8DEF\u5F84\u5B58\u653E
brandkbs.file.url=E:\\work3\\brandkbs3\\ brandkbs.file.url=D:\\ExcelTest\\
brandkbs.img.url=E:\\work\\brandkbs2\\img\\ brandkbs.img.url=D:\\ExcelTest\\
brandkbs.head.url=E:\\work\\brandkbs2\\head\\ brandkbs.head.url=D:\\ExcelTest\\
brandkbs.image.url=https://brandkbs.zhiweidata.com/brandkbs/images/ brandkbs.image.url=https://brandkbs.zhiweidata.com/brandkbs/images/
#\u56FE\u7247\u8D44\u6E90\u8DEF\u5F84 #\u56FE\u7247\u8D44\u6E90\u8DEF\u5F84
cbs.imagesPath=file:${brandkbs.img.url},file:${brandkbs.head.url} cbs.imagesPath=file:${brandkbs.img.url},file:${brandkbs.head.url}
......
application.name = brandkbs2 application.name = brandkbs2
server.port=8888 server.port=8888
spring.flyway.encoding=UTF-8 spring.flyway.encoding=UTF-8
#\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-file-size=10MB
#\u603B\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u8BBE\u7F6E
spring.servlet.multipart.max-request-size=20MB
server.servlet.context-path=/brandkbs server.servlet.context-path=/brandkbs
#jwt #jwt
jwt.key=Token jwt.key=Token
......
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