use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemExpressionLogicServiceImpl method updateJob.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysExprJobVO> updateJob(SysExprJobVO exprJob, String systemOid, String expressionOid) throws ServiceException, Exception {
if (null == exprJob || StringUtils.isBlank(exprJob.getOid()) || StringUtils.isBlank(systemOid) || StringUtils.isBlank(expressionOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
SysExpressionVO expression = new SysExpressionVO();
expression.setOid(expressionOid);
DefaultResult<SysExpressionVO> expressionResult = this.sysExpressionService.findObjectByOid(expression);
if (expressionResult.getValue() == null) {
throw new ServiceException(expressionResult.getSystemMessage().getValue());
}
expression = expressionResult.getValue();
DefaultResult<SysExprJobVO> oldResult = this.sysExprJobService.findObjectByOid(exprJob);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
exprJob.setId(oldResult.getValue().getId());
exprJob.setSystem(sys.getSysId());
exprJob.setExprId(expression.getExprId());
exprJob.setRunStatus(oldResult.getValue().getRunStatus());
if (super.isBlank(oldResult.getValue().getRunStatus())) {
exprJob.setRunStatus(ExpressionJobConstants.RUNSTATUS_FAULT);
logger.warn("Before runStatus flag is blank. Expression Job ID: " + oldResult.getValue().getId());
}
this.setStringValueMaxLength(exprJob, "description", MAX_DESCRIPTION_LENGTH);
return this.sysExprJobService.updateObject(exprJob);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemMessageNoticeLogicServiceImpl method updateConfig.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysMsgNoticeConfigVO> updateConfig(SysMsgNoticeConfigVO config, String systemOid) throws ServiceException, Exception {
if (config == null || super.isBlank(config.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
DefaultResult<SysMsgNoticeConfigVO> oldResult = this.sysMsgNoticeConfigService.findObjectByOid(config);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
config.setMsgId(oldResult.getValue().getMsgId());
config.setSystem(sys.getSysId());
return this.sysMsgNoticeConfigService.updateObject(config);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemMessageNoticeLogicServiceImpl method createConfig.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysMsgNoticeConfigVO> createConfig(SysMsgNoticeConfigVO config, String systemOid) throws ServiceException, Exception {
if (super.isBlank(systemOid) || config == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
config.setSystem(sys.getSysId());
return this.sysMsgNoticeConfigService.saveObject(config);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpVO> update(SysBeanHelpVO beanHelp, String systemOid) throws ServiceException, Exception {
if (beanHelp == null || super.isBlank(beanHelp.getOid()) || super.isBlank(systemOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sResult = sysService.findObjectByOid(sys);
if (sResult.getValue() == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
sys = sResult.getValue();
beanHelp.setSystem(sys.getSysId());
return sysBeanHelpService.updateObject(beanHelp);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method create.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpVO> create(SysBeanHelpVO beanHelp, String systemOid) throws ServiceException, Exception {
if (beanHelp == null || super.isBlank(systemOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sResult = sysService.findObjectByOid(sys);
if (sResult.getValue() == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
sys = sResult.getValue();
beanHelp.setSystem(sys.getSysId());
return sysBeanHelpService.saveObject(beanHelp);
}
Aggregations