Commit d961690e by shenjunjie

接口命名规范调整

parent 7d0bd200
...@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute; ...@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
import com.zhiwei.brandkbs2.model.CommonCodeEnum; import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.UserInfo; import com.zhiwei.brandkbs2.pojo.UserInfo;
import com.zhiwei.brandkbs2.service.IUserService; import com.zhiwei.brandkbs2.service.UserService;
import com.zhiwei.middleware.auth.util.JwtUtil; import com.zhiwei.middleware.auth.util.JwtUtil;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature; import org.aspectj.lang.Signature;
...@@ -40,7 +40,7 @@ public class AuthAspect { ...@@ -40,7 +40,7 @@ public class AuthAspect {
private String jwtKey; private String jwtKey;
@Resource(name = "userServiceImpl") @Resource(name = "userServiceImpl")
private IUserService iUserService; private UserService UserService;
@Pointcut("execution(com.zhiwei.brandkbs2.model.ResponseResult com.zhiwei.brandkbs2.controller..*.*(..))") @Pointcut("execution(com.zhiwei.brandkbs2.model.ResponseResult com.zhiwei.brandkbs2.controller..*.*(..))")
// @Pointcut("within(com.zhiwei.brandkbs2.controller..*)") // @Pointcut("within(com.zhiwei.brandkbs2.controller..*)")
...@@ -73,7 +73,7 @@ public class AuthAspect { ...@@ -73,7 +73,7 @@ public class AuthAspect {
return unAuthenticatedResponse(response, noAuth, joinPoint); return unAuthenticatedResponse(response, noAuth, joinPoint);
} }
String uid = tokenInfo.get(GenericAttribute.USER_ID).toString(); String uid = tokenInfo.get(GenericAttribute.USER_ID).toString();
UserInfo userInfo = iUserService.queryUserInfo(uid, request.getHeader("pid")); UserInfo userInfo = UserService.queryUserInfo(uid, request.getHeader("pid"));
if (!noAuth && null == userInfo) { if (!noAuth && null == userInfo) {
return unAuthoriseResponse(response); return unAuthoriseResponse(response);
} }
......
package com.zhiwei.brandkbs2.common; package com.zhiwei.brandkbs2.common;
import com.zhiwei.brandkbs2.service.ISystemInfoService; import com.zhiwei.brandkbs2.service.SystemInfoService;
import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform; import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform;
import com.zhiwei.qbjc.bean.pojo.common.Tag; import com.zhiwei.qbjc.bean.pojo.common.Tag;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -26,7 +26,7 @@ public class GlobalPojo { ...@@ -26,7 +26,7 @@ public class GlobalPojo {
public static final Logger log = LogManager.getLogger(GlobalPojo.class); public static final Logger log = LogManager.getLogger(GlobalPojo.class);
@Resource(name = "systemInfoServiceImpl") @Resource(name = "systemInfoServiceImpl")
private ISystemInfoService systemInfoService; private SystemInfoService systemInfoService;
/** /**
* 监测系统平台 * 监测系统平台
......
...@@ -8,6 +8,7 @@ package com.zhiwei.brandkbs2.config; ...@@ -8,6 +8,7 @@ package com.zhiwei.brandkbs2.config;
*/ */
public class Constant { public class Constant {
public static final String HOUR_PATTERN = "yyyy-MM-dd HH";
public static final String DAY_PATTERN = "yyyy-MM-dd"; public static final String DAY_PATTERN = "yyyy-MM-dd";
/** /**
......
...@@ -4,8 +4,9 @@ import com.zhiwei.brandkbs2.auth.Auth; ...@@ -4,8 +4,9 @@ import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO; import com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO;
import com.zhiwei.brandkbs2.service.IMarkDataService; import com.zhiwei.brandkbs2.service.CommonService;
import com.zhiwei.brandkbs2.service.IReportService; import com.zhiwei.brandkbs2.service.MarkDataService;
import com.zhiwei.brandkbs2.service.ReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -27,10 +28,13 @@ import javax.annotation.Resource; ...@@ -27,10 +28,13 @@ import javax.annotation.Resource;
public class AppArticleController extends BaseController { public class AppArticleController extends BaseController {
@Resource(name = "markDataServiceImpl") @Resource(name = "markDataServiceImpl")
IMarkDataService markDataService; MarkDataService markDataService;
@Resource(name = "reportServiceImpl") @Resource(name = "reportServiceImpl")
IReportService reportService; ReportService reportService;
@Resource(name = "commonServiceImpl")
CommonService commonService;
@ApiOperation("舆情列表") @ApiOperation("舆情列表")
@PostMapping("/mark/list") @PostMapping("/mark/list")
...@@ -62,7 +66,7 @@ public class AppArticleController extends BaseController { ...@@ -62,7 +66,7 @@ public class AppArticleController extends BaseController {
return ResponseResult.success(markDataService.getMarkSpread(startTime, endTime, true)); return ResponseResult.success(markDataService.getMarkSpread(startTime, endTime, true));
} }
@ApiOperation("舆情分析-平台曝光对比") @ApiOperation("舆情分析-品牌曝光对比")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "long") @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "long")
...@@ -102,12 +106,16 @@ public class AppArticleController extends BaseController { ...@@ -102,12 +106,16 @@ public class AppArticleController extends BaseController {
return ResponseResult.success(markDataService.getMarkHighWord(startTime, endTime)); return ResponseResult.success(markDataService.getMarkHighWord(startTime, endTime));
} }
@ApiOperation("舆情分析-获取默认时间")
@GetMapping("/default/time")
public ResponseResult getDefaultTime() {
return ResponseResult.success(commonService.getTimeRangeMonth());
}
@ApiOperation("舆情简报-分类统计") @ApiOperation("舆情简报-分类统计")
@GetMapping("/aggCount") @GetMapping("/aggCount")
public ResponseResult getReportsAggCount() { public ResponseResult getReportsAggCount() {
return ResponseResult.success(reportService.getReportsAggCount()); return ResponseResult.success(reportService.getReportsAggCount());
} }
} }
...@@ -3,8 +3,8 @@ package com.zhiwei.brandkbs2.controller; ...@@ -3,8 +3,8 @@ package com.zhiwei.brandkbs2.controller;
import com.zhiwei.brandkbs2.auth.Auth; import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.service.ICommonService; import com.zhiwei.brandkbs2.service.CommonService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.middleware.mark.pojo.enums.TagField; import com.zhiwei.middleware.mark.pojo.enums.TagField;
import com.zhiwei.middleware.mark.vo.MarkerTag; import com.zhiwei.middleware.mark.vo.MarkerTag;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -33,10 +33,10 @@ import java.util.stream.Collectors; ...@@ -33,10 +33,10 @@ import java.util.stream.Collectors;
public class CommonController extends BaseController { public class CommonController extends BaseController {
@Resource(name = "commonServiceImpl") @Resource(name = "commonServiceImpl")
ICommonService commonService; CommonService commonService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
IProjectService projectService; ProjectService projectService;
@ApiOperation("获取情感倾向标签信息") @ApiOperation("获取情感倾向标签信息")
@ApiImplicitParam(name = "linkedGroupId", value = "关联项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "linkedGroupId", value = "关联项目ID", required = true, paramType = "path", dataType = "string")
...@@ -67,4 +67,18 @@ public class CommonController extends BaseController { ...@@ -67,4 +67,18 @@ public class CommonController extends BaseController {
return ResponseResult.success(projectService.getUserAllProjects()); return ResponseResult.success(projectService.getUserAllProjects());
} }
// @ApiOperation("获取默认月间隔时间节点")
// @GetMapping("/time/month")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeMonth() {
// return ResponseResult.success(commonService.getTimeRangeMonth());
// }
//
// @ApiOperation("获取默认周间隔时间节点")
// @GetMapping("/time/week")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeWeek() {
// return ResponseResult.success(commonService.getTimeRangeWeek());
// }
} }
...@@ -5,8 +5,8 @@ import com.zhiwei.brandkbs2.auth.Auth; ...@@ -5,8 +5,8 @@ import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.auth.UserThreadLocal; import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.service.IUserService; import com.zhiwei.brandkbs2.service.UserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -36,15 +36,15 @@ public class LoginController extends BaseController { ...@@ -36,15 +36,15 @@ public class LoginController extends BaseController {
private int jwtHour; private int jwtHour;
@Resource(name = "userServiceImpl") @Resource(name = "userServiceImpl")
private IUserService iUserService; private UserService UserService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService iProjectService; private ProjectService ProjectService;
@ApiOperation("用户登录") @ApiOperation("用户登录")
@PostMapping("/user/login") @PostMapping("/user/login")
public ResponseResult login() { public ResponseResult login() {
return ResponseResult.success(iUserService.login().toMap()); return ResponseResult.success(UserService.login().toMap());
} }
@ApiOperation("用户信息获取") @ApiOperation("用户信息获取")
...@@ -59,7 +59,7 @@ public class LoginController extends BaseController { ...@@ -59,7 +59,7 @@ public class LoginController extends BaseController {
@ApiImplicitParam(name = "username", value = "用户名", required = false, paramType = "query", dataType = "string")) @ApiImplicitParam(name = "username", value = "用户名", required = false, paramType = "query", dataType = "string"))
@PostMapping("/user/bind/reset") @PostMapping("/user/bind/reset")
public ResponseResult resetBind(@RequestBody JSONObject json) { public ResponseResult resetBind(@RequestBody JSONObject json) {
iUserService.resetBind(json.getString("username")); UserService.resetBind(json.getString("username"));
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -71,25 +71,25 @@ public class LoginController extends BaseController { ...@@ -71,25 +71,25 @@ public class LoginController extends BaseController {
public ResponseResult bindUser(@RequestBody JSONObject json) { public ResponseResult bindUser(@RequestBody JSONObject json) {
String username = json.getString("username"); String username = json.getString("username");
String password = json.getString("password"); String password = json.getString("password");
return ResponseResult.success(iUserService.bindUser(username, password)); return ResponseResult.success(UserService.bindUser(username, password));
} }
@ApiOperation("跳过绑定(赋默认权限)") @ApiOperation("跳过绑定(赋默认权限)")
@PostMapping("/user/bind/skip") @PostMapping("/user/bind/skip")
public ResponseResult skipBindUser() { public ResponseResult skipBindUser() {
return ResponseResult.success(iUserService.skipBindUser()); return ResponseResult.success(UserService.skipBindUser());
} }
@ApiOperation("校验用户是否已有绑定关系") @ApiOperation("校验用户是否已有绑定关系")
@GetMapping("/user/login/checkBind") @GetMapping("/user/login/checkBind")
public ResponseResult checkBind() { public ResponseResult checkBind() {
return ResponseResult.success(iUserService.checkUserRoles()); return ResponseResult.success(UserService.checkUserRoles());
} }
@ApiOperation("获取当前用户拥有的所有项目(含过期)") @ApiOperation("获取当前用户拥有的所有项目(含过期)")
@GetMapping("/user/login/getUserAllProjects") @GetMapping("/user/login/getUserAllProjects")
public ResponseResult getLoginUserAllProjects() { public ResponseResult getLoginUserAllProjects() {
return ResponseResult.success(iProjectService.getLoginUserAllProjects()); return ResponseResult.success(ProjectService.getLoginUserAllProjects());
} }
@ApiOperation("测试接口") @ApiOperation("测试接口")
......
...@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.controller.BaseController; ...@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.Behavior; import com.zhiwei.brandkbs2.pojo.Behavior;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -55,10 +55,10 @@ public class ArticleController extends BaseController { ...@@ -55,10 +55,10 @@ public class ArticleController extends BaseController {
private RestTemplate restTemplate; private RestTemplate restTemplate;
@javax.annotation.Resource(name = "behaviorServiceImpl") @javax.annotation.Resource(name = "behaviorServiceImpl")
private IBehaviorService behaviorService; private BehaviorService behaviorService;
@javax.annotation.Resource(name = "projectServiceImpl") @javax.annotation.Resource(name = "projectServiceImpl")
private IProjectService projectService; private ProjectService projectService;
private static final Behavior.Operation OPERATION = new Behavior.Operation("稿件上传", true); private static final Behavior.Operation OPERATION = new Behavior.Operation("稿件上传", true);
......
...@@ -10,9 +10,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum; ...@@ -10,9 +10,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO; import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO;
import com.zhiwei.brandkbs2.pojo.vo.ProjectVO; import com.zhiwei.brandkbs2.pojo.vo.ProjectVO;
import com.zhiwei.brandkbs2.service.IHighWordService; import com.zhiwei.brandkbs2.service.HighWordService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.service.ITagFilterService; import com.zhiwei.brandkbs2.service.TagFilterService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -37,13 +37,13 @@ import java.util.List; ...@@ -37,13 +37,13 @@ import java.util.List;
public class BaseModuleController extends BaseController { public class BaseModuleController extends BaseController {
@Resource(name = "tagFilterServiceImpl") @Resource(name = "tagFilterServiceImpl")
ITagFilterService tagFilterService; TagFilterService tagFilterService;
@Resource(name = "highWordServiceImpl") @Resource(name = "highWordServiceImpl")
IHighWordService highWordService; HighWordService highWordService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
IProjectService projectService; ProjectService projectService;
@ApiOperation("获取在用筛选器列表") @ApiOperation("获取在用筛选器列表")
@GetMapping("/tagFilter") @GetMapping("/tagFilter")
......
...@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil; ...@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO; import com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -34,10 +34,10 @@ import java.util.List; ...@@ -34,10 +34,10 @@ import java.util.List;
public class BehaviorController extends BaseController { public class BehaviorController extends BaseController {
@Resource(name = "behaviorServiceImpl") @Resource(name = "behaviorServiceImpl")
private IBehaviorService behaviorService; private BehaviorService behaviorService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService iProjectService; private ProjectService ProjectService;
@ApiOperation("分页查询用户行为列表") @ApiOperation("分页查询用户行为列表")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -72,7 +72,7 @@ public class BehaviorController extends BaseController { ...@@ -72,7 +72,7 @@ public class BehaviorController extends BaseController {
@RequestParam(value = "behavior", defaultValue = "true") boolean behavior) { @RequestParam(value = "behavior", defaultValue = "true") boolean behavior) {
List<ExportBehaviorDTO> downloadList = behaviorService.download(startTime, endTime, behavior); List<ExportBehaviorDTO> downloadList = behaviorService.download(startTime, endTime, behavior);
String behaviorName = behavior ? "后台" : "前台"; String behaviorName = behavior ? "后台" : "前台";
String sheetName = iProjectService.getProjectVOById(UserThreadLocal.getProjectId()).getProjectName() + "_" + behaviorName; String sheetName = ProjectService.getProjectVOById(UserThreadLocal.getProjectId()).getProjectName() + "_" + behaviorName;
EasyExcelUtil.download(sheetName + "用户行为", sheetName, ExportBehaviorDTO.class, downloadList, response); EasyExcelUtil.download(sheetName + "用户行为", sheetName, ExportBehaviorDTO.class, downloadList, response);
return ResponseResult.success(); return ResponseResult.success();
} }
......
...@@ -12,8 +12,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum; ...@@ -12,8 +12,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.ChannelDTO; import com.zhiwei.brandkbs2.pojo.dto.ChannelDTO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.IChannelService; import com.zhiwei.brandkbs2.service.ChannelService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -41,10 +41,10 @@ import java.util.stream.Collectors; ...@@ -41,10 +41,10 @@ import java.util.stream.Collectors;
public class ChannelController extends BaseController { public class ChannelController extends BaseController {
@Resource(name = "channelServiceImpl") @Resource(name = "channelServiceImpl")
IChannelService channelService; ChannelService channelService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
IProjectService projectService; ProjectService projectService;
@Value("${brandkbs.img.url}") @Value("${brandkbs.img.url}")
private String brandkbsImgPath; private String brandkbsImgPath;
......
...@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.controller.BaseController; ...@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.Behavior; import com.zhiwei.brandkbs2.pojo.Behavior;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.service.ICustomTagService; import com.zhiwei.brandkbs2.service.CustomTagService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -33,10 +33,10 @@ import static com.alibaba.fastjson.JSON.parseArray; ...@@ -33,10 +33,10 @@ import static com.alibaba.fastjson.JSON.parseArray;
public class CustomTagController extends BaseController { public class CustomTagController extends BaseController {
@Resource(name = "customTagServiceImpl") @Resource(name = "customTagServiceImpl")
private ICustomTagService customTagService; private CustomTagService customTagService;
@Resource(name = "behaviorServiceImpl") @Resource(name = "behaviorServiceImpl")
private IBehaviorService behaviorService; private BehaviorService behaviorService;
private static final Behavior.Operation OPERATION = new Behavior.Operation("自定义标签管理", true); private static final Behavior.Operation OPERATION = new Behavior.Operation("自定义标签管理", true);
......
...@@ -11,9 +11,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum; ...@@ -11,9 +11,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.Behavior; import com.zhiwei.brandkbs2.pojo.Behavior;
import com.zhiwei.brandkbs2.pojo.vo.ProjectVO; import com.zhiwei.brandkbs2.pojo.vo.ProjectVO;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.service.ICommonService; import com.zhiwei.brandkbs2.service.CommonService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.mark.vo.MarkerTag; import com.zhiwei.middleware.mark.vo.MarkerTag;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -50,13 +50,13 @@ public class ProjectController extends BaseController { ...@@ -50,13 +50,13 @@ public class ProjectController extends BaseController {
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService iProjectService; private ProjectService ProjectService;
@Resource(name = "behaviorServiceImpl") @Resource(name = "behaviorServiceImpl")
private IBehaviorService behaviorService; private BehaviorService behaviorService;
@Resource(name = "commonServiceImpl") @Resource(name = "commonServiceImpl")
private ICommonService commonService; private CommonService commonService;
private static final Behavior.Operation OPERATION = new Behavior.Operation("项目管理", true); private static final Behavior.Operation OPERATION = new Behavior.Operation("项目管理", true);
...@@ -75,7 +75,7 @@ public class ProjectController extends BaseController { ...@@ -75,7 +75,7 @@ public class ProjectController extends BaseController {
@ApiOperation("添加项目配置") @ApiOperation("添加项目配置")
@PostMapping("/add") @PostMapping("/add")
public ResponseResult addProject(@RequestBody ProjectVO projectVO) { public ResponseResult addProject(@RequestBody ProjectVO projectVO) {
iProjectService.addProject(projectVO); ProjectService.addProject(projectVO);
behaviorService.pushBehavior(OPERATION, "添加项目配置:" + projectVO.getId(), request); behaviorService.pushBehavior(OPERATION, "添加项目配置:" + projectVO.getId(), request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -85,14 +85,14 @@ public class ProjectController extends BaseController { ...@@ -85,14 +85,14 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "size", value = "每页记录数", required = false, defaultValue = "10", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "keyword", value = "搜索关键字", required = false, defaultValue = "", paramType = "query", dataType = "string")}) @ApiImplicitParam(name = "size", value = "每页记录数", required = false, defaultValue = "10", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "keyword", value = "搜索关键字", required = false, defaultValue = "", paramType = "query", dataType = "string")})
@GetMapping("/list") @GetMapping("/list")
public ResponseResult findProjectList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam(value = "keyword", defaultValue = "") String keyword) { public ResponseResult findProjectList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam(value = "keyword", defaultValue = "") String keyword) {
return ResponseResult.success(iProjectService.findProjectList(page, size, keyword)); return ResponseResult.success(ProjectService.findProjectList(page, size, keyword));
} }
@ApiOperation("修改项目") @ApiOperation("修改项目")
@PutMapping("/update") @PutMapping("/update")
public ResponseResult updateProject(@RequestBody ProjectVO projectVO) { public ResponseResult updateProject(@RequestBody ProjectVO projectVO) {
iProjectService.updateProject(projectVO); ProjectService.updateProject(projectVO);
behaviorService.pushBehavior(OPERATION, "修改项目:" + projectVO.getId(), request); behaviorService.pushBehavior(OPERATION, "修改项目:" + projectVO.getId(), request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -101,7 +101,7 @@ public class ProjectController extends BaseController { ...@@ -101,7 +101,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string")
@DeleteMapping("/delete/{pid}") @DeleteMapping("/delete/{pid}")
public ResponseResult deleteProject(@PathVariable("pid") String pid) { public ResponseResult deleteProject(@PathVariable("pid") String pid) {
iProjectService.deleteProject(pid, UserThreadLocal.getProjectId()); ProjectService.deleteProject(pid, UserThreadLocal.getProjectId());
behaviorService.pushBehavior(OPERATION, "删除项目:" + pid, request); behaviorService.pushBehavior(OPERATION, "删除项目:" + pid, request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -110,7 +110,7 @@ public class ProjectController extends BaseController { ...@@ -110,7 +110,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string")
@PutMapping("/switch/projectShow/{pid}") @PutMapping("/switch/projectShow/{pid}")
public ResponseResult switchProjectShow(@PathVariable String pid) { public ResponseResult switchProjectShow(@PathVariable String pid) {
boolean result = iProjectService.switchProjectShow(pid); boolean result = ProjectService.switchProjectShow(pid);
if (result) { if (result) {
behaviorService.pushBehavior(OPERATION, "切换项目展示状态:" + pid, request); behaviorService.pushBehavior(OPERATION, "切换项目展示状态:" + pid, request);
return ResponseResult.success(); return ResponseResult.success();
...@@ -123,7 +123,7 @@ public class ProjectController extends BaseController { ...@@ -123,7 +123,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string")
@PutMapping("/switch/projectStart/{pid}") @PutMapping("/switch/projectStart/{pid}")
public ResponseResult switchProjectStart(@PathVariable String pid) { public ResponseResult switchProjectStart(@PathVariable String pid) {
iProjectService.switchProjectStart(pid); ProjectService.switchProjectStart(pid);
behaviorService.pushBehavior(OPERATION, "切换项目状态:" + pid, request); behaviorService.pushBehavior(OPERATION, "切换项目状态:" + pid, request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -132,7 +132,7 @@ public class ProjectController extends BaseController { ...@@ -132,7 +132,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string")
@GetMapping("/get/{pid}") @GetMapping("/get/{pid}")
public ResponseResult getProjectVOById(@PathVariable("pid") String pid) { public ResponseResult getProjectVOById(@PathVariable("pid") String pid) {
return ResponseResult.success(iProjectService.getProjectVOById(pid)); return ResponseResult.success(ProjectService.getProjectVOById(pid));
} }
@ApiOperation("图片上传") @ApiOperation("图片上传")
...@@ -153,7 +153,7 @@ public class ProjectController extends BaseController { ...@@ -153,7 +153,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string") @ApiImplicitParam(name = "pid", value = "项目ID", required = true, paramType = "path", dataType = "string")
@GetMapping("/download/keyword/{pid}") @GetMapping("/download/keyword/{pid}")
public ResponseResult downloadArticles(@PathVariable("pid") String pid) { public ResponseResult downloadArticles(@PathVariable("pid") String pid) {
ProjectVO project = iProjectService.getProjectVOById(pid); ProjectVO project = ProjectService.getProjectVOById(pid);
EasyExcelUtil.download(project.getBrandName() + "_命中关键词", "sheet1", UploadKeywordDTO.class, UploadKeywordDTO.change2This(project.getHitKeywords()), response); EasyExcelUtil.download(project.getBrandName() + "_命中关键词", "sheet1", UploadKeywordDTO.class, UploadKeywordDTO.change2This(project.getHitKeywords()), response);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -202,7 +202,7 @@ public class ProjectController extends BaseController { ...@@ -202,7 +202,7 @@ public class ProjectController extends BaseController {
@GetMapping("/user/getUserAllProjects") @GetMapping("/user/getUserAllProjects")
@Auth(role = RoleEnum.CUSTOMER) @Auth(role = RoleEnum.CUSTOMER)
public ResponseResult getUserAllProjects() { public ResponseResult getUserAllProjects() {
return ResponseResult.success(iProjectService.getUserAllProjects()); return ResponseResult.success(ProjectService.getUserAllProjects());
} }
} }
...@@ -4,7 +4,7 @@ import com.zhiwei.brandkbs2.auth.Auth; ...@@ -4,7 +4,7 @@ import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO; import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
import com.zhiwei.brandkbs2.service.IReportService; import com.zhiwei.brandkbs2.service.ReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -24,7 +24,7 @@ import javax.annotation.Resource; ...@@ -24,7 +24,7 @@ import javax.annotation.Resource;
public class ReportController { public class ReportController {
@Resource(name = "reportServiceImpl") @Resource(name = "reportServiceImpl")
private IReportService reportService; private ReportService reportService;
@ApiOperation("获取简报设置") @ApiOperation("获取简报设置")
......
...@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum; ...@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.Behavior; import com.zhiwei.brandkbs2.pojo.Behavior;
import com.zhiwei.brandkbs2.pojo.dto.UserDTO; import com.zhiwei.brandkbs2.pojo.dto.UserDTO;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.service.IUserService; import com.zhiwei.brandkbs2.service.UserService;
import com.zhiwei.middleware.auth.pojo.CenterUser; import com.zhiwei.middleware.auth.pojo.CenterUser;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -31,10 +31,10 @@ import javax.annotation.Resource; ...@@ -31,10 +31,10 @@ import javax.annotation.Resource;
public class UserController extends BaseController { public class UserController extends BaseController {
@Resource(name = "userServiceImpl") @Resource(name = "userServiceImpl")
private IUserService iUserService; private UserService UserService;
@Resource(name = "behaviorServiceImpl") @Resource(name = "behaviorServiceImpl")
private IBehaviorService behaviorService; private BehaviorService behaviorService;
private static final Behavior.Operation OPERATION = new Behavior.Operation("用户管理", true); private static final Behavior.Operation OPERATION = new Behavior.Operation("用户管理", true);
...@@ -55,7 +55,7 @@ public class UserController extends BaseController { ...@@ -55,7 +55,7 @@ public class UserController extends BaseController {
@RequestParam(value = "keyword", defaultValue = "") String keyword, @RequestParam(value = "keyword", defaultValue = "") String keyword,
@RequestParam(value = "pid") String pid, @RequestParam(value = "pid") String pid,
@RequestParam(value = "role", defaultValue = "-1") int role) { @RequestParam(value = "role", defaultValue = "-1") int role) {
return ResponseResult.success(iUserService.findUserList(page, size, keyword, pid, role)); return ResponseResult.success(UserService.findUserList(page, size, keyword, pid, role));
} }
@ApiOperation("根据手机号搜索用户信息") @ApiOperation("根据手机号搜索用户信息")
...@@ -77,7 +77,7 @@ public class UserController extends BaseController { ...@@ -77,7 +77,7 @@ public class UserController extends BaseController {
@ApiOperation("添加用户") @ApiOperation("添加用户")
@PostMapping("/add") @PostMapping("/add")
public ResponseResult addUser(@RequestBody UserDTO userDTO) { public ResponseResult addUser(@RequestBody UserDTO userDTO) {
iUserService.addUser(userDTO); UserService.addUser(userDTO);
behaviorService.pushBehavior(OPERATION, "添加用户:" + userDTO.getId(), request); behaviorService.pushBehavior(OPERATION, "添加用户:" + userDTO.getId(), request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -89,7 +89,7 @@ public class UserController extends BaseController { ...@@ -89,7 +89,7 @@ public class UserController extends BaseController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Auth(role = RoleEnum.ADMIN) @Auth(role = RoleEnum.ADMIN)
public ResponseResult deleteUser(@RequestParam(value = "uid") String userId, @RequestParam(value = "pid") String pid) { public ResponseResult deleteUser(@RequestParam(value = "uid") String userId, @RequestParam(value = "pid") String pid) {
iUserService.deleteUser(userId, pid); UserService.deleteUser(userId, pid);
behaviorService.pushBehavior(OPERATION, "删除用户:" + userId, request); behaviorService.pushBehavior(OPERATION, "删除用户:" + userId, request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -97,7 +97,7 @@ public class UserController extends BaseController { ...@@ -97,7 +97,7 @@ public class UserController extends BaseController {
@ApiOperation("编辑用户") @ApiOperation("编辑用户")
@PutMapping("/update") @PutMapping("/update")
public ResponseResult updateUser(@RequestBody UserDTO userDTO) { public ResponseResult updateUser(@RequestBody UserDTO userDTO) {
iUserService.updateUser(userDTO); UserService.updateUser(userDTO);
behaviorService.pushBehavior(OPERATION, "编辑用户:" + userDTO, request); behaviorService.pushBehavior(OPERATION, "编辑用户:" + userDTO, request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -113,14 +113,14 @@ public class UserController extends BaseController { ...@@ -113,14 +113,14 @@ public class UserController extends BaseController {
public ResponseResult findSuperAdminList(@RequestParam(value = "page", defaultValue = "1") int page, public ResponseResult findSuperAdminList(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "size", defaultValue = "10") int size, @RequestParam(value = "size", defaultValue = "10") int size,
@RequestParam(value = "keyword", defaultValue = "") String keyword) { @RequestParam(value = "keyword", defaultValue = "") String keyword) {
return ResponseResult.success(iUserService.findSuperAdminList(page, size, keyword)); return ResponseResult.success(UserService.findSuperAdminList(page, size, keyword));
} }
@ApiOperation("添加超级管理员") @ApiOperation("添加超级管理员")
@PostMapping("/add/superAdmin") @PostMapping("/add/superAdmin")
@Auth(role = RoleEnum.SUPER_ADMIN) @Auth(role = RoleEnum.SUPER_ADMIN)
public ResponseResult addSuperAdmin(@RequestBody UserDTO userDTO) { public ResponseResult addSuperAdmin(@RequestBody UserDTO userDTO) {
iUserService.addSuperAdmin(userDTO); UserService.addSuperAdmin(userDTO);
behaviorService.pushBehavior(OPERATION, "添加超级管理员:" + userDTO.getId(), request); behaviorService.pushBehavior(OPERATION, "添加超级管理员:" + userDTO.getId(), request);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -131,7 +131,7 @@ public class UserController extends BaseController { ...@@ -131,7 +131,7 @@ public class UserController extends BaseController {
@DeleteMapping("/delete/superAdmin") @DeleteMapping("/delete/superAdmin")
@Auth(role = RoleEnum.SUPER_ADMIN) @Auth(role = RoleEnum.SUPER_ADMIN)
public ResponseResult deleteSuperAdmin(@RequestParam(value = "uid") String userId) { public ResponseResult deleteSuperAdmin(@RequestParam(value = "uid") String userId) {
iUserService.deleteSuperAdmin(userId); UserService.deleteSuperAdmin(userId);
behaviorService.pushBehavior(OPERATION, "删除超级管理员:" + userId, request); behaviorService.pushBehavior(OPERATION, "删除超级管理员:" + userId, request);
return ResponseResult.success(); return ResponseResult.success();
} }
......
...@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.easyexcel.listener; ...@@ -3,7 +3,7 @@ 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.UploadEventDTO; import com.zhiwei.brandkbs2.easyexcel.dto.UploadEventDTO;
import com.zhiwei.brandkbs2.service.IEventService; import com.zhiwei.brandkbs2.service.EventService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -25,12 +25,12 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> { ...@@ -25,12 +25,12 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 储存解析数据集合 * 储存解析数据集合
*/ */
private final List<UploadEventDTO> datas = new ArrayList<>(BATCH_COUNT); private final List<UploadEventDTO> datas = new ArrayList<>(BATCH_COUNT);
private final IEventService iEventService; private final EventService EventService;
private final String projectId; private final String projectId;
private final String linkedGroupId; private final String linkedGroupId;
public EventFileListener(IEventService iEventService, String projectId, String linkedGroupId) { public EventFileListener(EventService EventService, String projectId, String linkedGroupId) {
this.iEventService = iEventService; this.EventService = EventService;
this.projectId = projectId; this.projectId = projectId;
this.linkedGroupId = linkedGroupId; this.linkedGroupId = linkedGroupId;
} }
...@@ -65,6 +65,6 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> { ...@@ -65,6 +65,6 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 保存更新事件信息逻辑 * 保存更新事件信息逻辑
*/ */
private void addFileEvent() { private void addFileEvent() {
datas.forEach(eventDTO -> iEventService.addFileEvent(projectId, linkedGroupId, eventDTO)); datas.forEach(eventDTO -> EventService.addFileEvent(projectId, linkedGroupId, eventDTO));
} }
} }
...@@ -37,6 +37,11 @@ public class MarkFlowEntity { ...@@ -37,6 +37,11 @@ public class MarkFlowEntity {
private JSONObject type; private JSONObject type;
/** /**
* 信息字段
*/
private JSONObject info;
/**
* 消息内容 * 消息内容
*/ */
private Object data; private Object data;
...@@ -82,6 +87,7 @@ public class MarkFlowEntity { ...@@ -82,6 +87,7 @@ public class MarkFlowEntity {
CompleteText completeText = CompleteText.restoreFromEs(tJson); CompleteText completeText = CompleteText.restoreFromEs(tJson);
this.type = FlowEntityUtil.getCompleteTextType(completeText); this.type = FlowEntityUtil.getCompleteTextType(completeText);
this.data = completeText; this.data = completeText;
this.info = createInfoWithEmotion(tJson);
break; break;
case INCOMPLETE: case INCOMPLETE:
if (!Tools.isEmpty(tJson.get("ind_full_text"))) { if (!Tools.isEmpty(tJson.get("ind_full_text"))) {
...@@ -90,6 +96,7 @@ public class MarkFlowEntity { ...@@ -90,6 +96,7 @@ public class MarkFlowEntity {
IncompleteText incompleteText = IncompleteText.restoreFromEs(tJson); IncompleteText incompleteText = IncompleteText.restoreFromEs(tJson);
this.type = FlowEntityUtil.getIncompleteTextType(incompleteText); this.type = FlowEntityUtil.getIncompleteTextType(incompleteText);
this.data = incompleteText; this.data = incompleteText;
this.info = createInfoWithEmotion(tJson);
break; break;
case QA: case QA:
if (!Tools.isEmpty(tJson.get("ind_full_text"))) { if (!Tools.isEmpty(tJson.get("ind_full_text"))) {
...@@ -104,6 +111,7 @@ public class MarkFlowEntity { ...@@ -104,6 +111,7 @@ public class MarkFlowEntity {
QAText qaText = QAText.restoreFromEs(tJson); QAText qaText = QAText.restoreFromEs(tJson);
this.type = FlowEntityUtil.getQaTextType(qaText); this.type = FlowEntityUtil.getQaTextType(qaText);
this.data = qaText; this.data = qaText;
this.info = createInfoWithEmotion(tJson);
break; break;
case VIDEO: case VIDEO:
if (!Tools.isEmpty(tJson.get("ind_full_text"))) { if (!Tools.isEmpty(tJson.get("ind_full_text"))) {
...@@ -115,10 +123,23 @@ public class MarkFlowEntity { ...@@ -115,10 +123,23 @@ public class MarkFlowEntity {
Video video = Video.restoreFromEs(tJson); Video video = Video.restoreFromEs(tJson);
this.type = FlowEntityUtil.getVideoType(video); this.type = FlowEntityUtil.getVideoType(video);
this.data = video; this.data = video;
this.info = createInfoWithEmotion(tJson);
break; break;
default: default:
break; break;
} }
} }
private JSONObject createInfoWithEmotion(JSONObject tJson) {
JSONObject info = new JSONObject();
String emotion = Tools.getEmotion(tJson);
if (null == emotion) {
info.put("hasTag", false);
return info;
}
info.put("hasTag", true);
info.put("showEmotion", emotion);
return info;
}
} }
...@@ -10,7 +10,7 @@ import java.util.Map; ...@@ -10,7 +10,7 @@ import java.util.Map;
/** /**
* @ClassName: EventSearchDto * @ClassName: EventSearchDto
* @Description TODO * @Description EventSearchDto
* @author: sjj * @author: sjj
* @date: 2022-05-20 14:07 * @date: 2022-05-20 14:07
*/ */
......
...@@ -9,12 +9,12 @@ import javax.servlet.http.HttpServletRequest; ...@@ -9,12 +9,12 @@ import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IBehaviorService * @ClassName: BehaviorService
* @Description 用户行为业务接口 * @Description 用户行为业务接口
* @author: sjj * @author: sjj
* @date: 2022-05-27 11:05 * @date: 2022-05-27 11:05
*/ */
public interface IBehaviorService { public interface BehaviorService {
/** /**
* 添加用户行为 * 添加用户行为
* *
......
...@@ -9,7 +9,7 @@ import com.zhiwei.brandkbs2.pojo.BrandkbsTask; ...@@ -9,7 +9,7 @@ import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
* @description 定时任务业务接口 * @description 定时任务业务接口
* @date 2019/12/12 13:58 * @date 2019/12/12 13:58
*/ */
public interface IBrandkbsTaskService { public interface BrandkbsTaskService {
/** /**
* 根据任务名称获取任务 * 根据任务名称获取任务
* *
......
...@@ -10,12 +10,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO; ...@@ -10,12 +10,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IChannelService * @ClassName: ChannelService
* @Description IChannelService * @Description ChannelService
* @author: sjj * @author: sjj
* @date: 2022-06-16 16:00 * @date: 2022-06-16 16:00
*/ */
public interface IChannelService { public interface ChannelService {
/** /**
* 根据搜索条件查询渠道列表 * 根据搜索条件查询渠道列表
......
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
* @author: sjj * @author: sjj
* @date: 2022-06-02 11:22 * @date: 2022-06-02 11:22
*/ */
public interface ICommonService { public interface CommonService {
/** /**
* 获取qbjcTags * 获取qbjcTags
...@@ -34,13 +34,20 @@ public interface ICommonService { ...@@ -34,13 +34,20 @@ public interface ICommonService {
/** /**
* 获取qbjcPlatform名称 * 获取qbjcPlatform名称
*
* @return 平台名称 * @return 平台名称
*/ */
List<String> getQbjcPlatformNames(); List<String> getQbjcPlatformNames();
/** /**
* 获取qbjcPlatform * 获取qbjcPlatform
*
* @return 平台 * @return 平台
*/ */
List<JSONObject> getQbjcPlatform(String... includeFields); List<JSONObject> getQbjcPlatform(String... includeFields);
Long[] getTimeRangeMonth();
Long[] getTimeRangeWeek();
} }
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
* @description 自定义标签业务接口 * @description 自定义标签业务接口
* @date 2022年3月24日15:20:16 * @date 2022年3月24日15:20:16
*/ */
public interface ICustomTagService { public interface CustomTagService {
/** /**
* 分页查询该项目所有自定义标签数据 * 分页查询该项目所有自定义标签数据
......
...@@ -3,12 +3,12 @@ package com.zhiwei.brandkbs2.service; ...@@ -3,12 +3,12 @@ package com.zhiwei.brandkbs2.service;
import com.zhiwei.brandkbs2.pojo.Event; import com.zhiwei.brandkbs2.pojo.Event;
/** /**
* @ClassName: IEventDataService * @ClassName: EventDataService
* @Description 事件数据业务接口抽象类 * @Description 事件数据业务接口抽象类
* @author: sjj * @author: sjj
* @date: 2022-05-23 17:48 * @date: 2022-05-23 17:48
*/ */
public interface IEventDataService { public interface EventDataService {
/** /**
* 更新事件数据 * 更新事件数据
......
...@@ -16,12 +16,12 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -16,12 +16,12 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IEventService * @ClassName: EventService
* @Description 事件管理业务接口 * @Description 事件管理业务接口
* @author: sjj * @author: sjj
* @date: 2022-05-17 16:32 * @date: 2022-05-17 16:32
*/ */
public interface IEventService { public interface EventService {
/** /**
* 根据事件id查询事件 * 根据事件id查询事件
......
...@@ -7,12 +7,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO; ...@@ -7,12 +7,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IHighWordService * @ClassName: HighWordService
* @Description 高频词服务接口 * @Description 高频词服务接口
* @author: sjj * @author: sjj
* @date: 2022-06-06 09:59 * @date: 2022-06-06 09:59
*/ */
public interface IHighWordService { public interface HighWordService {
/** /**
* 分页查询高频词列表 * 分页查询高频词列表
......
...@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO; ...@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IMarkDataService * @ClassName: MarkDataService
* @Description: 标注数据服务抽象类 * @Description: 标注数据服务抽象类
* @author: sjj * @author: sjj
* @date: 2022-06-28 14:04 * @date: 2022-06-28 14:04
*/ */
public interface IMarkDataService { public interface MarkDataService {
/** /**
* @param markSearchDTO 标注数据搜索传输类 * @param markSearchDTO 标注数据搜索传输类
......
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
* @description 项目业务接口 * @description 项目业务接口
* @date 2022年4月18日16:49:10 * @date 2022年4月18日16:49:10
*/ */
public interface IProjectService { public interface ProjectService {
/** /**
* 添加项目 * 添加项目
......
...@@ -6,12 +6,12 @@ import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO; ...@@ -6,12 +6,12 @@ import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
import java.util.Map; import java.util.Map;
/** /**
* @ClassName: IReportService * @ClassName: ReportService
* @Description 报告业务接口 * @Description 报告业务接口
* @author: sjj * @author: sjj
* @date: 2022-05-31 18:00 * @date: 2022-05-31 18:00
*/ */
public interface IReportService { public interface ReportService {
/** /**
* 获取项目报告配置信息 * 获取项目报告配置信息
......
...@@ -6,12 +6,12 @@ import com.zhiwei.qbjc.bean.pojo.common.Tag; ...@@ -6,12 +6,12 @@ import com.zhiwei.qbjc.bean.pojo.common.Tag;
import java.util.List; import java.util.List;
/** /**
* @ClassName: ISystemInfoService * @ClassName: SystemInfoService
* @Description 监测系统相关infoService * @Description 监测系统相关infoService
* @author: sjj * @author: sjj
* @date: 2022-06-16 14:19 * @date: 2022-06-16 14:19
*/ */
public interface ISystemInfoService { public interface SystemInfoService {
/** /**
* 获取监测系统Platforms * 获取监测系统Platforms
......
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
* @author: sjj * @author: sjj
* @date: 2022-06-01 13:40 * @date: 2022-06-01 13:40
*/ */
public interface ITagFilterService { public interface TagFilterService {
/** /**
* 获取在用筛选器列表 * 获取在用筛选器列表
......
package com.zhiwei.brandkbs2.service; package com.zhiwei.brandkbs2.service;
/** /**
* @ClassName: ITaskService * @ClassName: TaskService
* @Description 定时服务抽象类 * @Description 定时服务抽象类
* @author: sjj * @author: sjj
* @date: 2022-06-16 15:27 * @date: 2022-06-16 15:27
*/ */
public interface ITaskService{ public interface TaskService{
/** /**
* 渠道记录 * 渠道记录
......
...@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO; ...@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List; import java.util.List;
/** /**
* @ClassName: IUserService * @ClassName: UserService
* @Description 用户管理服务接口 * @Description 用户管理服务接口
* @author: sjj * @author: sjj
* @date: 2022-04-28 14:58 * @date: 2022-04-28 14:58
*/ */
public interface IUserService { public interface UserService {
/** /**
* 用户登录 * 用户登录
......
...@@ -11,7 +11,7 @@ import com.zhiwei.brandkbs2.pojo.User; ...@@ -11,7 +11,7 @@ import com.zhiwei.brandkbs2.pojo.User;
import com.zhiwei.brandkbs2.pojo.UserRole; import com.zhiwei.brandkbs2.pojo.UserRole;
import com.zhiwei.brandkbs2.pojo.vo.BehaviorVO; import com.zhiwei.brandkbs2.pojo.vo.BehaviorVO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.IBehaviorService; import com.zhiwei.brandkbs2.service.BehaviorService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -39,7 +39,7 @@ import java.util.stream.Collectors; ...@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-27 13:41 * @date: 2022-05-27 13:41
*/ */
@Service("behaviorServiceImpl") @Service("behaviorServiceImpl")
public class BehaviorServiceImpl implements IBehaviorService { public class BehaviorServiceImpl implements BehaviorService {
public static final Logger log = LogManager.getLogger(BehaviorServiceImpl.class); public static final Logger log = LogManager.getLogger(BehaviorServiceImpl.class);
@Resource(name = "behaviorDao") @Resource(name = "behaviorDao")
......
...@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl; ...@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
import com.zhiwei.brandkbs2.config.Constant; import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.dao.IBrandkbsTaskDao; import com.zhiwei.brandkbs2.dao.IBrandkbsTaskDao;
import com.zhiwei.brandkbs2.pojo.BrandkbsTask; import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
import com.zhiwei.brandkbs2.service.IBrandkbsTaskService; import com.zhiwei.brandkbs2.service.BrandkbsTaskService;
import org.springframework.data.mongodb.core.query.Update; import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -17,7 +17,7 @@ import java.util.Objects; ...@@ -17,7 +17,7 @@ import java.util.Objects;
* @date: 2022-07-12 17:38 * @date: 2022-07-12 17:38
*/ */
@Service @Service
public class BrandkbsTaskServiceImpl implements IBrandkbsTaskService { public class BrandkbsTaskServiceImpl implements BrandkbsTaskService {
@Resource(name = "brandkbsTaskDao") @Resource(name = "brandkbsTaskDao")
private IBrandkbsTaskDao brandkbsTaskDao; private IBrandkbsTaskDao brandkbsTaskDao;
......
...@@ -16,7 +16,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum; ...@@ -16,7 +16,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.pojo.*; import com.zhiwei.brandkbs2.pojo.*;
import com.zhiwei.brandkbs2.pojo.dto.ChannelDTO; import com.zhiwei.brandkbs2.pojo.dto.ChannelDTO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.IChannelService; import com.zhiwei.brandkbs2.service.ChannelService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -38,7 +38,7 @@ import java.util.stream.Collectors; ...@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-16 16:07 * @date: 2022-06-16 16:07
*/ */
@Service("channelServiceImpl") @Service("channelServiceImpl")
public class ChannelServiceImpl implements IChannelService { public class ChannelServiceImpl implements ChannelService {
@Resource(name = "eventDataDao") @Resource(name = "eventDataDao")
IEventDataDao eventDataDao; IEventDataDao eventDataDao;
......
package com.zhiwei.brandkbs2.service.impl; package com.zhiwei.brandkbs2.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.service.ICommonService; import com.zhiwei.brandkbs2.common.GenericAttribute;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.service.CommonService;
import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.mark.pojo.enums.TagField; import com.zhiwei.middleware.mark.pojo.enums.TagField;
import com.zhiwei.middleware.mark.service.MarkerClient; import com.zhiwei.middleware.mark.service.MarkerClient;
import com.zhiwei.middleware.mark.vo.MarkerTag; import com.zhiwei.middleware.mark.vo.MarkerTag;
import com.zhiwei.middleware.mark.vo.TagSearch; import com.zhiwei.middleware.mark.vo.TagSearch;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
...@@ -14,10 +18,7 @@ import org.springframework.stereotype.Service; ...@@ -14,10 +18,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -27,13 +28,13 @@ import java.util.stream.Collectors; ...@@ -27,13 +28,13 @@ import java.util.stream.Collectors;
* @date: 2022-06-02 11:23 * @date: 2022-06-02 11:23
*/ */
@Service("commonServiceImpl") @Service("commonServiceImpl")
public class CommonServiceImpl implements ICommonService { public class CommonServiceImpl implements CommonService {
@Value("${qbjc.platform.url}") @Value("${qbjc.platform.url}")
private String qbjcPlatformUrl; private String qbjcPlatformUrl;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService projectService; private ProjectService projectService;
@Autowired @Autowired
private MarkerClient markClient; private MarkerClient markClient;
...@@ -71,8 +72,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -71,8 +72,7 @@ public class CommonServiceImpl implements ICommonService {
@Override @Override
public List<String> getQbjcPlatformNames() { public List<String> getQbjcPlatformNames() {
HttpEntity<JSONObject> entity = restTemplate.getForEntity(qbjcPlatformUrl, JSONObject.class); HttpEntity<JSONObject> entity = restTemplate.getForEntity(qbjcPlatformUrl, JSONObject.class);
return Objects.requireNonNull(entity.getBody()).getJSONArray("data").toJavaList(JSONObject.class).stream().map(json -> json.getString("name")) return Objects.requireNonNull(entity.getBody()).getJSONArray("data").toJavaList(JSONObject.class).stream().map(json -> json.getString("name")).collect(Collectors.toList());
.collect(Collectors.toList());
} }
@Override @Override
...@@ -90,4 +90,18 @@ public class CommonServiceImpl implements ICommonService { ...@@ -90,4 +90,18 @@ public class CommonServiceImpl implements ICommonService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public Long[] getTimeRangeMonth() {
long endTime = DateUtils.addDays(Tools.truncDate(new Date(), Constant.DAY_PATTERN), 1).getTime();
long startTime = DateUtils.addMonths(new Date(endTime), -1).getTime();
return new Long[]{startTime, endTime};
}
@Override
public Long[] getTimeRangeWeek() {
long endTime = DateUtils.addDays(Tools.truncDate(new Date(), Constant.DAY_PATTERN), 1).getTime();
long startTime = DateUtils.addWeeks(new Date(endTime), -1).getTime();
return new Long[]{startTime, endTime};
}
} }
...@@ -10,7 +10,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum; ...@@ -10,7 +10,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.pojo.CustomTag; import com.zhiwei.brandkbs2.pojo.CustomTag;
import com.zhiwei.brandkbs2.pojo.vo.CustomTagVo; import com.zhiwei.brandkbs2.pojo.vo.CustomTagVo;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.ICustomTagService; import com.zhiwei.brandkbs2.service.CustomTagService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.action.update.UpdateRequest;
...@@ -30,7 +30,7 @@ import java.util.stream.Collectors; ...@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
* @date 2022年3月24日18:22:53 * @date 2022年3月24日18:22:53
*/ */
@Service @Service
public class CustomTagServiceImpl implements ICustomTagService { public class CustomTagServiceImpl implements CustomTagService {
@Resource(name = "customTagDao") @Resource(name = "customTagDao")
private ICustomTagDao customTagDao; private ICustomTagDao customTagDao;
......
...@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.dao.IEventDataDao; ...@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.dao.IEventDataDao;
import com.zhiwei.brandkbs2.es.EsClientDao; import com.zhiwei.brandkbs2.es.EsClientDao;
import com.zhiwei.brandkbs2.pojo.Event; import com.zhiwei.brandkbs2.pojo.Event;
import com.zhiwei.brandkbs2.pojo.EventData; import com.zhiwei.brandkbs2.pojo.EventData;
import com.zhiwei.brandkbs2.service.IEventDataService; import com.zhiwei.brandkbs2.service.EventDataService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -25,7 +25,7 @@ import java.util.stream.Collectors; ...@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-23 17:49 * @date: 2022-05-23 17:49
*/ */
@Service("eventDataServiceImpl") @Service("eventDataServiceImpl")
public class EventDataServiceImpl implements IEventDataService { public class EventDataServiceImpl implements EventDataService {
public static final Logger log = LogManager.getLogger(EventDataServiceImpl.class); public static final Logger log = LogManager.getLogger(EventDataServiceImpl.class);
@Resource(name = "eventDao") @Resource(name = "eventDao")
......
...@@ -26,9 +26,9 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO; ...@@ -26,9 +26,9 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
import com.zhiwei.brandkbs2.pojo.vo.EventVO; import com.zhiwei.brandkbs2.pojo.vo.EventVO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO; import com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO;
import com.zhiwei.brandkbs2.service.IEventDataService; import com.zhiwei.brandkbs2.service.EventDataService;
import com.zhiwei.brandkbs2.service.IEventService; import com.zhiwei.brandkbs2.service.EventService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -62,7 +62,7 @@ import java.util.stream.Collectors; ...@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-17 16:36 * @date: 2022-05-17 16:36
*/ */
@Service("eventServiceImpl") @Service("eventServiceImpl")
public class EventServiceImpl implements IEventService { public class EventServiceImpl implements EventService {
private static final Logger log = LogManager.getLogger(EventServiceImpl.class); private static final Logger log = LogManager.getLogger(EventServiceImpl.class);
@Value("${qbjc.event.tag.url}") @Value("${qbjc.event.tag.url}")
...@@ -81,10 +81,10 @@ public class EventServiceImpl implements IEventService { ...@@ -81,10 +81,10 @@ public class EventServiceImpl implements IEventService {
private IEventDataDao eventDataDao; private IEventDataDao eventDataDao;
@Resource(name = "eventDataServiceImpl") @Resource(name = "eventDataServiceImpl")
private IEventDataService eventDataService; private EventDataService eventDataService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService projectService; private ProjectService projectService;
@Resource(name = "mongoUtil") @Resource(name = "mongoUtil")
private com.zhiwei.brandkbs2.util.MongoUtil mongoUtil; private com.zhiwei.brandkbs2.util.MongoUtil mongoUtil;
......
...@@ -6,7 +6,7 @@ import com.zhiwei.brandkbs2.dao.IHighWordDao; ...@@ -6,7 +6,7 @@ import com.zhiwei.brandkbs2.dao.IHighWordDao;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO; import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO;
import com.zhiwei.brandkbs2.pojo.HighWord; import com.zhiwei.brandkbs2.pojo.HighWord;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.IHighWordService; import com.zhiwei.brandkbs2.service.HighWordService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
...@@ -23,7 +23,7 @@ import java.util.stream.Collectors; ...@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-06 10:02 * @date: 2022-06-06 10:02
*/ */
@Service("highWordServiceImpl") @Service("highWordServiceImpl")
public class HighWordServiceImpl implements IHighWordService { public class HighWordServiceImpl implements HighWordService {
@Resource(name = "highWordDao") @Resource(name = "highWordDao")
IHighWordDao highWordDao; IHighWordDao highWordDao;
......
...@@ -13,7 +13,7 @@ import com.zhiwei.brandkbs2.pojo.Project; ...@@ -13,7 +13,7 @@ import com.zhiwei.brandkbs2.pojo.Project;
import com.zhiwei.brandkbs2.pojo.User; import com.zhiwei.brandkbs2.pojo.User;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.pojo.vo.ProjectVO; import com.zhiwei.brandkbs2.pojo.vo.ProjectVO;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -32,7 +32,7 @@ import java.util.stream.Collectors; ...@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
* @date 2022年4月18日16:49:10 * @date 2022年4月18日16:49:10
*/ */
@Service("projectServiceImpl") @Service("projectServiceImpl")
public class ProjectServiceImpl implements IProjectService { public class ProjectServiceImpl implements ProjectService {
@Resource(name = "userDao") @Resource(name = "userDao")
private IUserDao userDao; private IUserDao userDao;
...@@ -62,7 +62,7 @@ public class ProjectServiceImpl implements IProjectService { ...@@ -62,7 +62,7 @@ public class ProjectServiceImpl implements IProjectService {
} }
//给超管添加该项目权限,并且初始化预警推送 TODO //给超管添加该项目权限,并且初始化预警推送 TODO
// for (Integer SUPER_ADMINUid : userMapper.getAllSUPER_ADMINUids()) { // for (Integer SUPER_ADMINUid : userMapper.getAllSUPER_ADMINUids()) {
// iUserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId()); // UserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId());
// } // }
projectDao.insertOneWithoutId(projectVO.creatProject(new Date())); projectDao.insertOneWithoutId(projectVO.creatProject(new Date()));
} }
......
...@@ -9,8 +9,8 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast; ...@@ -9,8 +9,8 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
import com.zhiwei.brandkbs2.model.CommonCodeEnum; import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.pojo.ReportSettings; import com.zhiwei.brandkbs2.pojo.ReportSettings;
import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO; import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.service.IReportService; import com.zhiwei.brandkbs2.service.ReportService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -31,7 +31,7 @@ import java.util.stream.Collectors; ...@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-31 18:01 * @date: 2022-05-31 18:01
*/ */
@Service("reportServiceImpl") @Service("reportServiceImpl")
public class ReportServiceImpl implements IReportService { public class ReportServiceImpl implements ReportService {
public static final Logger log = LogManager.getLogger(ReportServiceImpl.class); public static final Logger log = LogManager.getLogger(ReportServiceImpl.class);
@Resource(name = "reportDao") @Resource(name = "reportDao")
...@@ -41,7 +41,7 @@ public class ReportServiceImpl implements IReportService { ...@@ -41,7 +41,7 @@ public class ReportServiceImpl implements IReportService {
IReportSettingsDao reportSettingsDao; IReportSettingsDao reportSettingsDao;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
IProjectService projectService; ProjectService projectService;
@Override @Override
public Map<String, ReportSettingsDTO> getReportSettings() { public Map<String, ReportSettingsDTO> getReportSettings() {
......
package com.zhiwei.brandkbs2.service.impl; package com.zhiwei.brandkbs2.service.impl;
import com.zhiwei.brandkbs2.dao.IQbjcPojoDao; import com.zhiwei.brandkbs2.dao.IQbjcPojoDao;
import com.zhiwei.brandkbs2.service.ISystemInfoService; import com.zhiwei.brandkbs2.service.SystemInfoService;
import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform; import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform;
import com.zhiwei.qbjc.bean.pojo.common.Tag; import com.zhiwei.qbjc.bean.pojo.common.Tag;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -10,13 +10,13 @@ import javax.annotation.Resource; ...@@ -10,13 +10,13 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
* @ClassName: ISystemInfoServiceImpl * @ClassName: SystemInfoServiceImpl
* @Description ISystemInfoServiceImpl * @Description SystemInfoServiceImpl
* @author: sjj * @author: sjj
* @date: 2022-06-16 14:21 * @date: 2022-06-16 14:21
*/ */
@Service("systemInfoServiceImpl") @Service("systemInfoServiceImpl")
public class SystemInfoServiceImpl implements ISystemInfoService { public class SystemInfoServiceImpl implements SystemInfoService {
@Resource(name = "qbjcPojoDao") @Resource(name = "qbjcPojoDao")
private IQbjcPojoDao qbjcPojoDao; private IQbjcPojoDao qbjcPojoDao;
......
...@@ -4,12 +4,11 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal; ...@@ -4,12 +4,11 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.dao.ITagFilterDao; import com.zhiwei.brandkbs2.dao.ITagFilterDao;
import com.zhiwei.brandkbs2.pojo.TagFilter; import com.zhiwei.brandkbs2.pojo.TagFilter;
import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO; import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO;
import com.zhiwei.brandkbs2.service.ICommonService; import com.zhiwei.brandkbs2.service.CommonService;
import com.zhiwei.brandkbs2.service.IProjectService; import com.zhiwei.brandkbs2.service.TagFilterService;
import com.zhiwei.brandkbs2.service.ITagFilterService; import com.zhiwei.brandkbs2.service.ProjectService;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -24,16 +23,16 @@ import java.util.stream.Collectors; ...@@ -24,16 +23,16 @@ import java.util.stream.Collectors;
* @date: 2022-06-01 13:40 * @date: 2022-06-01 13:40
*/ */
@Service("tagFilterServiceImpl") @Service("tagFilterServiceImpl")
public class TagFilterServiceImpl implements ITagFilterService { public class TagFilterServiceImpl implements TagFilterService {
@Resource(name = "tagFilterDao") @Resource(name = "tagFilterDao")
private ITagFilterDao tagFilterDao; private ITagFilterDao tagFilterDao;
@Resource(name = "commonServiceImpl") @Resource(name = "commonServiceImpl")
private ICommonService commonService; private CommonService commonService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
private IProjectService projectService; private ProjectService projectService;
@Override @Override
public List<TagFilterDTO> getTagFilter() { public List<TagFilterDTO> getTagFilter() {
......
...@@ -8,7 +8,7 @@ import com.zhiwei.brandkbs2.es.EsClientDao; ...@@ -8,7 +8,7 @@ import com.zhiwei.brandkbs2.es.EsClientDao;
import com.zhiwei.brandkbs2.pojo.BrandkbsTask; import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
import com.zhiwei.brandkbs2.pojo.Channel; import com.zhiwei.brandkbs2.pojo.Channel;
import com.zhiwei.brandkbs2.pojo.ChannelIndex; import com.zhiwei.brandkbs2.pojo.ChannelIndex;
import com.zhiwei.brandkbs2.service.ITaskService; import com.zhiwei.brandkbs2.service.TaskService;
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.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -25,7 +25,7 @@ import java.util.Map; ...@@ -25,7 +25,7 @@ import java.util.Map;
* @date: 2022-06-16 15:28 * @date: 2022-06-16 15:28
*/ */
@Service("taskServiceImpl") @Service("taskServiceImpl")
public class TaskServiceImpl implements ITaskService { public class TaskServiceImpl implements TaskService {
public static final Logger log = LogManager.getLogger(TaskServiceImpl.class); public static final Logger log = LogManager.getLogger(TaskServiceImpl.class);
@Resource(name = "esClientDao") @Resource(name = "esClientDao")
...@@ -66,5 +66,8 @@ public class TaskServiceImpl implements ITaskService { ...@@ -66,5 +66,8 @@ public class TaskServiceImpl implements ITaskService {
public void reportSend() { public void reportSend() {
Date now = new Date(); Date now = new Date();
BrandkbsTask task = brandkbsTaskDao.findTaskByTaskNameAndVersion(Constant.TASK_REPORT_JOB, Constant.INIT_VERSION); BrandkbsTask task = brandkbsTaskDao.findTaskByTaskNameAndVersion(Constant.TASK_REPORT_JOB, Constant.INIT_VERSION);
} }
} }
...@@ -14,7 +14,7 @@ import com.zhiwei.brandkbs2.pojo.UserInfo; ...@@ -14,7 +14,7 @@ import com.zhiwei.brandkbs2.pojo.UserInfo;
import com.zhiwei.brandkbs2.pojo.UserRole; import com.zhiwei.brandkbs2.pojo.UserRole;
import com.zhiwei.brandkbs2.pojo.dto.UserDTO; import com.zhiwei.brandkbs2.pojo.dto.UserDTO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.IUserService; import com.zhiwei.brandkbs2.service.UserService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import com.zhiwei.middleware.auth.pojo.CenterUser; import com.zhiwei.middleware.auth.pojo.CenterUser;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -36,7 +36,7 @@ import java.util.stream.Collectors; ...@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
* @date: 2022-04-28 17:34 * @date: 2022-04-28 17:34
*/ */
@Service("userServiceImpl") @Service("userServiceImpl")
public class UserServiceImpl implements IUserService { public class UserServiceImpl implements UserService {
@Resource(name = "userDao") @Resource(name = "userDao")
private IUserDao userDao; private IUserDao userDao;
......
package com.zhiwei.brandkbs2.task; package com.zhiwei.brandkbs2.task;
import com.zhiwei.brandkbs2.service.ITaskService; import com.zhiwei.brandkbs2.service.TaskService;
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.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
...@@ -22,7 +22,7 @@ public class ControlCenter { ...@@ -22,7 +22,7 @@ public class ControlCenter {
public static final Logger log = LogManager.getLogger(ControlCenter.class); public static final Logger log = LogManager.getLogger(ControlCenter.class);
@Resource(name = "taskServiceImpl") @Resource(name = "taskServiceImpl")
private ITaskService taskService; private TaskService taskService;
@Async("scheduledExecutor") @Async("scheduledExecutor")
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 0 1 * * ?")
......
...@@ -20,6 +20,7 @@ import com.zhiwei.qbjc.bean.tools.BeanTools; ...@@ -20,6 +20,7 @@ import com.zhiwei.qbjc.bean.tools.BeanTools;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.time.FastDateFormat;
import org.dozer.DozerBeanMapper; import org.dozer.DozerBeanMapper;
import org.springframework.data.mapping.MappingException; import org.springframework.data.mapping.MappingException;
...@@ -39,6 +40,8 @@ import java.util.stream.Collectors; ...@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.zhiwei.brandkbs2.common.GenericAttribute.ES_MARK_CACHE_MAPS; import static com.zhiwei.brandkbs2.common.GenericAttribute.ES_MARK_CACHE_MAPS;
import static com.zhiwei.brandkbs2.config.Constant.DAY_PATTERN;
import static com.zhiwei.brandkbs2.config.Constant.HOUR_PATTERN;
import static java.util.Objects.nonNull; import static java.util.Objects.nonNull;
/** /**
...@@ -516,4 +519,28 @@ public class Tools { ...@@ -516,4 +519,28 @@ public class Tools {
return result; return result;
} }
public static Long[] formatTimeRange(Long startTime, Long endTime) {
if (Objects.isNull(startTime) || Objects.isNull(endTime)) {
endTime = DateUtils.addDays(Tools.truncDate(new Date(), DAY_PATTERN), 1).getTime();
startTime = DateUtils.addMonths(new Date(endTime), -1).getTime();
} else {
startTime = Tools.truncDate(new Date(startTime), HOUR_PATTERN).getTime();
endTime = Tools.truncDate(new Date(endTime), HOUR_PATTERN).getTime();
}
return new Long[]{startTime, endTime};
}
public String getEmotionByEsMarkMap(Map<String, Object> map) {
List<JSONObject> cacheMaps = (List<JSONObject>) map.get(GenericAttribute.ES_MARK_CACHE_MAPS);
if (null == cacheMaps) {
return null;
}
for (JSONObject json : cacheMaps) {
if (Constant.EMOTION_LABEL_KEY.equals(json.getString("group_name"))) {
return json.getString("name");
}
}
return null;
}
} }
\ No newline at end of file
package com.zhiwei.brandkbs2; package com.zhiwei.brandkbs2;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.controller.AppArticleController;
import com.zhiwei.brandkbs2.dao.IChannelLabelDao; import com.zhiwei.brandkbs2.dao.IChannelLabelDao;
import com.zhiwei.brandkbs2.dao.IEventDataDao; import com.zhiwei.brandkbs2.dao.IEventDataDao;
import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.ChannelIndex; import com.zhiwei.brandkbs2.pojo.ChannelIndex;
import com.zhiwei.brandkbs2.service.ITaskService; import com.zhiwei.brandkbs2.pojo.UserInfo;
import com.zhiwei.brandkbs2.service.TaskService;
import com.zhiwei.brandkbs2.util.TextUtil; import com.zhiwei.brandkbs2.util.TextUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.junit.Test; import org.junit.Test;
...@@ -18,7 +22,7 @@ import java.util.List; ...@@ -18,7 +22,7 @@ import java.util.List;
/** /**
* @ClassName: TestRunWith * @ClassName: TestRunWith
* @Description TODO * @Description TestRunWith
* @author: sjj * @author: sjj
* @date: 2022-06-16 16:27 * @date: 2022-06-16 16:27
*/ */
...@@ -28,7 +32,7 @@ import java.util.List; ...@@ -28,7 +32,7 @@ import java.util.List;
public class TestRunWith { public class TestRunWith {
@Autowired @Autowired
ITaskService iTaskService; TaskService TaskService;
@Autowired @Autowired
IEventDataDao eventDataDao; IEventDataDao eventDataDao;
...@@ -39,13 +43,20 @@ public class TestRunWith { ...@@ -39,13 +43,20 @@ public class TestRunWith {
@Autowired @Autowired
TextUtil textUtil; TextUtil textUtil;
@Autowired
AppArticleController appArticleController;
@Test @Test
public void test1(){ public void test1() {
iTaskService.messageFlowCount(1); UserInfo userInfo = new UserInfo();
userInfo.setProjectId("62beadd1bbf8eb20f96d2f2f");
UserThreadLocal.set(userInfo);
ResponseResult result = appArticleController.getMarkSpread(1657468800000L, 1657555200000L);
System.out.println(JSONObject.toJSONString(result));
} }
@Test @Test
public void test2(){ public void test2() {
ChannelIndex channelIndex = new ChannelIndex(); ChannelIndex channelIndex = new ChannelIndex();
channelIndex.setPlatform("微信"); channelIndex.setPlatform("微信");
channelIndex.setRealSource("微信公众号"); channelIndex.setRealSource("微信公众号");
...@@ -55,16 +66,16 @@ public class TestRunWith { ...@@ -55,16 +66,16 @@ public class TestRunWith {
} }
@Test @Test
public void test3(){ public void test3() {
channelLabelDao.getChannelLabelType(); channelLabelDao.getChannelLabelType();
} }
@Test @Test
public void test4(){ public void test4() {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
list.add("分析高频词耗时"); list.add("分析高频词耗时");
list.add("分析高频词"); list.add("分析高频词");
List<JSONObject> highWordsJson = TextUtil.getHighWordsJson(list,1); List<JSONObject> highWordsJson = TextUtil.getHighWordsJson(list, 1);
System.out.println(JSONObject.toJSONString(highWordsJson)); System.out.println(JSONObject.toJSONString(highWordsJson));
} }
......
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