Commit b9414799 authored by vkadam's avatar vkadam

Change in logic


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97003 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5ce5c497
......@@ -105,71 +105,72 @@ public class StockStatusWizIC extends ValidatorEJB implements StockStatusWizICLo
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("CURRENT COLUMN IN VALIDATION [" + childNodeName + "]");
if (childNodeName.equalsIgnoreCase("site_code"))
{
siteCode = this.genericUtility.getColumnValue("site_code", dom);
System.out.println("@@@ Validation Site Code:-[" + siteCode + "]");
if (siteCode != null && siteCode.trim().length() > 0)
{
sql = "select count(*)as cnt from site where site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt <= 0)
{
errCode = "VMINVSITE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else
{
errCode = "VMSITEBLK";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = this.genericUtility.getColumnValue("item_code", dom);
System.out.println("@@@ Validation Item Code:-[" + itemCode + "]");
if (itemCode != null && itemCode.trim().length() > 0)
{
sql = "select count(*)as cnt from item where item_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt <= 0)
{
errCode = "VMITEM1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else
{
errCode = "VMITEMBLK";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} else if (childNodeName.equalsIgnoreCase("lot_no"))
// if (childNodeName.equalsIgnoreCase("site_code"))
// {
// siteCode = this.genericUtility.getColumnValue("site_code", dom);
// System.out.println("@@@ Validation Site Code:-[" + siteCode + "]");
//
// if (siteCode != null && siteCode.trim().length() > 0)
// {
// sql = "select count(*)as cnt from site where site_code=?";
// pstmt = conn.prepareStatement(sql);
// pstmt.setString(1, siteCode);
// rs = pstmt.executeQuery();
// if (rs.next())
// {
// cnt = rs.getInt("cnt");
// }
// rs.close();
// rs = null;
// pstmt.close();
// pstmt = null;
//
// if (cnt <= 0)
// {
// errCode = "VMINVSITE";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
// }
// } else
// {
// errCode = "VMSITEBLK";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
// }
// } else if (childNodeName.equalsIgnoreCase("item_code"))
// {
// itemCode = this.genericUtility.getColumnValue("item_code", dom);
// System.out.println("@@@ Validation Item Code:-[" + itemCode + "]");
//
// if (itemCode != null && itemCode.trim().length() > 0)
// {
// sql = "select count(*)as cnt from item where item_code=?";
// pstmt = conn.prepareStatement(sql);
// pstmt.setString(1, itemCode);
// rs = pstmt.executeQuery();
// if (rs.next())
// {
// cnt = rs.getInt("cnt");
// }
// rs.close();
// rs = null;
// pstmt.close();
// pstmt = null;
//
// if (cnt <= 0)
// {
// errCode = "VMITEM1";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
// }
// } else
// {
// errCode = "VMITEMBLK";
// errList.add(errCode);
// errFields.add(childNodeName.toLowerCase());
// }
// }
if (childNodeName.equalsIgnoreCase("lot_no"))
{
lotNo = this.genericUtility.getColumnValue("lot_no", dom);
System.out.println("@@@ Validation Lot No:-[" + lotNo + "]");
......@@ -324,12 +325,13 @@ public class StockStatusWizIC extends ValidatorEJB implements StockStatusWizICLo
{
System.out.println("In case 1 item default &&&&&&&&&&");
valueXmlString.append("<Detail1 domID='1'>\r\n");
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
System.out.println("siteCode = [" + siteCode + "]");
valueXmlString.append("<site_code><![CDATA[").append(siteCode).append("]]></site_code>\r\n");
valueXmlString.append("<item_code><![CDATA[").append(" ").append("]]></item_code>\r\n");
// siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
// System.out.println("siteCode = [" + siteCode + "]");
// valueXmlString.append("<site_code><![CDATA[").append(siteCode).append("]]></site_code>\r\n");
// valueXmlString.append("<item_code><![CDATA[").append(" ").append("]]></item_code>\r\n");
valueXmlString.append("<lot_no><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
valueXmlString.append("<line_no_sl><![CDATA[").append(" ").append("]]></line_no_sl>\r\n");
valueXmlString.append("</Detail1>\r\n");
}
break;
......@@ -340,40 +342,45 @@ public class StockStatusWizIC extends ValidatorEJB implements StockStatusWizICLo
if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{
siteCode = genericUtility.getColumnValue("site_code", dom1);
itemCode = genericUtility.getColumnValue("item_code", dom1);
// siteCode = genericUtility.getColumnValue("site_code", dom1);
// itemCode = genericUtility.getColumnValue("item_code", dom1);
lotNo = genericUtility.getColumnValue("lot_no", dom1);
lotSl = genericUtility.getColumnValue("lot_sl", dom1);
sql = "select descr from item where item_code=?";
// sql = "select QORDER_NO,PORCP_NO,site_code,item_code from qc_order where lot_no=? AND lot_sl=?";
sql = "select QORDER_NO,PORCP_NO,site_code,item_code from qc_order where lot_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
// pstmt.setString(1, siteCode);
// pstmt.setString(2, itemCode);
pstmt.setString(1, lotNo);
// pstmt.setString(2, lotSl);
rs = pstmt.executeQuery();
if (rs.next())
{
itemDesc = rs.getString("descr");
qOrderNo = rs.getString("QORDER_NO");
porcpNo = rs.getString("PORCP_NO");
siteCode = rs.getString("site_code");
itemCode = rs.getString("item_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select QORDER_NO,PORCP_NO from qc_order where site_code=? and item_code=? and lot_no=?";
sql = "select descr from item where item_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
pstmt.setString(3, lotNo);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
qOrderNo = rs.getString("QORDER_NO");
porcpNo = rs.getString("PORCP_NO");
itemDesc = rs.getString("descr");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("&&&&&& QC_Order_No is:- [" + qOrderNo + "]");
System.out.println("&&&&&& PORCP_NO is:- [" + porcpNo + "]");
......
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