Commit 614ed5ed authored by dpawar's avatar dpawar

added new functionality


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97200 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e43d841f
......@@ -830,9 +830,10 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
{
System.out.println("item change form 3........");
ArrayList<String> ptcnList = null;
HashMap<String,String> ptcnMap =new HashMap<String,String>();
String pickOrder = "" ,saleOrderL = "",itemCode = "" ,locCode = "" ,lotNo = "" ,lotSl = "",subSql = "",
ptcnNo = "" ,mark = "",cartonNo = "",itemDescr = "",outerCartenNo = "",sorderLine = "";
int noArt = 0,count = 0,domId = 0 ;
int noArt = 0,count = 0,domId = 0,pstmtCount=0 ;
double quantity = 0,deAllQuantity = 0;
tranId = checkNull(genericUtility.getColumnValue( "tran_id", hdrDataDom ));
String qty = checkNull(genericUtility.getColumnValue( "quantity", allFormDataDom ));
......@@ -845,11 +846,11 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
System.out.println("item change form 3........itm_default");
ptcnList = getPtcnNo("ptcn", allFormDataDom, "2");
System.out.println("ptcnList@----->"+ptcnList);
for(int i=0 ;i < ptcnList.size();i++)
ptcnMap = getPtcnNo("ptcn", allFormDataDom, "2");
System.out.println("ptcnMap@----->"+ptcnMap);
for(Map.Entry<String, String> entry : ptcnMap.entrySet())
{
subSql = subSql + ","+ptcnList.get(i);
subSql = subSql + ","+entry.getValue();
}
subSql = subSql.substring(1,subSql.length()) ;
System.out.println("@@@ sql in @@@ :["+subSql+"]");
......@@ -860,7 +861,7 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
+ "FROM PICK_ORD_DET PODET, ITEM ITEM WHERE PODET.PICK_ORDER IN "
+ "(SELECT REF_ID FROM WAVE_TASK_DET WHERE PTCN IN (");
for (int i= 0;i < ptcnList.size();i++)
for(Map.Entry<String, String> entry : ptcnMap.entrySet())
{
mark = mark + "?,";
}
......@@ -871,9 +872,9 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
+ "ORDER BY PODET.LOC_CODE, PODET.ITEM_CODE");
System.out.println("sqlBuf : "+sqlBuf.toString());
pstmt = conn.prepareStatement(sqlBuf.toString());
for (int i= 0;i < ptcnList.size();i++)
for(Map.Entry<String, String> entry : ptcnMap.entrySet())
{
pstmt.setString(i+1, ptcnList.get(i));
pstmt.setString(++pstmtCount,entry.getValue());
}
rs =pstmt.executeQuery();
......@@ -896,12 +897,16 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
deAllQuantity = rs.getDouble("DEALLOC_QTY");
sorderLine = checkNull(rs.getString("LINE_NO__SORD"));
if(ptcnList !=null && ptcnList.size() > 0)
/*if(ptcnList !=null && ptcnList.size() > 0)
{
ptcnNo = ptcnList.get(count);
}
count++;
}*/
count++;
if(ptcnMap !=null && ptcnMap.size() > 0)
{
ptcnNo = ptcnMap.get(saleOrderL);
}
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"N\">\r\n");
//valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
......@@ -970,12 +975,15 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
cartonNo = checkNull(rs.getString("CARTON_NO"));
deAllQuantity = rs.getDouble("DEALLOC_QTY");
sorderLine = checkNull(rs.getString("LINE_NO__SORD"));
if(ptcnList !=null && ptcnList.size() > 0)
/*if(ptcnList !=null && ptcnList.size() > 0)
{
ptcnNo = ptcnList.get(count);
}
}*/
count++;
if(ptcnMap !=null && ptcnMap.size() > 0)
{
ptcnNo = ptcnMap.get(saleOrderL);
}
valueXmlString.append("<Detail3 domID='"+domId+"' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
......@@ -1229,43 +1237,39 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
}
return lineNo;
}
public ArrayList<String> getPtcnNo(String colName, Document dom, String formNo)
public HashMap<String,String> getPtcnNo(String colName, Document dom, String formNo)
{
ArrayList<String> colVal = new ArrayList<String>();
Node elementName = null, parentNode = null;
NodeList elementList = null;
Element elementAttr = null;
HashMap<String,String> colMap = new HashMap<String,String>();
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int childNodeListLength = 0;
String childNodeName = null,ptcn = "",oldPtcn = "",saleOrder = "";
GenericUtility genericUtility = GenericUtility.getInstance();
String columnName = "";
String columnValue = null;
boolean continueLoop = true;
boolean isFormNo = false;
int ctr;
boolean isFormNo = false;
try
{
elementList = dom.getElementsByTagName(colName);
if (Integer.parseInt(formNo) < 1)
{
isFormNo = true;
}
for(ctr = 0; ctr < elementList.getLength(); ctr++)
{
elementName = elementList.item(ctr);
parentNode = elementName.getParentNode();
elementAttr = (Element)parentNode;
if(elementAttr.getAttribute("objContext").equals(formNo) || elementAttr.getAttribute("formno").equals(formNo) || isFormNo)
parentNodeList = dom.getElementsByTagName("Detail2");
childNodeListLength = parentNodeList.getLength();
System.out.println("childNodeListLength----->>"+childNodeListLength);
for (int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = parentNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
if (childNode.getNodeType() == Node.ELEMENT_NODE)
{
columnName = elementName.getNodeName();
columnValue = "";
if(elementName.getFirstChild()!=null)
{
columnValue = elementName.getFirstChild().getNodeValue();
colVal.add(columnValue);
}
else
{
columnValue = null;
colVal.add(columnValue);
}
Element eElement = (Element) childNode;
ptcn = checkNull(eElement.getElementsByTagName("ptcn").item(0).getTextContent());
saleOrder = checkNull(eElement.getElementsByTagName("sale_order").item(0).getTextContent());
System.out.println("sale_order0----->"+saleOrder+ " PTCN --->["+ptcn+"]");
colMap.put(saleOrder,ptcn);
}
}
}
......@@ -1274,15 +1278,8 @@ public class MultiplePtcnWiz extends ValidatorEJB implements PickIssICLocal, Pic
System.out.println("Exception : [getPtcnNo(2)] :==>\n"+e.getMessage());
}
finally
{
elementName = null;
parentNode = null;
elementList = null;
elementAttr = null;
columnName = null;
}
return colVal;
return colMap;
}
private String getSiteCode( String xtraParams, Connection conn ) throws ITMException
{
......
......@@ -13,9 +13,12 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@javax.ejb.Stateless
public class MultiplePtcnWizPos extends ValidatorEJB implements MultiplePtcnWizPosLocal, MultiplePtcnWizPosRemote
......@@ -44,32 +47,84 @@ public class MultiplePtcnWizPos extends ValidatorEJB implements MultiplePtcnWizP
Document dom = null;
ResultSet rs = null;
PreparedStatement pstmt = null;
String errorString = "",sql = "";
int count = 0,nodeLength = 0,cnt = 0;
NodeList detail3List = null;
String errorString = "",sql = "",ptcn= "",saleOrder= "",childNodeName = "",mark = "";
int count = 0,nodeLength = 0,cnt = 0,childNodeListLength= 0;
Node parentNode = null;
Node childNode = null;
NodeList detail3List = null,detail2List = null;
NodeList childNodeList = null;
MultiplePtcnWizConf MultiplePtcnWizConfobj = null;
NodeList parentNodeList = null;
ArrayList<String> sorderList = new ArrayList <String>();
HashMap<String,Integer> sorderItemCountMap = new HashMap<String,Integer> ();
StringBuffer sqlBuf = new StringBuffer();
int pstmtCnt = 0;
try
{
conn.setAutoCommit(false);
dom = genericUtility.parseString(domString);
if(dom != null)
{
detail3List = dom.getElementsByTagName("Detail3");
{
parentNodeList = dom.getElementsByTagName("Detail2");
System.out.println("parentNode >>>{"+parentNode+"}");
int nodeCnt = parentNodeList.getLength();
System.out.println("nodeCnt >>>{"+nodeCnt+"}");
if(nodeCnt > 0)
{
childNodeListLength = parentNodeList.getLength();
System.out.println("childNodeListLength----->>"+childNodeListLength);
for (int ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = parentNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("Child name --->> "+childNodeName);
if (childNode.getNodeType() == Node.ELEMENT_NODE)
{
Element eElement = (Element) childNode;
ptcn = eElement.getElementsByTagName("ptcn").item(0).getTextContent();
saleOrder = eElement.getElementsByTagName("sale_order").item(0).getTextContent();
saleOrder = saleOrder == null ? "" : saleOrder.trim();
System.out.println("ptcn --->> "+ptcn);
System.out.println("saleOrder --->> "+saleOrder);
sorderList.add(saleOrder);
}
}
}
}
sql = "select count(*) from multi_pick_iss_hdr where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
System.out.println("saleOrder List-------->>"+sorderList);
if(sorderList.size() > 0)
{
sqlBuf.append("SELECT COUNT(*) FROM PICK_ORD_DET WHERE SALE_ORDER IN ( ");
for(int i = 0; i < sorderList.size(); i++)
{
mark = mark + "?,";
}
mark = mark.substring(0,mark.length() - 1);
sqlBuf.append(mark);
sqlBuf.append( ")");
pstmt = conn.prepareStatement(sqlBuf.toString());
for (String list : sorderList)
{
pstmt.setString(++pstmtCnt,list);
}
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("PICK_ORD_DET count--------->>"+count);
sql = "select count(*) from multi_pick_iss_det where tran_id = ? ";
sql = "SELECT COUNT(*) FROM MULTI_PICK_ISS_DET WHERE TRAN_ID = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
......@@ -81,14 +136,11 @@ public class MultiplePtcnWizPos extends ValidatorEJB implements MultiplePtcnWizP
rs = null;
pstmt.close();
pstmt = null;
System.out.println("multi_pick_iss_hdr count---->>["+count+"]");
System.out.println("multi_pick_iss_det count---->>["+cnt+"]");
nodeLength = detail3List.getLength();
System.out.println("nodeLength count---->>["+nodeLength+"]");
if(detail3List != null && count != 0 && cnt == count)
//nodeLength = detail3List.getLength();
if( count != 0 && cnt == count)
{
MultiplePtcnWizConfobj = new MultiplePtcnWizConf();
System.out.println("Detail3 length = "+detail3List.getLength());
MultiplePtcnWizConfobj = new MultiplePtcnWizConf();
errorString = MultiplePtcnWizConfobj.confirm( tranId, xtraParams,"", conn, false ) ;
//errorString = confirmedMultiplePickIssue(tranId, xtraParams, conn);
......@@ -129,6 +181,26 @@ public class MultiplePtcnWizPos extends ValidatorEJB implements MultiplePtcnWizP
}
return "";
}
/*private boolean isPtcnConfirmed(ArrayList<String> ptcnList,Connection conn) throws Exception
{
ResultSet rs = null;
PreparedStatement pstmt = null;
String sql = "";
try
{
if(ptcnList !=null && ptcnList.size() > 0)
{
}
}
catch(Exception e)
{
e.printStackTrace();
throw new Exception(e);
}
}*/
private String confirmedMultiplePickIssue(String tranId,String xtraParams,Connection conn) throws Exception
{
System.out.println("@@@@@@@@ Call confirmedMultiplePickIssue Method @@@@@@@@");
......
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