use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemBeanHelpManagementAction method loadSysBeanHelpData.
private void loadSysBeanHelpData() throws ServiceException, Exception {
this.transformFields2ValueObject(this.sysBeanHelp, new String[] { "oid" });
DefaultResult<SysBeanHelpVO> result = this.sysBeanHelpService.findObjectByOid(sysBeanHelp);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.sysBeanHelp = result.getValue();
SysVO sys = new SysVO();
sys.setSysId(this.sysBeanHelp.getSystem());
DefaultResult<SysVO> sResult = this.sysService.findByUK(sys);
if (sResult.getValue() != null) {
this.selectValue = sResult.getValue().getOid();
}
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSystemManagementSaveOrUpdateAction method save.
/**
* 產生 TB_SYS
*
* @throws ControllerException
* @throws AuthorityException
* @throws ServiceException
* @throws Exception
*/
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
SysVO sys = new SysVO();
this.transformFields2ValueObject(sys, new String[] { "sysId", "name", "host", "contextPath" });
if ("true".equals(super.getFields().get("isLocal"))) {
sys.setIsLocal(YesNo.YES);
} else {
sys.setIsLocal(YesNo.NO);
}
DefaultResult<SysVO> result = this.applicationSystemLogicService.create(sys, super.getFields().get("icon"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() == null) {
return;
}
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class CommonSelectItemsDataAction method loadSysValueObj.
private SysVO loadSysValueObj(String sysOid) 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();
return sys;
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class ApplicationSystemLogicServiceImpl method createMultiName.
/**
* 產生 tb_sys_multi_name 資料
*
* @param multiName
* @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<SysMultiNameVO> createMultiName(SysMultiNameVO multiName) throws ServiceException, Exception {
if (null == multiName || super.isBlank(multiName.getSysId()) || super.isBlank(multiName.getName()) || super.isBlank(multiName.getLocaleCode())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
if (LocaleLanguageUtils.getMap().get(multiName.getLocaleCode()) == null) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
}
SysVO sys = new SysVO();
sys.setSysId(multiName.getSysId());
DefaultResult<SysVO> sysResult = this.sysService.findByUK(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
super.setStringValueMaxLength(multiName, "name", 100);
return this.sysMultiNameService.saveObject(multiName);
}
use of com.netsteadfast.greenstep.vo.SysVO in project bamboobsc by billchen198318.
the class SystemContextBeanLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysCtxBeanVO> update(SysCtxBeanVO ctxBean, String systemOid) throws ServiceException, Exception {
if (ctxBean == null || super.isBlank(ctxBean.getOid()) || 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());
DefaultResult<SysCtxBeanVO> anotherResult = this.sysCxtBeanService.findByUK(ctxBean);
if (anotherResult.getValue() != null) {
// 有另一筆相同UK的資料, 但OID不同, 所以這次update 是不允許的
if (!anotherResult.getValue().getOid().equals(ctxBean.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_IS_EXIST));
}
}
if (super.defaultString(ctxBean.getDescription()).length() > MAX_DESCRIPTION_LENGTH) {
ctxBean.setDescription(ctxBean.getDescription().substring(0, MAX_DESCRIPTION_LENGTH));
}
return this.sysCxtBeanService.updateObject(ctxBean);
}
Aggregations