|
@ -1,5 +1,6 @@
|
|
|
package com.yihu.ehr.datacollect.controller;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.ehr.common.Services;
|
|
|
import com.yihu.ehr.datacollect.model.RsJobConfig;
|
|
|
import com.yihu.ehr.datacollect.model.RsJobLog;
|
|
@ -7,10 +8,15 @@ import com.yihu.ehr.datacollect.service.intf.IDatacollectManager;
|
|
|
import com.yihu.ehr.datacollect.service.intf.IDatacollectService;
|
|
|
import com.yihu.ehr.framework.constrant.DateConvert;
|
|
|
import com.yihu.ehr.framework.model.ActionResult;
|
|
|
import com.yihu.ehr.framework.model.DictItem;
|
|
|
import com.yihu.ehr.framework.model.DictionaryResult;
|
|
|
import com.yihu.ehr.framework.model.Result;
|
|
|
import com.yihu.ehr.framework.util.controller.BaseController;
|
|
|
import com.yihu.ehr.framework.util.operator.CollectionUtil;
|
|
|
import com.yihu.ehr.resource.service.IStdService;
|
|
|
import com.yihu.ehr.standard.model.adapter.resultModel.SchemeResultDetailModel;
|
|
|
import com.yihu.ehr.standard.model.standard.StandardModel;
|
|
|
import com.yihu.ehr.standard.service.adapter.AdapterSchemeService;
|
|
|
import com.yihu.ehr.system.service.intf.IDatasourceManager;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
@ -19,6 +25,7 @@ import org.apache.commons.beanutils.PropertyUtils;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@ -45,14 +52,19 @@ public class DataCollectController extends BaseController {
|
|
|
@Resource(name = Services.Datasource)
|
|
|
IDatasourceManager datasource;
|
|
|
|
|
|
@Resource(name = AdapterSchemeService.BEAN_ID)
|
|
|
private AdapterSchemeService adapterSchemeService;
|
|
|
|
|
|
/**************************** 任务管理 ************************************************/
|
|
|
|
|
|
/****************************
|
|
|
* 任务管理
|
|
|
************************************************/
|
|
|
/*
|
|
|
任务配置
|
|
|
*/
|
|
|
@RequestMapping("configJob")
|
|
|
public String configJob(Model model) {
|
|
|
model.addAttribute("contentPage","/datacollect/configJob");
|
|
|
model.addAttribute("contentPage", "/datacollect/configJob");
|
|
|
return "partView";
|
|
|
}
|
|
|
|
|
@ -60,7 +72,7 @@ public class DataCollectController extends BaseController {
|
|
|
任务新增/编辑
|
|
|
*/
|
|
|
@RequestMapping("editorJob")
|
|
|
public String editorJob(Model model,String jobId) {
|
|
|
public String editorJob(Model model, String jobId) {
|
|
|
try {
|
|
|
//是否编辑
|
|
|
if (jobId != null && jobId.length() > 0) {
|
|
@ -74,13 +86,11 @@ public class DataCollectController extends BaseController {
|
|
|
//获取方案列表
|
|
|
List data = stdService.getSchemeVersion();
|
|
|
JSONArray jsonArray = JSONArray.fromObject(data);
|
|
|
model.addAttribute("schemeList", "{\"detailModelList\":"+(CollectionUtil.isEmpty(data)?"[]":jsonArray)+"}");
|
|
|
model.addAttribute("schemeList", "{\"detailModelList\":" + (CollectionUtil.isEmpty(data) ? "[]" : jsonArray) + "}");
|
|
|
|
|
|
model.addAttribute("contentPage", "/datacollect/editorJob");
|
|
|
return "pageView";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "/datacollect/editorJob");
|
|
|
return "pageView";
|
|
|
}
|
|
@ -91,14 +101,12 @@ public class DataCollectController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("getJob")
|
|
|
@ResponseBody
|
|
|
public Result getJob(String name,int page, int rows){
|
|
|
public Result getJob(String name, int page, int rows) {
|
|
|
try {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("name", name);
|
|
|
return datacollect.getJobList(map, page, rows);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -108,12 +116,10 @@ public class DataCollectController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("getSchemeDataset")
|
|
|
@ResponseBody
|
|
|
public Result getSchemeDataset(String schemeId,String schemeVersion,String jobId){
|
|
|
try{
|
|
|
return datacollect.getSchemeDataset(schemeId,schemeVersion, jobId);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
public Result getSchemeDataset(String schemeId, String schemeVersion, String jobId) {
|
|
|
try {
|
|
|
return datacollect.getSchemeDataset(schemeId, schemeVersion, jobId);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -123,12 +129,10 @@ public class DataCollectController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("getSchemeDatasetCol")
|
|
|
@ResponseBody
|
|
|
public Result getSchemeDatasetCol(String schemeId,String schemeVersion,String datasetId){
|
|
|
try{
|
|
|
public Result getSchemeDatasetCol(String schemeId, String schemeVersion, String datasetId) {
|
|
|
try {
|
|
|
return datacollect.getSchemeDatasetCol(schemeId, schemeVersion, datasetId);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -146,10 +150,8 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
String cron = request.getParameter("cronExpression");
|
|
|
String jobDataset = request.getParameter("jobDataset");
|
|
|
return datacollect.addJob(obj,cron,jobDataset);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
return datacollect.addJob(obj, cron, jobDataset);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error("新增任务失败!");
|
|
|
}
|
|
|
}
|
|
@ -167,10 +169,8 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
String cron = request.getParameter("cronExpression");
|
|
|
String jobDataset = request.getParameter("jobDataset");
|
|
|
return datacollect.updateJob(obj, cron,jobDataset);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
return datacollect.updateJob(obj, cron, jobDataset);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error("修改任务失败!");
|
|
|
}
|
|
|
}
|
|
@ -180,12 +180,10 @@ public class DataCollectController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("validJob")
|
|
|
@ResponseBody
|
|
|
public Result validJob(String jobId,String valid) {
|
|
|
public Result validJob(String jobId, String valid) {
|
|
|
try {
|
|
|
return datacollect.validJob(jobId, valid);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -198,57 +196,51 @@ public class DataCollectController extends BaseController {
|
|
|
public Result deleteJob(String jobId) {
|
|
|
try {
|
|
|
return datacollect.deleteJob(jobId);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取任务信息
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getJobInfo")
|
|
|
@ResponseBody
|
|
|
public Result getJobInfo(String jobId)
|
|
|
{
|
|
|
public Result getJobInfo(String jobId) {
|
|
|
try {
|
|
|
RsJobConfig job = datacollect.getJobById(jobId);
|
|
|
if(job!=null)
|
|
|
{
|
|
|
ActionResult re = new ActionResult(true,"");
|
|
|
if (job != null) {
|
|
|
ActionResult re = new ActionResult(true, "");
|
|
|
re.setData(job.getValid());
|
|
|
return re;
|
|
|
} else {
|
|
|
return new ActionResult(false, "非法操作!");
|
|
|
}
|
|
|
else{
|
|
|
return new ActionResult(false,"非法操作!");
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据任务Id获取相关数据集下拉数据
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getJobDatasetByJobId")
|
|
|
@ResponseBody
|
|
|
public Result getJobDatasetByJobId(String jobId)
|
|
|
{
|
|
|
public Result getJobDatasetByJobId(String jobId) {
|
|
|
try {
|
|
|
return datacollect.getJobDatasetByJobId(jobId);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/************************* 数据集--数据源管理 ******************************************/
|
|
|
/*************************
|
|
|
* 数据集--数据源管理
|
|
|
******************************************/
|
|
|
/*
|
|
|
数据集配置
|
|
|
*/
|
|
@ -263,9 +255,7 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
model.addAttribute("contentPage", "/datacollect/configDataset");
|
|
|
return "partView";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "error");
|
|
|
return "partView";
|
|
|
}
|
|
@ -273,6 +263,7 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 数据集数据源管理列表(包含全部数据集)
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getDatasetSource")
|
|
@ -280,26 +271,23 @@ public class DataCollectController extends BaseController {
|
|
|
public Result getDatasetSource(String stdVersion) {
|
|
|
try {
|
|
|
return datacollect.getDatasetSource(stdVersion);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 更新数据集数据源
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("saveDatasetSource")
|
|
|
@ResponseBody
|
|
|
public Result saveDatasetSource(String stdVersion,String json){
|
|
|
public Result saveDatasetSource(String stdVersion, String json) {
|
|
|
try {
|
|
|
|
|
|
return datacollect.saveDatasetSource(json);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -308,19 +296,18 @@ public class DataCollectController extends BaseController {
|
|
|
/*************************** 任务执行 ************************************************/
|
|
|
/**
|
|
|
* 执行任务
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("executeJob")
|
|
|
@ResponseBody
|
|
|
public Result executeJob(String jobId){
|
|
|
public Result executeJob(String jobId) {
|
|
|
try {
|
|
|
datacollectService.executeJob(jobId);
|
|
|
return Result.success("处理完成!");
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
@ -328,36 +315,30 @@ public class DataCollectController extends BaseController {
|
|
|
任务补采界面
|
|
|
*/
|
|
|
@RequestMapping("repeatDatacollect")
|
|
|
public String repeatDatacollect(Model model,String jobId,String jobDatasetId,String jobStatus,String jobTimeFrom,String jobTimeTo) {
|
|
|
public String repeatDatacollect(Model model, String jobId, String jobDatasetId, String jobStatus, String jobTimeFrom, String jobTimeTo) {
|
|
|
try {
|
|
|
|
|
|
model.addAttribute("jobId", jobId==null?"":jobId);
|
|
|
model.addAttribute("jobDatasetId", jobDatasetId==null?"":jobDatasetId);
|
|
|
model.addAttribute("jobStatus", jobStatus==null?"":jobStatus);
|
|
|
if(jobTimeFrom!=null&&jobTimeFrom.length()>0)
|
|
|
{
|
|
|
model.addAttribute("jobId", jobId == null ? "" : jobId);
|
|
|
model.addAttribute("jobDatasetId", jobDatasetId == null ? "" : jobDatasetId);
|
|
|
model.addAttribute("jobStatus", jobStatus == null ? "" : jobStatus);
|
|
|
if (jobTimeFrom != null && jobTimeFrom.length() > 0) {
|
|
|
Date timeFrom = DateConvert.toDate(jobTimeFrom);
|
|
|
model.addAttribute("jobTimeFrom", DateConvert.toString(timeFrom));
|
|
|
}
|
|
|
else{
|
|
|
GregorianCalendar gc=new GregorianCalendar();
|
|
|
} else {
|
|
|
GregorianCalendar gc = new GregorianCalendar();
|
|
|
gc.setTime(new Date());
|
|
|
gc.add(5, -7);
|
|
|
model.addAttribute("jobTimeFrom", DateConvert.toString(gc.getTime()));
|
|
|
}
|
|
|
if(jobTimeTo!=null&&jobTimeTo.length()>0)
|
|
|
{
|
|
|
if (jobTimeTo != null && jobTimeTo.length() > 0) {
|
|
|
Date timeTo = DateConvert.toDate(jobTimeTo);
|
|
|
model.addAttribute("jobTimeTo", DateConvert.toString(timeTo));
|
|
|
}
|
|
|
else{
|
|
|
} else {
|
|
|
model.addAttribute("jobTimeTo", DateConvert.toString(new Date()));
|
|
|
}
|
|
|
model.addAttribute("contentPage", "/datacollect/repeatDatacollect");
|
|
|
return "partView";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "error");
|
|
|
return "partView";
|
|
|
}
|
|
@ -365,64 +346,55 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 任务详细日志列表
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getJobLogDetail")
|
|
|
@ResponseBody
|
|
|
public Result getJobLogDetail(String jobId,String jobDatasetId,String jobStatus,String jobTimeFrom,String jobTimeTo,int page, int rows){
|
|
|
public Result getJobLogDetail(String jobId, String jobDatasetId, String jobStatus, String jobTimeFrom, String jobTimeTo, int page, int rows) {
|
|
|
try {
|
|
|
Map<String, Object> conditionMap = new HashMap<String, Object>();
|
|
|
conditionMap.put("jobId",jobId);
|
|
|
conditionMap.put("jobDatasetId",jobDatasetId);
|
|
|
conditionMap.put("jobStatus",jobStatus);
|
|
|
conditionMap.put("jobTimeFrom",jobTimeFrom);
|
|
|
conditionMap.put("jobId", jobId);
|
|
|
conditionMap.put("jobDatasetId", jobDatasetId);
|
|
|
conditionMap.put("jobStatus", jobStatus);
|
|
|
conditionMap.put("jobTimeFrom", jobTimeFrom);
|
|
|
conditionMap.put("jobTimeTo", jobTimeTo);
|
|
|
return datacollect.getJobLogDetail(conditionMap,page,rows);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
return datacollect.getJobLogDetail(conditionMap, page, rows);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 补采数据
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("repeat")
|
|
|
@ResponseBody
|
|
|
public Result repeat(String ids){
|
|
|
public Result repeat(String ids) {
|
|
|
try {
|
|
|
if(ids.length()>0)
|
|
|
{
|
|
|
if (ids.length() > 0) {
|
|
|
String[] logId = ids.split(",");
|
|
|
if(logId.length==1)
|
|
|
{
|
|
|
if (logId.length == 1) {
|
|
|
return datacollectService.repeatJob(ids);
|
|
|
}
|
|
|
else {
|
|
|
} else {
|
|
|
StringBuilder str = new StringBuilder();
|
|
|
for(String id:logId)
|
|
|
{
|
|
|
for (String id : logId) {
|
|
|
ActionResult re = datacollectService.repeatJob(id);
|
|
|
if(re.isSuccessFlg())
|
|
|
{
|
|
|
str.append(id+"补采成功!\n");
|
|
|
}
|
|
|
else{
|
|
|
str.append(id+"补采失败!\n");
|
|
|
if (re.isSuccessFlg()) {
|
|
|
str.append(id + "补采成功!\n");
|
|
|
} else {
|
|
|
str.append(id + "补采失败!\n");
|
|
|
}
|
|
|
}
|
|
|
return Result.success(str.toString());
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
} else {
|
|
|
return Result.error("非法操作!");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -430,16 +402,15 @@ public class DataCollectController extends BaseController {
|
|
|
/*************************** 任务跟踪 ***********************************/
|
|
|
/**
|
|
|
* 任务跟踪界面
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("trackJob")
|
|
|
public String trackJob(Model model,String jobId) {
|
|
|
try{
|
|
|
public String trackJob(Model model, String jobId) {
|
|
|
try {
|
|
|
model.addAttribute("contentPage", "/datacollect/trackJob");
|
|
|
return "pageView";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "error");
|
|
|
return "partView";
|
|
|
}
|
|
@ -447,34 +418,32 @@ public class DataCollectController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 任务日志列表
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getJobLog")
|
|
|
@ResponseBody
|
|
|
public Result getJobLog(String jobId,int page, int rows){
|
|
|
public Result getJobLog(String jobId, int page, int rows) {
|
|
|
try {
|
|
|
Map<String, Object> conditionMap = new HashMap<String, Object>();
|
|
|
conditionMap.put("jobId",jobId);
|
|
|
return datacollect.getJobLog(conditionMap,page,rows);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
conditionMap.put("jobId", jobId);
|
|
|
return datacollect.getJobLog(conditionMap, page, rows);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 任务详细根据数据集分组
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getJobLogDataset")
|
|
|
@ResponseBody
|
|
|
public Result getJobLogDataset(String logId){
|
|
|
public Result getJobLogDataset(String logId) {
|
|
|
try {
|
|
|
return datacollect.getJobLogDataset(logId);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
@ -484,22 +453,121 @@ public class DataCollectController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping("jobLayout")
|
|
|
public String jobLayout(Model model) {
|
|
|
model.addAttribute("contentPage","/datacollect/jobLayout");
|
|
|
model.addAttribute("contentPage", "/datacollect/jobLayout");
|
|
|
return "partView";
|
|
|
}
|
|
|
|
|
|
@RequestMapping("getJobLayout")
|
|
|
@ResponseBody
|
|
|
public List<SchemeResultDetailModel> getJobLayout() {
|
|
|
try {
|
|
|
List<SchemeResultDetailModel> schemeResultDetailModels = adapterSchemeService.getSchemeList2();
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
String result = mapper.writeValueAsString(schemeResultDetailModels);
|
|
|
return schemeResultDetailModels;
|
|
|
// DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
// List<DictItem> detailModelList = new ArrayList<DictItem>();
|
|
|
// for(SchemeResultDetailModel schemeResultDetailModel : schemeResultDetailModels){
|
|
|
// DictItem items = new DictItem();
|
|
|
// String id = schemeResultDetailModel.getId();
|
|
|
// items.setCode(id);
|
|
|
// items.setValue(schemeResultDetailModel.getName());
|
|
|
// detailModelList.add(items);
|
|
|
// }
|
|
|
// dictionaryResult.setDetailModelList(detailModelList);
|
|
|
// return dictionaryResult;
|
|
|
} catch (Exception ex) {
|
|
|
// return Result.error(ex.getMessage());
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存或更新 任务编排信息
|
|
|
* @param list 适配方案 数据集关系
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("updateSchemeList")
|
|
|
@ResponseBody
|
|
|
public Result saveOrUpdateSchemes( String list) {
|
|
|
try {
|
|
|
return adapterSchemeService.saveOrUpdateSchemeList(list);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取适配方案 数据集关系
|
|
|
* @param schemeId 适配方案ID
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getSchemeDataSets")
|
|
|
@ResponseBody
|
|
|
public List getSchemeDataSets(
|
|
|
@RequestParam(value = "schemeId", required = true) Integer schemeId,
|
|
|
@RequestParam(value = "version", required = true) String version
|
|
|
) {
|
|
|
try {
|
|
|
return adapterSchemeService.getAdapterDataSets(schemeId,version);
|
|
|
} catch (Exception ex) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存适配方案数据集关系 (暂定)
|
|
|
* @param schemeId
|
|
|
* @param version
|
|
|
* @param dataSetList
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("addSchemeRelation")
|
|
|
@ResponseBody
|
|
|
public List addSchemeRelation(
|
|
|
@RequestParam(value = "schemeId", required = true) Integer schemeId,
|
|
|
@RequestParam(value = "version", required = true) String version,
|
|
|
@RequestParam(value = "dataSetList", required = true) String dataSetList
|
|
|
) {
|
|
|
try {
|
|
|
return adapterSchemeService.getAdapterDataSets(schemeId,version);
|
|
|
} catch (Exception ex) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存适配方案 数据映射关系
|
|
|
* @param schemeId
|
|
|
* @param version
|
|
|
* @param data
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("saveCrawlerFlow")
|
|
|
@ResponseBody
|
|
|
public Result saveCrawlerFlowRelation(
|
|
|
@RequestParam(value = "schemeId", required = true) Integer schemeId,
|
|
|
@RequestParam(value = "version", required = true) String version,
|
|
|
@RequestParam(value = "data", required = true) String data
|
|
|
) {
|
|
|
try {
|
|
|
return adapterSchemeService.saveDataSetRelation(schemeId, version, data);
|
|
|
} catch (Exception ex) {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
任务编排数据映射
|
|
|
*/
|
|
|
@RequestMapping("jobDataMapping")
|
|
|
public String jobDataMapping(Model model,String jobId) {
|
|
|
public String jobDataMapping(Model model, String jobId) {
|
|
|
try {
|
|
|
|
|
|
model.addAttribute("contentPage", "/datacollect/dataMapping");
|
|
|
return "pageView";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "/datacollect/dataMapping");
|
|
|
return "pageView";
|
|
|
}
|