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 47728c986..ec228b50f 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 @@ -229,6 +229,14 @@ public DemandResponse updateAsync(DemandRequest demandRequest, PaymentBackUpdate RequestInfo requestInfo = demandRequest.getRequestInfo(); List demands = demandRequest.getDemands(); AuditDetails auditDetail = util.getAuditDetail(requestInfo); + for (Demand demand : demands) { + AuditDetails currAuditDetails = demand.getAuditDetails(); + if (currAuditDetails != null) { + auditDetail.setCreatedTime(currAuditDetails.getCreatedTime()); + auditDetail.setCreatedBy(currAuditDetails.getCreatedBy()); + } + demand.setAuditDetails(auditDetail); + } List newDemands = new ArrayList<>(); diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/EnrichmentService.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/EnrichmentService.java index 24a3d3c2c..7c84d8b81 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/EnrichmentService.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/EnrichmentService.java @@ -198,9 +198,13 @@ private List getIdList(RequestInfo requestInfo, String tenantId, String * * @param waterConnectionRequest WaterConnectionRequest Object */ - public void enrichUpdateWaterConnection(WaterConnectionRequest waterConnectionRequest) { + public void enrichUpdateWaterConnection(AuditDetails currentAuditDetails, WaterConnectionRequest waterConnectionRequest) { AuditDetails auditDetails = waterServicesUtil .getAuditDetails(waterConnectionRequest.getRequestInfo().getUserInfo().getUuid(), false); + if (currentAuditDetails != null) { + auditDetails.setCreatedBy(currentAuditDetails.getCreatedBy()); + auditDetails.setCreatedTime(currentAuditDetails.getCreatedTime()); + } waterConnectionRequest.getWaterConnection().setAuditDetails(auditDetails); WaterConnection connection = waterConnectionRequest.getWaterConnection(); if (!CollectionUtils.isEmpty(connection.getDocuments())) { diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/WaterServiceImpl.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/WaterServiceImpl.java index b0d3c72b8..8130df986 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/WaterServiceImpl.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/WaterServiceImpl.java @@ -240,7 +240,7 @@ public List updateWaterConnection(WaterConnectionRequest waterC throw new CustomException("DUPLICATE_OLD_CONNECTION_NUMBER", "Duplicate Old connection number"); } - + AuditDetails auditDetails=waterConnection.get(0).getAuditDetails(); mDMSValidator.validateMasterData(waterConnectionRequest, WCConstants.UPDATE_APPLICATION); Property property = validateProperty.getOrValidateProperty(waterConnectionRequest); validateProperty.validatePropertyFields(property, waterConnectionRequest.getRequestInfo()); @@ -252,7 +252,7 @@ public List updateWaterConnection(WaterConnectionRequest waterC String previousApplicationStatus = workflowService.getApplicationStatus(waterConnectionRequest.getRequestInfo(), waterConnectionRequest.getWaterConnection().getApplicationNo(), waterConnectionRequest.getWaterConnection().getTenantId(), config.getBusinessServiceValue()); - enrichmentService.enrichUpdateWaterConnection(waterConnectionRequest); + enrichmentService.enrichUpdateWaterConnection(auditDetails, waterConnectionRequest); actionValidator.validateUpdateRequest(waterConnectionRequest, businessService, previousApplicationStatus); waterConnectionValidator.validateUpdate(waterConnectionRequest, searchResult, WCConstants.UPDATE_APPLICATION); userService.updateUser(waterConnectionRequest, searchResult); @@ -331,6 +331,7 @@ private List updateWaterConnectionForModifyFlow(WaterConnection throw new CustomException("DUPLICATE_OLD_CONNECTION_NUMBER", "Duplicate Old connection number"); } + AuditDetails auditDetails=waterConnection.get(0).getAuditDetails(); mDMSValidator.validateMasterData(waterConnectionRequest, WCConstants.MODIFY_CONNECTION); BusinessService businessService = workflowService.getBusinessService( waterConnectionRequest.getWaterConnection().getTenantId(), waterConnectionRequest.getRequestInfo(), @@ -342,7 +343,9 @@ private List updateWaterConnectionForModifyFlow(WaterConnection String previousApplicationStatus = workflowService.getApplicationStatus(waterConnectionRequest.getRequestInfo(), waterConnectionRequest.getWaterConnection().getApplicationNo(), waterConnectionRequest.getWaterConnection().getTenantId(), config.getModifyWSBusinessServiceName()); - enrichmentService.enrichUpdateWaterConnection(waterConnectionRequest); + if (auditDetails != null) { + enrichmentService.enrichUpdateWaterConnection(auditDetails, waterConnectionRequest); + } actionValidator.validateUpdateRequest(waterConnectionRequest, businessService, previousApplicationStatus); userService.updateUser(waterConnectionRequest, searchResult); waterConnectionValidator.validateUpdate(waterConnectionRequest, searchResult, WCConstants.MODIFY_CONNECTION);