Commit b24dae1a authored by dpawar's avatar dpawar

handle dom


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96514 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2092242d
......@@ -3,8 +3,10 @@ package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.util.*;
import java.sql.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
......@@ -12,6 +14,7 @@ import ibase.webitm.ejb.dis.InvAllocTraceBean;
import ibase.system.config.*;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless; // added for ejb3
......@@ -19,6 +22,7 @@ import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, DistIssuePosRemote
{
String objName="",detailNode="";
/*public void ejbCreate() throws RemoteException, CreateException
{
}
......@@ -63,7 +67,8 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
public String postSaveRec(String xmlString,String xmlString1,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
Document dom = null,dom1 = null;
System.out.println("DistIssuePosEJB called xmlString [" + xmlString + "] xmlString1 [" + xmlString1 + "]");
System.out.println("DistIssuePosEJB called xmlString : [" + xmlString + "] ");
System.out.println("xmlString1 : ["+xmlString1+"]");
try
{
if (xmlString != null && xmlString.trim().length() > 0)
......@@ -74,7 +79,24 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = GenericUtility.getInstance().parseString(xmlString1);
if( (xmlString1.toUpperCase()).contains("DISTISSWIZ") )
{
objName="distisswiz";
detailNode="detail3";
if( (xmlString1.toUpperCase()).contains("DETAIL3") )
{
executepostSaveRec(dom,dom1,objContext,editFlag,xtraParams,conn);
}
}
else
{
objName="";
detailNode="detail2";
executepostSaveRec(dom,dom1,objContext,editFlag,xtraParams,conn);
}
}
}
catch(Exception e)
......@@ -111,14 +133,33 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
tranDate = new java.sql.Date(System.currentTimeMillis());
System.out.println("\n tranDate :"+tranDate);
//commented by Dadso Pawar on 01/10/14
//hdrDom = dom1.getElementsByTagName("Detail1");
if("distisswiz".equalsIgnoreCase(objName))
{
hdrDom = dom.getElementsByTagName("Detail2");
}
else
{
hdrDom = dom.getElementsByTagName("Detail1");
}
hdrDom = dom1.getElementsByTagName("Detail1");
siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));
System.out.println("Site Code :: "+siteCode);
System.out.println("Tran ID :: "+tranId);
//currDetail = getCurrentDetailFromDom(dom,domID);
//currDetail = dom.getElementsByTagName("Detail2").item(0);
if("distisswiz".equalsIgnoreCase(objName))
{
currDetail = dom.getElementsByTagName("Detail3").item(0);
}
else
{
currDetail = dom.getElementsByTagName("Detail2").item(0);
}
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println(" Update Status ::"+updateStatus);
if (currDetail != null && !updateStatus.equalsIgnoreCase("D"))
{
......@@ -174,7 +215,7 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
if (!stockOpt.equalsIgnoreCase("0"))
{
strAllocate.put("tran_date",tranDate);
strAllocate.put("ref_ser","D-ISS");
//strAllocate.put("ref_ser","D-ISS");
strAllocate.put("ref_id",tranId);
strAllocate.put("ref_line",line.substring(line.length()-3));
strAllocate.put("site_code",siteCode);
......@@ -185,7 +226,18 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
strAllocate.put("alloc_qty",new Double(quantity));
strAllocate.put("chg_user",GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("chg_term",GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
//strAllocate.put("chg_win","W_DIST_ISSUE");
if("distisswiz".equalsIgnoreCase(objName))
{
strAllocate.put("chg_win","W_DESPATCHWIZ");
strAllocate.put("ref_ser","WI-ISS");
}
else
{
strAllocate.put("chg_win","W_DIST_ISSUE");
strAllocate.put("ref_ser","D-ISS");
}
System.out.println("Calling DistStkUpdEJB.....");
//if (distStkUpd.updAllocTrace(strAllocate) > 0)
......
......@@ -3,14 +3,17 @@ package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.util.*;
import java.sql.*;
import javax.ejb.*;
import javax.naming.InitialContext;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.GenericUtility;
import javax.annotation.*;
import javax.ejb.Stateless; // added for ejb3
......@@ -19,6 +22,7 @@ import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3
public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, DistIssuePrsRemote
{
String objName="",detailNode="";
/*public void ejbCreate() throws RemoteException, CreateException
{
}
......@@ -35,11 +39,40 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
{
}*/
public String preSaveRecWiz(String xmlString,String xmlString1,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
System.out.println("DistIssuePrs Ejb called preSaveRec for wizard......");
System.out.println("DistIssuePrsEJB called xmlString [" + xmlString + "]");
System.out.println(" @#xmlString1 [" + xmlString1 + "]");
Document dom = null,dom1=null;
try
{
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
if( (xmlString1.toUpperCase()).contains("DETAIL3") )
{
dom = GenericUtility.getInstance().parseString(xmlString1);
executepreSaveRec(dom,dom1,objContext,editFlag,xtraParams,conn);
}
}
}
catch(Exception e)
{
System.out.println("Exception :DistIssuePrsEJB :preSaveRec() :" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return "";
}
public String preSaveRec() throws RemoteException,ITMException
{
return "";
}
//public String preSaveRec(String xmlString1,String domId,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
public String preSaveRec(String xmlString,String xmlString1,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
......@@ -52,11 +85,27 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
dom = GenericUtility.getInstance().parseString(xmlString);
//executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom1 = GenericUtility.getInstance().parseString(xmlString1);
//if( (xmlString1.toUpperCase()).contains("DETAIL2") || (xmlString1.toUpperCase()).contains("DETAIL3") )
if( (xmlString1.toUpperCase()).contains("DETAIL3") )
{
objName="distisswiz";
detailNode="detail3";
}
else
{
objName="";
detailNode="detail2";
}
executepreSaveRec(dom,dom1,objContext,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
......@@ -91,7 +140,16 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
tranDate = new java.sql.Date(System.currentTimeMillis());
System.out.println("\n tranDate :"+tranDate);
hdrDom = dom1.getElementsByTagName("Detail1");
//hdrDom = dom1.getElementsByTagName("Detail1");
if("distisswiz".equalsIgnoreCase(objName))
{
System.out.println("distisswiz condition............#$#$#");
hdrDom = dom.getElementsByTagName("Detail2");
}
else
{
hdrDom = dom.getElementsByTagName("Detail1");
}
siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));
......@@ -99,21 +157,38 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
System.out.println("\n tranId :"+tranId);
//currDetail = getCurrentDetailFromDom(dom,domID);
//currDetail = dom.getElementsByTagName("Detail2").item(0);
if("distisswiz".equalsIgnoreCase(objName))
{
currDetail = dom.getElementsByTagName("Detail3").item(0);;
}
else
{
currDetail = dom.getElementsByTagName("Detail2").item(0);
}
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println("updateStatus :"+updateStatus);
if (currDetail != null && !updateStatus.equalsIgnoreCase("A"))
{
System.out.println("in condition.................@@@@@@");
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no",currDetail);
System.out.println("lineNo------->>["+lineNo+"]");
itemCode = GenericUtility.getInstance().getColumnValueFromNode("item_code",currDetail);
System.out.println("itemCode------->>["+itemCode+"]");
locCode = GenericUtility.getInstance().getColumnValueFromNode("loc_code",currDetail);
System.out.println("locCode------->>["+locCode+"]");
lotNo = GenericUtility.getInstance().getColumnValueFromNode("lot_no",currDetail);
System.out.println("lotNo------->>["+lotNo+"]");
lotSl = GenericUtility.getInstance().getColumnValueFromNode("lot_sl",currDetail);
System.out.println("lotSl------->>["+lotSl+"]");
quantityStr = GenericUtility.getInstance().getColumnValueFromNode("quantity",currDetail);
System.out.println("quantityStr------->>["+quantityStr+"]");
if (updateStatus.equalsIgnoreCase("E") || updateStatus.equalsIgnoreCase("D"))
{
//Commented And Changes Below - Gulzar 17/05/07
//sql = "SELECT QUANTITY FROM DISTORD_ISSDET WHERE TRAN_ID ='"+tranId+"' AND LINE_NO ="+lineNo+""; // Gulzar 17/05/07
sql = "SELECT ITEM_CODE, LOC_CODE, LOT_NO, LOT_SL, QUANTITY FROM DISTORD_ISSDET WHERE TRAN_ID ='"+tranId+"' AND LINE_NO ="+lineNo+""; // Gulzar 17/05/07
System.out.println("sql dist 11212sql-->>["+sql+"]");
rs = stmt.executeQuery(sql);
if (rs.next())
{
......@@ -125,6 +200,7 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
}
//End Changes - Gulzar 17/05/07
}
System.out.println("sql dist sql-->>["+sql+"]");
quantity = Double.parseDouble(quantityStr);
if (lotNo == null || lotNo.trim().length() == 0)
{
......@@ -160,7 +236,7 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
System.out.println("line1 :"+line);
strAllocate.put("tran_date",tranDate);
strAllocate.put("ref_ser","D-ISS");
//strAllocate.put("ref_ser","D-ISS");
strAllocate.put("ref_id",tranId);
strAllocate.put("ref_line",line.substring(line.length()-3));
strAllocate.put("site_code",siteCode);
......@@ -171,7 +247,18 @@ public class DistIssuePrs extends ValidatorEJB implements DistIssuePrsLocal, Dis
strAllocate.put("alloc_qty",new Double(-1*quantity));
strAllocate.put("chg_user",GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginCode"));
strAllocate.put("chg_term",GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"termId"));
//strAllocate.put("chg_win","W_DIST_ISSUE");
if("distisswiz".equalsIgnoreCase(objName))
{
strAllocate.put("chg_win","W_DISTISSWIZ");
strAllocate.put("ref_ser","WI-ISS");
}
else
{
strAllocate.put("chg_win","W_DIST_ISSUE");
strAllocate.put("ref_ser","D-ISS");
}
System.out.println("Calling DistStkUpdEJB.....");
//if (distStkUpd.updAllocTrace(strAllocate) > 0)
......
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