|
|
|
@ -1,231 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package com.platform.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import com.base.BaseController;
|
|
|
|
|
import com.platform.entities.DataInfoEntity;
|
|
|
|
|
import com.platform.entities.FolderNode;
|
|
|
|
|
import com.platform.entities.GatherOracleInfo;
|
|
|
|
|
import com.platform.entities.OracleConnectorParams;
|
|
|
|
|
import com.platform.entities.PagerOptions;
|
|
|
|
|
import com.platform.entities.VolumeEntity;
|
|
|
|
|
import com.platform.service.DataInfoService;
|
|
|
|
|
import com.platform.service.IGfsService;
|
|
|
|
|
import com.platform.service.IMySqlService;
|
|
|
|
|
import com.platform.service.IOracleExtractService;
|
|
|
|
|
import com.platform.service.OracleExtractHelper;
|
|
|
|
|
import com.platform.service.OracleStatusService;
|
|
|
|
|
import com.platform.service.impl.MySqlServiceImpl;
|
|
|
|
|
import com.platform.test.Brick;
|
|
|
|
|
import com.platform.test.FolderReader;
|
|
|
|
|
import com.platform.test.Volume;
|
|
|
|
|
import com.platform.utils.Configs;
|
|
|
|
|
import com.platform.utils.UtilsHelper;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
public class DataModelController extends BaseController{
|
|
|
|
|
@Resource(name = "dataInfoService")
|
|
|
|
|
private DataInfoService dfs;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "gfsService")
|
|
|
|
|
private IGfsService gfsService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "mySqlService")
|
|
|
|
|
private IMySqlService mySqlService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "OracleExtract")
|
|
|
|
|
private IOracleExtractService OracleExtract;
|
|
|
|
|
|
|
|
|
|
public void setDfsImp(DataInfoService dfs) {
|
|
|
|
|
this.dfs = dfs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/data.json")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ModelMap getAllDataToJson(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) {
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
Set<String> keySet = paramMap.keySet();
|
|
|
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
|
|
|
StringBuffer sb = new StringBuffer().append("<22><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:{");
|
|
|
|
|
for (String str : keySet) {
|
|
|
|
|
String value = paramMap.get(str)[0];
|
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
|
|
params.put(str, value);
|
|
|
|
|
sb.append(str).append(":").append(value).append(",");
|
|
|
|
|
} else {
|
|
|
|
|
sb.append(str).append(":").append("null").append(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Configs.CONSOLE_LOGGER.info(sb.deleteCharAt(sb.length() - 1)
|
|
|
|
|
.append("}").toString());
|
|
|
|
|
PagerOptions pagerOptions = (PagerOptions) UtilsHelper
|
|
|
|
|
.newObjAndSetAttrsByClass(PagerOptions.class, params);
|
|
|
|
|
|
|
|
|
|
return dfs.getPagerTableData(pagerOptions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/delete/data")
|
|
|
|
|
public void deleteData(HttpServletRequest res, HttpServletResponse req) {
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] data = paramMap.get("data");
|
|
|
|
|
dfs.deleteData(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/connectOracle")
|
|
|
|
|
public void connectOracle(HttpServletRequest res, HttpServletResponse req) {
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
|
if (oraclesName != null)
|
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
|
Configs.CONSOLE_LOGGER.info("连接成功\t" + rcName);
|
|
|
|
|
new OracleStatusService().connectToOracle(rcName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/cancelOracleConection")
|
|
|
|
|
public void cancelOracleConnection(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) {
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
|
String operate = paramMap.get("operation")[0];
|
|
|
|
|
if (null != oraclesName) {
|
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
|
Configs.CONSOLE_LOGGER.info("连接成功:\t" + rcName);
|
|
|
|
|
new OracleStatusService().cancelToOracle(rcName, operate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{name}/extract")
|
|
|
|
|
public void extractOracleData(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, String name) throws Exception {
|
|
|
|
|
System.out.println("------extract-------");
|
|
|
|
|
System.out.println(name);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 采集库对象--(多个采集库抽取到1个汇总库的1个tableName下)
|
|
|
|
|
String[] inneed = paramMap.get("inneed");
|
|
|
|
|
List<Map<String, String>> colleclist = new ArrayList<Map<String,String>>();
|
|
|
|
|
for (String string : nodes) {
|
|
|
|
|
JSONObject jsonobject = JSONObject.fromObject(string);
|
|
|
|
|
Map inneedMap = jsonobject;
|
|
|
|
|
colleclist.add(inneedMap);
|
|
|
|
|
}
|
|
|
|
|
OracleExtract.extractOracle(name, colleclist, map);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/volume/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public List<VolumeEntity> getFolder(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
|
System.out.println("get Request");
|
|
|
|
|
// Brick brick1 = new Brick("192.168.0.101", "D:/bootstrap");
|
|
|
|
|
// Brick brick2 = new Brick("192.168.0.103", "D:\book");
|
|
|
|
|
// List<Brick> bricks = new ArrayList<Brick>();
|
|
|
|
|
// bricks.add(brick1);
|
|
|
|
|
// bricks.add(brick2);
|
|
|
|
|
List<VolumeEntity> result = gfsService.getAllVolumes();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/volume/{name}/move", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object move(HttpServletRequest res, HttpServletResponse req, String name,
|
|
|
|
|
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
|
|
|
|
System.out.println("get Request");
|
|
|
|
|
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);
|
|
|
|
|
JSONObject jsonobject = JSONObject.fromObject(string);
|
|
|
|
|
map = jsonobject;
|
|
|
|
|
}
|
|
|
|
|
List<String> listItemPath = new ArrayList<String>();
|
|
|
|
|
String[] items = paramMap.get("selectItems");
|
|
|
|
|
System.out.println("selectItems");
|
|
|
|
|
for (String string : items) {
|
|
|
|
|
System.out.println(string);
|
|
|
|
|
JSONObject jsobj = JSONObject.fromObject(string);
|
|
|
|
|
Map itemmap = jsobj;
|
|
|
|
|
listItemPath.add((String)itemmap.get("dataPath"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public List<GatherOracleInfo> getOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) throws Exception {
|
|
|
|
|
|
|
|
|
|
List<GatherOracleInfo> result = mySqlService.findAllMySql();
|
|
|
|
|
System.out.println("----------getOracleInfo-----------------------");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/delete")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void deleteOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, int id) throws Exception {
|
|
|
|
|
|
|
|
|
|
mySqlService.deleteMySql(id);
|
|
|
|
|
System.out.println("----------deleteOracleInfo-----------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/insert")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void insertOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
|
|
|
|
|
mySqlService.insertOracle(oracle);
|
|
|
|
|
System.out.println("----------insertOracleInfo-----------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/oracle/{id}/update")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void updateOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
|
|
|
|
|
mySqlService.updateOracle(oracle);
|
|
|
|
|
System.out.println("----------updateOracleInfo-----------------------");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
package com.platform.controller;
|
|
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import net.sf.json.JSONArray;
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import com.base.BaseController;
|
|
|
|
|
import com.platform.entities.DataInfoEntity;
|
|
|
|
|
import com.platform.entities.DataInfoEntityMoveTmp;
|
|
|
|
|
import com.platform.entities.FolderNode;
|
|
|
|
|
import com.platform.entities.GatherOracleInfo;
|
|
|
|
|
import com.platform.entities.OracleConnectorParams;
|
|
|
|
|
import com.platform.entities.PagerOptions;
|
|
|
|
|
import com.platform.entities.VolumeEntity;
|
|
|
|
|
import com.platform.service.DataInfoService;
|
|
|
|
|
import com.platform.service.IGfsService;
|
|
|
|
|
import com.platform.service.IMoveDataService;
|
|
|
|
|
import com.platform.service.IMySqlService;
|
|
|
|
|
import com.platform.service.IOracleExtractService;
|
|
|
|
|
import com.platform.service.OracleExtractHelper;
|
|
|
|
|
import com.platform.service.OracleStatusService;
|
|
|
|
|
import com.platform.service.impl.MySqlServiceImpl;
|
|
|
|
|
import com.platform.test.Brick;
|
|
|
|
|
import com.platform.test.FolderReader;
|
|
|
|
|
import com.platform.test.Volume;
|
|
|
|
|
import com.platform.utils.Bean2MapUtils;
|
|
|
|
|
import com.platform.utils.Configs;
|
|
|
|
|
import com.platform.utils.UtilsHelper;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
public class DataModelController extends BaseController{
|
|
|
|
|
@Resource(name = "dataInfoService")
|
|
|
|
|
private DataInfoService dfs;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "gfsService")
|
|
|
|
|
private IGfsService gfsService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "mySqlService")
|
|
|
|
|
private IMySqlService mySqlService;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "OracleExtract")
|
|
|
|
|
private IOracleExtractService OracleExtract;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "moveDataService")
|
|
|
|
|
private IMoveDataService moveDataService;
|
|
|
|
|
|
|
|
|
|
public void setDfsImp(DataInfoService dfs) {
|
|
|
|
|
this.dfs = dfs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/data.json")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ModelMap getAllDataToJson(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
Set<String> keySet = paramMap.keySet();
|
|
|
|
|
Map<String, String> params = new HashMap<String, String>();
|
|
|
|
|
StringBuffer sb = new StringBuffer().append("当前的请求参数:{");
|
|
|
|
|
for (String str : keySet) {
|
|
|
|
|
String value = paramMap.get(str)[0];
|
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
|
|
params.put(str, value);
|
|
|
|
|
sb.append(str).append(":").append(value).append(",");
|
|
|
|
|
} else {
|
|
|
|
|
sb.append(str).append(":").append("null").append(",");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Configs.CONSOLE_LOGGER.info(sb.deleteCharAt(sb.length() - 1)
|
|
|
|
|
.append("}").toString());
|
|
|
|
|
PagerOptions pagerOptions = (PagerOptions) UtilsHelper
|
|
|
|
|
.newObjAndSetAttrsByClass(PagerOptions.class, params);
|
|
|
|
|
|
|
|
|
|
return dfs.getPagerTableData(pagerOptions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/delete/data", method= RequestMethod.POST)
|
|
|
|
|
public void deleteData(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] data = paramMap.get("data");
|
|
|
|
|
dfs.deleteData(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/connectOracle")
|
|
|
|
|
public void connectOracle(HttpServletRequest res, HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
|
if (oraclesName != null)
|
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
|
Configs.CONSOLE_LOGGER.info("连接成功\t" + rcName);
|
|
|
|
|
new OracleStatusService().connectToOracle(rcName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/cancelOracleConection")
|
|
|
|
|
public void cancelOracleConnection(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) throws UnsupportedEncodingException {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
Map<String, String[]> paramMap = res.getParameterMap();
|
|
|
|
|
String[] oraclesName = paramMap.get("oracleName");
|
|
|
|
|
String operate = paramMap.get("operation")[0];
|
|
|
|
|
if (null != oraclesName) {
|
|
|
|
|
for (String rcName : oraclesName) {
|
|
|
|
|
Configs.CONSOLE_LOGGER.info("取消连接:\t" + rcName);
|
|
|
|
|
new OracleStatusService().cancelToOracle(rcName, operate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{name}/extract", method= RequestMethod.POST)
|
|
|
|
|
public void extractOracleData(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, String name) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
System.out.println("------extract-------");
|
|
|
|
|
System.out.println(name);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 采集库对象--(多个采集库抽取到1个汇总库的1个tableName下)
|
|
|
|
|
String[] inneed = paramMap.get("inneed");
|
|
|
|
|
List<Map<String, String>> colleclist = new ArrayList<Map<String,String>>();
|
|
|
|
|
for (String string : nodes) {
|
|
|
|
|
JSONObject jsonobject = JSONObject.fromObject(string);
|
|
|
|
|
Map inneedMap = jsonobject;
|
|
|
|
|
colleclist.add(inneedMap);
|
|
|
|
|
}
|
|
|
|
|
OracleExtract.extractOracle(name, colleclist, map);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/volume/list", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public List<VolumeEntity> getFolder(HttpServletRequest res, HttpServletResponse req) throws Exception {
|
|
|
|
|
System.out.println("get Request");
|
|
|
|
|
// Brick brick1 = new Brick("192.168.0.101", "D:/bootstrap");
|
|
|
|
|
// Brick brick2 = new Brick("192.168.0.103", "D:\book");
|
|
|
|
|
// List<Brick> bricks = new ArrayList<Brick>();
|
|
|
|
|
// bricks.add(brick1);
|
|
|
|
|
// bricks.add(brick2);
|
|
|
|
|
List<VolumeEntity> result = gfsService.getAllVolumes();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/volume/{name}/move", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object move(HttpServletRequest res, HttpServletResponse req, String name,
|
|
|
|
|
FolderNode selectNode, DataInfoEntity selectItems) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
System.out.println("get Request");
|
|
|
|
|
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);
|
|
|
|
|
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");
|
|
|
|
|
List<DataInfoEntity> datas = new ArrayList<DataInfoEntity>();
|
|
|
|
|
List<String> srcVolumes = new ArrayList<String>();
|
|
|
|
|
for (String string : items) {
|
|
|
|
|
System.out.println(string);
|
|
|
|
|
JSONObject jsobj = JSONObject.fromObject(string);
|
|
|
|
|
Map itemmap = jsobj;
|
|
|
|
|
if (null != itemmap.get("volume")) {
|
|
|
|
|
srcVolumes.add((String) itemmap.get("volume"));
|
|
|
|
|
}
|
|
|
|
|
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"));
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/list", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public List<GatherOracleInfo> getOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req) throws Exception {
|
|
|
|
|
|
|
|
|
|
List<GatherOracleInfo> result = mySqlService.findAllMySql();
|
|
|
|
|
System.out.println("----------getOracleInfo-----------------------");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/delete", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void deleteOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, int id) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
mySqlService.deleteMySql(id);
|
|
|
|
|
System.out.println("----------deleteOracleInfo-----------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/insert", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void insertOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("UTF-8");
|
|
|
|
|
mySqlService.insertOracle(oracle);
|
|
|
|
|
System.out.println("----------insertOracleInfo-----------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/oracle/{id}/update", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void updateOracleInfo(HttpServletRequest res,
|
|
|
|
|
HttpServletResponse req, GatherOracleInfo oracle) throws Exception {
|
|
|
|
|
res.setCharacterEncoding("gb2312");
|
|
|
|
|
System.out.println(oracle.getName());
|
|
|
|
|
System.out.println(oracle);
|
|
|
|
|
|
|
|
|
|
mySqlService.updateOracle(oracle);
|
|
|
|
|
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/delete", method= RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object taskdeletes(DataInfoEntityMoveTmp move) throws Exception {
|
|
|
|
|
int result = moveDataService.delete(move);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|