diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsg.java b/backend/src/main/java/io/dataease/base/domain/SysMsg.java index d18c3eada6..b9759f2f1a 100644 --- a/backend/src/main/java/io/dataease/base/domain/SysMsg.java +++ b/backend/src/main/java/io/dataease/base/domain/SysMsg.java @@ -9,12 +9,10 @@ public class SysMsg implements Serializable { private Long userId; - private Integer type; + private Long typeId; private Boolean status; - private String router; - private String param; private Long createTime; diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java b/backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java new file mode 100644 index 0000000000..0ca1830b37 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java @@ -0,0 +1,13 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class SysMsgChannel implements Serializable { + private Long msgChannelId; + + private String channelName; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgChannelExample.java b/backend/src/main/java/io/dataease/base/domain/SysMsgChannelExample.java new file mode 100644 index 0000000000..6c860f8837 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgChannelExample.java @@ -0,0 +1,330 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class SysMsgChannelExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMsgChannelExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 andMsgChannelIdIsNull() { + addCriterion("msg_channel_id is null"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdIsNotNull() { + addCriterion("msg_channel_id is not null"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdEqualTo(Long value) { + addCriterion("msg_channel_id =", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdNotEqualTo(Long value) { + addCriterion("msg_channel_id <>", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdGreaterThan(Long value) { + addCriterion("msg_channel_id >", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdGreaterThanOrEqualTo(Long value) { + addCriterion("msg_channel_id >=", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdLessThan(Long value) { + addCriterion("msg_channel_id <", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdLessThanOrEqualTo(Long value) { + addCriterion("msg_channel_id <=", value, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdIn(List values) { + addCriterion("msg_channel_id in", values, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdNotIn(List values) { + addCriterion("msg_channel_id not in", values, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdBetween(Long value1, Long value2) { + addCriterion("msg_channel_id between", value1, value2, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andMsgChannelIdNotBetween(Long value1, Long value2) { + addCriterion("msg_channel_id not between", value1, value2, "msgChannelId"); + return (Criteria) this; + } + + public Criteria andChannelNameIsNull() { + addCriterion("channel_name is null"); + return (Criteria) this; + } + + public Criteria andChannelNameIsNotNull() { + addCriterion("channel_name is not null"); + return (Criteria) this; + } + + public Criteria andChannelNameEqualTo(String value) { + addCriterion("channel_name =", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotEqualTo(String value) { + addCriterion("channel_name <>", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameGreaterThan(String value) { + addCriterion("channel_name >", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameGreaterThanOrEqualTo(String value) { + addCriterion("channel_name >=", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLessThan(String value) { + addCriterion("channel_name <", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLessThanOrEqualTo(String value) { + addCriterion("channel_name <=", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLike(String value) { + addCriterion("channel_name like", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotLike(String value) { + addCriterion("channel_name not like", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameIn(List values) { + addCriterion("channel_name in", values, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotIn(List values) { + addCriterion("channel_name not in", values, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameBetween(String value1, String value2) { + addCriterion("channel_name between", value1, value2, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotBetween(String value1, String value2) { + addCriterion("channel_name not between", value1, value2, "channelName"); + 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); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java b/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java index 60c1d39c54..e242693c0c 100644 --- a/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgExample.java @@ -224,63 +224,63 @@ public class SysMsgExample { return (Criteria) this; } - public Criteria andTypeIsNull() { - addCriterion("`type` is null"); + public Criteria andTypeIdIsNull() { + addCriterion("type_id is null"); return (Criteria) this; } - public Criteria andTypeIsNotNull() { - addCriterion("`type` is not null"); + public Criteria andTypeIdIsNotNull() { + addCriterion("type_id is not null"); return (Criteria) this; } - public Criteria andTypeEqualTo(Integer value) { - addCriterion("`type` =", value, "type"); + public Criteria andTypeIdEqualTo(Long value) { + addCriterion("type_id =", value, "typeId"); return (Criteria) this; } - public Criteria andTypeNotEqualTo(Integer value) { - addCriterion("`type` <>", value, "type"); + public Criteria andTypeIdNotEqualTo(Long value) { + addCriterion("type_id <>", value, "typeId"); return (Criteria) this; } - public Criteria andTypeGreaterThan(Integer value) { - addCriterion("`type` >", value, "type"); + public Criteria andTypeIdGreaterThan(Long value) { + addCriterion("type_id >", value, "typeId"); return (Criteria) this; } - public Criteria andTypeGreaterThanOrEqualTo(Integer value) { - addCriterion("`type` >=", value, "type"); + public Criteria andTypeIdGreaterThanOrEqualTo(Long value) { + addCriterion("type_id >=", value, "typeId"); return (Criteria) this; } - public Criteria andTypeLessThan(Integer value) { - addCriterion("`type` <", value, "type"); + public Criteria andTypeIdLessThan(Long value) { + addCriterion("type_id <", value, "typeId"); return (Criteria) this; } - public Criteria andTypeLessThanOrEqualTo(Integer value) { - addCriterion("`type` <=", value, "type"); + public Criteria andTypeIdLessThanOrEqualTo(Long value) { + addCriterion("type_id <=", value, "typeId"); return (Criteria) this; } - public Criteria andTypeIn(List values) { - addCriterion("`type` in", values, "type"); + public Criteria andTypeIdIn(List values) { + addCriterion("type_id in", values, "typeId"); return (Criteria) this; } - public Criteria andTypeNotIn(List values) { - addCriterion("`type` not in", values, "type"); + public Criteria andTypeIdNotIn(List values) { + addCriterion("type_id not in", values, "typeId"); return (Criteria) this; } - public Criteria andTypeBetween(Integer value1, Integer value2) { - addCriterion("`type` between", value1, value2, "type"); + public Criteria andTypeIdBetween(Long value1, Long value2) { + addCriterion("type_id between", value1, value2, "typeId"); return (Criteria) this; } - public Criteria andTypeNotBetween(Integer value1, Integer value2) { - addCriterion("`type` not between", value1, value2, "type"); + public Criteria andTypeIdNotBetween(Long value1, Long value2) { + addCriterion("type_id not between", value1, value2, "typeId"); return (Criteria) this; } @@ -344,76 +344,6 @@ public class SysMsgExample { 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 values) { - addCriterion("router in", values, "router"); - return (Criteria) this; - } - - public Criteria andRouterNotIn(List 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; diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgSetting.java b/backend/src/main/java/io/dataease/base/domain/SysMsgSetting.java new file mode 100644 index 0000000000..4d679effec --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgSetting.java @@ -0,0 +1,19 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class SysMsgSetting implements Serializable { + private Long msgSettingId; + + private Long userId; + + private Long typeId; + + private Long channelId; + + private Boolean enable; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgSettingExample.java b/backend/src/main/java/io/dataease/base/domain/SysMsgSettingExample.java new file mode 100644 index 0000000000..6e2f095840 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgSettingExample.java @@ -0,0 +1,500 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class SysMsgSettingExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMsgSettingExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 andMsgSettingIdIsNull() { + addCriterion("msg_setting_id is null"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdIsNotNull() { + addCriterion("msg_setting_id is not null"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdEqualTo(Long value) { + addCriterion("msg_setting_id =", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdNotEqualTo(Long value) { + addCriterion("msg_setting_id <>", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdGreaterThan(Long value) { + addCriterion("msg_setting_id >", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdGreaterThanOrEqualTo(Long value) { + addCriterion("msg_setting_id >=", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdLessThan(Long value) { + addCriterion("msg_setting_id <", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdLessThanOrEqualTo(Long value) { + addCriterion("msg_setting_id <=", value, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdIn(List values) { + addCriterion("msg_setting_id in", values, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdNotIn(List values) { + addCriterion("msg_setting_id not in", values, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdBetween(Long value1, Long value2) { + addCriterion("msg_setting_id between", value1, value2, "msgSettingId"); + return (Criteria) this; + } + + public Criteria andMsgSettingIdNotBetween(Long value1, Long value2) { + addCriterion("msg_setting_id not between", value1, value2, "msgSettingId"); + 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 andTypeIdIsNull() { + addCriterion("type_id is null"); + return (Criteria) this; + } + + public Criteria andTypeIdIsNotNull() { + addCriterion("type_id is not null"); + return (Criteria) this; + } + + public Criteria andTypeIdEqualTo(Long value) { + addCriterion("type_id =", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotEqualTo(Long value) { + addCriterion("type_id <>", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdGreaterThan(Long value) { + addCriterion("type_id >", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdGreaterThanOrEqualTo(Long value) { + addCriterion("type_id >=", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdLessThan(Long value) { + addCriterion("type_id <", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdLessThanOrEqualTo(Long value) { + addCriterion("type_id <=", value, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdIn(List values) { + addCriterion("type_id in", values, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotIn(List values) { + addCriterion("type_id not in", values, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdBetween(Long value1, Long value2) { + addCriterion("type_id between", value1, value2, "typeId"); + return (Criteria) this; + } + + public Criteria andTypeIdNotBetween(Long value1, Long value2) { + addCriterion("type_id not between", value1, value2, "typeId"); + return (Criteria) this; + } + + public Criteria andChannelIdIsNull() { + addCriterion("channel_id is null"); + return (Criteria) this; + } + + public Criteria andChannelIdIsNotNull() { + addCriterion("channel_id is not null"); + return (Criteria) this; + } + + public Criteria andChannelIdEqualTo(Long value) { + addCriterion("channel_id =", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdNotEqualTo(Long value) { + addCriterion("channel_id <>", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdGreaterThan(Long value) { + addCriterion("channel_id >", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdGreaterThanOrEqualTo(Long value) { + addCriterion("channel_id >=", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdLessThan(Long value) { + addCriterion("channel_id <", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdLessThanOrEqualTo(Long value) { + addCriterion("channel_id <=", value, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdIn(List values) { + addCriterion("channel_id in", values, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdNotIn(List values) { + addCriterion("channel_id not in", values, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdBetween(Long value1, Long value2) { + addCriterion("channel_id between", value1, value2, "channelId"); + return (Criteria) this; + } + + public Criteria andChannelIdNotBetween(Long value1, Long value2) { + addCriterion("channel_id not between", value1, value2, "channelId"); + return (Criteria) this; + } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Boolean value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Boolean value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Boolean value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Boolean value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Boolean value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Boolean value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Boolean value1, Boolean value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + 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); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgType.java b/backend/src/main/java/io/dataease/base/domain/SysMsgType.java new file mode 100644 index 0000000000..fd27679478 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgType.java @@ -0,0 +1,19 @@ +package io.dataease.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class SysMsgType implements Serializable { + private Long msgTypeId; + + private Long pid; + + private String typeName; + + private String router; + + private String callback; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/domain/SysMsgTypeExample.java b/backend/src/main/java/io/dataease/base/domain/SysMsgTypeExample.java new file mode 100644 index 0000000000..143c4a936e --- /dev/null +++ b/backend/src/main/java/io/dataease/base/domain/SysMsgTypeExample.java @@ -0,0 +1,530 @@ +package io.dataease.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class SysMsgTypeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysMsgTypeExample() { + oredCriteria = new ArrayList(); + } + + 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 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 criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 andMsgTypeIdIsNull() { + addCriterion("msg_type_id is null"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdIsNotNull() { + addCriterion("msg_type_id is not null"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdEqualTo(Long value) { + addCriterion("msg_type_id =", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdNotEqualTo(Long value) { + addCriterion("msg_type_id <>", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdGreaterThan(Long value) { + addCriterion("msg_type_id >", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdGreaterThanOrEqualTo(Long value) { + addCriterion("msg_type_id >=", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdLessThan(Long value) { + addCriterion("msg_type_id <", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdLessThanOrEqualTo(Long value) { + addCriterion("msg_type_id <=", value, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdIn(List values) { + addCriterion("msg_type_id in", values, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdNotIn(List values) { + addCriterion("msg_type_id not in", values, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdBetween(Long value1, Long value2) { + addCriterion("msg_type_id between", value1, value2, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andMsgTypeIdNotBetween(Long value1, Long value2) { + addCriterion("msg_type_id not between", value1, value2, "msgTypeId"); + return (Criteria) this; + } + + public Criteria andPidIsNull() { + addCriterion("pid is null"); + return (Criteria) this; + } + + public Criteria andPidIsNotNull() { + addCriterion("pid is not null"); + return (Criteria) this; + } + + public Criteria andPidEqualTo(Long value) { + addCriterion("pid =", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotEqualTo(Long value) { + addCriterion("pid <>", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidGreaterThan(Long value) { + addCriterion("pid >", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidGreaterThanOrEqualTo(Long value) { + addCriterion("pid >=", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidLessThan(Long value) { + addCriterion("pid <", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidLessThanOrEqualTo(Long value) { + addCriterion("pid <=", value, "pid"); + return (Criteria) this; + } + + public Criteria andPidIn(List values) { + addCriterion("pid in", values, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotIn(List values) { + addCriterion("pid not in", values, "pid"); + return (Criteria) this; + } + + public Criteria andPidBetween(Long value1, Long value2) { + addCriterion("pid between", value1, value2, "pid"); + return (Criteria) this; + } + + public Criteria andPidNotBetween(Long value1, Long value2) { + addCriterion("pid not between", value1, value2, "pid"); + return (Criteria) this; + } + + public Criteria andTypeNameIsNull() { + addCriterion("type_name is null"); + return (Criteria) this; + } + + public Criteria andTypeNameIsNotNull() { + addCriterion("type_name is not null"); + return (Criteria) this; + } + + public Criteria andTypeNameEqualTo(String value) { + addCriterion("type_name =", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameNotEqualTo(String value) { + addCriterion("type_name <>", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameGreaterThan(String value) { + addCriterion("type_name >", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("type_name >=", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameLessThan(String value) { + addCriterion("type_name <", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameLessThanOrEqualTo(String value) { + addCriterion("type_name <=", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameLike(String value) { + addCriterion("type_name like", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameNotLike(String value) { + addCriterion("type_name not like", value, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameIn(List values) { + addCriterion("type_name in", values, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameNotIn(List values) { + addCriterion("type_name not in", values, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameBetween(String value1, String value2) { + addCriterion("type_name between", value1, value2, "typeName"); + return (Criteria) this; + } + + public Criteria andTypeNameNotBetween(String value1, String value2) { + addCriterion("type_name not between", value1, value2, "typeName"); + 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 values) { + addCriterion("router in", values, "router"); + return (Criteria) this; + } + + public Criteria andRouterNotIn(List 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 andCallbackIsNull() { + addCriterion("callback is null"); + return (Criteria) this; + } + + public Criteria andCallbackIsNotNull() { + addCriterion("callback is not null"); + return (Criteria) this; + } + + public Criteria andCallbackEqualTo(String value) { + addCriterion("callback =", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackNotEqualTo(String value) { + addCriterion("callback <>", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackGreaterThan(String value) { + addCriterion("callback >", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackGreaterThanOrEqualTo(String value) { + addCriterion("callback >=", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackLessThan(String value) { + addCriterion("callback <", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackLessThanOrEqualTo(String value) { + addCriterion("callback <=", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackLike(String value) { + addCriterion("callback like", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackNotLike(String value) { + addCriterion("callback not like", value, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackIn(List values) { + addCriterion("callback in", values, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackNotIn(List values) { + addCriterion("callback not in", values, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackBetween(String value1, String value2) { + addCriterion("callback between", value1, value2, "callback"); + return (Criteria) this; + } + + public Criteria andCallbackNotBetween(String value1, String value2) { + addCriterion("callback not between", value1, value2, "callback"); + 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); + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.java b/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.java new file mode 100644 index 0000000000..06948bd2f7 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.SysMsgChannel; +import io.dataease.base.domain.SysMsgChannelExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysMsgChannelMapper { + long countByExample(SysMsgChannelExample example); + + int deleteByExample(SysMsgChannelExample example); + + int deleteByPrimaryKey(Long msgChannelId); + + int insert(SysMsgChannel record); + + int insertSelective(SysMsgChannel record); + + List selectByExample(SysMsgChannelExample example); + + SysMsgChannel selectByPrimaryKey(Long msgChannelId); + + int updateByExampleSelective(@Param("record") SysMsgChannel record, @Param("example") SysMsgChannelExample example); + + int updateByExample(@Param("record") SysMsgChannel record, @Param("example") SysMsgChannelExample example); + + int updateByPrimaryKeySelective(SysMsgChannel record); + + int updateByPrimaryKey(SysMsgChannel record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml new file mode 100644 index 0000000000..9e8a89dcdf --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + msg_channel_id, channel_name + + + + + delete from sys_msg_channel + where msg_channel_id = #{msgChannelId,jdbcType=BIGINT} + + + delete from sys_msg_channel + + + + + + insert into sys_msg_channel (msg_channel_id, channel_name) + values (#{msgChannelId,jdbcType=BIGINT}, #{channelName,jdbcType=VARCHAR}) + + + insert into sys_msg_channel + + + msg_channel_id, + + + channel_name, + + + + + #{msgChannelId,jdbcType=BIGINT}, + + + #{channelName,jdbcType=VARCHAR}, + + + + + + update sys_msg_channel + + + msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT}, + + + channel_name = #{record.channelName,jdbcType=VARCHAR}, + + + + + + + + update sys_msg_channel + set msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT}, + channel_name = #{record.channelName,jdbcType=VARCHAR} + + + + + + update sys_msg_channel + + + channel_name = #{channelName,jdbcType=VARCHAR}, + + + where msg_channel_id = #{msgChannelId,jdbcType=BIGINT} + + + update sys_msg_channel + set channel_name = #{channelName,jdbcType=VARCHAR} + where msg_channel_id = #{msgChannelId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml index d13dafb604..ac47b7b666 100644 --- a/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml @@ -4,9 +4,8 @@ - + - @@ -71,7 +70,7 @@ - msg_id, user_id, `type`, `status`, router, param, create_time, read_time, content + msg_id, user_id, type_id, `status`, param, create_time, read_time, content + select + + distinct + + + from sys_msg_setting + + + + + order by ${orderByClause} + + + + + delete from sys_msg_setting + where msg_setting_id = #{msgSettingId,jdbcType=BIGINT} + + + delete from sys_msg_setting + + + + + + insert into sys_msg_setting (msg_setting_id, user_id, type_id, + channel_id, `enable`) + values (#{msgSettingId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{typeId,jdbcType=BIGINT}, + #{channelId,jdbcType=BIGINT}, #{enable,jdbcType=BIT}) + + + insert into sys_msg_setting + + + msg_setting_id, + + + user_id, + + + type_id, + + + channel_id, + + + `enable`, + + + + + #{msgSettingId,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{typeId,jdbcType=BIGINT}, + + + #{channelId,jdbcType=BIGINT}, + + + #{enable,jdbcType=BIT}, + + + + + + update sys_msg_setting + + + msg_setting_id = #{record.msgSettingId,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + type_id = #{record.typeId,jdbcType=BIGINT}, + + + channel_id = #{record.channelId,jdbcType=BIGINT}, + + + `enable` = #{record.enable,jdbcType=BIT}, + + + + + + + + update sys_msg_setting + set msg_setting_id = #{record.msgSettingId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + type_id = #{record.typeId,jdbcType=BIGINT}, + channel_id = #{record.channelId,jdbcType=BIGINT}, + `enable` = #{record.enable,jdbcType=BIT} + + + + + + update sys_msg_setting + + + user_id = #{userId,jdbcType=BIGINT}, + + + type_id = #{typeId,jdbcType=BIGINT}, + + + channel_id = #{channelId,jdbcType=BIGINT}, + + + `enable` = #{enable,jdbcType=BIT}, + + + where msg_setting_id = #{msgSettingId,jdbcType=BIGINT} + + + update sys_msg_setting + set user_id = #{userId,jdbcType=BIGINT}, + type_id = #{typeId,jdbcType=BIGINT}, + channel_id = #{channelId,jdbcType=BIGINT}, + `enable` = #{enable,jdbcType=BIT} + where msg_setting_id = #{msgSettingId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.java b/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.java new file mode 100644 index 0000000000..8d156a832d --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.java @@ -0,0 +1,30 @@ +package io.dataease.base.mapper; + +import io.dataease.base.domain.SysMsgType; +import io.dataease.base.domain.SysMsgTypeExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysMsgTypeMapper { + long countByExample(SysMsgTypeExample example); + + int deleteByExample(SysMsgTypeExample example); + + int deleteByPrimaryKey(Long msgTypeId); + + int insert(SysMsgType record); + + int insertSelective(SysMsgType record); + + List selectByExample(SysMsgTypeExample example); + + SysMsgType selectByPrimaryKey(Long msgTypeId); + + int updateByExampleSelective(@Param("record") SysMsgType record, @Param("example") SysMsgTypeExample example); + + int updateByExample(@Param("record") SysMsgType record, @Param("example") SysMsgTypeExample example); + + int updateByPrimaryKeySelective(SysMsgType record); + + int updateByPrimaryKey(SysMsgType record); +} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.xml b/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.xml new file mode 100644 index 0000000000..c3cc487413 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + msg_type_id, pid, type_name, router, callback + + + + + delete from sys_msg_type + where msg_type_id = #{msgTypeId,jdbcType=BIGINT} + + + delete from sys_msg_type + + + + + + insert into sys_msg_type (msg_type_id, pid, type_name, + router, callback) + values (#{msgTypeId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{typeName,jdbcType=VARCHAR}, + #{router,jdbcType=VARCHAR}, #{callback,jdbcType=VARCHAR}) + + + insert into sys_msg_type + + + msg_type_id, + + + pid, + + + type_name, + + + router, + + + callback, + + + + + #{msgTypeId,jdbcType=BIGINT}, + + + #{pid,jdbcType=BIGINT}, + + + #{typeName,jdbcType=VARCHAR}, + + + #{router,jdbcType=VARCHAR}, + + + #{callback,jdbcType=VARCHAR}, + + + + + + update sys_msg_type + + + msg_type_id = #{record.msgTypeId,jdbcType=BIGINT}, + + + pid = #{record.pid,jdbcType=BIGINT}, + + + type_name = #{record.typeName,jdbcType=VARCHAR}, + + + router = #{record.router,jdbcType=VARCHAR}, + + + callback = #{record.callback,jdbcType=VARCHAR}, + + + + + + + + update sys_msg_type + set msg_type_id = #{record.msgTypeId,jdbcType=BIGINT}, + pid = #{record.pid,jdbcType=BIGINT}, + type_name = #{record.typeName,jdbcType=VARCHAR}, + router = #{record.router,jdbcType=VARCHAR}, + callback = #{record.callback,jdbcType=VARCHAR} + + + + + + update sys_msg_type + + + pid = #{pid,jdbcType=BIGINT}, + + + type_name = #{typeName,jdbcType=VARCHAR}, + + + router = #{router,jdbcType=VARCHAR}, + + + callback = #{callback,jdbcType=VARCHAR}, + + + where msg_type_id = #{msgTypeId,jdbcType=BIGINT} + + + update sys_msg_type + set pid = #{pid,jdbcType=BIGINT}, + type_name = #{typeName,jdbcType=VARCHAR}, + router = #{router,jdbcType=VARCHAR}, + callback = #{callback,jdbcType=VARCHAR} + where msg_type_id = #{msgTypeId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java index 9d5c2ad132..08d0eb5123 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java @@ -1,5 +1,7 @@ package io.dataease.base.mapper.ext; +import io.dataease.base.domain.SysMsgExample; +import io.dataease.controller.message.dto.MsgGridDto; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,4 +35,7 @@ public interface ExtSysMsgMapper { int batchDelete(@Param("msgIds") List msgIds); + List queryGrid(SysMsgExample example); + + } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.xml new file mode 100644 index 0000000000..53892fc215 --- /dev/null +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + diff --git a/backend/src/main/java/io/dataease/commons/constants/SysMsgConstants.java b/backend/src/main/java/io/dataease/commons/constants/SysMsgConstants.java new file mode 100644 index 0000000000..6c2689404a --- /dev/null +++ b/backend/src/main/java/io/dataease/commons/constants/SysMsgConstants.java @@ -0,0 +1,8 @@ +package io.dataease.commons.constants; + +public class SysMsgConstants { + + public final static String SYS_MSG_CHANNEL = "sys_msg_channel"; + public final static String SYS_MSG_TYPE = "sys_msg_type"; + public final static String SYS_MSG_USER_SUBSCRIBE = "sys_msg_user_subscribe"; +} diff --git a/backend/src/main/java/io/dataease/controller/message/MsgController.java b/backend/src/main/java/io/dataease/controller/message/MsgController.java index a3125df1de..6f84a2e4df 100644 --- a/backend/src/main/java/io/dataease/controller/message/MsgController.java +++ b/backend/src/main/java/io/dataease/controller/message/MsgController.java @@ -2,16 +2,20 @@ package io.dataease.controller.message; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; -import io.dataease.base.domain.SysMsg; +import io.dataease.base.domain.SysMsgChannel; +import io.dataease.base.domain.SysMsgSetting; +import io.dataease.base.domain.SysMsgType; import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.PageUtils; import io.dataease.commons.utils.Pager; +import io.dataease.controller.message.dto.MsgGridDto; import io.dataease.controller.message.dto.MsgRequest; +import io.dataease.controller.message.dto.MsgSettingRequest; +import io.dataease.controller.message.dto.SettingTreeNode; 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; @@ -25,10 +29,10 @@ public class MsgController { @ApiOperation("查询消息") @PostMapping("/list/{goPage}/{pageSize}") - public Pager> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) { + public Pager> messages(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody MsgRequest msgRequest) { Long userId = AuthUtils.getUser().getUserId(); Page page = PageHelper.startPage(goPage, pageSize, true); - Pager> listPager = PageUtils.setPageInfo(page, sysMsgService.query(userId, msgRequest)); + Pager> listPager = PageUtils.setPageInfo(page, sysMsgService.queryGrid(userId, msgRequest)); return listPager; } @@ -47,4 +51,32 @@ public class MsgController { public void batchDelete(@RequestBody List msgIds) { sysMsgService.batchDelete(msgIds); } + + @PostMapping("/treeNodes") + public List treeNodes() { + + return sysMsgService.treeNodes(); + } + + @PostMapping("/channelList") + public List channelList() { + return sysMsgService.channelList(); + } + + @PostMapping("/settingList") + public List settingList() { + return sysMsgService.settingList(); + } + + @PostMapping("/updateSetting") + public void updateSetting(@RequestBody MsgSettingRequest request) { + Long userId = AuthUtils.getUser().getUserId(); + sysMsgService.updateSetting(request, userId); + } + + @PostMapping("/types") + public List allTypes() { + List sysMsgTypes = sysMsgService.queryMsgTypes(); + return sysMsgTypes; + } } diff --git a/backend/src/main/java/io/dataease/controller/message/dto/MsgGridDto.java b/backend/src/main/java/io/dataease/controller/message/dto/MsgGridDto.java new file mode 100644 index 0000000000..f88d6a57f3 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/dto/MsgGridDto.java @@ -0,0 +1,11 @@ +package io.dataease.controller.message.dto; + +import io.dataease.base.domain.SysMsg; +import lombok.Data; + +@Data +public class MsgGridDto extends SysMsg { + + private String router; + private String callback; +} diff --git a/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java b/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java index c081703309..6f9c3daba2 100644 --- a/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java +++ b/backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java @@ -10,7 +10,7 @@ public class MsgRequest implements Serializable { private static final long serialVersionUID = 1920091635946508658L; - private Integer type; + private Long type; private Boolean status; diff --git a/backend/src/main/java/io/dataease/controller/message/dto/MsgSettingRequest.java b/backend/src/main/java/io/dataease/controller/message/dto/MsgSettingRequest.java new file mode 100644 index 0000000000..3f1ec00b85 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/dto/MsgSettingRequest.java @@ -0,0 +1,14 @@ +package io.dataease.controller.message.dto; + + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MsgSettingRequest implements Serializable { + + private Long typeId; + + private Long channelId; +} diff --git a/backend/src/main/java/io/dataease/controller/message/dto/SettingTreeNode.java b/backend/src/main/java/io/dataease/controller/message/dto/SettingTreeNode.java new file mode 100644 index 0000000000..154147a223 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/dto/SettingTreeNode.java @@ -0,0 +1,19 @@ +package io.dataease.controller.message.dto; + + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class SettingTreeNode implements Serializable { + + private static final long serialVersionUID = -2416283978185545199L; + + private Long id; + + private String name; + + private List children; +} diff --git a/backend/src/main/java/io/dataease/controller/message/dto/SubscribeNode.java b/backend/src/main/java/io/dataease/controller/message/dto/SubscribeNode.java new file mode 100644 index 0000000000..40773bd735 --- /dev/null +++ b/backend/src/main/java/io/dataease/controller/message/dto/SubscribeNode.java @@ -0,0 +1,20 @@ +package io.dataease.controller.message.dto; + + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class SubscribeNode implements Serializable { + + private static final long serialVersionUID = -1680823237289721438L; + + private Long typeId; + + private Long channelId; + + public Boolean match(Long type, Long channel) { + return type == typeId && channel == channelId; + } +} diff --git a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java index c39911ff4f..078a02635b 100644 --- a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java +++ b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java @@ -25,7 +25,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.poi.hssf.usermodel.HSSFSheet; @@ -60,11 +59,9 @@ import org.pentaho.di.trans.steps.userdefinedjavaclass.UserDefinedJavaClassDef; import org.pentaho.di.trans.steps.userdefinedjavaclass.UserDefinedJavaClassMeta; import org.pentaho.di.www.SlaveServerJobStatus; import org.quartz.JobExecutionContext; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; - import javax.annotation.Resource; import java.io.File; import java.io.FileInputStream; @@ -403,6 +400,7 @@ public class ExtractDataService { private void sendWebMsg(DatasetTable datasetTable, String taskId, Boolean status) { String msg = status ? "成功" : "失败"; + Long typeId = status ? 5L : 6L; String id = datasetTable.getId(); AuthURD authURD = AuthUtils.authURDR(id); Set userIds = AuthUtils.userIdsByURD(authURD); @@ -411,7 +409,7 @@ public class ExtractDataService { Map param = new HashMap<>(); param.put("tableId", id); param.put("taskId", taskId); - DeMsgutil.sendMsg(userId, 1, "数据集【"+datasetTable.getName()+"】同步"+msg, gson.toJson(param)); + DeMsgutil.sendMsg(userId, typeId, 1L, "数据集【"+datasetTable.getName()+"】同步"+msg, gson.toJson(param)); }); } diff --git a/backend/src/main/java/io/dataease/service/message/DeMsgutil.java b/backend/src/main/java/io/dataease/service/message/DeMsgutil.java index fc1b3d354b..8d3e62c527 100644 --- a/backend/src/main/java/io/dataease/service/message/DeMsgutil.java +++ b/backend/src/main/java/io/dataease/service/message/DeMsgutil.java @@ -1,24 +1,13 @@ 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 routerMap ; - @PostConstruct - public void init() { - routerMap = new HashMap<>(); - routerMap.put(0, "panel"); - routerMap.put(1, "dataset"); - } private static SysMsgService sysMsgService; @@ -27,27 +16,18 @@ public class DeMsgutil { 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, Long typeId, Long channelId, String content, String param) { +// SysMsg sysMsg = new SysMsg(); +// sysMsg.setUserId(userId); +// sysMsg.setTypeId(typeId); +// sysMsg.setContent(content); +// sysMsg.setStatus(false); +// sysMsg.setCreateTime(System.currentTimeMillis()); +// sysMsg.setParam(param); + sysMsgService.sendMsg(userId, typeId, channelId, content, param); } - 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); - } } diff --git a/backend/src/main/java/io/dataease/service/message/MsgAop.java b/backend/src/main/java/io/dataease/service/message/MsgAop.java new file mode 100644 index 0000000000..cf4cb8790e --- /dev/null +++ b/backend/src/main/java/io/dataease/service/message/MsgAop.java @@ -0,0 +1,60 @@ +package io.dataease.service.message; + + +import io.dataease.controller.message.dto.SubscribeNode; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.stereotype.Component; +import javax.annotation.Resource; +import java.util.List; + +@Aspect +@Component +public class MsgAop { + + + + + @Resource + private SysMsgService sysMsgService; + + + + + + /** + * 对sendMsg 切面拦截 + * @param point + */ + @Around("(execution(* io.dataease.service.message.SysMsgService.sendMsg(..)))") + public Object cutPoint(ProceedingJoinPoint point) { + + Object[] args = point.getArgs(); + Object arg0 = args[0]; + Object arg1 = args[1]; + Object arg2 = args[2]; + + if (ObjectUtils.isEmpty(arg0) || ObjectUtils.isEmpty(arg1) || ObjectUtils.isEmpty(arg2)) { + return null; + } + Long userId = (Long) arg0; + Long typeId = (Long) arg1; + Long channelId = (Long) arg2; + + List subscribes = sysMsgService.subscribes(userId); + + try { + // 如果已经订阅了这种类型的消息 直接发送 否则直接返回 + if (CollectionUtils.isNotEmpty(subscribes) && subscribes.stream().anyMatch(item -> item.match(typeId, channelId))) + return point.proceed(args); + return null; + } catch (Throwable throwable) { + throwable.printStackTrace(); + } + return null; + + } +} diff --git a/backend/src/main/java/io/dataease/service/message/SysMsgService.java b/backend/src/main/java/io/dataease/service/message/SysMsgService.java index 6c9a4273c0..0bc5cdb8c8 100644 --- a/backend/src/main/java/io/dataease/service/message/SysMsgService.java +++ b/backend/src/main/java/io/dataease/service/message/SysMsgService.java @@ -1,16 +1,26 @@ package io.dataease.service.message; -import io.dataease.base.domain.SysMsg; -import io.dataease.base.domain.SysMsgExample; +import io.dataease.base.domain.*; +import io.dataease.base.mapper.SysMsgChannelMapper; import io.dataease.base.mapper.SysMsgMapper; +import io.dataease.base.mapper.SysMsgSettingMapper; +import io.dataease.base.mapper.SysMsgTypeMapper; import io.dataease.base.mapper.ext.ExtSysMsgMapper; -import io.dataease.controller.message.dto.MsgRequest; +import io.dataease.commons.constants.SysMsgConstants; +import io.dataease.commons.utils.AuthUtils; +import io.dataease.commons.utils.CommonBeanFactory; +import io.dataease.controller.message.dto.*; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; @Service public class SysMsgService { @@ -21,6 +31,17 @@ public class SysMsgService { @Resource private ExtSysMsgMapper extSysMsgMapper; + + @Resource + private SysMsgTypeMapper sysMsgTypeMapper; + + + @Resource + private SysMsgChannelMapper sysMsgChannelMapper; + + @Resource + private SysMsgSettingMapper sysMsgSettingMapper; + public List query(Long userId, MsgRequest msgRequest) { String orderClause = " create_time desc"; SysMsgExample example = new SysMsgExample(); @@ -34,7 +55,7 @@ public class SysMsgService { } if (ObjectUtils.isNotEmpty(msgRequest.getType())) { - criteria.andTypeEqualTo(msgRequest.getType()); + criteria.andTypeIdEqualTo(msgRequest.getType()); } if (ObjectUtils.isNotEmpty(msgRequest.getStatus())) { @@ -46,6 +67,36 @@ public class SysMsgService { return sysMsgs; } + public List queryGrid(Long userId, MsgRequest msgRequest) { + String orderClause = " create_time desc"; + SysMsgExample example = new SysMsgExample(); + SysMsgExample.Criteria criteria = example.createCriteria(); + criteria.andUserIdEqualTo(userId); + + List orders = msgRequest.getOrders(); + + if (CollectionUtils.isNotEmpty(orders)) { + orderClause = String.join(", ", orders); + } + + if (ObjectUtils.isNotEmpty(msgRequest.getType())) { + SysMsgTypeExample sysMsgTypeExample = new SysMsgTypeExample(); + sysMsgTypeExample.createCriteria().andPidEqualTo(msgRequest.getType()); + + List sysMsgTypes = sysMsgTypeMapper.selectByExample(sysMsgTypeExample); + List typeIds = sysMsgTypes.stream().map(SysMsgType::getMsgTypeId).collect(Collectors.toList()); + criteria.andTypeIdIn(typeIds); + } + + if (ObjectUtils.isNotEmpty(msgRequest.getStatus())) { + criteria.andStatusEqualTo(msgRequest.getStatus()); + } + + example.setOrderByClause(orderClause); + List msgGridDtos = extSysMsgMapper.queryGrid(example); + return msgGridDtos; + } + public void setReaded(Long msgId) { SysMsg sysMsg = new SysMsg(); sysMsg.setMsgId(msgId); @@ -67,4 +118,121 @@ public class SysMsgService { } + public List treeNodes() { + SysMsgService proxy = CommonBeanFactory.getBean(SysMsgService.class); + List sysMsgTypes = proxy.queryMsgTypes(); + return buildTree(sysMsgTypes); + } + + @Cacheable(SysMsgConstants.SYS_MSG_TYPE) + public List queryMsgTypes() { + SysMsgTypeExample example = new SysMsgTypeExample(); + List sysMsgTypes = sysMsgTypeMapper.selectByExample(example); + return sysMsgTypes; + } + + private List buildTree(List lists){ + List rootNodes = new ArrayList<>(); + lists.forEach(node -> { + SettingTreeNode settingTreeNode = convert(node); + if (isParent(node)) { + rootNodes.add(settingTreeNode); + } + lists.forEach(tNode -> { + if (tNode.getPid() == settingTreeNode.getId()) { + if (settingTreeNode.getChildren() == null) { + settingTreeNode.setChildren(new ArrayList()); + } + settingTreeNode.getChildren().add(convert(tNode)); + } + }); + }); + return rootNodes; + } + + private Boolean isParent(SysMsgType typeNode) { + return typeNode.getPid() == 0L; + } + + public SettingTreeNode convert(SysMsgType typeNode) { + SettingTreeNode settingTreeNode = new SettingTreeNode(); + settingTreeNode.setId(typeNode.getMsgTypeId()); + settingTreeNode.setName(typeNode.getTypeName()); + return settingTreeNode; + } + + + @Cacheable(SysMsgConstants.SYS_MSG_CHANNEL) + public List channelList() { + SysMsgChannelExample example = new SysMsgChannelExample(); + return sysMsgChannelMapper.selectByExample(example); + } + + public List settingList() { + Long userId = AuthUtils.getUser().getUserId(); + SysMsgSettingExample example = new SysMsgSettingExample(); + example.createCriteria().andUserIdEqualTo(userId); + List sysMsgSettings = sysMsgSettingMapper.selectByExample(example); + return sysMsgSettings; + } + + /** + * 修改了订阅信息 需要清除缓存 + * @param request + * @param userId + */ + @Transactional + @CacheEvict(value = SysMsgConstants.SYS_MSG_USER_SUBSCRIBE, key = "#userId") + public void updateSetting(MsgSettingRequest request, Long userId) { + Long typeId = request.getTypeId(); + Long channelId = request.getChannelId(); + // Long userId = AuthUtils.getUser().getUserId(); + SysMsgSettingExample example = new SysMsgSettingExample(); + example.createCriteria().andUserIdEqualTo(userId).andTypeIdEqualTo(typeId).andChannelIdEqualTo(channelId); + List sysMsgSettings = sysMsgSettingMapper.selectByExample(example); + if (CollectionUtils.isNotEmpty(sysMsgSettings)) { + sysMsgSettings.forEach(setting -> { + setting.setEnable(!setting.getEnable()); + sysMsgSettingMapper.updateByPrimaryKeySelective(setting); + }); + return; + } + SysMsgSetting sysMsgSetting = new SysMsgSetting(); + sysMsgSetting.setEnable(true); + sysMsgSetting.setChannelId(channelId); + sysMsgSetting.setTypeId(typeId); + sysMsgSetting.setUserId(userId); + sysMsgSettingMapper.insert(sysMsgSetting); + } + + public void sendMsg(Long userId, Long typeId, Long channelId, String content, String param) { + SysMsg sysMsg = new SysMsg(); + sysMsg.setUserId(userId); + sysMsg.setTypeId(typeId); + sysMsg.setContent(content); + sysMsg.setStatus(false); + sysMsg.setCreateTime(System.currentTimeMillis()); + sysMsg.setParam(param); + save(sysMsg); + } + + /** + * 查询用户订阅的消息 并缓存 + * @param userId + * @return + */ + @Cacheable(value = SysMsgConstants.SYS_MSG_USER_SUBSCRIBE, key = "#userId") + public List subscribes(Long userId) { + SysMsgSettingExample example = new SysMsgSettingExample(); + example.createCriteria().andUserIdEqualTo(userId).andEnableEqualTo(true); + List sysMsgSettings = sysMsgSettingMapper.selectByExample(example); + List resultLists = sysMsgSettings.stream().map(item -> { + SubscribeNode subscribeNode = new SubscribeNode(); + subscribeNode.setTypeId(item.getTypeId()); + subscribeNode.setChannelId(item.getChannelId()); + return subscribeNode; + }).collect(Collectors.toList()); + return resultLists; + } + } diff --git a/backend/src/main/java/io/dataease/service/panel/ShareService.java b/backend/src/main/java/io/dataease/service/panel/ShareService.java index 8165df9932..7656b61bcf 100644 --- a/backend/src/main/java/io/dataease/service/panel/ShareService.java +++ b/backend/src/main/java/io/dataease/service/panel/ShareService.java @@ -133,14 +133,14 @@ public class ShareService { List msgParam = new ArrayList(); msgParam.add(panelGroupId); addUserIdSet.forEach(userId -> { - if (!redUserIdSet.contains(userId)){ - DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】,请查收!", gson.toJson(msgParam)); + if (!redUserIdSet.contains(userId) && user.getUserId() != userId){ + DeMsgutil.sendMsg(userId, 2L, 1L,user.getNickName()+" 分享了仪表板【"+msg+"】,请查收!", gson.toJson(msgParam)); } }); redUserIdSet.forEach(userId -> { - if (!addUserIdSet.contains(userId)){ - DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 取消分享了仪表板【"+msg+"】,请查收!", gson.toJson(msgParam)); + if (!addUserIdSet.contains(userId) && user.getUserId() != userId){ + DeMsgutil.sendMsg(userId, 3L, 1L,user.getNickName()+" 取消分享了仪表板【"+msg+"】,请查收!", gson.toJson(msgParam)); } }); @@ -263,7 +263,7 @@ public class ShareService { Gson gson = new Gson(); userIdSet.forEach(userId -> { // DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!"); - DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!", gson.toJson(panelIds)); + DeMsgutil.sendMsg(userId, 2L,1L, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!", gson.toJson(panelIds)); }); } diff --git a/backend/src/main/resources/db/migration/V10__web_msg.sql b/backend/src/main/resources/db/migration/V10__web_msg.sql index 5702ecc48d..139c31b8e8 100644 --- a/backend/src/main/resources/db/migration/V10__web_msg.sql +++ b/backend/src/main/resources/db/migration/V10__web_msg.sql @@ -5,24 +5,81 @@ 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 '类型', + `type_id` bigint(20) 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_type` (`type_id`) USING BTREE, KEY `inx_msg_status` (`status`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='消息通知表'; +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='消息通知表'; + +-- ---------------------------- +-- Table structure for sys_msg_channel +-- ---------------------------- +DROP TABLE IF EXISTS `sys_msg_channel`; +CREATE TABLE `sys_msg_channel` ( + `msg_channel_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `channel_name` varchar(255) DEFAULT NULL COMMENT '渠道名称', + PRIMARY KEY (`msg_channel_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='消息渠道表'; + +-- ---------------------------- +-- Records of sys_msg_channel +-- ---------------------------- +BEGIN; +INSERT INTO `sys_msg_channel` VALUES (1, 'webmsg.channel_inner_msg'); +COMMIT; + + +-- ---------------------------- +-- Table structure for sys_msg_type +-- ---------------------------- +DROP TABLE IF EXISTS `sys_msg_type`; +CREATE TABLE `sys_msg_type` ( + `msg_type_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `pid` bigint(20) NOT NULL COMMENT '父类ID', + `type_name` varchar(255) DEFAULT NULL COMMENT '类型名称', + `router` varchar(255) DEFAULT NULL COMMENT '跳转路由', + `callback` varchar(255) DEFAULT NULL COMMENT '回调方法', + PRIMARY KEY (`msg_type_id`) USING BTREE, + KEY `inx_msgtype_pid` (`pid`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='消息类型表'; + +-- ---------------------------- +-- Records of sys_msg_type +-- ---------------------------- +BEGIN; +INSERT INTO `sys_msg_type` VALUES (1, 0, 'i18n_msg_type_panel_share', 'panel', 'to-msg-share'); +INSERT INTO `sys_msg_type` VALUES (2, 1, 'i18n_msg_type_panel_share', 'panel', 'to-msg-share'); +INSERT INTO `sys_msg_type` VALUES (3, 1, 'i18n_msg_type_panel_share_cacnel', 'panel', 'to-msg-share'); +INSERT INTO `sys_msg_type` VALUES (4, 0, 'i18n_msg_type_dataset_sync', 'dataset', 'to-msg-dataset'); +INSERT INTO `sys_msg_type` VALUES (5, 4, 'i18n_msg_type_dataset_sync_success', 'dataset', 'to-msg-dataset'); +INSERT INTO `sys_msg_type` VALUES (6, 4, 'i18n_msg_type_dataset_sync_faild', 'dataset', 'to-msg-dataset'); +COMMIT; + +-- ---------------------------- +-- Table structure for sys_msg_setting +-- ---------------------------- +DROP TABLE IF EXISTS `sys_msg_setting`; +CREATE TABLE `sys_msg_setting` ( + `msg_setting_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` bigint(20) NOT NULL COMMENT '用户ID', + `type_id` bigint(20) NOT NULL COMMENT '类型ID', + `channel_id` bigint(20) NOT NULL COMMENT '渠道ID', + `enable` tinyint(1) DEFAULT NULL COMMENT '是否启用', + PRIMARY KEY (`msg_setting_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='消息设置表'; BEGIN; INSERT INTO `sys_menu` VALUES (53, 1, 3, 1, '站内消息', 'sys-msg-web', 'msg/index', 1000, 'all-msg', 'system-msg-web', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (54, 53, 0, 1, '所有消息', 'sys-msg-web-all', 'msg/all', 1, 'web-msg', 'all', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (55, 53, 0, 1, '未读消息', 'sys-msg-web-unread', 'msg/unread', 2, 'unread-msg', 'unread', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL); INSERT INTO `sys_menu` VALUES (56, 53, 0, 1, '已读消息', 'sys-msg-web-readed', 'msg/readed', 3, 'readed-msg', 'readed', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL); +INSERT INTO `sys_menu` VALUES (59, 53, 0, 1, '接收管理', 'sys-msg-setting', 'msg/setting', 4, 'msg-setting', 'setting', b'0', b'0', b'0', NULL, NULL, NULL, NULL, NULL); COMMIT; BEGIN; diff --git a/backend/src/main/resources/ehcache/ehcache.xml b/backend/src/main/resources/ehcache/ehcache.xml index 8f3bf770f0..7043e2aa90 100644 --- a/backend/src/main/resources/ehcache/ehcache.xml +++ b/backend/src/main/resources/ehcache/ehcache.xml @@ -95,4 +95,38 @@ /> + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index daa0be9874..9265246666 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -266,4 +266,10 @@ i18n_schema_is_empty=Database schema is empty 所有消息=All Messages 未读消息=Unread Messages 已读消息=Read Messages +接收管理=Receive Manage +i18n_msg_type_panel_share=Dashboard sharing +i18n_msg_type_panel_share_cacnel=Dashboard unshared +i18n_msg_type_dataset_sync=Data set synchronization +i18n_msg_type_dataset_sync_success=Dataset synchronization successful +i18n_msg_type_dataset_sync_faild=Dataset synchronization failed i18n_data_not_sync=Please sync data first \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 0871efe0cd..afd2b013fe 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -265,4 +265,10 @@ i18n_schema_is_empty=数据库 Schema 为空 所有消息=所有消息 未读消息=未读消息 已读消息=已读消息 +接收管理=接收管理 +i18n_msg_type_panel_share=仪表板分享 +i18n_msg_type_panel_share_cacnel=仪表板取消分享 +i18n_msg_type_dataset_sync=数据集同步 +i18n_msg_type_dataset_sync_success=数据集同步成功 +i18n_msg_type_dataset_sync_faild=数据集同步失败 i18n_data_not_sync=请先完成数据同步 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 1dccd068c1..8edc897158 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -268,4 +268,10 @@ i18n_schema_is_empty=數據庫 Schema 為空 所有消息=所有消息 未读消息=未讀消息 已读消息=已讀消息 +接收管理=接收管理 +i18n_msg_type_panel_share=儀表板分享 +i18n_msg_type_panel_share_cacnel=儀表板取消分享 +i18n_msg_type_dataset_sync=數據集同步 +i18n_msg_type_dataset_sync_success=數據集同步成功 +i18n_msg_type_dataset_sync_faild=數據集同步失敗 i18n_data_not_sync=請先完成數據同步 \ No newline at end of file diff --git a/frontend/src/api/system/msg.js b/frontend/src/api/system/msg.js index 0f4cc70dfe..bf13395a41 100644 --- a/frontend/src/api/system/msg.js +++ b/frontend/src/api/system/msg.js @@ -26,3 +26,44 @@ export function batchRead(data) { }) } +export function treeList() { + return request({ + url: '/api/sys_msg/treeNodes', + method: 'post', + loading: true + }) +} + +export function channelList() { + return request({ + url: '/api/sys_msg/channelList', + method: 'post', + loading: true + }) +} + +export function settingList() { + return request({ + url: '/api/sys_msg/settingList', + method: 'post', + loading: true + }) +} + +export function updateSetting(data) { + return request({ + url: '/api/sys_msg/updateSetting', + method: 'post', + loading: true, + data + }) +} + +export function allTypes(data) { + return request({ + url: '/api/sys_msg/types', + method: 'post', + loading: true + }) +} + diff --git a/frontend/src/components/Notification/index.vue b/frontend/src/components/Notification/index.vue index 1d2a307a31..c173641dfe 100644 --- a/frontend/src/components/Notification/index.vue +++ b/frontend/src/components/Notification/index.vue @@ -31,7 +31,7 @@
-
【{{ $t(getTypeName(scope.row.type)) }}】  {{ scope.row.content }}
+
【{{ getTypeName(scope.row.typeId) }}】  {{ scope.row.content }}
{{ scope.row.createTime | timestampFormatDate }}
+
+ + + + + +
+ + + + + + + + + + diff --git a/frontend/src/views/msg/unread.vue b/frontend/src/views/msg/unread.vue index c5bfd90319..b017942771 100644 --- a/frontend/src/views/msg/unread.vue +++ b/frontend/src/views/msg/unread.vue @@ -2,7 +2,7 @@ - {{ $t(item.label) }} + {{ $t('webmsg.' + item.typeName) }} - + @@ -61,7 +61,7 @@ import LayoutContent from '@/components/business/LayoutContent' import ComplexTable from '@/components/business/complex-table' import { query, updateStatus, batchRead } from '@/api/system/msg' -import { msgTypes, getTypeName } from '@/utils/webMsg' +import { msgTypes, getTypeName, loadMsgTypes } from '@/utils/webMsg' import bus from '@/utils/bus' import { addOrder, formatOrders } from '@/utils/index' @@ -100,6 +100,10 @@ export default { mounted() { this.search() }, + created() { + // 先加载消息类型 + loadMsgTypes() + }, methods: { select(selection) { }, @@ -124,13 +128,13 @@ export default { }) }, getTypeName(value) { - return getTypeName(value) + return this.$t('webmsg.' + getTypeName(value)) }, typeChange(value) { this.search() }, toDetail(row) { - const param = { ...{ msgNotification: true, msgType: row.type, sourceParam: row.param }} + const param = { ...{ msgNotification: true, msgType: row.typeId, sourceParam: row.param }} this.$router.push({ name: row.router, params: param }) this.setReaded(row) }, diff --git a/frontend/src/views/panel/index.vue b/frontend/src/views/panel/index.vue index a8ee135114..25165d0b8b 100644 --- a/frontend/src/views/panel/index.vue +++ b/frontend/src/views/panel/index.vue @@ -75,11 +75,12 @@ export default { methods: { toMsgShare(routerParam) { if (routerParam !== null && routerParam.msgNotification) { - // 说明是从消息通知跳转过来的 - if (routerParam.msgType === 0) { // 是仪表板分享 + const panelShareTypeIds = [1, 2, 3] + // 说明是从消息通知跳转过来的 + if (panelShareTypeIds.includes(routerParam.msgType)) { // 是仪表板分享 this.componentName = 'PanelMain' this.$nextTick(() => { - this.$refs.panel_main.msg2Current(routerParam.sourceParam) + this.$refs.panel_main && this.$refs.panel_main.msg2Current && this.$refs.panel_main.msg2Current(routerParam.sourceParam) }) } }