mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(fix)(headless)Fix updating measure agg doesn't take effect.
This commit is contained in:
@@ -106,8 +106,6 @@ public class PromptHelper {
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(metric.getDefaultAgg())) {
|
if (StringUtils.isNotEmpty(metric.getDefaultAgg())) {
|
||||||
metricStr.append(" AGGREGATE '" + metric.getDefaultAgg().toUpperCase() + "'");
|
metricStr.append(" AGGREGATE '" + metric.getDefaultAgg().toUpperCase() + "'");
|
||||||
} else {
|
|
||||||
metricStr.append(" AGGREGATE 'NONE'");
|
|
||||||
}
|
}
|
||||||
metricStr.append(">");
|
metricStr.append(">");
|
||||||
metrics.add(metricStr.toString());
|
metrics.add(metricStr.toString());
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
|||||||
} else {
|
} else {
|
||||||
MetricResp metricRespByBizName = bizNameMap.get(metric.getBizName());
|
MetricResp metricRespByBizName = bizNameMap.get(metric.getBizName());
|
||||||
MetricResp metricRespByName = nameMap.get(metric.getName());
|
MetricResp metricRespByName = nameMap.get(metric.getName());
|
||||||
if (null != metricRespByBizName && isChange(metric, metricRespByBizName)) {
|
if (null != metricRespByBizName) {
|
||||||
metric.setId(metricRespByBizName.getId());
|
metric.setId(metricRespByBizName.getId());
|
||||||
this.updateMetric(metric, user);
|
this.updateMetric(metric, user);
|
||||||
} else {
|
} else {
|
||||||
if (null != metricRespByName && isChange(metric, metricRespByName)) {
|
if (null != metricRespByName) {
|
||||||
metric.setId(metricRespByName.getId());
|
metric.setId(metricRespByName.getId());
|
||||||
this.updateMetric(metric, user);
|
this.updateMetric(metric, user);
|
||||||
}
|
}
|
||||||
@@ -819,7 +819,7 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
|||||||
return modelResps.stream().map(ModelResp::getId).collect(Collectors.toSet());
|
return modelResps.stream().map(ModelResp::getId).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isChange(MetricReq metricReq, MetricResp metricResp) {
|
private boolean isNameChange(MetricReq metricReq, MetricResp metricResp) {
|
||||||
boolean isNameChange = !metricReq.getName().equals(metricResp.getName());
|
boolean isNameChange = !metricReq.getName().equals(metricResp.getName());
|
||||||
return isNameChange;
|
return isNameChange;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,8 +142,12 @@ public class ModelServiceImpl implements ModelService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ModelResp updateModel(ModelReq modelReq, User user) throws Exception {
|
public ModelResp updateModel(ModelReq modelReq, User user) throws Exception {
|
||||||
// checkParams(modelReq);
|
// Comment out below checks for now, they seem unnecessary and
|
||||||
|
// lead to unexpected exception in updating model
|
||||||
|
/*
|
||||||
|
checkParams(modelReq);
|
||||||
checkRelations(modelReq);
|
checkRelations(modelReq);
|
||||||
|
*/
|
||||||
ModelDO modelDO = modelRepository.getModelById(modelReq.getId());
|
ModelDO modelDO = modelRepository.getModelById(modelReq.getId());
|
||||||
ModelConverter.convert(modelDO, modelReq, user);
|
ModelConverter.convert(modelDO, modelReq, user);
|
||||||
modelRepository.updateModel(modelDO);
|
modelRepository.updateModel(modelDO);
|
||||||
|
|||||||
Reference in New Issue
Block a user