Skip to content

Commit

Permalink
Correct update of information about the assessment
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandravv committed Nov 17, 2020
1 parent b48fb32 commit 097976b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'maven'

group = 'com.dw'
version = '0.19'
version = '1.0'

description = """qrapids-qma-elastic"""

Expand Down
18 changes: 2 additions & 16 deletions src/main/java/evaluation/StrategicIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,7 @@ public static List<FactorMetricEvaluationDTO> getMetricsEvaluations(String proje
StrategicIndicatorFactorEvaluationDTO siFactors = getFactorsEvaluations(projectId,strategicIndicatorID);

for (FactorEvaluationDTO factor : siFactors.getFactors()) {
ret.add(new FactorMetricEvaluationDTO(
factor.getID(),
factor.getName(),
factor.getProject(),
Factor.getMetricsEvaluations(
factor.getProject(),
factor.getID())
.getMetrics()));
ret.add(new FactorMetricEvaluationDTO(factor, Factor.getMetricsEvaluations(factor.getProject(),factor.getID()).getMetrics()));
}
return ret;
}
Expand Down Expand Up @@ -320,14 +313,7 @@ public static List<FactorMetricEvaluationDTO> getMetricsEvaluations(String proje
strategicIndicatorID, from, to);

for (FactorEvaluationDTO factor : siFactors.getFactors()) {
ret.add(new FactorMetricEvaluationDTO(
factor.getID(),
factor.getName(),
factor.getProject(),
Factor.getMetricsEvaluations(
factor.getProject(),
factor.getID(), from, to)
.getMetrics()));
ret.add(new FactorMetricEvaluationDTO(factor, Factor.getMetricsEvaluations(factor.getProject(),factor.getID(), from, to).getMetrics()));
}
return ret;
}
Expand Down
22 changes: 16 additions & 6 deletions src/main/java/util/Queries.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,18 @@ public static UpdateResponse setStrategicIndicatorValue(QMLevel QMLevel,
.field(PROJECT, projectId)
.field(STRATEGIC_INDICATOR_ID, strategicIndicatorID)
.field(EVALUATION_DATE, evaluationDate)
.field(DATA_SOURCE, "QRapids Dashboard")
.field(NAME, strategicIndicatorName)
.field(DESCRIPTION, strategicIndicatorDescription);
.field(DATA_SOURCE, "QRapids Dashboard");
//.field(NAME, strategicIndicatorName)
//.field(DESCRIPTION, strategicIndicatorDescription);

// If the entry already exists, we update the information about the assessment
XContentBuilder updateReqObj = jsonBuilder().startObject();

updateReqObj.field(NAME, strategicIndicatorName);
indexReqObj.field(NAME, strategicIndicatorName);
updateReqObj.field(DESCRIPTION, strategicIndicatorDescription);
indexReqObj.field(DESCRIPTION, strategicIndicatorDescription);

updateReqObj.field(VALUE, value);
indexReqObj.field(VALUE, value);
updateReqObj.field(RATIONALE, info);
Expand Down Expand Up @@ -422,13 +427,18 @@ public static UpdateResponse setFactorValue(QMLevel QMLevel,
.field(PROJECT, projectId)
.field(FACTOR_ID, factorID)
.field(EVALUATION_DATE, evaluationDate)
.field(DATA_SOURCE, "QRapids Dashboard")
.field(NAME, factorName)
.field(DESCRIPTION, factorDescription);
.field(DATA_SOURCE, "QRapids Dashboard");
//.field(NAME, factorName)
//.field(DESCRIPTION, factorDescription);

// If the entry already exists, we update the information about the assessment
XContentBuilder updateReqObj = jsonBuilder().startObject();

updateReqObj.field(NAME, factorName);
indexReqObj.field(NAME, factorName);
updateReqObj.field(DESCRIPTION, factorDescription);
indexReqObj.field(DESCRIPTION, factorDescription);

updateReqObj.field(VALUE, value);
indexReqObj.field(VALUE, value);
updateReqObj.field(RATIONALE, info);
Expand Down

0 comments on commit 097976b

Please sign in to comment.