Search in sources :

Example 16 with ServiceException

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

the class AccountServiceImpl method generateNewPassword.

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public String generateNewPassword(String account) throws ServiceException, Exception {
    if (StringUtils.isBlank(account)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    TbAccount entity = new TbAccount();
    entity.setAccount(account);
    entity = this.findByEntityUK(entity);
    if (entity == null || StringUtils.isBlank(entity.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST));
    }
    String newPasswordStr = SimpleUtils.createRandomString(5);
    entity.setPassword(this.tranPassword(newPasswordStr));
    this.update(entity);
    return newPasswordStr;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) TbAccount(com.netsteadfast.greenstep.po.hbm.TbAccount) Transactional(org.springframework.transaction.annotation.Transactional)

Example 17 with ServiceException

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

the class SysJreportServiceImpl method findForSimpleByReportId.

@Override
public DefaultResult<SysJreportVO> findForSimpleByReportId(String reportId) throws ServiceException, Exception {
    if (StringUtils.isBlank(reportId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysJreportVO searchObj = this.sysJreportDAO.findForSimpleByReportId(reportId);
    DefaultResult<SysJreportVO> result = new DefaultResult<SysJreportVO>();
    if (null != searchObj && !StringUtils.isBlank(searchObj.getOid())) {
        result.setValue(searchObj);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST)));
    }
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 18 with ServiceException

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

the class WebSystemCtxBeanSupportListener method processBean.

private void processBean(ServletContextEvent event, String type) {
    try {
        List<TbSysCtxBean> ctxBeans = this.findSysCtxBeanList(type);
        for (int i = 0; ctxBeans != null && i < ctxBeans.size(); i++) {
            TbSysCtxBean bean = ctxBeans.get(i);
            try {
                Object executerObj = Class.forName(bean.getClassName()).newInstance();
                if (!(executerObj instanceof ContextInitializedAndDestroyedBean)) {
                    logger.warn("class not instanceof ContextInitializedAndDestroyedBean : " + bean.getClassName());
                    continue;
                }
                Method[] methods = executerObj.getClass().getMethods();
                for (Method method : methods) {
                    if (method.getName().equals("execute")) {
                        try {
                            method.invoke(executerObj, event);
                        } catch (ServiceException se) {
                            se.printStackTrace();
                            logger.warn(se.getMessage().toString());
                        } catch (Exception e) {
                            e.printStackTrace();
                            logger.error(e.getMessage().toString());
                        }
                    }
                }
            } catch (ClassNotFoundException cnfe) {
                cnfe.printStackTrace();
                logger.error(cnfe.getMessage().toString());
            }
        }
    } catch (ServiceException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) Method(java.lang.reflect.Method) TbSysCtxBean(com.netsteadfast.greenstep.po.hbm.TbSysCtxBean) ContextInitializedAndDestroyedBean(com.netsteadfast.greenstep.base.model.ContextInitializedAndDestroyedBean) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 19 with ServiceException

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

the class BusinessProcessManagementUtils method deleteDeployment.

public static void deleteDeployment(String resourceId, boolean force) throws ServiceException, Exception {
    if (StringUtils.isBlank(resourceId)) {
        throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
    sysBpmnResource.setId(resourceId);
    deleteDeployment(sysBpmnResource, force);
}
Also used : SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 20 with ServiceException

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

the class BusinessProcessManagementUtils method deployment.

public static String deployment(String resourceId) throws ServiceException, Exception {
    if (StringUtils.isBlank(resourceId)) {
        throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
    sysBpmnResource.setId(resourceId);
    return deployment(sysBpmnResource);
}
Also used : SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO) 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