Commit 52e16e3d authored by arawankar's avatar arawankar

MiscValConf.java

-Changes made to resolve in out parameter index issue.
-line no set on wrong index number

PayIbcaConf.java
-Change tran_ser previously it was 7 char ,now it is corrected to 6 char(P-IBC+COUNT)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@195697 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0cb6b1dc
......@@ -886,8 +886,10 @@ conn = getConnection();
pstmtInner.close();
pstmtInner = null;
}
if(cnt > 0)
//Modified by Anjali R. on [11/01/2019][In case of misc_vouchdet has no record then system should insert record in misc_vouchdet table][Start]
//if(cnt > 0)
if(cnt == 0)
//Modified by Anjali R. on [11/01/2019][In case of misc_vouchdet has no record then system should insert record in misc_vouchdet table][End]
{
lineInt = lineInt +1;
......@@ -909,7 +911,10 @@ conn = getConnection();
pstmtInner.setString(2,tranId);
pstmtInner.setString(3,acctCodeReco);
pstmtInner.setString(4,cctrCodeReco);
pstmtInner.setInt(3,lineNoDet);
//Modified by Anjali R. on [11/01/2019][Parameter set on wrong index number][Start]
//pstmtInner.setInt(3,lineNoDet);
pstmtInner.setInt(5,lineNoDet);
//Modified by Anjali R. on [11/01/2019][Parameter set on wrong index number][End]
int updCnt = pstmtInner.executeUpdate();
pstmtInner.close();
pstmtInner = null;
......
......@@ -35,15 +35,15 @@ import javax.ejb.Stateless;
@Stateless
public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, PayIbcaConfRemote
{
// GenericUtility genericUtility = GenericUtility.getInstance();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
//FinCommon finCommon = new FinCommon();
//Added By Pavan R on 06/NOV/17 Start
FinCommon finCommon = new FinCommon();
String tranId1 ="";
//Added By Pavan R on 06/NOV/17 End
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
String retString = "";
......@@ -65,7 +65,7 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
}
return retString;
}
public String confirm(String tranId,String xtraParams,String forcedFlag, Connection conn) throws RemoteException,ITMException
{
System.out.println("confirm called........");
......@@ -78,15 +78,15 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
PreparedStatement pstmt = null;
ResultSet rs = null;
FinCommon finCommon = null;
// GenericUtility genericUtility = null;
// GenericUtility genericUtility = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = null;
System.out.println("tran id = "+tranId);
//Added By Pavan R on 06/NOV/17 Start
tranId1 = tranId;
//Added By Pavan R on 06/NOV/17 End
boolean connStatus=false;
String chgUser="";
java.sql.Timestamp tranDate = null, today = null;
......@@ -98,21 +98,21 @@ public class PayIbcaConf extends ActionHandlerEJB implements PayIbcaConfLocal, P
ConnDriver connDriver = null;
connDriver = new ConnDriver();
//Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
conn.setAutoCommit(false);
connDriver = null;
connStatus = true;
}
finCommon = new FinCommon();
// genericUtility = new GenericUtility();
//genericUtility = new GenericUtility();
itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB();
loginEmpCode =validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("Printing loginEmpCode---1-----"+loginEmpCode+"--");
sql = "select confirmed ,site_code__from as site_code,chg_user from pay_ibca where tran_id = ?";
pstmt = conn.prepareStatement(sql);
......@@ -137,7 +137,7 @@ conn = getConnection();
sql="select emp_code from users where code=?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,chgUser);
rs=pstmt.executeQuery();
if(rs.next())
{
......@@ -148,7 +148,7 @@ conn = getConnection();
pstmt.close();
pstmt = null;
System.out.println("Printing loginEmpCode---2-----"+loginEmpCode+"--");
}
if(confirm != null && confirm.equalsIgnoreCase("N"))
{
......@@ -162,7 +162,7 @@ conn = getConnection();
{
return errString;
}
if(errString == null || errString.trim().length() == 0)
{
if("null".equalsIgnoreCase(loginEmpCode) || loginEmpCode==null || loginEmpCode.trim().length()==0)
......@@ -206,41 +206,41 @@ conn = getConnection();
}
finally
{
try
try
{
if( conn != null && !conn.isClosed() && connStatus )
{
if( conn != null && !conn.isClosed() && connStatus )
{
if(errString.indexOf("VTCICONF3") > -1)
{
conn.commit();
}
else
{
conn.rollback();
}
conn.close();
conn = null;
}
if(rs != null)
if(errString.indexOf("VTCICONF3") > -1)
{
rs.close();
rs = null;
conn.commit();
}
if(pstmt != null)
else
{
pstmt.close();
pstmt = null;
conn.rollback();
}
conn.close();
conn = null;
}
catch(Exception e)
if(rs != null)
{
System.out.println("Exception : "+e);
e.printStackTrace();
throw new ITMException(e);
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
System.out.println("Exception : "+e);
e.printStackTrace();
throw new ITMException(e);
}
}
return errString;
} //end of confirm method
......@@ -263,12 +263,12 @@ conn = getConnection();
itmDBAccessEJB = new ITMDBAccessEJB();
int cntrHdr = 0,cntr = 0,insertedRow = 0,rows = 0;
// GenericUtility genericUtility = null;
// GenericUtility genericUtility = null;
java.sql.Timestamp tranDate = null, today = null;
try
{
// genericUtility = GenericUtility.getInstance();
// genericUtility = GenericUtility.getInstance();
sql = "select tran_id,tran_date,eff_date,site_code__from, fin_entity__from, site_code__to,fin_entity__to,amount, " +
"curr_code,confirmed,conf_date,emp_code__aprv,acct_code__ifr,cctr_code__ifr,acct_code__ito,cctr_code__ito," +
"amount__bc,tran_type,tran_ser,tran_id__iss,exch_rate,link_type from PAY_IBCA where tran_id = ?";
......@@ -541,7 +541,7 @@ conn = getConnection();
System.out.println("tran_id From Confirm::"+tranId1);
//Added By Pavan R on 06/NOV/17 Start
System.out.println("Before POST_ON_LINE.....");
postOnline = checkNullAndTrim(finCommon.getFinparams("999999", "POST_ON_LINE", conn));
System.out.println("Before checkGlTranDrCr::postOnline["+postOnline+"]");
//tranId = (String)HdrMap.get("tran_Id");
......@@ -658,7 +658,7 @@ conn = getConnection();
ResultSet rs = null;
FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
// GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null;
try
{
......@@ -674,10 +674,10 @@ conn = getConnection();
if(!linkType.equalsIgnoreCase("R") && !linkType.equalsIgnoreCase("C"))
{
System.out.println("Inside iF linktype");
System.out.println("Printing HASHMAP MAPHRD"+MapHrd);
tranDate = (Timestamp)MapHrd.get("tran_date");
refDate = (Timestamp)MapHrd.get("ref_date");
effDate = (Timestamp)MapHrd.get("eff_date");
......@@ -725,7 +725,7 @@ conn = getConnection();
glTraceMap.put("ref_ser", "P-IBCA");
glTraceMap.put("ref_id", tranId);
glTraceMap.put("remarks", remarks);
System.out.println("HASHMAP glTraceUpdate"+glTraceMap);
System.out.println("1766 glTraceUpdate Called..............");
errString = finCommon.glTraceUpdate(glTraceMap,conn);
......@@ -764,10 +764,10 @@ conn = getConnection();
return errString;
}
private String gbfCreatePibca(String tranIdFr, String tranIdTo,String xtraParams ,Connection conn) throws ITMException
{
String errString = "", keyString = "", linkType = "", thisWin = "", ibcaConf = "N", siteCodeFrom = "", siteCodeTo = "", finEntFrom = "", finEntTo = "";
ArrayList<String> tranIdList = null;
int count = 0;
......@@ -778,25 +778,25 @@ conn = getConnection();
try
{
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
sql = "insert into pay_ibca (tran_id, tran_ser,tran_id__iss,tran_type, tran_date, eff_date, "
+ " site_code__from, fin_entity__from, site_code__to, fin_entity__to, acct_code__ifr, "
+ " cctr_code__ifr, acct_code__ito, cctr_code__ito, amount, curr_code, link_type, confirmed, "
+ " amount__bc, chg_date, chg_user, chg_term, add_date, add_user, add_term, remarks, sundry_type, sundry_code ) "
+ " values (?, ?,?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";
sql = "insert into pay_ibca (tran_id, tran_ser,tran_id__iss,tran_type, tran_date, eff_date, "
+ " site_code__from, fin_entity__from, site_code__to, fin_entity__to, acct_code__ifr, "
+ " cctr_code__ifr, acct_code__ito, cctr_code__ito, amount, curr_code, link_type, confirmed, "
+ " amount__bc, chg_date, chg_user, chg_term, add_date, add_user, add_term, remarks, sundry_type, sundry_code ) "
+ " values (?, ?,?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";
pstmtHdr = conn.prepareStatement(sql);
sql = "insert into pay_ibca_det ( tran_id, ref_ser, ref_no, ref_date, curr_code, acct_code, cctr_code, "
+ " due_date, tot_amt, discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, "
+ " sundry_type, sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, "
+ " adv_amt, tds_amt, ref_ser__org ) "
+ " values (tran_id, ref_ser, ref_no, ref_date, curr_code, acct_code, cctr_code, "
+ " due_date, tot_amt, discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, "
+ " sundry_type, sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, "
+ " adv_amt, tds_amt, ref_ser__org )";
sql = "insert into pay_ibca_det ( tran_id, ref_ser, ref_no, ref_date, curr_code, acct_code, cctr_code, "
+ " due_date, tot_amt, discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, "
+ " sundry_type, sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, "
+ " adv_amt, tds_amt, ref_ser__org ) "
+ " values (tran_id, ref_ser, ref_no, ref_date, curr_code, acct_code, cctr_code, "
+ " due_date, tot_amt, discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, "
+ " sundry_type, sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, "
+ " adv_amt, tds_amt, ref_ser__org )";
pstmtDet = conn.prepareStatement(sql);
......@@ -842,11 +842,11 @@ conn = getConnection();
pstmt = null;
for (int hdrCtr = 0; hdrCtr < tranIdList.size(); hdrCtr++)
{
sql = " SELECT tran_id, tran_ser, tran_id__iss, tran_type, tran_date, eff_date, site_code__from, fin_entity__from, "
+ " site_code__to, fin_entity__to, acct_code__ifr, cctr_code__ifr, acct_code__ito, cctr_code__ito, amount, "
+ " curr_code, link_type, confirmed, conf_date, emp_code__aprv, amount__bc, exch_rate, remarks, sundry_type, sundry_code "
+ " FROM pay_ibca WHERE tran_id = ? ";
+ " site_code__to, fin_entity__to, acct_code__ifr, cctr_code__ifr, acct_code__ito, cctr_code__ito, amount, "
+ " curr_code, link_type, confirmed, conf_date, emp_code__aprv, amount__bc, exch_rate, remarks, sundry_type, sundry_code "
+ " FROM pay_ibca WHERE tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,(String) tranIdList.get(hdrCtr));
rs = pstmt.executeQuery();
......@@ -855,9 +855,9 @@ conn = getConnection();
today = new java.sql.Timestamp(System.currentTimeMillis()) ;
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
tranDate = java.sql.Timestamp.valueOf(sdf.format(today) + " 00:00:00.000");
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String xmlValues = "";
xmlValues ="<?xml version=\"1.0\" encoding=\"utf-8\"?><Root>";
xmlValues = xmlValues + "<Header></Header>";
......@@ -869,10 +869,10 @@ conn = getConnection();
xmlValues = xmlValues + "<tran_ser>R</tran_ser>";
xmlValues = xmlValues + "<link_type>R</link_type>";
xmlValues = xmlValues + "</Detail1></Root>";
TransIDGenerator tg = new TransIDGenerator(xmlValues, "BASE", CommonConstants.DB_NAME);
newTranId = tg.generateTranSeqID("P-IBCA", "tran_id", keyString, conn);
tranType = rs.getString("tran_ser");
linkType = rs.getString("link_type");
siteCodeFrom = rs.getString("site_code__from");
......@@ -908,24 +908,24 @@ conn = getConnection();
pstmtHdr.setString(26,rs.getString("remarks"));
pstmtHdr.setString(27,rs.getString("sundry_type"));
pstmtHdr.setString(28,rs.getString("sundry_code"));
count = pstmtHdr.executeUpdate();
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " SELECT ref_ser, ref_no, ref_date, curr_code, acct_code, cctr_code, due_date, tot_amt, "
+ " discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, sundry_type, "
+ " sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, adv_amt, tds_amt, ref_ser__org "
+ " FROM pay_ibca_det WHERE tran_id = ? ";
+ " discount, tax_amt, auto_pay, bank_code, ref_type, cr_term, bill_no, bill_date, sundry_type, "
+ " sundry_code, pay_mode, exch_rate, entry_batch_no, purc_order, supp_bill_amt, adv_amt, tds_amt, ref_ser__org "
+ " FROM pay_ibca_det WHERE tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,(String) tranIdList.get(hdrCtr));
rs = pstmt.executeQuery();
while(rs.next())
{
pstmtDet.clearParameters();
pstmtDet.setString(1,newTranId);
pstmtDet.setString(2,rs.getString("ref_ser"));
......@@ -963,14 +963,14 @@ conn = getConnection();
pstmt.close();
pstmt = null;
pstmtDet.executeBatch();
sql = " select case when auto_confirm is null then 'N' else auto_confirm end "
+ " from IBCA_PAY_CTRL "
+ " where site_code__from = ? "
+ " and site_code__to = ? "
+ " and fin_entity__from = ? "
+ " and fin_entity__to = ? "
+ " and link_type = 'P' " ;
+ " from IBCA_PAY_CTRL "
+ " where site_code__from = ? "
+ " and site_code__to = ? "
+ " and fin_entity__from = ? "
+ " and fin_entity__to = ? "
+ " and link_type = 'P' " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCodeFrom);
pstmt.setString(2,siteCodeTo);
......@@ -1002,7 +1002,7 @@ conn = getConnection();
pstmtDet = null;
pstmtHdr.close();
pstmtHdr = null;
}
catch(Exception e)
{
......@@ -1103,7 +1103,7 @@ conn = getConnection();
DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
// GenericUtility genericUtility = new GenericUtility();
java.sql.Timestamp dateInterest = null;
try
......@@ -1216,8 +1216,8 @@ conn = getConnection();
return errString;
}
System.out.println("last ...........");
System.out.println("last ...........");
RcpDetMap = new HashMap();
RcpDetMap = (HashMap) MapDet.get(ctr);
refSer = (String)RcpDetMap.get("ref_ser");
......@@ -1395,7 +1395,7 @@ conn = getConnection();
}
}
System.out.println("Before calling gbfPostPibcaDetRcp::link["+link+"]");
if("A".equalsIgnoreCase(link))
{
......@@ -1506,7 +1506,7 @@ conn = getConnection();
ResultSet rs = null;
FinCommon finCommon = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
// GenericUtility genericUtility = new GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = null;
try
{
......@@ -1677,14 +1677,14 @@ conn = getConnection();
DistCommon distCommon = null;
ITMDBAccessEJB itmDBAccessEJB = null;
ValidatorEJB validatorEJB = new ValidatorEJB();
// GenericUtility genericUtility = new GenericUtility();
// GenericUtility genericUtility = new GenericUtility();
try
{
finCommon = new FinCommon();
distCommon = new DistCommon();
itmDBAccessEJB = new ITMDBAccessEJB();
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
//tranid to tran_Id Changed by Pavan R on On 06/NOV/17
tranId = (String)HdrMap.get("tran_id");
tranDate = (Timestamp)HdrMap.get("tran_date");
......@@ -1697,7 +1697,7 @@ conn = getConnection();
hcurrCode = (String)HdrMap.get("curr_code");
hexchRate = (Double)HdrMap.get("exch_rate");
remarks = (String)HdrMap.get("remarks");
System.out.println("DetList SIZE "+DetList.size());
System.out.println("DetList SIZE "+DetList);
......@@ -1778,7 +1778,7 @@ conn = getConnection();
amount = (Double)DetMap.get("tot_amt");
System.out.println("Sundrybalcramt"+amount);
if(amount > 0)
{
sundryBalMap.put("dr_amt", 0.0);
......@@ -1803,16 +1803,16 @@ conn = getConnection();
///Populate the misc_payables structure /////
// insert into misc_payable
System.out.println("Inside gbfPostPibcaDetFcp::Ref_Ser ["+(String)DetMap.get("ref_ser")+"] :: Ref_No ["+(String)DetMap.get("ref_no")+"]");
//Added By Pavan R on 06/NOV/17 Start to fix in misc_payables table reference series of IBCA is gone wrong. on 03/NOV/17
String ref_No = (String)DetMap.get("ref_no");
String ref_Ser = "";
int ll_cnt = 0;
System.out.println("ref_No::["+ref_No+"]");
sql = "select count(*) as ll_cnt from misc_payables where tran_ser like 'P-IBC%'" +
"AND REF_NO = ?";
pstmt = conn.prepareStatement(sql);
......@@ -1834,11 +1834,11 @@ conn = getConnection();
ref_Ser = "P-IBCA"+ll_cnt;
}
//Added By Pavan R on 06/NOV/17 End
miscPayMap = new HashMap();
miscPayMap.put("tran_date",tranDate);
//changed by Pavan R On 06/NOV/17
//miscPayMap.put("tran_ser",(String)DetMap.get("ref_ser"));
miscPayMap.put("tran_ser",ref_Ser);
......@@ -1865,7 +1865,7 @@ conn = getConnection();
miscPayMap.put("adv_amt", (Double)DetMap.get("adv_amt"));
miscPayMap.put("tds_amt", DetMap.get("tds_amt").toString());
miscPayMap.put("supp_bill_amt", DetMap.get("supp_bill_amt").toString());
miscPayMap.put("entry_batch_no", (String)DetMap.get("entry_batch_no"));
miscPayMap.put("purc_order",(String)DetMap.get("purc_order"));
miscPayMap.put("ref_ser__org", (String)DetMap.get("ref_ser__org"));
......@@ -1896,7 +1896,7 @@ conn = getConnection();
}
public double getReqDecimal(double actVal, int prec)
{
String fmtStr = "############0";
......@@ -1914,7 +1914,7 @@ conn = getConnection();
}
return retVal;
}
//Added By Pavan R on 06/NOV/17 Start
public String checkNullAndTrim( String inputVal )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment