use of com.netsteadfast.greenstep.vo.SysFtpTranVO in project bamboobsc by billchen198318.
the class SystemFtpClientUtils method findSysFtpTran.
public static SysFtpTranVO findSysFtpTran(String tranId) throws ServiceException, Exception {
SysFtpTranVO tran = new SysFtpTranVO();
tran.setTranId(tranId);
DefaultResult<SysFtpTranVO> result = sysFtpTranService.findByUK(tran);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
tran = result.getValue();
return tran;
}
use of com.netsteadfast.greenstep.vo.SysFtpTranVO 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