Commit d8dfb8e9 authored by wansari's avatar wansari

W15GSUN002 changed by wasim to update parameter for adding connection for wms...

W15GSUN002 changed by wasim to update parameter for adding connection for wms in update AWMSinterface method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98760 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d5bb856e
...@@ -246,11 +246,11 @@ public class CommonWmsUtil { ...@@ -246,11 +246,11 @@ public class CommonWmsUtil {
} }
return hm; return hm;
} }
public void updateAwmsInterface(ArrayList interfaceArrList) throws ITMException, SQLException public void updateAwmsInterface(ArrayList interfaceArrList,Connection connWms) throws ITMException, SQLException
{ {
System.out.println("Inside updateAwmsInterface"); System.out.println("Inside updateAwmsInterface");
PreparedStatement interfacePstmt=null; PreparedStatement interfacePstmt=null, interfaceWmsPstmt = null;
ResultSet rs = null; ResultSet rs = null;
String interfaceSql = ""; String interfaceSql = "";
...@@ -266,13 +266,23 @@ public class CommonWmsUtil { ...@@ -266,13 +266,23 @@ public class CommonWmsUtil {
String itemCode = "",lineNo = "",descr = "",unit = "",itemType = "",familyGrp = "",refSer = "",lotNo = "",refId = "",lotSl = "",quantity = "", String itemCode = "",lineNo = "",descr = "",unit = "",itemType = "",familyGrp = "",refSer = "",lotNo = "",refId = "",lotSl = "",quantity = "",
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "", palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",siteCode = "",
inOut = "",errCod = "",msgStat = ""; inOut = "",errCod = "",msgStat = "";
String transactionId = ""; String transactionId = "",WMSSql = "";
try try
{ {
conn = connDriver.getConnectDB("DriverAWMS"); conn = connDriver.getConnectDB("DriverAWMS");
conn.setAutoCommit(false); conn.setAutoCommit(false);
interfaceSql = "INSERT INTO INTERFACE2 (IN_OUT,ERR_COD,MSG_STAT,TRANS_DT_ACK,TRAN_ID," interfaceSql = "INSERT INTO INTERFACE (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,QUANTITY,EXP_DATE,MFG_DATE,"
+ "PALLET_NO,PALLET_STATUS,LOCK_STAT,QC_TYPE,STRO_PREF,PALLET_REJ,"
+ "PALLET_REJ_DESC,REF_LINE_NO) "
+ "VALUES (?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?)";
WMSSql = "INSERT INTO INTERFACE2 (IN_OUT,ERR_COD,MSG_STAT,TRANS_DT_ACK,TRAN_ID,"
+ "ITEM_CODE,DESCR,UNIT,ITEM_TYPE,FAMILY_GRP,REF_SER," + "ITEM_CODE,DESCR,UNIT,ITEM_TYPE,FAMILY_GRP,REF_SER,"
+ "LOT_NO,REF_ID,LOT_SL,QUANTITY,EXP_DATE,MFG_DATE," + "LOT_NO,REF_ID,LOT_SL,QUANTITY,EXP_DATE,MFG_DATE,"
+ "PALLET_NO,PALLET_STATUS,LOCK_STAT,QC_TYPE,STRO_PREF,PALLET_REJ," + "PALLET_NO,PALLET_STATUS,LOCK_STAT,QC_TYPE,STRO_PREF,PALLET_REJ,"
...@@ -300,7 +310,6 @@ public class CommonWmsUtil { ...@@ -300,7 +310,6 @@ public class CommonWmsUtil {
System.out.println("Tran Date is="+tranDate); System.out.println("Tran Date is="+tranDate);
if(tranDate != null && tranDate.trim().length() > 0 && !tranDate.equals("null")) if(tranDate != null && tranDate.trim().length() > 0 && !tranDate.equals("null"))
{ {
//tranDateAct = (Timestamp) detail.get("TRANS_DT_ACK");
tranDateAct = Timestamp.valueOf((String) detail.get("TRANS_DT_ACK")); tranDateAct = Timestamp.valueOf((String) detail.get("TRANS_DT_ACK"));
} }
...@@ -320,7 +329,6 @@ public class CommonWmsUtil { ...@@ -320,7 +329,6 @@ public class CommonWmsUtil {
System.out.println("Exp date"+expDt); System.out.println("Exp date"+expDt);
if(expDt != null && expDt.trim().length() > 0 && !expDt.equals("null")) if(expDt != null && expDt.trim().length() > 0 && !expDt.equals("null"))
{ {
//expDate = (Timestamp) detail.get("EXP_DATE");
expDate = Timestamp.valueOf((String) detail.get("EXP_DATE")); expDate = Timestamp.valueOf((String) detail.get("EXP_DATE"));
} }
...@@ -328,7 +336,6 @@ public class CommonWmsUtil { ...@@ -328,7 +336,6 @@ public class CommonWmsUtil {
System.out.println("Mfg date"+mfgDt); System.out.println("Mfg date"+mfgDt);
if(mfgDt != null && mfgDt.trim().length() > 0 && !mfgDt.equals("null")) if(mfgDt != null && mfgDt.trim().length() > 0 && !mfgDt.equals("null"))
{ {
//mfgDate = (Timestamp) detail.get("MFG_DATE");
mfgDate = Timestamp.valueOf((String) detail.get("MFG_DATE")); mfgDate = Timestamp.valueOf((String) detail.get("MFG_DATE"));
} }
//expDate = (Timestamp) detail.get("EXP_DATE"); //expDate = (Timestamp) detail.get("EXP_DATE");
...@@ -369,10 +376,40 @@ public class CommonWmsUtil { ...@@ -369,10 +376,40 @@ public class CommonWmsUtil {
interfacePstmt.setString(24, palletRejDesc); interfacePstmt.setString(24, palletRejDesc);
interfacePstmt.setString(25, lineNo); interfacePstmt.setString(25, lineNo);
interfaceWmsPstmt = connWms.prepareStatement(WMSSql);
interfaceWmsPstmt.setString(1, inOut);
interfaceWmsPstmt.setString(2, errCod);
interfaceWmsPstmt.setString(3, msgStat);
interfaceWmsPstmt.setTimestamp(4, tranDateAct);
interfaceWmsPstmt.setString(5, transactionId);
interfaceWmsPstmt.setString(6, itemCode);
interfaceWmsPstmt.setString(7, descr);
interfaceWmsPstmt.setString(8, unit);
interfaceWmsPstmt.setString(9, itemType);
interfaceWmsPstmt.setString(10, familyGrp);
interfaceWmsPstmt.setString(11, refSer);
interfaceWmsPstmt.setString(12, lotNo);
interfaceWmsPstmt.setString(13, refId);
interfaceWmsPstmt.setString(14, lotSl);
interfaceWmsPstmt.setString(15, quantity);
interfaceWmsPstmt.setTimestamp(16, expDate);
interfaceWmsPstmt.setTimestamp(17, mfgDate);
interfaceWmsPstmt.setString(18, palletNo);
interfaceWmsPstmt.setString(19, palletStatus);
interfaceWmsPstmt.setString(20, lockStat);
interfaceWmsPstmt.setString(21, qcType);
interfaceWmsPstmt.setString(22, stroPref);
interfaceWmsPstmt.setString(23, palletRej);
interfaceWmsPstmt.setString(24, palletRejDesc);
interfaceWmsPstmt.setString(25, lineNo);
caseCount = interfaceWmsPstmt.executeUpdate();
interfaceWmsPstmt.close(); interfaceWmsPstmt = null;
System.out.println("Update Count WMS= "+caseCount);
caseCount = interfacePstmt.executeUpdate(); caseCount = interfacePstmt.executeUpdate();
interfacePstmt.close(); interfacePstmt = null; interfacePstmt.close(); interfacePstmt = null;
System.out.println("Update Count AWMS= "+caseCount);
System.out.println("Update Count = "+caseCount);
} }
} }
catch(Exception e) catch(Exception e)
...@@ -392,6 +429,7 @@ public class CommonWmsUtil { ...@@ -392,6 +429,7 @@ public class CommonWmsUtil {
conn.commit(); conn.commit();
} }
if(interfacePstmt != null){interfacePstmt.close();interfacePstmt = null;} if(interfacePstmt != null){interfacePstmt.close();interfacePstmt = null;}
if(interfaceWmsPstmt != null){interfaceWmsPstmt.close();interfaceWmsPstmt = null;}
if(rs != null){rs.close();rs = null;} if(rs != null){rs.close();rs = null;}
if(conn != null){conn.close();conn = null;} if(conn != null){conn.close();conn = null;}
} }
......
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