Commit e80856f9 authored by smane's avatar smane

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94195 ce508802-f39f-4f6c-b175-0d175dae99d5
parent abb3af23
...@@ -80,8 +80,11 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl ...@@ -80,8 +80,11 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
String supMfgCode=""; String supMfgCode="";
String loginCode=""; String loginCode="";
String loginSiteCode=""; String loginSiteCode="";
String bomCode="";
String itemCode = ""; String itemCode = "";
System.out.println("editFlag ---->>>["+editFlag+"]"); String itemRef="";
String itemCodeAlt="";
System.out.println("editFlag ---->>>["+editFlag+"]");
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
int cnt = 0; int cnt = 0;
...@@ -119,7 +122,189 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl ...@@ -119,7 +122,189 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("supp_code__mfg")) if (childNodeName.equalsIgnoreCase("bom_code"))
{
System.out.println("***************Validation for bom code************:"+bomCode);
bomCode=checkNull(this.genericUtility.getColumnValue("bom_code", dom));
if(bomCode == null || (bomCode.trim().length() == 0))
{
System.out.println(">>>>>>>>>>bomCode null or space:"+bomCode);
errList.add("VTINVBOM1");
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(">>>>>>>>>bomCode not null:"+bomCode);
sql = "select count(*) from bom_alt where bom_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0)
{
System.out.println("Bom code not exit in bom_alt:"+bomCode);
errCode = "VTALTBOMCD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
if (childNodeName.equalsIgnoreCase("item_code"))
{
bomCode=checkNull(this.genericUtility.getColumnValue("bom_code", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
System.out.println(">>>>bomCode:"+bomCode);
System.out.println(">>>>itemCode:"+itemCode);
if(itemCode == null || (itemCode.trim().length() == 0))
{
System.out.println(">>>>>>>>>>itemCode null or space:"+itemCode);
errList.add("VTBOMITEM");
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(">>>>>>>>>itemCode not null:"+itemCode);
sql = "SELECT count(*) FROM bom_alt WHERE confirmed='Y' AND bom_code =? AND item_code=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
pstmt.setString(2,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0)
{
System.out.println("Item code not exit in bom_alt:"+itemCode);
errCode = "VTBOMITEM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
if (childNodeName.equalsIgnoreCase("item_ref"))
{
bomCode=checkNull(this.genericUtility.getColumnValue("bom_code", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
itemRef=checkNull(this.genericUtility.getColumnValue("item_ref", dom));
System.out.println(">>>>bomCode:"+bomCode);
System.out.println(">>>>itemCode:"+itemCode);
System.out.println(">>>>itemRef:"+itemRef);
if(itemRef == null || (itemRef.trim().length() == 0))
{
System.out.println(">>>>>>>>>>itemRef null or space:"+itemRef);
errList.add("VTITEMREF");
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(">>>>>>>>>itemRef not null:"+itemRef);
sql = "SELECT count(*) FROM bom_alt WHERE bom_code =? AND item_code =? AND item_ref=? AND confirmed='Y'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
pstmt.setString(2,itemCode);
pstmt.setString(3,itemRef);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0)
{
System.out.println("itemRef not exit in bom_alt:"+itemRef);
errCode = "VTITEMREF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
if (childNodeName.equalsIgnoreCase("item_code__alt"))
{
bomCode=checkNull(this.genericUtility.getColumnValue("bom_code", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
itemRef=checkNull(this.genericUtility.getColumnValue("item_ref", dom));
itemCodeAlt=checkNull(this.genericUtility.getColumnValue("item_code__alt", dom));
System.out.println(">>>>bomCode:"+bomCode);
System.out.println(">>>>itemCode:"+itemCode);
System.out.println(">>>>itemRef:"+itemRef);
System.out.println(">>>>itemCodeAlt:"+itemCodeAlt);
if(itemCodeAlt == null || (itemCodeAlt.trim().length() == 0))
{
System.out.println(">>>>>>>>>>itemCodeAlt null or space:"+itemCodeAlt);
errList.add("VTALTITMCD");
errFields.add(childNodeName.toLowerCase());
}
else
{
if(itemCodeAlt.trim().equalsIgnoreCase(itemCode.trim()))
{
System.out.println(">>>>>>>>>>Item Code Alt and Item code are same:"+itemCodeAlt);
errList.add("VTITEM1A");
errFields.add(childNodeName.toLowerCase());
}
else
{
System.out.println(">>>>>>>>>itemCodeAlt not null:"+itemCodeAlt);
sql = "SELECT count(*) FROM bom_alt WHERE bom_code =? AND item_code =? AND item_ref=? AND item_code__alt=? AND confirmed='Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
pstmt.setString(2,itemCode);
pstmt.setString(3,itemRef);
pstmt.setString(4,itemCodeAlt);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
if(cnt == 0)
{
System.out.println("itemCodeAlt not exit in bom_alt:"+itemCodeAlt);
errCode = "VTALTITMCD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
}
}
if (childNodeName.equalsIgnoreCase("supp_code__mfg"))
{ {
supMfgCode=checkNull(this.genericUtility.getColumnValue("supp_code__mfg", dom)); supMfgCode=checkNull(this.genericUtility.getColumnValue("supp_code__mfg", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom)); itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
......
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