Search in sources :

Example 1 with SysIconVO

use of com.netsteadfast.greenstep.vo.SysIconVO 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 2 with SysIconVO

use of com.netsteadfast.greenstep.vo.SysIconVO in project bamboobsc by billchen198318.

the class SystemProgramLogicServiceImpl method update.

/**
	 * 更新 TB_SYS_PROG 資料
	 * 
	 * @param sysProg
	 * @param sysOid
	 * @param iconOid
	 * @return
	 * @throws ServiceException
	 * @throws Exception
	 */
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysProgVO> update(SysProgVO sysProg, String sysOid, String iconOid) throws ServiceException, Exception {
    if (sysProg == null || StringUtils.isBlank(sysProg.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    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.updateObject(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 3 with SysIconVO

use of com.netsteadfast.greenstep.vo.SysIconVO in project bamboobsc by billchen198318.

the class ApplicationSystemLogicServiceImpl method update.

/**
	 * 更新 TB_SYS 資料
	 * 
	 * @param sys
	 * @param iconOid
	 * @return
	 * @throws ServiceException
	 * @throws Exception
	 */
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysVO> update(SysVO sys, String iconOid) throws ServiceException, Exception {
    if (null == sys || StringUtils.isBlank(sys.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysIconVO sysIcon = new SysIconVO();
    sysIcon.setOid(iconOid);
    DefaultResult<SysIconVO> iconResult = this.sysIconService.findObjectByOid(sysIcon);
    if (iconResult.getValue() == null) {
        throw new ServiceException(iconResult.getSystemMessage().getValue());
    }
    sys.setIcon(iconResult.getValue().getIconId());
    return this.sysService.updateObject(sys);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysIconVO(com.netsteadfast.greenstep.vo.SysIconVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with SysIconVO

use of com.netsteadfast.greenstep.vo.SysIconVO in project bamboobsc by billchen198318.

the class ApplicationSystemLogicServiceImpl method create.

/**
	 * 建立 TB_SYS 資料
	 * 
	 * @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<SysVO> create(SysVO sys, String iconOid) throws ServiceException, Exception {
    SysIconVO sysIcon = new SysIconVO();
    sysIcon.setOid(iconOid);
    DefaultResult<SysIconVO> iconResult = this.sysIconService.findObjectByOid(sysIcon);
    if (iconResult.getValue() == null) {
        throw new ServiceException(iconResult.getSystemMessage().getValue());
    }
    sys.setIcon(iconResult.getValue().getIconId());
    return this.sysService.saveObject(sys);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysIconVO(com.netsteadfast.greenstep.vo.SysIconVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)4 SysIconVO (com.netsteadfast.greenstep.vo.SysIconVO)4 Transactional (org.springframework.transaction.annotation.Transactional)4 SysVO (com.netsteadfast.greenstep.vo.SysVO)2