Commit f27d469d authored by smane's avatar smane

To solving literal does not match issue

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191084 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f0e51910
...@@ -31,7 +31,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -31,7 +31,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
String childNodeName = ""; String childNodeName = "";
int ctr,currentFormNo=0; int ctr,currentFormNo=0;
String columnValue=null; String columnValue=null;
Connection conn = null; Connection conn = null;
...@@ -39,33 +39,33 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -39,33 +39,33 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String errString = null; String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility e12genericUtility = new E12GenericUtility(); E12GenericUtility e12genericUtility = new E12GenericUtility();
/*--Commented for EJB3--sarah--10/06/2009 /*--Commented for EJB3--sarah--10/06/2009
public void ejbCreate() throws RemoteException,CreateException public void ejbCreate() throws RemoteException,CreateException
{ {
} }
public void ejbRemove() public void ejbRemove()
{ {
} }
public void ejbActivate() public void ejbActivate()
{ {
} }
public void ejbPassivate() public void ejbPassivate()
{ {
} }
*/ */
//End Comment--10/06/2009 //End Comment--10/06/2009
public void setSessionContext(SessionContext sess){ public void setSessionContext(SessionContext sess){
} }
public String itemChanged() throws RemoteException,ITMException public String itemChanged() throws RemoteException,ITMException
{ {
return ""; return "";
} }
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
String resultString = ""; String resultString = "";
Document dom = null,dom1 = null,dom2 = null; Document dom = null,dom1 = null,dom2 = null;
...@@ -101,12 +101,12 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -101,12 +101,12 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
return resultString; return resultString;
} //end of item change } //end of item change
public String itemChanged(Document dom,Document dom1,Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(Document dom,Document dom1,Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
java.sql.Timestamp chgdateTo=null; java.sql.Timestamp chgdateTo=null;
java.sql.Timestamp chgdateFr=null; java.sql.Timestamp chgdateFr=null;
String acct_prd=""; String acct_prd="";
String period=""; String period="";
Statement stmt=null; Statement stmt=null;
String dateFrom=null ; String dateFrom=null ;
String dateTo=null ; String dateTo=null ;
...@@ -126,7 +126,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -126,7 +126,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
String sitecode = ""; String sitecode = "";
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>"); valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>"); valueXmlString.append(editFlag).append("</editFlag></header>");
valueXmlString.append("<Detail1>"); valueXmlString.append("<Detail1>");
System.out.println("=======================xtraParams is=============="); System.out.println("=======================xtraParams is==============");
System.out.println("xtraParams is"+xtraParams); System.out.println("xtraParams is"+xtraParams);
System.out.println("=======================xtraParams is=============="); System.out.println("=======================xtraParams is==============");
...@@ -134,14 +134,14 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -134,14 +134,14 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
String sitecodeany=""; String sitecodeany="";
//dateTo = genericUtility.getColumnValue("adt_fr",dom); //dateTo = genericUtility.getColumnValue("adt_fr",dom);
//sitecode = genericUtility.getColumnValue("msitecode",dom); //sitecode = genericUtility.getColumnValue("msitecode",dom);
try{ try{
//===============Convert date to TimeStamp date format=========== //===============Convert date to TimeStamp date format===========
//Timestamp chgdateFrom = null,chgdateTo = null; //Timestamp chgdateFrom = null,chgdateTo = null;
//Object date = null; //Object date = null;
//SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); //SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
//date = sdf.parse(dateFrom); //date = sdf.parse(dateFrom);
//SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat()); //SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
//SimpleDateFormat sdf2 = new SimpleDateFormat(genericUtility.getDBDateFormat()); //SimpleDateFormat sdf2 = new SimpleDateFormat(genericUtility.getDBDateFormat());
//dateFrom =sdf1.format(date).toString() + " 00:00:00.0"; //dateFrom =sdf1.format(date).toString() + " 00:00:00.0";
...@@ -149,27 +149,27 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -149,27 +149,27 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
//date = sdf.parse(dateTo); //date = sdf.parse(dateTo);
//dateTo = sdf2.format(date).toString() + ".00:00:00"; //dateTo = sdf2.format(date).toString() + ".00:00:00";
//chgdateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0"); //chgdateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
//=============================================================== //===============================================================
//conn = getConnection(); //conn = getConnection();
/* ConnDriver connDriver = new ConnDriver();
/* ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");*/ conn = connDriver.getConnectDB("DriverITM");*/
//Added for multi tenancy //Added for multi tenancy
conn = getConnection(); conn = getConnection();
if ((objContext != null) && (objContext.trim().length() > 0)) if ((objContext != null) && (objContext.trim().length() > 0))
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
System.out.println("[" + getClass().getSimpleName() System.out.println("[" + getClass().getSimpleName()
+ "] [itemChanged(D)]:currentFormNo:" + currentFormNo); + "] [itemChanged(D)]:currentFormNo:" + currentFormNo);
System.out.println("currentColumn:::::["+currentColumn+"]"); System.out.println("currentColumn:::::["+currentColumn+"]");
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
...@@ -188,28 +188,28 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -188,28 +188,28 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
} }
ctr++; ctr++;
} }
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn)); while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
if(currentColumn.trim().equalsIgnoreCase("msite_code")) if(currentColumn.trim().equalsIgnoreCase("msite_code"))
{ {
sitecodeany = genericUtility.getColumnValue("msite_code",dom); sitecodeany = genericUtility.getColumnValue("msite_code",dom);
valueXmlString.append("<m_site_arg>").append("<![CDATA["+sitecodeany.trim()+"]]>").append("</m_site_arg>"); valueXmlString.append("<m_site_arg>").append("<![CDATA["+sitecodeany.trim()+"]]>").append("</m_site_arg>");
//valueXmlString.append("<as_ason_date>").append("<![CDATA["+dateFrom+"]]>").append("</as_ason_date>"); //valueXmlString.append("<as_ason_date>").append("<![CDATA["+dateFrom+"]]>").append("</as_ason_date>");
// System.out.println("sitecodeany=========> : "+sitecodeany); // System.out.println("sitecodeany=========> : "+sitecodeany);
} }
/* /*
if(currentColumn.trim().equalsIgnoreCase( "m_date_from" )) if(currentColumn.trim().equalsIgnoreCase( "m_date_from" ))
{ {
dateFrom = genericUtility.getColumnValue( "m_date_from", dom ); dateFrom = genericUtility.getColumnValue( "m_date_from", dom );
String dateFromStr = null; String dateFromStr = null;
String acctPrdSql = null; String acctPrdSql = null;
dateFromStr = genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); dateFromStr = genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
acctPrdSql = "select fr_date from acctprd where ? between fr_date and to_date"; acctPrdSql = "select fr_date from acctprd where ? between fr_date and to_date";
PreparedStatement acctStmt = null; PreparedStatement acctStmt = null;
...@@ -224,12 +224,12 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -224,12 +224,12 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
valueXmlString.append("<as_date_from>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</as_date_from>"); valueXmlString.append("<as_date_from>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</as_date_from>");
valueXmlString.append("<m_frst_date>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");*/ valueXmlString.append("<m_frst_date>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");*/
System.out.println("chgdateToStr BEFORE ==========>: "); System.out.println("chgdateToStr BEFORE ==========>: ");
dateFrom = genericUtility.getColumnValue("m_date_from",dom); dateFrom = genericUtility.getColumnValue("m_date_from",dom);
if ( dateFrom != null && dateFrom.trim().length() > 0) if ( dateFrom != null && dateFrom.trim().length() > 0)
{ {
String sDateFr= genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); String sDateFr= genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
...@@ -245,13 +245,13 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -245,13 +245,13 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
String frDateDBStr = ""; String frDateDBStr = "";
Date date = new Date(); Date date = new Date();
String first_date = ""; String first_date = "";
sql = "SELECT ACCT_PRD,CODE ,FR_DATE FROM PERIOD WHERE FR_DATE<=? AND TO_DATE >=?"; sql = "SELECT ACCT_PRD,CODE ,FR_DATE FROM PERIOD WHERE FR_DATE<=? AND TO_DATE >=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,chgdateFr); pstmt.setTimestamp(1,chgdateFr);
pstmt.setTimestamp(2,chgdateFr); pstmt.setTimestamp(2,chgdateFr);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("chgdateFr :=======================> "+chgdateFr); System.out.println("chgdateFr :=======================> "+chgdateFr);
System.out.println("chgdateTo :=======================> "+chgdateTo); System.out.println("chgdateTo :=======================> "+chgdateTo);
if(rs.next()) if(rs.next())
...@@ -259,37 +259,38 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -259,37 +259,38 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
accPrd = rs.getString("acct_prd"); accPrd = rs.getString("acct_prd");
codePrd=rs.getString("CODE"); codePrd=rs.getString("CODE");
frDateDB = rs.getString("FR_DATE"); frDateDB = rs.getString("FR_DATE");
} }
rs.close(); rs.close();
pstmt.close(); pstmt.close();
sql1 = "SELECT fr_date FROM period where '"+chgdateFr+"' between fr_date and to_date and code='"+codePrd+"'"; sql1 = "SELECT fr_date FROM period where ? between fr_date and to_date and code='"+codePrd+"'";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1,chgdateFr);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
date = rs1.getDate("fr_date"); date = rs1.getDate("fr_date");
} }
rs1.close(); rs1.close();
pstmt1.close(); pstmt1.close();
valueXmlString.append("<as_date_from>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</as_date_from>"); valueXmlString.append("<as_date_from>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</as_date_from>");
valueXmlString.append("<m_frst_date>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</m_frst_date>"); valueXmlString.append("<m_frst_date>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");
valueXmlString.append("<macct_prd>").append("<![CDATA["+accPrd.trim()+"]]>").append("</macct_prd>"); valueXmlString.append("<macct_prd>").append("<![CDATA["+accPrd.trim()+"]]>").append("</macct_prd>");
valueXmlString.append("<mprd_fr>").append("<![CDATA["+codePrd.trim()+"]]>").append("</mprd_fr>"); valueXmlString.append("<mprd_fr>").append("<![CDATA["+codePrd.trim()+"]]>").append("</mprd_fr>");
valueXmlString.append("<m_frst_date>").append("<![CDATA["+date+"]]>").append("</m_frst_date>"); valueXmlString.append("<m_frst_date>").append("<![CDATA["+date+"]]>").append("</m_frst_date>");
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
} }
//end of try //end of try
catch(ITMException e) catch(ITMException e)
{ {
...@@ -302,7 +303,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -302,7 +303,7 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
System.out.println("Exception :: "+ie); System.out.println("Exception :: "+ie);
ie.printStackTrace(); ie.printStackTrace();
throw new ITMException(ie); throw new ITMException(ie);
} }
finally finally
{ {
try try
...@@ -317,11 +318,11 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC ...@@ -317,11 +318,11 @@ public class LedgerAllACsAccountWise extends ValidatorEJB implements LedgerAllAC
{ {
} }
} }
return valueXmlString.toString() ; return valueXmlString.toString() ;
} }
//end of item change //end of item change
private String checkNull(String input) { private String checkNull(String input) {
return input == null ? "" : input.trim(); return input == null ? "" : input.trim();
} }
......
...@@ -31,7 +31,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -31,7 +31,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
NodeList childNodeList = null; NodeList childNodeList = null;
Node parentNode = null; Node parentNode = null;
Node childNode = null; Node childNode = null;
String childNodeName = ""; String childNodeName = "";
int ctr,currentFormNo=0; int ctr,currentFormNo=0;
String columnValue=null; String columnValue=null;
Connection conn = null; Connection conn = null;
...@@ -39,33 +39,33 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -39,33 +39,33 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String errString = null; String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility e12genericUtility = new E12GenericUtility(); E12GenericUtility e12genericUtility = new E12GenericUtility();
/*--Commented for EJB3--sarah--10/06/2009 /*--Commented for EJB3--sarah--10/06/2009
public void ejbCreate() throws RemoteException,CreateException public void ejbCreate() throws RemoteException,CreateException
{ {
} }
public void ejbRemove() public void ejbRemove()
{ {
} }
public void ejbActivate() public void ejbActivate()
{ {
} }
public void ejbPassivate() public void ejbPassivate()
{ {
} }
*/ */
//End Comment--10/06/2009 //End Comment--10/06/2009
public void setSessionContext(SessionContext sess){ public void setSessionContext(SessionContext sess){
} }
public String itemChanged() throws RemoteException,ITMException public String itemChanged() throws RemoteException,ITMException
{ {
return ""; return "";
} }
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
String resultString = ""; String resultString = "";
Document dom = null,dom1 = null,dom2 = null; Document dom = null,dom1 = null,dom2 = null;
...@@ -101,12 +101,12 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -101,12 +101,12 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
return resultString; return resultString;
} //end of item change } //end of item change
public String itemChanged(Document dom,Document dom1,Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(Document dom,Document dom1,Document dom2,String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
java.sql.Timestamp chgdateTo=null; java.sql.Timestamp chgdateTo=null;
java.sql.Timestamp chgdateFr=null; java.sql.Timestamp chgdateFr=null;
String acct_prd=""; String acct_prd="";
String period=""; String period="";
Statement stmt=null; Statement stmt=null;
String dateFrom=null ; String dateFrom=null ;
String dateTo=null ; String dateTo=null ;
...@@ -126,7 +126,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -126,7 +126,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
String sitecode = ""; String sitecode = "";
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>"); valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>"); valueXmlString.append(editFlag).append("</editFlag></header>");
valueXmlString.append("<Detail1>"); valueXmlString.append("<Detail1>");
System.out.println("=======================xtraParams is=============="); System.out.println("=======================xtraParams is==============");
System.out.println("xtraParams is"+xtraParams); System.out.println("xtraParams is"+xtraParams);
System.out.println("=======================xtraParams is=============="); System.out.println("=======================xtraParams is==============");
...@@ -134,14 +134,14 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -134,14 +134,14 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
String sitecodeany=""; String sitecodeany="";
//dateTo = genericUtility.getColumnValue("adt_fr",dom); //dateTo = genericUtility.getColumnValue("adt_fr",dom);
//sitecode = genericUtility.getColumnValue("msitecode",dom); //sitecode = genericUtility.getColumnValue("msitecode",dom);
try{ try{
//===============Convert date to TimeStamp date format=========== //===============Convert date to TimeStamp date format===========
//Timestamp chgdateFrom = null,chgdateTo = null; //Timestamp chgdateFrom = null,chgdateTo = null;
//Object date = null; //Object date = null;
//SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); //SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
//date = sdf.parse(dateFrom); //date = sdf.parse(dateFrom);
//SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat()); //SimpleDateFormat sdf1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
//SimpleDateFormat sdf2 = new SimpleDateFormat(genericUtility.getDBDateFormat()); //SimpleDateFormat sdf2 = new SimpleDateFormat(genericUtility.getDBDateFormat());
//dateFrom =sdf1.format(date).toString() + " 00:00:00.0"; //dateFrom =sdf1.format(date).toString() + " 00:00:00.0";
...@@ -149,27 +149,27 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -149,27 +149,27 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
//date = sdf.parse(dateTo); //date = sdf.parse(dateTo);
//dateTo = sdf2.format(date).toString() + ".00:00:00"; //dateTo = sdf2.format(date).toString() + ".00:00:00";
//chgdateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0"); //chgdateTo = java.sql.Timestamp.valueOf(sdf1.format(date).toString() + " 00:00:00.0");
//=============================================================== //===============================================================
//conn = getConnection(); //conn = getConnection();
/* ConnDriver connDriver = new ConnDriver();
/* ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");*/ conn = connDriver.getConnectDB("DriverITM");*/
//Added for multi tenancy //Added for multi tenancy
conn = getConnection(); conn = getConnection();
if ((objContext != null) && (objContext.trim().length() > 0)) if ((objContext != null) && (objContext.trim().length() > 0))
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
System.out.println("[" + getClass().getSimpleName() System.out.println("[" + getClass().getSimpleName()
+ "] [itemChanged(D)]:currentFormNo:" + currentFormNo); + "] [itemChanged(D)]:currentFormNo:" + currentFormNo);
System.out.println("currentColumn:::::["+currentColumn+"]"); System.out.println("currentColumn:::::["+currentColumn+"]");
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
...@@ -188,28 +188,28 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -188,28 +188,28 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
} }
ctr++; ctr++;
} }
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn)); while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
if(currentColumn.trim().equalsIgnoreCase("msite_code")) if(currentColumn.trim().equalsIgnoreCase("msite_code"))
{ {
sitecodeany = genericUtility.getColumnValue("msite_code",dom); sitecodeany = genericUtility.getColumnValue("msite_code",dom);
valueXmlString.append("<m_site_arg>").append("<![CDATA["+sitecodeany.trim()+"]]>").append("</m_site_arg>"); valueXmlString.append("<m_site_arg>").append("<![CDATA["+sitecodeany.trim()+"]]>").append("</m_site_arg>");
//valueXmlString.append("<as_ason_date>").append("<![CDATA["+dateFrom+"]]>").append("</as_ason_date>"); //valueXmlString.append("<as_ason_date>").append("<![CDATA["+dateFrom+"]]>").append("</as_ason_date>");
// System.out.println("sitecodeany=========> : "+sitecodeany); // System.out.println("sitecodeany=========> : "+sitecodeany);
} }
/* /*
if(currentColumn.trim().equalsIgnoreCase( "m_date_from" )) if(currentColumn.trim().equalsIgnoreCase( "m_date_from" ))
{ {
dateFrom = genericUtility.getColumnValue( "m_date_from", dom ); dateFrom = genericUtility.getColumnValue( "m_date_from", dom );
String dateFromStr = null; String dateFromStr = null;
String acctPrdSql = null; String acctPrdSql = null;
dateFromStr = genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()); dateFromStr = genericUtility.getValidDateString(dateFrom, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat());
acctPrdSql = "select fr_date from acctprd where ? between fr_date and to_date"; acctPrdSql = "select fr_date from acctprd where ? between fr_date and to_date";
PreparedStatement acctStmt = null; PreparedStatement acctStmt = null;
...@@ -224,10 +224,10 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -224,10 +224,10 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
valueXmlString.append("<as_date_from>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</as_date_from>"); valueXmlString.append("<as_date_from>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</as_date_from>");
valueXmlString.append("<m_frst_date>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");*/ valueXmlString.append("<m_frst_date>").append("<![CDATA[" + dateFromStr.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");*/
if(currentColumn.trim().equalsIgnoreCase( "m_date_from" )) if(currentColumn.trim().equalsIgnoreCase( "m_date_from" ))
{ {
System.out.println("chgdateToStr BEFORE ==========>: "); System.out.println("chgdateToStr BEFORE ==========>: ");
dateFrom = genericUtility.getColumnValue("m_date_from",dom); //m_date_from dateFrom = genericUtility.getColumnValue("m_date_from",dom); //m_date_from
System.out.println("dateFrom:dd:"+dateFrom); System.out.println("dateFrom:dd:"+dateFrom);
...@@ -245,13 +245,13 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -245,13 +245,13 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
String codePrd = ""; String codePrd = "";
String frDateDBStr = ""; String frDateDBStr = "";
String first_date = ""; String first_date = "";
sql = "SELECT ACCT_PRD,CODE ,FR_DATE FROM PERIOD WHERE FR_DATE<=? AND TO_DATE >=?"; sql = "SELECT ACCT_PRD,CODE ,FR_DATE FROM PERIOD WHERE FR_DATE<=? AND TO_DATE >=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,chgdateFr); pstmt.setTimestamp(1,chgdateFr);
pstmt.setTimestamp(2,chgdateFr); pstmt.setTimestamp(2,chgdateFr);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println("chgdateFr :=======================> "+chgdateFr); System.out.println("chgdateFr :=======================> "+chgdateFr);
System.out.println("chgdateTo :=======================> "+chgdateTo); System.out.println("chgdateTo :=======================> "+chgdateTo);
if(rs.next()) if(rs.next())
...@@ -259,36 +259,37 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -259,36 +259,37 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
accPrd = rs.getString("ACCT_PRD"); accPrd = rs.getString("ACCT_PRD");
codePrd=rs.getString("CODE"); codePrd=rs.getString("CODE");
frDateDB = rs.getString("FR_DATE"); frDateDB = rs.getString("FR_DATE");
} }
rs.close(); rs.close();
pstmt.close(); pstmt.close();
sql1 = "SELECT fr_date FROM period where '"+chgdateFr+"' between fr_date and to_date and code='"+codePrd+"'"; sql1 = "SELECT fr_date FROM period where ? between fr_date and to_date and code='"+codePrd+"'";
pstmt1 = conn.prepareStatement(sql1); pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1,chgdateFr);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1.next()) if(rs1.next())
{ {
first_date = rs1.getString("fr_date"); first_date = rs1.getString("fr_date");
} }
rs1.close(); rs1.close();
pstmt1.close(); pstmt1.close();
valueXmlString.append("<as_date_from>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</as_date_from>"); valueXmlString.append("<as_date_from>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</as_date_from>");
valueXmlString.append("<m_frst_date>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</m_frst_date>"); valueXmlString.append("<m_frst_date>").append("<![CDATA[" + frDateDB.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");
valueXmlString.append("<macct_prd>").append("<![CDATA["+accPrd.trim()+"]]>").append("</macct_prd>"); valueXmlString.append("<macct_prd>").append("<![CDATA["+accPrd.trim()+"]]>").append("</macct_prd>");
valueXmlString.append("<mprd_fr>").append("<![CDATA["+codePrd.trim()+"]]>").append("</mprd_fr>"); valueXmlString.append("<mprd_fr>").append("<![CDATA["+codePrd.trim()+"]]>").append("</mprd_fr>");
valueXmlString.append("<m_frst_date>").append("<![CDATA[" + first_date.trim() + " 00:00:00" +"]]>").append("</m_frst_date>"); valueXmlString.append("<m_frst_date>").append("<![CDATA[" + first_date.trim() + " 00:00:00" +"]]>").append("</m_frst_date>");
} }
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
} }
//end of try //end of try
catch(ITMException e) catch(ITMException e)
{ {
...@@ -301,7 +302,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -301,7 +302,7 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
System.out.println("Exception :: "+ie); System.out.println("Exception :: "+ie);
ie.printStackTrace(); ie.printStackTrace();
throw new ITMException(ie); throw new ITMException(ie);
} }
finally finally
{ {
try try
...@@ -316,11 +317,11 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal, ...@@ -316,11 +317,11 @@ public class Ledgerdatewise extends ValidatorEJB implements LedgerdatewiseLocal,
{ {
} }
} }
return valueXmlString.toString() ; return valueXmlString.toString() ;
} }
//end of item change //end of item change
private String checkNull(String input) { private String checkNull(String input) {
return input == null ? "" : input.trim(); return input == null ? "" : input.trim();
} }
......
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