Search in sources :

Example 6 with ServiceException

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());
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCodeVO(com.netsteadfast.greenstep.vo.SysCodeVO)

Example 7 with ServiceException

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;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCodeVO(com.netsteadfast.greenstep.vo.SysCodeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 8 with ServiceException

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;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysTemplateVO(com.netsteadfast.greenstep.vo.SysTemplateVO)

Example 9 with ServiceException

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;
}
Also used : TbSysFtpTranSegm(com.netsteadfast.greenstep.po.hbm.TbSysFtpTranSegm) SysFtpTranVO(com.netsteadfast.greenstep.vo.SysFtpTranVO) IOException(java.io.IOException) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SystemFtpClientResultObj(com.netsteadfast.greenstep.model.SystemFtpClientResultObj) SysFtpVO(com.netsteadfast.greenstep.vo.SysFtpVO)

Example 10 with ServiceException

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;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) IOException(java.io.IOException) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Aggregations

ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)291 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)91 Transactional (org.springframework.transaction.annotation.Transactional)89 HashMap (java.util.HashMap)65 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)49 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)48 SysVO (com.netsteadfast.greenstep.vo.SysVO)30 IOException (java.io.IOException)24 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)20 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)19 List (java.util.List)19 Map (java.util.Map)19 ArrayList (java.util.ArrayList)17 LinkedHashMap (java.util.LinkedHashMap)17 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)16 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)15 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)15 SysUploadVO (com.netsteadfast.greenstep.vo.SysUploadVO)14 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)13 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)12