Search in sources :

Example 11 with SysVO

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();
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysBeanHelpVO(com.netsteadfast.greenstep.vo.SysBeanHelpVO) SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 12 with SysVO

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;
}
Also used : SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 13 with SysVO

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;
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 14 with SysVO

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);
}
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 15 with SysVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysCtxBeanVO(com.netsteadfast.greenstep.vo.SysCtxBeanVO) 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