|
|
@ -20,6 +20,8 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import cokr.xit.base.code.CommonCode;
|
|
|
|
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.user.ManagedUser;
|
|
|
|
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
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.FTPUtil;
|
|
|
|
import cokr.xit.fims.cmmn.ftp.RemoteSystemInfo;
|
|
|
|
import cokr.xit.fims.cmmn.ftp.RemoteSystemInfo;
|
|
|
@ -27,11 +29,13 @@ 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;
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.parsing.AttachedTxtParser;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.parsing.LayoutDescriptor;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.parsing.LayoutDiscriminator;
|
|
|
|
import cokr.xit.fims.crdn.parsing.LayoutParser;
|
|
|
|
import cokr.xit.fims.crdn.parsing.LayoutParser;
|
|
|
|
import cokr.xit.fims.crdn.parsing.SingleFileParser;
|
|
|
|
|
|
|
|
import cokr.xit.fims.crdn.parsing.OnlyImageParser;
|
|
|
|
import cokr.xit.fims.crdn.parsing.OnlyImageParser;
|
|
|
|
import cokr.xit.fims.crdn.parsing.ParsingUtil;
|
|
|
|
import cokr.xit.fims.crdn.parsing.ParsingUtil;
|
|
|
|
import cokr.xit.fims.crdn.parsing.AttachedTxtParser;
|
|
|
|
import cokr.xit.fims.crdn.parsing.SingleFileParser;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnStngService;
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnStngService;
|
|
|
|
import cokr.xit.fims.crdn.service.ImportService;
|
|
|
|
import cokr.xit.fims.crdn.service.ImportService;
|
|
|
@ -77,6 +81,9 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
@Resource(name="globalStngMapper")
|
|
|
|
@Resource(name="globalStngMapper")
|
|
|
|
protected GlobalStngMapper globalStngMapper;
|
|
|
|
protected GlobalStngMapper globalStngMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="userMapper")
|
|
|
|
|
|
|
|
protected UserMapper userMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/** 단속 자료 등록 메인화면을 연다.
|
|
|
|
/** 단속 자료 등록 메인화면을 연다.
|
|
|
|
* @return fims/crdn/crdn05010-main
|
|
|
|
* @return fims/crdn/crdn05010-main
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -129,12 +136,12 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
boolean saved = false;
|
|
|
|
boolean saved = false;
|
|
|
|
|
|
|
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
LayoutParser enterprise = null;
|
|
|
|
LayoutParser parser = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "ino": enterprise = new OnlyImageParser(); break;
|
|
|
|
case "ino": parser = new OnlyImageParser(); break;
|
|
|
|
//case "knl": break;
|
|
|
|
//case "knl": break;
|
|
|
|
case "hitecom": enterprise = new SingleFileParser(); break;
|
|
|
|
case "hitecom": parser = new SingleFileParser(); break;
|
|
|
|
case "xit": enterprise = new AttachedTxtParser(); break;
|
|
|
|
case "xit": parser = new AttachedTxtParser(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -185,12 +192,12 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
boolean saved = false;
|
|
|
|
boolean saved = false;
|
|
|
|
|
|
|
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
LayoutParser enterprise = null;
|
|
|
|
LayoutParser parser = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "ino": enterprise = new OnlyImageParser(); break;
|
|
|
|
case "ino": parser = new OnlyImageParser(); break;
|
|
|
|
//case "knl": break;
|
|
|
|
//case "knl": break;
|
|
|
|
case "hitecom": enterprise = new SingleFileParser(); break;
|
|
|
|
case "hitecom": parser = new SingleFileParser(); break;
|
|
|
|
case "xit": enterprise = new AttachedTxtParser(); break;
|
|
|
|
case "xit": parser = new AttachedTxtParser(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -224,16 +231,17 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
ModelAndView mav = new ModelAndView("jsonView");
|
|
|
|
ModelAndView mav = new ModelAndView("jsonView");
|
|
|
|
|
|
|
|
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
String entType = hReq.getParameter("entType");
|
|
|
|
LayoutParser enterprise = null;
|
|
|
|
LayoutParser parser = null;
|
|
|
|
switch(entType){
|
|
|
|
switch(entType){
|
|
|
|
case "ino": enterprise = new OnlyImageParser(); break;
|
|
|
|
case "ino": parser = new OnlyImageParser(); break;
|
|
|
|
//case "knl": break;
|
|
|
|
//case "knl": break;
|
|
|
|
case "hitecom": enterprise = new SingleFileParser(); break;
|
|
|
|
case "hitecom": parser = new SingleFileParser(); break;
|
|
|
|
case "xit": enterprise = new AttachedTxtParser(); break;
|
|
|
|
case "xit": parser = new AttachedTxtParser(); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
//case "": enterprise = new (); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String institute = currentUser().getInstitute();
|
|
|
|
String institute = currentUser().getInstitute();
|
|
|
|
String taskSeCd = hReq.getParameter("taskSeCd");
|
|
|
|
String taskSeCd = hReq.getParameter("taskSeCd");
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
|
String equipmentType = hReq.getParameter("equipmentType");
|
|
|
@ -247,7 +255,20 @@ public class Crdn05Controller extends ApplicationController {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> dataObjectList = enterprise.parsing(fileList);
|
|
|
|
String sggCd = globalStngMapper.selectSggCdForCurrentUser();
|
|
|
|
|
|
|
|
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), institute);
|
|
|
|
|
|
|
|
String deptCd = currentUser.getDeptCode();
|
|
|
|
|
|
|
|
List<LayoutDescriptor> candidates = crdnStngService.getLinkFileLayoutMetadata(sggCd, taskSeCd, institute, deptCd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(candidates == null || candidates.isEmpty()) {
|
|
|
|
|
|
|
|
throw new RuntimeException("연계파일 레이아웃 정보 조회에 실패하였습니다.");
|
|
|
|
|
|
|
|
} else if(candidates.size() == 1) {
|
|
|
|
|
|
|
|
parser.setDescriptor(candidates.get(0));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
parser.setDescriptor(LayoutDiscriminator.choice(fileList, candidates));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> dataObjectList = parser.parsing(fileList);
|
|
|
|
mav = setCollectionInfo(mav, dataObjectList, "");
|
|
|
|
mav = setCollectionInfo(mav, dataObjectList, "");
|
|
|
|
return mav;
|
|
|
|
return mav;
|
|
|
|
}
|
|
|
|
}
|
|
|
|