From 4b4e8c0d9d30ec26e413e6ea1770e9014c67ae0e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 19 Aug 2022 10:52:56 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86):=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=A2=9E=E5=8A=A0=E8=AF=A6=E6=83=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/DataSetTableTaskController.java | 7 +++++++ .../dataset/DataSetTableTaskService.java | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java index 98d355e1ce..29d3b4547e 100644 --- a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java +++ b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableTaskController.java @@ -90,4 +90,11 @@ public class DataSetTableTaskController { dataSetTableTaskService.execTask(datasetTableTask); } + + @ApiOperation("详情") + @PostMapping("detail/{id}") + public DataSetTaskDTO detail(@PathVariable("id") String id) { + return dataSetTableTaskService.detail(id); + } + } diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java index fdb1d430da..9c289354aa 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskService.java @@ -24,6 +24,7 @@ import org.quartz.CronExpression; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PathVariable; import javax.annotation.Resource; import java.util.*; @@ -333,4 +334,21 @@ public class DataSetTableTaskService { scheduleService.fireNow(datasetTableTask); } } + + public DataSetTaskDTO detail(String id) { + BaseGridRequest request = new BaseGridRequest(); + List conditionEntities = request.getConditions() == null ? new ArrayList<>() : new ArrayList(request.getConditions()); + ConditionEntity entity = new ConditionEntity(); + entity.setField("dataset_table_task.id"); + entity.setOperator("eq"); + entity.setValue(id); + conditionEntities.add(entity); + request.setConditions(conditionEntities); + GridExample gridExample = request.convertExample(); + List dataSetTaskDTOS = extDataSetTaskMapper.taskList(gridExample); + if (CollectionUtils.isNotEmpty(dataSetTaskDTOS)) { + return dataSetTaskDTOS.get(0); + } + return null; + } }