Commit 5bd2a63a authored by chavanp's avatar chavanp

change the return type of AwmsInterface method.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106166 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2510201d
...@@ -365,8 +365,232 @@ public class CommonWmsUtil { ...@@ -365,8 +365,232 @@ public class CommonWmsUtil {
} }
return hm; return hm;
} }
public void updateAwmsInterface(ArrayList interfaceArrList,String siteCode,Connection connWms) throws ITMException, SQLException //change by Priyankac on 03JULY2017.[AwmsInterface return type should be changed..Start]
public String updateAwmsInterface(ArrayList interfaceArrList,String siteCode,Connection connWms) throws ITMException, SQLException
{ {
String errString = "";
System.out.println("Inside updateAwmsInterface");
PreparedStatement interfacePstmt=null, interfaceWmsPstmt = null,pstmt=null;
ResultSet rs = null;
String interfaceSql = "",sql="";
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
int caseCount = 0,caseCount1 = 0,cnt=0;
Boolean isError = false;
Timestamp tranDateAct = null,expDate = null,mfgDate = null,transactionDate = null;;
String tranDate = "",expDt = "",mfgDt = "";
String itemCode = "",lineNo = "",descr = "",unit = "",itemType = "",familyGrp = "",refSer = "",lotNo = "",refId = "",lotSl = "",quantity = "",
palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",palletRej = "",palletRejDesc = "",confirmed = "",
inOut = "",errCod = "",msgStat = "",transDate = "",errDesc = "";
String totalQty ,qtyPerArt ;
String transactionId = "",WMSSql = "";
java.sql.Timestamp currDate = new java.sql.Timestamp( System.currentTimeMillis() );
try
{
conn = connDriver.getConnectDB("DriverAWMS");
conn.setAutoCommit(false);
interfaceSql = "INSERT INTO HOST_TO_WMS (TRAN_ID,ITEM_CODE,DESCR,UNIT,ITEM_TYPE,"//Changed table name by wasim on 02-11-15, previous table name interface.
+ "FAMILY_GRP,IN_OUT,REF_SER,REF_ID,TRAN_DATE,LOT_NO,"
+ "LOT_SL,QUANTITY,QTY_PER_ART,TOTAL_QTY,EXP_DATE,MFG_DATE,"
+ "PALLET_NO,PALLET_STATUS,MSG_STAT,LOCK_STAT,ERR_COD,ERR_DESC,"
+ "QC_TYPE,TRANS_DT_ACK,STRO_PREF,LINE_NO) "
+ "VALUES (?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?)";
WMSSql = "INSERT INTO SWMS_TO_AWMS (TRAN_ID,ITEM_CODE,DESCR,UNIT,ITEM_TYPE,"//Changed table name by wasim on 02-11-15, previous table name interface2.
+ "FAMILY_GRP,IN_OUT,REF_SER,REF_ID,TRAN_DATE,LOT_NO,"
+ "LOT_SL,QUANTITY,QTY_PER_ART,TOTAL_QTY,EXP_DATE,MFG_DATE,"
+ "PALLET_NO,PALLET_STATUS,MSG_STAT,LOCK_STAT,ERR_COD,ERR_DESC,"
+ "QC_TYPE,TRANS_DT_ACK,STRO_PREF,LINE_NO,SCHEDULE_STATUS) "
+ "VALUES (?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?)";
Iterator itr=interfaceArrList.iterator();
System.out.println("Array List size="+interfaceArrList.size());
while(itr.hasNext())
{
HashMap detail = new HashMap();
detail = (HashMap) itr.next();
transactionId = generateTranTd("w_interface2", currDate.toString(), siteCode, connWms);
System.out.println("interface2TranId ::::::::::::: " + transactionId);
inOut = (String) detail.get("IN_OUT");
errCod = (String) detail.get("ERR_COD");
msgStat = (String) detail.get("MSG_STAT");
tranDate = (String) detail.get("TRANS_DT_ACK");
System.out.println("Tran Date is="+tranDate);
if(tranDate != null && tranDate.trim().length() > 0 && !tranDate.equals("null"))
{
tranDateAct = Timestamp.valueOf((String) detail.get("TRANS_DT_ACK"));
}
transDate = (String) detail.get("TRAN_DATE");
System.out.println("Tran Date is="+tranDate);
if(transDate != null && transDate.trim().length() > 0 && !transDate.equals("null"))
{
transactionDate = Timestamp.valueOf((String) detail.get("TRAN_DATE"));
}
System.out.println("transaction date::: " + transactionDate);
System.out.println("ack date::: " + tranDateAct);
//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("QUANTITY");
expDt = (String) detail.get("EXP_DATE");
System.out.println("Exp date"+expDt);
if(expDt != null && expDt.trim().length() > 0 && !expDt.equals("null"))
{
expDate = Timestamp.valueOf((String) detail.get("EXP_DATE"));
}
mfgDt = (String) detail.get("MFG_DATE");
System.out.println("Mfg date"+mfgDt);
if(mfgDt != null && mfgDt.trim().length() > 0 && !mfgDt.equals("null"))
{
mfgDate = Timestamp.valueOf((String) detail.get("MFG_DATE"));
}
palletNo = (String) detail.get("PALLET_NO");
palletStatus = (String) detail.get("PALLET_STATUS");
lockStat = (String) detail.get("LOCK_STAT");
qcType = (String) detail.get("QC_TYPE");
stroPref = (String) detail.get("STRO_PREF");
lockStat = (String) detail.get("LOCK_STAT");
qtyPerArt = (String) detail.get("QTY_PER_ART");
totalQty = (String) detail.get("TOTAL_QTY");
lineNo = (String) detail.get("LINE_NO");
interfacePstmt = conn.prepareStatement(interfaceSql);
interfacePstmt.setString(1, transactionId);
interfacePstmt.setString(2, itemCode);
interfacePstmt.setString(3, descr);
interfacePstmt.setString(4, unit);
interfacePstmt.setString(5, itemType);
interfacePstmt.setString(6, familyGrp);
interfacePstmt.setString(7, inOut);
interfacePstmt.setString(8, refSer);
interfacePstmt.setString(9, refId);
interfacePstmt.setTimestamp(10, transactionDate);
interfacePstmt.setString(11, lotNo);
interfacePstmt.setString(12, lotSl);
interfacePstmt.setString(13, quantity);
interfacePstmt.setString(14, qtyPerArt);
interfacePstmt.setString(15, totalQty);
interfacePstmt.setTimestamp(16, expDate);
interfacePstmt.setTimestamp(17, mfgDate);
interfacePstmt.setString(18, palletNo);
interfacePstmt.setString(19, palletStatus);
interfacePstmt.setString(20, msgStat);
interfacePstmt.setString(21, lockStat);
interfacePstmt.setString(22, errCod);
interfacePstmt.setString(23, errDesc);
interfacePstmt.setString(24, qcType);
interfacePstmt.setTimestamp(25, tranDateAct);
interfacePstmt.setString(26, stroPref);
interfacePstmt.setString(27, lineNo);
interfaceWmsPstmt = connWms.prepareStatement(WMSSql);
interfaceWmsPstmt.setString(1, transactionId);
interfaceWmsPstmt.setString(2, itemCode);
interfaceWmsPstmt.setString(3, descr);
interfaceWmsPstmt.setString(4, unit);
interfaceWmsPstmt.setString(5, itemType);
interfaceWmsPstmt.setString(6, familyGrp);
interfaceWmsPstmt.setString(7, inOut);
interfaceWmsPstmt.setString(8, refSer);
interfaceWmsPstmt.setString(9, refId);
interfaceWmsPstmt.setTimestamp(10, transactionDate);
interfaceWmsPstmt.setString(11, lotNo);
interfaceWmsPstmt.setString(12, lotSl);
interfaceWmsPstmt.setString(13, quantity);
interfaceWmsPstmt.setString(14, qtyPerArt);
interfaceWmsPstmt.setString(15, totalQty);
interfaceWmsPstmt.setTimestamp(16, expDate);
interfaceWmsPstmt.setTimestamp(17, mfgDate);
interfaceWmsPstmt.setString(18, palletNo);
interfaceWmsPstmt.setString(19, palletStatus);
interfaceWmsPstmt.setString(20, msgStat);
interfaceWmsPstmt.setString(21, lockStat);
interfaceWmsPstmt.setString(22, errCod);
interfaceWmsPstmt.setString(23, errDesc);
interfaceWmsPstmt.setString(24, qcType);
interfaceWmsPstmt.setTimestamp(25, tranDateAct);
interfaceWmsPstmt.setString(26, stroPref);
interfaceWmsPstmt.setString(27, lineNo);
interfaceWmsPstmt.setString(28, "N");//Changed by wasim 26 -11-2015 to add schedule_status = 'N' by default
caseCount1 += interfaceWmsPstmt.executeUpdate();
interfaceWmsPstmt.close(); interfaceWmsPstmt = null;
System.out.println("Update Count WMS= "+caseCount1);
caseCount += interfacePstmt.executeUpdate();
interfacePstmt.close(); interfacePstmt = null;
System.out.println("Update Count AWMS= "+caseCount);
}
//Added by saurabh for swms_to_Awms detail count should be match with pallet det[07/06/17|Start]
if(caseCount!=interfaceArrList.size())
{
errString="COUNTNOTMATCH_HOST";
}
if(caseCount1!=interfaceArrList.size())
{
errString="COUNTNOTMATCH_SWMS";
}
if(caseCount1!=caseCount)
{
errString="INSERTCNTNOTMATCH";
}
//Added by saurabh for swms_to_Awms detail count should be match with pallet det[07/06/17|End]
}
catch(Exception e)
{
isError = true;
errString = e.getMessage();
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(interfaceWmsPstmt != null){interfaceWmsPstmt.close();interfaceWmsPstmt = null;}
if(rs != null){rs.close();rs = null;}
if(conn != null){conn.close();conn = null;}
}
return errString;
/*{
System.out.println("Inside updateAwmsInterface"); System.out.println("Inside updateAwmsInterface");
PreparedStatement interfacePstmt=null, interfaceWmsPstmt = null; PreparedStatement interfacePstmt=null, interfaceWmsPstmt = null;
...@@ -569,7 +793,11 @@ public class CommonWmsUtil { ...@@ -569,7 +793,11 @@ public class CommonWmsUtil {
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;}
} }
}*/
} }
//change by Priyankac on 03JULY2017.[AwmsInterface return type should be changed..END]
public static String checkNullAndTrim(String input) public static String checkNullAndTrim(String input)
{ {
if (input==null) if (input==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