提交 54e28629 作者: 925993793@qq.com

事件服务和平台事件合并

上级 76d0108e
package com.zzsn.event.config.interceptor;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
* 拦截token,获取用户信息
*
* @author lkg
* @date 2024/4/29
*/
public class UserInfoInterceptor implements HandlerInterceptor {
@Value("${checkToken.url:}")
private String checkTokenUrl;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
String token = request.getHeader(Constants.HEADER_KEY);
Result<?> result = getUserInfo(token);
Integer code = result.getCode();
if (code == 500) {
returnJson(response, JSON.toJSONString(Result.FAIL(500, "第三方用户验证未通过,请检查令牌是否正确")));
return false;
}
UserVo userVo = JSONObject.parseObject(JSON.toJSONString(result.getResult()), UserVo.class);
UserUtil.setLoginUser(userVo);
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
UserUtil.removeUser();
}
private Result<?> getUserInfo(String token){
Result<?> bean;
try {
String body = HttpRequest.post(checkTokenUrl)
.header(Constants.HEADER_KEY,token)
.execute().body();
bean = JSONObject.parseObject(body, Result.class);
} catch (Exception e) {
bean = Result.FAIL();
}
return bean;
}
private void returnJson(HttpServletResponse response, String json) {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=utf-8");
try (PrintWriter writer = response.getWriter()) {
writer.println(json);
} catch (Exception ignored) {
}
}
}
package com.zzsn.event.config.interceptor; package com.zzsn.event.config.interceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @Description:
* @Author: obcy
* @Date: 2024/4/5
*/
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Bean
public UserInfoInterceptor userInfoInterceptor() {
return new UserInfoInterceptor();
}
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
// 添加自定义拦截器,拦截所有路径 registry.addInterceptor(userInfoInterceptor()).addPathPatterns("/**");
} }
} }
package com.zzsn.event.constant; package com.zzsn.event.constant;
public class Constants { public class Constants {
private Constants() { }
//事件专题-redis缓存key前缀 //事件专题-redis缓存key前缀
public static final String SUBJECT_ANALYSIS_PRE = "SUBJECT_ANALYSIS::"; public static final String SUBJECT_ANALYSIS_PRE = "SUBJECT_ANALYSIS::";
//传播路径 //传播路径
...@@ -46,5 +49,14 @@ public class Constants { ...@@ -46,5 +49,14 @@ public class Constants {
//处理后的专题资讯信息存储索引。 //处理后的专题资讯信息存储索引。
public final static String ES_DATA_FOR_SUBJECT = "subjectdatabase_2023"; public final static String ES_DATA_FOR_SUBJECT = "subjectdatabase_2023";
private Constants() { }
public final static String HEADER_KEY = "X-Access-Token";
//用户-普通用户
public static final Integer COMMON_USER = 2;
//用户-管理员用户
public static final Integer ADMIN_USER = 3;
/*数据权限类型*/
public final static String PERMISSION_SUBJECT = "subject";
} }
...@@ -3,25 +3,31 @@ package com.zzsn.event.controller; ...@@ -3,25 +3,31 @@ package com.zzsn.event.controller;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result; import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.Event; import com.zzsn.event.entity.*;
import com.zzsn.event.entity.EventTag;
import com.zzsn.event.entity.SubjectInfoSourceMap;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
import com.zzsn.event.util.HttpUtil; import com.zzsn.event.util.HttpUtil;
import com.zzsn.event.util.ObjectUtil; import com.zzsn.event.util.ObjectUtil;
import com.zzsn.event.util.tree.Node; import com.zzsn.event.util.tree.Node;
import com.zzsn.event.util.tree.TreeUtil;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*; import com.zzsn.event.vo.*;
import com.zzsn.event.xxljob.entity.KeyWords; import com.zzsn.event.xxljob.entity.KeyWords;
import com.zzsn.event.xxljob.service.IXxlJobInfoService; import com.zzsn.event.xxljob.service.IXxlJobInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.internal.StringUtil;
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.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 事件后台管理 * 事件后台管理
...@@ -47,6 +53,12 @@ public class EventManageController { ...@@ -47,6 +53,12 @@ public class EventManageController {
private ISubjectInfoSourceMapService subjectInfoSourceMapService; private ISubjectInfoSourceMapService subjectInfoSourceMapService;
@Autowired @Autowired
private EventRegionMapService eventRegionMapService; private EventRegionMapService eventRegionMapService;
@Autowired
private ISubjectTypeService subjectTypeService;
@Autowired
private ICustomerDataPermissionMapService customerDataPermissionMapService;
@Autowired
private ISysUserDataPermissionService sysUserDataPermissionService;
@Value(("${serviceProject.url:}")) @Value(("${serviceProject.url:}"))
private String SERVICE_PROJECT_URL; private String SERVICE_PROJECT_URL;
...@@ -80,6 +92,107 @@ public class EventManageController { ...@@ -80,6 +92,107 @@ public class EventManageController {
} }
/** /**
* 事件页左侧树
*
* @author lkg
* @date 2024/4/29
*/
@GetMapping("/leftTypeTree")
public Result<?> leftTree() {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
String userId = null;
String customerId = null;
if (category.equals(Constants.COMMON_USER)) {
userId = currentUser.getUserId();
} else if (category.equals(Constants.ADMIN_USER)) {
customerId = currentUser.getCustomerId();
}
List<SubjectTreeVO> tree = subjectTypeService.subjectAndTypeTree(userId, customerId);
return Result.OK(tree);
}
/**
* 事件页左侧树
*
* @author lkg
* @date 2024/4/29
*/
@GetMapping("/leftCustomerTree")
public Result<?> leftCustomerTree() {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
String userId = null;
String customerId = null;
if (category.equals(Constants.COMMON_USER)) {
userId = currentUser.getUserId();
} else if (category.equals(Constants.ADMIN_USER)) {
customerId = currentUser.getCustomerId();
}
List<SubjectTreeVO> tree = subjectTypeService.subjectAndCustomerTree(userId,customerId);
return Result.OK(tree);
}
/**
* 分页列表-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
@GetMapping("/newPlatPageList")
public Result<?> newPlatPageList(SubjectCondition subjectCondition,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
if (category.equals(Constants.COMMON_USER)) {
subjectCondition.setUserId(currentUser.getUserId());
} else if (category.equals(Constants.ADMIN_USER)) {
subjectCondition.setCustomerId(currentUser.getCustomerId());
}
IPage<EventNewPlatVO> pageList = eventService.newPlatPageList(subjectCondition, pageNo, pageSize);
return Result.OK(pageList);
}
/**
* 分页列表-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
@GetMapping("/newPlatCustomerPageList")
public Result<?> newPlatCustomerPageList(SubjectCondition subjectCondition,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
if (category.equals(Constants.COMMON_USER)) {
subjectCondition.setUserId(currentUser.getUserId());
subjectCondition.setCustomerId(currentUser.getCustomerId());
} else if (category.equals(Constants.ADMIN_USER)) {
if (StringUtils.isEmpty(subjectCondition.getCustomerId()) || "0".equals(subjectCondition.getCustomerId())) {
subjectCondition.setCustomerId(currentUser.getCustomerId());
}
}
if ("0".equals(subjectCondition.getCustomerId())) {
subjectCondition.setCustomerId(null);
}
IPage<EventNewPlatVO> pageList = eventService.newPlatCustomerPageList(subjectCondition, pageNo, pageSize);
return Result.OK(pageList);
}
/**
* 地域信息-树型结构 * 地域信息-树型结构
* *
* @param type 类别(1-国际;2-国内) * @param type 类别(1-国际;2-国内)
...@@ -102,9 +215,18 @@ public class EventManageController { ...@@ -102,9 +215,18 @@ public class EventManageController {
@ApiOperation(value = "事件-添加", notes = "事件-添加") @ApiOperation(value = "事件-添加", notes = "事件-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody AddEventParam eventParam) { public Result<?> add(@RequestBody AddEventParam eventParam) {
UserVo currentUser = UserUtil.getLoginUser();
eventParam.setCreateTime(new Date()); eventParam.setCreateTime(new Date());
eventParam.setUpdateTime(new Date()); eventParam.setUpdateTime(new Date());
Event event = eventService.saveMain(eventParam); Event event = eventService.saveMain(eventParam);
//新建的专题授权给自己和客户
if (currentUser.getCategory().equals(Constants.ADMIN_USER)) {
customerDataPermissionMapService.save(new CustomerDataPermissionMap().setCustomerId(currentUser.getCustomerId()).setPermissionId(event.getId()).setCategory(Constants.PERMISSION_SUBJECT));
}
if (currentUser.getCategory().equals(Constants.COMMON_USER)) {
sysUserDataPermissionService.save(new SysUserDataPermission().setUserId(currentUser.getUserId()).setPermissionId(event.getId()).setCategory(Constants.PERMISSION_SUBJECT));
customerDataPermissionMapService.save(new CustomerDataPermissionMap().setCustomerId(currentUser.getCustomerId()).setPermissionId(event.getId()).setCategory(Constants.PERMISSION_SUBJECT));
}
//插入xxlJob //插入xxlJob
iXxlJobInfoService.subjectInsert(event); iXxlJobInfoService.subjectInsert(event);
return Result.OK(); return Result.OK();
...@@ -139,6 +261,9 @@ public class EventManageController { ...@@ -139,6 +261,9 @@ public class EventManageController {
public Result<?> delete(@RequestParam(name = "id") String id) { public Result<?> delete(@RequestParam(name = "id") String id) {
Event event = eventService.getById(id); Event event = eventService.getById(id);
iXxlJobInfoService.deleteByInfosourceCode(event.getEventCode()); iXxlJobInfoService.deleteByInfosourceCode(event.getEventCode());
//删除数据权限关系
customerDataPermissionMapService.remove(Wrappers.<CustomerDataPermissionMap>lambdaQuery().eq(CustomerDataPermissionMap::getPermissionId, id));
sysUserDataPermissionService.remove(Wrappers.<SysUserDataPermission>lambdaQuery().eq(SysUserDataPermission::getPermissionId, id));
eventService.deleteMain(id); eventService.deleteMain(id);
return Result.OK(); return Result.OK();
} }
...@@ -198,6 +323,28 @@ public class EventManageController { ...@@ -198,6 +323,28 @@ public class EventManageController {
/** /**
* 项目列表
*
* @author lkg
* @date 2024/4/29
*/
@GetMapping("/projectList")
public Result<?> projectList() {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
String userId = null;
String customerId = null;
if (category.equals(Constants.COMMON_USER)) {
userId = currentUser.getUserId();
} else if (category.equals(Constants.ADMIN_USER)) {
customerId = currentUser.getCustomerId();
}
List<Node> projectList = eventService.projectList(userId, customerId);
return Result.OK(projectList);
}
/**
* 2.1 专题信息源绑定 * 2.1 专题信息源绑定
*/ */
@PostMapping("/infoSourceBind") @PostMapping("/infoSourceBind")
......
package com.zzsn.event.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.CustomerDataPermissionMap;
import com.zzsn.event.entity.SubjectType;
import com.zzsn.event.entity.SubjectTypeMap;
import com.zzsn.event.entity.SysUserDataPermission;
import com.zzsn.event.service.ICustomerDataPermissionMapService;
import com.zzsn.event.service.ISubjectTypeMapService;
import com.zzsn.event.service.ISubjectTypeService;
import com.zzsn.event.service.ISysUserDataPermissionService;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.util.tree.TreeUtil;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 事件后台管理-事件分类
*
* @author lkg
* @date 2024/4/29
*/
@Slf4j
@Api(tags = "-事件分类")
@RestController
@RequestMapping("/manage/subjectType")
public class EventTypeController {
@Autowired
private ISubjectTypeService subjectTypeService;
@Autowired
private ISubjectTypeMapService subjectTypeMapService;
@Autowired
private ICustomerDataPermissionMapService customerDataPermissionMapService;
@Autowired
private ISysUserDataPermissionService sysUserDataPermissionService;
/**
* 事件分类列表-树型结构
*
* @author lkg
* @date 2024/4/28
*/
@GetMapping("/list")
public Result<?> typeList() {
//获取当前登录用户
UserVo currentUser = UserUtil.getLoginUser();
Integer category = currentUser.getCategory();
String userId = null;
String customerId = null;
if (category.equals(Constants.COMMON_USER)) {
userId = currentUser.getUserId();
} else if (category.equals(Constants.ADMIN_USER)) {
customerId = currentUser.getCustomerId();
}
List<Node> nodes = subjectTypeService.enableList(userId,customerId);
List<Node> tree = TreeUtil.tree(nodes, "0");
return Result.OK(tree);
}
/**
* 新增专题分类
*
* @param subjectType 专题分类
* @author lkg
* @date 2024/4/29
*/
@PostMapping("/add")
public Result<?> addSubjectType(@RequestBody SubjectType subjectType) {
UserVo currentUser = UserUtil.getLoginUser();
String pid = subjectType.getPid();
if (!"0".equals(pid)) {
int count = subjectTypeMapService.count(new LambdaQueryWrapper<SubjectTypeMap>().eq(SubjectTypeMap::getTypeId, pid));
if (count > 0) {
return Result.FAIL(501, "当前分类下存在专题");
}
}
subjectType.setCustomerId(currentUser.getCustomerId());
subjectTypeService.add(subjectType);
//权限
if (currentUser.getCategory().equals(Constants.ADMIN_USER)) {
customerDataPermissionMapService.save(new CustomerDataPermissionMap().setCustomerId(currentUser.getCustomerId()).setPermissionId(subjectType.getId()).setCategory(Constants.PERMISSION_SUBJECT));
}
if (currentUser.getCategory().equals(Constants.COMMON_USER)) {
sysUserDataPermissionService.save(new SysUserDataPermission().setUserId(currentUser.getUserId()).setPermissionId(subjectType.getId()).setCategory(Constants.PERMISSION_SUBJECT));
customerDataPermissionMapService.save(new CustomerDataPermissionMap().setCustomerId(currentUser.getCustomerId()).setPermissionId(subjectType.getId()).setCategory(Constants.PERMISSION_SUBJECT));
}
return Result.OK();
}
/**
* 编辑
*
* @param subjectType 专题分类
* @author lkg
* @date 2024/4/29
*/
@PostMapping("/edit")
public Result<?> edit(@RequestBody SubjectType subjectType){
subjectTypeService.edit(subjectType);
return Result.OK();
}
/**
* 删除
*
* @param id 专题分类id
* @author lkg
* @date 2024/4/29
*/
@GetMapping("/delete")
public Result<?> delete(@RequestParam String id){
int count = subjectTypeMapService.count(new LambdaQueryWrapper<SubjectTypeMap>().eq(SubjectTypeMap::getTypeId, id));
if (count > 0) {
return Result.FAIL(501, "当前分类下存在专题");
}
//删除数据权限关系
customerDataPermissionMapService.remove(Wrappers.<CustomerDataPermissionMap>lambdaQuery().eq(CustomerDataPermissionMap::getPermissionId, id));
sysUserDataPermissionService.remove(Wrappers.<SysUserDataPermission>lambdaQuery().eq(SysUserDataPermission::getPermissionId, id));
subjectTypeService.delete(id);
return Result.OK();
}
}
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* Description: 客户-数据权限关系表
* Author: EDY
* Date: 2023/8/1
*/
@Data
@TableName("customer_data_permission_map")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="customer_data_permission_map-客户-数据权限关系表", description="客户-数据权限关系表")
public class CustomerDataPermissionMap {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private String id;
@ApiModelProperty(value = "客户id")
private String customerId;
@ApiModelProperty(value = "数据权限id")
private String permissionId;
@ApiModelProperty(value = "数据权限类型(project-项目;subject-专题;group-信息源组;keyword-关键词组;channel-栏目)")
private String category;
@ApiModelProperty(value = "创建人")
private String createBy;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
...@@ -33,6 +33,10 @@ public class Event { ...@@ -33,6 +33,10 @@ public class Event {
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "ID") @ApiModelProperty(value = "ID")
private String id; private String id;
/**编码*/
@Excel(name = "编码", width = 15)
@ApiModelProperty(value = "编码")
private String eventCode;
/**名称*/ /**名称*/
@Excel(name = "名称", width = 15) @Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
...@@ -57,20 +61,10 @@ public class Event { ...@@ -57,20 +61,10 @@ public class Event {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private Date endTime; private Date endTime;
/**事件地域*/
@Excel(name = "事件地域", width = 15)
@ApiModelProperty(value = "事件地域")
private String eventArea;
private String eventAreaId;
/**标签*/ /**标签*/
@Excel(name = "标签", width = 15) @Excel(name = "标签", width = 15)
@ApiModelProperty(value = "标签") @ApiModelProperty(value = "标签")
private String eventLabel; private String eventLabel;
private String eventLabelIds;
/**关键词*/
@Excel(name = "关键词", width = 15)
@ApiModelProperty(value = "关键词")
private String eventKeywords;
/**是否公开*/ /**是否公开*/
@Excel(name = "是否公开", width = 15) @Excel(name = "是否公开", width = 15)
@ApiModelProperty(value = "是否公开") @ApiModelProperty(value = "是否公开")
...@@ -99,18 +93,34 @@ public class Event { ...@@ -99,18 +93,34 @@ public class Event {
@Excel(name = "修改人id", width = 15) @Excel(name = "修改人id", width = 15)
@ApiModelProperty(value = "修改人id") @ApiModelProperty(value = "修改人id")
private String updateBy; private String updateBy;
/**状态(0-禁用;1-启用)*/
private Integer status=1; private Integer status=1;
/** /**
* 分析事件脉络-最新资讯的时间 * 专题最近一次分析时间
*/ */
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date analysisTime; private Date analysisTime;
/**
* 分析事件脉络-最新资讯的时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date eventTime; private Date eventTime;
@TableField(exist = false) /**划分专题库*/
private String typeName; @Excel(name = "划分专题库", width = 15, dicCode = "Thematic_Library")
private String eventCode; @ApiModelProperty(value = "划分专题库")
private String library;
/**定时单位(1分;2小时;3日;4月)*/
@ApiModelProperty(value = "定时单位")
private String unit;
/**定时数值*/
@ApiModelProperty(value = "定时数值")
private Integer space;
/**cron表达式*/
@ApiModelProperty(value = "cron表达式")
private String cron; private String cron;
/**是否提取热词*/
@ApiModelProperty(value = "是否提取热词")
private String ynExtractHotWords;
/**事件专题增量分析规则*/ /**事件专题增量分析规则*/
@ApiModelProperty(value = "事件专题增量分析规则") @ApiModelProperty(value = "事件专题增量分析规则")
private Integer increAnaRule; private Integer increAnaRule;
...@@ -120,16 +130,28 @@ public class Event { ...@@ -120,16 +130,28 @@ public class Event {
/**事件专题时间间隔分析规则(天)*/ /**事件专题时间间隔分析规则(天)*/
@ApiModelProperty(value = "事件专题时间间隔分析规则(天)") @ApiModelProperty(value = "事件专题时间间隔分析规则(天)")
private Integer timeAnaRule; private Integer timeAnaRule;
/**总热度*/
private Integer totalHot; private Integer totalHot;
/**媒体热度*/
private Integer mediaHot; private Integer mediaHot;
/**微信热度*/
private Integer wechatHot; private Integer wechatHot;
/**其他热度*/
private Integer otherHot; private Integer otherHot;
/**发布状态(0-未发布;1-已发布)*/
private Integer publishStatus; private Integer publishStatus;
/**发布状态(0-未发布;1-已发布)*/
private String relationEvents; private String relationEvents;
/**发布时间*/
private String publishDate; private String publishDate;
/**排序号*/
private Integer sortOrder;
@TableField(exist = false) @TableField(exist = false)
private String typeName;
@TableField(exist = false)
private String startDate; private String startDate;
@TableField(exist = false) @TableField(exist = false)
private String endDate; private String endDate;
......
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 项目专题关联表
* @Author: jeecg-boot
* @Date: 2021-12-20
* @Version: V1.0
*/
@Data
@TableName("project_subject_map")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="project_subject_map对象", description="项目专题关联表")
public class ProjectSubjectMap implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**项目id*/
@Excel(name = "项目id", width = 15)
@ApiModelProperty(value = "项目id")
private String projectId;
/**专题id*/
@Excel(name = "专题id", width = 15)
@ApiModelProperty(value = "专题id")
private String subjectId;
}
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 专题类别
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Data
@TableName("subject_type")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value="subject_type对象", description="专题类别")
public class SubjectType implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**类别名称*/
@Excel(name = "类别名称", width = 15)
@ApiModelProperty(value = "类别名称")
private String typeName;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
@ApiModelProperty(value = "父级节点")
private String pid;
/**是否有子节点*/
@Excel(name = "是否有子节点", width = 15, dicCode = "yn")
@ApiModelProperty(value = "是否有子节点")
private String hasChild;
/**专题分类类型(1:通用专题 2:事件专题)*/
@Excel(name = "专题分类类型(1:通用专题 2:事件专题)", width = 15)
@ApiModelProperty(value = "专题分类类型(1:通用专题 2:事件专题)")
private Integer category;
/**所属客户*/
@ApiModelProperty(value = "所属客户")
private String customerId;
/**
* 状态(1启用 0不启用)
*/
private Integer status;
}
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 专题与类别关联表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Data
@TableName("subject_type_map")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="subject_type_map对象", description="专题与类别关联表")
public class SubjectTypeMap implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**专题id*/
@Excel(name = "专题id", width = 15)
@ApiModelProperty(value = "专题id")
private String subjectId;
/**类别id*/
@Excel(name = "类别id", width = 15)
@ApiModelProperty(value = "类别id")
private String typeId;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
}
package com.zzsn.event.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @author lkg
* @description: 用户数据权限
* @date 2022/6/20 11:59
*/
@Data
@TableName("sys_user_data_permission")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="sys_user_data_permission对象", description="用户数据权限表")
public class SysUserDataPermission implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**用户id*/
@Excel(name = "用户id", width = 15)
@ApiModelProperty(value = "用户id")
private String userId;
/**权限id*/
@Excel(name = "权限id", width = 15)
@ApiModelProperty(value = "权限id")
private String permissionId;
/**权限类别*/
@Excel(name = "权限类别", width = 15)
@ApiModelProperty(value = "权限类别")
private String category;
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.CustomerDataPermissionMap;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerDataPermissionMapMapper extends BaseMapper<CustomerDataPermissionMap> {
}
...@@ -2,6 +2,7 @@ package com.zzsn.event.mapper; ...@@ -2,6 +2,7 @@ package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.Event; import com.zzsn.event.entity.Event;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*; import com.zzsn.event.vo.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -98,6 +99,45 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -98,6 +99,45 @@ public interface EventMapper extends BaseMapper<Event> {
@Param("type") Integer type); @Param("type") Integer type);
/** /**
* 分页列表(专题分类)-新平台管理
*
* @param subjectCondition 筛选条件
* @param offset 偏移量
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
List<EventNewPlatVO> newPlatPageList(@Param("subjectCondition") SubjectCondition subjectCondition, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
/**
* 总数量(专题分类)-新平台管理
*
* @param subjectCondition 筛选条件
* @author lkg
* @date 2024/4/28
*/
Integer newPlatCount(@Param("subjectCondition") SubjectCondition subjectCondition);
/**
* 分页列表(客户)-新平台管理
*
* @param subjectCondition 筛选条件
* @param offset 偏移量
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/30
*/
List<EventNewPlatVO> newPlatCustomerPageList(@Param("subjectCondition") SubjectCondition subjectCondition, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize);
/**
* 总数量(客户)-新平台管理
*
* @param subjectCondition 筛选条件
* @author lkg
* @date 2024/4/28
*/
Integer newPlatCustomerCount(@Param("subjectCondition") SubjectCondition subjectCondition);
/**
* 热点事件列表-前10 * 热点事件列表-前10
* *
* @param startTime 开始时间 * @param startTime 开始时间
...@@ -149,4 +189,42 @@ public interface EventMapper extends BaseMapper<Event> { ...@@ -149,4 +189,42 @@ public interface EventMapper extends BaseMapper<Event> {
* @date 2024/4/12 * @date 2024/4/12
*/ */
List<EventVO> eventList(@Param("eventIdList") List<String> eventIdList); List<EventVO> eventList(@Param("eventIdList") List<String> eventIdList);
/**
* 专题绑定关键词数量
*
* @param idList 专题id集合
* @author lkg
* @date 2024/4/28
*/
List<SubjectPage> bindKeywordCountList(@Param("idList") List<String> idList);
/**
* 专题绑定的信息源集合
*
* @param subjectIds 专题id
* @author lkg
* @date 2024/4/24
*/
List<SubjectSourceVO> bindSourceList(@Param("subjectIds") List<String> subjectIds);
/**
* 专题绑定的信息源集合
*
* @param subjectIds 专题id
* @author lkg
* @date 2024/4/24
*/
List<SubjectSourceVO> excludeSourceList(@Param("subjectIds") List<String> subjectIds);
/**
* 项目列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<Node> projectList(@Param("userId") String userId, @Param("customerId") String customerId);
} }
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.ProjectSubjectMap;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 项目专题关联表
* @Author: jeecg-boot
* @Date: 2021-12-20
* @Version: V1.0
*/
@Mapper
public interface ProjectSubjectMapMapper extends BaseMapper<ProjectSubjectMap> {
void deleteBySubjectId (@Param("subjectId") String subjectId);
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.SubjectTypeMap;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 专题与类别关联表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Mapper
public interface SubjectTypeMapMapper extends BaseMapper<SubjectTypeMap> {
void deleteBySubjectId (@Param("subjectId") String subjectId);
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.SubjectType;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.SubjectTreeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 专题类别
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Mapper
public interface SubjectTypeMapper extends BaseMapper<SubjectType> {
/**
* 可用的专题分类列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<Node> enableList(@Param("userId") String userId, @Param("customerId") String customerId);
/**
* 可用的专题和专题分类列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<SubjectTreeVO> subjectAndTypeTree(@Param("userId") String userId, @Param("customerId") String customerId);
/**
* 可用的专题和客户列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/30
*/
List<SubjectTreeVO> subjectAndCustomerTree(@Param("userId") String userId, @Param("customerId") String customerId);
/**
* 可用客户信息列表
*
* @param customerId 客户id
* @author lkg
* @date 2024/4/30
*/
List<SubjectTreeVO> enableCustomerList(@Param("customerId") String customerId);
/**
* 更新分类是否有子节点状态
*
* @param id 分类id
* @param hasChild 是否有子节点
* @author lkg
* @date 2024/4/29
*/
void updateTreeNodeStatus(@Param("id") String id, @Param("hasChild") Integer hasChild);
}
package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsn.event.entity.SysUserDataPermission;
import org.apache.ibatis.annotations.Mapper;
/**
* @author lkg
* @description:
* @date 2022/6/20 14:10
*/
@Mapper
public interface SysUserDataPermissionMapper extends BaseMapper<SysUserDataPermission> {
}
...@@ -17,8 +17,14 @@ ...@@ -17,8 +17,14 @@
<select id="queryInfo" resultType="com.zzsn.event.vo.EventVO"> <select id="queryInfo" resultType="com.zzsn.event.vo.EventVO">
select t.id,t.event_name,t.event_icon,t.start_time,t.end_time,t.publish_date,t.event_describe,t.event_label, select t.id,t.event_name,t.event_icon,t.start_time,t.end_time,t.publish_date,t.event_describe,t.event_label,
t.face_public,t.relation_events,t.event_type,c.type_name,IFNULL(r.id,false) as hasReport t.library,t.unit,t.space,t.cron,t.yn_extract_hot_words,
from event t inner join event_category c on t.event_type = c.id t.face_public,t.relation_events,t.event_type,t.sort_order,
stm.type_id as subjectTypeId,psm.project_id,
c.type_name,IFNULL(r.id,false) as hasReport
from event t
inner join event_category c on t.event_type = c.id
inner join subject_type_map stm on t.id = stm.subject_id
inner join project_subject_map psm on t.id = psm.subject_id
left join event_analysis_report r on t.id = r.event_id left join event_analysis_report r on t.id = r.event_id
where t.id = #{eventId} where t.id = #{eventId}
</select> </select>
...@@ -131,6 +137,213 @@ ...@@ -131,6 +137,213 @@
</if> </if>
</select> </select>
<select id="newPlatPageList" resultType="com.zzsn.event.vo.EventNewPlatVO">
SELECT distinct d.id,d.event_name, m.type_name as subjectTypeName, n.project_name
from
<choose>
<when test="subjectCondition.userId !=null and subjectCondition.userId != ''">
( select s.* from event s inner join sys_user_data_permission dp
on s.id=dp.permission_id and dp.user_id = #{subjectCondition.userId}
)
</when>
<when test="subjectCondition.customerId !=null and subjectCondition.customerId != ''">
( select s.* from event s inner join customer_data_permission_map m on s.id = m.permission_id
and m.customer_id = #{subjectCondition.customerId}
)
</when>
<otherwise>
event
</otherwise>
</choose>
d
INNER JOIN
(
select stm.subject_id,st.type_name from subject_type_map stm inner join subject_type st on stm.type_id = st.id
where 1=1
<if test="subjectCondition.typeIds!=null and subjectCondition.typeIds.size()>0">
and stm.type_id in
<foreach collection="subjectCondition.typeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) m
on d.id = m.subject_id
INNER JOIN
(
select psm.subject_id,p.project_name from project_subject_map psm inner join project p on psm.project_id = p.id
where 1=1
<if test="subjectCondition.projectId!=null and subjectCondition.projectId != ''">
and p.id = #{subjectCondition.projectId}
</if>
) n
on d.id = n.subject_id
where 1 = 1
<if test="subjectCondition.id !=null and subjectCondition.id !=''">
and d.id =#{subjectCondition.id}
</if>
<if test="subjectCondition.subjectName!=null and subjectCondition.subjectName != ''">
and d.event_name like CONCAT('%',#{subjectCondition.subjectName},'%')
</if>
<if test="subjectCondition.startTime != null and subjectCondition.startTime != ''">
and d.create_time >= #{subjectCondition.startTime}
</if>
<if test="subjectCondition.endTime != null and subjectCondition.endTime != ''">
and d.create_time <![CDATA[ <= ]]> #{subjectCondition.endTime}
</if>
order by d.sort_order,d.create_time desc
limit #{offset}, #{pageSize}
</select>
<select id="newPlatCount" resultType="Integer">
select count(1) from (
SELECT distinct d.id
from
<choose>
<when test="subjectCondition.userId !=null and subjectCondition.userId != ''">
( select s.* from event s inner join sys_user_data_permission dp
on s.id=dp.permission_id and dp.user_id = #{subjectCondition.userId}
)
</when>
<when test="subjectCondition.customerId !=null and subjectCondition.customerId != ''">
( select s.* from event s inner join customer_data_permission_map m on s.id = m.permission_id
and m.customer_id = #{subjectCondition.customerId}
)
</when>
<otherwise>
event
</otherwise>
</choose>
d
INNER JOIN
(
select stm.subject_id from subject_type_map stm
where 1=1
<if test="subjectCondition.typeIds!=null and subjectCondition.typeIds.size()>0">
and stm.type_id in
<foreach collection="subjectCondition.typeIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) m
on d.id = m.subject_id
INNER JOIN
(
select psm.subject_id from project_subject_map psm
where 1=1
<if test="subjectCondition.projectId!=null and subjectCondition.projectId != ''">
and psm.id = #{subjectCondition.projectId}
</if>
) n
on d.id = n.subject_id
where 1 = 1
<if test="subjectCondition.id !=null and subjectCondition.id !=''">
and d.id =#{subjectCondition.id}
</if>
<if test="subjectCondition.subjectName!=null and subjectCondition.subjectName != ''">
and d.event_name like CONCAT('%',#{subjectCondition.subjectName},'%')
</if>
<if test="subjectCondition.startTime != null and subjectCondition.startTime != ''">
and d.create_time >= #{subjectCondition.startTime}
</if>
<if test="subjectCondition.endTime != null and subjectCondition.endTime != ''">
and d.create_time <![CDATA[ <= ]]> #{subjectCondition.endTime}
</if>
) x
</select>
<select id="newPlatCustomerPageList" resultType="com.zzsn.event.vo.EventNewPlatVO">
select distinct x.id,x.event_name,st.type_name as subjectTypeName,p.project_name from (
select c.id, c.event_name,c.create_time
from event c inner join
(
select a.id, b.permission_id
from customer_data_permission_map b
inner join customer a on b.customer_id = a.id and a.status = 1
and a.is_delete = 0 and b.category = 'subject'
<if test="subjectCondition.userId !=null and subjectCondition.userId != ''">
and b.permission_id in
(
select permission_id from sys_user_data_permission where category = 'subject'
where user_id = #{subjectCondition.userId}
)
</if>
) m
on c.id = m.permission_id
where c.status = 1
<if test="subjectCondition.customerId !=null and subjectCondition.customerId != ''">
and m.id = #{subjectCondition.customerId}
</if>
<if test="subjectCondition.id !=null and subjectCondition.id !=''">
and c.id =#{subjectCondition.id}
</if>
<if test="subjectCondition.subjectName!=null and subjectCondition.subjectName != ''">
and c.event_name like CONCAT('%',#{subjectCondition.subjectName},'%')
</if>
<if test="subjectCondition.startTime != null and subjectCondition.startTime != ''">
and c.create_time >= #{subjectCondition.startTime}
</if>
<if test="subjectCondition.endTime != null and subjectCondition.endTime != ''">
and c.create_time <![CDATA[ <= ]]> #{subjectCondition.endTime}
</if>
) x
left join subject_type_map stm on stm.subject_id = x.id
left join subject_type st on stm.type_id = st.id
left join project_subject_map psm on psm.subject_id = x.id
left join project p on psm.project_id = p.id
where 1=1
<if test="subjectCondition.projectId!=null and subjectCondition.projectId != ''">
and p.id = #{subjectCondition.projectId}
</if>
order by x.create_time desc
limit #{offset},#{pageSize}
</select>
<select id="newPlatCustomerCount" resultType="Integer">
select count(1) from (
select distinct x.id from (
select c.id, c.event_name,c.create_time
from event c inner join
(
select a.id, b.permission_id
from customer_data_permission_map b
inner join customer a on b.customer_id = a.id and a.status = 1
and a.is_delete = 0 and b.category = 'subject'
<if test="subjectCondition.userId !=null and subjectCondition.userId != ''">
and b.permission_id in
(
select permission_id from sys_user_data_permission where category = 'subject'
where user_id = #{subjectCondition.userId}
)
</if>
) m
on c.id = m.permission_id
where c.status = 1
<if test="subjectCondition.customerId !=null and subjectCondition.customerId != ''">
and m.id = #{subjectCondition.customerId}
</if>
<if test="subjectCondition.id !=null and subjectCondition.id !=''">
and c.id =#{subjectCondition.id}
</if>
<if test="subjectCondition.subjectName!=null and subjectCondition.subjectName != ''">
and c.event_name like CONCAT('%',#{subjectCondition.subjectName},'%')
</if>
<if test="subjectCondition.startTime != null and subjectCondition.startTime != ''">
and c.create_time >= #{subjectCondition.startTime}
</if>
<if test="subjectCondition.endTime != null and subjectCondition.endTime != ''">
and c.create_time <![CDATA[ <= ]]> #{subjectCondition.endTime}
</if>
) x
left join subject_type_map stm on stm.subject_id = x.id
left join subject_type st on stm.type_id = st.id
left join project_subject_map psm on psm.subject_id = x.id
left join project p on psm.project_id = p.id
where 1=1
<if test="subjectCondition.projectId!=null and subjectCondition.projectId != ''">
and p.id = #{subjectCondition.projectId}
</if>
) y
</select>
<select id="topEventList" resultType="com.zzsn.event.vo.EventTopVO"> <select id="topEventList" resultType="com.zzsn.event.vo.EventTopVO">
select t.id,t.event_name,t.start_time,t.end_time,t.publish_date,t.total_hot,ec.type_name select t.id,t.event_name,t.start_time,t.end_time,t.publish_date,t.total_hot,ec.type_name
from event t from event t
...@@ -211,4 +424,69 @@ ...@@ -211,4 +424,69 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<select id="bindKeywordCountList" resultType="com.zzsn.event.vo.SubjectPage">
select subject_id as id , count(1) keyWordsNum from subject_keywords_map where subject_id in
<foreach collection="idList" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
group By subject_id
</select>
<select id="bindSourceList" resultType="com.zzsn.event.vo.SubjectSourceVO">
select distinct x.source_id,x.subject_id from (
select m.source_id,n.subject_id from subject_info_source_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type in(2,5)
<if test="subjectIds != null and subjectIds.size() > 0">
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
select sm.source_id,sm.subject_id from subject_info_source_map sm where type = 1
<if test="subjectIds != null and subjectIds.size() > 0">
and sm.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) x
</select>
<select id="excludeSourceList" resultType="com.zzsn.event.vo.SubjectSourceVO">
select distinct x.source_id,x.subject_id from (
select m.source_id,n.subject_id from subject_info_source_map n
inner join info_source_group_map m on n.source_id = m.group_id
where n.type = 4
<if test="subjectIds != null and subjectIds.size() > 0">
and n.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
union
select sm.source_id,sm.subject_id from subject_info_source_map sm where type = 3
<if test="subjectIds != null and subjectIds.size() > 0">
and sm.subject_id in
<foreach collection="subjectIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
) x
</select>
<select id="projectList" resultType="com.zzsn.event.util.tree.Node">
select s.id,s.project_name as name from project s
<if test="userId !=null and userId != ''">
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
<if test="customerId !=null and customerId != ''">
inner join customer_data_permission_map mp on s.id=mp.permission_id and mp.customer_id = #{customerId}
</if>
where s.is_delete = 0 and s.status = 1
</select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsn.event.mapper.ProjectSubjectMapMapper">
<delete id="deleteBySubjectId" >
delete from project_subject_map WHERE subject_id = #{subjectId}
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsn.event.mapper.SubjectTypeMapMapper">
<delete id="deleteBySubjectId" >
delete from subject_type_map WHERE subject_id = #{subjectId}
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsn.event.mapper.SubjectTypeMapper">
<select id="enableList" resultType="com.zzsn.event.util.tree.Node">
select s.id,s.type_name as name,s.pid from subject_type s
<if test="userId !=null and userId != ''">
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
<if test="customerId !=null and customerId != ''">
inner join customer_data_permission_map mp on s.id=mp.permission_id and mp.customer_id = #{customerId}
</if>
where s.category = 2 and s.status = 1
</select>
<select id="subjectAndTypeTree" resultType="com.zzsn.event.vo.SubjectTreeVO">
select s.id,s.type_name as name,s.pid,'false' as ynSubject from subject_type s
<if test="userId !=null and userId != ''">
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
<if test="customerId !=null and customerId != ''">
inner join customer_data_permission_map mp on s.id=mp.permission_id and mp.customer_id = #{customerId}
</if>
where s.category = 2 and s.status = 1
union
select n.id,n.name,m.id as pid,'true' as ynSubject from
(
select s.id,s.type_name as name,s.pid from subject_type s
<if test="userId !=null and userId != ''">
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
<if test="customerId !=null and customerId != ''">
inner join customer_data_permission_map mp on s.id=mp.permission_id and mp.customer_id = #{customerId}
</if>
where s.category = 2 and s.status = 1
) m
inner join subject_type_map stm on m.id = stm.type_id
inner join
(
select s.id,s.event_name as name from event s
<if test="userId !=null and userId != ''">
inner join sys_user_data_permission dp on s.id=dp.permission_id and dp.user_id = #{userId}
</if>
<if test="customerId !=null and customerId != ''">
inner join customer_data_permission_map mp on s.id=mp.permission_id and mp.customer_id = #{customerId}
</if>
where s.status = 1
) n on stm.subject_id = n.id
</select>
<select id="subjectAndCustomerTree" resultType="com.zzsn.event.vo.SubjectTreeVO">
select c.id, c.event_name as name, m.id as pid, 'true' as ynSubject
from event c inner join
(
select a.id, b.permission_id
from customer_data_permission_map b
inner join customer a on b.customer_id = a.id and a.status = 1
and a.is_delete = 0 and b.category = 'subject'
<if test="userId !=null and userId != ''">
and b.permission_id in
(
select permission_id from sys_user_data_permission where category = 'subject'
where user_id = #{userId}
)
</if>
) m
on c.id = m.permission_id
where c.status = 1
<if test="customerId !=null and customerId != ''">
and m.id = #{customerId}
</if>
</select>
<select id="enableCustomerList" resultType="com.zzsn.event.vo.SubjectTreeVO">
select id,customer_name as name,'0' as pid,'false' as ynSubject from customer where status = 1 and is_delete = 0
<if test="customerId!=null and customerId != ''">
and id = #{customerId}
</if>
</select>
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update subject_type
set has_child = #{hasChild}
where id = #{id}
</update>
</mapper>
\ No newline at end of file
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.CustomerDataPermissionMap;
/**
* @Description: 客户表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
public interface ICustomerDataPermissionMapService extends IService<CustomerDataPermissionMap> {
}
...@@ -3,8 +3,8 @@ package com.zzsn.event.service; ...@@ -3,8 +3,8 @@ package com.zzsn.event.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.Event; import com.zzsn.event.entity.Event;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*; import com.zzsn.event.vo.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -64,6 +64,28 @@ public interface IEventService extends IService<Event> { ...@@ -64,6 +64,28 @@ public interface IEventService extends IService<Event> {
IPage<EventFrontVO> frontPageList(String eventName, Integer eventType,String labelField, String labelName, String order, String orderType, Integer pageNo, Integer pageSize); IPage<EventFrontVO> frontPageList(String eventName, Integer eventType,String labelField, String labelName, String order, String orderType, Integer pageNo, Integer pageSize);
/** /**
* 分页列表(专题类别)-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
IPage<EventNewPlatVO> newPlatPageList(SubjectCondition subjectCondition,Integer pageNo, Integer pageSize);
/**
* 分页列表(客户)-新平台管理
*
* @param subjectCondition 筛选条件
* @param pageNo 当前页
* @param pageSize 返回条数
* @author lkg
* @date 2024/4/28
*/
IPage<EventNewPlatVO> newPlatCustomerPageList(SubjectCondition subjectCondition,Integer pageNo, Integer pageSize);
/**
* 热点事件列表-前10 * 热点事件列表-前10
* *
* @param startTime 开始时间 * @param startTime 开始时间
...@@ -119,4 +141,14 @@ public interface IEventService extends IService<Event> { ...@@ -119,4 +141,14 @@ public interface IEventService extends IService<Event> {
* @date 2024/4/12 * @date 2024/4/12
*/ */
List<EventVO> eventList(List<String> eventIdList); List<EventVO> eventList(List<String> eventIdList);
/**
* 项目列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<Node> projectList(String userId, String customerId);
} }
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.ProjectSubjectMap;
/**
* @Description: 项目专题关联表
* @Author: jeecg-boot
* @Date: 2021-12-20
* @Version: V1.0
*/
public interface IProjectSubjectMapService extends IService<ProjectSubjectMap> {
/**根据专题id删除*/
void deleteBySubjectId (String subjectId);
}
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.SubjectTypeMap;
/**
* @Description: 专题与类别关联表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
public interface ISubjectTypeMapService extends IService<SubjectTypeMap> {
/**根据专题id删除*/
void deleteBySubjectId (String subjectId);
}
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.SubjectType;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.SubjectTreeVO;
import java.util.List;
/**
* @Description: 专题类别
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
public interface ISubjectTypeService extends IService<SubjectType> {
/**
* 可用的专题分类列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<Node> enableList(String userId,String customerId);
/**
* 获取分类下的所有节点id集合
*
* @param typeId 分类id
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<String> belowIdList(String typeId,String userId,String customerId);
/**
* 新增专题分类
*
* @param subjectType 专题分类
* @author lkg
* @date 2024/4/29
*/
void add(SubjectType subjectType);
/**
* 编辑专题分类
*
* @param subjectType 专题分类
* @author lkg
* @date 2024/4/29
*/
void edit(SubjectType subjectType);
/**
* 删除专题分类
*
* @param typeId 专题分类id
* @author lkg
* @date 2024/4/29
*/
void delete(String typeId);
/**
* 可用的专题和专题分类列表
*
* @param userId 用户id
* @param customerId 客户id
* @author lkg
* @date 2024/4/29
*/
List<SubjectTreeVO> subjectAndTypeTree(String userId, String customerId);
/**
* 可用的专题和客户列表
*
* @param customerId 客户id
* @author lkg
* @date 2024/4/30
*/
List<SubjectTreeVO> subjectAndCustomerTree(String userId,String customerId);
}
package com.zzsn.event.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.entity.SysUserDataPermission;
/**
* @author lkg
* @description:
* @date 2022/6/20 14:10
*/
public interface ISysUserDataPermissionService extends IService<SysUserDataPermission> {
}
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.CustomerDataPermissionMap;
import com.zzsn.event.mapper.CustomerDataPermissionMapMapper;
import com.zzsn.event.service.ICustomerDataPermissionMapService;
import org.springframework.stereotype.Service;
/**
* @Description: 客户表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Service
public class CustomerDataPermissionMapImpl extends ServiceImpl<CustomerDataPermissionMapMapper, CustomerDataPermissionMap> implements ICustomerDataPermissionMapService {
}
...@@ -7,15 +7,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -7,15 +7,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.constant.Constants; import com.zzsn.event.constant.Constants;
import com.zzsn.event.entity.Event; import com.zzsn.event.entity.*;
import com.zzsn.event.entity.EventRegionMap;
import com.zzsn.event.entity.EventTag;
import com.zzsn.event.enums.CodePrefixEnum; import com.zzsn.event.enums.CodePrefixEnum;
import com.zzsn.event.mapper.EventMapper; import com.zzsn.event.mapper.EventMapper;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
import com.zzsn.event.util.CodeGenerateUtil; import com.zzsn.event.util.CodeGenerateUtil;
import com.zzsn.event.util.CronUtil; import com.zzsn.event.util.CronUtil;
import com.zzsn.event.util.HanlpUtil; import com.zzsn.event.util.HanlpUtil;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*; import com.zzsn.event.vo.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -28,6 +27,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder; ...@@ -28,6 +27,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms; import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms;
import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
...@@ -38,19 +38,13 @@ import org.elasticsearch.search.sort.SortOrder; ...@@ -38,19 +38,13 @@ import org.elasticsearch.search.sort.SortOrder;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Description: 事件 * @Description: 事件
...@@ -64,7 +58,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -64,7 +58,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
@Autowired @Autowired
private CodeGenerateUtil codeGenerateUtil; private CodeGenerateUtil codeGenerateUtil;
@Autowired @Autowired
private IKeyWordsService iKeyWordsService; private ISubjectTypeMapService iSubjectTypeMapService;
@Autowired @Autowired
private ISubjectInfoSourceMapService iSubjectInfoSourceMapService; private ISubjectInfoSourceMapService iSubjectInfoSourceMapService;
@Autowired @Autowired
...@@ -73,6 +67,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -73,6 +67,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
private IEventTagService eventTagService; private IEventTagService eventTagService;
@Autowired @Autowired
private EventRegionMapService eventRegionMapService; private EventRegionMapService eventRegionMapService;
@Autowired
private IProjectSubjectMapService iProjectSubjectMapService;
@Autowired
private ISubjectTypeService iSubjectTypeService;
@Resource @Resource
private RestHighLevelClient client; private RestHighLevelClient client;
...@@ -107,13 +105,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -107,13 +105,13 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
@Override @Override
public IPage<EventFrontVO> frontPageList(String eventName, Integer eventType,String labelField, String labelName,String order, String orderType, Integer pageNo, Integer pageSize) { public IPage<EventFrontVO> frontPageList(String eventName, Integer eventType, String labelField, String labelName, String order, String orderType, Integer pageNo, Integer pageSize) {
int offset = (pageNo - 1) * pageSize; int offset = (pageNo - 1) * pageSize;
Integer type = null; Integer type = null;
if (StringUtils.isNotEmpty(labelField) && labelField.equals("event_label")) { if (StringUtils.isNotEmpty(labelField) && labelField.equals("event_label")) {
type = 1; type = 1;
} }
List<EventFrontVO> pageList = baseMapper.frontPageList(eventName, eventType,labelField,labelName,type,order,orderType, offset, pageSize); List<EventFrontVO> pageList = baseMapper.frontPageList(eventName, eventType, labelField, labelName, type, order, orderType, offset, pageSize);
if (CollectionUtils.isNotEmpty(pageList)) { if (CollectionUtils.isNotEmpty(pageList)) {
//获取专题资讯的首发来源 //获取专题资讯的首发来源
Map<String, String> map = getFirstMap(pageList); Map<String, String> map = getFirstMap(pageList);
...@@ -125,13 +123,44 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -125,13 +123,44 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
} }
//获取总条数 //获取总条数
Integer count = baseMapper.frontTotalCount(eventName, eventType,labelField,labelName,type); Integer count = baseMapper.frontTotalCount(eventName, eventType, labelField, labelName, type);
IPage<EventFrontVO> pageData = new Page<>(pageNo, pageSize, count); IPage<EventFrontVO> pageData = new Page<>(pageNo, pageSize, count);
pageData.setRecords(pageList); pageData.setRecords(pageList);
return pageData; return pageData;
} }
@Override @Override
public IPage<EventNewPlatVO> newPlatPageList(SubjectCondition subjectCondition, Integer pageNo, Integer pageSize) {
int offset = (pageNo - 1) * pageSize;
//查询类别id的所有明细id
List<String> typeIds = new ArrayList<>();
String subjectTypeId = subjectCondition.getSubjectTypeId();
if (StringUtils.isNotEmpty(subjectTypeId) && !"0".equals(subjectTypeId)) {
typeIds = iSubjectTypeService.belowIdList(subjectTypeId,subjectCondition.getUserId(),subjectCondition.getCustomerId());
}
subjectCondition.setTypeIds(typeIds);
//在根据所有明细节点查出专题列表
List<EventNewPlatVO> pageList = baseMapper.newPlatPageList(subjectCondition, offset, pageSize);
count(pageList);
//获取总条数
Integer count = baseMapper.newPlatCount(subjectCondition);
IPage<EventNewPlatVO> pageData = new Page<>(pageNo, pageSize, count);
pageData.setRecords(pageList);
return pageData;
}
@Override
public IPage<EventNewPlatVO> newPlatCustomerPageList(SubjectCondition subjectCondition, Integer pageNo, Integer pageSize) {
int offset = (pageNo - 1) * pageSize;
List<EventNewPlatVO> pageList = baseMapper.newPlatCustomerPageList(subjectCondition, offset, pageSize);
count(pageList);
Integer count = baseMapper.newPlatCustomerCount(subjectCondition);
IPage<EventNewPlatVO> pageData = new Page<>(pageNo, pageSize, count);
pageData.setRecords(pageList);
return pageData;
}
@Override
public List<EventTopVO> topEventList(String startTime, String endTime, Integer type, Integer pageSize) { public List<EventTopVO> topEventList(String startTime, String endTime, Integer type, Integer pageSize) {
return baseMapper.topEventList(startTime, endTime, type, 0, pageSize); return baseMapper.topEventList(startTime, endTime, type, 0, pageSize);
} }
...@@ -157,7 +186,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -157,7 +186,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
TermsAggregationBuilder one = AggregationBuilders.terms("one").field("subjectId.keyword").size(eventIdList.size()); TermsAggregationBuilder one = AggregationBuilders.terms("one").field("subjectId.keyword").size(eventIdList.size());
//ES分组取每组第一条Java写法 //ES分组取每组第一条Java写法
TopHitsAggregationBuilder topHitsAggregationBuilder = AggregationBuilders.topHits("top_docs") TopHitsAggregationBuilder topHitsAggregationBuilder = AggregationBuilders.topHits("top_docs")
.sort("publishDate",SortOrder.ASC) .sort("publishDate", SortOrder.ASC)
.size(1); .size(1);
one.subAggregation(topHitsAggregationBuilder); one.subAggregation(topHitsAggregationBuilder);
searchSourceBuilder.aggregation(one); searchSourceBuilder.aggregation(one);
...@@ -183,7 +212,6 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -183,7 +212,6 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
@Override @Override
@Transactional @Transactional
public Event saveMain(AddEventParam addEventParam) { public Event saveMain(AddEventParam addEventParam) {
String cron;
Event event = new Event(); Event event = new Event();
//事件专题的默认分析规则参数-必填 //事件专题的默认分析规则参数-必填
BeanUtils.copyProperties(addEventParam, event); BeanUtils.copyProperties(addEventParam, event);
...@@ -192,14 +220,22 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -192,14 +220,22 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
event.setTimeAnaRule(5); event.setTimeAnaRule(5);
String subjectCode = codeGenerateUtil.geneCodeNo(CodePrefixEnum.SUBJECT_DEFAULT.getValue()); String subjectCode = codeGenerateUtil.geneCodeNo(CodePrefixEnum.SUBJECT_DEFAULT.getValue());
event.setEventCode(subjectCode); event.setEventCode(subjectCode);
cron = CronUtil.getRandomCron(); String cron;
if (StringUtils.isEmpty(event.getUnit()) || null == event.getSpace()) {
cron = CronUtil.getRandomCron();
} else {
cron = CronUtil.generateCron(event.getUnit(), event.getSpace());
}
event.setCron(cron); event.setCron(cron);
baseMapper.insert(event); baseMapper.insert(event);
String eventId = event.getId(); String eventId = event.getId();
//插入专题-类别、项目的绑定关系
saveMapMain(event, addEventParam);
//事件标签
eventTagService.save(EventTag.builder().eventId(eventId).build()); eventTagService.save(EventTag.builder().eventId(eventId).build());
//地缘关系绑定 //地缘关系绑定
List<RegionVO> regionList = addEventParam.getRegionList(); List<RegionVO> regionList = addEventParam.getRegionList();
addMap(eventId, regionList); addRegionMap(eventId, regionList);
return event; return event;
} }
...@@ -211,12 +247,19 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -211,12 +247,19 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
String eventId = subject.getId(); String eventId = subject.getId();
baseMapper.updateById(subject); baseMapper.updateById(subject);
//专题-类别、项目的绑定关系处理
//删除专题-类别绑定关系
iSubjectTypeMapService.deleteBySubjectId(subject.getId());
//删除专题-项目的绑定关系
iProjectSubjectMapService.deleteBySubjectId(subject.getId());
saveMapMain(subject, addEventParam);
//地域关系处理 //地域关系处理
LambdaQueryWrapper<EventRegionMap> queryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<EventRegionMap> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(EventRegionMap::getEventId, eventId); queryWrapper.eq(EventRegionMap::getEventId, eventId);
eventRegionMapService.remove(queryWrapper); eventRegionMapService.remove(queryWrapper);
List<RegionVO> regionList = addEventParam.getRegionList(); List<RegionVO> regionList = addEventParam.getRegionList();
addMap(eventId, regionList); addRegionMap(eventId, regionList);
} }
@Override @Override
...@@ -230,6 +273,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -230,6 +273,10 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
LambdaQueryWrapper<EventRegionMap> queryWrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<EventRegionMap> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(EventRegionMap::getEventId, id); queryWrapper.eq(EventRegionMap::getEventId, id);
eventRegionMapService.remove(queryWrapper); eventRegionMapService.remove(queryWrapper);
//删除专题-类别绑定关系
iSubjectTypeMapService.deleteBySubjectId(id);
//删除专题-项目的绑定关系
iProjectSubjectMapService.deleteBySubjectId(id);
baseMapper.deleteById(id); baseMapper.deleteById(id);
} }
...@@ -244,12 +291,17 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -244,12 +291,17 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
@Override @Override
public List<EventExcelVO> frontList(List<String> eventIdList,Integer size) { public List<Node> projectList(String userId, String customerId) {
return baseMapper.frontList(eventIdList,size); return baseMapper.projectList(userId,customerId);
}
@Override
public List<EventExcelVO> frontList(List<String> eventIdList, Integer size) {
return baseMapper.frontList(eventIdList, size);
} }
@Override @Override
public List<StatisticsKeyWordVo> hotWords(String index,String id, Integer number) { public List<StatisticsKeyWordVo> hotWords(String index, String id, Integer number) {
SubjectDataVo subjectDataVo = esService.queryInfo(index, id); SubjectDataVo subjectDataVo = esService.queryInfo(index, id);
String content = subjectDataVo.getContent(); String content = subjectDataVo.getContent();
List<Map.Entry<String, Integer>> keywordsList = HanlpUtil.extractKeyWordsByText(Jsoup.parse(content).text(), number); List<Map.Entry<String, Integer>> keywordsList = HanlpUtil.extractKeyWordsByText(Jsoup.parse(content).text(), number);
...@@ -265,7 +317,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -265,7 +317,7 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
return rn; return rn;
} }
private void addMap(String eventId, List<RegionVO> regionList) { private void addRegionMap(String eventId, List<RegionVO> regionList) {
if (CollectionUtils.isNotEmpty(regionList)) { if (CollectionUtils.isNotEmpty(regionList)) {
List<EventRegionMap> dataList = new ArrayList<>(); List<EventRegionMap> dataList = new ArrayList<>();
for (RegionVO regionVO : regionList) { for (RegionVO regionVO : regionList) {
...@@ -281,4 +333,103 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements ...@@ -281,4 +333,103 @@ public class EventServiceImpl extends ServiceImpl<EventMapper, Event> implements
} }
} }
private void saveMapMain(Event subject, AddEventParam addEventParam) {
if (StringUtils.isNotEmpty(addEventParam.getSubjectTypeId())) {
SubjectTypeMap subjectTypeMap = new SubjectTypeMap();
subjectTypeMap.setSubjectId(subject.getId());
subjectTypeMap.setCreateBy(subject.getCreateBy());
subjectTypeMap.setCreateTime(subject.getCreateTime());
subjectTypeMap.setUpdateBy(subject.getUpdateBy());
subjectTypeMap.setUpdateTime(subject.getUpdateTime());
subjectTypeMap.setTypeId(addEventParam.getSubjectTypeId());
iSubjectTypeMapService.save(subjectTypeMap);
}
if (StringUtils.isNotEmpty(addEventParam.getProjectId())) {
ProjectSubjectMap projectSubjectMap = new ProjectSubjectMap();
projectSubjectMap.setProjectId(addEventParam.getProjectId());
projectSubjectMap.setSubjectId(subject.getId());
iProjectSubjectMapService.save(projectSubjectMap);
}
}
//专题实际绑定信息源的集合
private List<SubjectSourceVO> subjectBindSourceList(List<String> subjectIds){
List<SubjectSourceVO> bindList = baseMapper.bindSourceList(subjectIds);
List<SubjectSourceVO> excludeList = baseMapper.excludeSourceList(subjectIds);
bindList.removeAll(excludeList);
return bindList;
}
//查询每个专题的数量
private Map<String, Integer> subjectInfoCountMap(List<String> subjectIdList, List<Integer> checkStatusList) {
SearchRequest searchRequest = new SearchRequest(Constants.ES_DATA_FOR_SUBJECT);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
//默认最大数量是10000,设置为true后,显示准确数量
searchSourceBuilder.trackTotalHits(true);
//创建查询对象
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.termsQuery("subjectId.keyword", subjectIdList));
//默认查询没删除的
boolQuery.must(QueryBuilders.matchQuery("deleteFlag", 0));
if (checkStatusList != null && checkStatusList.size() > 0) {
boolQuery.must(QueryBuilders.termsQuery("checkStatus", checkStatusList));
}
searchSourceBuilder.query(boolQuery);
//分组
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("group_subjectId").field("subjectId.keyword");
searchSourceBuilder.aggregation(aggregationBuilder);
//不返回文本内容
searchSourceBuilder.fetchSource(false);
searchRequest.source(searchSourceBuilder);
SearchResponse searchResponse = null;
try {
searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
e.printStackTrace();
}
//获取分组桶
Aggregations aggregations = searchResponse.getAggregations();
//获取id分组集合
Terms parsedStringTerms = aggregations.get("group_subjectId");
List<? extends Terms.Bucket> buckets = parsedStringTerms.getBuckets();
Map<String, Integer> map = new HashMap<>(subjectIdList.size());
for (Terms.Bucket bucket : buckets) {
String subjectId = bucket.getKeyAsString();
long collectCount = bucket.getDocCount();
map.put(subjectId, (int) collectCount);
}
return map;
}
private void count(List<EventNewPlatVO> pageList){
if (CollectionUtils.isNotEmpty(pageList)) {
List<String> idList = pageList.stream().map(EventNewPlatVO::getId).collect(Collectors.toList());
Map<String, Integer> infoSourceNumMap = new HashMap<>();
Map<String, Integer> keyWordsNumMap = baseMapper.bindKeywordCountList(idList).stream().collect(Collectors.toMap(SubjectPage::getId, SubjectPage::getKeyWordsNum));
Map<String, List<SubjectSourceVO>> collect = subjectBindSourceList(idList).stream().collect(Collectors.groupingBy(SubjectSourceVO::getSubjectId));
for (Map.Entry<String, List<SubjectSourceVO>> entry : collect.entrySet()) {
String subjectId = entry.getKey();
List<SubjectSourceVO> value = entry.getValue();
infoSourceNumMap.put(subjectId, value.size());
}
List<Integer> checkStatus = new ArrayList<>();
checkStatus.add(0);
Map<String, Integer> unCheckCountMap = subjectInfoCountMap(idList, checkStatus);
Map<String, Integer> subjectInfoCountMap = subjectInfoCountMap(idList, null);
for (EventNewPlatVO newPlatVO : pageList) {
int keyWordsNum = null == keyWordsNumMap.get(newPlatVO.getId()) ? 0 : keyWordsNumMap.get(newPlatVO.getId());
int infoSourceNum = null == infoSourceNumMap.get(newPlatVO.getId()) ? 0 : infoSourceNumMap.get(newPlatVO.getId());
//查询每个专题现有的信息数量
int subjectInfoCount = null == subjectInfoCountMap.get(newPlatVO.getId()) ? 0 : subjectInfoCountMap.get(newPlatVO.getId());
int unCheckCount = null == unCheckCountMap.get(newPlatVO.getId()) ? 0 : unCheckCountMap.get(newPlatVO.getId());
newPlatVO.setUnCheckNum(unCheckCount);
newPlatVO.setSubjectInfoNum(subjectInfoCount);
newPlatVO.setInfoSourceNum(infoSourceNum);
newPlatVO.setKeyWordsNum(keyWordsNum);
}
}
}
} }
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.ProjectSubjectMap;
import com.zzsn.event.mapper.ProjectSubjectMapMapper;
import com.zzsn.event.service.IProjectSubjectMapService;
import org.springframework.stereotype.Service;
/**
* @Description: 项目专题关联表
* @Author: jeecg-boot
* @Date: 2021-12-20
* @Version: V1.0
*/
@Service
public class ProjectSubjectMapServiceImpl extends ServiceImpl<ProjectSubjectMapMapper, ProjectSubjectMap> implements IProjectSubjectMapService {
@Override
public void deleteBySubjectId (String subjectId){
baseMapper.deleteBySubjectId(subjectId);
}
}
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.SubjectTypeMap;
import com.zzsn.event.mapper.SubjectTypeMapMapper;
import com.zzsn.event.service.ISubjectTypeMapService;
import org.springframework.stereotype.Service;
/**
* @Description: 专题与类别关联表
* @Author: jeecg-boot
* @Date: 2021-12-01
* @Version: V1.0
*/
@Service
public class SubjectTypeMapServiceImpl extends ServiceImpl<SubjectTypeMapMapper, SubjectTypeMap> implements ISubjectTypeMapService {
@Override
public void deleteBySubjectId(String subjectId) {
baseMapper.deleteBySubjectId(subjectId);
}
}
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.SubjectType;
import com.zzsn.event.mapper.SubjectTypeMapper;
import com.zzsn.event.service.ISubjectTypeService;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.util.tree.TreeUtil;
import com.zzsn.event.vo.SubjectTreeVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
*
*
* @author lkg
* @date 2024/4/28
*/
@Service
public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, SubjectType> implements ISubjectTypeService {
@Override
public List<Node> enableList(String userId,String customerId) {
return baseMapper.enableList(userId,customerId);
}
@Override
public List<String> belowIdList(String typeId,String userId,String customerId) {
List<Node> nodes = this.enableList(userId,customerId);
return TreeUtil.belowList(nodes, typeId, true);
}
@Override
public void add(SubjectType subjectType) {
if (StringUtils.isEmpty(subjectType.getPid())) {
subjectType.setPid("0");
} else {
//如果当前节点父ID不为空 则设置父节点的hasChildren 为1
SubjectType parent = baseMapper.selectById(subjectType.getPid());
if (parent != null && !"1".equals(parent.getHasChild())) {
parent.setHasChild("1");
baseMapper.updateById(parent);
}
}
subjectType.setCreateTime(new Date());
baseMapper.insert(subjectType);
}
@Override
public void edit(SubjectType subjectType) {
SubjectType entity = this.getById(subjectType.getId());
String old_pid = entity.getPid();
String new_pid = subjectType.getPid();
if (!old_pid.equals(new_pid)) {
updateOldParentNode(old_pid);
if (StringUtils.isEmpty(new_pid)) {
subjectType.setPid("0");
}
if (!"0".equals(subjectType.getPid())) {
baseMapper.updateTreeNodeStatus(subjectType.getPid(), 0);
}
}
baseMapper.updateById(subjectType);
}
@Override
@Transactional
public void delete(String typeId) {
SubjectType byId = getById(typeId);
String pid = byId.getPid();
baseMapper.deleteById(typeId);
LambdaQueryWrapper<SubjectType> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(SubjectType::getPid,pid);
Integer count = baseMapper.selectCount(queryWrapper);
if (count == 0) {
baseMapper.updateTreeNodeStatus(pid,0);
}
}
@Override
public List<SubjectTreeVO> subjectAndTypeTree(String userId, String customerId) {
List<SubjectTreeVO> subjectTreeVOS = baseMapper.subjectAndTypeTree(userId, customerId);
List<SubjectTreeVO> tree = TreeUtil.tree(subjectTreeVOS, "0");
tree.forEach(this::subjectNumCount);
return tree;
}
@Override
public List<SubjectTreeVO> subjectAndCustomerTree(String userId,String customerId) {
List<SubjectTreeVO> subjectTreeVOS = baseMapper.enableCustomerList(customerId);
List<SubjectTreeVO> list = baseMapper.subjectAndCustomerTree(userId,customerId);
subjectTreeVOS.addAll(list);
List<SubjectTreeVO> tree = TreeUtil.tree(subjectTreeVOS, "0");
tree.forEach(this::subjectNumCount);
return tree;
}
private void subjectNumCount(SubjectTreeVO subjectTreeVO) {
Boolean ynSubject = subjectTreeVO.getYnSubject();
if (!ynSubject) {
int num = 0;
List<? extends Node> children = subjectTreeVO.getChildren();
if (CollectionUtils.isNotEmpty(children)) {
for (Node node : children) {
SubjectTreeVO subjectTreeNode = (SubjectTreeVO)node;
subjectNumCount(subjectTreeNode);
num = num + 1;
}
subjectTreeVO.setSubjectCount(num);
}
}
}
private void updateOldParentNode(String pid) {
if (!"0".equals(pid)) {
Integer count = baseMapper.selectCount(new QueryWrapper<SubjectType>().eq("pid", pid));
if (count == null || count <= 1) {
baseMapper.updateTreeNodeStatus(pid, 0);
}
}
}
}
package com.zzsn.event.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.SysUserDataPermission;
import com.zzsn.event.mapper.SysUserDataPermissionMapper;
import com.zzsn.event.service.ISysUserDataPermissionService;
import org.springframework.stereotype.Service;
/**
* @author lkg
* @description:
* @date 2022/6/20 14:10
*/
@Service
public class SysUserDataPermissionServiceImpl extends ServiceImpl<SysUserDataPermissionMapper, SysUserDataPermission> implements ISysUserDataPermissionService {
}
...@@ -67,4 +67,31 @@ public class ObjectUtil { ...@@ -67,4 +67,31 @@ public class ObjectUtil {
} }
return map; return map;
} }
/**
* 对象转map
*
* @param obj: 对象
* @author lkg
* @date 2023/2/17
*/
public static Map<String, Object> objectMap(Object obj) {
Map<String, Object> map = new HashMap<>();
if (obj == null) {
return map;
}
Class clazz = obj.getClass();
Field[] fields = clazz.getDeclaredFields();
try {
for (Field field : fields) {
field.setAccessible(true);
if(field.get(obj)!=null){
map.put(field.getName(), field.get(obj));
}
}
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
} }
package com.zzsn.event.util.user;
/**
* 用户信息
*
* @author lkg
* @date 2023/4/12
*/
public abstract class UserUtil {
private static final ThreadLocal<UserVo> USER_THREAD_LOCAL = new ThreadLocal<>();
public static UserVo getLoginUser(){
return USER_THREAD_LOCAL.get();
}
public static void setLoginUser(UserVo userVo) {
USER_THREAD_LOCAL.set(userVo);
}
public static void removeUser(){USER_THREAD_LOCAL.remove();}
}
package com.zzsn.event.util.user;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = false)
public class UserVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
private String userId;
/**
* 账号名
*/
private String username;
/**
* 真实姓名
*/
private String name;
/**
* 1-超级用户;2-普通用户;3-管理员用户(租户下)
*/
private Integer category;
/**
* 客户id
*/
private String customerId;
}
...@@ -7,11 +7,10 @@ import java.util.List; ...@@ -7,11 +7,10 @@ import java.util.List;
@Data @Data
public class AddEventParam extends Event { public class AddEventParam extends Event {
private String corn;
//0 do not 1 do 1
private Integer extractHotWords;
// time unit minute
private Integer period;
/**事件地域信息*/ /**事件地域信息*/
List<RegionVO> regionList; List<RegionVO> regionList;
/**事件分类id*/
private String subjectTypeId;
/**项目id*/
private String projectId;
} }
package com.zzsn.event.vo;
import lombok.Data;
/**
*
*
* @author lkg
* @date 2024/4/28
*/
@Data
public class EventNewPlatVO {
private String id;
private String eventName;
private Integer subjectInfoNum;
private Integer unCheckNum;
private Integer infoSourceNum;
private Integer keyWordsNum;
private String subjectTypeName;
private String projectName;
}
...@@ -38,6 +38,24 @@ public class EventVO { ...@@ -38,6 +38,24 @@ public class EventVO {
private String eventType; private String eventType;
/**事件分类名称*/ /**事件分类名称*/
private String typeName; private String typeName;
/**划分专题库*/
private String library;
/**定时单位(1分;2小时;3日:4月)*/
private String unit;
/**定时数值*/
private Integer space;
/***cron表达式*/
private String cron;
/**是否提取热词*/
private String ynExtractHotWords;
/**专题分类id*/
private String subjectTypeId;
/**项目id*/
private String projectId;
/**排序号*/
private Integer sortOrder;
/**是否生成分析报告*/ /**是否生成分析报告*/
private Boolean hasReport; private Boolean hasReport;
......
package com.zzsn.event.vo;
import lombok.Data;
import java.util.List;
/**
* @author lkg
* @description: 专题查询条件封装类
* @date 2022/6/21 20:00
*/
@Data
public class SubjectCondition {
/**专题id*/
private String id;
/**专题名称*/
private String subjectName;
/**项目id*/
private String projectId;
/**专题分类id(父节点)*/
private String subjectTypeId;
/**专题分类集合(父节点下子节点集合)*/
private List<String> typeIds;
/**状态*/
private Integer status;
/**开始时间*/
private String startTime;
/**结束时间*/
private String endTime;
/**用户id*/
private String userId;
/**客户id*/
private String customerId;
}
package com.zzsn.event.vo;
import lombok.Data;
/**
*
*
* @author lkg
* @date 2024/4/28
*/
@Data
public class SubjectSourceVO {
private String subjectId;
private String sourceId;
}
package com.zzsn.event.vo;
import com.zzsn.event.util.tree.Node;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author lkg
* @date 2024/4/29
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SubjectTreeVO extends Node {
private Boolean ynSubject;
private Integer subjectCount=0;
}
...@@ -123,6 +123,8 @@ scheduling: ...@@ -123,6 +123,8 @@ scheduling:
enable: false enable: false
serviceProject: serviceProject:
url: https://clb.ciglobal.cn/clb-api/datapull/ url: https://clb.ciglobal.cn/clb-api/datapull/
checkToken:
url: https://clb.ciglobal.cn/clb-api/sys/checkToken
scoreRule: scoreRule:
weekScore: 10 weekScore: 10
monthScore: 5 monthScore: 5
......
...@@ -120,6 +120,8 @@ scheduling: ...@@ -120,6 +120,8 @@ scheduling:
enable: true enable: true
serviceProject: serviceProject:
url: https://clb.ciglobal.cn/clb-api/datapull/ url: https://clb.ciglobal.cn/clb-api/datapull/
checkToken:
url: https://clb.ciglobal.cn/clb-api/sys/checkToken
scoreRule: scoreRule:
weekScore: 10 weekScore: 10
monthScore: 5 monthScore: 5
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论