|
|
@ -1,5 +1,6 @@
|
|
|
|
package cokr.xit.fims.crdn.web;
|
|
|
|
package cokr.xit.fims.crdn.web;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
import java.nio.file.Path;
|
|
|
@ -20,6 +21,8 @@ import cokr.xit.base.code.CommonCode;
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.web.FileInfoFactory;
|
|
|
|
import cokr.xit.base.file.web.FileInfoFactory;
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
import cokr.xit.base.web.ApplicationController;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.ftp.FTPUtil;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.ftp.RemoteSystemInfo;
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInstMapper;
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInstMapper;
|
|
|
@ -129,10 +132,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -141,24 +144,31 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
|
|
|
|
|
|
|
|
String workPath = ParsingUtil.getWorkDirectoryPath(institute, taskSeCd, entType, equipmentType);
|
|
|
|
String workPath = ParsingUtil.getWorkDirectoryPath(institute, taskSeCd, entType, equipmentType);
|
|
|
|
|
|
|
|
File workDir = new File(workPath);
|
|
|
|
//ftp G클라우드
|
|
|
|
workDir.mkdirs();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RemoteSystemInfo rs = new RemoteSystemInfo();
|
|
|
|
//RemoteSystemInfo rs = new RemoteSystemInfo();
|
|
|
|
rs.setIp("211.119.124.9");
|
|
|
|
//rs.setIp("211.119.124.9");
|
|
|
|
rs.setId("xituser");
|
|
|
|
//rs.setId("xituser");
|
|
|
|
rs.setPw("xituser!@");
|
|
|
|
//rs.setPw("xituser!@");
|
|
|
|
rs.setOsType("linux");
|
|
|
|
//rs.setOsType("linux");
|
|
|
|
|
|
|
|
|
|
|
|
String remoteWorkPath = File.separator + "applications"
|
|
|
|
//String remoteWorkPath = File.separator + "applications"
|
|
|
|
+ File.separator + "tempForFTPTest"
|
|
|
|
// + File.separator + "tempForFTPTest"
|
|
|
|
+ File.separator + entType
|
|
|
|
// + File.separator + "ino"
|
|
|
|
+ File.separator;
|
|
|
|
// + File.separator;
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//boolean result = FTPUtil.fileDown(rs, remoteWorkPath, workPath);
|
|
|
|
boolean result = FTPUtil.fileDown(rs, remoteWorkPath, workPath);
|
|
|
|
|
|
|
|
if(!result) {
|
|
|
|
|
|
|
|
saved = false;
|
|
|
|
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
saved = false;
|
|
|
|
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
saved = true;
|
|
|
|
saved = true;
|
|
|
@ -177,10 +187,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -189,8 +199,19 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
String workPath = ParsingUtil.getWorkDirectoryPath(institute, taskSeCd, entType, equipmentType);
|
|
|
|
String workPath = ParsingUtil.getWorkDirectoryPath(institute, taskSeCd, entType, equipmentType);
|
|
|
|
|
|
|
|
|
|
|
|
//TODO :
|
|
|
|
File workDir = new File(workPath);
|
|
|
|
|
|
|
|
workDir.mkdirs();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
for(int i=0; i < uploadFiles.length; i++) {
|
|
|
|
|
|
|
|
File newFile = new File(workPath+File.separator+uploadFiles[i].getOriginalFilename());
|
|
|
|
|
|
|
|
uploadFiles[i].transferTo(newFile);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
saved = false;
|
|
|
|
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
saved = true;
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
return mav;
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -205,10 +226,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|