Commit d7b66801 authored by caluka's avatar caluka

Ejb code for BOMAMD After Adding sitecode in bomamd_hdr [MF3GSUN024] .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94297 ce508802-f39f-4f6c-b175-0d175dae99d5
parent eb925c17
......@@ -88,13 +88,13 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
int currentFormNo =0,recCnt=0;
int currentFormNo =0,recCnt=0,recCnt1=0;
String bomcode="",amdNo="",lineNo="";
String active = "",confirmed = "";
String bomcodeHdr = "",lineNoBOM = "",updateStatus="",supMfgCode="",itemCode="";
String supCode="",supMfgCodeList[]=null;
String loginSiteCode="";
String loginSiteCode="",siteCode="";
try
{
System.out.println("@@@@@@@@ wfvaldata called");
......@@ -123,6 +123,9 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
if(childNodeName.equalsIgnoreCase("bom_code"))
{
bomcode = checkNull(genericUtility.getColumnValue("bom_code", dom));
loginSiteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
System.out.println("@@loginSiteCode"+loginSiteCode);
System.out.println("@@@@ bom_code["+bomcode+"]");
if(bomcode == null || bomcode.trim().length() == 0)
{
......@@ -132,6 +135,7 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
}
else
{
errCode = isExist("bom","bom_code",bomcode,conn);
if( "FALSE".equalsIgnoreCase(errCode ))
{
......@@ -139,27 +143,67 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
sql = " select confirmed from bom where bom_code = ? ";
else
{
sql = " select site_code from bom where bom_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomcode);
rs = pstmt.executeQuery();
if(rs.next())
{
recCnt++;
confirmed = rs.getString("confirmed");
siteCode = rs.getString("site_code")==null?"":rs.getString("site_code");;
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(siteCode.trim().length() > 0 && siteCode != null)
{
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())
{
recCnt++;
confirmed = rs.getString("confirmed")==null?"N":rs.getString("confirmed");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( recCnt == 0 )
{
errCode = "VTBOMCD3";
errCode = "VTBOMCD4";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else if (!("Y".equalsIgnoreCase(confirmed)))
}
else
{
sql = " select confirmed from bom where bom_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomcode);
rs = pstmt.executeQuery();
if(rs.next())
{
confirmed = rs.getString("confirmed")==null?"N":rs.getString("confirmed");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if (!("Y".equalsIgnoreCase(confirmed)) )
{
errCode = "VTNOTCONF1";
errList.add(errCode);
......@@ -169,6 +213,7 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
}
}
}
}// end for
break; // case 1 end
......@@ -466,7 +511,7 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
int currentFormNo =0;
String columnValue="",bomcode="",type="",descr="",sitecode="",sitedescr="",itemcode="",itemdescr="";
String unit="",unitpotency="";
String unit="",unitpotency="",loginSiteCode="";
String linenobom="",itemref="",unitalt="",matchpoten="",adjpotency="",qtyperunit="";
String criticalitem="",supcodemfg="",mfgref="",issvariencetype="",issvarvaltype="",locusagetype="";
......@@ -532,6 +577,28 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
{
System.out.println("@@@@@@@@ itm_default called @@@@@@@@");
valueXmlString.append("<amd_date>").append("<![CDATA["+sysDate+"]]>").append("</amd_date>");
loginSiteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
//sitecode = checkNull(genericUtility.getColumnValue("site_code", dom));
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>");
}
else if(currentColumn.trim().equalsIgnoreCase("bom_code"))
......@@ -568,7 +635,7 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
pstmt = null;
valueXmlString.append("<type>").append("<![CDATA["+type+"]]>").append("</type>");
valueXmlString.append("<descr>").append("<![CDATA["+descr+"]]>").append("</descr>");
valueXmlString.append("<site_code>").append("<![CDATA["+sitecode+"]]>").append("</site_code>");
//valueXmlString.append("<site_code>").append("<![CDATA["+sitecode+"]]>").append("</site_code>");
valueXmlString.append("<item_code>").append("<![CDATA["+itemcode+"]]>").append("</item_code>");
valueXmlString.append("<batch_qty>").append("<![CDATA["+batchqty+"]]>").append("</batch_qty>");
valueXmlString.append("<unit>").append("<![CDATA["+unit+"]]>").append("</unit>");
......@@ -586,7 +653,7 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
valueXmlString.append("<valid_upto__o protect = \"1\">").append("<![CDATA[]]>").append("</valid_upto__o>");
}
if ( sitecode!= null && sitecode.length() > 0 )
/*if ( sitecode!= null && sitecode.length() > 0 )
{
sql = "select descr from site where site_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -605,8 +672,8 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
}else
{
valueXmlString.append("<site_descr protect = \"1\">").append("<![CDATA[]]>").append("</site_descr>");
}
if ( itemcode!= null && itemcode.length() > 0 )
}*/
if ( itemcode!= null && itemcode.trim().length() > 0 )
{
sql = "select descr from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -630,7 +697,6 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
}
valueXmlString.append("</Detail1>");
break;
// case 2 start
......
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