Search in sources :

Example 6 with ServiceMethodAuthority

use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.

the class SystemProgramLogicServiceImpl method create.

/**
	 * 產生 TB_SYS_PROG 資料
	 * 
	 * @param sys
	 * @param iconOid
	 * @return
	 * @throws ServiceException
	 * @throws Exception
	 */
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysProgVO> create(SysProgVO sysProg, String sysOid, String iconOid) throws ServiceException, Exception {
    SysVO sys = new SysVO();
    sys.setOid(sysOid);
    DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
    if (sysResult.getValue() == null) {
        throw new ServiceException(sysResult.getSystemMessage().getValue());
    }
    sys = sysResult.getValue();
    SysIconVO sysIcon = new SysIconVO();
    sysIcon.setOid(iconOid);
    DefaultResult<SysIconVO> iconResult = this.sysIconService.findObjectByOid(sysIcon);
    if (iconResult.getValue() == null) {
        throw new ServiceException(iconResult.getSystemMessage().getValue());
    }
    sysIcon = iconResult.getValue();
    sysProg.setProgSystem(sys.getSysId());
    sysProg.setIcon(sysIcon.getIconId());
    return this.sysProgService.saveObject(sysProg);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO) SysIconVO(com.netsteadfast.greenstep.vo.SysIconVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 7 with ServiceMethodAuthority

use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.

the class SystemWebServiceConfigLogicServiceImpl method update.

@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysWsConfigVO> update(SysWsConfigVO config, String systemOid) throws ServiceException, Exception {
    if (config == null || super.isBlank(config.getOid()) || super.isBlank(systemOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<SysWsConfigVO> oldResult = this.sysWsConfigService.findObjectByOid(config);
    if (oldResult.getValue() == null) {
        throw new ServiceException(oldResult.getSystemMessage().getValue());
    }
    SysVO sys = new SysVO();
    sys.setOid(systemOid);
    DefaultResult<SysVO> sResult = this.sysService.findObjectByOid(sys);
    if (sResult.getValue() == null) {
        throw new ServiceException(sResult.getSystemMessage().getValue());
    }
    sys = sResult.getValue();
    config.setWsId(oldResult.getValue().getWsId());
    config.setSystem(sys.getSysId());
    if (super.defaultString(config.getDescription()).length() > MAX_DESCRIPTION_LENGTH) {
        config.setDescription(config.getDescription().substring(0, MAX_DESCRIPTION_LENGTH));
    }
    return this.sysWsConfigService.updateObject(config);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysWsConfigVO(com.netsteadfast.greenstep.vo.SysWsConfigVO) SysVO(com.netsteadfast.greenstep.vo.SysVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 8 with ServiceMethodAuthority

use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.

the class SystemWebServiceConfigLogicServiceImpl method create.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysWsConfigVO> create(SysWsConfigVO config, String systemOid) throws ServiceException, Exception {
    if (config == null || super.isBlank(systemOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysVO sys = new SysVO();
    sys.setOid(systemOid);
    DefaultResult<SysVO> sResult = this.sysService.findObjectByOid(sys);
    if (sResult.getValue() == null) {
        throw new ServiceException(sResult.getSystemMessage().getValue());
    }
    sys = sResult.getValue();
    config.setSystem(sys.getSysId());
    if (super.defaultString(config.getDescription()).length() > MAX_DESCRIPTION_LENGTH) {
        config.setDescription(config.getDescription().substring(0, MAX_DESCRIPTION_LENGTH));
    }
    return this.sysWsConfigService.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 9 with ServiceMethodAuthority

use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.

the class SystemContextBeanLogicServiceImpl method create.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysCtxBeanVO> create(SysCtxBeanVO ctxBean, String systemOid) throws ServiceException, Exception {
    if (ctxBean == null || super.isBlank(systemOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysVO sys = new SysVO();
    sys.setOid(systemOid);
    DefaultResult<SysVO> sResult = this.sysService.findObjectByOid(sys);
    if (sResult.getValue() == null) {
        throw new ServiceException(sResult.getSystemMessage().getValue());
    }
    sys = sResult.getValue();
    ctxBean.setSystem(sys.getSysId());
    if (super.defaultString(ctxBean.getDescription()).length() > MAX_DESCRIPTION_LENGTH) {
        ctxBean.setDescription(ctxBean.getDescription().substring(0, MAX_DESCRIPTION_LENGTH));
    }
    return this.sysCxtBeanService.saveObject(ctxBean);
}
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 10 with ServiceMethodAuthority

use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.

the class SystemExpressionLogicServiceImpl method createJob.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysExprJobVO> createJob(SysExprJobVO exprJob, String systemOid, String expressionOid) throws ServiceException, Exception {
    if (exprJob == null || super.isBlank(systemOid) || super.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();
    exprJob.setSystem(sys.getSysId());
    exprJob.setExprId(expression.getExprId());
    // 預設值
    exprJob.setRunStatus(ExpressionJobConstants.RUNSTATUS_SUCCESS);
    this.setStringValueMaxLength(exprJob, "description", MAX_DESCRIPTION_LENGTH);
    return this.sysExprJobService.saveObject(exprJob);
}
Also used : 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)

Aggregations

ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)95 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)91 Transactional (org.springframework.transaction.annotation.Transactional)84 HashMap (java.util.HashMap)32 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)31 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)29 SysVO (com.netsteadfast.greenstep.vo.SysVO)13 LinkedHashMap (java.util.LinkedHashMap)13 Map (java.util.Map)12 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)7 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)7 BaseEntity (com.netsteadfast.greenstep.base.model.BaseEntity)6 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)6 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)6 IOException (java.io.IOException)6 BaseValueObj (com.netsteadfast.greenstep.base.model.BaseValueObj)5 RoleVO (com.netsteadfast.greenstep.vo.RoleVO)5 SysProgVO (com.netsteadfast.greenstep.vo.SysProgVO)5 UserRoleVO (com.netsteadfast.greenstep.vo.UserRoleVO)5 BbReportRoleView (com.netsteadfast.greenstep.po.hbm.BbReportRoleView)4