Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #731 from egovernments/PFM-5564
Browse files Browse the repository at this point in the history
Pfm 5564
  • Loading branch information
pradeepkumarcm-egov authored Feb 14, 2024
2 parents 2a7ef07 + 19f0691 commit 0660b5d
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ private List<Demand> createDemand(RequestInfo requestInfo, List<Calculation> cal
//sendPaymentAndBillSMSNotification(requestInfo,tenantId,owner,waterConnectionRequest,property,demandDetails,consumerCode,demands,isForConnectionNO,businessService,billCycle,billNumbers,paymentDueDate);
}
}
sendDownloadBillSMSNotification(requestInfo,tenantId,owner,waterConnectionRequest,property,demandDetails,consumerCode,demands,isForConnectionNO,businessService,billCycle,billNumbers,paymentDueDate);
BigDecimal totalAmount=fetchTotalBillAmount(demands,requestInfo);
//log.info("Total Amount from fetch Bill"+String.valueOf(totalAmount));
if(totalAmount!=null && totalAmount.signum()> 0)
sendDownloadBillSMSNotification(requestInfo,tenantId,owner,waterConnectionRequest,property,demandDetails,consumerCode,demands,isForConnectionNO,businessService,billCycle,billNumbers,paymentDueDate,totalAmount);
}
}
log.info("Demand Object" + demands.toString());
Expand Down Expand Up @@ -348,7 +351,7 @@ private void sendPaymentSMSNotification(RequestInfo requestInfo, String tenantId
}
}
}
private void sendDownloadBillSMSNotification(RequestInfo requestInfo, String tenantId, User owner, WaterConnectionRequest waterConnectionRequest, Property property, List<DemandDetail> demandDetails, String consumerCode, List<Demand> demands, Boolean isForConnectionNO, String businessService, String billCycle,List<String> billNumbers, String paymentDueDate) {
private void sendDownloadBillSMSNotification(RequestInfo requestInfo, String tenantId, User owner, WaterConnectionRequest waterConnectionRequest, Property property, List<DemandDetail> demandDetails, String consumerCode, List<Demand> demands, Boolean isForConnectionNO, String businessService, String billCycle,List<String> billNumbers, String paymentDueDate,BigDecimal totalamount) {
HashMap<String, String> localizationMessage = util.getLocalizationMessage(requestInfo,
WSCalculationConstant.mGram_Consumer_NewBill, tenantId);
String actionLink = config.getNotificationUrl()
Expand All @@ -364,22 +367,21 @@ private void sendDownloadBillSMSNotification(RequestInfo requestInfo, String ten
}
String messageString = localizationMessage.get(WSCalculationConstant.MSG_KEY);

System.out.println("Localization message get bill::" + messageString);
System.out.println("isForConnectionNO:" + isForConnectionNO);
//System.out.println("Localization message get bill::" + messageString);
//System.out.println("isForConnectionNO:" + isForConnectionNO);
if (!StringUtils.isEmpty(messageString) && isForConnectionNO) {
log.info("Demand Object get bill" + demands.toString());
log.info("requestInfo get Bill" + requestInfo);
log.info("bill number get bill size :" + billNumbers.size());
if (billNumbers.size() > 0) {
if (totalamount!=null && billNumbers.size() > 0 && totalamount.signum()>0) {
actionLink = actionLink.replace("$billNumber", billNumbers.get(0));
messageString = messageString.replace("{ownername}", owner.getName());
messageString = messageString.replace("{Period}", billCycle);
messageString = messageString.replace("{consumerno}", consumerCode);
messageString = messageString.replace("{billamount}", demandDetails.stream()
.map(DemandDetail::getTaxAmount).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
messageString = messageString.replace("{billamount}", totalamount.toString());
messageString = messageString.replace("{BILL_LINK}", getShortenedUrl(actionLink));

System.out.println("Demand genaration Message get bill::" + messageString);
// System.out.println("Demand genaration Message get bill::" + messageString);

SMSRequest sms = SMSRequest.builder().mobileNumber(owner.getMobileNumber()).message(messageString).tenantid(tenantId)
.category(Category.TRANSACTION).build();
Expand Down

0 comments on commit 0660b5d

Please sign in to comment.