added mobile number to the transaction fields
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package net.ipksindia.dao
|
||||
|
||||
import model.TransactionRequest
|
||||
import net.ipksindia.model.TransactionRequest
|
||||
import net.ipksindia.ItemNotFoundException
|
||||
import java.sql.Date
|
||||
import java.sql.ResultSet
|
||||
@@ -27,13 +27,15 @@ class TransactionDao {
|
||||
comm_txn_no,
|
||||
comm_txn_amt,
|
||||
dccb_code,
|
||||
TO_NUMBER(cbs_br_code) AS br_code,
|
||||
TO_NUMBER(t.cbs_br_code) AS br_code,
|
||||
SUBSTR(REGEXP_REPLACE(REGEXP_REPLACE(UPPER(remm_name), '[^A-Z0-9 ]', ''), ' {2,}', ' '),1,35) AS remitter_name,
|
||||
ipks_accno AS pacs_acc_no,
|
||||
da.link_accno AS cbs_sb_acc_no,
|
||||
'pacs_db' AS db_name
|
||||
'pacs_db' AS db_name,
|
||||
kh.mobile_no
|
||||
FROM neft_rtgs_txn t
|
||||
JOIN dep_account da ON t.ipks_accno = da.key_1
|
||||
JOIN kyc_hdr kh ON da.customer_no = kh.cif_no
|
||||
WHERE
|
||||
t.txn_no = ?
|
||||
""".trimIndent()
|
||||
@@ -89,20 +91,20 @@ class TransactionDao {
|
||||
it.setString(19, neftQueueNumber)
|
||||
}.use { it.executeUpdate() }
|
||||
}
|
||||
}catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database")
|
||||
} catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
fun getTransactionRequest(transactionNumber: String): TransactionRequest {
|
||||
return try {
|
||||
DatabaseFactory.instance.getConnection().use { connection ->
|
||||
connection.prepareStatement(singleTransactionRequestQuery).apply { setString(1, transactionNumber) }
|
||||
.executeQuery()
|
||||
.use { mapToObject(it) ?: throw ItemNotFoundException("Transaction Number", transactionNumber) }
|
||||
}
|
||||
connection.prepareStatement(singleTransactionRequestQuery).apply { setString(1, transactionNumber) }
|
||||
.executeQuery()
|
||||
.use { mapToObject(it) ?: throw ItemNotFoundException("Transaction Number", transactionNumber) }
|
||||
}
|
||||
} catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database")
|
||||
throw SQLException("Failed to connect to the database: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +132,7 @@ private fun mapToObject(rs: ResultSet): TransactionRequest? {
|
||||
remitterName = rs.getString("remitter_name"),
|
||||
pacsAccountNumber = rs.getString("pacs_acc_no"),
|
||||
linkedCBSAccountNumber = rs.getString("cbs_sb_acc_no"),
|
||||
mobileNumber = rs.getString("mobile_no") ?: "999999999"
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user