forked from github/dataease
Merge pull request #139 from dataease/pr@dev@feat_message-center
feat: 消息中心
This commit is contained in:
commit
0baff3bfd7
@ -0,0 +1,12 @@
|
|||||||
|
package io.dataease.auth.service;
|
||||||
|
|
||||||
|
import io.dataease.commons.model.AuthURD;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public interface ExtAuthService {
|
||||||
|
|
||||||
|
Set<Long> userIdsByRD(AuthURD request);
|
||||||
|
|
||||||
|
AuthURD resourceTarget(String resourceId);
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package io.dataease.auth.service.impl;
|
||||||
|
|
||||||
|
import io.dataease.auth.service.ExtAuthService;
|
||||||
|
import io.dataease.base.domain.SysAuth;
|
||||||
|
import io.dataease.base.domain.SysAuthExample;
|
||||||
|
import io.dataease.base.mapper.SysAuthMapper;
|
||||||
|
import io.dataease.base.mapper.ext.ExtAuthMapper;
|
||||||
|
import io.dataease.commons.model.AuthURD;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ExtAuthServiceImpl implements ExtAuthService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtAuthMapper extAuthMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysAuthMapper sysAuthMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Long> userIdsByRD(AuthURD request) {
|
||||||
|
Set<Long> result = new HashSet<>();
|
||||||
|
List<Long> roleIds = request.getRoleIds();
|
||||||
|
List<Long> deptIds = request.getDeptIds();
|
||||||
|
if (!CollectionUtils.isEmpty(roleIds)) {
|
||||||
|
result.addAll(extAuthMapper.queryUserIdWithRoleIds(roleIds));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(deptIds)) {
|
||||||
|
result.addAll(extAuthMapper.queryUserIdWithDeptIds(deptIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AuthURD resourceTarget(String resourceId) {
|
||||||
|
AuthURD authURD = new AuthURD();
|
||||||
|
SysAuthExample example = new SysAuthExample();
|
||||||
|
example.createCriteria().andAuthSourceEqualTo(resourceId);
|
||||||
|
List<SysAuth> sysAuths = sysAuthMapper.selectByExample(example);
|
||||||
|
Map<String, List<SysAuth>> authMap = sysAuths.stream().collect(Collectors.groupingBy(SysAuth::getAuthTargetType));
|
||||||
|
if (!CollectionUtils.isEmpty(authMap.get("user"))) {
|
||||||
|
authURD.setUserIds(authMap.get("user").stream().map(item -> Long.parseLong(item.getAuthTarget())).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(authMap.get("role"))) {
|
||||||
|
authURD.setUserIds(authMap.get("role").stream().map(item -> Long.parseLong(item.getAuthTarget())).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(authMap.get("dept"))) {
|
||||||
|
authURD.setUserIds(authMap.get("dept").stream().map(item -> Long.parseLong(item.getAuthTarget())).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
return authURD;
|
||||||
|
}
|
||||||
|
}
|
27
backend/src/main/java/io/dataease/base/domain/SysMsg.java
Normal file
27
backend/src/main/java/io/dataease/base/domain/SysMsg.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysMsg implements Serializable {
|
||||||
|
private Long msgId;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
private String router;
|
||||||
|
|
||||||
|
private String param;
|
||||||
|
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
private Long readTime;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
770
backend/src/main/java/io/dataease/base/domain/SysMsgExample.java
Normal file
770
backend/src/main/java/io/dataease/base/domain/SysMsgExample.java
Normal file
@ -0,0 +1,770 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SysMsgExample {
|
||||||
|
protected String orderByClause;
|
||||||
|
|
||||||
|
protected boolean distinct;
|
||||||
|
|
||||||
|
protected List<Criteria> oredCriteria;
|
||||||
|
|
||||||
|
public SysMsgExample() {
|
||||||
|
oredCriteria = new ArrayList<Criteria>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderByClause(String orderByClause) {
|
||||||
|
this.orderByClause = orderByClause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrderByClause() {
|
||||||
|
return orderByClause;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistinct(boolean distinct) {
|
||||||
|
this.distinct = distinct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDistinct() {
|
||||||
|
return distinct;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criteria> getOredCriteria() {
|
||||||
|
return oredCriteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void or(Criteria criteria) {
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria or() {
|
||||||
|
Criteria criteria = createCriteriaInternal();
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria createCriteria() {
|
||||||
|
Criteria criteria = createCriteriaInternal();
|
||||||
|
if (oredCriteria.size() == 0) {
|
||||||
|
oredCriteria.add(criteria);
|
||||||
|
}
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criteria createCriteriaInternal() {
|
||||||
|
Criteria criteria = new Criteria();
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
oredCriteria.clear();
|
||||||
|
orderByClause = null;
|
||||||
|
distinct = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract static class GeneratedCriteria {
|
||||||
|
protected List<Criterion> criteria;
|
||||||
|
|
||||||
|
protected GeneratedCriteria() {
|
||||||
|
super();
|
||||||
|
criteria = new ArrayList<Criterion>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid() {
|
||||||
|
return criteria.size() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criterion> getAllCriteria() {
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Criterion> getCriteria() {
|
||||||
|
return criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition) {
|
||||||
|
if (condition == null) {
|
||||||
|
throw new RuntimeException("Value for condition cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition, Object value, String property) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||||
|
if (value1 == null || value2 == null) {
|
||||||
|
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||||
|
}
|
||||||
|
criteria.add(new Criterion(condition, value1, value2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdIsNull() {
|
||||||
|
addCriterion("msg_id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdIsNotNull() {
|
||||||
|
addCriterion("msg_id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdEqualTo(Long value) {
|
||||||
|
addCriterion("msg_id =", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdNotEqualTo(Long value) {
|
||||||
|
addCriterion("msg_id <>", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdGreaterThan(Long value) {
|
||||||
|
addCriterion("msg_id >", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("msg_id >=", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdLessThan(Long value) {
|
||||||
|
addCriterion("msg_id <", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("msg_id <=", value, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdIn(List<Long> values) {
|
||||||
|
addCriterion("msg_id in", values, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdNotIn(List<Long> values) {
|
||||||
|
addCriterion("msg_id not in", values, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("msg_id between", value1, value2, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andMsgIdNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("msg_id not between", value1, value2, "msgId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdIsNull() {
|
||||||
|
addCriterion("user_id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdIsNotNull() {
|
||||||
|
addCriterion("user_id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdEqualTo(Long value) {
|
||||||
|
addCriterion("user_id =", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdNotEqualTo(Long value) {
|
||||||
|
addCriterion("user_id <>", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdGreaterThan(Long value) {
|
||||||
|
addCriterion("user_id >", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("user_id >=", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdLessThan(Long value) {
|
||||||
|
addCriterion("user_id <", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("user_id <=", value, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdIn(List<Long> values) {
|
||||||
|
addCriterion("user_id in", values, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdNotIn(List<Long> values) {
|
||||||
|
addCriterion("user_id not in", values, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("user_id between", value1, value2, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andUserIdNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("user_id not between", value1, value2, "userId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeIsNull() {
|
||||||
|
addCriterion("`type` is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeIsNotNull() {
|
||||||
|
addCriterion("`type` is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeEqualTo(Integer value) {
|
||||||
|
addCriterion("`type` =", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeNotEqualTo(Integer value) {
|
||||||
|
addCriterion("`type` <>", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeGreaterThan(Integer value) {
|
||||||
|
addCriterion("`type` >", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("`type` >=", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeLessThan(Integer value) {
|
||||||
|
addCriterion("`type` <", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeLessThanOrEqualTo(Integer value) {
|
||||||
|
addCriterion("`type` <=", value, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeIn(List<Integer> values) {
|
||||||
|
addCriterion("`type` in", values, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeNotIn(List<Integer> values) {
|
||||||
|
addCriterion("`type` not in", values, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("`type` between", value1, value2, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
|
||||||
|
addCriterion("`type` not between", value1, value2, "type");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusIsNull() {
|
||||||
|
addCriterion("`status` is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusIsNotNull() {
|
||||||
|
addCriterion("`status` is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusEqualTo(Boolean value) {
|
||||||
|
addCriterion("`status` =", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusNotEqualTo(Boolean value) {
|
||||||
|
addCriterion("`status` <>", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusGreaterThan(Boolean value) {
|
||||||
|
addCriterion("`status` >", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusGreaterThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("`status` >=", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusLessThan(Boolean value) {
|
||||||
|
addCriterion("`status` <", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusLessThanOrEqualTo(Boolean value) {
|
||||||
|
addCriterion("`status` <=", value, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusIn(List<Boolean> values) {
|
||||||
|
addCriterion("`status` in", values, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusNotIn(List<Boolean> values) {
|
||||||
|
addCriterion("`status` not in", values, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("`status` between", value1, value2, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andStatusNotBetween(Boolean value1, Boolean value2) {
|
||||||
|
addCriterion("`status` not between", value1, value2, "status");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterIsNull() {
|
||||||
|
addCriterion("router is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterIsNotNull() {
|
||||||
|
addCriterion("router is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterEqualTo(String value) {
|
||||||
|
addCriterion("router =", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterNotEqualTo(String value) {
|
||||||
|
addCriterion("router <>", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterGreaterThan(String value) {
|
||||||
|
addCriterion("router >", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("router >=", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterLessThan(String value) {
|
||||||
|
addCriterion("router <", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("router <=", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterLike(String value) {
|
||||||
|
addCriterion("router like", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterNotLike(String value) {
|
||||||
|
addCriterion("router not like", value, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterIn(List<String> values) {
|
||||||
|
addCriterion("router in", values, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterNotIn(List<String> values) {
|
||||||
|
addCriterion("router not in", values, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterBetween(String value1, String value2) {
|
||||||
|
addCriterion("router between", value1, value2, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andRouterNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("router not between", value1, value2, "router");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamIsNull() {
|
||||||
|
addCriterion("param is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamIsNotNull() {
|
||||||
|
addCriterion("param is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamEqualTo(String value) {
|
||||||
|
addCriterion("param =", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamNotEqualTo(String value) {
|
||||||
|
addCriterion("param <>", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamGreaterThan(String value) {
|
||||||
|
addCriterion("param >", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("param >=", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamLessThan(String value) {
|
||||||
|
addCriterion("param <", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("param <=", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamLike(String value) {
|
||||||
|
addCriterion("param like", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamNotLike(String value) {
|
||||||
|
addCriterion("param not like", value, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamIn(List<String> values) {
|
||||||
|
addCriterion("param in", values, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamNotIn(List<String> values) {
|
||||||
|
addCriterion("param not in", values, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamBetween(String value1, String value2) {
|
||||||
|
addCriterion("param between", value1, value2, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andParamNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("param not between", value1, value2, "param");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeIsNull() {
|
||||||
|
addCriterion("create_time is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeIsNotNull() {
|
||||||
|
addCriterion("create_time is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeEqualTo(Long value) {
|
||||||
|
addCriterion("create_time =", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeNotEqualTo(Long value) {
|
||||||
|
addCriterion("create_time <>", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeGreaterThan(Long value) {
|
||||||
|
addCriterion("create_time >", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("create_time >=", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeLessThan(Long value) {
|
||||||
|
addCriterion("create_time <", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("create_time <=", value, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeIn(List<Long> values) {
|
||||||
|
addCriterion("create_time in", values, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeNotIn(List<Long> values) {
|
||||||
|
addCriterion("create_time not in", values, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("create_time between", value1, value2, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("create_time not between", value1, value2, "createTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeIsNull() {
|
||||||
|
addCriterion("read_time is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeIsNotNull() {
|
||||||
|
addCriterion("read_time is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeEqualTo(Long value) {
|
||||||
|
addCriterion("read_time =", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeNotEqualTo(Long value) {
|
||||||
|
addCriterion("read_time <>", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeGreaterThan(Long value) {
|
||||||
|
addCriterion("read_time >", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("read_time >=", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeLessThan(Long value) {
|
||||||
|
addCriterion("read_time <", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("read_time <=", value, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeIn(List<Long> values) {
|
||||||
|
addCriterion("read_time in", values, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeNotIn(List<Long> values) {
|
||||||
|
addCriterion("read_time not in", values, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("read_time between", value1, value2, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andReadTimeNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("read_time not between", value1, value2, "readTime");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentIsNull() {
|
||||||
|
addCriterion("content is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentIsNotNull() {
|
||||||
|
addCriterion("content is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentEqualTo(String value) {
|
||||||
|
addCriterion("content =", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentNotEqualTo(String value) {
|
||||||
|
addCriterion("content <>", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentGreaterThan(String value) {
|
||||||
|
addCriterion("content >", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentGreaterThanOrEqualTo(String value) {
|
||||||
|
addCriterion("content >=", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentLessThan(String value) {
|
||||||
|
addCriterion("content <", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentLessThanOrEqualTo(String value) {
|
||||||
|
addCriterion("content <=", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentLike(String value) {
|
||||||
|
addCriterion("content like", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentNotLike(String value) {
|
||||||
|
addCriterion("content not like", value, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentIn(List<String> values) {
|
||||||
|
addCriterion("content in", values, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentNotIn(List<String> values) {
|
||||||
|
addCriterion("content not in", values, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentBetween(String value1, String value2) {
|
||||||
|
addCriterion("content between", value1, value2, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andContentNotBetween(String value1, String value2) {
|
||||||
|
addCriterion("content not between", value1, value2, "content");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Criteria extends GeneratedCriteria {
|
||||||
|
|
||||||
|
protected Criteria() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Criterion {
|
||||||
|
private String condition;
|
||||||
|
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
private Object secondValue;
|
||||||
|
|
||||||
|
private boolean noValue;
|
||||||
|
|
||||||
|
private boolean singleValue;
|
||||||
|
|
||||||
|
private boolean betweenValue;
|
||||||
|
|
||||||
|
private boolean listValue;
|
||||||
|
|
||||||
|
private String typeHandler;
|
||||||
|
|
||||||
|
public String getCondition() {
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getSecondValue() {
|
||||||
|
return secondValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNoValue() {
|
||||||
|
return noValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSingleValue() {
|
||||||
|
return singleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBetweenValue() {
|
||||||
|
return betweenValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isListValue() {
|
||||||
|
return listValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTypeHandler() {
|
||||||
|
return typeHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.typeHandler = null;
|
||||||
|
this.noValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, String typeHandler) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.value = value;
|
||||||
|
this.typeHandler = typeHandler;
|
||||||
|
if (value instanceof List<?>) {
|
||||||
|
this.listValue = true;
|
||||||
|
} else {
|
||||||
|
this.singleValue = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value) {
|
||||||
|
this(condition, value, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||||
|
super();
|
||||||
|
this.condition = condition;
|
||||||
|
this.value = value;
|
||||||
|
this.secondValue = secondValue;
|
||||||
|
this.typeHandler = typeHandler;
|
||||||
|
this.betweenValue = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Criterion(String condition, Object value, Object secondValue) {
|
||||||
|
this(condition, value, secondValue, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package io.dataease.base.mapper;
|
||||||
|
|
||||||
|
import io.dataease.base.domain.SysMsg;
|
||||||
|
import io.dataease.base.domain.SysMsgExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface SysMsgMapper {
|
||||||
|
long countByExample(SysMsgExample example);
|
||||||
|
|
||||||
|
int deleteByExample(SysMsgExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Long msgId);
|
||||||
|
|
||||||
|
int insert(SysMsg record);
|
||||||
|
|
||||||
|
int insertSelective(SysMsg record);
|
||||||
|
|
||||||
|
List<SysMsg> selectByExample(SysMsgExample example);
|
||||||
|
|
||||||
|
SysMsg selectByPrimaryKey(Long msgId);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") SysMsg record, @Param("example") SysMsgExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") SysMsg record, @Param("example") SysMsgExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(SysMsg record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(SysMsg record);
|
||||||
|
}
|
275
backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml
Normal file
275
backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
<?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="io.dataease.base.mapper.SysMsgMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysMsg">
|
||||||
|
<id column="msg_id" jdbcType="BIGINT" property="msgId" />
|
||||||
|
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
||||||
|
<result column="type" jdbcType="INTEGER" property="type" />
|
||||||
|
<result column="status" jdbcType="BIT" property="status" />
|
||||||
|
<result column="router" jdbcType="VARCHAR" property="router" />
|
||||||
|
<result column="param" jdbcType="VARCHAR" property="param" />
|
||||||
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
|
<result column="read_time" jdbcType="BIGINT" property="readTime" />
|
||||||
|
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
msg_id, user_id, `type`, `status`, router, param, create_time, read_time, content
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="io.dataease.base.domain.SysMsgExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from sys_msg
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from sys_msg
|
||||||
|
where msg_id = #{msgId,jdbcType=BIGINT}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
|
delete from sys_msg
|
||||||
|
where msg_id = #{msgId,jdbcType=BIGINT}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysMsgExample">
|
||||||
|
delete from sys_msg
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="io.dataease.base.domain.SysMsg">
|
||||||
|
insert into sys_msg (msg_id, user_id, `type`,
|
||||||
|
`status`, router, param,
|
||||||
|
create_time, read_time, content
|
||||||
|
)
|
||||||
|
values (#{msgId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER},
|
||||||
|
#{status,jdbcType=BIT}, #{router,jdbcType=VARCHAR}, #{param,jdbcType=VARCHAR},
|
||||||
|
#{createTime,jdbcType=BIGINT}, #{readTime,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysMsg">
|
||||||
|
insert into sys_msg
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="msgId != null">
|
||||||
|
msg_id,
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
user_id,
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
`type`,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status`,
|
||||||
|
</if>
|
||||||
|
<if test="router != null">
|
||||||
|
router,
|
||||||
|
</if>
|
||||||
|
<if test="param != null">
|
||||||
|
param,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="readTime != null">
|
||||||
|
read_time,
|
||||||
|
</if>
|
||||||
|
<if test="content != null">
|
||||||
|
content,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="msgId != null">
|
||||||
|
#{msgId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
#{userId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
#{type,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
#{status,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
<if test="router != null">
|
||||||
|
#{router,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="param != null">
|
||||||
|
#{param,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="readTime != null">
|
||||||
|
#{readTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="content != null">
|
||||||
|
#{content,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="io.dataease.base.domain.SysMsgExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from sys_msg
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update sys_msg
|
||||||
|
<set>
|
||||||
|
<if test="record.msgId != null">
|
||||||
|
msg_id = #{record.msgId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.userId != null">
|
||||||
|
user_id = #{record.userId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.type != null">
|
||||||
|
`type` = #{record.type,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.status != null">
|
||||||
|
`status` = #{record.status,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
<if test="record.router != null">
|
||||||
|
router = #{record.router,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.param != null">
|
||||||
|
param = #{record.param,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.readTime != null">
|
||||||
|
read_time = #{record.readTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.content != null">
|
||||||
|
content = #{record.content,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update sys_msg
|
||||||
|
set msg_id = #{record.msgId,jdbcType=BIGINT},
|
||||||
|
user_id = #{record.userId,jdbcType=BIGINT},
|
||||||
|
`type` = #{record.type,jdbcType=INTEGER},
|
||||||
|
`status` = #{record.status,jdbcType=BIT},
|
||||||
|
router = #{record.router,jdbcType=VARCHAR},
|
||||||
|
param = #{record.param,jdbcType=VARCHAR},
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
read_time = #{record.readTime,jdbcType=BIGINT},
|
||||||
|
content = #{record.content,jdbcType=VARCHAR}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysMsg">
|
||||||
|
update sys_msg
|
||||||
|
<set>
|
||||||
|
<if test="userId != null">
|
||||||
|
user_id = #{userId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
`type` = #{type,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status` = #{status,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
<if test="router != null">
|
||||||
|
router = #{router,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="param != null">
|
||||||
|
param = #{param,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="readTime != null">
|
||||||
|
read_time = #{readTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="content != null">
|
||||||
|
content = #{content,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where msg_id = #{msgId,jdbcType=BIGINT}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysMsg">
|
||||||
|
update sys_msg
|
||||||
|
set user_id = #{userId,jdbcType=BIGINT},
|
||||||
|
`type` = #{type,jdbcType=INTEGER},
|
||||||
|
`status` = #{status,jdbcType=BIT},
|
||||||
|
router = #{router,jdbcType=VARCHAR},
|
||||||
|
param = #{param,jdbcType=VARCHAR},
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
read_time = #{readTime,jdbcType=BIGINT},
|
||||||
|
content = #{content,jdbcType=VARCHAR}
|
||||||
|
where msg_id = #{msgId,jdbcType=BIGINT}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -0,0 +1,17 @@
|
|||||||
|
package io.dataease.base.mapper.ext;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface ExtAuthMapper {
|
||||||
|
|
||||||
|
List<Long> queryUserIdWithRoleIds(@Param("roleIds") List<Long> roleIds);
|
||||||
|
|
||||||
|
List<Long> queryUserIdWithDeptIds(@Param("deptIds") List<Long> deptIds);
|
||||||
|
|
||||||
|
|
||||||
|
// Set<Long> queryUserIdWithRD(@Param("roleIds") List<Long> roleIds, @Param("deptIds") List<Long> deptIds);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
<?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="io.dataease.base.mapper.ext.ExtAuthMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryUserIdWithRoleIds" resultType="java.lang.Long" >
|
||||||
|
select user_id
|
||||||
|
from sys_users_roles
|
||||||
|
where role_id in
|
||||||
|
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
|
||||||
|
#{roleId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryUserIdWithDeptIds" resultType="java.lang.Long" >
|
||||||
|
select user_id
|
||||||
|
from sys_user
|
||||||
|
where dept_id in
|
||||||
|
<foreach collection="deptIds" item="deptId" open='(' separator=',' close=')'>
|
||||||
|
#{deptId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
@ -15,4 +15,8 @@ public interface ExtPanelShareMapper {
|
|||||||
List<PanelSharePo> query(Map<String, Object> param);
|
List<PanelSharePo> query(Map<String, Object> param);
|
||||||
|
|
||||||
List<PanelShare> queryWithResource(GridExample example);
|
List<PanelShare> queryWithResource(GridExample example);
|
||||||
|
|
||||||
|
List<Long> queryUserIdWithRoleIds(Map<String, List<Long>> param);
|
||||||
|
|
||||||
|
List<Long> queryUserIdWithDeptIds(Map<String, List<Long>> param);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,24 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryUserIdWithRoleIds" resultType="java.lang.Long" >
|
||||||
|
select user_id
|
||||||
|
from sys_users_roles
|
||||||
|
where role_id in
|
||||||
|
<foreach collection="roleIds" item="roleId" open='(' separator=',' close=')'>
|
||||||
|
#{roleId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryUserIdWithDeptIds" resultType="java.lang.Long" >
|
||||||
|
select user_id
|
||||||
|
from sys_user
|
||||||
|
where dept_id in
|
||||||
|
<foreach collection="deptIds" item="deptId" open='(' separator=',' close=')'>
|
||||||
|
#{deptId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
19
backend/src/main/java/io/dataease/commons/model/AuthURD.java
Normal file
19
backend/src/main/java/io/dataease/commons/model/AuthURD.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package io.dataease.commons.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AuthURD implements Serializable {
|
||||||
|
|
||||||
|
private List<Long> userIds;
|
||||||
|
|
||||||
|
private List<Long> deptIds;
|
||||||
|
|
||||||
|
private List<Long> roleIds;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,23 +1,41 @@
|
|||||||
package io.dataease.commons.utils;
|
package io.dataease.commons.utils;
|
||||||
|
|
||||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||||
import io.dataease.service.sys.SysUserService;
|
import io.dataease.auth.service.ExtAuthService;
|
||||||
|
import io.dataease.commons.model.AuthURD;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class AuthUtils {
|
public class AuthUtils {
|
||||||
|
|
||||||
private static SysUserService sysUserService;
|
private static ExtAuthService extAuthService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setSysUserService(SysUserService sysUserService) {
|
public void setExtAuthService(ExtAuthService extAuthService) {
|
||||||
AuthUtils.sysUserService = sysUserService;
|
AuthUtils.extAuthService = extAuthService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CurrentUserDto getUser(){
|
public static CurrentUserDto getUser(){
|
||||||
CurrentUserDto userDto = (CurrentUserDto)SecurityUtils.getSubject().getPrincipal();
|
CurrentUserDto userDto = (CurrentUserDto)SecurityUtils.getSubject().getPrincipal();
|
||||||
return userDto;
|
return userDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据组织 角色 用户 获取下属用户ID
|
||||||
|
public static Set<Long> userIdsByURD(AuthURD request) {
|
||||||
|
Set<Long> userIds = extAuthService.userIdsByRD(request);
|
||||||
|
if (!CollectionUtils.isEmpty(request.getUserIds())) {
|
||||||
|
userIds.addAll(request.getUserIds());
|
||||||
|
}
|
||||||
|
return userIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取资源对那些人/角色/组织 有权限
|
||||||
|
public static AuthURD authURDR(String resourceId) {
|
||||||
|
return extAuthService.resourceTarget(resourceId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package io.dataease.controller.message;
|
||||||
|
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import io.dataease.base.domain.SysMsg;
|
||||||
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
|
import io.dataease.commons.utils.PageUtils;
|
||||||
|
import io.dataease.commons.utils.Pager;
|
||||||
|
import io.dataease.controller.message.dto.MsgRequest;
|
||||||
|
import io.dataease.service.message.SysMsgService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Api(tags = "系统:消息管理")
|
||||||
|
@RequestMapping("/api/sys_msg")
|
||||||
|
@RestController
|
||||||
|
public class MsgController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysMsgService sysMsgService;
|
||||||
|
|
||||||
|
@ApiOperation("查询消息")
|
||||||
|
@PostMapping("/list/{goPage}/{pageSize}")
|
||||||
|
public Pager<List<SysMsg>> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) {
|
||||||
|
Long userId = AuthUtils.getUser().getUserId();
|
||||||
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
|
Pager<List<SysMsg>> listPager = PageUtils.setPageInfo(page, sysMsgService.query(userId, msgRequest));
|
||||||
|
return listPager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/setReaded/{msgId}")
|
||||||
|
public void setReaded(@PathVariable Long msgId) {
|
||||||
|
sysMsgService.setReaded(msgId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package io.dataease.controller.message.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MsgRequest implements Serializable {
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
private Boolean status;
|
||||||
|
}
|
@ -10,10 +10,8 @@ import io.dataease.commons.constants.JdbcConstants;
|
|||||||
import io.dataease.commons.constants.JobStatus;
|
import io.dataease.commons.constants.JobStatus;
|
||||||
import io.dataease.commons.constants.ScheduleType;
|
import io.dataease.commons.constants.ScheduleType;
|
||||||
import io.dataease.commons.constants.UpdateType;
|
import io.dataease.commons.constants.UpdateType;
|
||||||
import io.dataease.commons.utils.CommonBeanFactory;
|
import io.dataease.commons.model.AuthURD;
|
||||||
import io.dataease.commons.utils.DorisTableUtils;
|
import io.dataease.commons.utils.*;
|
||||||
import io.dataease.commons.utils.HttpClientUtil;
|
|
||||||
import io.dataease.commons.utils.LogUtil;
|
|
||||||
import io.dataease.datasource.constants.DatasourceTypes;
|
import io.dataease.datasource.constants.DatasourceTypes;
|
||||||
import io.dataease.datasource.dto.*;
|
import io.dataease.datasource.dto.*;
|
||||||
import io.dataease.datasource.provider.DatasourceProvider;
|
import io.dataease.datasource.provider.DatasourceProvider;
|
||||||
@ -24,6 +22,7 @@ import io.dataease.dto.dataset.DataTableInfoDTO;
|
|||||||
import io.dataease.exception.DataEaseException;
|
import io.dataease.exception.DataEaseException;
|
||||||
import io.dataease.listener.util.CacheUtils;
|
import io.dataease.listener.util.CacheUtils;
|
||||||
import io.dataease.provider.QueryProvider;
|
import io.dataease.provider.QueryProvider;
|
||||||
|
import io.dataease.service.message.DeMsgutil;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -74,8 +73,7 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -206,10 +204,15 @@ public class ExtractDataService {
|
|||||||
extractData(datasetTable, "all_scope");
|
extractData(datasetTable, "all_scope");
|
||||||
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
replaceTable(DorisTableUtils.dorisName(datasetTableId));
|
||||||
saveSucessLog(datasetTableTaskLog);
|
saveSucessLog(datasetTableTaskLog);
|
||||||
|
|
||||||
|
sendWebMsg(datasetTable, taskId,true);
|
||||||
|
|
||||||
// deleteFile("all_scope", datasetTableId);
|
// deleteFile("all_scope", datasetTableId);
|
||||||
|
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
saveErrorLog(datasetTableId, taskId, e);
|
saveErrorLog(datasetTableId, taskId, e);
|
||||||
|
sendWebMsg(datasetTable, taskId,false);
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||||
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
|
dropDorisTable(DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTableId)));
|
||||||
// deleteFile("all_scope", datasetTableId);
|
// deleteFile("all_scope", datasetTableId);
|
||||||
@ -230,6 +233,7 @@ public class ExtractDataService {
|
|||||||
Long execTime = System.currentTimeMillis();
|
Long execTime = System.currentTimeMillis();
|
||||||
extractData(datasetTable, "incremental_add");
|
extractData(datasetTable, "incremental_add");
|
||||||
saveSucessLog(datasetTableTaskLog);
|
saveSucessLog(datasetTableTaskLog);
|
||||||
|
sendWebMsg(datasetTable, taskId,true);
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||||
}else {
|
}else {
|
||||||
DatasetTableIncrementalConfig datasetTableIncrementalConfig = dataSetTableService.incrementalConfig(datasetTableId);
|
DatasetTableIncrementalConfig datasetTableIncrementalConfig = dataSetTableService.incrementalConfig(datasetTableId);
|
||||||
@ -267,12 +271,17 @@ public class ExtractDataService {
|
|||||||
extractData(datasetTable, "incremental_delete");
|
extractData(datasetTable, "incremental_delete");
|
||||||
}
|
}
|
||||||
saveSucessLog(datasetTableTaskLog);
|
saveSucessLog(datasetTableTaskLog);
|
||||||
|
|
||||||
|
sendWebMsg(datasetTable, taskId,true);
|
||||||
|
|
||||||
// deleteFile("incremental_add", datasetTableId);
|
// deleteFile("incremental_add", datasetTableId);
|
||||||
// deleteFile("incremental_delete", datasetTableId);
|
// deleteFile("incremental_delete", datasetTableId);
|
||||||
|
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed, execTime);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
saveErrorLog(datasetTableId, taskId, e);
|
saveErrorLog(datasetTableId, taskId, e);
|
||||||
|
sendWebMsg(datasetTable, taskId,false);
|
||||||
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
updateTableStatus(datasetTableId, datasetTable, JobStatus.Error, null);
|
||||||
// deleteFile("incremental_add", datasetTableId);
|
// deleteFile("incremental_add", datasetTableId);
|
||||||
// deleteFile("incremental_delete", datasetTableId);
|
// deleteFile("incremental_delete", datasetTableId);
|
||||||
@ -294,6 +303,20 @@ public class ExtractDataService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendWebMsg(DatasetTable datasetTable, String taskId, Boolean status) {
|
||||||
|
String msg = status ? "成功" : "失败";
|
||||||
|
String id = datasetTable.getId();
|
||||||
|
AuthURD authURD = AuthUtils.authURDR(id);
|
||||||
|
Set<Long> userIds = AuthUtils.userIdsByURD(authURD);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
userIds.forEach(userId -> {
|
||||||
|
Map<String,Object> param = new HashMap<>();
|
||||||
|
param.put("tableId", id);
|
||||||
|
param.put("taskId", taskId);
|
||||||
|
DeMsgutil.sendMsg(userId, 1, "数据集【"+datasetTable.getName()+"】同步"+msg, gson.toJson(param));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void updateTableStatus(String datasetTableId, DatasetTable datasetTable, JobStatus completed, Long execTime) {
|
private void updateTableStatus(String datasetTableId, DatasetTable datasetTable, JobStatus completed, Long execTime) {
|
||||||
datasetTable.setSyncStatus(completed.name());
|
datasetTable.setSyncStatus(completed.name());
|
||||||
if(execTime != null){
|
if(execTime != null){
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package io.dataease.service.message;
|
||||||
|
|
||||||
|
import io.dataease.base.domain.SysMsg;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DeMsgutil {
|
||||||
|
|
||||||
|
private static Map<Integer, String> routerMap ;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
routerMap = new HashMap<>();
|
||||||
|
routerMap.put(0, "panel");
|
||||||
|
routerMap.put(1, "dataset");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static SysMsgService sysMsgService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setSysMsgService(SysMsgService sysMsgService) {
|
||||||
|
DeMsgutil.sysMsgService = sysMsgService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendMsg(Long userId, int type, String content) {
|
||||||
|
SysMsg sysMsg = new SysMsg();
|
||||||
|
sysMsg.setUserId(userId);
|
||||||
|
sysMsg.setType(type);
|
||||||
|
sysMsg.setContent(content);
|
||||||
|
sysMsg.setRouter(routerMap.get(type));
|
||||||
|
sysMsg.setStatus(false);
|
||||||
|
sysMsg.setCreateTime(System.currentTimeMillis());
|
||||||
|
sysMsgService.save(sysMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendMsg(Long userId, int type, String content, String param) {
|
||||||
|
SysMsg sysMsg = new SysMsg();
|
||||||
|
sysMsg.setUserId(userId);
|
||||||
|
sysMsg.setType(type);
|
||||||
|
sysMsg.setContent(content);
|
||||||
|
sysMsg.setRouter(routerMap.get(type));
|
||||||
|
sysMsg.setStatus(false);
|
||||||
|
sysMsg.setCreateTime(System.currentTimeMillis());
|
||||||
|
sysMsg.setParam(param);
|
||||||
|
sysMsgService.save(sysMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package io.dataease.service.message;
|
||||||
|
|
||||||
|
|
||||||
|
import io.dataease.base.domain.SysMsg;
|
||||||
|
import io.dataease.base.domain.SysMsgExample;
|
||||||
|
import io.dataease.base.mapper.SysMsgMapper;
|
||||||
|
import io.dataease.controller.message.dto.MsgRequest;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SysMsgService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysMsgMapper sysMsgMapper;
|
||||||
|
|
||||||
|
public List<SysMsg> query(Long userId, MsgRequest msgRequest) {
|
||||||
|
String orderClause = "";
|
||||||
|
SysMsgExample example = new SysMsgExample();
|
||||||
|
SysMsgExample.Criteria criteria = example.createCriteria();
|
||||||
|
criteria.andUserIdEqualTo(userId);
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(msgRequest.getType())) {
|
||||||
|
criteria.andTypeEqualTo(msgRequest.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(msgRequest.getStatus())) {
|
||||||
|
criteria.andStatusEqualTo(msgRequest.getStatus());
|
||||||
|
}else {
|
||||||
|
orderClause += " status asc ,";
|
||||||
|
}
|
||||||
|
|
||||||
|
orderClause += " create_time desc";
|
||||||
|
example.setOrderByClause(orderClause);
|
||||||
|
List<SysMsg> sysMsgs = sysMsgMapper.selectByExample(example);
|
||||||
|
return sysMsgs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReaded(Long msgId) {
|
||||||
|
SysMsg sysMsg = new SysMsg();
|
||||||
|
sysMsg.setMsgId(msgId);
|
||||||
|
sysMsg.setStatus(true);
|
||||||
|
sysMsgMapper.updateByPrimaryKeySelective(sysMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(SysMsg sysMsg) {
|
||||||
|
// sysMsg.setStatus(false);
|
||||||
|
// sysMsg.setCreateTime(System.currentTimeMillis());
|
||||||
|
sysMsgMapper.insert(sysMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(SysMsg sysMsg) {
|
||||||
|
|
||||||
|
sysMsgMapper.updateByPrimaryKey(sysMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,16 @@
|
|||||||
package io.dataease.service.panel;
|
package io.dataease.service.panel;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
import io.dataease.auth.api.dto.CurrentRoleDto;
|
import io.dataease.auth.api.dto.CurrentRoleDto;
|
||||||
import io.dataease.auth.api.dto.CurrentUserDto;
|
import io.dataease.auth.api.dto.CurrentUserDto;
|
||||||
|
import io.dataease.base.domain.PanelGroup;
|
||||||
import io.dataease.base.domain.PanelShare;
|
import io.dataease.base.domain.PanelShare;
|
||||||
import io.dataease.base.domain.PanelShareExample;
|
import io.dataease.base.domain.PanelShareExample;
|
||||||
|
import io.dataease.base.mapper.PanelGroupMapper;
|
||||||
import io.dataease.base.mapper.PanelShareMapper;
|
import io.dataease.base.mapper.PanelShareMapper;
|
||||||
import io.dataease.base.mapper.ext.ExtPanelShareMapper;
|
import io.dataease.base.mapper.ext.ExtPanelShareMapper;
|
||||||
import io.dataease.base.mapper.ext.query.GridExample;
|
import io.dataease.base.mapper.ext.query.GridExample;
|
||||||
|
import io.dataease.commons.model.AuthURD;
|
||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
import io.dataease.commons.utils.BeanUtils;
|
import io.dataease.commons.utils.BeanUtils;
|
||||||
import io.dataease.commons.utils.CommonBeanFactory;
|
import io.dataease.commons.utils.CommonBeanFactory;
|
||||||
@ -14,15 +18,14 @@ import io.dataease.controller.request.panel.PanelShareRequest;
|
|||||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||||
import io.dataease.dto.panel.PanelShareDto;
|
import io.dataease.dto.panel.PanelShareDto;
|
||||||
import io.dataease.dto.panel.PanelSharePo;
|
import io.dataease.dto.panel.PanelSharePo;
|
||||||
|
import io.dataease.service.message.DeMsgutil;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -32,13 +35,15 @@ public class ShareService {
|
|||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private PanelShareMapper mapper;
|
private PanelShareMapper mapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PanelGroupMapper panelGroupMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExtPanelShareMapper extPanelShareMapper;
|
private ExtPanelShareMapper extPanelShareMapper;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void save(PanelShareRequest request){
|
public void save(PanelShareRequest request){
|
||||||
|
List<PanelGroup> panelGroups = queryGroup(request.getPanelIds());
|
||||||
//1.先根据仪表板删除所有已经分享的
|
//1.先根据仪表板删除所有已经分享的
|
||||||
Integer type = request.getType();
|
Integer type = request.getType();
|
||||||
List<String> panelIds = request.getPanelIds();
|
List<String> panelIds = request.getPanelIds();
|
||||||
@ -66,6 +71,33 @@ public class ShareService {
|
|||||||
if (CollectionUtils.isNotEmpty(shares)){
|
if (CollectionUtils.isNotEmpty(shares)){
|
||||||
extPanelShareMapper.batchInsert(shares);
|
extPanelShareMapper.batchInsert(shares);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下面是发送提醒消息逻辑
|
||||||
|
Set<Long> userIdSet = new HashSet<Long>();
|
||||||
|
AuthURD authURD = new AuthURD();
|
||||||
|
if (type == 0) {
|
||||||
|
authURD.setUserIds(targetIds);
|
||||||
|
}
|
||||||
|
if (type == 1) {
|
||||||
|
authURD.setRoleIds(targetIds);
|
||||||
|
}
|
||||||
|
if(type == 2) {
|
||||||
|
authURD.setDeptIds(targetIds);
|
||||||
|
}
|
||||||
|
userIdSet = AuthUtils.userIdsByURD(authURD);
|
||||||
|
|
||||||
|
CurrentUserDto user = AuthUtils.getUser();
|
||||||
|
String msg = StringUtils.joinWith(",", panelGroups.stream().map(PanelGroup::getName).collect(Collectors.toList()));
|
||||||
|
Gson gson = new Gson();
|
||||||
|
userIdSet.forEach(userId -> {
|
||||||
|
// DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!");
|
||||||
|
DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!", gson.toJson(panelIds));
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<PanelGroup> queryGroup(List<String> panelIds) {
|
||||||
|
return panelIds.stream().map(panelGroupMapper::selectByPrimaryKey).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
19
backend/src/main/resources/db/migration/V10__web_msg.sql
Normal file
19
backend/src/main/resources/db/migration/V10__web_msg.sql
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sys_msg
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sys_msg`;
|
||||||
|
CREATE TABLE `sys_msg` (
|
||||||
|
`msg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '消息主键',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||||
|
`type` int(4) NOT NULL COMMENT '类型',
|
||||||
|
`status` tinyint(1) NOT NULL COMMENT '状态',
|
||||||
|
`router` varchar(255) DEFAULT NULL COMMENT '跳转路由',
|
||||||
|
`param` varchar(255) DEFAULT NULL COMMENT '路由参数',
|
||||||
|
`create_time` bigint(13) NOT NULL COMMENT '发送时间',
|
||||||
|
`read_time` bigint(13) DEFAULT NULL COMMENT '读取时间',
|
||||||
|
`content` varchar(255) DEFAULT NULL COMMENT '消息内容',
|
||||||
|
PRIMARY KEY (`msg_id`) USING BTREE,
|
||||||
|
KEY `inx_msg_userid` (`user_id`) USING BTREE,
|
||||||
|
KEY `inx_msg_type` (`type`) USING BTREE,
|
||||||
|
KEY `inx_msg_status` (`status`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='消息通知表';
|
19
frontend/src/api/system/msg.js
Normal file
19
frontend/src/api/system/msg.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function query(pageIndex, pageSize, data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/sys_msg/list/' + pageIndex + '/' + pageSize,
|
||||||
|
method: 'post',
|
||||||
|
loading: true,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateStatus(msgId) {
|
||||||
|
return request({
|
||||||
|
url: '/api/sys_msg/setReaded/' + msgId,
|
||||||
|
method: 'post',
|
||||||
|
loading: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
178
frontend/src/components/Notification/index.vue
Normal file
178
frontend/src/components/Notification/index.vue
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<el-popover
|
||||||
|
|
||||||
|
v-model="visible"
|
||||||
|
width="350"
|
||||||
|
trigger="click"
|
||||||
|
placement="top-end"
|
||||||
|
style="display: flex;align-items: center;"
|
||||||
|
class="international"
|
||||||
|
>
|
||||||
|
<div style="height: 30px;">
|
||||||
|
<div style="float: left;font-size:16px;font-weight:bold;">
|
||||||
|
<span>{{ $t('webmsg.web_msg') }}</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="showSetting" style="float: right;">
|
||||||
|
<a href="#" style="text-detext-decoratext-decoration:none;cursor:point;" @click="msgSetting">消息规则</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-divider class="msg-line-class" />
|
||||||
|
<el-table
|
||||||
|
class="de-msg-data-table"
|
||||||
|
:data="data"
|
||||||
|
:show-header="false"
|
||||||
|
:highlight-current-row="true"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column prop="content" :label="$t('commons.name')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="start-item">
|
||||||
|
<div class="filter-db-row star-item-content" @click="showDetail(scope.row)">
|
||||||
|
<!-- <svg-icon icon-class="panel" class="ds-icon-scene" /> -->
|
||||||
|
<div class="title-div"><span>【{{ $t(getTypeName(scope.row.type)) }}】 {{ scope.row.content }}</span></div>
|
||||||
|
<div class="title-div"><span>{{ scope.row.createTime | timestampFormatDate }}</span></div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="star-item-close">
|
||||||
|
<i class="el-icon-delete " @click="remove(scope.row)" />
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="msg-foot-class">
|
||||||
|
<el-row style="padding: 5px 0;margin-bottom: -5px;cursor:point;" @click="showMore">
|
||||||
|
<span @click="showMore">{{ $t('webmsg.show_more') }}</span>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div slot="reference">
|
||||||
|
<div>
|
||||||
|
<svg-icon
|
||||||
|
class-name="notification"
|
||||||
|
icon-class="notification"
|
||||||
|
/>
|
||||||
|
<span v-if="paginationConfig.total" class="msg-number">{{ paginationConfig.total }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { query, updateStatus } from '@/api/system/msg'
|
||||||
|
import { msgTypes, getTypeName } from '@/utils/webMsg'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
msgTypes: msgTypes,
|
||||||
|
showSetting: false,
|
||||||
|
data: [],
|
||||||
|
visible: false,
|
||||||
|
paginationConfig: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.search()
|
||||||
|
// 每30s定时刷新拉取消息
|
||||||
|
setInterval(() => {
|
||||||
|
this.search()
|
||||||
|
}, 30000)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handClick(lang) {
|
||||||
|
console.log(lang)
|
||||||
|
},
|
||||||
|
showDetail(row) {
|
||||||
|
const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }}
|
||||||
|
this.visible = false
|
||||||
|
this.$router.push({ name: row.router, params: param })
|
||||||
|
this.setReaded(row.msgId)
|
||||||
|
},
|
||||||
|
remove(row) {
|
||||||
|
|
||||||
|
},
|
||||||
|
msgSetting() {
|
||||||
|
|
||||||
|
},
|
||||||
|
showMore() {
|
||||||
|
const routerName = 'sys-msg-web-all'
|
||||||
|
this.visible = false
|
||||||
|
this.$router.push({ name: routerName })
|
||||||
|
this.$emit('refresh-top-bar')
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
const param = {
|
||||||
|
status: false
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = this.paginationConfig
|
||||||
|
query(currentPage, pageSize, param).then(response => {
|
||||||
|
this.data = response.data.listObject
|
||||||
|
this.paginationConfig.total = response.data.itemCount
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTypeName(value) {
|
||||||
|
return getTypeName(value)
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
// 设置已读
|
||||||
|
setReaded(msgId) {
|
||||||
|
updateStatus(msgId).then(res => {
|
||||||
|
this.search()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.msg-number {
|
||||||
|
min-width: 14px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 14px;
|
||||||
|
display: inline-block;
|
||||||
|
position: fixed;
|
||||||
|
right: 155px;
|
||||||
|
top: 8px;
|
||||||
|
background: red;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 17px;
|
||||||
|
padding: 4px 7px;
|
||||||
|
font-size: 16px;
|
||||||
|
transform: scale(.7);
|
||||||
|
font-family: Tahoma!important;
|
||||||
|
}
|
||||||
|
.title-div {
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
span {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
white-space:nowrap;
|
||||||
|
width:290px;
|
||||||
|
height:24px;
|
||||||
|
display:block;
|
||||||
|
font-size: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.msg-line-class {
|
||||||
|
margin: 0 0 !important;
|
||||||
|
}
|
||||||
|
.msg-foot-class {
|
||||||
|
padding-top: 5px;
|
||||||
|
:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: #f4f4f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
1
frontend/src/icons/svg/all-msg.svg
Normal file
1
frontend/src/icons/svg/all-msg.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194186074" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5368" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M542.865473 179.373297c-11.667737-5.553483-25.564235-3.748371-35.536354 4.592598l-191.97122 160.771637-153.038512-0.632403-0.141216 0c-8.810666 0-17.328667 3.467985-23.538089 9.771551-6.291287 6.28003-9.853415 14.809287-9.853415 23.736611l-0.704035 268.632203c0 8.904811 3.479241 17.48114 9.760295 23.784706 6.26775 6.349615 14.774495 9.864672 23.654746 9.864672l154.842601 0 190.986799 160.16277c6.139837 5.131881 13.766538 7.756661 21.383006 7.756661 4.802376 0 9.619078-1.031493 14.152325-3.186576 11.7056-5.482875 19.21462-17.339924 19.21462-30.369681L562.077024 209.742978C562.104653 196.784852 554.617122 184.927803 542.865473 179.373297zM495.321644 742.55498l-0.022513 0L349.757361 620.517529c-6.010901-4.991688-13.568017-7.733125-21.35947-7.733125L194.938296 612.784404l0.550539-201.38052 131.750673 0.562818 0.116657 0c7.814989 0 15.394618-2.717901 21.370727-7.756661l146.594753-122.786511L495.321644 742.55498zM776.185426 248.66443c-15.349593-9.958816-35.805484-5.41329-45.834908 10.051937-10.004865 15.418154-5.600555 36.20355 9.677407 46.373167 3.609201 2.412956 89.137133 60.994166 89.137133 206.910467 0 146.195663-82.013899 204.871017-85.282339 207.120244-15.383362 10.310833-19.507286 31.142278-9.268084 46.583968 6.4192 9.700943 17.036002 14.926968 27.815509 14.926968 6.374174 0 12.793374-1.852184 18.48705-5.624091 4.686742-3.139503 114.996081-79.225389 114.996081-263.008112C895.950114 327.842747 781.130042 251.827469 776.185426 248.66443zM672.284031 347.292728c-16.448624-7.826246-35.991726-0.704035-44.00626 15.770172-7.990998 16.542768-1.077541 36.531008 15.255449 44.802392 2.084475 1.101077 52.114938 27.228131 52.114938 101.673657 0 79.531358-46.795792 105.891725-48.307216 106.759489-16.48444 8.29492-23.186072 28.493961-14.938224 45.084824 5.881964 11.762905 17.643845 18.582217 29.933753 18.582217 4.968152 0 10.077519-1.14815 14.869662-3.538593 3.467985-1.780553 85.22401-44.358277 85.22401-166.887938C762.383072 391.322523 675.962817 349.026208 672.284031 347.292728z" p-id="5369"></path></svg>
|
After Width: | Height: | Size: 2.3 KiB |
1
frontend/src/icons/svg/notification.svg
Normal file
1
frontend/src/icons/svg/notification.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625126274902" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1191" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M757.76 819.2h-491.52A61.44 61.44 0 0 1 204.8 757.76v-286.72a307.2 307.2 0 0 1 614.4 0v286.72a61.44 61.44 0 0 1-61.44 61.44z m-245.76-614.4A266.6496 266.6496 0 0 0 245.76 471.04v286.72a20.48 20.48 0 0 0 20.48 20.48h491.52a20.48 20.48 0 0 0 20.48-20.48v-286.72A266.6496 266.6496 0 0 0 512 204.8zM512 942.08a102.4 102.4 0 0 1-102.4-102.4h40.96a61.44 61.44 0 0 0 122.88 0h40.96a102.4 102.4 0 0 1-102.4 102.4z" p-id="1192"></path><path d="M491.52 81.92h40.96v81.92h-40.96zM837.2224 298.5984a383.7952 383.7952 0 0 0-111.0016-111.4112l22.528-34.4064a428.4416 428.4416 0 0 1 122.88 122.88zM186.7776 298.5984l-34.4064-22.9376a428.4416 428.4416 0 0 1 122.88-122.88l22.528 34.4064a383.7952 383.7952 0 0 0-111.0016 111.4112z" p-id="1193"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
frontend/src/icons/svg/readed-msg.svg
Normal file
1
frontend/src/icons/svg/readed-msg.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194105498" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4691" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M897.2 341v1.8L567.8 87.2c-32.6-25.3-78.3-25.4-111.1-0.3L123.5 343.1c-35.3 19.8-59.1 56.8-59.1 99.2v405.5c0 63.1 52.8 114.4 117.7 114.4h660.4c64.9 0 117.7-51.3 117.7-114.4V442.3c0-43.9-25.6-82.2-63-101.3zM484.9 123.2c16.1-12.4 38.6-12.3 54.7 0.1l323.7 251.1-330 229.5c-12.7 8.8-29.8 9-42.6 0.4L153.5 377.9l331.4-254.7zM108.2 847.8V442.3c0-12.3 3.2-23.8 8.8-33.9 0.8 0.7 1.7 1.5 2.6 2.1L465 642.3c1.8 1.2 3.7 2.4 5.7 3.5-5.1 2.2-10 5-14.7 8.1L118.3 884c-6.4-10.6-10.1-23-10.1-36.2z m734.3 71.9H182.1c-9.6 0-18.8-1.8-27.2-5.1l327-222.9c15.3-10.4 35.9-10.4 51.2 0l330.1 225.1c-6.5 1.9-13.5 2.9-20.7 2.9z m74-71.9c0 15.2-4.9 29.2-13.1 40.8L559.1 653.9c-3.3-2.2-6.7-4.3-10.2-6 3.7-1.8 7.3-4 10.8-6.4l342.2-238c0.7-0.5 1.3-1 1.9-1.5 8 11.5 12.7 25.4 12.7 40.3v405.5z" p-id="4692"></path></svg>
|
After Width: | Height: | Size: 1.1 KiB |
1
frontend/src/icons/svg/unread-msg.svg
Normal file
1
frontend/src/icons/svg/unread-msg.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625194120904" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4859" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css"></style></defs><path d="M128 331.392V810.666667h725.333333V327.68L469.077333 597.333333 128 331.392zM747.264 298.666667H223.744l247.978667 193.365333L747.264 298.666667zM938.666667 213.333333v682.666667H42.666667V213.333333h896z" p-id="4860"></path><path d="M853.333333 256m-128 0a128 128 0 1 0 256 0 128 128 0 1 0-256 0Z" p-id="4861"></path></svg>
|
After Width: | Height: | Size: 701 B |
1
frontend/src/icons/svg/web-msg.svg
Normal file
1
frontend/src/icons/svg/web-msg.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1625193768947" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1789" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M862.528 225.536c29.12 0 52.864 23.68 52.864 52.8v467.264a52.992 52.992 0 0 1-52.864 52.864H161.472a52.992 52.992 0 0 1-52.864-52.864V278.336c0-29.12 23.744-52.8 52.864-52.8h701.056m0-64H161.472A116.864 116.864 0 0 0 44.608 278.336v467.264c0 64.64 52.288 116.864 116.864 116.864h700.992a116.8 116.8 0 0 0 116.864-116.864V278.336a116.8 116.8 0 0 0-116.8-116.8z" fill="#231815" p-id="1790"></path><path d="M512 607.872a32.064 32.064 0 0 1-19.52-6.592L83.584 287.36a32 32 0 0 1 38.976-50.752L512 535.552l388.288-298.88a32 32 0 0 1 38.976 50.688L531.52 601.28A32.064 32.064 0 0 1 512 607.872z" fill="#231815" p-id="1791"></path></svg>
|
After Width: | Height: | Size: 1007 B |
@ -1137,5 +1137,12 @@ export default {
|
|||||||
can_not_move_change_sort: 'Cannot move to change sort',
|
can_not_move_change_sort: 'Cannot move to change sort',
|
||||||
can_not_move_parent_to_children: 'Parent organization cannot move to its own child node',
|
can_not_move_parent_to_children: 'Parent organization cannot move to its own child node',
|
||||||
move_success: 'Mobile success'
|
move_success: 'Mobile success'
|
||||||
|
},
|
||||||
|
webmsg: {
|
||||||
|
web_msg: 'On site message notification',
|
||||||
|
show_more: 'View more',
|
||||||
|
all_type: 'All type',
|
||||||
|
panel_type: 'Panel Share',
|
||||||
|
dataset_type: 'Dataset sync'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1179,5 +1179,12 @@ export default {
|
|||||||
can_not_move_change_sort: '不能移動以改變排序',
|
can_not_move_change_sort: '不能移動以改變排序',
|
||||||
can_not_move_parent_to_children: '父組織不能移動到自己的子節點下',
|
can_not_move_parent_to_children: '父組織不能移動到自己的子節點下',
|
||||||
move_success: '移動成功'
|
move_success: '移動成功'
|
||||||
|
},
|
||||||
|
webmsg: {
|
||||||
|
web_msg: '站內消息通知',
|
||||||
|
show_more: '查看更多',
|
||||||
|
all_type: '全部類型',
|
||||||
|
panel_type: '儀表板分享',
|
||||||
|
dataset_type: '數據集同步'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1142,5 +1142,12 @@ export default {
|
|||||||
can_not_move_change_sort: '不能移动以改变排序',
|
can_not_move_change_sort: '不能移动以改变排序',
|
||||||
can_not_move_parent_to_children: '父组织不能移动到自己的子节点下',
|
can_not_move_parent_to_children: '父组织不能移动到自己的子节点下',
|
||||||
move_success: '移动成功'
|
move_success: '移动成功'
|
||||||
|
},
|
||||||
|
webmsg: {
|
||||||
|
web_msg: '站内消息通知',
|
||||||
|
show_more: '查看更多',
|
||||||
|
all_type: '全部类型',
|
||||||
|
panel_type: '仪表板分享',
|
||||||
|
dataset_type: '数据集同步'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<!-- <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
|
<!-- <el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip> -->
|
</el-tooltip> -->
|
||||||
|
<notification class="right-menu-item hover-effect" @refresh-top-bar="initCurrentRoutes" />
|
||||||
<lang-select class="right-menu-item hover-effect" />
|
<lang-select class="right-menu-item hover-effect" />
|
||||||
<div style="height: 100%;padding: 0 8px;" class="right-menu-item hover-effect">
|
<div style="height: 100%;padding: 0 8px;" class="right-menu-item hover-effect">
|
||||||
<a href="https://dataease.io/docs/" target="_blank" style="display: flex;height: 100%;width: 100%;justify-content: center;align-items: center;">
|
<a href="https://dataease.io/docs/" target="_blank" style="display: flex;height: 100%;width: 100%;justify-content: center;align-items: center;">
|
||||||
@ -75,7 +75,7 @@ import { mapGetters } from 'vuex'
|
|||||||
import AppLink from './Sidebar/Link'
|
import AppLink from './Sidebar/Link'
|
||||||
import variables from '@/styles/variables.scss'
|
import variables from '@/styles/variables.scss'
|
||||||
import { isExternal } from '@/utils/validate'
|
import { isExternal } from '@/utils/validate'
|
||||||
// import Doc from '@/components/Doc'
|
import Notification from '@/components/Notification'
|
||||||
// import Screenfull from '@/components/Screenfull'
|
// import Screenfull from '@/components/Screenfull'
|
||||||
// import SizeSelect from '@/components/SizeSelect'
|
// import SizeSelect from '@/components/SizeSelect'
|
||||||
import LangSelect from '@/components/LangSelect'
|
import LangSelect from '@/components/LangSelect'
|
||||||
@ -86,6 +86,7 @@ export default {
|
|||||||
AppLink,
|
AppLink,
|
||||||
// Screenfull,
|
// Screenfull,
|
||||||
// SizeSelect,
|
// SizeSelect,
|
||||||
|
Notification,
|
||||||
LangSelect
|
LangSelect
|
||||||
// Doc
|
// Doc
|
||||||
},
|
},
|
||||||
|
@ -76,6 +76,7 @@ export const loadMenus = (next, to) => {
|
|||||||
buildMenus().then(res => {
|
buildMenus().then(res => {
|
||||||
const filterDatas = filterRouter(res.data)
|
const filterDatas = filterRouter(res.data)
|
||||||
const asyncRouter = filterAsyncRouter(filterDatas)
|
const asyncRouter = filterAsyncRouter(filterDatas)
|
||||||
|
addMsgMenu(asyncRouter)
|
||||||
asyncRouter.push({ path: '*', redirect: '/404', hidden: true })
|
asyncRouter.push({ path: '*', redirect: '/404', hidden: true })
|
||||||
store.dispatch('permission/GenerateRoutes', asyncRouter).then(() => { // 存储路由
|
store.dispatch('permission/GenerateRoutes', asyncRouter).then(() => { // 存储路由
|
||||||
router.addRoutes(asyncRouter)
|
router.addRoutes(asyncRouter)
|
||||||
@ -87,6 +88,44 @@ export const loadMenus = (next, to) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const addMsgMenu = asyncRouter => {
|
||||||
|
const menu = {
|
||||||
|
path: 'system-msg-web',
|
||||||
|
component: () => import('@/views/msg/index'),
|
||||||
|
name: 'sys-msg-web',
|
||||||
|
meta: { title: '站内消息', icon: 'all-msg' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'all',
|
||||||
|
component: () => import('@/views/msg/all'),
|
||||||
|
name: 'sys-msg-web-all',
|
||||||
|
meta: { title: '所有消息', icon: 'web-msg' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'unread',
|
||||||
|
component: () => import('@/views/msg/unread'),
|
||||||
|
name: 'sys-msg-web-unread',
|
||||||
|
meta: { title: '未读消息', icon: 'unread-msg' }
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'readed',
|
||||||
|
component: () => import('@/views/msg/readed'),
|
||||||
|
name: 'sys-msg-web-readed',
|
||||||
|
meta: { title: '已读消息', icon: 'readed-msg' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
asyncRouter.forEach(element => {
|
||||||
|
if (element.name === 'system') {
|
||||||
|
if (element.children) {
|
||||||
|
element.children.splice(0, 0, menu)
|
||||||
|
}
|
||||||
|
// element.children.push(menu)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 验证path是否有效
|
* 验证path是否有效
|
||||||
* @param {*} path
|
* @param {*} path
|
||||||
|
@ -189,10 +189,26 @@ div:focus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.de-msg-data-table {
|
||||||
|
.el-table__body-wrapper >table>{
|
||||||
|
tbody {
|
||||||
|
.el-table__row {
|
||||||
|
:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
td {
|
||||||
|
padding: 3px 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.de-filter-data-table::before {
|
.de-filter-data-table::before {
|
||||||
height: 0px !important;
|
height: 0px !important;
|
||||||
}
|
}
|
||||||
|
.de-msg-data-table::before {
|
||||||
|
height: 0px !important;
|
||||||
|
}
|
||||||
.custom-component-class {
|
.custom-component-class {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
div.el-input-group__append {
|
div.el-input-group__append {
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.is-active>.el-submenu__title {
|
.is-active>.el-submenu__title {
|
||||||
color: $subMenuActiveText !important;
|
color: $menuActiveText !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .nest-menu .el-submenu>.el-submenu__title,
|
& .nest-menu .el-submenu>.el-submenu__title,
|
||||||
@ -94,7 +94,7 @@
|
|||||||
background-color: $subMenuBg !important;
|
background-color: $subMenuBg !important;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $subMenuHover !important;
|
background-color: $menuHover !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ $menuBg:#ffffff;
|
|||||||
// $menuHover:#263445;
|
// $menuHover:#263445;
|
||||||
$menuHover: rgba(158, 158, 158, 0.2);
|
$menuHover: rgba(158, 158, 158, 0.2);
|
||||||
|
|
||||||
$subMenuBg:#1f2d3d;
|
$subMenuBg:#ffffff;
|
||||||
// $subMenuHover:#001528;
|
// $subMenuHover:#001528;
|
||||||
$subMenuHover:#0a7be0;
|
$subMenuHover:#0a7be0;
|
||||||
$colorBg:rgba(10,123,224,.1);
|
$colorBg:rgba(10,123,224,.1);
|
||||||
|
17
frontend/src/utils/webMsg.js
Normal file
17
frontend/src/utils/webMsg.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
export const msgTypes = [
|
||||||
|
// { value: -1, label: '全部类型' },
|
||||||
|
// { value: 0, label: '仪表板分享' },
|
||||||
|
// { value: 1, label: '数据集同步' }
|
||||||
|
{ value: -1, label: 'webmsg.all_type' },
|
||||||
|
{ value: 0, label: 'webmsg.panel_type' },
|
||||||
|
{ value: 1, label: 'webmsg.dataset_type' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const getTypeName = value => {
|
||||||
|
for (let index = 0; index < msgTypes.length; index++) {
|
||||||
|
const element = msgTypes[index]
|
||||||
|
if (element.value === value) {
|
||||||
|
return element.label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -103,6 +103,9 @@ export default {
|
|||||||
'param': function() {
|
'param': function() {
|
||||||
this.initTable(this.param)
|
this.initTable(this.param)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initTable(this.param)
|
this.initTable(this.param)
|
||||||
@ -187,6 +190,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
'type': type
|
'type': type
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
msg2Current(sourceParam) {
|
||||||
|
this.tabActive = 'updateInfo'
|
||||||
|
this.table.msgTaskId = sourceParam.taskId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<de-main-container>
|
<de-main-container>
|
||||||
<!--<router-view/>-->
|
<!--<router-view/>-->
|
||||||
<component :is="component" :param="param" @switchComponent="switchComponent" @saveSuccess="saveSuccess" />
|
<component :is="component" ref="dynamic_component" :param="param" @switchComponent="switchComponent" @saveSuccess="saveSuccess" />
|
||||||
</de-main-container>
|
</de-main-container>
|
||||||
</de-container>
|
</de-container>
|
||||||
</template>
|
</template>
|
||||||
@ -40,6 +40,27 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
removeClass(document.body, 'showRightPanel')
|
removeClass(document.body, 'showRightPanel')
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
||||||
|
let routerParam
|
||||||
|
if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
|
||||||
|
// 说明是从消息通知跳转过来的
|
||||||
|
if (routerParam.msgType === 1) { // 是数据集同步
|
||||||
|
if (routerParam.sourceParam) {
|
||||||
|
try {
|
||||||
|
const msgParam = JSON.parse(routerParam.sourceParam)
|
||||||
|
this.param = msgParam.tableId
|
||||||
|
this.component = ViewTable
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.dynamic_component.msg2Current(routerParam.sourceParam)
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchComponent(c) {
|
switchComponent(c) {
|
||||||
this.param = c.param
|
this.param = c.param
|
||||||
|
146
frontend/src/views/msg/all.vue
Normal file
146
frontend/src/views/msg/all.vue
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
||||||
|
|
||||||
|
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
|
||||||
|
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ $t(item.label) }}</el-radio-button>
|
||||||
|
|
||||||
|
</el-radio-group>
|
||||||
|
<complex-table
|
||||||
|
:data="data"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination-config="paginationConfig"
|
||||||
|
@select="select"
|
||||||
|
@search="search"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column prop="content" :label="$t('commons.name')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
|
||||||
|
<span style="display: flex;flex: 1;">
|
||||||
|
<span>
|
||||||
|
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
|
||||||
|
<svg-icon v-else icon-class="readed-msg" />
|
||||||
|
</span>
|
||||||
|
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
|
||||||
|
{{ scope.row.content }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ $t(getTypeName(scope.row.type)) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</complex-table>
|
||||||
|
|
||||||
|
</layout-content>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import LayoutContent from '@/components/business/LayoutContent'
|
||||||
|
import ComplexTable from '@/components/business/complex-table'
|
||||||
|
import { query, updateStatus } from '@/api/system/msg'
|
||||||
|
import { msgTypes, getTypeName } from '@/utils/webMsg'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
LayoutContent,
|
||||||
|
ComplexTable
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectType: -1,
|
||||||
|
// msgTypes: [
|
||||||
|
// { value: -1, label: '全部类型' },
|
||||||
|
// { value: 0, label: '仪表板分享' },
|
||||||
|
// { value: 1, label: '数据集同步' }
|
||||||
|
// ],
|
||||||
|
msgTypes: msgTypes,
|
||||||
|
data: [],
|
||||||
|
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
|
||||||
|
|
||||||
|
columns: [],
|
||||||
|
|
||||||
|
paginationConfig: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
select(selection) {
|
||||||
|
},
|
||||||
|
|
||||||
|
search() {
|
||||||
|
const param = {}
|
||||||
|
|
||||||
|
if (this.selectType >= 0) {
|
||||||
|
param.type = this.selectType
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = this.paginationConfig
|
||||||
|
query(currentPage, pageSize, param).then(response => {
|
||||||
|
this.data = response.data.listObject
|
||||||
|
this.paginationConfig.total = response.data.itemCount
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTypeName(value) {
|
||||||
|
return getTypeName(value)
|
||||||
|
},
|
||||||
|
typeChange(value) {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
toDetail(row) {
|
||||||
|
const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }}
|
||||||
|
this.$router.push({ name: row.router, params: param })
|
||||||
|
this.setReaded(row)
|
||||||
|
},
|
||||||
|
// 设置已读
|
||||||
|
setReaded(row) {
|
||||||
|
updateStatus(row.msgId).then(res => {
|
||||||
|
this.search()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.de-msg-radio-class {
|
||||||
|
padding: 0 5px;
|
||||||
|
>>>.el-radio-button__inner {
|
||||||
|
border-radius: 4px 4px 4px 4px !important;
|
||||||
|
border-left: 1px solid #dcdfe6 !important;
|
||||||
|
padding: 10px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #0a7be0;
|
||||||
|
border-color: #0a7be0;
|
||||||
|
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.de-msg-a:hover {
|
||||||
|
text-decoration: underline !important;
|
||||||
|
color: #0a7be0 !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
21
frontend/src/views/msg/index.vue
Normal file
21
frontend/src/views/msg/index.vue
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<router-view />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default ({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('app/toggleSideBarHide', false)
|
||||||
|
},
|
||||||
|
method: {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
140
frontend/src/views/msg/readed.vue
Normal file
140
frontend/src/views/msg/readed.vue
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
<template>
|
||||||
|
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
||||||
|
|
||||||
|
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
|
||||||
|
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ $t(item.label) }}</el-radio-button>
|
||||||
|
|
||||||
|
</el-radio-group>
|
||||||
|
<complex-table
|
||||||
|
:data="data"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination-config="paginationConfig"
|
||||||
|
@select="select"
|
||||||
|
@search="search"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column prop="content" :label="$t('commons.name')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
|
||||||
|
<span style="display: flex;flex: 1;">
|
||||||
|
<span>
|
||||||
|
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
|
||||||
|
<svg-icon v-else icon-class="readed-msg" />
|
||||||
|
</span>
|
||||||
|
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
|
||||||
|
{{ scope.row.content }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ $t(getTypeName(scope.row.type)) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</complex-table>
|
||||||
|
|
||||||
|
</layout-content>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import LayoutContent from '@/components/business/LayoutContent'
|
||||||
|
import ComplexTable from '@/components/business/complex-table'
|
||||||
|
import { query } from '@/api/system/msg'
|
||||||
|
import { msgTypes, getTypeName } from '@/utils/webMsg'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
LayoutContent,
|
||||||
|
ComplexTable
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectType: -1,
|
||||||
|
// msgTypes: [
|
||||||
|
// { value: -1, label: '全部类型' },
|
||||||
|
// { value: 0, label: '仪表板分享' },
|
||||||
|
// { value: 1, label: '数据集同步' }
|
||||||
|
// ],
|
||||||
|
msgTypes: msgTypes,
|
||||||
|
data: [],
|
||||||
|
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
|
||||||
|
|
||||||
|
columns: [],
|
||||||
|
|
||||||
|
paginationConfig: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
select(selection) {
|
||||||
|
},
|
||||||
|
|
||||||
|
search() {
|
||||||
|
const param = {}
|
||||||
|
param.status = true
|
||||||
|
if (this.selectType >= 0) {
|
||||||
|
param.type = this.selectType
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = this.paginationConfig
|
||||||
|
query(currentPage, pageSize, param).then(response => {
|
||||||
|
this.data = response.data.listObject
|
||||||
|
this.paginationConfig.total = response.data.itemCount
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTypeName(value) {
|
||||||
|
return getTypeName(value)
|
||||||
|
},
|
||||||
|
typeChange(value) {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
toDetail(row) {
|
||||||
|
const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }}
|
||||||
|
this.$router.push({ name: row.router, params: param })
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.de-msg-radio-class {
|
||||||
|
padding: 0 5px;
|
||||||
|
>>>.el-radio-button__inner {
|
||||||
|
border-radius: 4px 4px 4px 4px !important;
|
||||||
|
border-left: 1px solid #dcdfe6 !important;
|
||||||
|
padding: 10px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #0a7be0;
|
||||||
|
border-color: #0a7be0;
|
||||||
|
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.de-msg-a:hover {
|
||||||
|
text-decoration: underline !important;
|
||||||
|
color: #0a7be0 !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
146
frontend/src/views/msg/unread.vue
Normal file
146
frontend/src/views/msg/unread.vue
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<layout-content v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
||||||
|
|
||||||
|
<el-radio-group v-model="selectType" style="margin-bottom: 15px;" @change="typeChange">
|
||||||
|
<el-radio-button v-for="(item,index) in msgTypes" :key="index" class="de-msg-radio-class" :label="item.value">{{ $t(item.label) }}</el-radio-button>
|
||||||
|
|
||||||
|
</el-radio-group>
|
||||||
|
<complex-table
|
||||||
|
:data="data"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination-config="paginationConfig"
|
||||||
|
@select="select"
|
||||||
|
@search="search"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column prop="content" :label="$t('commons.name')">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
|
||||||
|
<span style="display: flex;flex: 1;">
|
||||||
|
<span>
|
||||||
|
<svg-icon v-if="!scope.row.status" icon-class="unread-msg" style="color: red;" />
|
||||||
|
<svg-icon v-else icon-class="readed-msg" />
|
||||||
|
</span>
|
||||||
|
<span style="margin-left: 6px;" class="de-msg-a" @click="toDetail(scope.row)">
|
||||||
|
{{ scope.row.content }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="createTime" :label="$t('commons.create_time')" width="180">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column prop="type" :label="$t('datasource.type')" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ $t(getTypeName(scope.row.type)) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</complex-table>
|
||||||
|
|
||||||
|
</layout-content>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import LayoutContent from '@/components/business/LayoutContent'
|
||||||
|
import ComplexTable from '@/components/business/complex-table'
|
||||||
|
import { query, updateStatus } from '@/api/system/msg'
|
||||||
|
import { msgTypes, getTypeName } from '@/utils/webMsg'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
LayoutContent,
|
||||||
|
ComplexTable
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectType: -1,
|
||||||
|
// msgTypes: [
|
||||||
|
// { value: -1, label: '全部类型' },
|
||||||
|
// { value: 0, label: '仪表板分享' },
|
||||||
|
// { value: 1, label: '数据集同步' }
|
||||||
|
// ],
|
||||||
|
msgTypes: msgTypes,
|
||||||
|
data: [],
|
||||||
|
allTypes: [{ name: 'mysql', type: 'jdbc' }, { name: 'sqlServer', type: 'jdbc' }],
|
||||||
|
|
||||||
|
columns: [],
|
||||||
|
|
||||||
|
paginationConfig: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
select(selection) {
|
||||||
|
},
|
||||||
|
|
||||||
|
search() {
|
||||||
|
const param = {}
|
||||||
|
param.status = false
|
||||||
|
if (this.selectType >= 0) {
|
||||||
|
param.type = this.selectType
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = this.paginationConfig
|
||||||
|
query(currentPage, pageSize, param).then(response => {
|
||||||
|
this.data = response.data.listObject
|
||||||
|
this.paginationConfig.total = response.data.itemCount
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getTypeName(value) {
|
||||||
|
return getTypeName(value)
|
||||||
|
},
|
||||||
|
typeChange(value) {
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
toDetail(row) {
|
||||||
|
const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }}
|
||||||
|
this.$router.push({ name: row.router, params: param })
|
||||||
|
this.setReaded(row)
|
||||||
|
},
|
||||||
|
// 设置已读
|
||||||
|
setReaded(row) {
|
||||||
|
updateStatus(row.msgId).then(res => {
|
||||||
|
this.search()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.de-msg-radio-class {
|
||||||
|
padding: 0 5px;
|
||||||
|
>>>.el-radio-button__inner {
|
||||||
|
border-radius: 4px 4px 4px 4px !important;
|
||||||
|
border-left: 1px solid #dcdfe6 !important;
|
||||||
|
padding: 10px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>.el-radio-button__orig-radio:checked+.el-radio-button__inner {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #0a7be0;
|
||||||
|
border-color: #0a7be0;
|
||||||
|
-webkit-box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
box-shadow: 0px 0 0 0 #0a7be0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.de-msg-a:hover {
|
||||||
|
text-decoration: underline !important;
|
||||||
|
color: #0a7be0 !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-tree :data="datas" :props="defaultProps" @node-click="handleNodeClick">
|
<el-tree :data="datas" :props="defaultProps" node-key="name" :default-expanded-keys="expandNodes" @node-click="handleNodeClick">
|
||||||
<span slot-scope="{ data }" class="custom-tree-node">
|
<span slot-scope="{ data }" class="custom-tree-node">
|
||||||
<span>
|
<span :class="!!data.msgNode ? 'msg-node-class': ''">
|
||||||
<span v-if="!!data.id">
|
<span v-if="!!data.id">
|
||||||
<el-button
|
<el-button
|
||||||
icon="el-icon-picture-outline"
|
icon="el-icon-picture-outline"
|
||||||
@ -23,24 +23,35 @@ import { uuid } from 'vue-uuid'
|
|||||||
import { get } from '@/api/panel/panel'
|
import { get } from '@/api/panel/panel'
|
||||||
export default {
|
export default {
|
||||||
name: 'ShareTree',
|
name: 'ShareTree',
|
||||||
|
props: {
|
||||||
|
msgPanelIds: {
|
||||||
|
type: Array,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
datas: [],
|
datas: [],
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
}
|
},
|
||||||
|
expandNodes: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initData()
|
this.initData().then(res => {
|
||||||
|
this.datas = res.data
|
||||||
|
if (this.msgPanelIds && this.msgPanelIds.length > 0) {
|
||||||
|
this.expandMsgNode(this.msgPanelIds)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
const param = {}
|
const param = {}
|
||||||
loadTree(param).then(res => {
|
return loadTree(param)
|
||||||
this.datas = res.data
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleNodeClick(data) {
|
handleNodeClick(data) {
|
||||||
get('panel/group/findOne/' + data.id).then(response => {
|
get('panel/group/findOne/' + data.id).then(response => {
|
||||||
@ -58,7 +69,35 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
},
|
||||||
|
expandMsgNode(panelIds) {
|
||||||
|
console.log(panelIds)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.getMsgNodes(panelIds)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getMsgNodes(panelIds) {
|
||||||
|
this.datas.forEach(item => {
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
item.children.forEach(node => {
|
||||||
|
if (panelIds.includes(node.id)) {
|
||||||
|
node.msgNode = true
|
||||||
|
this.expandNodes.push(item.name)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.msg-node-class {
|
||||||
|
color: red;
|
||||||
|
>>> i{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
|
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
|
||||||
<de-main-container>
|
<de-main-container>
|
||||||
<panel-main v-show="componentName==='PanelMain'" />
|
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
||||||
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
||||||
<panel-edit v-if="componentName==='PanelEdit'" />
|
<panel-edit v-if="componentName==='PanelEdit'" />
|
||||||
<!-- <component :is="component" :param="param" />-->
|
<!-- <component :is="component" :param="param" />-->
|
||||||
@ -48,6 +48,19 @@ export default {
|
|||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
||||||
|
let routerParam
|
||||||
|
if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
|
||||||
|
// 说明是从消息通知跳转过来的
|
||||||
|
if (routerParam.msgType === 0) { // 是仪表板分享
|
||||||
|
this.componentName = 'PanelMain'
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.panel_main.msg2Current(routerParam.sourceParam)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane name="panels_share" :lazy="true">
|
<el-tab-pane name="panels_share" :lazy="true">
|
||||||
<span slot="label"><i class="el-icon-share" />{{ $t('panel.share') }}</span>
|
<span slot="label"><i class="el-icon-share" />{{ $t('panel.share') }}</span>
|
||||||
<share-tree v-if="showShare" />
|
<share-tree v-if="showShare" ref="share_tree" :msg-panel-ids="msgPanelIds" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</de-aside-container>
|
</de-aside-container>
|
||||||
@ -38,7 +38,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
activeName: 'PanelList',
|
activeName: 'PanelList',
|
||||||
showShare: false,
|
showShare: false,
|
||||||
showEnshrine: false
|
showEnshrine: false,
|
||||||
|
msgPanelIds: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -86,6 +87,20 @@ export default {
|
|||||||
preStyle: null
|
preStyle: null
|
||||||
})
|
})
|
||||||
this.$store.dispatch('panel/setMainActiveName', 'PanelMain')
|
this.$store.dispatch('panel/setMainActiveName', 'PanelMain')
|
||||||
|
},
|
||||||
|
msg2Current(panelIds) {
|
||||||
|
this.refreshShare()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (panelIds) {
|
||||||
|
try {
|
||||||
|
panelIds = JSON.parse(panelIds)
|
||||||
|
this.msgPanelIds = panelIds
|
||||||
|
this.activeName = 'panels_share'
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user