added Purulia and Mughberia Bank codes in Nabard List
This commit is contained in:
@@ -31,10 +31,10 @@ public class RequestResponse {
|
||||
static Statement statement = null;
|
||||
|
||||
public static ArrayList<DataBean> get_response(String jsonInputString, String date) throws IOException {
|
||||
// String urlFromDatabase = "https://IPKS.cedgeapiservices.in/IPKSTRAN";
|
||||
// String urlFromDatabase = "https://IPKS.cedgeapiservices.in/IPKSTRAN";
|
||||
String urlFromDatabase = "";
|
||||
String bc = new JSONObject(jsonInputString).getString("bankcode");
|
||||
if(bc.equals("0005") || bc.equals("0021")) {
|
||||
if (bc.equals("0005") || bc.equals("0021") || bc.equals("0016") || bc.equals("0018")) {
|
||||
urlFromDatabase = "https://NABARDIPKS.cedgeapiservices.in/IPKSTRAN";
|
||||
} else {
|
||||
urlFromDatabase = "https://UCBIPKS.cedgeapiservices.in/IPKSTRAN";
|
||||
@@ -50,7 +50,7 @@ public class RequestResponse {
|
||||
}
|
||||
HttpURLConnection con = null;
|
||||
try {
|
||||
con = (HttpURLConnection)url.openConnection();
|
||||
con = (HttpURLConnection) url.openConnection();
|
||||
con.setRequestMethod("POST");
|
||||
con.setRequestProperty("Content-Type", "application/json; utf-8");
|
||||
con.setRequestProperty("Accept", "application/json");
|
||||
@@ -163,7 +163,8 @@ public class RequestResponse {
|
||||
try {
|
||||
connection = Util.getDBConnection();
|
||||
st = connection.createStatement();
|
||||
rs = st.executeQuery("select l.bankcode,l.jrnl_id,l.txn_date from kcc_api_log l where l.txn_date='" + date + "'");
|
||||
rs = st.executeQuery(
|
||||
"select l.bankcode,l.jrnl_id,l.txn_date from kcc_api_log l where l.txn_date='" + date + "'");
|
||||
while (rs.next()) {
|
||||
String comb = rs.getString(1) + "|" + rs.getString(2) + "|" + rs.getString(3);
|
||||
combination.add(comb);
|
||||
@@ -176,12 +177,17 @@ public class RequestResponse {
|
||||
while (iter.hasNext()) {
|
||||
DataBean d = iter.next();
|
||||
if (!d.getTxnCode().equalsIgnoreCase("001057")) {
|
||||
if (combination.contains(d.getBankcode() + "|" + d.getJrnlId() + "|" + d.getTimestamp()) || d.getJrnlId() == null || d.getJrnlId().equalsIgnoreCase("")) {
|
||||
System.out.println("RECORD ALREADY PRESENT FOR " + d.getBankcode() + "|" + d.getJrnlId() + "|" + d.getTimestamp());
|
||||
if (combination.contains(d.getBankcode() + "|" + d.getJrnlId() + "|" + d.getTimestamp())
|
||||
|| d.getJrnlId() == null || d.getJrnlId().equalsIgnoreCase("")) {
|
||||
System.out.println("RECORD ALREADY PRESENT FOR " + d.getBankcode() + "|" + d.getJrnlId() + "|"
|
||||
+ d.getTimestamp());
|
||||
continue;
|
||||
}
|
||||
query = "insert into kcc_api_log (bankcode, cbsacctno, txncode, txnamt, txnind, narration, jrnl_id, txn_date, post_flag, success_flag, errorlog) values ('" + d.getBankcode() + "','" + d.getAcctNo() + "','" + d.getTxnCode() + "',abs(" + d.getTxnAmt() + "),'";
|
||||
query = query + d.getTxnInd() + "','" + d.getNarration() + "','" + d.getJrnlId() + "','" + d.getTimestamp() + "','N','N'," + null + ")";
|
||||
query = "insert into kcc_api_log (bankcode, cbsacctno, txncode, txnamt, txnind, narration, jrnl_id, txn_date, post_flag, success_flag, errorlog) values ('"
|
||||
+ d.getBankcode() + "','" + d.getAcctNo() + "','" + d.getTxnCode() + "',abs("
|
||||
+ d.getTxnAmt() + "),'";
|
||||
query = query + d.getTxnInd() + "','" + d.getNarration() + "','" + d.getJrnlId() + "','"
|
||||
+ d.getTimestamp() + "','N','N'," + null + ")";
|
||||
System.out.println("SQL Statement :" + query);
|
||||
st2.addBatch(query);
|
||||
System.out.println("Added to DB Insert Batch");
|
||||
|
Reference in New Issue
Block a user