Commit c113f53f authored by skale's avatar skale

Change in code as per the requestId MF89SUN152.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91133 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9f6545fe
...@@ -18,15 +18,14 @@ import ibase.webitm.ejb.*; ...@@ -18,15 +18,14 @@ import ibase.webitm.ejb.*;
import javax.ejb.Stateless; // added for ejb3 import javax.ejb.Stateless; // added for ejb3
@Stateless // added for ejb3 @Stateless // added for ejb3
public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLocal,BatchsizeAprvICRemote
public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLocal, BatchsizeAprvICRemote //SessionBean
{ {
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
String userId = null; String userId = null;
String loginSite = null; String loginSite = null;
/*public void ejbCreate() throws RemoteException, CreateException /* public void ejbCreate() throws RemoteException, CreateException
{ {
System.out.println("BatchsizeAprvICEJB is in Process.........."); System.out.println("BatchsizeAprvICEJB is in Process..........");
} }
...@@ -38,7 +37,7 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc ...@@ -38,7 +37,7 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc
} }
public void ejbPassivate() public void ejbPassivate()
{ {
}*/ } */
public String wfValData() throws RemoteException,ITMException public String wfValData() throws RemoteException,ITMException
{ {
return ""; return "";
...@@ -297,7 +296,42 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc ...@@ -297,7 +296,42 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc
errString = getErrorString( "eff_from", errCode, userId ); errString = getErrorString( "eff_from", errCode, userId );
} }
} }
//added by msalam on 010709 for add supplier validation with itemmnfr_det and then this
if ( childNodeName.equalsIgnoreCase ( "supp_code__mfg" ) )
{
String itemCode = null;
String suppCode = null;
itemCode = genericUtility.getColumnValue( "item_code", dom1 );
suppCode = genericUtility.getColumnValue( "supp_code__mfg", dom1 );
if( suppCode != null || suppCode.trim().length() > 0 )
{
sql = " SELECT COUNT(1) FROM itemmnfr_det WHERE item_code = ? and SUPP_CODE__MNFR = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, suppCode );
rs = pstmt.executeQuery();
cnt = 0;
if( rs.next() )
{
cnt = rs.getInt( 1 );
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0 )
{
errCode = "VMINVSUPP";
errString = getErrorString( "supp_code__mfg", errCode, userId );
}
}
}
//end added by msalam on 010709 for add supplier validation with itemmnfr_det and then this
} //END OF FOR LOOP OF CASE1 } //END OF FOR LOOP OF CASE1
break; break;
}//END SWITCH }//END SWITCH
...@@ -484,12 +518,14 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc ...@@ -484,12 +518,14 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc
{ {
String vSql = null; String vSql = null;
String itemDescr = null; String itemDescr = null;
vSql = "select descr from item where item_code = '" + ( columnValue != null ? columnValue.trim() : "" ) + "'"; String itemUnit = null;
vSql = "select descr, unit from item where item_code = '" + ( columnValue != null ? columnValue.trim() : "" ) + "'";
vPStmt = conn.prepareStatement( vSql ); vPStmt = conn.prepareStatement( vSql );
vRs = vPStmt.executeQuery(); vRs = vPStmt.executeQuery();
if( vRs.next() ) if( vRs.next() )
{ {
itemDescr = vRs.getString( "descr" ); itemDescr = vRs.getString( "descr" );
itemUnit = vRs.getString( "unit" );
} }
vRs.close(); vRs.close();
vRs = null; vRs = null;
...@@ -497,6 +533,26 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc ...@@ -497,6 +533,26 @@ public class BatchsizeAprvIC extends ValidatorEJB implements BatchsizeAprvICLoc
vPStmt = null; vPStmt = null;
valueXmlString.append("<item_code_descr>").append("<![CDATA[" + ( itemDescr != null ? itemDescr.trim() : "" )+ "]]>").append("</item_code_descr>"); valueXmlString.append("<item_code_descr>").append("<![CDATA[" + ( itemDescr != null ? itemDescr.trim() : "" )+ "]]>").append("</item_code_descr>");
valueXmlString.append("<item_unit>").append("<![CDATA[" + ( itemUnit != null ? itemUnit.trim() : "" )+ "]]>").append("</item_unit>");
}
if( currentColumn.trim().equals( "supp_code__mnfr" ) )
{
String vSql = null;
String suppName = null;
vSql = "select supp_name from supplier where supp_code = '" + ( columnValue != null ? columnValue : "" ) + "'";
vPStmt = conn.prepareStatement( vSql );
vRs = vPStmt.executeQuery();
if( vRs.next() )
{
suppName = vRs.getString( "supp_name" );
}
vRs.close();
vRs = null;
vPStmt.close();
vPStmt = null;
valueXmlString.append("<supp_name>").append("<![CDATA[" + ( suppName != null ? suppName.trim() : "" )+ "]]>").append("</supp_name>");
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
......
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