Commit dd365efc authored by chavanp's avatar chavanp

new stock help jsp format


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105125 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 64be596f
......@@ -107,6 +107,114 @@ public class StockHelp implements StockHelpLocal,StockHelpRemote
}
// end 24/08/11 manoharan
//Added By Priyanka 26/02/2017
public String getImagePath(String itemCode) throws ITMException
{
String retImgPath = "", itemParnt = "", itemRefSer = "", docId = "", docType = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
Connection conn = null;
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
sql = " SELECT ITEM_PARNT FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemParnt = checkNullAndTrim(rs.getString("ITEM_PARNT"));
}
if(rs != null)
{
rs.close();rs = null;
}
if(pstmt != null)
{
pstmt.close();pstmt = null;
}
sql = " SELECT REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = 'w_item'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
itemRefSer = checkNullAndTrim(rs.getString("REF_SER"));
}
if(rs != null)
{
rs.close();rs = null;
}
if(pstmt != null)
{
pstmt.close();pstmt = null;
}
sql = " SELECT DOC_CONTENTS.DOC_ID,DOC_CONTENTS.DOC_TYPE FROM DOC_CONTENTS, DOC_TRANSACTION_LINK, USERS "
+ " WHERE DOC_TRANSACTION_LINK.DOC_ID = DOC_CONTENTS.DOC_ID AND USERS.CODE = DOC_CONTENTS.ADD_USER "
+ " AND REF_SER = ? AND (REF_ID = ? OR REF_ID = ?) ORDER BY DOC_CONTENTS.DOC_ID ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemRefSer);
pstmt.setString(2, itemCode);
pstmt.setString(3, itemParnt);
rs = pstmt.executeQuery();
if(rs.next())
{
docId = checkNullAndTrim(rs.getString("DOC_ID"));
docType= checkNullAndTrim(rs.getString("DOC_TYPE"));
retImgPath = "/ibase/WebITMDocumentHandlerServlet?OBJ_NAME=item&REF_ID="+itemCode.trim()+"&ACTION=GET_DOCUMENT&CLIENT=WEB1&DOC_ID="+docId+"&DOC_TYPE="+docType+"";
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if (rs != null)
{
rs.close();rs = null;
}
if (pstmt != null )
{
pstmt.close();pstmt = null;
}
if (conn != null && !conn.isClosed())
{
conn.close();conn = null;
}
}
catch (Exception e)
{
throw new ITMException(e);
}
}
return retImgPath;
}
//End 26/02/2017.
private static String checkNullAndTrim(String input)
{
if (input==null)
{
input="";
}
return input.trim();
}
public ArrayList loadData(String lotno,String sitecode,String itemcode) throws ITMException
{
//GenericUtility genericUtility = null;
......
......@@ -117,10 +117,38 @@ public class StockHelpBean
stkHlpRetArr = null;
stkParms = null;
}
System.out.println(">>>>>>>>>>>>>>ddDD"+thisBeanArray);
//System.out.println(">>>>>>>>>>>>>>ddDD"+thisBeanArray);
return thisBeanArray;
}
//Added By Priyanka 26/02/2017.
public String getImagePath(String itemCode) throws ITMException
{
InitialContext ctx = null;
AppConnectParm appConnect = null;
StockHelpLocal homeObj = null;
String itemImagePath = "";
try
{
appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
homeObj = (StockHelpLocal)ctx.lookup("ibase/StockHelp/local");
itemImagePath = homeObj.getImagePath(itemCode);
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
appConnect = null;
ctx = null;
homeObj = null;
}
return itemImagePath;
}
//End on 26/02/2017.
public ArrayList loaddata() throws Exception
{
......
......@@ -19,4 +19,6 @@ public interface StockHelpLocal// extends ValidatorLocal
public ArrayList getDetails(String siteCode, String itemCode) throws RemoteException,ITMException;
public String getItemDescr(String itemCode) throws ITMException;
public ArrayList loadData(String lotno,String sitecode,String itemCode) throws ITMException;
public String getImagePath(String itemCode)throws ITMException;
}
\ No newline at end of file
......@@ -14,4 +14,5 @@ public interface StockHelpRemote //extends ValidatorRemote
{
public ArrayList getDetails(String siteCode, String itemCode) throws RemoteException,ITMException;
public String getItemDescr(String itemCode) throws ITMException;
public String getImagePath(String itemCode)throws ITMException;
}
\ No newline at end of file
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