web_backend_develope
chenlw 10 years ago
parent 13a37b8d31
commit d07a4457bb

@ -60,7 +60,8 @@ kubeMasterUrl=http://192.168.0.110:8080/
collect-user-name=system
collect-password=oracle
collect-service-name=orcl
# standard table :
# eg:sql -> select count(*) from u_bzbjy.kzxzb; select count(*) from u_bzbjy.zfxxb;
collect-user-table=u_bzbjy
collect-exec-table=kzxzb
collect-pay-table=zfxxb
@ -109,4 +110,3 @@ package_name=DefaultDescription
sql_script_path_last=/DefaultDescription_last/
sql_script_path_standard=/DefaultDescription/

@ -31,7 +31,7 @@ import com.platform.utils.Configs;
public class BaseController {
/** log4j */
public static Logger log = Configs.DAILY_ROLLING_LOGGER;
public final static Logger log = Logger.getLogger(BaseController.class);
/**
* <> @ExceptionHandler----
@ -43,9 +43,8 @@ public class BaseController {
*/
@ExceptionHandler
public Object exp(HttpServletRequest request, HttpServletResponse response,Exception ex) {
System.out.println("URI"+request.getRequestURI());
request.setAttribute("ex", ex);
System.err.println("BaseController --exp " + ex);
log.error("URI"+request.getRequestURI());
log.error("BaseController --exp " + ex);
new CustomException("base_code_", ex);
// 根据不同错误转向不同页面
if(ex instanceof CustomException) {

@ -1,6 +1,5 @@
package com.platform.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -13,14 +12,12 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.base.BaseController;
import com.platform.entities.CheckoutEntity;
import com.platform.entities.PreDataInfo;
import com.platform.service.ICheckoutService;
import com.platform.utils.Configs;
/** --
* @author chen
@ -29,8 +26,7 @@ import com.platform.utils.Configs;
@Controller
@RequestMapping("/checkout")
public class CheckoutController extends BaseController {
@SuppressWarnings("static-access")
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(CheckoutController.class);
public final static Logger log = Logger.getLogger(CheckoutController.class);
@Resource(name = "checkoutService")
private ICheckoutService checkoutService;

File diff suppressed because it is too large Load Diff

@ -15,19 +15,28 @@ import com.platform.utils.Configs;
@Controller
public class DefaultController {
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(DefaultController.class);
public final static Logger log = Logger.getLogger(DefaultController.class);
/**
* @param req
* @param res
* @return
*/
@RequestMapping("/")
public ModelAndView defaultHandler(HttpServletRequest req, HttpServletResponse res){
//处理不匹配的请求
System.out.println("index");
log.info("index");
return new ModelAndView("index");
}
/**
* @param req
* @param res
* @return
*/
@RequestMapping("/test")
public ModelMap test(HttpServletRequest req, HttpServletResponse res){
//System.out.println(Class.class.getClass().getResource("/").getPath());
System.out.println(Configs.EXTRACT_LOG_LOCALTION);
log.info(Configs.EXTRACT_LOG_LOCALTION);
return new ModelMap();
}

@ -3,19 +3,13 @@ package com.platform.controller;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.Resource;
import javax.servlet.ServletException;
@ -47,7 +41,6 @@ import com.platform.entities.ResumableInfo;
import com.platform.entities.ResumableInfoStorage;
import com.platform.form.PagerOptions;
import com.platform.service.IPreDataInfoService;
import com.platform.service.IScriptMakeService;
import com.platform.utils.Configs;
import com.platform.utils.FileOperateHelper;
import com.platform.utils.HttpUtils;
@ -62,8 +55,14 @@ import com.platform.utils.UtilsHelper;
@RequestMapping("/fileOperation")
public class ExcelController extends BaseController{
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(ExcelController.class);
/**
*
*/
public final static Logger log = Logger.getLogger(ExcelController.class);
/**
* ----
*/
@Resource(name = "preDataInfoService")
private IPreDataInfoService preDataInfoService;
@ -102,9 +101,9 @@ public class ExcelController extends BaseController{
// Save to file
InputStream is = request.getInputStream();
long readed = 0;
long content_length = request.getContentLength();
long contentLength = request.getContentLength();
byte[] bytes = new byte[1024 * 100];
while (readed < content_length) {
while (readed < contentLength) {
int r = is.read(bytes);
if (r < 0) {
break;
@ -122,7 +121,6 @@ public class ExcelController extends BaseController{
log.info(info.resumableFilename);
ResumableInfoStorage.getInstance().remove(info);
response.getWriter().print("All finished.");
//开始导入excel
} else {
response.getWriter().print("Upload");
@ -146,7 +144,6 @@ public class ExcelController extends BaseController{
preDataInfoService.exportExcel(Configs.FILE_DOWNLOAD_PATH);
File file = new File(Configs.FILE_DOWNLOAD_PATH);
// System.out.println(Configs.FILE_DOWNLOAD_PATH);
if (file.exists()) {
HttpHeaders headers = new HttpHeaders();
String fileName = new String(file.getName().getBytes("UTF-8"),
@ -266,8 +263,7 @@ public class ExcelController extends BaseController{
List<String> jsonlist = (List<String>) JSONArray.toCollection(jsonArray, String.class);
ModelMap modelMap = new ModelMap();
if (null == jsonlist && jsonlist.size() > 0) {
// System.err.println(request.getParameter("fileNameList"));
if (null == jsonlist || jsonlist.size() == 0) {
modelMap.addAttribute("returncode","3002");
return modelMap;
}
@ -324,11 +320,10 @@ public class ExcelController extends BaseController{
if(multipartResolver.isMultipart(request)){
//再将request中的数据转化成multipart类型的数据
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
Iterator iter = multiRequest.getFileNames();
Iterator<String> iter = multiRequest.getFileNames();
while(iter.hasNext()){
//这里的name为fileItem的alias属性值相当于form表单中name
String name=(String)iter.next();
// System.out.println("name:"+name);
String name= iter.next();
//根据name值拿取文件
MultipartFile file = multiRequest.getFile(name);
if(file != null){
@ -338,14 +333,12 @@ public class ExcelController extends BaseController{
if(!localFile.getParentFile().exists()) {
//如果目标文件所在的目录不存在,则创建父目录
localFile.getParentFile().mkdirs();
// System.out.println("parent:"+localFile.getParentFile().getPath());
}
//写文件到本地
try {
file.transferTo(localFile);
} catch (IOException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
log.error(e.getStackTrace());
}
}

@ -37,8 +37,7 @@ import com.platform.utils.ZipCompressUtils;
@RequestMapping("/filePackage")
public class FilePackageController extends BaseController {
@SuppressWarnings("static-access")
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(FilePackageController.class);
public static Logger log = Logger.getLogger(FilePackageController.class);
@Resource(name = "scriptMakeService")
private IScriptMakeService scriptMakeService;
@ -56,14 +55,14 @@ public class FilePackageController extends BaseController {
scriptMakeService.makeCfg();
scriptMakeService.makeXml();
String filePath = Configs.PACKAGE_DOWNLOAD_PATH;
System.out.println(filePath + Configs.PACKAGE_NAME);
log.info(filePath + Configs.PACKAGE_NAME);
ZipCompressUtils.zip(new File(filePath + Configs.PACKAGE_NAME),
filePath + "package.zip"); // 产生压缩文件
File file = new File(filePath + "package.zip");
if (file.exists()) {
HttpHeaders headers = new HttpHeaders();
String fileName = new String(file.getName());// 为了解决中文名称乱码问题
System.out.println(fileName);
log.info(fileName);
headers.setContentDispositionFormData("attachment", fileName);
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
ResponseEntity<byte[]> responseEntity = new ResponseEntity<byte[]>(
@ -108,10 +107,6 @@ public class FilePackageController extends BaseController {
log.info("---------/readSqlFile------------------");
ModelMap modelMap = new ModelMap();
Map<String, Object> result = scriptMakeService.readSql(type, data);
// StringBuilder sb = new StringBuilder();
// sb.append("查看相应日志").append("\n").append("看到了");
// modelMap.addAttribute("data1", result.get("data1").toString());
// modelMap.addAttribute("data2", result.get("data2").toString());
modelMap.addAllAttributes(result);
return modelMap;
}
@ -182,7 +177,7 @@ public class FilePackageController extends BaseController {
@ResponseBody
public ModelMap totalVerifySqlFile(@RequestBody List<SqlFileInfoEntity> forms,
HttpServletRequest req, HttpServletResponse res) throws Exception {
log.info("--------- /totalOnholeSqlFile --- " + forms +" "+ forms.size());
log.info("--------- /totalVerifySqlFile --- " + forms +" "+ forms.size());
ModelMap modelMap = new ModelMap();
if (forms.size() > 0) {
Map<String, Object> result = scriptMakeService.totalVerifySqlFile(forms);

@ -2,33 +2,16 @@
package com.platform.controller;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import oracle.sql.DATE;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.base.BaseController;
import com.base.CustomException;
import com.platform.entities.GfsFolderEntity;
import com.platform.entities.VolumeEntity;
import com.platform.glusterfs.VolumeInfo;
import com.platform.entities.VolumeEntity;
import com.platform.glusterfs.VolumeInfo;
import com.platform.service.IGfsService;
import com.platform.utils.Configs;
/**
@ -42,37 +25,43 @@ import com.platform.utils.Configs;
@Controller
@RequestMapping("")
public class FolderController extends BaseController {
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(FolderController.class);
public static Logger log = Logger.getLogger(FolderController.class);
@Resource(name = "gfsService")
private IGfsService gfsService;
/**
* @param path
* @return
* @throws Exception
*/
@RequestMapping(value="/getAllSubPathByPath", method= RequestMethod.POST)
public Object getAllSubPathByPath(String path) throws Exception {
System.out.println(path);
log.info(path);
Object result = null;
if (null != path && !"".equals(path)) {
System.out.println(path);
log.info(path);
result = gfsService.getFolder(path);
}
return result;
}
/**
* @param srcpath
* @param dstPath
* @param name
* @return
* @throws Exception
*/
@RequestMapping("/copyFolder")
public Object copyFolder(String srcpath, String dstPath, String name) throws Exception {
// -1 :error; -2: the filename is not exists ;-3 :destFolderName ; 1: right
int result = 0;
// int result = gfsService.copyFolder(srcpath, dstPath, name);
System.out.println(srcpath);
System.out.println(dstPath);
log.info(srcpath);
log.info(dstPath);
String obj = "right";
if (1 != result) {
@ -81,23 +70,6 @@ public class FolderController extends BaseController {
return obj;
}
// /**
// * <一句话功能简述> 查询集群中所有的 volume 及其 信息
// * <功能详细描述>
// * @return
// * @throws Exception
// * @see [类、类#方法、类#成员]
// */
// @RequestMapping(value="/volume/list", method= RequestMethod.POST)
// public Object getVolums() throws Exception{
// System.out.println("----------------------------------");
// long a = new Date().getTime();
// List<VolumeEntity> result = gfsService.getAllVolumes();
// System.out.println("----------------------------------");
// System.out.println(new Date().getTime()-a);
// return result;
// }
//
/**
* <> volume
* <>
@ -106,12 +78,10 @@ public class FolderController extends BaseController {
* @throws Exception
* @see [##]
*/
@RequestMapping(value="/volume/findByName", method= RequestMethod.POST)
public Object getVolumByName(String volumeName) throws Exception{
log.info(volumeName);
VolumeEntity result = gfsService.getOneVolume(volumeName);
return result;
}
}

@ -8,8 +8,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -22,7 +22,6 @@ import com.platform.entities.GatherOracleInfo;
import com.platform.form.oracleForm;
import com.platform.service.ILogRead;
import com.platform.service.IOracleExtractService;
import com.platform.service.thread.ThreadExtractOracle;
import com.platform.service.thread.ThreadExtractStandardOracle;
import com.platform.service.thread.ThreadGainOracleConnect;
import com.platform.utils.Configs;
@ -35,21 +34,40 @@ import com.platform.utils.Constant;
@Controller
public class OracleController extends BaseController {
/**
*
*/
public final static Logger log = Logger.getLogger(OracleController.class);
/**
* oracle
*/
@Resource(name = "OracleExtract")
private IOracleExtractService OracleExtract;
/**
* oracle
*/
@Resource(name = "logReadService")
private ILogRead logReadService;
/**
* oracle
*/
@Resource(name = "gatherOracleDao")
private GatherOracleDao gatherOracleDao;
/** oracle
* @param res
* @param req
* @param form
* @throws Exception
*/
@RequestMapping(value = "/oracle/standardextract/{name}/extract", method = RequestMethod.POST)
public void oracleStandardExtract(HttpServletRequest res, HttpServletResponse req,
@RequestBody oracleForm form) throws Exception {
Configs.CONSOLE_LOGGER.info("/oracle/standardextract/{name}/extract");
// res.setCharacterEncoding("UTF-8");
Configs.CONSOLE_LOGGER.info(form.getInneed().get(0).getName());
log.info("/oracle/standardextract/{name}/extract");
log.info(form.getInneed().get(0).getName());
boolean isConnect = false;
//5秒内是否能获得oracle连接否则认为超时。
if (null != form.getTarget()) {
@ -94,12 +112,10 @@ public class OracleController extends BaseController {
if (isConnect && null != form.getInneed() && form.getInneed().size() > 0) {
ThreadExtractStandardOracle thExtra = new ThreadExtractStandardOracle(form, OracleExtract);
thExtra.start();
// OracleExtract.extractOracle(form.getName(), form.getInneed(),
// form.getTarget());
}
}
/** sqlserveroracle
/** sqlserveroracle
* @param name
* @param res
* @param req
@ -114,7 +130,7 @@ public class OracleController extends BaseController {
String result = logReadService.readStandardLog(name);
// StringBuilder sb = new StringBuilder();
// sb.append("查看相应日志").append("\n").append("看到了");
Map<String, String> log = new HashMap<>();
Map<String, String> log = new HashMap<String, String>();
log.put(name, result);
return log;
}

@ -17,8 +17,6 @@ import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.platform.utils.Configs;
/**
* <>
@ -35,23 +33,19 @@ import com.platform.utils.Configs;
@Controller
public class SetGlusterfsController {
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(SetGlusterfsController.class);
public final static Logger log = Logger.getLogger(SetGlusterfsController.class);
@RequestMapping("/tes")
public Object defaultHandler(HttpServletRequest req, HttpServletResponse request) {
//<EFBFBD><EFBFBD><EFBFBD><><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//测试
try {
System.out.println("fsdfds");
log.info("fsdfds");
return "listAll";
} catch (Exception e) {
e.printStackTrace();
log.error(e);
return "result";
}
}
}

@ -12,12 +12,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.base.BaseController;
import com.platform.utils.Configs;
@Controller
public class TaskModelController extends BaseController{
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(TaskModelController.class);
public static Logger log = Logger.getLogger(TaskModelController.class);
@RequestMapping("/task/transfer/list")
@ResponseBody

@ -13,29 +13,42 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.base.BaseController;
import com.platform.entities.VolumeEntity;
import com.platform.entities.VolumeInitEntity;
import com.platform.form.VolumeForm;
import com.platform.http.gfs.HttpUtils;
import com.platform.service.IVolumeService;
import com.platform.utils.Configs;
import com.platform.utils.ThreadVolume;
import com.platform.utils.ThreadVolumeImm;
/** gfs
* @author chen
*
*/
@Controller
public class VolumeController extends BaseController{
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(VolumeController.class);
public static Logger log = Logger.getLogger(VolumeController.class);
/**
* gfs
*/
@Resource(name = "volumeService")
private IVolumeService volumeService;
/**
* http
*/
HttpUtils ht = new HttpUtils();
/** volume
* @param res
* @param req
* @param form
* @return
* @throws Exception
*/
@RequestMapping(value = "/volume/update", method = RequestMethod.POST)
@ResponseBody
public String volumeUpdate(HttpServletRequest res, HttpServletResponse req,
@RequestBody VolumeEntity form) throws Exception {
Configs.CONSOLE_LOGGER.error("/oracle/update");
log.error("/oracle/update");
int rest = volumeService.save(form);
if (rest == 1) {
req.setStatus(200);
@ -48,11 +61,18 @@ public class VolumeController extends BaseController{
return result;
}
/** volume
* @param res
* @param req
* @param entity
* @return
* @throws Exception
*/
@RequestMapping(value = "/volume/delete", method = RequestMethod.POST)
@ResponseBody
public String volumeDelete(HttpServletRequest res, HttpServletResponse req,
@RequestBody VolumeEntity entity) throws Exception {
Configs.CONSOLE_LOGGER.error("/volume/delete");
log.error("/volume/delete");
int rest = volumeService.delete(entity);
if (rest == 1) {
req.setStatus(200);

@ -200,4 +200,14 @@ public class CheckoutEntity extends PreDataInfo implements Comparable<CheckoutEn
return 1;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(this.getId()).append(",").append(this.getDataId()).append(",").append(this.getAreaCode())
.append(this.getCityName()).append(",").append(this.getDistrictName()).append(",").append(this.getSysName()).append(",").append(this.getDataVersion())
.append(",").append(this.getDataBaseType()).append(",falg ").append(this.getCheckoutFlag()).append(",Exec ")
.append(this.getExecResultLast()).append(",pay ").append(this.getPayResultLast());
return sb.toString();
}
}

@ -1,23 +1,18 @@
package com.platform.glusterfs;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.junit.Test;
import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper;
import com.platform.utils.Constant;
import com.platform.utils.GanymedSSH;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* volume <>
@ -255,7 +250,7 @@ public class VolumeInfo {
*/
public List<String> getVolumeMountPoint(String volumeName) {
// log.info("get volume MountPoint");
List<String> mountPoints = new ArrayList<>();
List<String> mountPoints = new ArrayList<String>();
String cmd=Constant.df + "|grep " + volumeName + "|awk '{print $6}'";
List<String> reStrings = Constant.ganymedSSH.execCmdWaitAcquiescent(cmd);
// System.out.println(reStrings);
@ -300,7 +295,7 @@ public class VolumeInfo {
*/
public Map<String, Double> getVolumebricksDataSize(String volumeName) {
List<String> bricks = getVolumeBricks(volumeName);
Map<String, Double> brick_size = new HashMap<>();
Map<String, Double> brick_size = new HashMap<String, Double>();
if (bricks == null) {
return null;
}
@ -340,7 +335,7 @@ public class VolumeInfo {
*/
public Map<String, Double> getVolumebricksAvailableSize(String volumeName) {
List<String> bricks = getVolumeBricks(volumeName);
Map<String, Double> brick_size = new HashMap<>();
Map<String, Double> brick_size = new HashMap<String, Double>();
if (bricks == null) {
return null;
}

@ -6,6 +6,8 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.apache.log4j.Logger;
import com.base.Custom4exception;
import com.base.CustomException;
import com.platform.entities.OracleConnectorParams;
@ -13,19 +15,23 @@ import com.platform.utils.Configs;
import com.platform.utils.FileOperateHelper;
public class OracleConnector {
public static Logger log = Configs.DAILY_ROLLING_LOGGER.getLogger(OracleConnector.class);
public OracleConnector() {
}
static {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Configs.CONSOLE_LOGGER.info("Oracle驱动加载成功");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
new CustomException(Custom4exception.OracleSQL_Except, e);
e.printStackTrace();
log.error(Custom4exception.OracleSQL_Except, e);
}
}
public synchronized static Connection ConnectionBuilder(String url, String user,
public synchronized static Connection connectionBuilder(String url, String user,
String password, OracleConnectorParams oc) throws CustomException {
Connection conn=null;
try {
@ -44,10 +50,9 @@ public class OracleConnector {
public synchronized static boolean canConnect(String url, String user, String password) {
Connection result = null;
try {
result = ConnectionBuilder(url, user, password, null);
result = connectionBuilder(url, user, password, null);
} catch (CustomException e) {
// TODO Auto-generated catch block
e.printStackTrace();
log.error(Custom4exception.OracleSQL_Except, e);
}
return (null != result);
}
@ -57,8 +62,9 @@ public class OracleConnector {
if (null != filePath) {
filePath = filePath.replace(".log", "");
}
Statement statement = null;
try {
Statement statement = conn
statement = conn
.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
resultSet = statement.executeQuery(sql);
@ -67,7 +73,16 @@ public class OracleConnector {
} catch (SQLException e) {
FileOperateHelper
.fileWrite(filePath+".log", sql+ "\r\n"+e.getMessage()+"\r\n");
new CustomException(Custom4exception.OracleSQL_Except, e);
log.error(Custom4exception.OracleSQL_Except, e);
}
finally{
if (null != statement) {
try {
statement.close();
} catch (SQLException e) {
log.error(Custom4exception.OracleSQL_Except, e);
}
}
}
return resultSet;
@ -77,9 +92,9 @@ public class OracleConnector {
String password, String sql, String filePath) {
ResultSet result = null;
try {
result = getSQLExecResultSet(ConnectionBuilder(url, user, password, null), sql, filePath);
result = getSQLExecResultSet(connectionBuilder(url, user, password, null), sql, filePath);
} catch (CustomException e) {
new CustomException(Custom4exception.OracleSQL_Except, e);
log.error(Custom4exception.OracleSQL_Except, e);
}
return result;
}
@ -95,8 +110,9 @@ public class OracleConnector {
filePath = filePath.replace(".log", "");
}
boolean flag = false;
Statement statement = null;
try {
Statement statement = conn.createStatement();
statement = conn.createStatement();
statement.execute(sql);
flag = true;
FileOperateHelper
@ -105,8 +121,18 @@ public class OracleConnector {
flag = false;
FileOperateHelper
.fileWrite(filePath+".log", sql+ "\r\n"+e.getMessage()+"\r\n");
new CustomException(Custom4exception.OracleSQL_Except, e);
log.error(Custom4exception.OracleSQL_Except, e);
}
finally{
if (null != statement) {
try {
statement.close();
} catch (SQLException e) {
log.error(Custom4exception.OracleSQL_Except, e);
}
}
}
return flag;
}
/**
@ -120,8 +146,9 @@ public class OracleConnector {
filePath = filePath.replace(".log", "");
}
boolean flag = false;
Statement statement = null;
try {
Statement statement = conn.createStatement();
statement = conn.createStatement();
if(statement.executeUpdate(sql) > 0)
{
flag = true;
@ -132,7 +159,16 @@ public class OracleConnector {
flag = false;
FileOperateHelper
.fileWrite(filePath+".log", sql+ "\r\n"+e.getMessage()+"\r\n");
new CustomException(Custom4exception.OracleSQL_Except, e, sql);
log.error(Custom4exception.OracleSQL_Except, e);
}
finally{
if (null != statement) {
try {
statement.close();
} catch (SQLException e) {
log.error(Custom4exception.OracleSQL_Except, e);
}
}
}
return flag;
}

@ -8,12 +8,34 @@ import org.springframework.ui.ModelMap;
import com.platform.entities.DataInfoEntity;
import com.platform.form.PagerOptions;
/**
* @author chen
*
*/
public interface DataInfoService {
/**
* @param pagerOptions
* @return
*/
public ModelMap getPagerTableData(PagerOptions pagerOptions);
/**
* @param id
* @throws Exception
*/
void deleteData(String[] id) throws Exception;
/**
* @param ids
* @throws Exception
*/
void deleteData(List<Integer> ids) throws Exception;
/**
* @param data
* @return
* @throws Exception
*/
int save(DataInfoEntity data) throws Exception;
}

@ -12,9 +12,23 @@ import com.platform.entities.EncodedInfoEntity;
*/
public interface EncodeInfoService {
/**
* @param tableName
* @return
*/
public List<EncodedInfoEntity> getAllEncodeInfo(String tableName);
/** code/
* @param code
* @param tableName
* @return
*/
public int deleteEncodeByCode(String code, String tableName);
/** /
* @param code
* @param name
* @return
*/
public String getEncodeNameByCode(String code, String name);
}

@ -56,10 +56,4 @@ public interface ICheckoutService {
*/
public List<CheckoutEntity> extractSqlServer(List<CheckoutEntity> list) throws Exception;
/**
* @param ck
* @return
* @throws Exception
*/
public Map<String, PreDataInfo> readLog(CheckoutEntity ck) throws Exception;
}

@ -31,10 +31,24 @@ import com.platform.entities.VolumeEntity;
public interface ICodeService {
/**
* @param sys
* @return
* @throws Exception
*/
public List<SystemEntity> findSystem(SystemEntity sys) throws Exception;
/**
* @param region
* @return
* @throws Exception
*/
public List<RegionalismEntity> findRegionalism(RegionalismEntity region) throws Exception;
/**
* @return
* @throws Exception
*/
public Map<String, Object> findAll() throws Exception;
}

@ -0,0 +1,35 @@
package com.platform.service;
import java.util.List;
import com.platform.entities.GatherOracleInfo;
public interface IGatherOracleService {
/**
* @return oracle
* @throws Exception
*/
public List<GatherOracleInfo> findAllOracle() throws Exception;
/** oracle
* @return
* @throws Exception
*/
public int deleteOracle(int id) throws Exception;
/** oracle
* @param oracle
* @return
* @throws Exception
*/
public int insertOracle(GatherOracleInfo oracle) throws Exception;
/** oracle
* @param oracle
* @return
* @throws Exception
*/
public int updateOracle(GatherOracleInfo oracle) throws Exception;
}

@ -1,4 +1,3 @@
/**
* : IGfsService.java
* : </>
@ -9,14 +8,11 @@
* <>
*/
package com.platform.service;
import java.util.List;
import com.platform.entities.FolderNode;
import com.platform.entities.VolumeEntity;
/**
* <>
* <>
@ -60,7 +56,7 @@ public interface IGfsService {
public List<VolumeEntity> getAllVolumes() throws Exception;
/**
* <>
* <> volume volume
* <>
* @return
* @throws Exception
@ -68,9 +64,21 @@ public interface IGfsService {
*/
public VolumeEntity getOneVolume(String volumeName) throws Exception;
/**
* @param volumeName
* @param srcPath
* @param dstPath
* @return
* @throws Exception
*/
public int moveData(String volumeName, String srcPath, String dstPath) throws Exception;
/**
* @param volumeName
* @param srcPath
* @return
* @throws Exception
*/
public int deleteData(String volumeName, String srcPath) throws Exception;
}

@ -2,8 +2,17 @@ package com.platform.service;
public interface ILogRead {
/**
* @param filename
* @return
* @throws Exception
*/
public String readLog(String filename) throws Exception;
/**
* @param filename
* @return
* @throws Exception
*/
public String readStandardLog(String filename) throws Exception;
}

@ -32,10 +32,25 @@ public interface IMoveDataService {
*/
public int delete(DataInfoEntityMoveTmp dataMove) throws Exception;
/** --
* @param data
* @return
* @throws Exception
*/
public int update(DataInfoEntityMoveTmp data) throws Exception;
/** --
* @param data
* @return
* @throws Exception
*/
public int save(DataInfoEntityMoveTmp data) throws Exception;
/** --
* @param list
* @return
* @throws Exception
*/
public int insertBatch(List<DataInfoEntityMoveTmp> list) throws Exception;
}

@ -1,25 +0,0 @@
package com.platform.service;
import java.util.List;
import com.platform.entities.GatherOracleInfo;
public interface IMySqlService {
/**
* @return
* @throws Exception
*/
public List<GatherOracleInfo> findAllMySql() throws Exception;
/**
* @return
* @throws Exception
*/
public int deleteMySql(int id) throws Exception;
public int insertOracle(GatherOracleInfo oracle) throws Exception;
public int updateOracle(GatherOracleInfo oracle) throws Exception;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save