feat:自定义样式,email

This commit is contained in:
wangjiahao 2021-02-25 16:31:09 +08:00
parent c5f53f5ff3
commit b96f4bb7c5
5 changed files with 15 additions and 58 deletions

View File

@ -129,11 +129,11 @@
<artifactId>commons-codec</artifactId>
</dependency>
<!--<dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.72</version>
</dependency>-->
</dependency>
<!-- openapi -->
<dependency>

View File

@ -1,47 +0,0 @@
package io.dataease.notice.sender.impl;
import com.dingtalk.api.DefaultDingTalkClient;
import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiRobotSendRequest;
import com.taobao.api.ApiException;
import io.dataease.commons.utils.LogUtil;
import io.dataease.notice.domain.MessageDetail;
import io.dataease.notice.sender.AbstractNoticeSender;
import io.dataease.notice.sender.NoticeModel;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class DingNoticeSender extends AbstractNoticeSender {
public void sendNailRobot(MessageDetail messageDetail, String context) {
List<String> userIds = messageDetail.getUserIds();
if (CollectionUtils.isEmpty(userIds)) {
return;
}
DingTalkClient client = new DefaultDingTalkClient(messageDetail.getWebhook());
OapiRobotSendRequest request = new OapiRobotSendRequest();
request.setMsgtype("text");
OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text();
text.setContent(context);
request.setText(text);
OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
List<String> phoneList = super.getUserPhones(userIds);
LogUtil.info("收件人地址: " + phoneList);
at.setAtMobiles(phoneList);
request.setAt(at);
try {
client.execute(request);
} catch (ApiException e) {
LogUtil.error(e.getMessage(), e);
}
}
@Override
public void send(MessageDetail messageDetail, NoticeModel noticeModel) {
String context = super.getContext(messageDetail, noticeModel);
sendNailRobot(messageDetail, context);
}
}

View File

@ -1,13 +1,12 @@
package io.dataease.notice.service;
import com.alibaba.nacos.client.utils.StringUtils;
import io.dataease.commons.constants.NoticeConstants;
import io.dataease.notice.domain.MessageDetail;
import io.dataease.notice.sender.NoticeModel;
import io.dataease.notice.sender.NoticeSender;
import io.dataease.notice.sender.impl.DingNoticeSender;
import io.dataease.notice.sender.impl.MailNoticeSender;
import io.dataease.notice.sender.impl.WeComNoticeSender;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -19,8 +18,7 @@ public class NoticeSendService {
private MailNoticeSender mailNoticeSender;
@Resource
private WeComNoticeSender weComNoticeSender;
@Resource
private DingNoticeSender dingNoticeSender;
@Resource
private NoticeService noticeService;
@ -33,9 +31,9 @@ public class NoticeSendService {
case NoticeConstants.Type.WECHAT_ROBOT:
noticeSender = weComNoticeSender;
break;
case NoticeConstants.Type.NAIL_ROBOT:
noticeSender = dingNoticeSender;
break;
// case NoticeConstants.Type.NAIL_ROBOT:
// noticeSender = dingNoticeSender;
// break;
default:
break;
}

View File

@ -1,6 +1,5 @@
package io.dataease.service.chart;
import com.alibaba.nacos.common.util.UuidUtils;
import io.dataease.base.domain.ChartGroup;
import io.dataease.base.domain.ChartGroupExample;
import io.dataease.base.mapper.ChartGroupMapper;
@ -14,6 +13,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@ -24,7 +24,7 @@ public class ChartGroupService {
public ChartGroupDTO save(ChartGroup chartGroup) {
if (StringUtils.isEmpty(chartGroup.getId())) {
chartGroup.setId(UuidUtils.generateUuid());
chartGroup.setId(UUID.randomUUID().toString());
chartGroup.setCreateTime(System.currentTimeMillis());
chartGroupMapper.insert(chartGroup);
} else {

View File

@ -0,0 +1,6 @@
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.favicon', NULL, 'file', 6);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.loginImage', NULL, 'file', 3);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.loginLogo', NULL, 'file', 2);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.loginTitle', '', 'text', 4);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.logo', NULL, 'file', 1);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.title', '', 'text', 5);