From 52e784b7efe155da16ea98b0be451265dc716f94 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Thu, 18 Jan 2024 14:11:14 +0530 Subject: [PATCH 01/10] PFM-4114 added log lines --- .../org/egov/echallan/config/ChallanConfiguration.java | 3 +++ .../egov/echallan/repository/ChallanRepository.java | 10 +++++----- .../src/main/resources/application.properties | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java index 32c8509e4..bdd99ed69 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java @@ -80,6 +80,9 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${persister.update.challan.topic}") private String updateChallanTopic; + + @Value("${persister.update.challan.topic}") + private String updateNewChallanTopic; @Value("${persister.update.status.challan.topic}") private String updateStatusChallanTopic; diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java index 049eb49d6..04bb76cd1 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java @@ -111,11 +111,11 @@ public void save(ChallanRequest challanRequest) { */ public void update(ChallanRequest challanRequest) { - if(challanRequest.getChallan().getPaidDate()!=null) - { - challanRequest.getChallan().setPaidDate(Long.valueOf(challanRequest.getChallan().getPaidDate())); - } - log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" | PAID DATE: "+challanRequest.getChallan().getPaidDate()); +// if(challanRequest.getChallan().getPaidDate()!=null) +// { +// challanRequest.getChallan().setPaidDate(Long.valueOf(challanRequest.getChallan().getPaidDate())); +// } + log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" | PAID DATE: "+challanRequest.getChallan().getPaidDate()+" | STATUS: "+challanRequest.getChallan().getApplicationStatus()); producer.push(config.getUpdateChallanTopic(), challanRequest); } diff --git a/municipal-services/echallan-services/src/main/resources/application.properties b/municipal-services/echallan-services/src/main/resources/application.properties index 3f21f5ec6..22f798592 100644 --- a/municipal-services/echallan-services/src/main/resources/application.properties +++ b/municipal-services/echallan-services/src/main/resources/application.properties @@ -49,6 +49,7 @@ spring.kafka.producer.buffer_memory_config=33554432 #persister configs persister.save.challan.topic=save-challan persister.update.challan.topic=update-challan +persister.update.new.challan.topic=update-new-challan persister.update.status.challan.topic=update-status-challan kafka.topics.filestore=PDF_GEN_CREATE kafka.topics.receipt.cancel.name=egov.collection.payment-cancel From e41049974507d7a93764e2e1655855f3333004f1 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 10:29:01 +0530 Subject: [PATCH 02/10] PFM-4114 added log lines --- .../java/org/egov/echallan/config/ChallanConfiguration.java | 2 +- .../java/org/egov/echallan/expense/service/PaymentService.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java index bdd99ed69..704693ad0 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java @@ -81,7 +81,7 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${persister.update.challan.topic}") private String updateChallanTopic; - @Value("${persister.update.challan.topic}") + @Value("${persister.update.new.challan.topic}") private String updateNewChallanTopic; @Value("${persister.update.status.challan.topic}") diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java index 376a3108c..7464f2b2d 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java @@ -120,11 +120,12 @@ public PaymentResponse updatePayment(ChallanRequest request) { StringBuilder uri = new StringBuilder(config.getPaymentContextPath()) .append(config.getPaymentUpdateEndpoint()); - System.out.println("URL to check the payment search::" + uri); + log.info("URL to check the payment search::" + uri +" and paymentworkflow is " + paymentWorkflow); Object result = serviceRequestRepository.fetchResult(uri, PaymentWorkflowRequest.builder() .paymentWorkflows(Arrays.asList(paymentWorkflow)).requestInfo(request.getRequestInfo()).build()); try { response = mapper.convertValue(result, PaymentResponse.class); + log.info(response.toString()); } catch (IllegalArgumentException e) { log.error("Error parsing update payment response Challan id : " + challan.getId()); throw new CustomException("EXP_PAYMENT_PARSING_ERROR", "Unable to parse payment response"); From c03b493eb15092ea62841a20a5c9da5591301785 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 11:27:50 +0530 Subject: [PATCH 03/10] PFM-4114 --- .../src/main/java/org/egov/echallan/service/ChallanService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java index 016658101..41da17b5c 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java @@ -158,11 +158,11 @@ public Challan update(ChallanRequest request, Map finalData) { userService.setAccountUser(request); enrichmentService.enrichUpdateRequest(request, searchResult.get(0)); calculationService.addCalculation(request); - repository.update(request); if (request.getChallan().getApplicationStatus() == StatusEnum.PAID && searchResult.get(0).getApplicationStatus() == StatusEnum.ACTIVE) paymentService.createPayment(request); if (searchResult.get(0).getApplicationStatus() == StatusEnum.PAID) paymentService.updatePayment(request); + repository.update(request); return request.getChallan(); } From 7302ba319d4425542082a82915b62fe401973416 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 12:11:50 +0530 Subject: [PATCH 04/10] PFM-4114 --- .../main/java/org/egov/echallan/service/ChallanService.java | 2 +- .../java/org/egov/echallan/service/PaymentUpdateService.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java index 41da17b5c..a40c8f662 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java @@ -162,7 +162,7 @@ public Challan update(ChallanRequest request, Map finalData) { paymentService.createPayment(request); if (searchResult.get(0).getApplicationStatus() == StatusEnum.PAID) paymentService.updatePayment(request); - repository.update(request); + repository.update(request); return request.getChallan(); } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java index cd2a3b721..007f490fe 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java @@ -90,6 +90,10 @@ public void process(HashMap record) { challan.setIsBillPaid(true); challan.setAuditDetails(auditDetails); ChallanRequest request = ChallanRequest.builder().requestInfo(requestInfo).challan(challan).build(); + log.info("Inside receipt topic -> Challan request "+request); + log.info("Paid Date"+request.getChallan().getPaidDate()); + log.info("Is Bill Paid"+request.getChallan().getIsBillPaid()); + log.info("Application status"+request.getChallan().getApplicationStatus()); producer.push(config.getUpdateChallanTopic(), request); }); } From af87802bd41bcfed00a5c126ce533bb38b9f61fc Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 12:48:21 +0530 Subject: [PATCH 05/10] PFM-4114 --- .../egov/echallan/service/PaymentUpdateService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java index 007f490fe..e78965228 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java @@ -90,11 +90,11 @@ public void process(HashMap record) { challan.setIsBillPaid(true); challan.setAuditDetails(auditDetails); ChallanRequest request = ChallanRequest.builder().requestInfo(requestInfo).challan(challan).build(); - log.info("Inside receipt topic -> Challan request "+request); - log.info("Paid Date"+request.getChallan().getPaidDate()); - log.info("Is Bill Paid"+request.getChallan().getIsBillPaid()); - log.info("Application status"+request.getChallan().getApplicationStatus()); - producer.push(config.getUpdateChallanTopic(), request); +// log.info("Inside receipt topic -> Challan request "+request); + log.info("Paid Date "+request.getChallan().getPaidDate()); + log.info("Is Bill Paid "+request.getChallan().getIsBillPaid()); + log.info("Application status "+request.getChallan().getApplicationStatus()); + producer.push(config.getUpdateNewChallanTopic(), request); }); } } From c77c53d89e351393f0e057e02855da9a7118f10b Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 14:21:43 +0530 Subject: [PATCH 06/10] PFM-4114 --- .../egov/echallan/repository/builder/ChallanQueryBuilder.java | 2 +- .../src/main/java/org/egov/echallan/service/ChallanService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java index 36f19a550..d3735c0f7 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java @@ -45,7 +45,7 @@ public ChallanQueryBuilder(ChallanConfiguration config) { public static final String FILESTOREID_UPDATE_SQL = "UPDATE eg_echallan SET filestoreid=? WHERE id=?"; - public static final String CANCEL_RECEIPT_UPDATE_SQL = "UPDATE eg_echallan SET applicationStatus='ACTIVE' WHERE referenceId=? and businessService=?"; + public static final String CANCEL_RECEIPT_UPDATE_SQL = "UPDATE eg_echallan SET applicationStatus='CANCELLED' WHERE referenceId=? and businessService=?"; private static final String TENANTIDS = "SELECT distinct(tenantid) FROM eg_echallan challan"; diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java index a40c8f662..016658101 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java @@ -158,11 +158,11 @@ public Challan update(ChallanRequest request, Map finalData) { userService.setAccountUser(request); enrichmentService.enrichUpdateRequest(request, searchResult.get(0)); calculationService.addCalculation(request); + repository.update(request); if (request.getChallan().getApplicationStatus() == StatusEnum.PAID && searchResult.get(0).getApplicationStatus() == StatusEnum.ACTIVE) paymentService.createPayment(request); if (searchResult.get(0).getApplicationStatus() == StatusEnum.PAID) paymentService.updatePayment(request); - repository.update(request); return request.getChallan(); } From 60ed268bf3604d896069a54d947f190a87a8def8 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 14:25:59 +0530 Subject: [PATCH 07/10] PFM-4114 --- .../java/org/egov/echallan/service/PaymentUpdateService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java index e78965228..adb17fbed 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java @@ -94,7 +94,7 @@ public void process(HashMap record) { log.info("Paid Date "+request.getChallan().getPaidDate()); log.info("Is Bill Paid "+request.getChallan().getIsBillPaid()); log.info("Application status "+request.getChallan().getApplicationStatus()); - producer.push(config.getUpdateNewChallanTopic(), request); + producer.push(config.getUpdateChallanTopic(), request); }); } } From db23858ce0b8e10885f0e450306f152d999093df Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 14:41:21 +0530 Subject: [PATCH 08/10] PFM-4114 --- .../java/org/egov/echallan/config/ChallanConfiguration.java | 3 --- .../src/main/resources/application.properties | 1 - 2 files changed, 4 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java index 704693ad0..32c8509e4 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java @@ -80,9 +80,6 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${persister.update.challan.topic}") private String updateChallanTopic; - - @Value("${persister.update.new.challan.topic}") - private String updateNewChallanTopic; @Value("${persister.update.status.challan.topic}") private String updateStatusChallanTopic; diff --git a/municipal-services/echallan-services/src/main/resources/application.properties b/municipal-services/echallan-services/src/main/resources/application.properties index 22f798592..3f21f5ec6 100644 --- a/municipal-services/echallan-services/src/main/resources/application.properties +++ b/municipal-services/echallan-services/src/main/resources/application.properties @@ -49,7 +49,6 @@ spring.kafka.producer.buffer_memory_config=33554432 #persister configs persister.save.challan.topic=save-challan persister.update.challan.topic=update-challan -persister.update.new.challan.topic=update-new-challan persister.update.status.challan.topic=update-status-challan kafka.topics.filestore=PDF_GEN_CREATE kafka.topics.receipt.cancel.name=egov.collection.payment-cancel From b8e3834a9650995bf490bb73d897fd330a07c32f Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 15:24:44 +0530 Subject: [PATCH 09/10] PFM-4114 --- .../org/egov/echallan/expense/service/PaymentService.java | 2 -- .../java/org/egov/echallan/repository/ChallanRepository.java | 5 ----- .../java/org/egov/echallan/service/PaymentUpdateService.java | 4 ---- 3 files changed, 11 deletions(-) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java index 7464f2b2d..655f452e5 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java @@ -120,12 +120,10 @@ public PaymentResponse updatePayment(ChallanRequest request) { StringBuilder uri = new StringBuilder(config.getPaymentContextPath()) .append(config.getPaymentUpdateEndpoint()); - log.info("URL to check the payment search::" + uri +" and paymentworkflow is " + paymentWorkflow); Object result = serviceRequestRepository.fetchResult(uri, PaymentWorkflowRequest.builder() .paymentWorkflows(Arrays.asList(paymentWorkflow)).requestInfo(request.getRequestInfo()).build()); try { response = mapper.convertValue(result, PaymentResponse.class); - log.info(response.toString()); } catch (IllegalArgumentException e) { log.error("Error parsing update payment response Challan id : " + challan.getId()); throw new CustomException("EXP_PAYMENT_PARSING_ERROR", "Unable to parse payment response"); diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java index 04bb76cd1..420be7d3b 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java @@ -110,11 +110,6 @@ public void save(ChallanRequest challanRequest) { * @param ChallanRequest The challan create request */ public void update(ChallanRequest challanRequest) { - -// if(challanRequest.getChallan().getPaidDate()!=null) -// { -// challanRequest.getChallan().setPaidDate(Long.valueOf(challanRequest.getChallan().getPaidDate())); -// } log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" | PAID DATE: "+challanRequest.getChallan().getPaidDate()+" | STATUS: "+challanRequest.getChallan().getApplicationStatus()); producer.push(config.getUpdateChallanTopic(), challanRequest); } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java index adb17fbed..cd2a3b721 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java @@ -90,10 +90,6 @@ public void process(HashMap record) { challan.setIsBillPaid(true); challan.setAuditDetails(auditDetails); ChallanRequest request = ChallanRequest.builder().requestInfo(requestInfo).challan(challan).build(); -// log.info("Inside receipt topic -> Challan request "+request); - log.info("Paid Date "+request.getChallan().getPaidDate()); - log.info("Is Bill Paid "+request.getChallan().getIsBillPaid()); - log.info("Application status "+request.getChallan().getApplicationStatus()); producer.push(config.getUpdateChallanTopic(), request); }); } From b0b720214b2697f7c4b49f384822d64563503e76 Mon Sep 17 00:00:00 2001 From: Saloni-eGov Date: Fri, 19 Jan 2024 15:26:15 +0530 Subject: [PATCH 10/10] PFM-4114 --- .../java/org/egov/echallan/expense/service/PaymentService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java index 655f452e5..376a3108c 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/expense/service/PaymentService.java @@ -120,6 +120,7 @@ public PaymentResponse updatePayment(ChallanRequest request) { StringBuilder uri = new StringBuilder(config.getPaymentContextPath()) .append(config.getPaymentUpdateEndpoint()); + System.out.println("URL to check the payment search::" + uri); Object result = serviceRequestRepository.fetchResult(uri, PaymentWorkflowRequest.builder() .paymentWorkflows(Arrays.asList(paymentWorkflow)).requestInfo(request.getRequestInfo()).build()); try {