Commit 7699f7b6 authored by arawankar's avatar arawankar

MiscPayAutoPrc.java

-bug fixing 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@197616 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f2f7543b
...@@ -269,8 +269,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -269,8 +269,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
camt = camt + resultSet.getDouble("TOT_AMT")+resultSet.getDouble("ADJ_AMT")+resultSet.getDouble("HOLD_AMT"); camt = camt + resultSet.getDouble("TOT_AMT")+resultSet.getDouble("ADJ_AMT")+resultSet.getDouble("HOLD_AMT");
mcnt = mcnt+1; mcnt = mcnt+1;
} }
System.out.println("refNo---["+ refNo +"]"); refNo = checkNullAndTrim((resultSet.getString("REF_NO")));
refNo = checkNullAndTrim(resultSet.getString("REF_NO"));
System.out.println("refNo --["+refNo+"]"); System.out.println("refNo --["+refNo+"]");
pstmt1.setString(1, refNo); pstmt1.setString(1, refNo);
resultSet1 = pstmt1.executeQuery(); resultSet1 = pstmt1.executeQuery();
...@@ -297,7 +296,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -297,7 +296,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
refDateStr = ""; refDateStr = "";
} }
System.out.println("refDateStr----["+refDateStr+"]");
if(resultSet.getTimestamp("due_date") != null) if(resultSet.getTimestamp("due_date") != null)
{ {
dueDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("due_date"),genericUtility.getApplDateFormat()); dueDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("due_date"),genericUtility.getApplDateFormat());
...@@ -408,6 +407,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -408,6 +407,17 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
sumNetAmt = resultSet1.getDouble(1); sumNetAmt = resultSet1.getDouble(1);
} }
//Modified by Anjali R. on [25/02/2019][To check ref_date null][Start]
if(resultSet.getTimestamp("ref_date") != null)
{
refDateStr = genericUtility.getValidDateString(resultSet.getTimestamp("ref_date"),genericUtility.getApplDateFormat());
}
else
{
refDateStr = "";
}
System.out.println("refDateStr----["+refDateStr+"]");
//Modified by Anjali R. on [25/02/2019][To check ref_date null][End]
//Added By to set due_date on 13-FEB-2019[START]. //Added By to set due_date on 13-FEB-2019[START].
if(resultSet.getTimestamp("due_date") != null) if(resultSet.getTimestamp("due_date") != null)
{ {
...@@ -486,6 +496,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -486,6 +496,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
{ {
System.out.println("Exception in getdata logic ----["+e.getMessage()+"]"); System.out.println("Exception in getdata logic ----["+e.getMessage()+"]");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);//Modified by Anjali R. on [25/02/2019]
} }
return xmlRetString; return xmlRetString;
} }
...@@ -497,8 +508,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -497,8 +508,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
Connection conn = null; Connection conn = null;
String errString = null; String errString = null;
AppConnectParm appConnect = null; //Modified by Anjali R. on [25/02/2019][Start]
InitialContext initialCtx = null; //AppConnectParm appConnect = null;
//InitialContext initialCtx = null;
//Modified by Anjali R. on [25/02/2019][End]
ITMDBAccessEJB itmDBAccess = null; ITMDBAccessEJB itmDBAccess = null;
String loginCode = ""; String loginCode = "";
...@@ -889,7 +902,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -889,7 +902,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]"); System.out.println("tranDate--["+tranDate+"]autoPost--["+autoPost+"]taxEnv--["+taxEnv+"]mExchRatePay--["+mExchRatePay+"]");
//Modified by Anjali R. on [01/09/2018][If specific paymoode has been selected then paymode set as paymode + "%" to remove percentage sign from paymode][Start] //Modified by Anjali R. on [01/09/2018][If specific paymode has been selected then paymode set as paymode + "%" to remove percentage sign from paymode][Start]
String payModeHeader = genericUtility.getColumnValue("pay_mode", headerDom,"1",""); String payModeHeader = genericUtility.getColumnValue("pay_mode", headerDom,"1","");
System.out.println("payModeHeader--["+payModeHeader+"]"); System.out.println("payModeHeader--["+payModeHeader+"]");
System.out.println("payModeHeader length--["+payModeHeader.length()+"]"); System.out.println("payModeHeader length--["+payModeHeader.length()+"]");
...@@ -898,7 +911,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -898,7 +911,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
payModeHeader = payModeHeader.substring(0,payModeHeader.length()-1); payModeHeader = payModeHeader.substring(0,payModeHeader.length()-1);
System.out.println("payModeHeader---after substring["+payModeHeader+"]"); System.out.println("payModeHeader---after substring["+payModeHeader+"]");
} }
//Modified by Anjali R. on [01/09/2018][If specific paymoode has been selected then paymode set as paymode + "%" to remove percentage sign from paymode][End] //Modified by Anjali R. on [01/09/2018][If specific paymode has been selected then paymode set as paymode + "%" to remove percentage sign from paymode][End]
headerBuff = new StringBuffer(); headerBuff = new StringBuffer();
headerBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">"); headerBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"1\">");
...@@ -970,6 +983,12 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -970,6 +983,12 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
if(payModeList.contains(payMode)) if(payModeList.contains(payMode))
{ {
System.out.println("continue paymode"); System.out.println("continue paymode");
//Modified by Anjali R. on [25/02/2019][To set sundry code in header][Start]
Document dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "pay_mode", payMode);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
//Modified by Anjali R. on [25/02/2019][To set sundry code in header][End]
continue; continue;
} }
else if(payMode == null || payMode.trim().length() == 0) else if(payMode == null || payMode.trim().length() == 0)
...@@ -1034,6 +1053,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1034,6 +1053,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
parentNodeList1 = getNodebyValue(payModeDom, xpath1, mSundryType,"S"); parentNodeList1 = getNodebyValue(payModeDom, xpath1, mSundryType,"S");
alreadyExist.add(mSundryType); alreadyExist.add(mSundryType);
//Modified by Anjali R. on [25/02/2019][Start]
Document dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_type", mSundryType);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
//Modified by Anjali R. on [25/02/2019][End]
mRemarks = "Automatic Payment "; mRemarks = "Automatic Payment ";
tot = 0.0; tot = 0.0;
mTotAmt = 0.0; mTotAmt = 0.0;
...@@ -1070,6 +1096,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1070,6 +1096,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
oCurrCode = genericUtility.getColumnValueFromNode("curr_code", parentNode1); oCurrCode = genericUtility.getColumnValueFromNode("curr_code", parentNode1);
mSiteCode = genericUtility.getColumnValueFromNode("site_code", parentNode1); mSiteCode = genericUtility.getColumnValueFromNode("site_code", parentNode1);
//Modified by Anjali R. on [25/02/2019][Start]
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", mSundryCode);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
//Modified by Anjali R. on [25/02/2019][End]
oPayMode = mPayMode; oPayMode = mPayMode;
oSundryType = mSundryType; oSundryType = mSundryType;
oSundryCode = mSundryCode; oSundryCode = mSundryCode;
...@@ -1527,7 +1560,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1527,7 +1560,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
//if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode) ))//Changed for NEFT & RTGS //if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode) ))//Changed for NEFT & RTGS
if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode)) || "G".equalsIgnoreCase(oPayMode) || "N".equalsIgnoreCase(oPayMode)) if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode)) || "G".equalsIgnoreCase(oPayMode) || "N".equalsIgnoreCase(oPayMode))
{ {
oSundryCode = ""; //oSundryCode = "";//Modified by Anjali R. on [25/02/2019]
} }
if("Q".equalsIgnoreCase(oPayMode)) if("Q".equalsIgnoreCase(oPayMode))
{ {
...@@ -1918,7 +1951,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -1918,7 +1951,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
return confirmRetString; return confirmRetString;
} }
private String getMiscAutoPayCheckSplit(Document headerDom, Document detailDom, String windowName, String xtraParams,Connection conn)throws ITMException private String getMiscAutoPayCheckSplit(Document headerDom, Document detailDom, String windowName, String xtraParams,Connection conn)throws ITMException, RemoteException
{ {
String errString = ""; String errString = "";
String loginCode = ""; String loginCode = "";
...@@ -2285,6 +2318,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2285,6 +2318,13 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
Document payModeDom = getNodeListToDom(parentNodeList); Document payModeDom = getNodeListToDom(parentNodeList);
//Modified by Anjali R. on [25/02/2019][Start]
Document dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "pay_mode", tempPayMode);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
//Modified by Anjali R. on [25/02/2019][End]
//for selected rows //for selected rows
lineNo = 0; lineNo = 0;
int cnt = 0; int cnt = 0;
...@@ -2322,6 +2362,18 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2322,6 +2362,18 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
System.out.println("alreadyExist---["+alreadyExist+"]"); System.out.println("alreadyExist---["+alreadyExist+"]");
parentNodeList1 = getNodebyValue(payModeDom, xpath1, mSundryType,"S"); parentNodeList1 = getNodebyValue(payModeDom, xpath1, mSundryType,"S");
alreadyExist.add(mSundryType); alreadyExist.add(mSundryType);
//Modified by Anjali R. on [25/02/2019][Start]
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_type", mSundryType);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
dom = setNodeValue(genericUtility.parseString(headerBuff.toString()), "sundry_code", mSundryCode);
headerBuff = null;
headerBuff = new StringBuffer();
headerBuff.append(genericUtility.serializeDom(dom));
//Modified by Anjali R. on [25/02/2019][End]
mRemarks = "Automatic Payment "; mRemarks = "Automatic Payment ";
tot = 0.0; tot = 0.0;
mTotAmt = 0.0; mTotAmt = 0.0;
...@@ -2806,7 +2858,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -2806,7 +2858,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
//if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode) ))//Changed for NEFT & RTGS //if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode) ))//Changed for NEFT & RTGS
if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode)) || "G".equalsIgnoreCase(oPayMode) || "N".equalsIgnoreCase(oPayMode)) if(!isSundry && ("D".equalsIgnoreCase(oPayMode) || "T".equalsIgnoreCase(oPayMode) || "P".equalsIgnoreCase(oPayMode)) || "G".equalsIgnoreCase(oPayMode) || "N".equalsIgnoreCase(oPayMode))
{ {
oSundryCode = ""; //oSundryCode = "";//Modified by Anjali R. on [25/02/2019]
} }
if("Q".equalsIgnoreCase(oPayMode)) if("Q".equalsIgnoreCase(oPayMode))
{ {
...@@ -3263,7 +3315,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3263,7 +3315,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
confirmRetString = ""; confirmRetString = "";
confirmRetString = succesString+"</br>" + errorString; confirmRetString = succesString+"</br>" + errorString;
errString = confirmRetString; //Modified by Anjali R. on [25/02/2019][Start]
//errString = confirmRetString;
confirmRetString = getErrorMessage("", confirmRetString, "VTTRANCONF", "", "P");
//Modified by Anjali R. on [25/02/2019][End]
} }
/*confirmRetString = ""; /*confirmRetString = "";
confirmRetString = succesString+"</br>" + errorString; confirmRetString = succesString+"</br>" + errorString;
...@@ -3317,7 +3372,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3317,7 +3372,10 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
throw new ITMException(e); throw new ITMException(e);
} }
} }
return confirmRetString; //Modified by Anjali R. on [25/02/2019][Start]
//return confirmRetString;
return getErrorMessage("", confirmRetString, "VTTRANCONF", "", "P");
//Modified by Anjali R. on [25/02/2019][End]
} }
private String confirm(String tranId ,String xtraParams ,Connection conn) throws ITMException, Exception private String confirm(String tranId ,String xtraParams ,Connection conn) throws ITMException, Exception
{ {
...@@ -3636,14 +3694,6 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3636,14 +3694,6 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
return date; return date;
} }
private String checkNullAndTrim(String input)
{
if (input==null)
{
input="";
}
return input.trim();
}
private Document getNodeListToDom(NodeList nodes) private Document getNodeListToDom(NodeList nodes)
{ {
Document newXmlDocument = null; Document newXmlDocument = null;
...@@ -3755,7 +3805,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3755,7 +3805,8 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
else else
{ {
System.out.println("Inside root condition......"); System.out.println("Inside without root condition......");
Document errDom = genericUtility.parseString(retXml); Document errDom = genericUtility.parseString(retXml);
...@@ -3830,7 +3881,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3830,7 +3881,7 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
return retXml; return retXml;
} }
private static void setNodeValue(Document dom, String nodeName,String nodeVal) throws Exception private Document setNodeValue(Document dom, String nodeName,String nodeVal) throws Exception
{ {
Node tempNode = dom.getElementsByTagName(nodeName).item(0); Node tempNode = dom.getElementsByTagName(nodeName).item(0);
...@@ -3847,5 +3898,14 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi ...@@ -3847,5 +3898,14 @@ public class MiscPayAutoPrc extends ProcessEJB implements MiscPayAutoPrcLocal,Mi
} }
} }
tempNode = null; tempNode = null;
return dom;
}
public String checkNullAndTrim(String input)
{
if (input == null || "null".equalsIgnoreCase(input) || "undefined".equalsIgnoreCase(input))
{
input= "";
}
return input;
} }
} }
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