|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cokr.xit.fims.crdn.web;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
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.web.FileInfoFactory;
|
|
|
|
|
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.CrdnQuery;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInstMapper;
|
|
|
|
@ -129,10 +132,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
|
switch(entType){
|
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -141,24 +144,31 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
|
|
|
|
|
|
String workPath = ParsingUtil.getWorkDirectoryPath(institute, taskSeCd, entType, equipmentType);
|
|
|
|
|
|
|
|
|
|
//ftp G클라우드
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//RemoteSystemInfo rs = new RemoteSystemInfo();
|
|
|
|
|
//rs.setIp("211.119.124.9");
|
|
|
|
|
//rs.setId("xituser");
|
|
|
|
|
//rs.setPw("xituser!@");
|
|
|
|
|
//rs.setOsType("linux");
|
|
|
|
|
|
|
|
|
|
//String remoteWorkPath = File.separator + "applications"
|
|
|
|
|
// + File.separator + "tempForFTPTest"
|
|
|
|
|
// + File.separator + "ino"
|
|
|
|
|
// + File.separator;
|
|
|
|
|
File workDir = new File(workPath);
|
|
|
|
|
workDir.mkdirs();
|
|
|
|
|
|
|
|
|
|
RemoteSystemInfo rs = new RemoteSystemInfo();
|
|
|
|
|
rs.setIp("211.119.124.9");
|
|
|
|
|
rs.setId("xituser");
|
|
|
|
|
rs.setPw("xituser!@");
|
|
|
|
|
rs.setOsType("linux");
|
|
|
|
|
|
|
|
|
|
String remoteWorkPath = File.separator + "applications"
|
|
|
|
|
+ File.separator + "tempForFTPTest"
|
|
|
|
|
+ File.separator + entType
|
|
|
|
|
+ File.separator;
|
|
|
|
|
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) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
saved = false;
|
|
|
|
|
mav.addObject("saved", saved);
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saved = true;
|
|
|
|
@ -177,10 +187,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
|
switch(entType){
|
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -189,8 +199,19 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
|
String equipmentType = hReq.getParameter("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);
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
@ -205,10 +226,10 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
|
EquipmentEnterprise enterprise = null;
|
|
|
|
|
switch(entType){
|
|
|
|
|
case "INO": enterprise = new Ino(); break;
|
|
|
|
|
case "KNL": enterprise = new Knl(); break;
|
|
|
|
|
case "HITECOM": enterprise = new HiteCom(); break;
|
|
|
|
|
case "XIT": enterprise = new XitRecommend(); break;
|
|
|
|
|
case "ino": enterprise = new Ino(); break;
|
|
|
|
|
case "knl": enterprise = new Knl(); break;
|
|
|
|
|
case "hitecom": enterprise = new HiteCom(); break;
|
|
|
|
|
case "xit": enterprise = new XitRecommend(); break;
|
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|