|
|
|
@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import com.base.BaseController;
|
|
|
|
@ -132,17 +133,14 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/oracle/{name}/extract", method= RequestMethod.POST)
|
|
|
|
|
public void oracleExtract(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req,@PathVariable String name) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
System.out.println("------extract-------");
|
|
|
|
|
System.out.println(name);
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
//汇总库 对象信息--带有tableName-
|
|
|
|
|
String[] nodes = paramMap.get("target");
|
|
|
|
|
Map map = null;
|
|
|
|
|
for (String string : nodes) {
|
|
|
|
|
JSONObject jsonobject = JSONObject.fromObject(string);
|
|
|
|
|
map = jsonobject;
|
|
|
|
|
System.out.println(map);
|
|
|
|
|
map = jsonobject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 采集库对象--(多个采集库抽取到1个汇总库的1个tableName下)
|
|
|
|
@ -194,35 +192,32 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value = "/volume/{name}/move", method= RequestMethod.POST)
|
|
|
|
|
public void volumeMove(HttpServletRequest res, HttpServletResponse req,@PathVariable String name,
|
|
|
|
|
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
System.out.println("get Request");
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
// System.out.println(paramMap);
|
|
|
|
|
String[] nodes = paramMap.get("selectNode");
|
|
|
|
|
Map map = null;
|
|
|
|
|
for (String string : nodes) {
|
|
|
|
|
System.out.println(string);
|
|
|
|
|
for (String string : nodes) {
|
|
|
|
|
JSONObject jsonobject = JSONObject.fromObject(string);
|
|
|
|
|
map = jsonobject;
|
|
|
|
|
}
|
|
|
|
|
String dstVolume = (String) map.get("volume");
|
|
|
|
|
|
|
|
|
|
List<String> listItemPath = new ArrayList<String>();
|
|
|
|
|
String[] items = paramMap.get("selectItems");
|
|
|
|
|
System.out.println("selectItems");
|
|
|
|
|
String[] items = paramMap.get("selectItems");
|
|
|
|
|
List<DataInfoEntity> datas = new ArrayList<DataInfoEntity>();
|
|
|
|
|
List<String> srcVolumes = new ArrayList<String>();
|
|
|
|
|
for (String string : items) {
|
|
|
|
|
System.out.println(string);
|
|
|
|
|
for (String string : items) {
|
|
|
|
|
JSONObject jsobj = JSONObject.fromObject(string);
|
|
|
|
|
Map itemmap = jsobj;
|
|
|
|
|
DataInfoEntity data = (DataInfoEntity) Bean2MapUtils.convertMap(DataInfoEntity.class, itemmap);
|
|
|
|
|
datas.add(data);
|
|
|
|
|
}
|
|
|
|
|
System.out.println("------/volume/{name}/move--------");
|
|
|
|
|
}
|
|
|
|
|
if (datas.size() >0) {
|
|
|
|
|
moveDataService.moveData(datas, (String)map.get("path"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
req.setStatus(200);
|
|
|
|
|
}
|
|
|
|
|
// public Object volumeMove(HttpServletRequest res, HttpServletResponse req, String name,
|
|
|
|
|
// @RequestBody FolderNode selectNode, @RequestBody List<DataInfoEntity> selectItems) throws Exception {
|
|
|
|
@ -250,22 +245,23 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/oracle/list", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public List<GatherOracleInfo> oracleList() throws Exception {
|
|
|
|
|
log.debug("----------getOracleInfo-----------------------");
|
|
|
|
|
log.info("----------getOracleInfo-----------------------");
|
|
|
|
|
List<GatherOracleInfo> result = mySqlService.findAllMySql();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/delete", method= RequestMethod.POST)
|
|
|
|
|
public void oracleDelete(@PathVariable String id) throws Exception {
|
|
|
|
|
log.debug("----------deleteOracleInfo----------------");
|
|
|
|
|
public void oracleDelete(@PathVariable String id, HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
|
log.info("----------deleteOracleInfo----------------");
|
|
|
|
|
Integer num = Integer.valueOf(id);
|
|
|
|
|
mySqlService.deleteMySql(num);
|
|
|
|
|
req.setStatus(200);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/insert", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void oracleInsert(@PathVariable String id, @RequestBody GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
log.debug("----------insertOracleInfo----------------");
|
|
|
|
|
log.info("----------insertOracleInfo----------------");
|
|
|
|
|
oracle.setId(Integer.valueOf(id));
|
|
|
|
|
mySqlService.insertOracle(oracle);
|
|
|
|
|
}
|
|
|
|
@ -273,7 +269,7 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/update", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void oracleUpdate(@PathVariable("id") String id, @RequestBody GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
log.debug("----------updateOracleInfo-----------------------");
|
|
|
|
|
log.info("----------updateOracleInfo-----------------------");
|
|
|
|
|
log.debug(oracle);
|
|
|
|
|
mySqlService.updateOracle(oracle);
|
|
|
|
|
}
|
|
|
|
@ -281,7 +277,7 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/task/transfer/list", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object taskTransferList() throws Exception {
|
|
|
|
|
log.debug("----------/task/transfer/list-----------------------");
|
|
|
|
|
//log.info("----------/task/transfer/list-----------------------");
|
|
|
|
|
List<DataInfoEntityMoveTmp> result = moveDataService.findAll();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -289,7 +285,7 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/task/transfer/{id}/delete", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object taskTransferDelete(@PathVariable String id) throws Exception {
|
|
|
|
|
log.debug("----------/task/transfer/{id}/delete-----------------------");
|
|
|
|
|
log.info("----------/task/transfer/{id}/delete-----------------------");
|
|
|
|
|
DataInfoEntityMoveTmp move = new DataInfoEntityMoveTmp();
|
|
|
|
|
move.setId(Integer.valueOf(id));
|
|
|
|
|
int result = moveDataService.delete(move );
|
|
|
|
@ -299,7 +295,7 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/task/transfer/save", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object taskTransferSave(@RequestBody DataInfoEntity move) throws Exception {
|
|
|
|
|
log.debug("---------/task/transfer/save-----------------------");
|
|
|
|
|
log.info("---------/task/transfer/save-----------------------");
|
|
|
|
|
int result = dfs.save(move);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -307,8 +303,19 @@ public class DataModelController extends BaseController{
|
|
|
|
|
@RequestMapping(value="/code/list", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object findCodeList() throws Exception {
|
|
|
|
|
log.debug("---------/findSystemCode-----------------------");
|
|
|
|
|
log.info("---------/findSystemCode-----------------------");
|
|
|
|
|
Map<String, Object> result = codeService.findAll();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/oracle/extract/log", method= RequestMethod.POST )
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object getExtractLog(@RequestParam("rcName") String name, HttpServletRequest res, HttpServletResponse req){
|
|
|
|
|
log.info("---------/oracle/extract/log-------------------");
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
sb.append("查看相应日志").append("\n").append("看到了");
|
|
|
|
|
Map<String, String> log = new HashMap<>();
|
|
|
|
|
log.put(name, sb.toString());
|
|
|
|
|
return log;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|