Commit f419ed26 authored by manohar's avatar manohar

item_code default set as X and accordingly validation and itemchanged code changed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94126 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 02044ce4
...@@ -189,7 +189,7 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr ...@@ -189,7 +189,7 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
itemCode = genericUtility.getColumnValue("item_code", dom); itemCode = genericUtility.getColumnValue("item_code", dom);
itemCode = itemCode == null ? "" : itemCode.trim(); itemCode = itemCode == null ? "" : itemCode.trim();
if(itemCode != null && itemCode.trim().length() > 0) if(itemCode != null && itemCode.trim().length() > 0 && !"X".equals(itemCode.trim()))
{ {
sql = " select count(*) from bomdet,workorder " sql = " select count(*) from bomdet,workorder "
+ " where workorder.bom_code = bomdet.bom_code " + " where workorder.bom_code = bomdet.bom_code "
...@@ -237,12 +237,13 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr ...@@ -237,12 +237,13 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
pstmt = null; pstmt = null;
} }
} }
else // 14/01/14 manoharan allow blank so that for all rubber stereo the sae contract will be used so commented
{ //else
errCode = "VTITMNL"; //null item code //{
errString = itmDBAccessEJB.getErrorString("","VTITMNL",userId); // errCode = "VTITMNL"; //null item code
break ; // errString = itmDBAccessEJB.getErrorString("","VTITMNL",userId);
} // break ;
//}
} }
if(childNodeName.equalsIgnoreCase("contract_no")) if(childNodeName.equalsIgnoreCase("contract_no"))
{ {
...@@ -447,6 +448,9 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr ...@@ -447,6 +448,9 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
pstmt = null; pstmt = null;
valueXmlString.append("<site_code> ").append("<![CDATA["+loginSite+"]]>").append("</site_code>"); valueXmlString.append("<site_code> ").append("<![CDATA["+loginSite+"]]>").append("</site_code>");
valueXmlString.append("<site_descr>").append("<![CDATA["+siteDescr+"]]>").append("</site_descr>"); valueXmlString.append("<site_descr>").append("<![CDATA["+siteDescr+"]]>").append("</site_descr>");
// 14/01/14 manoharan set default as blank so that for all rubber stereo the same contract wil be used
valueXmlString.append("<item_code>").append("<![CDATA[X]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[ALL ITEMS]]>").append("</item_descr>");
} }
else if (currentColumn.trim().equalsIgnoreCase("site_code")) else if (currentColumn.trim().equalsIgnoreCase("site_code"))
{ {
...@@ -468,20 +472,29 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr ...@@ -468,20 +472,29 @@ public class WoContract extends ValidatorEJB implements WoContractLocal, WoContr
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
itemCode = genericUtility.getColumnValue("item_code",dom) ; itemCode = genericUtility.getColumnValue("item_code",dom) ;
sql = " select descr from item where item_code = ? "; if (itemCode != null && !"X".equals(itemCode))
{
pstmt = conn.prepareStatement(sql); sql = " select descr from item where item_code = ? ";
pstmt.setString(1,itemCode.trim());
rs = pstmt.executeQuery(); pstmt = conn.prepareStatement(sql);
if(rs.next()) pstmt.setString(1,itemCode.trim());
rs = pstmt.executeQuery();
if(rs.next())
{
itemDescr = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<item_descr>").append("<![CDATA[" + itemDescr + "]]>").append("</item_descr>");
}
else
{ {
itemDescr = rs.getString(1); valueXmlString.append("<item_code>").append("<![CDATA[X]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[ALL ITEMS]]>").append("</item_descr>");
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<item_descr>").append("<![CDATA[" + itemDescr + "]]>").append("</item_descr>");
} }
else if((currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))) else if((currentColumn.trim().equalsIgnoreCase("itm_defaultedit")))
......
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