|
@ -1,28 +1,22 @@
|
|
|
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;
|
|
|
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.*;
|
|
|
import com.yihu.ehr.framework.model.ActionResult;
|
|
|
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;
|
|
|
import org.apache.commons.beanutils.ConvertUtils;
|
|
|
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;
|
|
@ -444,152 +438,4 @@ public class DataCollectController extends BaseController {
|
|
|
return Result.error(ex.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取适配方案-版本下拉框列表
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getLayout")
|
|
|
@ResponseBody
|
|
|
public DetailModelResult getLayout() {
|
|
|
try {
|
|
|
DetailModelResult schemeResultDetailModels = adapterSchemeService.getSchemeList();
|
|
|
return schemeResultDetailModels;
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取任务编排 适配版本列表
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getSchemeVersionList")
|
|
|
@ResponseBody
|
|
|
public DetailModelResult getSchemeVersionList() {
|
|
|
try {
|
|
|
DetailModelResult schemeResultDetailModels = adapterSchemeService.getSchemeVersionList();
|
|
|
return schemeResultDetailModels;
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
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 versionId 适配方案版本ID
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("getSchemeDataSets")
|
|
|
@ResponseBody
|
|
|
public DetailModelResult getSchemeDataSets(
|
|
|
@RequestParam(value = "versionId", required = true) Integer versionId
|
|
|
) {
|
|
|
try {
|
|
|
return adapterSchemeService.getSchemeDataset(versionId);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return new DetailModelResult();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存适配方案数据集关系 (暂定)
|
|
|
*
|
|
|
* @param schemeId
|
|
|
* @param version
|
|
|
* @param data 映射关系
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("addSchemeRelation")
|
|
|
@ResponseBody
|
|
|
public ActionResult addSchemeRelation(
|
|
|
@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) {
|
|
|
ex.printStackTrace();
|
|
|
return new ActionResult();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存适配方案 数据映射关系
|
|
|
*
|
|
|
* @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("jobLayout")
|
|
|
public String jobLayout(Model model) {
|
|
|
model.addAttribute("contentPage", "/datacollect/jobLayout");
|
|
|
return "partView";
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
任务编排数据映射
|
|
|
*/
|
|
|
@RequestMapping("jobDataMapping")
|
|
|
public String jobDataMapping(Model model, String jobId) {
|
|
|
try {
|
|
|
|
|
|
model.addAttribute("contentPage", "/datacollect/dataMapping");
|
|
|
return "pageView";
|
|
|
} catch (Exception ex) {
|
|
|
model.addAttribute("contentPage", "/datacollect/dataMapping");
|
|
|
return "pageView";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping("datasetDetail")
|
|
|
public String datasetDetail(Model model,Integer schemeId,String schemeNm,String version) {
|
|
|
model.addAttribute("contentPage", "/datacollect/datasetDetail");
|
|
|
model.addAttribute("schemeId",schemeId);
|
|
|
model.addAttribute("version",version);
|
|
|
model.addAttribute("schemeNm",schemeNm);
|
|
|
return "pageView";
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|