Search in sources :

Example 56 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class SystemCalendarNoteSaveOrUpdateAction method save.

/**
	 * 儲存 TB_SYS_CALENDAR_NOTE
	 * 
	 * @throws ControllerException
	 * @throws AuthorityException
	 * @throws ServiceException
	 * @throws Exception
	 */
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    String accountOid = this.getFields().get("accountOid");
    SysCalendarNoteVO sysCalendarNote = new SysCalendarNoteVO();
    sysCalendarNote = this.transformFields2ValueObject(sysCalendarNote, new String[] { "title", "note", "date", "time", "contact" });
    sysCalendarNote.setAlert(YesNo.NO);
    if ("true".equals(this.getFields().get("alert"))) {
        sysCalendarNote.setAlert(YesNo.YES);
    }
    DefaultResult<SysCalendarNoteVO> result = this.systemCalendarNoteLogicService.create(sysCalendarNote, accountOid);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.message = result.getSystemMessage().getValue();
    this.success = IS_YES;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCalendarNoteVO(com.netsteadfast.greenstep.vo.SysCalendarNoteVO)

Example 57 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class SystemCalendarNoteSaveOrUpdateAction method delete.

/**
	 * 刪除 TB_SYS_CALENDAR_NOTE
	 * 
	 * @throws ControllerException
	 * @throws AuthorityException
	 * @throws ServiceException
	 * @throws Exception
	 */
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysCalendarNoteVO sysCalendarNote = new SysCalendarNoteVO();
    sysCalendarNote = this.transformFields2ValueObject(sysCalendarNote, new String[] { "oid" });
    DefaultResult<Boolean> result = this.sysCalendarNoteService.deleteObject(sysCalendarNote);
    if (result.getValue() == null || !result.getValue()) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.message = result.getSystemMessage().getValue();
    this.success = IS_YES;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCalendarNoteVO(com.netsteadfast.greenstep.vo.SysCalendarNoteVO)

Example 58 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class SystemContextBeanManagmentAction method loadSysCtxBeanData.

private void loadSysCtxBeanData() throws ServiceException, Exception {
    this.transformFields2ValueObject(sysCtxBean, new String[] { "oid" });
    DefaultResult<SysCtxBeanVO> result = this.sysCtxBeanService.findObjectByOid(sysCtxBean);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sysCtxBean = result.getValue();
    SysVO sys = new SysVO();
    sys.setSysId(this.sysCtxBean.getSystem());
    DefaultResult<SysVO> sResult = this.sysService.findByUK(sys);
    if (sResult.getValue() != null) {
        this.selectValue = sResult.getValue().getOid();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCtxBeanVO(com.netsteadfast.greenstep.vo.SysCtxBeanVO) SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 59 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class SystemBpmnResourceSaveOrUpdateAction method export.

private void export() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysBpmnResourceVO resource = new SysBpmnResourceVO();
    resource.setOid(this.getFields().get("oid"));
    DefaultResult<SysBpmnResourceVO> result = this.sysBpmnResourceService.findObjectByOid(resource);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    resource = result.getValue();
    sysBpmnResourceService.hibernateSessionClear();
    this.uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, resource.getContent(), resource.getId() + ".zip");
    this.message = SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS);
    this.success = IS_YES;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO)

Example 60 with ServiceException

use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.

the class SystemBeanHelpManagementAction method loadSysBeanHelpData.

private void loadSysBeanHelpData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sysBeanHelp, new String[] { "oid" });
    DefaultResult<SysBeanHelpVO> result = this.sysBeanHelpService.findObjectByOid(sysBeanHelp);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sysBeanHelp = result.getValue();
    SysVO sys = new SysVO();
    sys.setSysId(this.sysBeanHelp.getSystem());
    DefaultResult<SysVO> sResult = this.sysService.findByUK(sys);
    if (sResult.getValue() != null) {
        this.selectValue = sResult.getValue().getOid();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysBeanHelpVO(com.netsteadfast.greenstep.vo.SysBeanHelpVO) SysVO(com.netsteadfast.greenstep.vo.SysVO)

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