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