Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
5ce64f0d
提交
5ce64f0d
authored
11月 15, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 消息订阅增加邮件渠道
上级
75a22aab
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
417 行增加
和
215 行删除
+417
-215
SysMsgChannel.java
.../src/main/java/io/dataease/base/domain/SysMsgChannel.java
+3
-7
SysMsgChannelExample.java
...in/java/io/dataease/base/domain/SysMsgChannelExample.java
+70
-0
SysMsgChannelMapper.xml
...main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml
+23
-5
SystemParameterController.java
...io/dataease/controller/sys/SystemParameterController.java
+8
-5
ExtractDataService.java
.../java/io/dataease/service/dataset/ExtractDataService.java
+1
-1
DatasourceService.java
...ava/io/dataease/service/datasource/DatasourceService.java
+1
-1
DeMsgutil.java
.../src/main/java/io/dataease/service/message/DeMsgutil.java
+3
-9
MsgAop.java
...end/src/main/java/io/dataease/service/message/MsgAop.java
+0
-60
SysMsgService.java
.../main/java/io/dataease/service/message/SysMsgService.java
+17
-9
SendService.java
...java/io/dataease/service/message/service/SendService.java
+7
-0
SendEmail.java
.../dataease/service/message/service/strategy/SendEmail.java
+28
-0
SendStation.java
...ataease/service/message/service/strategy/SendStation.java
+30
-0
ShareService.java
...src/main/java/io/dataease/service/panel/ShareService.java
+3
-3
EmailService.java
...rc/main/java/io/dataease/service/system/EmailService.java
+199
-0
SystemParameterService.java
...va/io/dataease/service/system/SystemParameterService.java
+2
-95
V28__de1.5.sql
backend/src/main/resources/db/migration/V28__de1.5.sql
+11
-0
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+1
-16
setting.vue
frontend/src/views/msg/setting.vue
+8
-2
index.vue
frontend/src/views/system/SysParam/index.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/base/domain/SysMsgChannel.java
浏览文件 @
5ce64f0d
package
io
.
dataease
.
base
.
domain
;
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
@ApiModel
(
"消息渠道"
)
public
class
SysMsgChannel
implements
Serializable
{
public
class
SysMsgChannel
implements
Serializable
{
@ApiModelProperty
(
"消息渠道ID"
)
private
Long
msgChannelId
;
private
Long
msgChannelId
;
@ApiModelProperty
(
"消息渠道名称"
)
private
String
channelName
;
private
String
channelName
;
private
String
serviceName
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/SysMsgChannelExample.java
浏览文件 @
5ce64f0d
...
@@ -233,6 +233,76 @@ public class SysMsgChannelExample {
...
@@ -233,6 +233,76 @@ public class SysMsgChannelExample {
addCriterion
(
"channel_name not between"
,
value1
,
value2
,
"channelName"
);
addCriterion
(
"channel_name not between"
,
value1
,
value2
,
"channelName"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andServiceNameIsNull
()
{
addCriterion
(
"service_name is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameIsNotNull
()
{
addCriterion
(
"service_name is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameEqualTo
(
String
value
)
{
addCriterion
(
"service_name ="
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameNotEqualTo
(
String
value
)
{
addCriterion
(
"service_name <>"
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameGreaterThan
(
String
value
)
{
addCriterion
(
"service_name >"
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"service_name >="
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameLessThan
(
String
value
)
{
addCriterion
(
"service_name <"
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"service_name <="
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameLike
(
String
value
)
{
addCriterion
(
"service_name like"
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameNotLike
(
String
value
)
{
addCriterion
(
"service_name not like"
,
value
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameIn
(
List
<
String
>
values
)
{
addCriterion
(
"service_name in"
,
values
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"service_name not in"
,
values
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"service_name between"
,
value1
,
value2
,
"serviceName"
);
return
(
Criteria
)
this
;
}
public
Criteria
andServiceNameNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"service_name not between"
,
value1
,
value2
,
"serviceName"
);
return
(
Criteria
)
this
;
}
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml
浏览文件 @
5ce64f0d
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysMsgChannel"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.SysMsgChannel"
>
<id
column=
"msg_channel_id"
jdbcType=
"BIGINT"
property=
"msgChannelId"
/>
<id
column=
"msg_channel_id"
jdbcType=
"BIGINT"
property=
"msgChannelId"
/>
<result
column=
"channel_name"
jdbcType=
"VARCHAR"
property=
"channelName"
/>
<result
column=
"channel_name"
jdbcType=
"VARCHAR"
property=
"channelName"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
</resultMap>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<sql
id=
"Example_Where_Clause"
>
<where>
<where>
...
@@ -64,7 +65,7 @@
...
@@ -64,7 +65,7 @@
</where>
</where>
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
msg_channel_id, channel_name
msg_channel_id, channel_name
, service_name
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -97,8 +98,10 @@
...
@@ -97,8 +98,10 @@
</if>
</if>
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
insert into sys_msg_channel (msg_channel_id, channel_name)
insert into sys_msg_channel (msg_channel_id, channel_name, service_name
values (#{msgChannelId,jdbcType=BIGINT}, #{channelName,jdbcType=VARCHAR})
)
values (#{msgChannelId,jdbcType=BIGINT}, #{channelName,jdbcType=VARCHAR}, #{serviceName,jdbcType=VARCHAR}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
insert into sys_msg_channel
insert into sys_msg_channel
...
@@ -109,6 +112,9 @@
...
@@ -109,6 +112,9 @@
<if
test=
"channelName != null"
>
<if
test=
"channelName != null"
>
channel_name,
channel_name,
</if>
</if>
<if
test=
"serviceName != null"
>
service_name,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"msgChannelId != null"
>
<if
test=
"msgChannelId != null"
>
...
@@ -117,6 +123,9 @@
...
@@ -117,6 +123,9 @@
<if
test=
"channelName != null"
>
<if
test=
"channelName != null"
>
#{channelName,jdbcType=VARCHAR},
#{channelName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"serviceName != null"
>
#{serviceName,jdbcType=VARCHAR},
</if>
</trim>
</trim>
</insert>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultType=
"java.lang.Long"
>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.SysMsgChannelExample"
resultType=
"java.lang.Long"
>
...
@@ -134,6 +143,9 @@
...
@@ -134,6 +143,9 @@
<if
test=
"record.channelName != null"
>
<if
test=
"record.channelName != null"
>
channel_name = #{record.channelName,jdbcType=VARCHAR},
channel_name = #{record.channelName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.serviceName != null"
>
service_name = #{record.serviceName,jdbcType=VARCHAR},
</if>
</set>
</set>
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
@@ -142,7 +154,8 @@
...
@@ -142,7 +154,8 @@
<update
id=
"updateByExample"
parameterType=
"map"
>
<update
id=
"updateByExample"
parameterType=
"map"
>
update sys_msg_channel
update sys_msg_channel
set msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
set msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
channel_name = #{record.channelName,jdbcType=VARCHAR}
channel_name = #{record.channelName,jdbcType=VARCHAR},
service_name = #{record.serviceName,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -153,12 +166,16 @@
...
@@ -153,12 +166,16 @@
<if
test=
"channelName != null"
>
<if
test=
"channelName != null"
>
channel_name = #{channelName,jdbcType=VARCHAR},
channel_name = #{channelName,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"serviceName != null"
>
service_name = #{serviceName,jdbcType=VARCHAR},
</if>
</set>
</set>
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.SysMsgChannel"
>
update sys_msg_channel
update sys_msg_channel
set channel_name = #{channelName,jdbcType=VARCHAR}
set channel_name = #{channelName,jdbcType=VARCHAR},
service_name = #{serviceName,jdbcType=VARCHAR}
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/controller/sys/SystemParameterController.java
浏览文件 @
5ce64f0d
...
@@ -6,8 +6,8 @@ import io.dataease.controller.sys.response.BasicInfo;
...
@@ -6,8 +6,8 @@ import io.dataease.controller.sys.response.BasicInfo;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.service.FileService
;
import
io.dataease.service.FileService
;
import
io.dataease.service.system.EmailService
;
import
io.dataease.service.system.SystemParameterService
;
import
io.dataease.service.system.SystemParameterService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
...
@@ -16,12 +16,12 @@ import org.springframework.http.ResponseEntity;
...
@@ -16,12 +16,12 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@ApiIgnore
@ApiIgnore
@RestController
@RestController
@RequestMapping
(
value
=
"/system"
)
@RequestMapping
(
value
=
"/system"
)
...
@@ -32,10 +32,13 @@ public class SystemParameterController {
...
@@ -32,10 +32,13 @@ public class SystemParameterController {
@Resource
@Resource
private
FileService
fileService
;
private
FileService
fileService
;
@Resource
private
EmailService
emailService
;
@GetMapping
(
"/mail/info"
)
@GetMapping
(
"/mail/info"
)
public
MailInfo
mailInfo
()
{
public
MailInfo
mailInfo
()
{
return
systemParameterService
.
mailInfo
(
ParamConstants
.
Classify
.
MAIL
.
getValue
()
);
return
emailService
.
mailInfo
(
);
}
}
@GetMapping
(
"/basic/info"
)
@GetMapping
(
"/basic/info"
)
...
@@ -51,7 +54,7 @@ public class SystemParameterController {
...
@@ -51,7 +54,7 @@ public class SystemParameterController {
@PostMapping
(
"/edit/email"
)
@PostMapping
(
"/edit/email"
)
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
public
void
editMail
(
@RequestBody
List
<
SystemParameter
>
systemParameter
)
{
systemParameter
Service
.
editMail
(
systemParameter
);
email
Service
.
editMail
(
systemParameter
);
}
}
@PostMapping
(
"/edit/basic"
)
@PostMapping
(
"/edit/basic"
)
...
@@ -61,7 +64,7 @@ public class SystemParameterController {
...
@@ -61,7 +64,7 @@ public class SystemParameterController {
@PostMapping
(
"/testConnection"
)
@PostMapping
(
"/testConnection"
)
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
)
{
public
void
testConnection
(
@RequestBody
HashMap
<
String
,
String
>
hashMap
)
{
systemParameter
Service
.
testConnection
(
hashMap
);
email
Service
.
testConnection
(
hashMap
);
}
}
@GetMapping
(
"/version"
)
@GetMapping
(
"/version"
)
...
...
backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java
浏览文件 @
5ce64f0d
...
@@ -413,7 +413,7 @@ public class ExtractDataService {
...
@@ -413,7 +413,7 @@ public class ExtractDataService {
if
(
ObjectUtils
.
isNotEmpty
(
datasetTableTask
)
&&
ObjectUtils
.
isNotEmpty
(
datasetTableTask
.
getName
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
datasetTableTask
)
&&
ObjectUtils
.
isNotEmpty
(
datasetTableTask
.
getName
()))
{
content
+=
" 任务名称【"
+
datasetTableTask
.
getName
()
+
"】"
;
content
+=
" 任务名称【"
+
datasetTableTask
.
getName
()
+
"】"
;
}
}
DeMsgutil
.
sendMsg
(
userId
,
typeId
,
1L
,
content
,
gson
.
toJson
(
param
));
DeMsgutil
.
sendMsg
(
userId
,
typeId
,
content
,
gson
.
toJson
(
param
));
});
});
}
}
...
...
backend/src/main/java/io/dataease/service/datasource/DatasourceService.java
浏览文件 @
5ce64f0d
...
@@ -316,7 +316,7 @@ public class DatasourceService {
...
@@ -316,7 +316,7 @@ public class DatasourceService {
String
content
=
"数据源【"
+
datasource
.
getName
()
+
"】无效"
;
String
content
=
"数据源【"
+
datasource
.
getName
()
+
"】无效"
;
DeMsgutil
.
sendMsg
(
userId
,
typeId
,
1L
,
content
,
gson
.
toJson
(
param
));
DeMsgutil
.
sendMsg
(
userId
,
typeId
,
content
,
gson
.
toJson
(
param
));
});
});
}
}
}
}
backend/src/main/java/io/dataease/service/message/DeMsgutil.java
浏览文件 @
5ce64f0d
...
@@ -18,15 +18,9 @@ public class DeMsgutil {
...
@@ -18,15 +18,9 @@ public class DeMsgutil {
public
static
void
sendMsg
(
Long
userId
,
Long
typeId
,
Long
channelId
,
String
content
,
String
param
)
{
public
static
void
sendMsg
(
Long
userId
,
Long
typeId
,
String
content
,
String
param
)
{
// SysMsg sysMsg = new SysMsg();
// sysMsg.setUserId(userId);
sysMsgService
.
sendMsg
(
userId
,
typeId
,
content
,
param
);
// sysMsg.setTypeId(typeId);
// sysMsg.setContent(content);
// sysMsg.setStatus(false);
// sysMsg.setCreateTime(System.currentTimeMillis());
// sysMsg.setParam(param);
sysMsgService
.
sendMsg
(
userId
,
typeId
,
channelId
,
content
,
param
);
}
}
...
...
backend/src/main/java/io/dataease/service/message/MsgAop.java
deleted
100644 → 0
浏览文件 @
75a22aab
package
io
.
dataease
.
service
.
message
;
import
io.dataease.controller.sys.response.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
浏览文件 @
5ce64f0d
...
@@ -16,6 +16,7 @@ import io.dataease.controller.sys.request.MsgSettingRequest;
...
@@ -16,6 +16,7 @@ import io.dataease.controller.sys.request.MsgSettingRequest;
import
io.dataease.controller.sys.response.MsgGridDto
;
import
io.dataease.controller.sys.response.MsgGridDto
;
import
io.dataease.controller.sys.response.SettingTreeNode
;
import
io.dataease.controller.sys.response.SettingTreeNode
;
import
io.dataease.controller.sys.response.SubscribeNode
;
import
io.dataease.controller.sys.response.SubscribeNode
;
import
io.dataease.service.message.service.SendService
;
import
io.dataease.service.system.SystemParameterService
;
import
io.dataease.service.system.SystemParameterService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
@@ -280,15 +281,22 @@ public class SysMsgService {
...
@@ -280,15 +281,22 @@ public class SysMsgService {
extSysMsgMapper
.
batchInsert
(
settings
);
extSysMsgMapper
.
batchInsert
(
settings
);
}
}
public
void
sendMsg
(
Long
userId
,
Long
typeId
,
Long
channelId
,
String
content
,
String
param
)
{
public
void
sendMsg
(
Long
userId
,
Long
typeId
,
String
content
,
String
param
)
{
SysMsg
sysMsg
=
new
SysMsg
();
List
<
SubscribeNode
>
subscribes
=
subscribes
(
userId
);
sysMsg
.
setUserId
(
userId
);
sysMsg
.
setTypeId
(
typeId
);
if
(
CollectionUtils
.
isNotEmpty
(
subscribes
))
{
sysMsg
.
setContent
(
content
);
subscribes
.
stream
().
filter
(
item
->
item
.
getTypeId
()
==
typeId
).
forEach
(
sub
->
{
sysMsg
.
setStatus
(
false
);
SendService
sendService
=
serviceByChannel
(
sub
.
getChannelId
());
sysMsg
.
setCreateTime
(
System
.
currentTimeMillis
());
sendService
.
sendMsg
(
userId
,
typeId
,
content
,
param
);
sysMsg
.
setParam
(
param
);
});
save
(
sysMsg
);
}
}
private
SendService
serviceByChannel
(
Long
channelId
){
String
beanName
=
sysMsgChannelMapper
.
selectByPrimaryKey
(
channelId
).
getServiceName
();
return
(
SendService
)
CommonBeanFactory
.
getBean
(
beanName
);
}
}
/**
/**
...
...
backend/src/main/java/io/dataease/service/message/service/SendService.java
0 → 100644
浏览文件 @
5ce64f0d
package
io
.
dataease
.
service
.
message
.
service
;
public
interface
SendService
{
void
sendMsg
(
Long
userId
,
Long
typeId
,
String
content
,
String
param
);
}
backend/src/main/java/io/dataease/service/message/service/strategy/SendEmail.java
0 → 100644
浏览文件 @
5ce64f0d
package
io
.
dataease
.
service
.
message
.
service
.
strategy
;
import
io.dataease.auth.service.AuthUserService
;
import
io.dataease.service.message.service.SendService
;
import
io.dataease.service.system.EmailService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
@Service
(
"sendEmail"
)
public
class
SendEmail
implements
SendService
{
@Autowired
private
EmailService
emailService
;
@Autowired
private
AuthUserService
authUserService
;
@Async
@Override
public
void
sendMsg
(
Long
userId
,
Long
typeId
,
String
content
,
String
param
)
{
String
email
=
authUserService
.
getUserById
(
userId
).
getEmail
();
emailService
.
send
(
email
,
content
,
content
);
}
}
backend/src/main/java/io/dataease/service/message/service/strategy/SendStation.java
0 → 100644
浏览文件 @
5ce64f0d
package
io
.
dataease
.
service
.
message
.
service
.
strategy
;
import
io.dataease.base.domain.SysMsg
;
import
io.dataease.base.mapper.SysMsgMapper
;
import
io.dataease.service.message.service.SendService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Service
(
"sendStation"
)
public
class
SendStation
implements
SendService
{
@Resource
private
SysMsgMapper
sysMsgMapper
;
@Override
public
void
sendMsg
(
Long
userId
,
Long
typeId
,
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
);
sysMsgMapper
.
insert
(
sysMsg
);
}
}
backend/src/main/java/io/dataease/service/panel/ShareService.java
浏览文件 @
5ce64f0d
...
@@ -136,13 +136,13 @@ public class ShareService {
...
@@ -136,13 +136,13 @@ public class ShareService {
msgParam
.
add
(
panelGroupId
);
msgParam
.
add
(
panelGroupId
);
addUserIdSet
.
forEach
(
userId
->
{
addUserIdSet
.
forEach
(
userId
->
{
if
(!
redUserIdSet
.
contains
(
userId
)
&&
user
.
getUserId
()
!=
userId
){
if
(!
redUserIdSet
.
contains
(
userId
)
&&
user
.
getUserId
()
!=
userId
){
DeMsgutil
.
sendMsg
(
userId
,
2L
,
1L
,
user
.
getNickName
()+
" 分享了仪表板【"
+
msg
+
"】,请查收!"
,
gson
.
toJson
(
msgParam
));
DeMsgutil
.
sendMsg
(
userId
,
2L
,
user
.
getNickName
()+
" 分享了仪表板【"
+
msg
+
"】,请查收!"
,
gson
.
toJson
(
msgParam
));
}
}
});
});
redUserIdSet
.
forEach
(
userId
->
{
redUserIdSet
.
forEach
(
userId
->
{
if
(!
addUserIdSet
.
contains
(
userId
)
&&
user
.
getUserId
()
!=
userId
){
if
(!
addUserIdSet
.
contains
(
userId
)
&&
user
.
getUserId
()
!=
userId
){
DeMsgutil
.
sendMsg
(
userId
,
3L
,
1L
,
user
.
getNickName
()+
" 取消分享了仪表板【"
+
msg
+
"】,请查收!"
,
gson
.
toJson
(
msgParam
));
DeMsgutil
.
sendMsg
(
userId
,
3L
,
user
.
getNickName
()+
" 取消分享了仪表板【"
+
msg
+
"】,请查收!"
,
gson
.
toJson
(
msgParam
));
}
}
});
});
...
@@ -265,7 +265,7 @@ public class ShareService {
...
@@ -265,7 +265,7 @@ public class ShareService {
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
userIdSet
.
forEach
(
userId
->
{
userIdSet
.
forEach
(
userId
->
{
// DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!");
// DeMsgutil.sendMsg(userId, 0, user.getNickName()+" 分享了仪表板【"+msg+"】给您,请查收!");
DeMsgutil
.
sendMsg
(
userId
,
2L
,
1L
,
user
.
getNickName
()+
" 分享了仪表板【"
+
msg
+
"】给您,请查收!"
,
gson
.
toJson
(
panelIds
));
DeMsgutil
.
sendMsg
(
userId
,
2L
,
user
.
getNickName
()+
" 分享了仪表板【"
+
msg
+
"】给您,请查收!"
,
gson
.
toJson
(
panelIds
));
});
});
}
}
...
...
backend/src/main/java/io/dataease/service/system/EmailService.java
0 → 100644
浏览文件 @
5ce64f0d
package
io
.
dataease
.
service
.
system
;
import
io.dataease.base.domain.SystemParameter
;
import
io.dataease.base.domain.SystemParameterExample
;
import
io.dataease.base.mapper.SystemParameterMapper
;
import
io.dataease.commons.constants.ParamConstants
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.utils.CommonBeanFactory
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.i18n.Translator
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
org.springframework.mail.javamail.MimeMessageHelper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.mail.MessagingException
;
import
javax.mail.internet.MimeMessage
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Properties
;
@Service
public
class
EmailService
{
private
static
final
String
SSL_CLASS_KEY
=
"mail.smtp.socketFactory.class"
;
private
static
final
String
SSL_CLASS_VAL
=
"javax.net.ssl.SSLSocketFactory"
;
private
static
final
String
TLS_PROP_KEY
=
"mail.smtp.starttls.enable"
;
private
static
final
String
SMTP_TIMEOUT_KEY
=
"mail.smtp.timeout"
;
private
static
final
String
SMTP_TIMEOUT_VAL
=
"30000"
;
private
static
final
String
SMTP_CONNECTIONTIMEOUT_KEY
=
"mail.smtp.connectiontimeout"
;
private
static
final
String
SMTP_CONNECTIONTIMEOUT_VAL
=
"5000"
;
@Resource
private
SystemParameterMapper
systemParameterMapper
;
/**
*
* @param to 收件人
* @param title 标题
* @param content 内容
*/
public
void
send
(
String
to
,
String
title
,
String
content
)
{
if
(
StringUtils
.
isBlank
(
to
))
return
;
MailInfo
mailInfo
=
proxy
().
mailInfo
();
JavaMailSenderImpl
driver
=
driver
(
mailInfo
);
MimeMessage
mimeMessage
=
driver
.
createMimeMessage
();
MimeMessageHelper
helper
=
null
;
try
{
helper
=
new
MimeMessageHelper
(
mimeMessage
,
true
);
helper
.
setFrom
(
driver
.
getUsername
());
helper
.
setSubject
(
title
);
helper
.
setText
(
content
,
true
);
helper
.
setTo
(
to
);
driver
.
send
(
mimeMessage
);
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
Translator
.
get
(
"connection_failed"
));
}
}
public
JavaMailSenderImpl
driver
(
MailInfo
mailInfo
)
{
JavaMailSenderImpl
javaMailSender
=
new
JavaMailSenderImpl
();
javaMailSender
.
setDefaultEncoding
(
"UTF-8"
);
javaMailSender
.
setHost
(
mailInfo
.
getHost
());
javaMailSender
.
setPort
(
Integer
.
valueOf
(
mailInfo
.
getPort
()));
javaMailSender
.
setUsername
(
mailInfo
.
getAccount
());
javaMailSender
.
setPassword
(
mailInfo
.
getPassword
());
Properties
props
=
new
Properties
();
if
(
BooleanUtils
.
toBoolean
(
mailInfo
.
getSsl
()))
{
props
.
put
(
SSL_CLASS_KEY
,
SSL_CLASS_VAL
);
}
if
(
BooleanUtils
.
toBoolean
(
mailInfo
.
getTls
()))
{
props
.
put
(
TLS_PROP_KEY
,
"true"
);
}
props
.
put
(
SMTP_TIMEOUT_KEY
,
SMTP_TIMEOUT_VAL
);
props
.
put
(
SMTP_CONNECTIONTIMEOUT_KEY
,
SMTP_CONNECTIONTIMEOUT_VAL
);
javaMailSender
.
setJavaMailProperties
(
props
);
return
javaMailSender
;
}
private
EmailService
proxy
()
{
return
CommonBeanFactory
.
getBean
(
EmailService
.
class
);
}
public
MailInfo
mailInfo
()
{
String
type
=
ParamConstants
.
Classify
.
MAIL
.
getValue
();
List
<
SystemParameter
>
paramList
=
getParamList
(
type
);
MailInfo
mailInfo
=
new
MailInfo
();
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
for
(
SystemParameter
param
:
paramList
)
{
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SERVER
.
getValue
()))
{
mailInfo
.
setHost
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PORT
.
getValue
()))
{
mailInfo
.
setPort
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
ACCOUNT
.
getValue
()))
{
mailInfo
.
setAccount
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()))
{
String
password
=
EncryptUtils
.
aesDecrypt
(
param
.
getParamValue
()).
toString
();
mailInfo
.
setPassword
(
password
);
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SSL
.
getValue
()))
{
mailInfo
.
setSsl
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
TLS
.
getValue
()))
{
mailInfo
.
setTls
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
RECIPIENTS
.
getValue
()))
{
mailInfo
.
setRecipient
(
param
.
getParamValue
());
}
}
}
return
mailInfo
;
}
public
List
<
SystemParameter
>
getParamList
(
String
type
)
{
SystemParameterExample
example
=
new
SystemParameterExample
();
example
.
createCriteria
().
andParamKeyLike
(
type
+
"%"
);
return
systemParameterMapper
.
selectByExample
(
example
);
}
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
/*List<SystemParameter> paramList = this.getParamList(ParamConstants.Classify.MAIL.getValue());
boolean empty = paramList.size() <= 0;*/
parameters
.
forEach
(
parameter
->
{
SystemParameterExample
example
=
new
SystemParameterExample
();
if
(
parameter
.
getParamKey
().
equals
(
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()))
{
if
(!
StringUtils
.
isBlank
(
parameter
.
getParamValue
()))
{
String
string
=
EncryptUtils
.
aesEncrypt
(
parameter
.
getParamValue
()).
toString
();
parameter
.
setParamValue
(
string
);
}
}
example
.
createCriteria
().
andParamKeyEqualTo
(
parameter
.
getParamKey
());
if
(
systemParameterMapper
.
countByExample
(
example
)
>
0
)
{
systemParameterMapper
.
updateByPrimaryKey
(
parameter
);
}
else
{
systemParameterMapper
.
insert
(
parameter
);
}
example
.
clear
();
});
}
public
void
testConnection
(
HashMap
<
String
,
String
>
hashMap
)
{
JavaMailSenderImpl
javaMailSender
=
new
JavaMailSenderImpl
();
javaMailSender
.
setDefaultEncoding
(
"UTF-8"
);
javaMailSender
.
setHost
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
SERVER
.
getValue
()));
javaMailSender
.
setPort
(
Integer
.
valueOf
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PORT
.
getValue
())));
javaMailSender
.
setUsername
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
ACCOUNT
.
getValue
()));
javaMailSender
.
setPassword
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()));
Properties
props
=
new
Properties
();
String
recipients
=
hashMap
.
get
(
ParamConstants
.
MAIL
.
RECIPIENTS
.
getValue
());
if
(
BooleanUtils
.
toBoolean
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
SSL
.
getValue
())))
{
props
.
put
(
"mail.smtp.socketFactory.class"
,
"javax.net.ssl.SSLSocketFactory"
);
}
if
(
BooleanUtils
.
toBoolean
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
TLS
.
getValue
())))
{
props
.
put
(
"mail.smtp.starttls.enable"
,
"true"
);
}
props
.
put
(
"mail.smtp.timeout"
,
"30000"
);
props
.
put
(
"mail.smtp.connectiontimeout"
,
"5000"
);
javaMailSender
.
setJavaMailProperties
(
props
);
try
{
javaMailSender
.
testConnection
();
}
catch
(
MessagingException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
Translator
.
get
(
"connection_failed"
));
}
if
(!
StringUtils
.
isBlank
(
recipients
)){
MimeMessage
mimeMessage
=
javaMailSender
.
createMimeMessage
();
MimeMessageHelper
helper
=
null
;
try
{
helper
=
new
MimeMessageHelper
(
mimeMessage
,
true
);
helper
.
setFrom
(
javaMailSender
.
getUsername
());
helper
.
setSubject
(
"DataEase测试邮件 "
);
helper
.
setText
(
"这是一封测试邮件,邮件发送成功"
,
true
);
helper
.
setTo
(
recipients
);
javaMailSender
.
send
(
mimeMessage
);
}
catch
(
MessagingException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
Translator
.
get
(
"connection_failed"
));
}
}
}
}
backend/src/main/java/io/dataease/service/system/SystemParameterService.java
浏览文件 @
5ce64f0d
...
@@ -9,24 +9,16 @@ import io.dataease.commons.constants.ParamConstants;
...
@@ -9,24 +9,16 @@ import io.dataease.commons.constants.ParamConstants;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.EncryptUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.BasicInfo
;
import
io.dataease.controller.sys.response.MailInfo
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.dto.SystemParameterDTO
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.FileService
;
import
io.dataease.service.FileService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.mail.javamail.JavaMailSenderImpl
;
import
org.springframework.mail.javamail.MimeMessageHelper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
javax.mail.MessagingException
;
import
javax.mail.internet.MimeMessage
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.util.*
;
import
java.util.*
;
...
@@ -44,6 +36,7 @@ public class SystemParameterService {
...
@@ -44,6 +36,7 @@ public class SystemParameterService {
private
FileService
fileService
;
private
FileService
fileService
;
public
String
searchEmail
()
{
public
String
searchEmail
()
{
return
extSystemParameterMapper
.
email
();
return
extSystemParameterMapper
.
email
();
}
}
...
@@ -67,31 +60,7 @@ public class SystemParameterService {
...
@@ -67,31 +60,7 @@ public class SystemParameterService {
}
}
public
MailInfo
mailInfo
(
String
type
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
type
);
MailInfo
mailInfo
=
new
MailInfo
();
if
(!
CollectionUtils
.
isEmpty
(
paramList
))
{
for
(
SystemParameter
param
:
paramList
)
{
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SERVER
.
getValue
()))
{
mailInfo
.
setHost
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PORT
.
getValue
()))
{
mailInfo
.
setPort
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
ACCOUNT
.
getValue
()))
{
mailInfo
.
setAccount
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()))
{
String
password
=
EncryptUtils
.
aesDecrypt
(
param
.
getParamValue
()).
toString
();
mailInfo
.
setPassword
(
password
);
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
SSL
.
getValue
()))
{
mailInfo
.
setSsl
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
TLS
.
getValue
()))
{
mailInfo
.
setTls
(
param
.
getParamValue
());
}
else
if
(
StringUtils
.
equals
(
param
.
getParamKey
(),
ParamConstants
.
MAIL
.
RECIPIENTS
.
getValue
()))
{
mailInfo
.
setRecipient
(
param
.
getParamValue
());
}
}
}
return
mailInfo
;
}
public
String
getSystemLanguage
()
{
public
String
getSystemLanguage
()
{
...
@@ -110,28 +79,7 @@ public class SystemParameterService {
...
@@ -110,28 +79,7 @@ public class SystemParameterService {
public
void
editMail
(
List
<
SystemParameter
>
parameters
)
{
List
<
SystemParameter
>
paramList
=
this
.
getParamList
(
ParamConstants
.
Classify
.
MAIL
.
getValue
());
boolean
empty
=
paramList
.
size
()
<=
0
;
parameters
.
forEach
(
parameter
->
{
SystemParameterExample
example
=
new
SystemParameterExample
();
if
(
parameter
.
getParamKey
().
equals
(
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()))
{
if
(!
StringUtils
.
isBlank
(
parameter
.
getParamValue
()))
{
String
string
=
EncryptUtils
.
aesEncrypt
(
parameter
.
getParamValue
()).
toString
();
parameter
.
setParamValue
(
string
);
}
}
example
.
createCriteria
().
andParamKeyEqualTo
(
parameter
.
getParamKey
());
if
(
systemParameterMapper
.
countByExample
(
example
)
>
0
)
{
systemParameterMapper
.
updateByPrimaryKey
(
parameter
);
}
else
{
systemParameterMapper
.
insert
(
parameter
);
}
example
.
clear
();
});
}
public
void
editBasic
(
List
<
SystemParameter
>
parameters
)
{
public
void
editBasic
(
List
<
SystemParameter
>
parameters
)
{
parameters
.
forEach
(
parameter
->
{
parameters
.
forEach
(
parameter
->
{
...
@@ -154,48 +102,7 @@ public class SystemParameterService {
...
@@ -154,48 +102,7 @@ public class SystemParameterService {
return
systemParameterMapper
.
selectByExample
(
example
);
return
systemParameterMapper
.
selectByExample
(
example
);
}
}
public
void
testConnection
(
HashMap
<
String
,
String
>
hashMap
)
{
JavaMailSenderImpl
javaMailSender
=
new
JavaMailSenderImpl
();
javaMailSender
.
setDefaultEncoding
(
"UTF-8"
);
javaMailSender
.
setHost
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
SERVER
.
getValue
()));
javaMailSender
.
setPort
(
Integer
.
valueOf
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PORT
.
getValue
())));
javaMailSender
.
setUsername
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
ACCOUNT
.
getValue
()));
javaMailSender
.
setPassword
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
PASSWORD
.
getValue
()));
Properties
props
=
new
Properties
();
String
recipients
=
hashMap
.
get
(
ParamConstants
.
MAIL
.
RECIPIENTS
.
getValue
());
if
(
BooleanUtils
.
toBoolean
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
SSL
.
getValue
())))
{
props
.
put
(
"mail.smtp.socketFactory.class"
,
"javax.net.ssl.SSLSocketFactory"
);
}
if
(
BooleanUtils
.
toBoolean
(
hashMap
.
get
(
ParamConstants
.
MAIL
.
TLS
.
getValue
())))
{
props
.
put
(
"mail.smtp.starttls.enable"
,
"true"
);
}
props
.
put
(
"mail.smtp.timeout"
,
"30000"
);
props
.
put
(
"mail.smtp.connectiontimeout"
,
"5000"
);
javaMailSender
.
setJavaMailProperties
(
props
);
try
{
javaMailSender
.
testConnection
();
}
catch
(
MessagingException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
Translator
.
get
(
"connection_failed"
));
}
if
(!
StringUtils
.
isBlank
(
recipients
)){
MimeMessage
mimeMessage
=
javaMailSender
.
createMimeMessage
();
MimeMessageHelper
helper
=
null
;
try
{
helper
=
new
MimeMessageHelper
(
mimeMessage
,
true
);
helper
.
setFrom
(
javaMailSender
.
getUsername
());
helper
.
setSubject
(
"DataEase测试邮件 "
);
helper
.
setText
(
"这是一封测试邮件,邮件发送成功"
,
true
);
helper
.
setTo
(
recipients
);
javaMailSender
.
send
(
mimeMessage
);
}
catch
(
MessagingException
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
Translator
.
get
(
"connection_failed"
));
}
}
}
public
String
getVersion
()
{
public
String
getVersion
()
{
return
System
.
getenv
(
"MS_VERSION"
);
return
System
.
getenv
(
"MS_VERSION"
);
...
...
backend/src/main/resources/db/migration/V28__de1.5.sql
浏览文件 @
5ce64f0d
...
@@ -16,3 +16,14 @@ CREATE TABLE `panel_link_mapping` (
...
@@ -16,3 +16,14 @@ CREATE TABLE `panel_link_mapping` (
`resource_id`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'仪表板ID'
,
`resource_id`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'仪表板ID'
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- 策略模式优化发送消息
-- ----------------------------
ALTER
TABLE
`dataease`
.
`sys_msg_channel`
ADD
COLUMN
`service_name`
varchar
(
255
)
NULL
COMMENT
'策略名称'
AFTER
`channel_name`
;
UPDATE
`dataease`
.
`sys_msg_channel`
SET
`service_name`
=
'sendStation'
WHERE
`msg_channel_id`
=
1
;
INSERT
INTO
`dataease`
.
`sys_msg_channel`
(
`msg_channel_id`
,
`channel_name`
,
`service_name`
)
VALUES
(
2
,
'webmsg.channel_email_msg'
,
'sendEmail'
);
backend/src/main/resources/generatorConfig.xml
浏览文件 @
5ce64f0d
...
@@ -65,22 +65,7 @@
...
@@ -65,22 +65,7 @@
<!--要生成的数据库表 -->
<!--要生成的数据库表 -->
<!-- <table tableName="panel_link_jump"/>-->
<table
tableName=
"sys_msg_channel"
/>
<!-- <table tableName="panel_link_jump_info"/>-->
<!-- <table tableName="panel_link_jump_target_view_info"/>-->
<table
tableName=
"v_auth_model"
/>
<table
tableName=
"panel_link_mapping"
/>
<!-- <table tableName="sys_dict_item"/>-->
<!-- <table tableName="dataset_table_field"/>-->
<!-- <table tableName="v_chart">-->
<!-- </table>-->
<!-- <table tableName="v_auth_model">-->
<!-- </table>-->
<!-- <table tableName="v_dataset"/>-->
<!-- <table tableName="sys_auth_detail"/>-->
<!-- <table tableName="dataset_table_task">-->
<!-- <columnOverride column="extra_data" javaType="java.lang.String" jdbcType="VARCHAR" />-->
<!-- </table>-->
</context>
</context>
...
...
frontend/src/views/msg/setting.vue
浏览文件 @
5ce64f0d
...
@@ -65,9 +65,15 @@ export default {
...
@@ -65,9 +65,15 @@ export default {
},
},
mounted
()
{
mounted
()
{
},
beforeCreate
()
{
// this.loadChannelData()
channelList
().
then
(
res
=>
{
this
.
msg_channels
=
res
.
data
})
},
},
created
()
{
created
()
{
this
.
loadChannelData
()
this
.
loadSettingData
(
this
.
loadTreeData
)
this
.
loadSettingData
(
this
.
loadTreeData
)
},
},
...
@@ -129,7 +135,7 @@ export default {
...
@@ -129,7 +135,7 @@ export default {
settingList
().
then
(
res
=>
{
settingList
().
then
(
res
=>
{
const
lists
=
res
.
data
const
lists
=
res
.
data
lists
.
forEach
(
item
=>
{
lists
.
forEach
(
item
=>
{
const
key
=
item
.
typeId
const
key
=
item
.
typeId
+
''
if
(
!
Object
.
keys
(
temp_setting_data
).
includes
(
key
))
{
if
(
!
Object
.
keys
(
temp_setting_data
).
includes
(
key
))
{
temp_setting_data
[
key
]
=
[]
temp_setting_data
[
key
]
=
[]
}
}
...
...
frontend/src/views/system/SysParam/index.vue
浏览文件 @
5ce64f0d
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
<basic-setting
/>
<basic-setting
/>
</el-tab-pane>
</el-tab-pane>
<
!--
<
el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"first"
>
<el-tab-pane
:lazy=
"true"
:label=
"$t('system_parameter_setting.mailbox_service_settings')"
name=
"first"
>
<email-setting
/>
<email-setting
/>
</el-tab-pane>
-->
</el-tab-pane>
<el-tab-pane
v-if=
"isPluginLoaded"
:lazy=
"true"
:label=
"$t('sysParams.display')"
name=
"second"
>
<el-tab-pane
v-if=
"isPluginLoaded"
:lazy=
"true"
:label=
"$t('sysParams.display')"
name=
"second"
>
<plugin-com
v-if=
"isPluginLoaded"
ref=
"DisplaySetting"
component-name=
"DisplaySetting"
/>
<plugin-com
v-if=
"isPluginLoaded"
ref=
"DisplaySetting"
component-name=
"DisplaySetting"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论