use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class DegreeFeedbackLogicServiceImpl method startProcess.
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT, ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DegreeFeedbackProjectVO> startProcess(DegreeFeedbackProjectVO project) throws ServiceException, Exception {
if (null == project || super.isBlank(project.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<DegreeFeedbackProjectVO> result = this.degreeFeedbackProjectService.findObjectByOid(project);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
project = result.getValue();
if (YesNo.YES.equals(project.getPublishFlag())) {
throw new ServiceException("The project is published, cannot start audit processing!");
}
List<BusinessProcessManagementTaskVO> tasks = this.queryTaskByVariableProjectOid(project.getOid());
if (null != tasks && tasks.size() > 0) {
throw new ServiceException("Audit processing has been started!");
}
this.startProcess(this.getProcessFlowParam(project.getOid(), YesNo.YES, "start apply." + project.getName()));
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
return result;
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority 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);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority 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);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class DataQueryMapperLogicServiceImpl method updateMapper.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DataQueryMapperVO> updateMapper(DataQueryMapperVO queryMapper, List<Map<String, String>> fieldsData) throws ServiceException, Exception {
if (null == queryMapper || super.isBlank(queryMapper.getOid()) || null == fieldsData || fieldsData.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
// name 是 UK , 修改之前要檢查是否重復
DataQueryMapperVO checkQueryMapper = new DataQueryMapperVO();
checkQueryMapper.setName(queryMapper.getName());
DefaultResult<DataQueryMapperVO> checkResult = this.dataQueryMapperService.findByUK(checkQueryMapper);
if (checkResult.getValue() != null) {
checkQueryMapper = checkResult.getValue();
if (!checkQueryMapper.getOid().equals(queryMapper.getOid())) {
// 有別筆資料的 name (UK) 相同
throw new ServiceException("Please change name!");
}
}
this.deleteMapperSet(queryMapper);
this.createMapperSet(queryMapper, fieldsData);
return this.dataQueryMapperService.updateObject(queryMapper);
}
use of com.netsteadfast.greenstep.base.model.ServiceMethodAuthority in project bamboobsc by billchen198318.
the class DataSourceLogicServiceImpl method updateConf.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<DataSourceConfVO> updateConf(String driverOid, DataSourceConfVO dataSourceConf) throws ServiceException, Exception {
if (super.isBlank(driverOid) || null == dataSourceConf) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<DataSourceConfVO> oldResult = this.dataSourceConfService.findObjectByOid(dataSourceConf);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
// ID 是 UK, 不允許變動
dataSourceConf.setId(oldResult.getValue().getId());
DataSourceDriverVO driver = new DataSourceDriverVO();
driver.setOid(driverOid);
DefaultResult<DataSourceDriverVO> dResult = this.dataSourceDriverService.findObjectByOid(driver);
if (dResult.getValue() == null) {
throw new ServiceException(dResult.getSystemMessage().getValue());
}
driver = dResult.getValue();
dataSourceConf.setDriverId(driver.getId());
if (super.defaultString(dataSourceConf.getJdbcUrl()).length() > MAX_JDBC_URL_LENGTH) {
throw new ServiceException("jdbc-url Only allows " + String.valueOf(MAX_JDBC_URL_LENGTH) + " characters!");
}
if (null == dataSourceConf.getDescription()) {
dataSourceConf.setDescription("");
}
this.setStringValueMaxLength(dataSourceConf, "description", MAX_DESCRIPTION_LENGTH);
return dataSourceConfService.updateObject(dataSourceConf);
}
Aggregations