Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
8a5ccbb2
Unverified
提交
8a5ccbb2
authored
7月 12, 2021
作者:
fit2cloud-chenyw
提交者:
GitHub
7月 12, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #203 from dataease/pr@dev@feat_消息设置
feat: 增加消息接收设置
上级
cf2623a7
3f15bf57
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
50 个修改的文件
包含
1985 行增加
和
233 行删除
+1985
-233
SysMsg.java
backend/src/main/java/io/dataease/base/domain/SysMsg.java
+1
-3
SysMsgChannel.java
.../src/main/java/io/dataease/base/domain/SysMsgChannel.java
+14
-0
SysMsgChannelExample.java
...in/java/io/dataease/base/domain/SysMsgChannelExample.java
+331
-0
SysMsgExample.java
.../src/main/java/io/dataease/base/domain/SysMsgExample.java
+24
-94
SysMsgSetting.java
.../src/main/java/io/dataease/base/domain/SysMsgSetting.java
+20
-0
SysMsgSettingExample.java
...in/java/io/dataease/base/domain/SysMsgSettingExample.java
+0
-0
SysMsgType.java
...end/src/main/java/io/dataease/base/domain/SysMsgType.java
+20
-0
SysMsgTypeExample.java
.../main/java/io/dataease/base/domain/SysMsgTypeExample.java
+0
-0
SysMsgChannelMapper.java
...ain/java/io/dataease/base/mapper/SysMsgChannelMapper.java
+31
-0
SysMsgChannelMapper.xml
...main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml
+165
-0
SysMsgMapper.xml
...nd/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml
+18
-35
SysMsgSettingMapper.java
...ain/java/io/dataease/base/mapper/SysMsgSettingMapper.java
+31
-0
SysMsgSettingMapper.xml
...main/java/io/dataease/base/mapper/SysMsgSettingMapper.xml
+212
-0
SysMsgTypeMapper.java
...c/main/java/io/dataease/base/mapper/SysMsgTypeMapper.java
+31
-0
SysMsgTypeMapper.xml
...rc/main/java/io/dataease/base/mapper/SysMsgTypeMapper.xml
+212
-0
ExtSysMsgMapper.java
...ain/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java
+5
-0
ExtSysMsgMapper.xml
...main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.xml
+60
-0
SysMsgConstants.java
...n/java/io/dataease/commons/constants/SysMsgConstants.java
+8
-0
MsgController.java
...in/java/io/dataease/controller/message/MsgController.java
+36
-4
MsgGridDto.java
...n/java/io/dataease/controller/message/dto/MsgGridDto.java
+11
-0
MsgRequest.java
...n/java/io/dataease/controller/message/dto/MsgRequest.java
+1
-1
MsgSettingRequest.java
...io/dataease/controller/message/dto/MsgSettingRequest.java
+14
-0
SettingTreeNode.java
...a/io/dataease/controller/message/dto/SettingTreeNode.java
+19
-0
SubscribeNode.java
...ava/io/dataease/controller/message/dto/SubscribeNode.java
+20
-0
ExtractDataService.java
.../java/io/dataease/service/dataset/ExtractDataService.java
+2
-4
DeMsgutil.java
.../src/main/java/io/dataease/service/message/DeMsgutil.java
+11
-31
MsgAop.java
...end/src/main/java/io/dataease/service/message/MsgAop.java
+60
-0
SysMsgService.java
.../main/java/io/dataease/service/message/SysMsgService.java
+172
-4
ShareService.java
...src/main/java/io/dataease/service/panel/ShareService.java
+5
-5
V10__web_msg.sql
backend/src/main/resources/db/migration/V10__web_msg.sql
+61
-4
ehcache.xml
backend/src/main/resources/ehcache/ehcache.xml
+35
-0
messages_en_US.properties
backend/src/main/resources/i18n/messages_en_US.properties
+7
-0
messages_zh_CN.properties
backend/src/main/resources/i18n/messages_zh_CN.properties
+6
-0
messages_zh_TW.properties
backend/src/main/resources/i18n/messages_zh_TW.properties
+7
-0
msg.js
frontend/src/api/system/msg.js
+41
-0
index.vue
frontend/src/components/Notification/index.vue
+16
-9
msg-setting.svg
frontend/src/icons/svg/msg-setting.svg
+2
-0
en.js
frontend/src/lang/en.js
+10
-2
tw.js
frontend/src/lang/tw.js
+10
-2
zh.js
frontend/src/lang/zh.js
+10
-2
getters.js
frontend/src/store/getters.js
+2
-1
index.js
frontend/src/store/index.js
+3
-1
msg.js
frontend/src/store/modules/msg.js
+25
-0
webMsg.js
frontend/src/utils/webMsg.js
+17
-7
index.vue
frontend/src/views/dataset/index.vue
+4
-3
all.vue
frontend/src/views/msg/all.vue
+10
-6
readed.vue
frontend/src/views/msg/readed.vue
+10
-6
setting.vue
frontend/src/views/msg/setting.vue
+161
-0
unread.vue
frontend/src/views/msg/unread.vue
+10
-6
index.vue
frontend/src/views/panel/index.vue
+4
-3
没有找到文件。
backend/src/main/java/io/dataease/base/domain/SysMsg.java
浏览文件 @
8a5ccbb2
...
...
@@ -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
;
...
...
backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java
0 → 100644
浏览文件 @
8a5ccbb2
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
backend/src/main/java/io/dataease/base/domain/SysMsgChannelExample.java
0 → 100644
浏览文件 @
8a5ccbb2
package
io
.
dataease
.
base
.
domain
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
SysMsgChannelExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
SysMsgChannelExample
()
{
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
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
<
Long
>
values
)
{
addCriterion
(
"msg_channel_id in"
,
values
,
"msgChannelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andMsgChannelIdNotIn
(
List
<
Long
>
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
<
String
>
values
)
{
addCriterion
(
"channel_name in"
,
values
,
"channelName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChannelNameNotIn
(
List
<
String
>
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
backend/src/main/java/io/dataease/base/domain/SysMsgExample.java
浏览文件 @
8a5ccbb2
...
...
@@ -224,63 +224,63 @@ public class SysMsgExample {
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNull
()
{
addCriterion
(
"
`type`
is null"
);
public
Criteria
andTypeI
dI
sNull
()
{
addCriterion
(
"
type_id
is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeIsNotNull
()
{
addCriterion
(
"
`type`
is not null"
);
public
Criteria
andTypeI
dI
sNotNull
()
{
addCriterion
(
"
type_id
is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
EqualTo
(
Integer
value
)
{
addCriterion
(
"
`type` ="
,
value
,
"type
"
);
public
Criteria
andType
IdEqualTo
(
Long
value
)
{
addCriterion
(
"
type_id ="
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
NotEqualTo
(
Integer
value
)
{
addCriterion
(
"
`type` <>"
,
value
,
"type
"
);
public
Criteria
andType
IdNotEqualTo
(
Long
value
)
{
addCriterion
(
"
type_id <>"
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
GreaterThan
(
Integer
value
)
{
addCriterion
(
"
`type` >"
,
value
,
"type
"
);
public
Criteria
andType
IdGreaterThan
(
Long
value
)
{
addCriterion
(
"
type_id >"
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
GreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"
`type` >="
,
value
,
"type
"
);
public
Criteria
andType
IdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
type_id >="
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
LessThan
(
Integer
value
)
{
addCriterion
(
"
`type` <"
,
value
,
"type
"
);
public
Criteria
andType
IdLessThan
(
Long
value
)
{
addCriterion
(
"
type_id <"
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
LessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"
`type` <="
,
value
,
"type
"
);
public
Criteria
andType
IdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"
type_id <="
,
value
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTypeI
n
(
List
<
Integer
>
values
)
{
addCriterion
(
"
`type` in"
,
values
,
"type
"
);
public
Criteria
andTypeI
dIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
type_id in"
,
values
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
NotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"
`type` not in"
,
values
,
"type
"
);
public
Criteria
andType
IdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"
type_id not in"
,
values
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
Between
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"
`type` between"
,
value1
,
value2
,
"type
"
);
public
Criteria
andType
IdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"
type_id between"
,
value1
,
value2
,
"typeId
"
);
return
(
Criteria
)
this
;
}
public
Criteria
andType
NotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"
`type` not between"
,
value1
,
value2
,
"type
"
);
public
Criteria
andType
IdNotBetween
(
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
<
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
;
...
...
backend/src/main/java/io/dataease/base/domain/SysMsgSetting.java
0 → 100644
浏览文件 @
8a5ccbb2
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
backend/src/main/java/io/dataease/base/domain/SysMsgSettingExample.java
0 → 100644
浏览文件 @
8a5ccbb2
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/domain/SysMsgType.java
0 → 100644
浏览文件 @
8a5ccbb2
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
backend/src/main/java/io/dataease/base/domain/SysMsgTypeExample.java
0 → 100644
浏览文件 @
8a5ccbb2
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.java
0 → 100644
浏览文件 @
8a5ccbb2
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
<
SysMsgChannel
>
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
backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml
0 → 100644
浏览文件 @
8a5ccbb2
<?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.SysMsgChannelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysMsgChannel"
>
<id
column=
"msg_channel_id"
jdbcType=
"BIGINT"
property=
"msgChannelId"
/>
<result
column=
"channel_name"
jdbcType=
"VARCHAR"
property=
"channelName"
/>
</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_channel_id, channel_name
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from sys_msg_channel
<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_channel
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from sys_msg_channel
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
>
delete from sys_msg_channel
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
insert into sys_msg_channel (msg_channel_id, channel_name)
values (#{msgChannelId,jdbcType=BIGINT}, #{channelName,jdbcType=VARCHAR})
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
insert into sys_msg_channel
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgChannelId != null"
>
msg_channel_id,
</if>
<if
test=
"channelName != null"
>
channel_name,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgChannelId != null"
>
#{msgChannelId,jdbcType=BIGINT},
</if>
<if
test=
"channelName != null"
>
#{channelName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultType=
"java.lang.Long"
>
select count(*) from sys_msg_channel
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update sys_msg_channel
<set>
<if
test=
"record.msgChannelId != null"
>
msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
</if>
<if
test=
"record.channelName != null"
>
channel_name = #{record.channelName,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_channel
set msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
channel_name = #{record.channelName,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
update sys_msg_channel
<set>
<if
test=
"channelName != null"
>
channel_name = #{channelName,jdbcType=VARCHAR},
</if>
</set>
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
update sys_msg_channel
set channel_name = #{channelName,jdbcType=VARCHAR}
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/SysMsgMapper.xml
浏览文件 @
8a5ccbb2
...
...
@@ -4,9 +4,8 @@
<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=
"type
_id"
jdbcType=
"BIGINT"
property=
"typeId
"
/>
<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"
/>
...
...
@@ -71,7 +70,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
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
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -104,14 +103,12 @@
</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 into sys_msg (msg_id, user_id, type_id,
`status`, param, create_time,
read_time, content)
values (#{msgId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{typeId,jdbcType=BIGINT},
#{status,jdbcType=BIT}, #{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
...
...
@@ -122,15 +119,12 @@
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"type != null"
>
`type`
,
<if
test=
"type
Id
!= null"
>
type_id
,
</if>
<if
test=
"status != null"
>
`status`,
</if>
<if
test=
"router != null"
>
router,
</if>
<if
test=
"param != null"
>
param,
</if>
...
...
@@ -151,15 +145,12 @@
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
</if>
<if
test=
"type != null"
>
#{type
,jdbcType=INTEGER
},
<if
test=
"type
Id
!= null"
>
#{type
Id,jdbcType=BIGINT
},
</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>
...
...
@@ -189,15 +180,12 @@
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=INTEGER
},
<if
test=
"record.type
Id
!= null"
>
type_id = #{record.typeId,jdbcType=BIGINT
},
</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>
...
...
@@ -219,9 +207,8 @@
update sys_msg
set msg_id = #{record.msgId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=INTEGER
},
type_id = #{record.typeId,jdbcType=BIGINT
},
`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},
...
...
@@ -236,15 +223,12 @@
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
</if>
<if
test=
"type != null"
>
`type` = #{type,jdbcType=INTEGER
},
<if
test=
"type
Id
!= null"
>
type_id = #{typeId,jdbcType=BIGINT
},
</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>
...
...
@@ -263,9 +247,8 @@
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsg"
>
update sys_msg
set user_id = #{userId,jdbcType=BIGINT},
`type` = #{type,jdbcType=INTEGER
},
type_id = #{typeId,jdbcType=BIGINT
},
`status` = #{status,jdbcType=BIT},
router = #{router,jdbcType=VARCHAR},
param = #{param,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
read_time = #{readTime,jdbcType=BIGINT},
...
...
backend/src/main/java/io/dataease/base/mapper/SysMsgSettingMapper.java
0 → 100644
浏览文件 @
8a5ccbb2
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.SysMsgSetting
;
import
io.dataease.base.domain.SysMsgSettingExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
SysMsgSettingMapper
{
long
countByExample
(
SysMsgSettingExample
example
);
int
deleteByExample
(
SysMsgSettingExample
example
);
int
deleteByPrimaryKey
(
Long
msgSettingId
);
int
insert
(
SysMsgSetting
record
);
int
insertSelective
(
SysMsgSetting
record
);
List
<
SysMsgSetting
>
selectByExample
(
SysMsgSettingExample
example
);
SysMsgSetting
selectByPrimaryKey
(
Long
msgSettingId
);
int
updateByExampleSelective
(
@Param
(
"record"
)
SysMsgSetting
record
,
@Param
(
"example"
)
SysMsgSettingExample
example
);
int
updateByExample
(
@Param
(
"record"
)
SysMsgSetting
record
,
@Param
(
"example"
)
SysMsgSettingExample
example
);
int
updateByPrimaryKeySelective
(
SysMsgSetting
record
);
int
updateByPrimaryKey
(
SysMsgSetting
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/SysMsgSettingMapper.xml
0 → 100644
浏览文件 @
8a5ccbb2
<?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.SysMsgSettingMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysMsgSetting"
>
<id
column=
"msg_setting_id"
jdbcType=
"BIGINT"
property=
"msgSettingId"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"type_id"
jdbcType=
"BIGINT"
property=
"typeId"
/>
<result
column=
"channel_id"
jdbcType=
"BIGINT"
property=
"channelId"
/>
<result
column=
"enable"
jdbcType=
"BIT"
property=
"enable"
/>
</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_setting_id, user_id, type_id, channel_id, `enable`
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgSettingExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from sys_msg_setting
<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_setting
where msg_setting_id = #{msgSettingId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from sys_msg_setting
where msg_setting_id = #{msgSettingId,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.SysMsgSettingExample"
>
delete from sys_msg_setting
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysMsgSetting"
>
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>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysMsgSetting"
>
insert into sys_msg_setting
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgSettingId != null"
>
msg_setting_id,
</if>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"typeId != null"
>
type_id,
</if>
<if
test=
"channelId != null"
>
channel_id,
</if>
<if
test=
"enable != null"
>
`enable`,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgSettingId != null"
>
#{msgSettingId,jdbcType=BIGINT},
</if>
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
</if>
<if
test=
"typeId != null"
>
#{typeId,jdbcType=BIGINT},
</if>
<if
test=
"channelId != null"
>
#{channelId,jdbcType=BIGINT},
</if>
<if
test=
"enable != null"
>
#{enable,jdbcType=BIT},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysMsgSettingExample"
resultType=
"java.lang.Long"
>
select count(*) from sys_msg_setting
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update sys_msg_setting
<set>
<if
test=
"record.msgSettingId != null"
>
msg_setting_id = #{record.msgSettingId,jdbcType=BIGINT},
</if>
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if
test=
"record.typeId != null"
>
type_id = #{record.typeId,jdbcType=BIGINT},
</if>
<if
test=
"record.channelId != null"
>
channel_id = #{record.channelId,jdbcType=BIGINT},
</if>
<if
test=
"record.enable != null"
>
`enable` = #{record.enable,jdbcType=BIT},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
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}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.SysMsgSetting"
>
update sys_msg_setting
<set>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
</if>
<if
test=
"typeId != null"
>
type_id = #{typeId,jdbcType=BIGINT},
</if>
<if
test=
"channelId != null"
>
channel_id = #{channelId,jdbcType=BIGINT},
</if>
<if
test=
"enable != null"
>
`enable` = #{enable,jdbcType=BIT},
</if>
</set>
where msg_setting_id = #{msgSettingId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsgSetting"
>
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}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.java
0 → 100644
浏览文件 @
8a5ccbb2
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
<
SysMsgType
>
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
backend/src/main/java/io/dataease/base/mapper/SysMsgTypeMapper.xml
0 → 100644
浏览文件 @
8a5ccbb2
<?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.SysMsgTypeMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysMsgType"
>
<id
column=
"msg_type_id"
jdbcType=
"BIGINT"
property=
"msgTypeId"
/>
<result
column=
"pid"
jdbcType=
"BIGINT"
property=
"pid"
/>
<result
column=
"type_name"
jdbcType=
"VARCHAR"
property=
"typeName"
/>
<result
column=
"router"
jdbcType=
"VARCHAR"
property=
"router"
/>
<result
column=
"callback"
jdbcType=
"VARCHAR"
property=
"callback"
/>
</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_type_id, pid, type_name, router, callback
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgTypeExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from sys_msg_type
<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_type
where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from sys_msg_type
where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.SysMsgTypeExample"
>
delete from sys_msg_type
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysMsgType"
>
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>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysMsgType"
>
insert into sys_msg_type
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgTypeId != null"
>
msg_type_id,
</if>
<if
test=
"pid != null"
>
pid,
</if>
<if
test=
"typeName != null"
>
type_name,
</if>
<if
test=
"router != null"
>
router,
</if>
<if
test=
"callback != null"
>
callback,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgTypeId != null"
>
#{msgTypeId,jdbcType=BIGINT},
</if>
<if
test=
"pid != null"
>
#{pid,jdbcType=BIGINT},
</if>
<if
test=
"typeName != null"
>
#{typeName,jdbcType=VARCHAR},
</if>
<if
test=
"router != null"
>
#{router,jdbcType=VARCHAR},
</if>
<if
test=
"callback != null"
>
#{callback,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysMsgTypeExample"
resultType=
"java.lang.Long"
>
select count(*) from sys_msg_type
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update sys_msg_type
<set>
<if
test=
"record.msgTypeId != null"
>
msg_type_id = #{record.msgTypeId,jdbcType=BIGINT},
</if>
<if
test=
"record.pid != null"
>
pid = #{record.pid,jdbcType=BIGINT},
</if>
<if
test=
"record.typeName != null"
>
type_name = #{record.typeName,jdbcType=VARCHAR},
</if>
<if
test=
"record.router != null"
>
router = #{record.router,jdbcType=VARCHAR},
</if>
<if
test=
"record.callback != null"
>
callback = #{record.callback,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_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}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.SysMsgType"
>
update sys_msg_type
<set>
<if
test=
"pid != null"
>
pid = #{pid,jdbcType=BIGINT},
</if>
<if
test=
"typeName != null"
>
type_name = #{typeName,jdbcType=VARCHAR},
</if>
<if
test=
"router != null"
>
router = #{router,jdbcType=VARCHAR},
</if>
<if
test=
"callback != null"
>
callback = #{callback,jdbcType=VARCHAR},
</if>
</set>
where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsgType"
>
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}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.java
浏览文件 @
8a5ccbb2
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
<
Long
>
msgIds
);
List
<
MsgGridDto
>
queryGrid
(
SysMsgExample
example
);
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtSysMsgMapper.xml
0 → 100644
浏览文件 @
8a5ccbb2
<?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.ExtSysMsgMapper"
>
<resultMap
id=
"msgGridDto"
type=
"io.dataease.controller.message.dto.MsgGridDto"
extends=
"io.dataease.base.mapper.SysMsgMapper.BaseResultMap"
>
<result
column=
"router"
property=
"router"
></result>
<result
column=
"callback"
property=
"callback"
></result>
</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>
<select
id=
"queryGrid"
parameterType=
"io.dataease.base.domain.SysMsgExample"
resultMap=
"msgGridDto"
>
select sm.*, smt.router, smt.callback
from sys_msg sm
left join sys_msg_type smt on smt.msg_type_id = sm.type_id
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
<if
test=
"orderByClause == null"
>
order by sm.status asc
</if>
</select>
</mapper>
backend/src/main/java/io/dataease/commons/constants/SysMsgConstants.java
0 → 100644
浏览文件 @
8a5ccbb2
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"
;
}
backend/src/main/java/io/dataease/controller/message/MsgController.java
浏览文件 @
8a5ccbb2
...
...
@@ -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
<
List
<
SysMsg
>>
messages
(
@PathVariable
int
goPage
,
@PathVariable
int
pageSize
,
@RequestBody
MsgRequest
msgRequest
)
{
public
Pager
<
List
<
MsgGridDto
>>
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
));
Pager
<
List
<
MsgGridDto
>>
listPager
=
PageUtils
.
setPageInfo
(
page
,
sysMsgService
.
queryGrid
(
userId
,
msgRequest
));
return
listPager
;
}
...
...
@@ -47,4 +51,32 @@ public class MsgController {
public
void
batchDelete
(
@RequestBody
List
<
Long
>
msgIds
)
{
sysMsgService
.
batchDelete
(
msgIds
);
}
@PostMapping
(
"/treeNodes"
)
public
List
<
SettingTreeNode
>
treeNodes
()
{
return
sysMsgService
.
treeNodes
();
}
@PostMapping
(
"/channelList"
)
public
List
<
SysMsgChannel
>
channelList
()
{
return
sysMsgService
.
channelList
();
}
@PostMapping
(
"/settingList"
)
public
List
<
SysMsgSetting
>
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
<
SysMsgType
>
allTypes
()
{
List
<
SysMsgType
>
sysMsgTypes
=
sysMsgService
.
queryMsgTypes
();
return
sysMsgTypes
;
}
}
backend/src/main/java/io/dataease/controller/message/dto/MsgGridDto.java
0 → 100644
浏览文件 @
8a5ccbb2
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
;
}
backend/src/main/java/io/dataease/controller/message/dto/MsgRequest.java
浏览文件 @
8a5ccbb2
...
...
@@ -10,7 +10,7 @@ public class MsgRequest implements Serializable {
private
static
final
long
serialVersionUID
=
1920091635946508658L
;
private
Integer
type
;
private
Long
type
;
private
Boolean
status
;
...
...
backend/src/main/java/io/dataease/controller/message/dto/MsgSettingRequest.java
0 → 100644
浏览文件 @
8a5ccbb2
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
;
}
backend/src/main/java/io/dataease/controller/message/dto/SettingTreeNode.java
0 → 100644
浏览文件 @
8a5ccbb2
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
<
SettingTreeNode
>
children
;
}
backend/src/main/java/io/dataease/controller/message/dto/SubscribeNode.java
0 → 100644
浏览文件 @
8a5ccbb2
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
;
}
}
backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java
浏览文件 @
8a5ccbb2
...
...
@@ -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
<
Long
>
userIds
=
AuthUtils
.
userIdsByURD
(
authURD
);
...
...
@@ -411,7 +409,7 @@ public class ExtractDataService {
Map
<
String
,
Object
>
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
));
});
}
...
...
backend/src/main/java/io/dataease/service/message/DeMsgutil.java
浏览文件 @
8a5ccbb2
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
;
...
...
@@ -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
,
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
.
s
ave
(
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
.
s
endMsg
(
userId
,
typeId
,
channelId
,
content
,
param
);
}
}
backend/src/main/java/io/dataease/service/message/MsgAop.java
0 → 100644
浏览文件 @
8a5ccbb2
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
<
SubscribeNode
>
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
;
}
}
backend/src/main/java/io/dataease/service/message/SysMsgService.java
浏览文件 @
8a5ccbb2
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
<
SysMsg
>
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
.
andType
Id
EqualTo
(
msgRequest
.
getType
());
}
if
(
ObjectUtils
.
isNotEmpty
(
msgRequest
.
getStatus
()))
{
...
...
@@ -46,6 +67,36 @@ public class SysMsgService {
return
sysMsgs
;
}
public
List
<
MsgGridDto
>
queryGrid
(
Long
userId
,
MsgRequest
msgRequest
)
{
String
orderClause
=
" create_time desc"
;
SysMsgExample
example
=
new
SysMsgExample
();
SysMsgExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
List
<
String
>
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
<
SysMsgType
>
sysMsgTypes
=
sysMsgTypeMapper
.
selectByExample
(
sysMsgTypeExample
);
List
<
Long
>
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
<
MsgGridDto
>
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
<
SettingTreeNode
>
treeNodes
()
{
SysMsgService
proxy
=
CommonBeanFactory
.
getBean
(
SysMsgService
.
class
);
List
<
SysMsgType
>
sysMsgTypes
=
proxy
.
queryMsgTypes
();
return
buildTree
(
sysMsgTypes
);
}
@Cacheable
(
SysMsgConstants
.
SYS_MSG_TYPE
)
public
List
<
SysMsgType
>
queryMsgTypes
()
{
SysMsgTypeExample
example
=
new
SysMsgTypeExample
();
List
<
SysMsgType
>
sysMsgTypes
=
sysMsgTypeMapper
.
selectByExample
(
example
);
return
sysMsgTypes
;
}
private
List
<
SettingTreeNode
>
buildTree
(
List
<
SysMsgType
>
lists
){
List
<
SettingTreeNode
>
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
>());
}
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
<
SysMsgChannel
>
channelList
()
{
SysMsgChannelExample
example
=
new
SysMsgChannelExample
();
return
sysMsgChannelMapper
.
selectByExample
(
example
);
}
public
List
<
SysMsgSetting
>
settingList
()
{
Long
userId
=
AuthUtils
.
getUser
().
getUserId
();
SysMsgSettingExample
example
=
new
SysMsgSettingExample
();
example
.
createCriteria
().
andUserIdEqualTo
(
userId
);
List
<
SysMsgSetting
>
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
<
SysMsgSetting
>
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
<
SubscribeNode
>
subscribes
(
Long
userId
)
{
SysMsgSettingExample
example
=
new
SysMsgSettingExample
();
example
.
createCriteria
().
andUserIdEqualTo
(
userId
).
andEnableEqualTo
(
true
);
List
<
SysMsgSetting
>
sysMsgSettings
=
sysMsgSettingMapper
.
selectByExample
(
example
);
List
<
SubscribeNode
>
resultLists
=
sysMsgSettings
.
stream
().
map
(
item
->
{
SubscribeNode
subscribeNode
=
new
SubscribeNode
();
subscribeNode
.
setTypeId
(
item
.
getTypeId
());
subscribeNode
.
setChannelId
(
item
.
getChannelId
());
return
subscribeNode
;
}).
collect
(
Collectors
.
toList
());
return
resultLists
;
}
}
backend/src/main/java/io/dataease/service/panel/ShareService.java
浏览文件 @
8a5ccbb2
...
...
@@ -133,14 +133,14 @@ public class ShareService {
List
<
String
>
msgParam
=
new
ArrayList
<
String
>();
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
));
});
}
...
...
backend/src/main/resources/db/migration/V10__web_msg.sql
浏览文件 @
8a5ccbb2
...
...
@@ -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
;
...
...
backend/src/main/resources/ehcache/ehcache.xml
浏览文件 @
8a5ccbb2
...
...
@@ -95,4 +95,38 @@
/>
<!--消息渠道缓存-->
<cache
name=
"sys_msg_channel"
eternal=
"true"
maxElementsInMemory=
"100"
maxElementsOnDisk=
"1000"
overflowToDisk=
"true"
diskPersistent=
"false"
/>
<!--消息类型缓存-->
<cache
name=
"sys_msg_type"
eternal=
"true"
maxElementsInMemory=
"100"
maxElementsOnDisk=
"1000"
overflowToDisk=
"true"
diskPersistent=
"false"
/>
<!--消息类型缓存-->
<cache
name=
"sys_msg_user_subscribe"
eternal=
"false"
maxElementsInMemory=
"100"
maxElementsOnDisk=
"10000"
overflowToDisk=
"true"
diskPersistent=
"false"
timeToIdleSeconds=
"28800"
timeToLiveSeconds=
"86400"
memoryStoreEvictionPolicy=
"LRU"
/>
</ehcache>
\ No newline at end of file
backend/src/main/resources/i18n/messages_en_US.properties
浏览文件 @
8a5ccbb2
...
...
@@ -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
backend/src/main/resources/i18n/messages_zh_CN.properties
浏览文件 @
8a5ccbb2
...
...
@@ -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
=
请先完成数据同步
backend/src/main/resources/i18n/messages_zh_TW.properties
浏览文件 @
8a5ccbb2
...
...
@@ -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
frontend/src/api/system/msg.js
浏览文件 @
8a5ccbb2
...
...
@@ -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
})
}
frontend/src/components/Notification/index.vue
浏览文件 @
8a5ccbb2
...
...
@@ -31,7 +31,7 @@
<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>
【
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
】
{{
scope
.
row
.
content
}}
</span></div>
<div
class=
"title-div"
><span>
{{
scope
.
row
.
createTime
|
timestampFormatDate
}}
</span></div>
</div>
<!--
<div
class=
"star-item-close"
>
...
...
@@ -61,13 +61,12 @@
<
script
>
import
{
query
,
updateStatus
}
from
'@/api/system/msg'
import
{
msgTypes
,
getTypeName
}
from
'@/utils/webMsg'
import
{
getTypeName
,
loadMsgTypes
}
from
'@/utils/webMsg'
import
{
mapGetters
}
from
'vuex'
import
bus
from
'@/utils/bus'
export
default
{
data
()
{
return
{
msgTypes
:
msgTypes
,
showSetting
:
false
,
data
:
[],
visible
:
false
,
...
...
@@ -85,6 +84,8 @@ export default {
])
},
created
()
{
// 先加载消息类型
loadMsgTypes
()
this
.
search
()
// 每30s定时刷新拉取消息
this
.
timer
=
setInterval
(()
=>
{
...
...
@@ -107,12 +108,18 @@ export default {
// console.log(lang)
// },
showDetail
(
row
)
{
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
,
sourceParam
:
row
.
param
}}
const
param
=
{
...{
msgNotification
:
true
,
msgType
:
row
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
visible
=
false
if
(
this
.
$route
&&
this
.
$route
.
name
&&
this
.
$route
.
name
.
includes
(
'panel'
)
&&
row
.
type
===
0
)
{
bus
.
$emit
(
'to-msg-share'
,
param
)
}
else
if
(
this
.
$route
&&
this
.
$route
.
name
&&
this
.
$route
.
name
.
includes
(
'dataset'
)
&&
row
.
type
===
1
)
{
bus
.
$emit
(
'to-msg-dataset'
,
param
)
// if (this.$route && this.$route.name && this.$route.name.includes('panel') && row.type === 0) {
// bus.$emit('to-msg-share', param)
// } else if (this.$route && this.$route.name && this.$route.name.includes('dataset') && row.type === 1) {
// bus.$emit('to-msg-dataset', param)
// } else {
// this.$router.push({ name: row.router, params: param })
// }
if
(
this
.
$route
&&
this
.
$route
.
name
&&
this
.
$route
.
name
===
row
.
router
)
{
// 如果当前路由就是目标路由 那么使用router.push页面不会刷新 这时候要使用事件方式
row
.
callback
&&
bus
.
$emit
(
row
.
callback
,
param
)
}
else
{
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
}
...
...
@@ -155,7 +162,7 @@ export default {
})
},
getTypeName
(
value
)
{
return
getTypeName
(
value
)
return
this
.
$t
(
'webmsg.'
+
getTypeName
(
value
)
)
},
open
()
{
this
.
visible
=
true
...
...
frontend/src/icons/svg/msg-setting.svg
0 → 100644
浏览文件 @
8a5ccbb2
<?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=
"1625803255741"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2522"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
></style></defs><path
d=
"M692.8 557.8c-49.3 0-89.4 40-89.4 89.1s40.1 89.1 89.4 89.1c49.3 0 89.4-40 89.4-89.1 0-49.2-40-89.1-89.4-89.1zM693 681c-18.2-0.8-32.6-15.9-32.6-34.1 0-18.3 14.4-33.3 32.6-34.1 18.5 0.5 33.2 15.6 33.2 34.1S711.5 680.5 693 681z"
p-id=
"2523"
></path><path
d=
"M955.1 593.9c-2.9-15.2-12.1-24.9-23.3-24.7h-2.3c-38.5 0-69.9-31-69.9-69.1 0-12.5 6-26.3 6.1-26.4 5.9-13.6 1.4-29.3-10.7-37.8l-0.7-0.5-67.3-36.8-0.7-0.3c-13-5.3-28-2.3-38.1 7.5-8.2 8.4-34 30.1-54.9 30.1-21.1 0-47.2-22.1-55.4-30.7-10-9.9-24.9-13-38.1-7.8l-0.7 0.3-69.6 37.8-0.7 0.5c-12.1 8.4-16.6 24.2-10.7 37.8 0.1 0.1 6.1 13.9 6.1 26.4 0 38.1-31.3 69.1-69.9 69.1H452c-11.2-0.2-20.4 9.5-23.3 24.7-0.2 1.1-5.6 29.6-5.6 52.1 0 22.4 5.4 50.8 5.6 52.1 2.8 15 11.9 24.7 22.9 24.7l0.4-0.1h2.3c38.5 0 69.9 31 69.9 69.1 0 12.5-6 26.3-6.1 26.4-5.9 13.6-1.4 29.3 10.6 37.8l0.6 0.5 66 36.4 0.7 0.3c13.1 5.4 28.3 2.3 38.2-7.9 7.8-8.4 34.6-32.1 56.2-32.1 21.7 0 48.2 23.5 56.6 32.6 6.6 6.9 15.8 10.8 25.4 10.7 4.3 0.1 8.7-0.8 12.7-2.5l0.7-0.3 68.4-37.4 0.7-0.5c12-8.5 16.5-24.3 10.7-37.8-0.1-0.1-6.1-13.9-6.1-26.4 0-38.1 31.3-69.1 69.9-69.1h2.3c11.2 0.3 20.4-9.5 23.3-24.6 0.2-1.1 5.6-29.6 5.6-52.1 0.1-22.3-5.2-50.4-5.5-52z m-62.2 92.2c-46.1 2.3-82.9 40-82.9 86 0 15.4 6.1 30.1 7.4 33.1l-55 29.9h-0.1c-0.6 0-1.3-0.2-1.8-0.5-1-1.1-9-9.4-20.5-17.9-17.1-12.6-33.4-18.9-48.4-18.9-14.8 0-31 6.2-48 18.5-11.4 8.2-19.3 16.5-20.3 17.6-0.5 0.3-1.1 0.4-1.7 0.4h-0.1l-53-29.2c1.3-3 7.4-17.8 7.4-33.2 0-45.9-36.8-83.6-82.9-86-0.7-3.6-4.3-23.8-4.3-39.1 0-15.2 3.6-35.5 4.3-39.1 46.1-2.4 82.9-40 82.9-86 0-15.3-6-30.1-7.4-33.1l56.1-30.3h0.2c0.7 0 1.4 0.2 2.1 0.5 6.2 6.2 12.9 11.8 20.1 16.9 16.8 11.8 32.7 17.7 47.3 17.7 14.4 0 30.2-5.9 46.8-17.4 7.2-5 13.9-10.5 20-16.6 0.6-0.4 1.3-0.5 2.1-0.5h0.2l54.1 29.6c-1.3 3.1-7.4 17.8-7.4 33.2 0 45.9 36.8 83.6 82.9 86 0.7 3.6 4.3 23.9 4.3 39.1s-3.8 35.7-4.4 39.3z"
p-id=
"2524"
></path><path
d=
"M426 831.2H198.1c-30.8 0-67.3-35.9-67.3-66V348.6l248.4 168.9v-80.1L130.8 268.5v-30c0-30 14.3-43.9 44.9-43.9h672.5c30.6 0 44.6 13.9 44.6 43.9v9.5h0.2v111.5c0 18.4 15.1 33.5 33.5 33.5s33.5-15.1 33.5-33.5V248v-2.5-7.1c0-66.6-43.7-109.7-111.8-109.7H175.7c-68.1 0-112.1 43-112.1 109.7v526.8c0 66.5 66.6 131.8 134.5 131.8H426c18.1 0 32.9-14.8 32.9-32.9 0-18.1-14.8-32.9-32.9-32.9z"
p-id=
"2525"
></path></svg>
\ No newline at end of file
frontend/src/lang/en.js
浏览文件 @
8a5ccbb2
...
...
@@ -1242,9 +1242,17 @@ export default {
content
:
'Content'
,
sned_time
:
'Send Time'
,
read_time
:
'Read Time'
,
type
:
'Type'
,
type
:
'
Message
Type'
,
mark_readed
:
'Mark As Read'
,
please_select
:
'Please select at least one message'
,
mark_success
:
'Mark read successfully'
mark_success
:
'Mark read successfully'
,
receive_manage
:
'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_msg_type_all
:
'All type'
,
channel_inner_msg
:
'On site news'
}
}
frontend/src/lang/tw.js
浏览文件 @
8a5ccbb2
...
...
@@ -1242,9 +1242,17 @@ export default {
content
:
'消息內容'
,
sned_time
:
'提交時間'
,
read_time
:
'查看時間'
,
type
:
'類型'
,
type
:
'
消息
類型'
,
mark_readed
:
'標記已讀'
,
please_select
:
'請至少選擇一條消息'
,
mark_success
:
'標記已讀成功'
mark_success
:
'標記已讀成功'
,
receive_manage
:
'接收管理'
,
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_msg_type_all
:
'全部類型'
,
channel_inner_msg
:
'站內消息'
}
}
frontend/src/lang/zh.js
浏览文件 @
8a5ccbb2
...
...
@@ -1244,9 +1244,17 @@ export default {
content
:
'消息内容'
,
sned_time
:
'提交时间'
,
read_time
:
'查看时间'
,
type
:
'类型'
,
type
:
'
消息
类型'
,
mark_readed
:
'标记已读'
,
please_select
:
'请至少选择一条消息'
,
mark_success
:
'标记已读成功'
mark_success
:
'标记已读成功'
,
receive_manage
:
'接收管理'
,
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_msg_type_all
:
'全部类型'
,
channel_inner_msg
:
'站内消息'
}
}
frontend/src/store/getters.js
浏览文件 @
8a5ccbb2
...
...
@@ -25,6 +25,7 @@ const getters = {
validate
:
state
=>
state
.
lic
.
validate
,
licMsg
:
state
=>
state
.
lic
.
licMsg
,
uiInfo
:
state
=>
state
.
user
.
uiInfo
,
conditions
:
state
=>
state
.
conditions
.
conditions
conditions
:
state
=>
state
.
conditions
.
conditions
,
msgTypes
:
state
=>
state
.
msg
.
msgTypes
}
export
default
getters
frontend/src/store/index.js
浏览文件 @
8a5ccbb2
...
...
@@ -11,6 +11,7 @@ import request from './modules/request'
import
panel
from
'./modules/panel'
import
application
from
'./modules/application'
import
lic
from
'./modules/lic'
import
msg
from
'./modules/msg'
import
animation
from
'@/components/canvas/store/animation'
import
compose
from
'@/components/canvas/store/compose'
import
contextmenu
from
'@/components/canvas/store/contextmenu'
...
...
@@ -182,7 +183,8 @@ const data = {
request
,
panel
,
application
,
lic
lic
,
msg
},
getters
}
...
...
frontend/src/store/modules/msg.js
0 → 100644
浏览文件 @
8a5ccbb2
const
state
=
{
msgTypes
:
[]
}
const
mutations
=
{
SET_MSG_TYPES
:
(
state
,
value
)
=>
{
state
.
msgTypes
=
value
}
}
const
actions
=
{
setMsgTypes
({
commit
},
data
)
{
commit
(
'SET_MSG_TYPES'
,
data
)
}
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
}
frontend/src/utils/webMsg.js
浏览文件 @
8a5ccbb2
export
const
msgTypes
=
[
{
value
:
-
1
,
label
:
'webmsg.all_type'
},
{
value
:
0
,
label
:
'webmsg.panel_type'
},
{
value
:
1
,
label
:
'webmsg.dataset_type'
}
]
import
{
allTypes
}
from
'@/api/system/msg'
import
store
from
'@/store'
export
const
loadMsgTypes
=
value
=>
{
let
msgTypes
=
store
.
getters
.
msgTypes
if
(
!
msgTypes
||
Object
.
keys
(
msgTypes
).
length
===
0
)
{
allTypes
().
then
(
res
=>
{
msgTypes
=
res
.
data
const
defaultType
=
{
msgTypeId
:
-
1
,
pid
:
0
,
typeName
:
'i18n_msg_type_all'
}
msgTypes
.
splice
(
0
,
0
,
defaultType
)
store
.
dispatch
(
'msg/setMsgTypes'
,
msgTypes
)
})
}
}
export
const
getTypeName
=
value
=>
{
const
msgTypes
=
store
.
getters
.
msgTypes
for
(
let
index
=
0
;
index
<
msgTypes
.
length
;
index
++
)
{
const
element
=
msgTypes
[
index
]
if
(
element
.
value
===
value
)
{
return
element
.
label
if
(
element
.
msgTypeId
===
value
)
{
return
element
.
typeName
}
}
}
frontend/src/views/dataset/index.vue
浏览文件 @
8a5ccbb2
...
...
@@ -99,15 +99,16 @@ export default {
toMsgShare
(
routerParam
)
{
if
(
routerParam
!==
null
&&
routerParam
.
msgNotification
)
{
// 说明是从消息通知跳转过来的
if
(
routerParam
.
msgType
===
1
)
{
// 是数据集同步
const
panelShareTypeIds
=
[
4
,
5
,
6
]
// 说明是从消息通知跳转过来的
if
(
panelShareTypeIds
.
includes
(
routerParam
.
msgType
))
{
// 是数据集同步
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
)
this
.
$refs
.
dynamic_component
&&
this
.
$refs
.
dynamic_component
.
msg2Current
&&
this
.
$refs
.
dynamic_component
.
msg2Current
(
routerParam
.
sourceParam
)
})
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
frontend/src/views/msg/all.vue
浏览文件 @
8a5ccbb2
...
...
@@ -2,7 +2,7 @@
<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-button
v-for=
"(item,index) in
$store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -36,9 +36,9 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
2
0"
>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
$t
(
getTypeName
(
scope
.
row
.
type
)
)
}}
</span>
<span>
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -52,7 +52,7 @@
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'
import
{
msgTypes
,
getTypeName
,
loadMsgTypes
}
from
'@/utils/webMsg'
import
bus
from
'@/utils/bus'
import
{
addOrder
,
formatOrders
}
from
'@/utils/index'
export
default
{
...
...
@@ -85,6 +85,10 @@ export default {
mounted
()
{
this
.
search
()
},
created
()
{
// 先加载消息类型
loadMsgTypes
()
},
methods
:
{
select
(
selection
)
{
},
...
...
@@ -109,13 +113,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
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
row
.
status
||
this
.
setReaded
(
row
)
},
...
...
frontend/src/views/msg/readed.vue
浏览文件 @
8a5ccbb2
...
...
@@ -2,7 +2,7 @@
<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-button
v-for=
"(item,index) in
$store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -42,9 +42,9 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
2
0"
>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
$t
(
getTypeName
(
scope
.
row
.
type
)
)
}}
</span>
<span>
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -58,7 +58,7 @@
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'
import
{
msgTypes
,
getTypeName
,
loadMsgTypes
}
from
'@/utils/webMsg'
import
{
addOrder
,
formatOrders
}
from
'@/utils/index'
export
default
{
components
:
{
...
...
@@ -90,6 +90,10 @@ export default {
mounted
()
{
this
.
search
()
},
created
()
{
// 先加载消息类型
loadMsgTypes
()
},
methods
:
{
select
(
selection
)
{
},
...
...
@@ -114,13 +118,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
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
},
sortChange
({
column
,
prop
,
order
})
{
...
...
frontend/src/views/msg/setting.vue
0 → 100644
浏览文件 @
8a5ccbb2
<
template
xmlns:el-col=
"http://www.w3.org/1999/html"
>
<layout-content
:header=
"$t('webmsg.receive_manage')"
>
<el-col>
<el-row
class=
"tree-head"
>
<span
style=
"float: left;padding-left: 10px"
>
{{
$t
(
'webmsg.type'
)
}}
</span>
<span
v-for=
"channel in msg_channels"
:key=
"channel.msgChannelId"
class=
"auth-span"
>
{{
$t
(
channel
.
channelName
)
}}
</span>
</el-row>
<el-row
style=
"margin-top: 5px"
>
<el-tree
:props=
"defaultProps"
:data=
"treeData"
default-expand-all
:node-key=
"defaultProps.id"
:highlight-current=
"highlightCurrent"
@
node-click=
"nodeClick"
>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
style=
"margin-left: 6px"
>
{{
$t
(
'webmsg.'
+
data
.
name
)
}}
</span>
</span>
<span
@
click
.
stop
>
<!--
<div
v-if=
"setting_data[data.id]"
>
<span
v-for=
"channel in setting_data[data.id]"
:key=
"channel.channelId"
class=
"auth-span"
>
<a
href=
"javascript:;"
@
click=
"clickAuth(data.id,channel)"
>
<svg-icon
style=
"width: 25px;height: 25px"
:icon-class=
"channel.enable ? 'lock_open' : 'lock_closed'"
/>
</a>
</span>
</div>
-->
<div>
<span
v-for=
"channel in msg_channels"
:key=
"channel.msgChannelId"
class=
"auth-span"
>
<a
href=
"javascript:;"
@
click=
"clickAuth(node,channel)"
>
<svg-icon
style=
"width: 25px;height: 25px"
:icon-class=
"checkBoxStatus(node, channel)?'lock_open':'lock_closed'"
/>
</a>
</span>
</div></span>
</span>
</el-tree>
</el-row>
</el-col>
</layout-content>
</
template
>
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
treeList
,
channelList
,
settingList
,
updateSetting
}
from
'@/api/system/msg'
export
default
{
name
:
'LazyTree'
,
components
:
{
LayoutContent
},
data
()
{
return
{
treeData
:
[],
defaultProps
:
{
children
:
'children'
,
label
:
'name'
,
id
:
'id'
},
highlightCurrent
:
true
,
msg_channels
:
[],
setting_data
:
{}
}
},
computed
:
{
},
mounted
()
{
},
created
()
{
this
.
loadChannelData
()
this
.
loadSettingData
(
this
.
loadTreeData
)
},
methods
:
{
// 加载树节点数据
loadTreeData
()
{
treeList
().
then
(
res
=>
{
this
.
treeData
=
res
.
data
})
},
// 加载消息渠道
loadChannelData
()
{
channelList
().
then
(
res
=>
{
this
.
msg_channels
=
res
.
data
})
},
// 加载用户设置信息
loadSettingData
(
callBack
)
{
// this.setting_data = {}
const
temp_setting_data
=
{}
settingList
().
then
(
res
=>
{
const
lists
=
res
.
data
lists
.
forEach
(
item
=>
{
const
key
=
item
.
typeId
if
(
!
Object
.
keys
(
temp_setting_data
).
includes
(
key
))
{
temp_setting_data
[
key
]
=
[]
}
temp_setting_data
[
key
].
push
(
item
)
})
this
.
setting_data
=
temp_setting_data
callBack
&&
callBack
()
})
},
checkBoxStatus
(
node
,
channel
)
{
const
nodeId
=
node
.
data
.
id
return
this
.
setting_data
[
nodeId
]
&&
this
.
setting_data
[
nodeId
].
some
(
item
=>
item
.
channelId
===
channel
.
msgChannelId
&&
item
.
enable
)
},
clickAuth
(
node
,
channel
)
{
// const status = this.checkBoxStatus(nodeId, channel)
const
param
=
{
typeId
:
node
.
data
.
id
,
channelId
:
channel
.
msgChannelId
}
updateSetting
(
param
).
then
(
res
=>
{
this
.
loadSettingData
()
// node.checked = true
})
},
nodeClick
(
data
,
node
)
{
console
.
log
(
data
)
}
}
}
</
script
>
<
style
scoped
>
.custom-tree-node
{
flex
:
1
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
font-size
:
14px
;
padding-left
:
8px
;
}
.tree-main
{
height
:
calc
(
100vh
-
210px
);
border
:
1px
solid
#e6e6e6
;
overflow-y
:
auto
;
}
.tree-head
{
height
:
30px
;
line-height
:
30px
;
border-bottom
:
1px
solid
#e6e6e6
;
background-color
:
#f7f8fa
;
font-size
:
12px
;
color
:
#3d4d66
;
}
.auth-span
{
float
:
right
;
width
:
50px
;
margin-right
:
30px
}
.highlights-text
{
color
:
#faaa39
!important
;
}
</
style
>
frontend/src/views/msg/unread.vue
浏览文件 @
8a5ccbb2
...
...
@@ -2,7 +2,7 @@
<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-button
v-for=
"(item,index) in
$store.getters.msgTypes.filter(type => type.pid
<
=
0
)"
:key=
"index"
class=
"de-msg-radio-class"
:label=
"item.msgTypeId"
>
{{
$t
(
'webmsg.'
+
item
.
typeName
)
}}
</el-radio-button>
</el-radio-group>
<complex-table
...
...
@@ -45,9 +45,9 @@
</
template
>
</el-table-column>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
2
0"
>
<el-table-column
prop=
"type"
sortable=
"custom"
:label=
"$t('webmsg.type')"
width=
"1
4
0"
>
<
template
slot-scope=
"scope"
>
<span>
{{
$t
(
getTypeName
(
scope
.
row
.
type
)
)
}}
</span>
<span>
{{
getTypeName
(
scope
.
row
.
typeId
)
}}
</span>
</
template
>
</el-table-column>
...
...
@@ -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
.
type
Id
,
sourceParam
:
row
.
param
}}
this
.
$router
.
push
({
name
:
row
.
router
,
params
:
param
})
this
.
setReaded
(
row
)
},
...
...
frontend/src/views/panel/index.vue
浏览文件 @
8a5ccbb2
...
...
@@ -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
)
})
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论