From 90c19e7d496e716457d4fb83b330055c9cec0483 Mon Sep 17 00:00:00 2001 From: paramita Date: Tue, 3 Sep 2024 17:53:20 +0530 Subject: [PATCH] modification of TDS code --- src/TDS_Calculate/TDS_Calculation.java | 429 ++++++++++++++++--------- 1 file changed, 269 insertions(+), 160 deletions(-) diff --git a/src/TDS_Calculate/TDS_Calculation.java b/src/TDS_Calculate/TDS_Calculation.java index 96231f6..5f12e5c 100644 --- a/src/TDS_Calculate/TDS_Calculation.java +++ b/src/TDS_Calculate/TDS_Calculation.java @@ -4,6 +4,7 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Timestamp; import java.text.DecimalFormat; import java.time.LocalDate; @@ -47,11 +48,10 @@ public class TDS_Calculation { //Calculate the Projected value and insert into the table TDS_TXN for (Map accountDetails : depAccountsDetails) { //String accNo = (String) accountDetails.get("KEY_1"); - + //Caclculate the Projected amount. - calculateProjectedAmount(accountDetails); + // calculateProjectedAmount(accountDetails); //System.out.println("Projected amount for the account:" + accNo + " " + ProjectedAmt); - //insertProjectedAmount(accNo, ProjectedAmt, prodCode); } @@ -66,7 +66,7 @@ public class TDS_Calculation { + "DA.INTT_PAID,DP.PROD_CODE,DA.INTT_SOP_DATE,DA.INTT_EOP_DATE,DA.TERM_VALUE,DA.MAT_VALUE,DA.MAT_DT,DA.TERM_LENGTH,\n" + "DA.NXT_DUE_DATE,DA.INTT_PROJECTED,dp.INTT_PAYOUT_FREQ FROM DEP_ACCOUNT DA ,dep_product dp\n" + "where DA.DEP_PROD_ID=dp.ID and substr(dp.prod_code,1,1) in ('2','3') and substr(DA.GL_CLASS_CODE,9,2)='14'\n" - + "and DA.CURR_STATUS ='O'and da.INTT_PAID >100000 group by DA.KEY_1,DA.PACS_ID,DA.CURR_STATUS,DA.CUSTOMER_NO,DA.ACCT_OPEN_DT,\n" + + "and DA.CURR_STATUS ='O' and DA.PACS_ID in ('02000','07190','07544') group by DA.KEY_1,DA.PACS_ID,DA.CURR_STATUS,DA.CUSTOMER_NO,DA.ACCT_OPEN_DT,\n" + "DA.INTT_PAID,DA.INTT_SOP_DATE,DA.INTT_EOP_DATE,DA.TERM_VALUE,DA.MAT_VALUE,DA.MAT_DT,DA.TERM_LENGTH,\n" + "DA.NXT_DUE_DATE,DA.INTT_PROJECTED,dp.INTT_PAYOUT_FREQ,DP.PROD_CODE"; PreparedStatement preparedStatement = conn.prepareStatement(depAccountSql); @@ -110,59 +110,71 @@ public class TDS_Calculation { try (Connection conn = DriverManager.getConnection(URL, USERNAME, PASWORD)) { for (Map acc : depAccountsDetails) { String CIF_No = (String) acc.get("CUSTOMER_NO"); - String KEY_1 = (String) acc.get("KEY_1"); - Double INTT_PAID = (Double) acc.get("INTT_PAID"); - String PACS_ID = (String) acc.get("PACS_ID"); + String KEY_1 = (String) acc.get("KEY_1"); + Double INTT_PAID = (Double) acc.get("INTT_PAID"); + String PACS_ID = (String) acc.get("PACS_ID"); String ID_TYPE = identificationData.get(CIF_No); //System.out.println("ID TYPE is: " + ID_TYPE); // LocalDate birthDt = null; String bDaySql = "SELECT TO_CHAR(TO_DATE(BIRTH_DATE,'DD-MM-YYYY'),'DD-MM-YYYY') AS BIRTH_DATE FROM KYC_HDR WHERE CIF_NO = ?"; - PreparedStatement ps = conn.prepareStatement(bDaySql); - ps.setString(1, CIF_No); - ResultSet rs = ps.executeQuery(); + try (PreparedStatement ps = conn.prepareStatement(bDaySql)) { + ps.setString(1, CIF_No); + try (ResultSet rs = ps.executeQuery()) { - while (rs.next()) { + while (rs.next()) { - try { - birth_date = rs.getString("BIRTH_DATE"); - //System.out.println("Birth Date: "+birth_date); + try { + birth_date = rs.getString("BIRTH_DATE"); + //System.out.println("Birth Date: "+birth_date); + } catch (SQLException e) { + System.err.println("null pointer"); + } + if (birth_date != null) { + //System.out.println("Birth Date:" + birth_date); + LocalDate submission_date = LocalDate.now(); + + DateTimeFormatter bdayFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); + LocalDate birthdate = LocalDate.parse(birth_date, bdayFormatter); + //if (birth_date != null) { + Period period = Period.between(birthdate, submission_date); + int age = period.getYears(); // Get the years from here. + + if (age >= 60) { + formType = "H"; + } else { + formType = "G"; + } + + if ("PAN CARD".equalsIgnoreCase(ID_TYPE)) { + PanAvailability(KEY_1, INTT_PAID, CIF_No, formType, PACS_ID); + } else { + PanNotAvailability(KEY_1, INTT_PAID, CIF_No, formType, PACS_ID); + } + } + } } catch (Exception e) { - System.err.println("null pointer"); - } - if (birth_date != null) { - //System.out.println("Birth Date:" + birth_date); - LocalDate submission_date = LocalDate.now(); - - DateTimeFormatter bdayFormatter = DateTimeFormatter.ofPattern("dd-MM-yyyy"); - LocalDate birthdate = LocalDate.parse(birth_date, bdayFormatter); - //if (birth_date != null) { - Period period = Period.between(birthdate, submission_date); - int age = period.getYears(); // Get the years from here. - - if (age >= 60) { - formType = "H"; - } else { - formType = "G"; - } - - if ("PAN CARD".equalsIgnoreCase(ID_TYPE)) { - PanAvailability(KEY_1,INTT_PAID, CIF_No, formType,PACS_ID); - } else { - PanNotAvailability(KEY_1,INTT_PAID, CIF_No, formType,PACS_ID); - } + //System.out.println("Processing done"); + e.printStackTrace(); } + }catch (Exception e) { + //System.out.println("Processing done"); + e.printStackTrace(); } + + + } + } catch (Exception ex) { ex.printStackTrace(); } } - public static void PanAvailability(String KEY_1,Double INTT_PAID, String CIF_No, String formType,String PACS_ID) { + public static void PanAvailability(String KEY_1, Double INTT_PAID, String CIF_No, String formType, String PACS_ID) { - System.out.println("CIF No:" + CIF_No + " is having Pan " + " with Form Type " + formType + " and interest Paid:" +INTT_PAID+ " for PACS ID: " +PACS_ID); + System.out.println("CIF No:" + CIF_No + " is having Pan " + " with Form Type " + formType + " and interest Paid:" + INTT_PAID + " for PACS ID: " + PACS_ID); double thresold_G = 250000; double thresold_H = 300000; double thresold = 0.0; @@ -173,7 +185,6 @@ public class TDS_Calculation { } else if (formType.equalsIgnoreCase("G")) { thresold = thresold_G; } - DecimalFormat df_obj = new DecimalFormat("#.####"); @@ -191,92 +202,140 @@ public class TDS_Calculation { // // Added for GL_TXN calculations // String PACS_ID = (String) acc.get("PACS_ID"); - // extract the Form _id from FORM15G_H table. - String getFormData = "SELECT FORM_ID,KEY_1 FROM FORM15G_H WHERE KEY_1= ?"; - PreparedStatement ps = conn.prepareStatement(getFormData); + // extract the Form _id from FORM15G_H table. + String getFormData = "SELECT FORM_ID,KEY_1 FROM FORM15G_H WHERE KEY_1= ?"; + PreparedStatement ps = conn.prepareStatement(getFormData); - ps.setString(1, CIF_No); + ps.setString(1, CIF_No); - ResultSet formResultSet = ps.executeQuery(); + ResultSet formResultSet = ps.executeQuery(); - int FORM_ID = 0; + int FORM_ID = 0; - if (formResultSet.next()) { - FORM_ID = formResultSet.getInt("FORM_ID"); - } - /// System.out.println("FORM ID:" + FORM_ID); + if (formResultSet.next()) { + FORM_ID = formResultSet.getInt("FORM_ID"); + System.out.println("Form Id is for YES PAN.........................." + FORM_ID); + } - // Extract the TXN_ID from the table TDX_TXN with the help of Key_1; - String getTdsTxnData = "select TXN_ID from TDS_TXN where KEY_1= ?"; - PreparedStatement ps1 = conn.prepareStatement(getTdsTxnData); + // Extract the TXN_ID from the table TDX_TXN with the help of Key_1; + String getTdsTxnData = "select TXN_ID from TDS_TXN where KEY_1= ?"; + PreparedStatement ps1 = conn.prepareStatement(getTdsTxnData); - ps1.setString(1, KEY_1); + ps1.setString(1, KEY_1); - ResultSet rs = ps1.executeQuery(); + ResultSet rs = ps1.executeQuery(); - int TXN_ID = 0; + int TXN_ID = 0; - if (rs.next()) { - TXN_ID = rs.getInt("TXN_ID"); - } + if (rs.next()) { + TXN_ID = rs.getInt("TXN_ID"); + } - // System.out.println("TXN ID: " + TXN_ID); - // Starting of TDS Calculation........ - if (INTT_PAID != null && INTT_PAID > thresold) { - - System.out.println("The account number: " + KEY_1+ " has been crossed the thresold:" + INTT_PAID + "having CIF No: " +CIF_No); + //Including 15g/h logic. + if (FORM_ID != 0) { + System.out.println("FORM ID for having 15g/h for YES PAN:" + FORM_ID); + // Starting of TDS Calculation........ - //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable - System.out.println("Interest Paid: " + INTT_PAID); - tds_amount = INTT_PAID * 0.10; - System.out.println("TDS Amount is : " + tds_amount); + if (INTT_PAID != null && INTT_PAID > thresold) { - // deduct the TDS_AMOUNT from INTT_PAID - double deductedAmt = INTT_PAID - tds_amount; + System.out.println("The account number: " + KEY_1 + " has been crossed the thresold:" + INTT_PAID + " having CIF No: " + CIF_No + " for YES PAN"); - System.out.println("Deducted amount: " + deductedAmt); + //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable + System.out.println("Interest Paid: " + INTT_PAID); + tds_amount = INTT_PAID * 0.10; + System.out.println("TDS Amount is : " + tds_amount); - // Now need to insert into the table for record. - String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; - PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + // deduct the TDS_AMOUNT from INTT_PAID + double deductedAmt = INTT_PAID - tds_amount; - insertSmt.setInt(1, TXN_ID); - insertSmt.setInt(2, FORM_ID); - insertSmt.setDouble(3, tds_amount); - insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); - insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); - insertSmt.setString(6, KEY_1); - insertSmt.setDouble(7, INTT_PAID); - insertSmt.setString(8, "Y"); - System.out.println("pre execution"); - insertSmt.executeQuery(); - System.out.println("post execution"); - // Need to insert the deducted amount into corresponding GL. - insrtGLTransaction(KEY_1,PACS_ID, INTT_PAID, tds_amount); + System.out.println("Deducted amount: " + deductedAmt); - }else{ - System.out.println("Interest Paid didn't cross the thresold for YES PAN"); - } - // } - //} - + // Now need to insert into the table for record. + String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; + PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + + insertSmt.setInt(1, TXN_ID); + insertSmt.setInt(2, FORM_ID); + insertSmt.setDouble(3, tds_amount); + insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); + insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); + insertSmt.setString(6, KEY_1); + insertSmt.setDouble(7, INTT_PAID); + insertSmt.setString(8, "Y"); + + insertSmt.executeQuery(); + + // Need to insert the deducted amount into corresponding GL. + insrtGLTransaction(KEY_1, PACS_ID, INTT_PAID, tds_amount); + } else { + System.out.println("Interest Paid didn't cross the thresold for YES PAN having FORM_ID:" + FORM_ID); + } + } else { + //This block is for calculating TDS for more than 10000 due to 15g/h availability + System.out.println("FORM ID for not having 15g/h:" + FORM_ID); + + + if (formType.equalsIgnoreCase("H")) { + thresold = 50000; + } else if (formType.equalsIgnoreCase("G")) { + thresold = 40000; + } + + System.out.println("NO 15G/H available for YES PAN setting thresold: " +thresold); + + if (INTT_PAID != null && INTT_PAID > thresold) { + System.out.println("The account number: " + KEY_1 + " has crossed the thresold:" + INTT_PAID + " having CIF No: " + CIF_No); + + //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable + System.out.println("Interest Paid: " + INTT_PAID); + tds_amount = INTT_PAID * 0.10; + System.out.println("TDS Amount is : " + tds_amount); + + // deduct the TDS_AMOUNT from INTT_PAID + double deductedAmt = INTT_PAID - tds_amount; + + System.out.println("Deducted amount: " + deductedAmt); + + // Now need to insert into the table for record. + String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; + PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + + insertSmt.setInt(1, TXN_ID); + insertSmt.setInt(2, FORM_ID); + insertSmt.setDouble(3, tds_amount); + insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); + insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); + insertSmt.setString(6, KEY_1); + insertSmt.setDouble(7, INTT_PAID); + insertSmt.setString(8, "Y"); + + insertSmt.executeQuery(); + + // Need to insert the deducted amount into corresponding GL. + insrtGLTransaction(KEY_1, PACS_ID, INTT_PAID, tds_amount); + } else { + System.out.println("Interest Paid did not cross the thresold for YES PAN having FORM_ID:" + FORM_ID); + } + } + //} } catch (Exception e) { e.printStackTrace(); - }finally { + } finally { System.out.println("Processing done for PAN available"); + System.out.println("\n"); } } - public static void PanNotAvailability(String KEY_1,Double INTT_PAID, String CIF_No, String formType,String PACS_ID) { - System.out.println("CIF No:" + CIF_No + " is not having Pan " + " with Form Type " + formType + " and interest Paid:" +INTT_PAID+ " for PACS ID: " +PACS_ID); + public static void PanNotAvailability(String KEY_1, Double INTT_PAID, String CIF_No, String formType, String PACS_ID) { + System.out.println("CIF No:" + CIF_No + " is not having Pan " + " with Form Type " + formType + " and interest Paid:" + INTT_PAID + " for PACS ID: " + PACS_ID); double thresold_G = 250000; double thresold_H = 300000; double thresold = 0; double tds_amount = 0; - - if (formType.equalsIgnoreCase("H")) { + + if (formType.equalsIgnoreCase("H")) { thresold = thresold_H; } else if (formType.equalsIgnoreCase("G")) { thresold = thresold_G; @@ -296,82 +355,135 @@ public class TDS_Calculation { // // Added for GL_TXN calculations // String PACS_ID = (String) acc.get("PACS_ID"); - // extract the Form _id from FORM15G_H table. - String getFormData = "SELECT FORM_ID,KEY_1 FROM FORM15G_H WHERE KEY_1= ?"; - PreparedStatement ps = conn.prepareStatement(getFormData); + // extract the Form _id from FORM15G_H table. + String getFormData = "SELECT FORM_ID,KEY_1 FROM FORM15G_H WHERE KEY_1= ?"; + PreparedStatement ps = conn.prepareStatement(getFormData); - ps.setString(1, CIF_No); + ps.setString(1, CIF_No); - ResultSet formResultSet = ps.executeQuery(); + ResultSet formResultSet = ps.executeQuery(); - int FORM_ID = 0; + int FORM_ID = 0; - if (formResultSet.next()) { - FORM_ID = formResultSet.getInt("FORM_ID"); - } - //System.out.println("FORM ID:" + FORM_ID); + if (formResultSet.next()) { + FORM_ID = formResultSet.getInt("FORM_ID"); + System.out.println("Form Id is for NO PAN..........................." + FORM_ID); + } + //System.out.println("FORM ID:" + FORM_ID); - // Extract the TXN_ID from the table TDX_TXN with the help of Key_1; - String getTdsTxnData = "select TXN_ID from TDS_TXN where KEY_1= ?"; - PreparedStatement ps1 = conn.prepareStatement(getTdsTxnData); + // Extract the TXN_ID from the table TDX_TXN with the help of Key_1; + String getTdsTxnData = "select TXN_ID from TDS_TXN where KEY_1= ?"; + PreparedStatement ps1 = conn.prepareStatement(getTdsTxnData); - ps1.setString(1, KEY_1); + ps1.setString(1, KEY_1); - ResultSet rs = ps1.executeQuery(); + ResultSet rs = ps1.executeQuery(); - int TXN_ID = 0; + int TXN_ID = 0; - if (rs.next()) { - TXN_ID = rs.getInt("TXN_ID"); - } + if (rs.next()) { + TXN_ID = rs.getInt("TXN_ID"); + } - //System.out.println("TXN ID: " + TXN_ID); - // Starting of TDS Calculation........ - if (INTT_PAID != null && INTT_PAID > thresold) { - - System.out.println("The account number: " + KEY_1+ " has been crossed the thresold:" + INTT_PAID + "having CIF No: " +CIF_No); + //Including 15g/h logic. + if (FORM_ID != 0) { + System.out.println("FORM ID for having 15g/h for NO PAN: " + FORM_ID); + // Starting of TDS Calculation........ - //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable - System.out.println("Interest Paid for NO PAN: " + INTT_PAID); - tds_amount = INTT_PAID * 0.20; - System.out.println("TDS Amount is FOR NO PAN : " + tds_amount); + if (INTT_PAID != null && INTT_PAID > thresold) { - // Now need to insert into the table for record. - String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; - PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + System.out.println("The account number: " + KEY_1 + " has been crossed the thresold:" + INTT_PAID + " having CIF No: " + CIF_No + " for NO PAN"); - insertSmt.setInt(1, TXN_ID); - insertSmt.setInt(2, FORM_ID); - insertSmt.setDouble(3, tds_amount); - insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); - insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); - insertSmt.setString(6, KEY_1); - insertSmt.setDouble(7, INTT_PAID); - insertSmt.setString(8, "N"); + //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable + System.out.println("Interest Paid: " + INTT_PAID); + tds_amount = INTT_PAID * 0.20; + System.out.println("TDS Amount is : " + tds_amount); - insertSmt.executeQuery(); + // deduct the TDS_AMOUNT from INTT_PAID + double deductedAmt = INTT_PAID - tds_amount; - // Need to insert the deducted amount into corresponding GL. - insrtGLTransaction(KEY_1,PACS_ID, INTT_PAID, tds_amount); - }else{ - System.out.println("Interest Paid didn't cross the thresold for No Pan"); - } - // } + System.out.println("Deducted amount: " + deductedAmt); + + // Now need to insert into the table for record. + String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; + PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + + insertSmt.setInt(1, TXN_ID); + insertSmt.setInt(2, FORM_ID); + insertSmt.setDouble(3, tds_amount); + insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); + insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); + insertSmt.setString(6, KEY_1); + insertSmt.setDouble(7, INTT_PAID); + insertSmt.setString(8, "Y"); + + insertSmt.executeQuery(); + + // Need to insert the deducted amount into corresponding GL. + insrtGLTransaction(KEY_1, PACS_ID, INTT_PAID, tds_amount); + } else { + System.out.println("Interest Paid did not cross the thresold for NO PAN having FORM_ID:" + FORM_ID); + } + } else { + //This block is for calculating TDS for more than 10000 due to 15g/h availability + System.out.println("FORM ID for not having 15g/h:" + FORM_ID); + System.out.println("NO 15G/H available for NO PAN"); + + if (formType.equalsIgnoreCase("H")) { + thresold = 50000; + } else if (formType.equalsIgnoreCase("G")) { + thresold = 40000; + } + + if (INTT_PAID != null && INTT_PAID > thresold) { + System.out.println("The account number: " + KEY_1 + " has crossed the thresold:" + INTT_PAID + " having CIF No: " + CIF_No+ " for NO PAN"); + + //Calculate the TDS.//Here TDS will be 10% as PAN is avaiable + System.out.println("Interest Paid: " + INTT_PAID); + tds_amount = INTT_PAID * 0.20; + System.out.println("TDS Amount is : " + tds_amount); + + // deduct the TDS_AMOUNT from INTT_PAID + double deductedAmt = INTT_PAID - tds_amount; + + System.out.println("Deducted amount: " + deductedAmt); + + // Now need to insert into the table for record. + String InsertTdsSql = " Insert into TDS_CALCULATIONS(TXN_ID,FORM_ID,TDS_AMT,CREATED_AT,TDS_DATE,KEY_1,INTEREST_AMT,PANCARD) values(?,?,?,?,?,?,?,?) "; + PreparedStatement insertSmt = conn.prepareStatement(InsertTdsSql); + + insertSmt.setInt(1, TXN_ID); + insertSmt.setInt(2, FORM_ID); + insertSmt.setDouble(3, tds_amount); + insertSmt.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); + insertSmt.setDate(5, java.sql.Date.valueOf(LocalDate.now())); + insertSmt.setString(6, KEY_1); + insertSmt.setDouble(7, INTT_PAID); + insertSmt.setString(8, "Y"); + + insertSmt.executeQuery(); + + // Need to insert the deducted amount into corresponding GL. + insrtGLTransaction(KEY_1, PACS_ID, INTT_PAID, tds_amount); + } else { + System.out.println("Interest Paid did not cross the thresold for NO PAN having FORM_ID:" + FORM_ID); + } + } //} - // System.out.println("Interest Paid: " + INTT_PAID + " for the account: " +KEY_1); } catch (Exception e) { e.printStackTrace(); - }finally { - System.out.println("Processing done for PAN not available"); + } finally { + System.out.println("Processing done for PAN NOT available"); + System.out.println("\n"); } } public static void calculateProjectedAmount(Map accNo) { - // int termValue = (int) accNo.get("TERM_VALUE"); + // int termValue = (int) accNo.get("TERM_VALUE"); double INTT_PROJECTED = (double) accNo.get("INTT_PROJECTED"); - // int termLength = (int) accNo.get("TERM_LENGTH"); //in days as per IPKS DB + // int termLength = (int) accNo.get("TERM_LENGTH"); //in days as per IPKS DB String inttPayoutFre = ((String) accNo.get("INTT_PAYOUT_FREQ")).trim(); String prodCode = (String) accNo.get("PROD_CODE"); String accNum = (String) accNo.get("KEY_1"); @@ -397,10 +509,9 @@ public class TDS_Calculation { //calculate projected amount double projectedAmount = INTT_PROJECTED * temp; - System.out.println("Calculation is done for Account No: " + accNum + " and Projected Amount is : " +projectedAmount); - // return projectedAmount; + System.out.println("Calculation is done for Account No: " + accNum + " and Projected Amount is : " + projectedAmount); + // return projectedAmount; insertProjectedAmount(accNum, projectedAmount, prodCode); - } @@ -425,8 +536,8 @@ public class TDS_Calculation { ps.setTimestamp(4, Timestamp.valueOf(LocalDateTime.now())); ps.setDouble(5, projectedAmt); - boolean i= ps.executeUpdate()>0; - System.out.println("inserted Projected amount for : " + accNo ); + boolean i = ps.executeUpdate() > 0; + System.out.println("inserted Projected amount for : " + accNo); } catch (Exception e) { e.printStackTrace(); @@ -498,7 +609,7 @@ public class TDS_Calculation { } //This is the method of GL Transaction - public static void insrtGLTransaction(String KEY,String PACS_ID, double INTT_PAID, double tds_amount) { + public static void insrtGLTransaction(String KEY, String PACS_ID, double INTT_PAID, double tds_amount) { // String KEY_1 = null; double TXN_AMT = INTT_PAID - tds_amount; @@ -530,11 +641,9 @@ public class TDS_Calculation { // if (KEY_1 == null) { // System.out.println("No BGL avaiable for TDS of this PACS ID. Kindly check manually in the system."); // } - if(KEY_1.isEmpty()){ - System.out.println("No BGL avaiable for TDS of this PACS ID. Kindly check manually in the system."); - } - -else { + if (KEY_1.isEmpty()) { + System.out.println("No BGL avaiable for TDS of this PACS ID. Kindly check manually in the system."); + } else { long randomNumberGeneration = randomNumberGenerator();