|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.platform.controller;
|
|
|
|
package com.platform.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
|
|
import com.base.BaseController;
|
|
|
|
import com.base.BaseController;
|
|
|
|
import com.platform.entities.DataInfoEntity;
|
|
|
|
import com.platform.entities.DataInfoEntity;
|
|
|
|
|
|
|
|
import com.platform.entities.DataInfoEntityMoveTmp;
|
|
|
|
import com.platform.entities.FolderNode;
|
|
|
|
import com.platform.entities.FolderNode;
|
|
|
|
import com.platform.entities.GatherOracleInfo;
|
|
|
|
import com.platform.entities.GatherOracleInfo;
|
|
|
|
import com.platform.entities.OracleConnectorParams;
|
|
|
|
import com.platform.entities.OracleConnectorParams;
|
|
|
@ -31,6 +33,7 @@ import com.platform.entities.PagerOptions;
|
|
|
|
import com.platform.entities.VolumeEntity;
|
|
|
|
import com.platform.entities.VolumeEntity;
|
|
|
|
import com.platform.service.DataInfoService;
|
|
|
|
import com.platform.service.DataInfoService;
|
|
|
|
import com.platform.service.IGfsService;
|
|
|
|
import com.platform.service.IGfsService;
|
|
|
|
|
|
|
|
import com.platform.service.IMoveDataService;
|
|
|
|
import com.platform.service.IMySqlService;
|
|
|
|
import com.platform.service.IMySqlService;
|
|
|
|
import com.platform.service.IOracleExtractService;
|
|
|
|
import com.platform.service.IOracleExtractService;
|
|
|
|
import com.platform.service.OracleExtractHelper;
|
|
|
|
import com.platform.service.OracleExtractHelper;
|
|
|
@ -39,6 +42,7 @@ import com.platform.service.impl.MySqlServiceImpl;
|
|
|
|
import com.platform.test.Brick;
|
|
|
|
import com.platform.test.Brick;
|
|
|
|
import com.platform.test.FolderReader;
|
|
|
|
import com.platform.test.FolderReader;
|
|
|
|
import com.platform.test.Volume;
|
|
|
|
import com.platform.test.Volume;
|
|
|
|
|
|
|
|
import com.platform.utils.Bean2MapUtils;
|
|
|
|
import com.platform.utils.Configs;
|
|
|
|
import com.platform.utils.Configs;
|
|
|
|
import com.platform.utils.UtilsHelper;
|
|
|
|
import com.platform.utils.UtilsHelper;
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +59,9 @@ public class DataModelController extends BaseController{
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "OracleExtract")
|
|
|
|
@Resource(name = "OracleExtract")
|
|
|
|
private IOracleExtractService OracleExtract;
|
|
|
|
private IOracleExtractService OracleExtract;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name = "moveDataService")
|
|
|
|
|
|
|
|
private IMoveDataService moveDataService;
|
|
|
|
|
|
|
|
|
|
|
|
public void setDfsImp(DataInfoService dfs) {
|
|
|
|
public void setDfsImp(DataInfoService dfs) {
|
|
|
|
this.dfs = dfs;
|
|
|
|
this.dfs = dfs;
|
|
|
@ -63,11 +70,12 @@ public class DataModelController extends BaseController{
|
|
|
|
@RequestMapping("/data.json")
|
|
|
|
@RequestMapping("/data.json")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ModelMap getAllDataToJson(HttpServletRequest res,
|
|
|
|
public ModelMap getAllDataToJson(HttpServletRequest res,
|
|
|
|
HttpServletResponse req) {
|
|
|
|
HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Set<String> keySet = paramMap.keySet();
|
|
|
|
Set<String> keySet = paramMap.keySet();
|
|
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
|
|
StringBuffer sb = new StringBuffer().append("<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:{");
|
|
|
|
StringBuffer sb = new StringBuffer().append("当前的请求参数:{");
|
|
|
|
for (String str : keySet) {
|
|
|
|
for (String str : keySet) {
|
|
|
|
String value = paramMap.get(str)[0];
|
|
|
|
String value = paramMap.get(str)[0];
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
@ -81,19 +89,21 @@ public class DataModelController extends BaseController{
|
|
|
|
.append("}").toString());
|
|
|
|
.append("}").toString());
|
|
|
|
PagerOptions pagerOptions = (PagerOptions) UtilsHelper
|
|
|
|
PagerOptions pagerOptions = (PagerOptions) UtilsHelper
|
|
|
|
.newObjAndSetAttrsByClass(PagerOptions.class, params);
|
|
|
|
.newObjAndSetAttrsByClass(PagerOptions.class, params);
|
|
|
|
|
|
|
|
|
|
|
|
return dfs.getPagerTableData(pagerOptions);
|
|
|
|
return dfs.getPagerTableData(pagerOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/delete/data")
|
|
|
|
@RequestMapping(value="/delete/data", method= RequestMethod.POST)
|
|
|
|
public void deleteData(HttpServletRequest res, HttpServletResponse req) {
|
|
|
|
public void deleteData(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
String[] data = paramMap.get("data");
|
|
|
|
String[] data = paramMap.get("data");
|
|
|
|
dfs.deleteData(data);
|
|
|
|
dfs.deleteData(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/connectOracle")
|
|
|
|
@RequestMapping("/connectOracle")
|
|
|
|
public void connectOracle(HttpServletRequest res, HttpServletResponse req) {
|
|
|
|
public void connectOracle(HttpServletRequest res, HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
if (oraclesName != null)
|
|
|
|
if (oraclesName != null)
|
|
|
@ -105,21 +115,23 @@ public class DataModelController extends BaseController{
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/cancelOracleConection")
|
|
|
|
@RequestMapping("/cancelOracleConection")
|
|
|
|
public void cancelOracleConnection(HttpServletRequest res,
|
|
|
|
public void cancelOracleConnection(HttpServletRequest res,
|
|
|
|
HttpServletResponse req) {
|
|
|
|
HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
String operate = paramMap.get("operation")[0];
|
|
|
|
String operate = paramMap.get("operation")[0];
|
|
|
|
if (null != oraclesName) {
|
|
|
|
if (null != oraclesName) {
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
Configs.CONSOLE_LOGGER.info("连接成功:\t" + rcName);
|
|
|
|
Configs.CONSOLE_LOGGER.info("取消连接:\t" + rcName);
|
|
|
|
new OracleStatusService().cancelToOracle(rcName, operate);
|
|
|
|
new OracleStatusService().cancelToOracle(rcName, operate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{name}/extract")
|
|
|
|
@RequestMapping(value="/oracle/{name}/extract", method= RequestMethod.POST)
|
|
|
|
public void extractOracleData(HttpServletRequest res,
|
|
|
|
public void extractOracleData(HttpServletRequest res,
|
|
|
|
HttpServletResponse req, String name) throws Exception {
|
|
|
|
HttpServletResponse req, String name) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
System.out.println("------extract-------");
|
|
|
|
System.out.println("------extract-------");
|
|
|
|
System.out.println(name);
|
|
|
|
System.out.println(name);
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
@ -144,7 +156,7 @@ public class DataModelController extends BaseController{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/volume/list")
|
|
|
|
@RequestMapping(value="/volume/list", method= RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public List<VolumeEntity> getFolder(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
public List<VolumeEntity> getFolder(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
System.out.println("get Request");
|
|
|
|
System.out.println("get Request");
|
|
|
@ -161,6 +173,7 @@ public class DataModelController extends BaseController{
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public Object move(HttpServletRequest res, HttpServletResponse req, String name,
|
|
|
|
public Object move(HttpServletRequest res, HttpServletResponse req, String name,
|
|
|
|
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
|
|
|
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
System.out.println("get Request");
|
|
|
|
System.out.println("get Request");
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
// System.out.println(paramMap);
|
|
|
|
// System.out.println(paramMap);
|
|
|
@ -174,22 +187,23 @@ public class DataModelController extends BaseController{
|
|
|
|
List<String> listItemPath = new ArrayList<String>();
|
|
|
|
List<String> listItemPath = new ArrayList<String>();
|
|
|
|
String[] items = paramMap.get("selectItems");
|
|
|
|
String[] items = paramMap.get("selectItems");
|
|
|
|
System.out.println("selectItems");
|
|
|
|
System.out.println("selectItems");
|
|
|
|
|
|
|
|
List<DataInfoEntity> datas = new ArrayList<DataInfoEntity>();
|
|
|
|
for (String string : items) {
|
|
|
|
for (String string : items) {
|
|
|
|
System.out.println(string);
|
|
|
|
System.out.println(string);
|
|
|
|
JSONObject jsobj = JSONObject.fromObject(string);
|
|
|
|
JSONObject jsobj = JSONObject.fromObject(string);
|
|
|
|
Map itemmap = jsobj;
|
|
|
|
Map itemmap = jsobj;
|
|
|
|
listItemPath.add((String)itemmap.get("dataPath"));
|
|
|
|
DataInfoEntity data = (DataInfoEntity) Bean2MapUtils.convertMap(DataInfoEntity.class, itemmap);
|
|
|
|
|
|
|
|
datas.add(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("------/volume/{name}/move--------");
|
|
|
|
|
|
|
|
boolean result = false ;
|
|
|
|
|
|
|
|
if (datas.size() >0) {
|
|
|
|
|
|
|
|
result = moveDataService.moveData(datas, (String)map.get("path"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(name);
|
|
|
|
|
|
|
|
System.out.println(nodes);
|
|
|
|
|
|
|
|
System.out.println(selectItems);
|
|
|
|
|
|
|
|
System.out.println("--------------");
|
|
|
|
|
|
|
|
int result = gfsService.copyFolder(listItemPath, (String)map.get("path"), "app");
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/list")
|
|
|
|
@RequestMapping(value="/oracle/list", method= RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public List<GatherOracleInfo> getOracleInfo(HttpServletRequest res,
|
|
|
|
public List<GatherOracleInfo> getOracleInfo(HttpServletRequest res,
|
|
|
|
HttpServletResponse req) throws Exception {
|
|
|
|
HttpServletResponse req) throws Exception {
|
|
|
@ -199,30 +213,48 @@ public class DataModelController extends BaseController{
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/delete")
|
|
|
|
@RequestMapping(value="/oracle/{id}/delete", method= RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public void deleteOracleInfo(HttpServletRequest res,
|
|
|
|
public void deleteOracleInfo(HttpServletRequest res,
|
|
|
|
HttpServletResponse req, int id) throws Exception {
|
|
|
|
HttpServletResponse req, int id) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
mySqlService.deleteMySql(id);
|
|
|
|
mySqlService.deleteMySql(id);
|
|
|
|
System.out.println("----------deleteOracleInfo-----------------------");
|
|
|
|
System.out.println("----------deleteOracleInfo-----------------------");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/insert")
|
|
|
|
@RequestMapping(value="/oracle/{id}/insert", method= RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public void insertOracleInfo(HttpServletRequest res,
|
|
|
|
public void insertOracleInfo(HttpServletRequest res,
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
mySqlService.insertOracle(oracle);
|
|
|
|
mySqlService.insertOracle(oracle);
|
|
|
|
System.out.println("----------insertOracleInfo-----------------------");
|
|
|
|
System.out.println("----------insertOracleInfo-----------------------");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/update")
|
|
|
|
@RequestMapping(value="/oracle/update", method= RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public void updateOracleInfo(HttpServletRequest res,
|
|
|
|
public void updateOracleInfo(HttpServletRequest res,
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
|
|
|
res.setCharacterEncoding("gb2312");
|
|
|
|
|
|
|
|
System.out.println(oracle.getName());
|
|
|
|
|
|
|
|
System.out.println(oracle);
|
|
|
|
|
|
|
|
|
|
|
|
mySqlService.updateOracle(oracle);
|
|
|
|
mySqlService.updateOracle(oracle);
|
|
|
|
System.out.println("----------updateOracleInfo-----------------------");
|
|
|
|
System.out.println("----------updateOracleInfo-----------------------");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/task/transfer/list", method= RequestMethod.POST)
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public Object taskList() throws Exception {
|
|
|
|
|
|
|
|
List<DataInfoEntityMoveTmp> result = moveDataService.findAll();
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/task/transfer/deletes", method= RequestMethod.POST)
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public Object taskdeletes() throws Exception {
|
|
|
|
|
|
|
|
DataInfoEntityMoveTmp dataMove = null;
|
|
|
|
|
|
|
|
int result = moveDataService.delete(dataMove);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|