feat(X-Pack): 定时报告

This commit is contained in:
fit2cloud-chenyw 2024-04-23 15:30:03 +08:00
parent a073b58a5e
commit 629eeac898
28 changed files with 450 additions and 260 deletions

View File

@ -1,6 +1,6 @@
package io.dataease.commons.utils;
import io.dataease.task.dao.auto.entity.CoreSysTask;
import io.dataease.utils.LogUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.quartz.CronExpression;
import org.quartz.CronScheduleBuilder;
@ -12,19 +12,9 @@ import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @author song.tianyang
* @Date 2020/12/17 4:06 下午
* @Description CRON解析类
*/
public class CronUtils {
/**
* 解析表达式获取CronTrigger
*
* @param cron
* @return
*/
public static CronTrigger getCronTrigger(String cron) {
if (!CronExpression.isValidExpression(cron)) {
throw new RuntimeException("cron :" + cron + "表达式解析错误");
@ -32,28 +22,6 @@ public class CronUtils {
return TriggerBuilder.newTrigger().withIdentity("Calculate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
}
/**
* 获取以指定时间为开始时间的下一次执行时间
*
* @param cron
* @param start
* @return
*/
public static Date getNextTriggerTime(String cron, Date start) {
if (start == null) {
return getNextTriggerTime(cron);
} else {
CronTrigger trigger = getCronTrigger(cron);
return trigger.getFireTimeAfter(start);
}
}
/**
* 获取以当前日期为准的下一次执行时间
*
* @param cron
* @return
*/
public static Date getNextTriggerTime(String cron) {
Date date = null;
try {
@ -61,38 +29,39 @@ public class CronUtils {
Date startDate = trigger.getStartTime();
date = trigger.getFireTimeAfter(startDate);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
}
return date;
}
public static String cron(CoreSysTask taskEntity) {
if (taskEntity.getRateType() == -1) {
return taskEntity.getRateVal();
public static String cron(Integer rateType, String rateVal) {
if (rateType == 0) {
return rateVal;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = sdf.parse(taskEntity.getRateVal());
date = sdf.parse(rateVal);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar instance = Calendar.getInstance();
assert date != null;
instance.setTime(date);
if (taskEntity.getRateType() == 0) {
if (rateType == 1) {
return instance.get(Calendar.SECOND) + " " +
instance.get(Calendar.MINUTE) + " " +
instance.get(Calendar.HOUR_OF_DAY) + " * * ?";
}
if (taskEntity.getRateType() == 1) {
if (rateType == 2) {
return instance.get(Calendar.SECOND) + " " +
instance.get(Calendar.MINUTE) + " " +
instance.get(Calendar.HOUR_OF_DAY) + " ? * " +
getDayOfWeek(instance);
}
if (taskEntity.getRateType() == 2) {
if (rateType == 3) {
return instance.get(Calendar.SECOND) + " " +
instance.get(Calendar.MINUTE) + " " +
instance.get(Calendar.HOUR_OF_DAY) + " " +
@ -102,13 +71,6 @@ public class CronUtils {
return null;
}
public static String cron() {
Calendar instance = Calendar.getInstance();
instance.add(Calendar.SECOND, 5);
return instance.get(Calendar.SECOND) + " " +
instance.get(Calendar.MINUTE) + " " +
instance.get(Calendar.HOUR_OF_DAY) + " * * ?";
}
private static String getDayOfWeek(Calendar instance) {
int index = instance.get(Calendar.DAY_OF_WEEK);
@ -120,7 +82,7 @@ public class CronUtils {
public static Boolean taskExpire(Long endTime) {
if (ObjectUtils.isEmpty(endTime))
return false;
Long now = System.currentTimeMillis();
long now = System.currentTimeMillis();
return now > endTime;
}

View File

@ -18,11 +18,9 @@ import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.datasource.request.EngineRequest;
import io.dataease.datasource.server.DatasourceServer;
import io.dataease.datasource.server.DatasourceTaskServer;
import io.dataease.datasource.server.EngineServer;
import io.dataease.exception.DEException;
import io.dataease.job.sechedule.ExtractDataJob;
import io.dataease.job.sechedule.ScheduleManager;
import io.dataease.utils.JsonUtil;
import io.dataease.job.schedule.ExtractDataJob;
import io.dataease.job.schedule.ScheduleManager;
import io.dataease.utils.LogUtil;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.StringUtils;

View File

@ -35,8 +35,8 @@ import io.dataease.datasource.request.DatasourceRequest;
import io.dataease.engine.constant.SQLConstants;
import io.dataease.exception.DEException;
import io.dataease.i18n.Translator;
import io.dataease.job.sechedule.CheckDsStatusJob;
import io.dataease.job.sechedule.ScheduleManager;
import io.dataease.job.schedule.CheckDsStatusJob;
import io.dataease.job.schedule.ScheduleManager;
import io.dataease.license.config.XpackInteract;
import io.dataease.log.DeLog;
import io.dataease.model.BusiNodeRequest;

View File

@ -1,11 +1,13 @@
package io.dataease.job.sechedule;
package io.dataease.job.schedule;
import io.dataease.datasource.server.DatasourceServer;
import io.dataease.utils.CommonBeanFactory;
import io.dataease.utils.LogUtil;
import jakarta.annotation.Resource;
import org.quartz.*;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;
@Component

View File

@ -1,4 +1,4 @@
package io.dataease.job.sechedule;
package io.dataease.job.schedule;
import io.dataease.utils.LogUtil;
import org.quartz.*;

View File

@ -0,0 +1,45 @@
package io.dataease.job.schedule;
import io.dataease.commons.utils.CronUtils;
import io.dataease.license.config.XpackInteract;
import jakarta.annotation.Resource;
import org.apache.commons.lang3.ObjectUtils;
import org.quartz.JobDataMap;
import org.quartz.JobKey;
import org.quartz.TriggerKey;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class DeTaskExecutor {
@Resource
private ScheduleManager scheduleManager;
@XpackInteract(value = "xpackTaskExecutor", replace = true)
public boolean execute(Long taskId) {
return false;
}
public void addOrUpdateTask(Long taskId, String cron, Long startTime, Long endTime) {
if (CronUtils.taskExpire(endTime)) {
return;
}
String key = taskId.toString();
JobKey jobKey = new JobKey(key, key);
TriggerKey triggerKey = new TriggerKey(key, key);
JobDataMap jobDataMap = new JobDataMap();
jobDataMap.put("taskId", taskId);
Date end = null;
if (ObjectUtils.isNotEmpty(endTime)) end = new Date(endTime);
scheduleManager.addOrUpdateCronJob(jobKey, triggerKey, DeXpackScheduleJob.class, cron, new Date(startTime), end, jobDataMap);
}
public void removeTask(Long taskId) {
String key = taskId.toString();
JobKey jobKey = new JobKey(key);
TriggerKey triggerKey = new TriggerKey(key);
scheduleManager.removeJob(jobKey, triggerKey);
}
}

View File

@ -0,0 +1,24 @@
package io.dataease.job.schedule;
import io.dataease.utils.CommonBeanFactory;
import jakarta.annotation.Resource;
import org.quartz.*;
import org.springframework.stereotype.Component;
import java.util.Objects;
@Component
public class DeXpackScheduleJob implements Job {
@Resource
private DeTaskExecutor deTaskExecutor;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
Trigger trigger = jobExecutionContext.getTrigger();
JobKey jobKey = trigger.getJobKey();
JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
Long taskId = jobDataMap.getLong("taskId");
if (!deTaskExecutor.execute(taskId)) {
Objects.requireNonNull(CommonBeanFactory.getBean(ScheduleManager.class)).removeJob(jobKey, trigger.getKey());
}
}
}

View File

@ -1,14 +1,13 @@
package io.dataease.job.sechedule;
package io.dataease.job.schedule;
import io.dataease.datasource.manage.DatasourceSyncManage;
import io.dataease.datasource.server.DatasourceServer;
import io.dataease.utils.CommonBeanFactory;
import org.quartz.JobExecutionContext;
import org.springframework.stereotype.Component;
@Component
public class ExtractDataJob extends DeScheduleJob{
public class ExtractDataJob extends DeScheduleJob {
private DatasourceSyncManage datasourceSyncManage;
public ExtractDataJob() {

View File

@ -1,4 +1,4 @@
package io.dataease.job.sechedule;
package io.dataease.job.schedule;
import com.fit2cloud.quartz.anno.QuartzScheduled;
import io.dataease.datasource.server.DatasourceServer;
@ -6,7 +6,6 @@ import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
@Component
public class Schedular {

View File

@ -1,4 +1,4 @@
package io.dataease.job.sechedule;
package io.dataease.job.schedule;
import io.dataease.exception.DEException;
@ -8,7 +8,6 @@ import jakarta.annotation.Resource;
import org.quartz.*;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -31,7 +30,7 @@ public class ScheduleManager {
* @throws SchedulerException
*/
public void addSimpleJob(JobKey jobKey, TriggerKey triggerKey, Class<? extends Job> cls, int repeatIntervalTime,
JobDataMap jobDataMap) throws SchedulerException {
JobDataMap jobDataMap) throws SchedulerException {
JobBuilder jobBuilder = JobBuilder.newJob(cls).withIdentity(jobKey);
@ -64,7 +63,7 @@ public class ScheduleManager {
* @param jobDataMap
*/
public void addCronJob(JobKey jobKey, TriggerKey triggerKey, Class jobClass, String cron, Date startTime,
Date endTime, JobDataMap jobDataMap) {
Date endTime, JobDataMap jobDataMap) {
try {
LogUtil.info("addCronJob: " + triggerKey.getName() + "," + triggerKey.getGroup());
@ -105,7 +104,7 @@ public class ScheduleManager {
}
public void addCronJob(JobKey jobKey, TriggerKey triggerKey, Class jobClass, String cron, Date startTime,
Date endTime) {
Date endTime) {
addCronJob(jobKey, triggerKey, jobClass, cron, startTime, endTime, null);
}
@ -315,7 +314,7 @@ public class ScheduleManager {
* @throws SchedulerException
*/
public void addOrUpdateSimpleJob(JobKey jobKey, TriggerKey triggerKey, Class clz,
int intervalTime, JobDataMap jobDataMap) throws SchedulerException {
int intervalTime, JobDataMap jobDataMap) throws SchedulerException {
if (scheduler.checkExists(triggerKey)) {
modifySimpleJobTime(triggerKey, intervalTime);
@ -326,20 +325,20 @@ public class ScheduleManager {
}
public void addOrUpdateSingleJob(JobKey jobKey, TriggerKey triggerKey, Class clz,
Date date, JobDataMap jobDataMap) throws DEException {
Date date, JobDataMap jobDataMap) throws DEException {
try {
if (scheduler.checkExists(triggerKey)) {
modifySingleJobTime(triggerKey, date);
} else {
addSingleJob(jobKey, triggerKey, clz, date, jobDataMap);
}
}catch (Exception e){
} catch (Exception e) {
DEException.throwException(e);
}
}
public void addOrUpdateSingleJob(JobKey jobKey, TriggerKey triggerKey, Class clz,
Date date) throws SchedulerException {
Date date) throws SchedulerException {
addOrUpdateSingleJob(jobKey, triggerKey, clz, date, null);
}
@ -359,7 +358,7 @@ public class ScheduleManager {
* @throws SchedulerException
*/
public void addOrUpdateCronJob(JobKey jobKey, TriggerKey triggerKey, Class jobClass, String cron, Date startTime,
Date endTime, JobDataMap jobDataMap) throws DEException {
Date endTime, JobDataMap jobDataMap) throws DEException {
LogUtil.info("AddOrUpdateCronJob: " + jobKey.getName() + "," + triggerKey.getGroup());
try {
@ -368,13 +367,13 @@ public class ScheduleManager {
} else {
addCronJob(jobKey, triggerKey, jobClass, cron, startTime, endTime, jobDataMap);
}
}catch (Exception e){
} catch (Exception e) {
DEException.throwException(e);
}
}
public void addOrUpdateCronJob(JobKey jobKey, TriggerKey triggerKey, Class jobClass, String cron, Date startTime,
Date endTime) throws SchedulerException {
Date endTime) throws SchedulerException {
addOrUpdateCronJob(jobKey, triggerKey, jobClass, cron, startTime, endTime, null);
}

View File

@ -1,167 +0,0 @@
package io.dataease.task.dao.auto.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author fit2cloud
* @since 2023-04-12
*/
@TableName("core_sys_task")
public class CoreSysTask implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 任务ID
*/
@TableId(value = "task_id", type = IdType.AUTO)
private Long taskId;
/**
* 任务名称
*/
private String taskName;
/**
* 任务类型
*/
private String taskType;
/**
* 开始时间
*/
private Long startTime;
/**
* 结束时间
*/
private Long endTime;
/**
* 频率方式
*/
private Integer rateType;
/**
* 频率值
*/
private String rateVal;
/**
* 创建者ID
*/
private Long creator;
/**
* 创建时间
*/
private Long createTime;
/**
* 运行状态
*/
private Boolean status;
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public Integer getRateType() {
return rateType;
}
public void setRateType(Integer rateType) {
this.rateType = rateType;
}
public String getRateVal() {
return rateVal;
}
public void setRateVal(String rateVal) {
this.rateVal = rateVal;
}
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
@Override
public String toString() {
return "CoreSysTask{" +
"taskId = " + taskId +
", taskName = " + taskName +
", taskType = " + taskType +
", startTime = " + startTime +
", endTime = " + endTime +
", rateType = " + rateType +
", rateVal = " + rateVal +
", creator = " + creator +
", createTime = " + createTime +
", status = " + status +
"}";
}
}

View File

@ -1,16 +0,0 @@
package io.dataease.task.dao.auto.mapper;
import io.dataease.task.dao.auto.entity.CoreSysTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author fit2cloud
* @since 2023-04-12
*/
public interface CoreSysTaskMapper extends BaseMapper<CoreSysTask> {
}

View File

@ -18,6 +18,7 @@ i18n_menu.datasource=\u6570\u636E\u6E90
i18n_menu.user=\u7528\u6237\u7BA1\u7406
i18n_menu.org=\u7EC4\u7EC7\u7BA1\u7406
i18n_menu.auth=\u6743\u9650\u914D\u7F6E
i18n_menu.report=\u5B9A\u65F6\u62A5\u544A
i18n_menu.sync=\u540C\u6B65\u7BA1\u7406
i18n_menu.summary=\u6982\u89C8
i18n_menu.ds=\u6570\u636E\u8FDE\u63A5\u7BA1\u7406

View File

@ -0,0 +1,7 @@
<svg width="19" height="20" viewBox="0 0 19 20" fill="" xmlns="http://www.w3.org/2000/svg">
<path d="M15.4224 1.07745C15.5787 1.23373 15.6665 1.44569 15.6665 1.66671V8.33337H13.9998V2.50004H2.33317V17.5H6.49984V19.1667H1.49984C1.27882 19.1667 1.06686 19.0789 0.910582 18.9226C0.754301 18.7663 0.666504 18.5544 0.666504 18.3334V1.66671C0.666504 1.44569 0.754301 1.23373 0.910582 1.07745C1.06686 0.921172 1.27882 0.833374 1.49984 0.833374H14.8332C15.0542 0.833374 15.2661 0.921172 15.4224 1.07745Z" fill=""/>
<path d="M4.4165 5.00004C4.18638 5.00004 3.99984 5.18659 3.99984 5.41671V6.25004C3.99984 6.48016 4.18639 6.66671 4.4165 6.66671H11.9165C12.1466 6.66671 12.3332 6.48016 12.3332 6.25004V5.41671C12.3332 5.18659 12.1466 5.00004 11.9165 5.00004H4.4165Z" fill=""/>
<path d="M3.99984 8.75004C3.99984 8.51992 4.18638 8.33337 4.4165 8.33337H7.74984C7.97996 8.33337 8.1665 8.51992 8.1665 8.75004V9.58337C8.1665 9.81349 7.97996 10 7.74984 10H4.4165C4.18638 10 3.99984 9.81349 3.99984 9.58337V8.75004Z" fill=""/>
<path d="M13.8187 14.3479H15.3495C15.4646 14.3479 15.5578 14.4411 15.5578 14.5562V15.4439C15.5578 15.5589 15.4646 15.6522 15.3495 15.6522H12.7227C12.6076 15.6522 12.5143 15.5589 12.5143 15.4439V12.8171C12.5143 12.702 12.6076 12.6087 12.7227 12.6087H13.6104C13.7254 12.6087 13.8187 12.702 13.8187 12.8171V14.3479Z" fill=""/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.1665 15C8.1665 17.7613 10.4052 20 13.1665 20C15.9278 20 18.1665 17.7613 18.1665 15C18.1665 12.2387 15.9278 10 13.1665 10C10.4052 10 8.1665 12.2387 8.1665 15ZM15.5235 17.3571C14.8984 17.9822 14.0506 18.3334 13.1665 18.3334C12.2825 18.3334 11.4346 17.9822 10.8095 17.3571C10.1844 16.7319 9.83317 15.8841 9.83317 15C9.83317 14.116 10.1844 13.2681 10.8095 12.643C11.4346 12.0179 12.2825 11.6667 13.1665 11.6667C14.0506 11.6667 14.8984 12.0179 15.5235 12.643C16.1487 13.2681 16.4998 14.116 16.4998 15C16.4998 15.8841 16.1487 16.7319 15.5235 17.3571Z" fill=""/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -2242,5 +2242,42 @@ export default {
appearance: {
give_up: '放弃更新',
save_apply: '保存并应用'
},
report: {
title: '定时报告',
task_name: '任务名称',
last_exec_time: '上次执行时间',
last_exec_result: '上次执行结果',
task_status: '任务状态',
next_exec_time: '下次执行时间',
creator: '创建人',
create_time: '创建时间',
status_wait: '等待发送',
status_stop: '任务停止',
status_finish: '任务结束',
status_send: '发送中',
search_tips: '通过任务名称搜索',
report_title: '任务列表',
instance_title: '任务日志',
add_task: '添加任务',
lark_groups: '飞书群',
send_setting: '发送设置',
start_time: '开始时间',
end_time: '结束时间',
once_a_day: '每天',
once_a_week: '每周',
once_a_month: '每月',
week_mon: '一',
week_tue: '二',
week_wed: '三',
week_thu: '四',
week_fri: '五',
week_sat: '六',
week_sun: '日',
every_exec: '执行一次',
date: '日',
last_status_running: '运行中',
last_status_fail: '失败',
last_status_success: '成功'
}
}

@ -1 +1 @@
Subproject commit fb7d5598b6c23469dac21c5cefc4d388c27236fc
Subproject commit 22e8ad631b05f078920385f440ae97561fa8c351

View File

@ -0,0 +1,13 @@
version: '2.1'
services:
de-selenium:
image: selenium/standalone-chrome:latest
container_name: de-selenium
shm_size: 2gb
environment:
- SE_START_XVFB=false
- SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true
ports:
- "4444:4444"
networks:
- dataease-network

View File

@ -42,10 +42,17 @@
<flatten-maven.version>1.3.0</flatten-maven.version>
<maven.resources.version>3.3.1</maven.resources.version>
<maven.exec.version>3.1.0</maven.exec.version>
<guava.version>31.1-jre</guava.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
@ -106,6 +113,7 @@
<artifactId>easyexcel</artifactId>
<version>${easyexcel.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@ -0,0 +1,73 @@
package io.dataease.api.report;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.api.report.dto.*;
import io.dataease.api.report.vo.ReportGridVO;
import io.dataease.api.report.vo.ReportInstanceVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@Tag(name = "定时报告")
@ApiSupport(order = 888, author = "fit2cloud-someone")
public interface ReportApi {
@Operation(summary = "查询报告列表")
@Parameters({
@Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH),
@Parameter(name = "pageSize", description = "每页容量", required = true, in = ParameterIn.PATH),
@Parameter(name = "request", description = "过滤条件", required = true)
})
@PostMapping("/pager/{goPage}/{pageSize}")
IPage<ReportGridVO> pager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody ReportGridRequest request);
@Operation(summary = "创建任务")
@PostMapping("/create")
void create(@RequestBody ReportCreator creator);
@Operation(summary = "更新任务")
@PostMapping("/update")
void update(@RequestBody ReportEditor editor);
@Operation(summary = "立即运行")
@PostMapping("/fireNow/{taskId}")
void fireNow(@PathVariable("taskId") Long taskId);
@Operation(summary = "停止")
@PostMapping("/stop/{taskId}")
void stopNow(@PathVariable("taskId") Long taskId);
@Operation(summary = "删除")
@PostMapping("/delete")
void delete(@RequestBody List<Long> taskIdList);
@Operation(summary = "查询详情")
@GetMapping("/info/{taskId}")
ReportEditor info(@PathVariable("taskId") Long taskId);
@Operation(summary = "查询日志列表")
@Parameters({
@Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH),
@Parameter(name = "pageSize", description = "每页容量", required = true, in = ParameterIn.PATH),
@Parameter(name = "request", description = "过滤条件", required = true)
})
@PostMapping("/logPager/{goPage}/{pageSize}")
IPage<ReportInstanceVO> pager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody ReportInstanceRequest request);
@Operation(summary = "删除日志")
@PostMapping("/deleteLog")
void deleteInstance(@RequestBody ReportInstanceDelRequest request);
@GetMapping("/logMsg")
String logMsg(@RequestBody ReportInstanceMsgRequest request);
}

View File

@ -0,0 +1,54 @@
package io.dataease.api.report.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
public class ReportCreator implements Serializable {
@Serial
private static final long serialVersionUID = 376997744239219719L;
private String name;
private String title;
private String content;
private Integer rtid;
@JsonSerialize(using= ToStringSerializer.class)
private Long rid;
private Integer format;
private List<Long> viewIdList;
private Integer viewDataRange;
private String pixel;
private List<Integer> reciFlagList;
private List<Long> uidList;
private List<Long> ridList;
private List<String> emailList;
private List<String> larkGroupList;
private Integer extWaitTime;
private Integer rateType;
private String rateVal;
private Long startTime;
private Long endTime;
}

View File

@ -0,0 +1,19 @@
package io.dataease.api.report.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
@EqualsAndHashCode(callSuper = true)
@Data
public class ReportEditor extends ReportCreator{
@Serial
private static final long serialVersionUID = 4580864230335912932L;
@JsonSerialize(using= ToStringSerializer.class)
private Long taskId;
}

View File

@ -0,0 +1,25 @@
package io.dataease.api.report.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
public class ReportGridRequest implements Serializable {
@Serial
private static final long serialVersionUID = 3478936079850972546L;
private List<Long> uidList;
private List<Integer> lastStatusList;
private List<Integer> statusList;
private List<Long> timeList;
private String keyword;
private Boolean timeDesc;
}

View File

@ -0,0 +1,16 @@
package io.dataease.api.report.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class ReportInstanceDelRequest implements Serializable {
@Serial
private static final long serialVersionUID = 3972312402268432597L;
private Long instanceId;
private Integer timeFlag;
}

View File

@ -0,0 +1,16 @@
package io.dataease.api.report.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class ReportInstanceMsgRequest implements Serializable {
@Serial
private static final long serialVersionUID = 7192222037770564561L;
private Long taskId;
private Long instanceId;
}

View File

@ -0,0 +1,21 @@
package io.dataease.api.report.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
public class ReportInstanceRequest implements Serializable {
@Serial
private static final long serialVersionUID = 6928403022356816279L;
private Long taskId;
private List<Integer> execStatusList;
private List<Long> timeList;
private String keyword;
}

View File

@ -0,0 +1,31 @@
package io.dataease.api.report.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class ReportGridVO implements Serializable {
@Serial
private static final long serialVersionUID = -5178055146669970633L;
@JsonSerialize(using= ToStringSerializer.class)
private Long id;
private String name;
private Long lastExecTime;
private Integer lastExecStatus;
private Integer status;
private Long nextExecTime;
private String creator;
private Long createTime;
}

View File

@ -0,0 +1,20 @@
package io.dataease.api.report.vo;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data
public class ReportInstanceVO implements Serializable {
@Serial
private static final long serialVersionUID = -7845204306008848053L;
private Long id;
private String name;
private Long startTime;
private Integer execStatus;
}

View File

@ -79,6 +79,10 @@ public interface UserApi {
@PostMapping("/role/option")
List<UserItemVO> optionForRole(@RequestBody UserRequest request);
@Operation(summary = "组织内用户")
@GetMapping("/org/option")
List<UserItemVO> optionForOrg();
@Operation(summary = "角色已绑用户")
@Parameters({
@Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH),