use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemSettingConfigureUtils method updateParam1.
public static void updateParam1(String code, String value) throws ServiceException, Exception {
SysCodeVO sysCode = new SysCodeVO();
sysCode.setType(CODE_TYPE);
sysCode.setCode(code);
DefaultResult<SysCodeVO> result = sysCodeService.findByUK(sysCode);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
sysCode = result.getValue();
sysCode.setParam1(value);
result = sysCodeService.updateObject(sysCode);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class SystemSettingConfigureUtils method getCode.
public static SysCodeVO getCode(String code) {
SysCodeVO sysCode = new SysCodeVO();
sysCode.setType(CODE_TYPE);
sysCode.setCode(code);
try {
DefaultResult<SysCodeVO> result = sysCodeService.findByUK(sysCode);
if (result.getValue() != null) {
sysCode = result.getValue();
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return sysCode;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class TemplateUtils method loadSysTemplate.
private static SysTemplateVO loadSysTemplate(String templateId) throws ServiceException, Exception {
SysTemplateVO sysTemplate = new SysTemplateVO();
sysTemplate.setTemplateId(templateId);
DefaultResult<SysTemplateVO> result = sysTemplateService.findByUK(sysTemplate);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
sysTemplate = result.getValue();
return sysTemplate;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException 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.base.exception.ServiceException in project bamboobsc by billchen198318.
the class UploadSupportUtils method findUpload.
public static SysUploadVO findUpload(String uploadOid) throws ServiceException, Exception {
if (StringUtils.isBlank(uploadOid)) {
throw new Exception("Upload OID parameter is blank!");
}
SysUploadVO uploadObj = new SysUploadVO();
uploadObj.setOid(uploadOid);
DefaultResult<SysUploadVO> result = sysUploadService.findObjectByOid(uploadObj);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
uploadObj = result.getValue();
return uploadObj;
}
Aggregations