Search in sources :

Example 1 with OlapConfVO

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

the class AnalyticsMDXLogicServiceImpl method update.

@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<OlapMdxVO> update(OlapMdxVO olapMdx, String configOid, String catalogOid) throws ServiceException, Exception {
    if (null == olapMdx || super.isNoSelectId(configOid) || super.isNoSelectId(catalogOid) || super.isBlank(olapMdx.getName()) || super.isBlank(olapMdx.getOid())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<OlapMdxVO> oldResult = this.olapMdxService.findObjectByOid(olapMdx);
    if (oldResult.getValue() == null) {
        throw new ServiceException(oldResult.getSystemMessage().getValue());
    }
    // 查資料是否存在
    OlapConfVO config = this.loadOlapConfig(configOid);
    // 查資料是否存在
    OlapCatalogVO catalog = this.loadOlapCatalog(catalogOid);
    olapMdx.setConfOid(config.getOid());
    olapMdx.setCatalogOid(catalog.getOid());
    if (olapMdx.getName().equals(oldResult.getValue().getName()) && !olapMdx.getOid().equals(oldResult.getValue().getOid())) {
        // 存在別筆資料但UK相同 , 所以不能 UPDATE
        throw new ServiceException("Please change another name!");
    }
    oldResult.getValue().setExpression(null);
    // 先把BLOB 資料清掉
    this.olapMdxService.updateObject(oldResult.getValue());
    return this.olapMdxService.updateObject(olapMdx);
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OlapCatalogVO(com.netsteadfast.greenstep.vo.OlapCatalogVO) OlapMdxVO(com.netsteadfast.greenstep.vo.OlapMdxVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with OlapConfVO

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

the class AnalyticsMDXLogicServiceImpl method create.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<OlapMdxVO> create(OlapMdxVO olapMdx, String configOid, String catalogOid) throws ServiceException, Exception {
    if (null == olapMdx || super.isNoSelectId(configOid) || super.isNoSelectId(catalogOid) || super.isBlank(olapMdx.getName())) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    // 查資料是否存在
    OlapConfVO config = this.loadOlapConfig(configOid);
    // 查資料是否存在
    OlapCatalogVO catalog = this.loadOlapCatalog(catalogOid);
    olapMdx.setConfOid(config.getOid());
    olapMdx.setCatalogOid(catalog.getOid());
    return this.olapMdxService.saveObject(olapMdx);
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) OlapCatalogVO(com.netsteadfast.greenstep.vo.OlapCatalogVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with OlapConfVO

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

the class AnalyticsMDXLogicServiceImpl method loadOlapConfig.

private OlapConfVO loadOlapConfig(String oid) throws ServiceException, Exception {
    OlapConfVO conf = new OlapConfVO();
    conf.setOid(oid);
    DefaultResult<OlapConfVO> result = this.olapConfService.findObjectByOid(conf);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    conf = result.getValue();
    return conf;
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 4 with OlapConfVO

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

the class AnalyticsConfigSaveOrUpdateAction method update.

private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    OlapConfVO olapConf = new OlapConfVO();
    this.transformFields2ValueObject(olapConf, new String[] { "oid", "id", "name", "jdbcDrivers", "jdbcUrl", "description" });
    DefaultResult<OlapConfVO> result = this.analyticsConfigLogicService.update(olapConf);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO)

Example 5 with OlapConfVO

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

the class AnalyticsConfigSaveOrUpdateAction method delete.

private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    OlapConfVO olapConf = new OlapConfVO();
    this.transformFields2ValueObject(olapConf, new String[] { "oid" });
    DefaultResult<Boolean> result = this.analyticsConfigLogicService.delete(olapConf);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : OlapConfVO(com.netsteadfast.greenstep.vo.OlapConfVO)

Aggregations

OlapConfVO (com.netsteadfast.greenstep.vo.OlapConfVO)9 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)5 OlapCatalogVO (com.netsteadfast.greenstep.vo.OlapCatalogVO)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)2 Transactional (org.springframework.transaction.annotation.Transactional)2 AuthorityException (com.netsteadfast.greenstep.base.exception.AuthorityException)1 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)1 OlapMdxVO (com.netsteadfast.greenstep.vo.OlapMdxVO)1 File (java.io.File)1