Merge pull request #3078 from dataease/pr@dev@perf_email_task_channel

perf(系统管理-定时报告): 增加消息渠道
This commit is contained in:
fit2cloud-chenyw 2022-09-14 17:13:06 +08:00 committed by GitHub
commit c93dd1c59d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 21 deletions

View File

@ -68,7 +68,8 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/**/*.json", ANON);
filterChainDefinitionMap.put("/system/ui/**", ANON);
filterChainDefinitionMap.put("/system/file/**", ANON);
filterChainDefinitionMap.put("/system/filedown/**", ANON);
filterChainDefinitionMap.put("/system/showpicture/**", ANON);
filterChainDefinitionMap.put("/**/*.js", ANON);
filterChainDefinitionMap.put("/**/*.css", ANON);
filterChainDefinitionMap.put("/**/*.map", ANON);

View File

@ -1,6 +1,6 @@
package io.dataease.controller.sys;
import io.dataease.plugins.common.base.domain.FileMetadata;
import io.dataease.plugins.common.base.domain.SystemParameter;
import io.dataease.commons.constants.ParamConstants;
import io.dataease.controller.sys.response.BasicInfo;
@ -8,6 +8,7 @@ import io.dataease.controller.sys.response.MailInfo;
import io.dataease.dto.SystemParameterDTO;
import io.dataease.listener.DatasetCheckListener;
import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.util.GlobalFileUtil;
import io.dataease.plugins.xpack.cas.dto.CasSaveResult;
import io.dataease.service.FileService;
import io.dataease.service.system.EmailService;
@ -22,7 +23,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -108,21 +109,16 @@ public class SystemParameterController {
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
}
@GetMapping("/file/down/{fileId}/{fileName}")
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName) throws Exception{
@GetMapping("/filedown/{fileId}/{fileName}")
public ResponseEntity<ByteArrayResource> down(@PathVariable("fileId") String fileId, @PathVariable("fileName") String fileName) throws Exception {
FileMetadata fileMetadata = fileService.getFileMetadataById(fileId);
String type = fileMetadata.getType();
if (!StringUtils.endsWith(fileName.toUpperCase(), type.toUpperCase())) {
fileName += ("." + type);
}
byte[] bytes = fileService.loadFileAsBytes(fileId);
ByteArrayResource bar = new ByteArrayResource(bytes);
final HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
ContentDisposition contentDisposition = ContentDisposition.parse("attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
headers.setContentDisposition(contentDisposition);
return new ResponseEntity<>(bar, headers, HttpStatus.OK);
return GlobalFileUtil.down(fileId, fileName);
}
@GetMapping("/showpicture/{fileId}")
public ResponseEntity<byte[]> showPicture(@PathVariable("fileId") String fileId) throws Exception {
return GlobalFileUtil.showPicture(fileId);
}
@PostMapping(value = "/save/ui", consumes = {"multipart/form-data"})

View File

@ -2338,6 +2338,11 @@ export default {
panel: 'Panel',
content: 'Content',
recipients: 'Recipients',
recisetting: 'channel',
email: 'Email',
wecom: 'Wecom',
dingtalk: 'Dingtalk',
lark: 'Lark',
pixel: 'Pixel',
default: 'Default',
custom: 'Custom',

View File

@ -2335,10 +2335,15 @@ export default {
},
emailtask: {
title: '郵件主題',
title: '報告主題',
panel: '儀錶闆',
content: '郵件正文',
content: '報告正文',
recipients: '收件人',
recisetting: '接受設置',
email: '郵件',
wecom: '企業微信',
dingtalk: '釘釘',
lark: '飛書',
pixel: '分辨率',
default: '默認',
custom: '自定義',

View File

@ -2335,10 +2335,15 @@ export default {
},
emailtask: {
title: '邮件主题',
title: '报告主题',
panel: '仪表板',
content: '邮件正文',
content: '报告正文',
recipients: '收件人',
recisetting: '接受设置',
email: '邮件',
wecom: '企业微信',
dingtalk: '钉钉',
lark: '飞书',
pixel: '分辨率',
default: '默认',
custom: '自定义',