Commit b7d122e5 authored by wansari's avatar wansari

W15JSUN015 updated source for counting from swms_to_awms to check weather schedular is runn today


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100067 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bb4eadf3
......@@ -336,15 +336,16 @@ public class StatusChangeRequest implements Schedule {
public String StockCountActivty(String loginSiteCode) throws RemoteException,ITMException
{
Connection conn = null;
ResultSet rs = null,rsPhyscan = null;
PreparedStatement pstmt = null, pstmtPhyscan = null;
ResultSet rs = null,rsPhyscan = null,rsInterface = null;
PreparedStatement pstmt = null, pstmtPhyscan = null,pstmtInterface = null;
boolean isError = false;
String lineNo = "",itemDescr = "",itemCode = "",unit = "",itemType = "",familyGrp = "",
lotNo = "",lotSl = "",palletNo = "",palletStatus = "",lockStat = "",qcType = "",stroPref = "",analysisClass = "",
errString = "",sql = "",sqlPhyScan = "",tranId = "",invStat = "";
errString = "",sql = "",sqlPhyScan = "",tranId = "",invStat = "",sqlInterface = "";
double quantity = 0, noArtQuot = 0,noArtRem = 0,notArt = 0,totalQuantity = 0, qtyPerArt = 0;
int count = 0;
Timestamp today = new Timestamp(System.currentTimeMillis());
Timestamp expDate = null;
......@@ -364,6 +365,22 @@ public class StatusChangeRequest implements Schedule {
invStat = "'"+invStat+"'";
System.out.println("AWMS INVSTAT for Physical count: "+invStat);
sqlInterface = " SELECT COUNT(1) FROM SWMS_TO_AWMS WHERE IN_OUT = ? AND TRAN_DATE = ?";
pstmtInterface = conn.prepareStatement(sqlInterface);
pstmtInterface.setString(1, "B");
pstmtInterface.setTimestamp(2, getCurrtDate());
rsInterface = pstmtInterface.executeQuery();
if(rsInterface.next())
{
count = rsInterface.getInt(1);
}
rsInterface.close();rsInterface = null;
pstmtInterface.close();pstmtInterface = null;
System.out.println("Count from swms_to_amws for in_out B="+count);
if(count == 0)
{
sql = " SELECT TRAN_ID FROM PHYSCAN WHERE SITE_CODE = ? AND TRAN_DATE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, loginSiteCode);
......@@ -429,7 +446,7 @@ public class StatusChangeRequest implements Schedule {
interfaceHmap.put("IN_OUT", "B");
interfaceHmap.put("REF_SER", "PSCAN");
interfaceHmap.put("REF_ID", tranId);
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(today)));
interfaceHmap.put("TRAN_DATE", checkNullAndTrim(String.valueOf(getCurrtDate())));
interfaceHmap.put("LOT_NO", lotNo);
interfaceHmap.put("LOT_SL", lotSl);
interfaceHmap.put("QUANTITY", "");
......@@ -464,7 +481,11 @@ public class StatusChangeRequest implements Schedule {
{
commonWmsUtility.updateAwmsInterface(interfaceArrList,loginSiteCode,conn);
}
}
else
{
System.out.println("***************Stock Count Activty is already already runn today************");
}
}
catch(Exception e)
{
......@@ -493,6 +514,8 @@ public class StatusChangeRequest implements Schedule {
if(rs != null){rs.close();rs=null;}
if(pstmtPhyscan != null){pstmtPhyscan.close();pstmtPhyscan=null;}
if(rsPhyscan != null){rsPhyscan.close();rsPhyscan=null;}
if(pstmtInterface != null){pstmtInterface.close();pstmtInterface=null;}
if(rsInterface != null){rsInterface.close();rsInterface=null;}
}
catch(Exception se)
{
......
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