Commit dcaed015 authored by manohar's avatar manohar

bugfixing


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91571 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7c61b3f1
......@@ -18,7 +18,6 @@ import ibase.system.config.*;
import ibase.webitm.ejb.*;
import javax.ejb.Stateless; // added for ejb3
//public class LCDetPosEJB extends ValidatorEJB implements SessionBean
@Stateless // added for ejb3
public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRemote
......@@ -39,26 +38,186 @@ public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRem
{
return "";
}
public String postSaveRec(String xmlString1, String domId, String objContext, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
public String postSave(String xmlString1, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
System.out.println("LCDetPosEJB Called............!");
System.out.println("LCDetPosEJB Called..postSave..........!");
Document dom = null;
try
{
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString1);
executePostSave(dom,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
System.out.println("Exception :LCDetPosEJB :postSave(): " + e.getMessage()+ ":");
e.printStackTrace();
throw new ITMException(e);
}
return "";
}
public String postSaveRec(String xmlString, String domId, String objContext, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
System.out.println("LCDetPosEJB Called............!");
Document dom = null;
try
{
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString);
executepostSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
System.out.println("Exception :LCDetPosEJB :postSaveRec(): " + e.getMessage()+ ":");
System.out.println("Exception :LCDetPosEJB :postSave(): " + e.getMessage()+ ":");
e.printStackTrace();
throw new ITMException(e);
}
return "";
}
private String executePostSave(Document dom, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
String sql = "",dlvTo = "", dlvAdd1 = "", dlvAdd2 = "", dlvAdd3 = "", city = "";
String stateCodeDlv = "", countCodeDlv = "", pinDlv = "", stanCodeDlv = "", tel1Dlv = "";
String tel2Dlv = "", tel3Dlv = "", faxDlv = "", saleOrder = "";
NodeList hdrDom = null;
Node currDetail = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
int count = 0;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
dlvTo = genericUtility.getColumnValue("dlv_to",dom);
dlvAdd1 = genericUtility.getColumnValue("dlv_add1",dom);
dlvAdd2 = genericUtility.getColumnValue("dlv_add2",dom);
dlvAdd3 = genericUtility.getColumnValue("dlv_add3",dom);
city = genericUtility.getColumnValue("dlv_city",dom);
stateCodeDlv = genericUtility.getColumnValue("state_code__dlv",dom);
countCodeDlv = genericUtility.getColumnValue("count_code__dlv",dom);
pinDlv = genericUtility.getColumnValue("dlv_pin",dom);
stanCodeDlv = genericUtility.getColumnValue("stan_code__dlv",dom);
tel1Dlv = genericUtility.getColumnValue("tel1__dlv",dom);
tel2Dlv = genericUtility.getColumnValue("tel2__dlv",dom);
tel3Dlv = genericUtility.getColumnValue("tel3__dlv",dom);
faxDlv = genericUtility.getColumnValue("fax__dlv",dom);
saleOrder = genericUtility.getColumnValue("sale_order",dom);
if (dlvTo != null && dlvTo.trim().length() > 0)
{
sql = "select count(1) from sorder where sale_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleOrder);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1) ;
}
rs.close();
pstmt.close();
rs = null;
pstmt = null;
if (count > 0 )
{
sql = "update sorder set dlv_to = ?, "
+ " dlv_add1 = ?, "
+ " dlv_add2 = ?, "
+ " dlv_add3 = ?, "
+ " dlv_city = ?, "
+ " state_code__dlv = ?, "
+ " count_code__dlv = ?, "
+ " dlv_pin = ?, "
+ " stan_code = ?, "
+ " tel1__dlv = ?, "
+ " tel2__dlv = ?, "
+ " tel3__dlv = ?, "
+ " fax__dlv = ? "
+ " where sale_order = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,dlvTo);
pstmt.setString(2,dlvAdd1);
pstmt.setString(3,dlvAdd2);
pstmt.setString(4,dlvAdd3);
pstmt.setString(5,city);
pstmt.setString(6,stateCodeDlv);
pstmt.setString(7,countCodeDlv);
pstmt.setString(8,pinDlv);
pstmt.setString(9,stanCodeDlv);
pstmt.setString(10,tel1Dlv);
pstmt.setString(11,tel2Dlv);
pstmt.setString(12,tel3Dlv);
pstmt.setString(13,faxDlv);
pstmt.setString(14,saleOrder);
count = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if (count > 0)
{
System.out.println("Update Into SORDDET Successfully....:: " + count);
}
else if (count == 0)
{
System.out.println("No Updation Occur Into SORDER ....:: " + count);
}
}
}
}
catch (SQLException sqe)
{
System.out.println("The SQLException occurs in LCDetPosEJB...... :"+sqe);
try
{
conn.rollback();
}
catch (Exception sqe1){}
sqe.printStackTrace();
throw new ITMException(sqe);
}
catch(Exception e)
{
System.out.println("The Exception occurs in LCDetPosEJB........ :"+e);
try
{
conn.rollback();
}
catch (Exception e1){}
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
System.err.println("Exception :LCDetPosEJB......... :\n"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
}
return "";
}
private String executepostSaveRec(Document dom, String domID, String ObjContext, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
String saleOrder = "", lineNoSord = "", descr = "", sqlUpd = "";
......@@ -97,7 +256,7 @@ public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRem
if (updCnt > 0)
{
System.out.println("Update Into SORDDET Successfully....:: " + updCnt);
conn.commit();
//conn.commit();
}
else if (updCnt == 0)
{
......
......@@ -18,5 +18,6 @@ public interface LCDetPosLocal extends ValidatorLocal
{
public String postSaveRec()throws RemoteException,ITMException;
public String postSave(String xmlString1, String editFlag, String xtraParams, Connection con) throws RemoteException, ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -18,5 +18,6 @@ public interface LCDetPosRemote extends ValidatorRemote
{
public String postSaveRec()throws RemoteException,ITMException;
public String postSave(String xmlString1, String editFlag, String xtraParams, Connection con) throws RemoteException, ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
......@@ -2492,12 +2492,17 @@ public class SalesReturn extends ValidatorEJB implements SalesReturnLocal, Sales
valueXmlString.append("<site_code__mfg>").append("<![CDATA[" + getAbsString(siteCodeMfg) + "]]>").append("</site_code__mfg>");
setNodeValue( dom, "site_code__mfg", siteCodeMfg );
if (mfgDate != null)
{
valueXmlString.append("<mfg_date>").append("<![CDATA[" + genericUtility.getValidDateString( mfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) + "]]>").append("</mfg_date>");
setNodeValue( dom, "mfg_date", genericUtility.getValidDateString( mfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) );
}
valueXmlString.append("<mfg_date>").append("<![CDATA[" + genericUtility.getValidDateString( mfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) + "]]>").append("</mfg_date>");
setNodeValue( dom, "mfg_date", genericUtility.getValidDateString( mfgDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) );
valueXmlString.append("<exp_date>").append("<![CDATA[" + genericUtility.getValidDateString( expDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) + "]]>").append("</exp_date>");
setNodeValue( dom, "exp_date", genericUtility.getValidDateString( expDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) );
if (expDate != null)
{
valueXmlString.append("<exp_date>").append("<![CDATA[" + genericUtility.getValidDateString( expDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) + "]]>").append("</exp_date>");
setNodeValue( dom, "exp_date", genericUtility.getValidDateString( expDate.toString(), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat() ) );
}
valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>");
setNodeValue( dom, "lot_no", lotNo );
......
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