|
@@ -232,6 +232,23 @@ public class GrowthRecordService {
|
|
|
return record;
|
|
return record;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Associate a growth record with an assessment result.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param growthRecordId the ID of the growth record to associate
|
|
|
|
|
+ * @param assessmentResultId the ID of the assessment result to associate with
|
|
|
|
|
+ * @return true if the association was successful, false otherwise
|
|
|
|
|
+ */
|
|
|
|
|
+ public Boolean associateWithAssessment(Long growthRecordId, Long assessmentResultId) {
|
|
|
|
|
+ GrowthRecord record = growthRecordMapper.selectById(growthRecordId);
|
|
|
|
|
+ if (record == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ record.setAssessmentId(assessmentResultId);
|
|
|
|
|
+ growthRecordMapper.updateById(record);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// ========== Private helpers ==========
|
|
// ========== Private helpers ==========
|
|
|
|
|
|
|
|
private String computeDedupHash(Long childId, Date reportDate, String sourceType, Long parentRecordId) {
|
|
private String computeDedupHash(Long childId, Date reportDate, String sourceType, Long parentRecordId) {
|