Commit c2582507 authored by wansari's avatar wansari

W15GSUN002 changed by wasim to add getPalletizedAttributes() method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98692 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4bd13377
...@@ -5,6 +5,8 @@ import ibase.webitm.utility.ITMException; ...@@ -5,6 +5,8 @@ import ibase.webitm.utility.ITMException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
public class CommonWmsUtil { public class CommonWmsUtil {
public static int ALL_PTCN_EX_COUNT; public static int ALL_PTCN_EX_COUNT;
...@@ -174,4 +176,79 @@ public class CommonWmsUtil { ...@@ -174,4 +176,79 @@ public class CommonWmsUtil {
} }
return stkOpt; return stkOpt;
} }
//Changed by wasim on 09-10-15 to get attribute data for interface2 table [START]
public HashMap getPalletizedAttributes(String itemCode, String siteCode, Connection conn) throws ITMException, SQLException
{
HashMap hm = new HashMap();
PreparedStatement pstmt=null;
ResultSet rs = null;
String sql = "";
String familyGrp = "", qcType = "", stroPref = "";
try
{
sql = "SELECT LOC_ZONE__PREF,PROC_MTH,ANALYSIS_CLASS FROM SITEITEM WHERE ITEM_CODE = ? AND SITE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
familyGrp = checkNullAndTrim(rs.getString("LOC_ZONE__PREF"));
qcType = checkNullAndTrim(rs.getString("PROC_MTH"));
stroPref = checkNullAndTrim(rs.getString("ANALYSIS_CLASS"));
}
rs.close();rs = null;
pstmt.close();pstmt = null;
sql = "SELECT LOC_ZONE__PREF,PROC_MTH,ANALYSIS_CLASS FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
if(familyGrp == null || familyGrp.length() <= 0)
{
familyGrp = checkNullAndTrim(rs.getString("LOC_ZONE__PREF"));
}
if(qcType == null || qcType.length() <= 0)
{
qcType = checkNullAndTrim(rs.getString("PROC_MTH"));
}
if(stroPref == null || stroPref.length() <= 0)
{
stroPref = checkNullAndTrim(rs.getString("ANALYSIS_CLASS"));
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
hm.put("LOC_ZONE__PREF", familyGrp);
hm.put("PROC_MTH", qcType);
hm.put("ANALYSIS_CLASS", stroPref);
}
catch(Exception e)
{
System.out.println("Exception ::" + e.getMessage() + ":");
throw new ITMException(e);
}
finally
{
if(pstmt != null){pstmt.close();pstmt = null;}
if(rs != null){rs.close();rs = null;}
}
return hm;
}
private static String checkNullAndTrim(String input)
{
if (input==null)
{
input="";
}
return input.trim();
}
//Changed by wasim on 09-10-15 to get attribute data for interface2 table [END]
} }
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