(fix)(headless)Fix updating measure agg doesn't take effect.

This commit is contained in:
jerryjzhang
2025-02-19 18:11:02 +08:00
parent 33268bf3d9
commit 335e1f9ada
3 changed files with 8 additions and 6 deletions

View File

@@ -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());

View File

@@ -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;
} }

View File

@@ -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);