Commit 468950c5 authored by wansari's avatar wansari

W15GSUN002 changed by wasim to add updateAwmsInterface() method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98700 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0f7c671c
package ibase.webitm.utility.wms; package ibase.webitm.utility.wms;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -6,7 +7,10 @@ import java.sql.Connection; ...@@ -6,7 +7,10 @@ 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.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
public class CommonWmsUtil { public class CommonWmsUtil {
public static int ALL_PTCN_EX_COUNT; public static int ALL_PTCN_EX_COUNT;
...@@ -177,7 +181,7 @@ public class CommonWmsUtil { ...@@ -177,7 +181,7 @@ public class CommonWmsUtil {
return stkOpt; return stkOpt;
} }
//Changed by wasim on 09-10-15 to get attribute data for interface2 table [START] //Changed by wasim on 09-10-15 for AWMS interface2 table [START]
public HashMap getPalletizedAttributes(String itemCode, String siteCode, Connection conn) throws ITMException, SQLException public HashMap getPalletizedAttributes(String itemCode, String siteCode, Connection conn) throws ITMException, SQLException
{ {
HashMap hm = new HashMap(); HashMap hm = new HashMap();
...@@ -242,6 +246,139 @@ public class CommonWmsUtil { ...@@ -242,6 +246,139 @@ public class CommonWmsUtil {
} }
return hm; return hm;
} }
public void updateAwmsInterface(ArrayList interfaceArrList) throws ITMException, SQLException
{
System.out.println("Inside updateAwmsInterface");
PreparedStatement interfacePstmt=null;
ResultSet rs = null;
String interfaceSql = "";
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
int caseCount = 0;
Boolean isError = false;
Timestamp tranDateAct = null,expDate = null,mfgDate = null;
String itemCode = "",lineNo = "",descr = "",unit = "",itemType = "",familyGrp = "",refSer = "",lotNo = "",refId = "",lotSl = "",quantity = "",
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "",
inOut = "",errCod = "",msgStat = "";
String transactionId = "";
try
{
conn = connDriver.getConnectDB("DriverAWMS");
conn.setAutoCommit(false);
interfaceSql = "INSERT INTO INTERFACE2 (IN_OUT,ERR_COD,MSG_STAT,TRANS_DT_ACK,TRAN_ID,"
+ "ITEM_CODE,DESCR,UNIT,ITEM_TYPE,FAMILY_GRP,REF_SER,"
+ "LOT_NO,REF_ID,LOT_SL,QUANINTY,EXP_DATE,MFG_DATE,"
+ "PALLET_NO,PALLET_STATUS,LOCK_STAT,QC_TYPE,STRO_PREF,PALLET_REJ,"
+ "PALLET_REJ_DESC,REF_LINE_NO) "
+ "VALUES (?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?)";
/*interfaceSql = "INSERT INTO INTERFACE2 (IN_OUT,ERR_COD,MSG_STAT,TRANS_DT_ACK,TRAN_ID,"
+ "ITEM_CODE,DESCR,UNIT,ITEM_TYPE,FAMILY_GRP,REF_SER,"
+ "LOT_NO,REF_ID,LOT_SL,QUANINTY) "
+ "VALUES (?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?)";*/
Iterator itr=interfaceArrList.iterator();
System.out.println("Array List size="+interfaceArrList.size());
while(itr.hasNext())
{
HashMap detail = new HashMap();
detail = (HashMap) itr.next();
inOut = (String) detail.get("IN_OUT");
errCod = (String) detail.get("ERR_COD");
msgStat = (String) detail.get("MSG_STAT");
tranDateAct = (Timestamp) detail.get("TRANS_DT_ACK");
transactionId = (String) detail.get("TRAN_ID");
itemCode = (String) detail.get("ITEM_CODE");
descr = (String) detail.get("DESCR");
unit = (String) detail.get("UNIT");
itemType = (String) detail.get("ITEM_TYPE");
familyGrp = (String) detail.get("FAMILY_GRP");
refSer = (String) detail.get("REF_SER");
lotNo = (String) detail.get("LOT_NO");
refId = (String) detail.get("REF_ID");
lotSl = (String) detail.get("LOT_SL");
quantity = (String) detail.get("QUANINTY");
expDate = (Timestamp) detail.get("EXP_DATE");
mfgDate = (Timestamp) detail.get("MFG_DATE");
palletNo = (String) detail.get("PALLET_NO");
palletNo = (String) detail.get("PALLET_STATUS");
lockStat = (String) detail.get("LOCK_STAT");
qcType = (String) detail.get("QC_TYPE");
stroPref = (String) detail.get("STRO_PREF");
palletRej = (String) detail.get("PALLET_REJ");
palletRejDesc = (String) detail.get("PALLET_REJ_DESC");
lineNo = (String) detail.get("REF_LINE_NO");
interfacePstmt = conn.prepareStatement(interfaceSql);
interfacePstmt.setString(1, inOut);
interfacePstmt.setString(2, errCod);
interfacePstmt.setString(3, msgStat);
interfacePstmt.setTimestamp(4, tranDateAct);
interfacePstmt.setString(5, transactionId);
interfacePstmt.setString(6, itemCode);
interfacePstmt.setString(7, descr);
interfacePstmt.setString(8, unit);
interfacePstmt.setString(9, itemType);
interfacePstmt.setString(10, familyGrp);
interfacePstmt.setString(11, refSer);
interfacePstmt.setString(12, lotNo);
interfacePstmt.setString(13, refId);
interfacePstmt.setString(14, lotSl);
interfacePstmt.setString(15, quantity);
interfacePstmt.setTimestamp(16, expDate);
interfacePstmt.setTimestamp(17, mfgDate);
interfacePstmt.setString(18, palletNo);
interfacePstmt.setString(19, palletStatus);
interfacePstmt.setString(20, lockStat);
interfacePstmt.setString(21, qcType);
interfacePstmt.setString(22, stroPref);
interfacePstmt.setString(23, palletRej);
interfacePstmt.setString(24, palletRejDesc);
interfacePstmt.setString(25, lineNo);
caseCount = interfacePstmt.executeUpdate();
interfacePstmt.close(); interfacePstmt = null;
System.out.println("Update Count = "+caseCount);
}
}
catch(Exception e)
{
isError = true;
throw new ITMException(e);
}
finally
{
System.out.println("updateAwmsInterface isError="+isError);
if(isError)
{
conn.rollback();
}
else
{
conn.commit();
}
if(interfacePstmt != null){interfacePstmt.close();interfacePstmt = null;}
if(rs != null){rs.close();rs = null;}
if(conn != null){conn.close();conn = null;}
}
}
private static String checkNullAndTrim(String input) private static String checkNullAndTrim(String input)
{ {
if (input==null) if (input==null)
...@@ -250,5 +387,5 @@ public class CommonWmsUtil { ...@@ -250,5 +387,5 @@ public class CommonWmsUtil {
} }
return input.trim(); return input.trim();
} }
//Changed by wasim on 09-10-15 to get attribute data for interface2 table [END] //Changed by wasim on 09-10-15 to for AWMS 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