perf(系统管理-任务管理): 数据同步增加详情接口

This commit is contained in:
fit2cloud-chenyw 2022-08-19 10:52:56 +08:00
parent d7c56b520f
commit 4b4e8c0d9d
2 changed files with 25 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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<ConditionEntity> 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<DataSetTaskDTO> dataSetTaskDTOS = extDataSetTaskMapper.taskList(gridExample);
if (CollectionUtils.isNotEmpty(dataSetTaskDTOS)) {
return dataSetTaskDTOS.get(0);
}
return null;
}
}