Commit eb925c17 authored by smane's avatar smane

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94296 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 8be8660e
......@@ -82,11 +82,13 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
String supCode="";
String loginCode="";
String loginSiteCode="";
String siteCode="";
String bomCode="";
String itemCode = "";
String itemRef="";
String itemCodeAlt="";
String confStatus="";
int recCount=0;
System.out.println("editFlag ---->>>["+editFlag+"]");
int ctr = 0;
int currentFormNo = 0;
......@@ -130,6 +132,7 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
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);
......@@ -158,6 +161,82 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
rs = null;
pstmt.close();
pstmt = null;
//check for site code and bom code....
sql = " select site_code from bom where bom_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
rs = pstmt.executeQuery();
if(rs.next())
{
siteCode = rs.getString("site_code");
System.out.println(">>>>>>>>>>>found siteCode :"+siteCode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(siteCode==null || siteCode.trim().length() == 0)
{
System.out.println(">>>>>>>>>>>Check When Site code null:"+siteCode);
sql = " select confirmed from bom where bom_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
rs = pstmt.executeQuery();
if(rs.next())
{
confStatus = rs.getString("confirmed")==null?"N":rs.getString("confirmed");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
else
{
loginSiteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
System.out.println(">>>>>>>>>>>Check When loginSiteCode:"+loginSiteCode);
System.out.println(">>>>>>>>>>>Check When Site code not null:"+siteCode);
sql = " select confirmed from bom where bom_code = ? and site_code=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
pstmt.setString(2,loginSiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{ recCount++;
confStatus = rs.getString("confirmed")==null?"N":rs.getString("confirmed");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">>>>>>>>>Record Count:"+siteCode);
if( recCount == 0 )
{
errCode = "VTBOMCD4";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
System.out.println(">>>>>>>>>Record confStatus:"+confStatus);
if (!("Y".equalsIgnoreCase(confStatus)))
{
errCode = "VTNOTCNFCD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
......@@ -348,6 +427,7 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
System.out.println(">>>>>>>>>>>>>>supMfgCode for validation:"+supMfgCode);
System.out.println(">>>>>>>>>>>>>>itemCode for validation:"+itemCode);
loginSiteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
if (supMfgCode == null || supMfgCode.trim().length()==0)
{
sql = "SELECT count(*) AS cnt FROM siteitem WHERE site_code=? AND item_code=? AND CASE WHEN appr_supp IS NULL THEN 'N' ELSE appr_supp END ='Y' ";
......@@ -552,6 +632,8 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
String itemAltDecr="";
String itemAltUnit="";
String supCodeMfgOld="";
String loginSiteCode="";
String sitedescr="";
int ctr = 0;
int currentFormNo = 0;
int childNodeListLength = 0;
......@@ -601,7 +683,9 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
}
while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
System.out.println(">>>>>>>>>>>>>>>>>>>>>CURRENT COLUMN ["+currentColumn+"]");
if (currentColumn.trim().equalsIgnoreCase("item_code"))
if(currentColumn.trim().equalsIgnoreCase("item_code"))
{
//for item_code
bomCode=checkNull(this.genericUtility.getColumnValue("bom_code", dom));
......@@ -724,6 +808,31 @@ public class BomAltAmdIC extends ValidatorEJB implements BomAltAmdICLocal, BomAl
currAppdate = new SimpleDateFormat(genericUtility.getApplDateFormat()).format(currDate);
valueXmlString.append("<amd_date>").append("<![CDATA["+currAppdate+"]]>").append("</amd_date>");
System.out.println(">>>>>>>>>>>>>>>>>>>>itm_default currAppdate:"+currAppdate);
//set login site code..
loginSiteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
if ( loginSiteCode!= null && loginSiteCode.trim().length() > 0 )
{
sql = "select descr from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSiteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
sitedescr = checkNull( rs.getString(1));
System.out.println("Default loginSiteCode descr:"+sitedescr);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
valueXmlString.append("<site_code>").append("<![CDATA["+checkNull(loginSiteCode)+"]]>").append("</site_code>");
valueXmlString.append("<site_descr>").append("<![CDATA["+checkNull(sitedescr)+"]]>").append("</site_descr>");
}
valueXmlString.append("</Detail1>");
......
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