From 811eb4edddbacec6bbf0370a86779ac161d64ccc Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Thu, 1 Aug 2024 12:50:56 +0300 Subject: [PATCH] reference fixes --- .../service/description/DescriptionServiceImpl.java | 3 ++- .../java/org/opencdmp/service/plan/PlanServiceImpl.java | 7 ++++--- .../java/org/opencdmp/service/user/UserServiceImpl.java | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java index 24907f17a..96719ab3c 100644 --- a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java @@ -745,6 +745,7 @@ public class DescriptionServiceImpl implements DescriptionService { referenceEntity = new ReferenceEntity(); referenceEntity.setId(UUID.randomUUID()); referenceEntity.setLabel(referencePersist.getLabel()); + referenceEntity.setDescription(referencePersist.getDescription()); referenceEntity.setIsActive(IsActive.Active); referenceEntity.setCreatedAt(Instant.now()); referenceEntity.setTypeId(fieldEntity.getReferenceTypeId()); @@ -882,7 +883,7 @@ public class DescriptionServiceImpl implements DescriptionService { data.setCode(persist.getCode()); data.setDataType(persist.getDataType()); - data.setCode(persist.getCode()); + data.setValue(persist.getValue()); return data; } diff --git a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java index 13b8600e1..2799e7d7c 100644 --- a/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/plan/PlanServiceImpl.java @@ -1093,6 +1093,7 @@ public class PlanServiceImpl implements PlanService { referenceEntity = new ReferenceEntity(); referenceEntity.setId(UUID.randomUUID()); referenceEntity.setLabel(referencePersist.getLabel()); + referenceEntity.setDescription(referencePersist.getDescription()); referenceEntity.setIsActive(IsActive.Active); referenceEntity.setCreatedAt(Instant.now()); referenceEntity.setTypeId(fieldEntity.getReferenceTypeId()); @@ -1179,7 +1180,7 @@ public class PlanServiceImpl implements PlanService { if (!this.conventionService.isListNullOrEmpty(persist.getFields())){ data.setFields(new ArrayList<>()); for (FieldPersist fieldPersist: persist.getFields()) { - data.getFields().add(this.buildPlanContactEntity(fieldPersist)); + data.getFields().add(this.buildFieldEntity(fieldPersist)); } } @@ -1193,13 +1194,13 @@ public class PlanServiceImpl implements PlanService { return data; } - private @NotNull FieldEntity buildPlanContactEntity(FieldPersist persist){ + private @NotNull FieldEntity buildFieldEntity(FieldPersist persist){ FieldEntity data = new FieldEntity(); if (persist == null) return data; data.setCode(persist.getCode()); data.setDataType(persist.getDataType()); - data.setCode(persist.getCode()); + data.setValue(persist.getValue()); return data; } diff --git a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java index 1175ca252..b1dd5a25c 100644 --- a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java @@ -223,6 +223,7 @@ public class UserServiceImpl implements UserService { referenceEntity = new ReferenceEntity(); referenceEntity.setId(UUID.randomUUID()); referenceEntity.setLabel(model.getLabel()); + referenceEntity.setDescription(model.getDescription()); referenceEntity.setIsActive(IsActive.Active); referenceEntity.setCreatedAt(Instant.now()); referenceEntity.setTypeId(model.getTypeId()); @@ -272,7 +273,7 @@ public class UserServiceImpl implements UserService { data.setCode(persist.getCode()); data.setDataType(persist.getDataType()); - data.setCode(persist.getCode()); + data.setValue(persist.getValue()); return data; }