Search in sources :

Example 16 with SysVO

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);
}
Also used : SysExprJobVO(com.netsteadfast.greenstep.vo.SysExprJobVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) SysExpressionVO(com.netsteadfast.greenstep.vo.SysExpressionVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 17 with SysVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) SysMsgNoticeConfigVO(com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 18 with SysVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 19 with SysVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 20 with SysVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SysVO (com.netsteadfast.greenstep.vo.SysVO)35 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)30 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)13 Transactional (org.springframework.transaction.annotation.Transactional)13 JsonParseException (com.fasterxml.jackson.core.JsonParseException)7 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)7 TbSys (com.netsteadfast.greenstep.po.hbm.TbSys)6 ISysService (com.netsteadfast.greenstep.service.ISysService)6 SysExpressionVO (com.netsteadfast.greenstep.vo.SysExpressionVO)3 HashMap (java.util.HashMap)3 SysCtxBeanVO (com.netsteadfast.greenstep.vo.SysCtxBeanVO)2 SysExprJobVO (com.netsteadfast.greenstep.vo.SysExprJobVO)2 SysIconVO (com.netsteadfast.greenstep.vo.SysIconVO)2 SysMsgNoticeConfigVO (com.netsteadfast.greenstep.vo.SysMsgNoticeConfigVO)2 SysTwitterVO (com.netsteadfast.greenstep.vo.SysTwitterVO)2 SysWsConfigVO (com.netsteadfast.greenstep.vo.SysWsConfigVO)2 TbSysIcon (com.netsteadfast.greenstep.po.hbm.TbSysIcon)1 SysBeanHelpVO (com.netsteadfast.greenstep.vo.SysBeanHelpVO)1 SysProgVO (com.netsteadfast.greenstep.vo.SysProgVO)1 Map (java.util.Map)1