Commit fa9c3930 authored by jshinde's avatar jshinde

Request Id: W15JSUN006

,One new screen on handheld device to scan the pallet after it receive tooutbound or partial picking area.
 Forklift person will scan the pallet and put it on RMPM  or FG
outbound location based on the item of pallet


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@38132 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5125a0d1
/**
* PURPOSE : PalletOutIC component
* AUTHOR : Jagruti Shinde
* DATE : 07-01-2016
*/
package ibase.webitm.ejb.wms;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.wms.CommonWmsUtil;
import java.rmi.RemoteException;
import java.sql.*;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.*;
import org.w3c.dom.*;
@javax.ejb.Stateless
public class PalletOutIC extends ValidatorEJB implements PalletOutICLocal, PalletOutICRemote
{
/**
* The method is defined without any parameter and returns blank string
*/
DistCommon distComm = new DistCommon();
@Override
public String wfValData() throws RemoteException, ITMException
{
return "";
}
/**
* The public method is used for converting the current form data into a document(DOM)
* The dom is then given as argument to the overloaded function wfValData to perform validation
* Returns validation string if exists else returns null in XML format
* @param xmlString contains the current form data in XML format
* @param xmlString1 contains all the header information in the XML format
* @param xmlString2 contains the data of all the forms in XML format
* @param objContext represents the form number
* @param editFlag represents the mode of transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
@Override
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
System.out.println( "xmlString ::" + xmlString);
System.out.println( "xmlString1 ::" + xmlString1);
System.out.println( "xmlString2 ::" + xmlString2);
if(xmlString != null && xmlString.trim().length()!=0)
{
dom = genericUtility.parseString(xmlString);
}
if(xmlString1 != null && xmlString1.trim().length()!=0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if(xmlString2 != null && xmlString2.trim().length()!=0)
{
dom2 = genericUtility.parseString(xmlString2);
}
errString = wfValData( dom, dom1, dom2, objContext, xtraParams);
System.out.println( "ErrString: " + errString);
}
catch(Exception e)
{
errString = genericUtility.createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
return (errString);
}
/**
* The public overloaded method takes a document as input and is used for the validation of required fields
* Returns validation string if exist otherwise returns null in XML format
* @param currFormDataDom contains the current form data as a document object model
* @param hdrDataDom contains all the header information
* @param allFormDataDom contains the field data of all the forms
* @param objContext represents form number
* @param editFlag represents the mode of transaction(A-Add or E-Edit)
* @param xtraParams contains additional information such as loginEmpCode,loginCode,chgTerm etc
*/
@Override
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String xtraParams) throws RemoteException, ITMException
{
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
Connection conn = null;
GenericUtility genericUtility;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
String loginSite = "", userId = "", childNodeName = "", errorType = "", errCode = "", errString = "",itemCode="",
palletNo = "", sql = "",locCodeSugg="",locCodeInput = "",itemSerRg="",sql1="",fld_value="",sqlU="",udf_str1="",bayNo="";
int currentFormNo = 0, childNodeListLength = 0, cnt = 0, ctr = 0,cntP=0,locIcnt = 0,locScnt= 0;;
ArrayList <String> errList = new ArrayList<String>();
ArrayList <String> errFields = new ArrayList <String> ();
PreparedStatement pstmt = null ;
ResultSet rs = null ;
try
{
genericUtility = GenericUtility.getInstance();
CommonWmsUtil commonWmsUtility = CommonWmsUtil.getInstance();
System.out.println("xtraParam----->>["+xtraParams+"]");
System.out.println("DOM---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext);
}
switch ( currentFormNo )
{
case 1:
System.out.println("------in detail1 validation----------------");
System.out.println("DOM---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
bayNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", dom));
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
//System.out.println("childNodeName ------->>["+childNodeName+"]");
if("pallet_no".equalsIgnoreCase(childNodeName))
{
System.out.println("ScanLoc in dom"+bayNo);
if(bayNo.length() <= 0)
{
System.out.println("Bay No length less than 0 :::::::::: ");
errCode = "VMNLPALLET";//blank pallet no
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else
{
sql="SELECT COUNT(1) FROM SWMS_TO_AWMS S,WMS_TO_HOST W WHERE S.TRAN_ID = W.TRAN_ID AND S.SCHEDULE_STATUS = ? AND W.IN_OUT = ? AND W.BAY_NO = ? AND S.PALLET_NO = W.PALLET_NO AND S.IN_OUT = W.IN_OUT";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "N");
pstmt.setString(2, "O");
pstmt.setString(3, bayNo);
rs = pstmt.executeQuery();
if(rs.next())
{
cntP = rs.getInt(1);
System.out.println("count bayloc>>>>>>>" +cntP);
if(cntP==0)
{
System.out.println("loc_code exist");
errCode = "VMPALLTEXT";//swms
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}//PALLET ELSE END
}//PALLET NO END
}//FOR 1
break;
case 2:
System.out.println("------in detail2 validation----------------");
System.out.println("DOM---->>["+genericUtility.serializeDom(dom).toString()+"]");
System.out.println("DOM1----->>["+genericUtility.serializeDom(dom1).toString()+"]");
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
parentNodeList = dom2.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
locCodeInput = checkNullAndTrim(genericUtility.getColumnValue("loc_code_input",dom));
locCodeSugg = checkNullAndTrim(genericUtility.getColumnValue("loc_code_sugg",dom));
bayNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom));
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
//System.out.println("childNodeName ------->>["+childNodeName+"]");
if("loc_code_input".equalsIgnoreCase(childNodeName))
{
if(locCodeInput.length() <= 0)
{
System.out.println("Input Location length less than 0 :::::::::: ");
errCode = "VMLOCANULL"; //LOC NULL
errList.add( errCode );
errFields.add(childNodeName.toLowerCase());
}
else
{
sql="SELECT COUNT(1) FROM LOCATION WHERE INV_STAT NOT IN (?,?) AND LOC_CODE=? AND SITE_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, "AWMSQ");
pstmt.setString(3, locCodeInput);
pstmt.setString(4, loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
locIcnt = rs.getInt(1);
System.out.println("count location>>>>>>>" +locIcnt);
if(locIcnt==0)
{
System.out.println("loc_code exist");
errCode = "VMLOCATEXT";//LOC CODE SHOULD PRESENT
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
if(locCodeInput.equalsIgnoreCase(locCodeSugg))
{
System.out.println("input location is same as suggested location");
}
else
{
System.out.println("input location is not same as suggested location");
errCode = "VMLOCATEXS";// not same
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}//IF LOC_CODE_INPUT END
if("loc_code_sugg".equalsIgnoreCase(childNodeName))
{
System.out.println("in loc_code sugg ");
/*sql="SELECT DISTINCT(W.PALLET_NO) FROM SWMS_TO_AWMS S,WMS_TO_HOST W WHERE S.TRAN_ID = W.TRAN_ID AND S.SCHEDULE_STATUS = ? AND W.IN_OUT = ? AND W.BAY_NO = ? AND S.PALLET_NO = W.PALLET_NO";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "N");
pstmt.setString(2, "O");
pstmt.setString(3, bayNo);
rs = pstmt.executeQuery();
while(rs.next())
{
palletNo = rs.getString("PALLET_NO");
System.out.println( "item code"+itemCode);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
sql="SELECT DISTINCT(ITEM_CODE) FROM STOCK WHERE SITE_CODE=? AND LOC_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite);
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
while(rs.next())
{
itemCode = rs.getString("ITEM_CODE");
System.out.println( "item code"+itemCode);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
sql = "SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSerRg = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
System.out.println("itemSerRg FROM SITEITEM:::"+itemSerRg);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("ITEM_SER__RG1["+itemSerRg+"]");
//locCodeSugg = checkNullAndTrim(disudf_str1tComm.getDisparams("999999", itemSerRg , conn));
sql1="SELECT FLD_VALUE FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ?";
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, "LOC_CODE_SUGG");
pstmt.setString(2, "W_PALLETOUT");
rs = pstmt.executeQuery();
if(rs.next())
{
fld_value = checkNullAndTrim(rs.getString("FLD_VALUE"));
System.out.println("FLD_VALUE FROM GENCODES:::"+fld_value);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if(itemSerRg.equalsIgnoreCase(fld_value))
{
System.out.println("fld_value :"+fld_value);
sqlU="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmt = conn.prepareStatement(sqlU);
pstmt.setString(1, "LOC_CODE_SUGG");
pstmt.setString(2, "W_PALLETOUT");
pstmt.setString(3,fld_value);
rs = pstmt.executeQuery();
if(rs.next())
{
udf_str1 = checkNullAndTrim(rs.getString("UDF_STR1"));
System.out.println("UDF_STR1 FROM GENCODES:::"+udf_str1 +"for FLD_VALUE "+fld_value);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if(itemSerRg.equalsIgnoreCase(udf_str1))
{
System.out.println("udf_str1 :"+udf_str1);
locCodeSugg =udf_str1 ;
}
}
*/
}//if loc_code_sugg
}//FOR END 2
break;
}//End of switch statement
int errListSize = errList.size();
cnt =0;
String errFldName = null;
if ( errList != null && errListSize > 0 )
{
for (cnt = 0; cnt < errListSize; cnt++ )
{
errCode = errList.get(cnt);
errFldName = errFields.get(cnt);
System.out.println("errCode .........." + errCode);
errString = getErrorString( errFldName, errCode, userId );
errorType = errorType( conn, errCode );
if ( errString.length() > 0)
{
String bifurErrString = errString.substring( errString.indexOf("<Errors>") + 8, errString.indexOf("<trace>"));
bifurErrString =bifurErrString+errString.substring( errString.indexOf("</trace>") + 8, errString.indexOf("</Errors>"));
errStringXml.append(bifurErrString);
System.out.println("errStringXml .........."+errStringXml);
errString = "";
}
if ( errorType.equalsIgnoreCase("E"))
{
break;
}
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors></Root>\r\n");
}
else
{
errStringXml = new StringBuffer( "" );
}
errString = errStringXml.toString();
}//TRY
catch ( Exception e )
{
System.out.println ( "Exception: PalletOutIC: wfValData( Document currFormDataDom ): " + e.getMessage() + ":" );
//throw new ITMException(e);
e.printStackTrace();
}
finally
{
try
{
if (conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
System.out.println( "Exception : PalletOutIC:wfValData : " + e.getMessage() );
throw new ITMException(e);
}
}
System.out.println( "errString>>>>>>>::" + errString );
return errString;
}//wf end
private String errorType( Connection conn , String errorCode )
{
String msgType = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
try
{
String sql = " SELECT MSG_TYPE FROM MESSAGES WHERE MSG_NO = ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString(1, errorCode);
rs = pstmt.executeQuery();
while( rs.next() )
{
msgType = rs.getString("MSG_TYPE");
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
try
{
if ( rs != null )
{
rs.close();
rs = null;
}
if ( pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
catch ( Exception e )
{
e.printStackTrace();
}
}
return msgType;
}
@Override
public String itemChanged() throws RemoteException, ITMException
{
return "";
}
@Override
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document currFormDataDom = null;
Document hdrDataDom = null;
Document allFormDataDom = null;
String errString = null;
GenericUtility genericUtility = GenericUtility.getInstance();
System.out.println("xmlString ["+xmlString+"]");
System.out.println("xmlString1 ["+xmlString1+"]");
System.out.println("xmlString2 ["+xmlString2+"]");
try
{
if (xmlString != null && xmlString.trim().length()!=0)
{
currFormDataDom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length()!=0)
{
hdrDataDom = genericUtility.parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length()!=0)
{
allFormDataDom = genericUtility.parseString(xmlString2);
}
System.out.println ( "Calling itemChanged( currFormDataDom, hdrDataDom, allFormDataDom, objContext, currentColumn, editFlag, xtraParams )");
errString = itemChanged( currFormDataDom, hdrDataDom, allFormDataDom, objContext, currentColumn, editFlag, xtraParams );
System.out.println ( "ErrString :" + errString);
}
catch (Exception e)
{
System.out.println ( "Exception : PalletOutIC:itemChanged(String,String):" + e.getMessage() + ":" );
throw new ITMException(e);
}
System.out.println ( "returning from PalletOutIC itemChanged \n[" + errString + "]" );
return errString;
}
@Override
public String itemChanged( Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String currentColumn,String editFlag, String xtraParams ) throws RemoteException,ITMException
{
Connection conn = null;
PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null, rs1 = null;
int currentFormNo = 0, domId = 0;
String sql = "", tranId = "", chgUser = "", chgTerm = "", loginEmpCode = "", loginSite = "", locCodeInput = "",
locCodeSuggest="",childNodeName="",sql1="",fld_value="",sqlU="",udf_str1="",bayNo="";
StringBuffer valueXmlString;
ArrayList <String> errList = new ArrayList<String>();
ArrayList <String> errFields = new ArrayList <String> ();
System.out.println("xtraParams=["+xtraParams+"]");
System.out.println("PalletOUTCalled........................... : ["+currentColumn+"]");
GenericUtility genericUtility = GenericUtility.getInstance();
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<editFlag>").append( editFlag );
try
{
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String currDate = sdf.format(currentDate.getTime());
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
loginEmpCode = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
chgUser = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
System.out.println("loginEmpCode---->>["+loginEmpCode+"] chgUser---->>["+chgUser+"]");
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB( "DriverITM" );
connDriver = null;
if( objContext != null && objContext.trim().length() > 0 )
{
currentFormNo = Integer.parseInt( objContext );
}
System.out.println("current form no["+currentFormNo+"]");
valueXmlString.append("</editFlag>\r\n</Header>\r\n");
switch ( currentFormNo )
{
case 1:
{
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
System.out.println("------------------ inside case 1 itemchange --------------- ");
}
} //Case 1. End
break;
case 2:
{
System.out.println("-------------- itemchanged in Details 2 ----------------------");
System.out.println("hdrDataDom------->>["+genericUtility.serializeDom(hdrDataDom)+"]");
System.out.println("currFormDataDom------>>["+genericUtility.serializeDom(currFormDataDom)+"]");
System.out.println("allFormDataDom------>>["+genericUtility.serializeDom(allFormDataDom)+"]");
String palletNo = "",itemCode="",locCodeSugg="",itemSerRg="", errorType = "", errCode = "", errString = "";
bayNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no", hdrDataDom));
System.out.println("BayNo scanned is="+bayNo);
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ) )
{
System.out.println("------------------ inside case 2 itemchange ITEMDEFAULT--------------- ");
sql="SELECT DISTINCT(W.PALLET_NO) FROM SWMS_TO_AWMS S,WMS_TO_HOST W WHERE S.TRAN_ID = W.TRAN_ID AND S.SCHEDULE_STATUS = ? AND W.IN_OUT = ? AND W.BAY_NO = ? AND S.PALLET_NO = W.PALLET_NO AND S.IN_OUT = W.IN_OUT";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "N");
pstmt.setString(2, "O");
pstmt.setString(3, bayNo);
rs = pstmt.executeQuery();
while(rs.next())
{
palletNo = rs.getString("PALLET_NO");
System.out.println( "palletNo:::"+palletNo);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
sql="SELECT DISTINCT(ITEM_CODE) FROM STOCK WHERE SITE_CODE=? AND LOC_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite);
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
while(rs.next())
{
itemCode = rs.getString("ITEM_CODE");
System.out.println( "item code:::"+itemCode);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
sql = "SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSerRg = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
System.out.println("itemSerRg FROM SITEITEM::"+itemSerRg);
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
System.out.println("ITEM_SER__RG1["+itemSerRg+"]");
//locCodeSugg = checkNullAndTrim(disudf_str1tComm.getDisparams("999999", itemSerRg , conn));
sql1="SELECT FLD_VALUE FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ?";
pstmt = conn.prepareStatement(sql1);
pstmt.setString(1, "LOC_CODE_SUGG");
pstmt.setString(2, "W_PALLETOUT");
rs = pstmt.executeQuery();
while(rs.next())
{
fld_value = checkNullAndTrim(rs.getString("FLD_VALUE"));
System.out.println("FLD_VALUE FROM GENCODES::"+fld_value);
System.out.println("itemSerRg["+itemSerRg+"]");
System.out.println("fld_value["+fld_value+"]");
if(itemSerRg.equalsIgnoreCase(fld_value))
{
sqlU="SELECT UDF_STR1 FROM GENCODES WHERE FLD_NAME = ? AND MOD_NAME = ? AND FLD_VALUE = ?";
pstmt1 = conn.prepareStatement(sqlU);
pstmt1.setString(1, "LOC_CODE_SUGG");
pstmt1.setString(2, "W_PALLETOUT");
pstmt1.setString(3,fld_value);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
udf_str1 = checkNullAndTrim(rs1.getString("UDF_STR1"));
System.out.println("UDF_STR1 FROM GENCODES::"+udf_str1 +"for FLD_VALUE "+fld_value);
}
if(pstmt1 != null){pstmt1.close();pstmt1 = null;}
if(rs1 != null){rs1.close();rs1 = null;}
System.out.println("udf_str1 :"+udf_str1);
locCodeSugg =udf_str1 ;
}
}
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
valueXmlString.append("<Detail2 domID=\"1\" selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<loc_code_input><![CDATA[" ).append( locCodeInput ).append( "]]></loc_code_input>\r\n" );
valueXmlString.append( "<loc_code_sugg><![CDATA[" ).append( locCodeSugg ).append( "]]></loc_code_sugg>\r\n" );
valueXmlString.append("</Detail2>\r\n");
if(locCodeInput.equalsIgnoreCase(locCodeSugg))
{
System.out.println("in itemchange input location is same as suggested location");
}
else
{
System.out.println(" in itemchange input location is not same as suggested location");
errCode = "VMLOCATEXS";//not same
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
break;
}
}
/*else if(currentColumn.trim().equalsIgnoreCase( "loc_code_sugg" ))
{
System.out.println("------------------ inside case 2 itemchange --------------- ");
sql="SELECT ITEM_CODE FROM STOCK WHERE SITE_CODE=? AND LOC_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSite);
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
while(rs.next())
{
itemCode = rs.getString("ITEM_CODE");
System.out.println( "item code"+itemCode);
}
if(pstmt != null){ pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
sql = "SELECT ITEM_SER__RG1 FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, loginSite);
rs = pstmt.executeQuery();
while(rs.next())
{
itemSerRg = checkNullAndTrim(rs.getString("ITEM_SER__RG1"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
System.out.println("ITEM_SER__RG1["+itemSerRg+"]");
locCodeSugg = checkNullAndTrim(distComm.getDisparams("999999", itemSerRg , conn));
valueXmlString.append("<Detail2 domID=\"1\" selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
valueXmlString.append( "<pallet_no><![CDATA[" ).append( palletNo ).append( "]]></pallet_no>\r\n" );
valueXmlString.append( "<loc_code_input><![CDATA[" ).append( locCodeInput ).append( "]]></loc_code_input>\r\n" );
valueXmlString.append( "<loc_code_sugg><![CDATA[" ).append( locCodeSugg ).append( "]]></loc_code_sugg>\r\n" );
valueXmlString.append("</Detail2>\r\n");
}
*/
} //Case 2. End
break;
}//End of switch block
valueXmlString.append( "</Root>\r\n" );
}//TRY END
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if(pstmt != null) { pstmt.close(); pstmt = null; }
if(rs != null) { rs.close(); rs = null; }
if(conn != null){conn.close();conn = null;}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
System.out.println( "XML String return from item change="+valueXmlString.toString());
return valueXmlString.toString();
}//ITEM CHANGE END
private String checkNull( String input )
{
if ( input == null )
{
input = "";
}
return input.trim();
}
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
}
/**
* PURPOSE : Local Interface for PalletOutIC component
* AUTHOR : Jagruti Shinde
* DATE : 07-01-2016
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import javax.ejb.*;
@javax.ejb.Local
public interface PalletOutICLocal extends ValidatorLocal
{
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) throws RemoteException, ITMException;
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged( Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String currentColumn,String editFlag, String xtraParams ) throws RemoteException, ITMException;
}
/**
* PURPOSE : Remote Interface for PalletOutIC component
* AUTHOR : Jagruti Shinde
* DATE : 07-01-2016
*/
package ibase.webitm.ejb.wms;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import javax.ejb.*;
@javax.ejb.Remote
public interface PalletOutICRemote extends ValidatorRemote
{
public String wfValData() throws RemoteException, ITMException;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext,String editFlag, String xtraParams) throws RemoteException, ITMException;
public String wfValData(Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String xtraParams) throws RemoteException, ITMException;
public String itemChanged() throws RemoteException, ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException;
public String itemChanged( Document currFormDataDom, Document hdrDataDom, Document allFormDataDom, String objContext, String currentColumn,String editFlag, String xtraParams ) throws RemoteException, ITMException;
}
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