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;
}
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;
}
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();
}
}
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);
}
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);
}
Aggregations