Commit c2b3e6d7 authored by caluka's avatar caluka

Ejb updated for GRN Transfer wizard Transaction[D14HFRA001]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96890 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d3043d8a
......@@ -75,6 +75,7 @@ public class StockTransferPos extends ValidatorEJB implements StockTransferPosLo
DistStkUpdLocal distStkUpd = null;
NodeList hdrDom = null;
Node currDetail = null;
Node parentNode = null;
try
{
System.out.println("objContext =[" + objContext + "]");
......@@ -83,13 +84,24 @@ public class StockTransferPos extends ValidatorEJB implements StockTransferPosLo
distStkUpd = getComponent("DistStkUpd");
hdrDom = dom.getElementsByTagName("Detail1");
//Start added by chandra shekar 0n 25-11-14
parentNode = hdrDom.item(0);
String objName = getObjName(parentNode);
System.out.println("objName=["+objName+"]domID["+domID+"]");
if(("w_qc_sample_wiz".equals(objName)) || ("w_grn_transfer_wiz".equals(objName)) )
{
hdrDom = dom.getElementsByTagName("Detail2");
}
//end added by chandra shekar 0n 25-11-14
siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));
System.out.println("tran_id : " + tranId);
System.out.println("objContext ::[" + objContext + "]");
//currDetail = getCurrentDetailFromDom(dom,domID); Commented by gulzar on 12/24/2011
currDetail = getCurrentDetailFromDom( dom, domID, objContext );//Change added by gulzar on 12/24/2011
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println(">>>>>>>currDetail@@@:"+currDetail);
System.out.println(">>>>>>>updateStatus@@@:"+updateStatus);
if (currDetail != null && !updateStatus.equalsIgnoreCase("D"))
{
......@@ -176,7 +188,30 @@ public class StockTransferPos extends ValidatorEJB implements StockTransferPosLo
}
return "";
}
//start added by chandrashekar on 1-dec-14
private String getObjName(Node node) throws Exception
{
String objName = null;
NodeList nodeList = null;
Node detaulNode = null;
Node detailNode = null;
nodeList = node.getChildNodes();
NamedNodeMap attrMap = node.getAttributes();
objName = attrMap.getNamedItem( "objName" ).getNodeValue();
/*
for(int ctr = 0; ctr < nodeList.getLength(); ctr++ )
{
detailNode = nodeList.item(ctr);
if(detailNode.getNodeName().equalsIgnoreCase("attribute") )
{
objName = detailNode.getAttributes().getNamedItem("objName").getNodeValue();
}
}
*/
return "w_" + objName;
}
//end added by chandrashekar on 01-dec-14
private String chkStockOption(String itemCode, String siteCode,Connection conn)throws RemoteException,ITMException
{
//Connection conn = null; // COMMENTED BY RITESH ON 11-11-13
......@@ -256,7 +291,7 @@ public class StockTransferPos extends ValidatorEJB implements StockTransferPosLo
Node currDetail = null,reqDetail = null;
String currDomId = "";
int detailListLength = 0;
System.out.println("objContext:["+objContext+"]");
//detailList = dom.getElementsByTagName("Detail2");//Commented by gulzar on 12/24/2011
detailList = dom.getElementsByTagName("Detail"+objContext);//change added by gulzar on 12/24/2011
detailListLength = detailList.getLength();
......
......@@ -45,10 +45,25 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
Document dom = null;
try
{
System.out.println(">>>>>>>>objContext:"+objContext);
System.out.println(">>>>>>>>xtraParams:"+xtraParams);
if (xmlString1 != null && xmlString1.trim().length() > 0)
{
dom = GenericUtility.getInstance().parseString(xmlString1);
executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
if( (xmlString1.toUpperCase()).contains("DETAIL4"))
{
System.out.println(">>>>>>>>>>>>>>In Detail4:"+xmlString1);
//executePostSaveRec(dom,domId,objContext,editFlag,xtraParams, conn);
executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
//else if( "w_woi_scan".equals(windowName))
else
{
//executePostSaveRec(dom,domId,objContext,editFlag,xtraParams, conn);
executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
//executepreSaveRec(dom,domId,objContext,editFlag,xtraParams,conn);
}
}
catch(Exception e)
......@@ -73,17 +88,31 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
DistStkUpdLocal distStkUpd = null;
NodeList hdrDom = null;
Node currDetail = null;
Node parentNode = null;
try
{
distStkUpd = getComponent("DistStkUpd");
stmt = conn.createStatement();
hdrDom = dom.getElementsByTagName("Detail1");
//Code Added by sagar on 25/11/14 Start..
parentNode = hdrDom.item(0);
String objName = getObjName(parentNode);
System.out.println(">>>>>>>>>>>objName Detail2:"+objName);
if(("w_qc_sample_wiz".equals(objName)) || ("w_grn_transfer_wiz".equals(objName)) )
{
System.out.println(">>>>>In Match obj name Detail2:"+objName);
hdrDom = dom.getElementsByTagName("Detail2");
}
//Code Added by sagar on 25/11/14 End..
siteCode = GenericUtility.getInstance().getColumnValueFromNode("site_code",hdrDom.item(0));
tranId = GenericUtility.getInstance().getColumnValueFromNode("tran_id",hdrDom.item(0));
System.out.println("tran_id :" + tranId);
currDetail = getCurrentDetailFromDom(dom,domID);
System.out.println(">>>tran_id :" + tranId);
System.out.println(">>>siteCode :" + siteCode);
//currDetail = getCurrentDetailFromDom(dom,domID);
currDetail = getCurrentDetailFromDom(dom,domID,objName); //Code Added by sagar
System.out.println(">>>>>>>currDetail:"+currDetail);
updateStatus = getCurrentUpdateFlag(currDetail);
System.out.println(">>>>>>>updateStatus:"+updateStatus);
if (currDetail != null && !updateStatus.equalsIgnoreCase("A"))
{
lineNo = GenericUtility.getInstance().getColumnValueFromNode("line_no",currDetail);
......@@ -170,7 +199,6 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
}
return errString;
}
private Node getCurrentDetailFromDom(Document dom,String domId)
{
NodeList detailList = null;
......@@ -192,7 +220,35 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
}
return reqDetail;
}
private Node getCurrentDetailFromDom(Document dom,String domId,String objName)
{
NodeList detailList = null;
Node currDetail = null,reqDetail = null;
String currDomId = "";
int detailListLength = 0;
if(("w_qc_sample_wiz".equals(objName)) || ("w_grn_transfer_wiz".equals(objName)) )
{
System.out.println(">>>>>In Match obj name Detail4:"+objName);
detailList = dom.getElementsByTagName("Detail4");
}
else
{
detailList = dom.getElementsByTagName("Detail2");
}
detailListLength = detailList.getLength();
for (int ctr = 0;ctr < detailListLength;ctr++)
{
currDetail = detailList.item(ctr);
currDomId = currDetail.getAttributes().getNamedItem("domID").getNodeValue();
if (currDomId.equals(domId))
{
reqDetail = currDetail;
break;
}
}
return reqDetail;
}
private String getCurrentUpdateFlag(Node currDetail)
{
NodeList currDetailList = null;
......@@ -200,7 +256,9 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
System.out.println(">>>>>>currDetailList in getCurrentUpdateFlag():"+currDetailList);
currDetailListLength = currDetailList.getLength();
System.out.println(">>>>>>currDetailListLength in getCurrentUpdateFlag():"+currDetailListLength);
for (int i=0;i< currDetailListLength;i++)
{
nodeName = currDetailList.item(i).getNodeName();
......@@ -251,4 +309,27 @@ public class StockTransferPrs extends ValidatorEJB implements StockTransferPrsLo
}
return comp;
}
//getObjName method added by sagar on 25/11/14
private String getObjName(Node node) throws Exception
{
String objName = null;
NodeList nodeList = null;
Node detaulNode = null;
Node detailNode = null;
nodeList = node.getChildNodes();
NamedNodeMap attrMap = node.getAttributes();
objName = attrMap.getNamedItem( "objName" ).getNodeValue();
/*
for(int ctr = 0; ctr < nodeList.getLength(); ctr++ )
{
detailNode = nodeList.item(ctr);
if(detailNode.getNodeName().equalsIgnoreCase("attribute") )
{
objName = detailNode.getAttributes().getNamedItem("objName").getNodeValue();
}
}
*/
return "w_" + objName;
}
}
\ No newline at end of file
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