Commit b903f702 authored by manohar's avatar manohar

Bug fixing, wrong dom used to fetch values, corrected


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96621 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4ff0625b
...@@ -57,6 +57,9 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -57,6 +57,9 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
String childNodeName = ""; String childNodeName = "";
try { try {
System.out.println("Work Order Receipt wizard validation xmlString [" + xmlString + "]" ) ;
System.out.println("Work Order Receipt wizard validation xmlString1 [" + xmlString1 + "]" ) ;
System.out.println("Work Order Receipt wizard validation xmlString1 [" + xmlString2 + "]" ) ;
dom = parseString(xmlString); dom = parseString(xmlString);
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) { if (xmlString2.trim().length() > 0) {
...@@ -225,7 +228,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -225,7 +228,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
if(childNodeName.equalsIgnoreCase("work_order")) if(childNodeName.equalsIgnoreCase("work_order"))
{ {
workOrder = genericUtility.getColumnValue("work_order",dom2); workOrder = genericUtility.getColumnValue("work_order",dom);
if (workOrder == null || workOrder.trim().length() == 0) if (workOrder == null || workOrder.trim().length() == 0)
{ {
...@@ -283,7 +286,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -283,7 +286,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
else if(childNodeName.equalsIgnoreCase("item_code")) else if(childNodeName.equalsIgnoreCase("item_code"))
{ {
itemCode = genericUtility.getColumnValue("item_code",dom2); itemCode = genericUtility.getColumnValue("item_code",dom);
if (itemCode == null || itemCode.trim().length() == 0) if (itemCode == null || itemCode.trim().length() == 0)
{ {
...@@ -379,7 +382,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -379,7 +382,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
if(childNodeName.equalsIgnoreCase("work_order")) if(childNodeName.equalsIgnoreCase("work_order"))
{ {
workOrder = genericUtility.getColumnValue("work_order",dom2); workOrder = genericUtility.getColumnValue("work_order",dom2,"2");
if (workOrder == null || workOrder.trim().length() == 0) if (workOrder == null || workOrder.trim().length() == 0)
{ {
...@@ -456,8 +459,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -456,8 +459,8 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
else if(childNodeName.equalsIgnoreCase("quantity")) else if(childNodeName.equalsIgnoreCase("quantity"))
{ {
squantity = genericUtility.getColumnValue("quantity",dom2); squantity = genericUtility.getColumnValue("quantity",dom);
workOrder = genericUtility.getColumnValue("work_order",dom2); workOrder = genericUtility.getColumnValue("work_order",dom);
System.out.println("squantity"+squantity+"workOrder<><><>"+workOrder); System.out.println("squantity"+squantity+"workOrder<><><>"+workOrder);
if (squantity == null || squantity.trim().length() == 0) if (squantity == null || squantity.trim().length() == 0)
{ {
...@@ -517,7 +520,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -517,7 +520,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
else if(childNodeName.equalsIgnoreCase("item_code")) else if(childNodeName.equalsIgnoreCase("item_code"))
{ {
itemCode = genericUtility.getColumnValue("item_code",dom2); itemCode = genericUtility.getColumnValue("item_code",dom);
if (itemCode == null || itemCode.trim().length() == 0) if (itemCode == null || itemCode.trim().length() == 0)
{ {
...@@ -551,7 +554,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -551,7 +554,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
} }
else if(childNodeName.equalsIgnoreCase("loc_code")) else if(childNodeName.equalsIgnoreCase("loc_code"))
{ {
locCode = genericUtility.getColumnValue("loc_code",dom2); locCode = genericUtility.getColumnValue("loc_code",dom);
if (locCode == null || locCode.trim().length() == 0) if (locCode == null || locCode.trim().length() == 0)
{ {
...@@ -622,9 +625,9 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -622,9 +625,9 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println("xtraParams"+xtraParams); System.out.println("xtraParams"+xtraParams);
System.out.println("xmlString111>>"+xmlString); System.out.println("Work Order Receipt wizard itemchange xmlString [" + xmlString + "]" ) ;
System.out.println("xmlString222>>"+xmlString1); System.out.println("Work Order Receipt wizard itemchange xmlString1 [" + xmlString1 + "]" ) ;
System.out.println("xmlString333>>"+xmlString2); System.out.println("Work Order Receipt wizard itemchange xmlString1 [" + xmlString2 + "]" ) ;
dom = parseString(xmlString); dom = parseString(xmlString);
dom1 = parseString(xmlString1); dom1 = parseString(xmlString1);
if (xmlString2.trim().length() > 0) { if (xmlString2.trim().length() > 0) {
...@@ -710,7 +713,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -710,7 +713,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
System.out.println("DOM2 Elements["+genericUtility.serializeDom(dom2).toString()+"]"); System.out.println("DOM2 Elements["+genericUtility.serializeDom(dom2).toString()+"]");
System.out.println("itm_default >>>>> 2>>"); //System.out.println("itm_default >>>>> 2>>");
workOrder = genericUtility.getColumnValue("work_order", dom1); workOrder = genericUtility.getColumnValue("work_order", dom1);
sql = "select count(1) from workorder_receipt where CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?"; sql = "select count(1) from workorder_receipt where CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
...@@ -954,25 +957,13 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -954,25 +957,13 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
valueXmlString.append("<exp_date>").append("<![CDATA[" + sExpDate + "]]>").append("</exp_date>"); valueXmlString.append("<exp_date>").append("<![CDATA[" + sExpDate + "]]>").append("</exp_date>");
valueXmlString.append("<site_code__own>").append("<![CDATA[" + woSiteCode + "]]>").append("</site_code__own>"); valueXmlString.append("<site_code__own>").append("<![CDATA[" + woSiteCode + "]]>").append("</site_code__own>");
sql = "select descr from item where item_code = ?"; sql = "select descr,unit,pack_code from item where item_code = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
itemDescr = rs.getString(1) == null ? "":rs.getString(1); itemDescr = rs.getString(1) == null ? "":rs.getString(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
valueXmlString.append("<descr>").append("<![CDATA[" + itemDescr + "]]>").append("</descr>");
sql = "select unit,pack_code from item where item_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
unit = rs.getString("unit") == null ? "":rs.getString("unit"); unit = rs.getString("unit") == null ? "":rs.getString("unit");
packCode = rs.getString("pack_code") == null ? "":rs.getString("pack_code"); packCode = rs.getString("pack_code") == null ? "":rs.getString("pack_code");
} }
...@@ -980,11 +971,25 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -980,11 +971,25 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
rs.close(); rs.close();
pstmt = null; pstmt = null;
rs = null; rs = null;
valueXmlString.append("<descr>").append("<![CDATA[" + itemDescr + "]]>").append("</descr>");
//sql = "select unit,pack_code from item where item_code = ?";
//pstmt=conn.prepareStatement(sql);
//pstmt.setString(1,itemCode);
//rs = pstmt.executeQuery();
//if(rs.next())
//{
// unit = rs.getString("unit") == null ? "":rs.getString("unit");
// packCode = rs.getString("pack_code") == null ? "":rs.getString("pack_code");
//}
//pstmt.close();
//rs.close();
//pstmt = null;
//rs = null;
valueXmlString.append("<unit>").append("<![CDATA[" + unit + "]]>").append("</unit>"); valueXmlString.append("<unit>").append("<![CDATA[" + unit + "]]>").append("</unit>");
valueXmlString.append("<pack_code>").append("<![CDATA[" + packCode + "]]>").append("</pack_code>"); valueXmlString.append("<pack_code>").append("<![CDATA[" + packCode + "]]>").append("</pack_code>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>"); valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
valueXmlString.append("<conf_date>").append("<![CDATA[" + currAppdate + "]]>").append("</conf_date>"); //valueXmlString.append("<conf_date>").append("<![CDATA[" + currAppdate + "]]>").append("</conf_date>");
valueXmlString.append("<mfg_date>").append("<![CDATA[" + sMfgDateStart + "]]>").append("</mfg_date>"); valueXmlString.append("<mfg_date>").append("<![CDATA[" + sMfgDateStart + "]]>").append("</mfg_date>");
sql = "select qc_reqd from siteitem where site_code = ? and item_code = ?"; sql = "select qc_reqd from siteitem where site_code = ? and item_code = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
...@@ -1009,7 +1014,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1009,7 +1014,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
if(qcReqd.equalsIgnoreCase("Y")) if(qcReqd.equalsIgnoreCase("Y"))
{ {
sql = "select var_value from mfgparm where var_name = 'WORCP_LOCK_GROUP'"; sql = "select var_value from mfgparm where prd_code = '999999' and var_name = 'WORCP_LOCK_GROUP'";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -1119,7 +1124,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1119,7 +1124,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
//tranid = genericUtility.getColumnValue("tran_id", dom2, "2"); //tranid = genericUtility.getColumnValue("tran_id", dom2, "2");
tranid = genericUtility.getColumnValue("tran_id", dom1); tranid = genericUtility.getColumnValue("tran_id", dom);
workOrder = genericUtility.getColumnValue("work_order", dom1); workOrder = genericUtility.getColumnValue("work_order", dom1);
//childNodeListLength = childNodeList.getLength(); //childNodeListLength = childNodeList.getLength();
System.out.println("tran val"+tranid+"workOrder>>>"+workOrder); System.out.println("tran val"+tranid+"workOrder>>>"+workOrder);
...@@ -1385,7 +1390,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -1385,7 +1390,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
if(noOfArt > 0) if(noOfArt > 0)
{ {
System.out.println(">>>>START>>>>>>>>>"); //System.out.println(">>>>START>>>>>>>>>");
sql = "select shipper_size,gross_weight,net_weight from item_lot_packsize where item_code = ? and lot_no__from <= ? and lot_no__to >= ? "; sql = "select shipper_size,gross_weight,net_weight from item_lot_packsize where item_code = ? and lot_no__from <= ? and lot_no__to >= ? ";
pstmt1=conn.prepareStatement(sql); pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,itemCode); pstmt1.setString(1,itemCode);
......
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