use of com.netsteadfast.greenstep.model.SystemFtpClientResultObj in project bamboobsc by billchen198318.
the class SystemFtpClientUtils method getFileOnly.
/**
* 取出FTP或SFTP上的檔案
*
* @param tranId TB_SYS_FTP_TRAN.TRAN_ID
* @return
* @throws ServiceException
* @throws Exception
*/
public static SystemFtpClientResultObj getFileOnly(String tranId) throws ServiceException, Exception {
if (StringUtils.isBlank(tranId)) {
throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
logger.info("getFileOnly begin...");
SystemFtpClientResultObj resultObj = new SystemFtpClientResultObj();
SysFtpTranVO tran = findSysFtpTran(tranId);
SysFtpVO ftp = findSysFtp(tran.getFtpId());
List<TbSysFtpTranSegm> segms = findSysFtpTranSegm(tran.getFtpId(), tran.getTranId());
resultObj.setSysFtp(ftp);
resultObj.setSysFtpTran(tran);
resultObj.setSysFtpTranSegms(segms);
getFiles(resultObj);
logger.info("getFileOnly end...");
return resultObj;
}
use of com.netsteadfast.greenstep.model.SystemFtpClientResultObj in project bamboobsc by billchen198318.
the class SystemFtpClientUtils method getDatas.
/**
* 取出FTP或SFTP上的檔案, 並將TXT文字檔切割成資料放至map中, XML則只將內容讀取至變數中
*
* @param tranId TB_SYS_FTP_TRAN.TRAN_ID
* @param classesToBeBound 將xml轉成Object ( 只有在TRAN_TYPE = 'GET-XML' 才需要 )
* @return
* @throws ServiceException
* @throws Exception
*/
public static SystemFtpClientResultObj getDatas(String tranId) throws ServiceException, Exception {
logger.info("getDatas begin...");
SystemFtpClientResultObj resultObj = getFileOnly(tranId);
SysFtpTranVO tran = resultObj.getSysFtpTran();
if (SystemFtpClientModel.TRAN_GET_TEXT.equals(tran.getTranType())) {
// 分割 txt 檔案
processText(resultObj);
} else if (SystemFtpClientModel.TRAN_GET_XML.equals(tran.getTranType())) {
// 處理 xml 檔案
processXml(resultObj);
}
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put(SystemFtpClientModel.RESULT_OBJ_VARIABLE, resultObj);
ScriptExpressionUtils.execute(tran.getExprType(), tran.getHelpExpression(), null, paramMap);
logger.info("getDatas end...");
return resultObj;
}
Aggregations