Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong
2022-08-22 16:26:36 +08:00
10 changed files with 177 additions and 71 deletions

View File

@@ -176,6 +176,23 @@ public class XEmailTaskServer {
}
}
@RequiresPermissions("task-email:del")
@PostMapping("/batchDel")
public void delete(@RequestBody List<Long> taskIds) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
try {
taskIds.forEach(taskId -> {
XpackEmailTaskRequest request = emailXpackService.taskForm(taskId);
GlobalTaskEntity globalTaskEntity = BeanUtils.copyBean(new GlobalTaskEntity(), request);
scheduleService.deleteSchedule(globalTaskEntity);
});
emailXpackService.batchDel(taskIds);
} catch (Exception e) {
LogUtil.error(e);
DEException.throwException(e);
}
}
@PostMapping("/stop/{taskId}")
public void stop(@PathVariable Long taskId) throws Exception {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);

View File

@@ -8,14 +8,17 @@ import io.dataease.controller.sys.response.BasicInfo;
import io.dataease.dto.SystemParameterDTO;
import io.dataease.exception.DataEaseException;
import io.dataease.plugins.common.base.domain.FileMetadata;
import io.dataease.plugins.common.base.domain.SysParamAssist;
import io.dataease.plugins.common.base.domain.SystemParameter;
import io.dataease.plugins.common.base.domain.SystemParameterExample;
import io.dataease.plugins.common.base.mapper.SystemParameterMapper;
import io.dataease.plugins.config.SpringContextUtil;
import io.dataease.plugins.xpack.cas.dto.CasSaveResult;
import io.dataease.plugins.xpack.cas.service.CasXpackService;
import io.dataease.plugins.xpack.display.service.DisplayXpackService;
import io.dataease.service.FileService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -26,6 +29,7 @@ import javax.annotation.Resource;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
@@ -231,6 +235,20 @@ public class SystemParameterService {
systemParameterDTO.setFileName(fileMetadata.getName());
}
}
if (systemParameter.getType().equalsIgnoreCase("blob")) {
Map<String, DisplayXpackService> beansOfType = SpringContextUtil.getApplicationContext().getBeansOfType((DisplayXpackService.class));
DisplayXpackService displayXpackService = null;
if (beansOfType.keySet().size() > 0 && (displayXpackService = SpringContextUtil.getBean(DisplayXpackService.class)) != null) {
String paramValue = systemParameter.getParamValue();
if (StringUtils.isNotBlank(paramValue)) {
long blobId = Long.parseLong(paramValue);
String content = displayXpackService.readBlob(blobId);
systemParameterDTO.setParamValue(content);
}
} else {
systemParameterDTO.setParamValue(null);
}
}
dtoList.add(systemParameterDTO);
}
dtoList.sort(Comparator.comparingInt(SystemParameter::getSort));

View File

@@ -22,3 +22,16 @@ INSERT INTO `sys_menu` VALUES (750, 2, 0, 2, '导入用户', NULL, NULL, 999, NU
update system_parameter set sort = (sort + 1) where sort > 3;
update system_parameter set sort = 4 where param_key = 'ui.favicon'
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.showFoot', NULL, 'text', 18);
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.footContent', NULL, 'blob', 19);
CREATE TABLE IF NOT EXISTS `sys_param_assist` (
`id` BIGINT(21) NOT NULL AUTO_INCREMENT,
`content` MEDIUMBLOB COMMENT '内容',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `sys_task_email`
MODIFY COLUMN `view_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '关联视图' AFTER `task_id`;