From 16815eb723f4cc5d94a0c61718759cb54e42323c Mon Sep 17 00:00:00 2001 From: Taniya-eGov Date: Fri, 25 Oct 2024 15:16:15 +0530 Subject: [PATCH] Created date issue --- .../org/egov/demand/service/DemandService.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java index fc68a687b..02b9e9eb8 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/service/DemandService.java @@ -250,12 +250,13 @@ public DemandResponse updateAsync(DemandRequest demandRequest, PaymentBackUpdate */ newDemands.add(demand); } else { - AuditDetails currAuditDetails = demand.getAuditDetails(); - if (currAuditDetails != null) { - auditDetail.setCreatedTime(currAuditDetails.getCreatedTime()); - auditDetail.setCreatedBy(currAuditDetails.getCreatedBy()); + AuditDetails updateAuditDetail = util.getAuditDetail(requestInfo); + AuditDetails demandAuditDetails = demand.getAuditDetails(); + if (demandAuditDetails != null) { + updateAuditDetail.setCreatedTime(demandAuditDetails.getCreatedTime()); + updateAuditDetail.setCreatedBy(demandAuditDetails.getCreatedBy()); } - demand.setAuditDetails(auditDetail); + demand.setAuditDetails(updateAuditDetail); for (DemandDetail detail : demand.getDemandDetails()) { if (StringUtils.isEmpty(detail.getId())) { @@ -265,7 +266,12 @@ public DemandResponse updateAsync(DemandRequest demandRequest, PaymentBackUpdate detail.setId(UUID.randomUUID().toString()); detail.setCollectionAmount(BigDecimal.ZERO); } - detail.setAuditDetails(auditDetail); + AuditDetails demandDetailAuditDetail = detail.getAuditDetails(); + if (demandDetailAuditDetail != null) { + updateAuditDetail.setCreatedTime(demandDetailAuditDetail.getCreatedTime()); + updateAuditDetail.setCreatedBy(demandDetailAuditDetail.getCreatedBy()); + } + detail.setAuditDetails(updateAuditDetail); detail.setDemandId(demandId); detail.setTenantId(demand.getTenantId()); }