Commit faac0eed authored by caluka's avatar caluka

Supplier code mfg validation for BOMAMD[MF3GSUN024] .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94270 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7609f06a
...@@ -92,13 +92,16 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem ...@@ -92,13 +92,16 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
String bomcode="",amdNo="",lineNo=""; String bomcode="",amdNo="",lineNo="";
String active = "",confirmed = ""; String active = "",confirmed = "";
String bomcodeHdr = "",lineNoBOM = "",updateStatus=""; String bomcodeHdr = "",lineNoBOM = "",updateStatus="",supMfgCode="",itemCode="";
String supCode="",supMfgCodeList[]=null;
String loginSiteCode="";
try try
{ {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
connDriver = null; connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginSiteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
if(objContext != null && objContext.trim().length()>0) if(objContext != null && objContext.trim().length()>0)
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
...@@ -186,7 +189,83 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem ...@@ -186,7 +189,83 @@ public class BomAmdIC extends ValidatorEJB implements BomAmdICLocal, BomAmdICRem
bomcodeHdr = checkNull(genericUtility.getColumnValue("bom_code", dom1)); bomcodeHdr = checkNull(genericUtility.getColumnValue("bom_code", dom1));
System.out.println("@@@@ bomcode["+bomcode+"]::::bomcodeHdr["+bomcodeHdr+"]"); System.out.println("@@@@ bomcode["+bomcode+"]::::bomcodeHdr["+bomcodeHdr+"]");
} } if (childNodeName.equalsIgnoreCase("supp_code__mfg"))
{
supMfgCode=checkNull(this.genericUtility.getColumnValue("supp_code__mfg", dom));
itemCode=checkNull(this.genericUtility.getColumnValue("item_code", dom));
System.out.println(">>>>>>>>>>>>>>supMfgCode for validation:"+supMfgCode);
System.out.println(">>>>>>>>>>>>>>itemCode for validation:"+itemCode);
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' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSiteCode);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">>>>>>>>>>>>>>cnt validation:"+cnt);
if(cnt > 0)
{
errCode = "VTAPRSUPP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
//check validation for supp_code__mfg not null
if (supMfgCode != null && supMfgCode.trim().length()>0 && errCode.trim().length()==0 )
{
supMfgCode=supMfgCode.trim();
System.out.println(">>>>>>>>>>>>> supMfgCode not null:" + supMfgCode.toString());
supMfgCodeList = supMfgCode.split(",");
if (supMfgCodeList != null && supMfgCodeList.length > 0)
{
for(int i=0; supMfgCodeList.length>i; i++)
{
supCode="";
supCode = supMfgCodeList[i];
System.out.println(">>>>>>>>>>>>>>> found supCode:" + supCode);
sql = "SELECT count(*) AS cnt FROM supplier WHERE supp_code =? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, supCode.trim());
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">>>>>>>>>>>>>>cnt for supCode:"+cnt);
if(cnt==0)
{
errCode = "VMSUPP1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
} //end for loop for split supp code
}
}
}//validation end for supp_code__mfg
if ( childNodeName.equalsIgnoreCase("line_no__bom")) if ( childNodeName.equalsIgnoreCase("line_no__bom"))
{ {
lineNoBOM = checkNull(genericUtility.getColumnValue("line_no__bom", dom)); lineNoBOM = checkNull(genericUtility.getColumnValue("line_no__bom", 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