Commit 821b2cbd authored by wansari's avatar wansari

W15GSUN003 updated changes for inventory hold


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98949 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 059e6ee1
......@@ -237,8 +237,6 @@ public class ScheduleAWMSInOutTasks implements Schedule
HashMap hashMap = new HashMap();
java.sql.Timestamp currDate = new java.sql.Timestamp( System.currentTimeMillis() );
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
chgTerm = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgTerm" );
......@@ -247,13 +245,16 @@ public class ScheduleAWMSInOutTasks implements Schedule
DistStkUpdLocal distStkUpd = null;
ArrayList lineNoList = new ArrayList();
ArrayList tranIdList = new ArrayList();
boolean isRecordExist = false;
try
{
System.out.println("Inside stock transfer");
java.sql.Timestamp currDate = getCurrtDate();
System.out.println("Current date for stock transfer is"+currDate);
SimpleDateFormat sdfAppl = new SimpleDateFormat(genericUtility.getApplDateFormat());
String currDateStr = sdfAppl.format(currDate);
......@@ -302,8 +303,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
rsInterface = pstmtInterface.executeQuery();
while(rsInterface.next())
{
isRecordExist = true;
//isRecordExist = false;
lineNoInterface = rsInterface.getString("LINE_NO");
lineNoInterface = " " + lineNoInterface;
......@@ -342,6 +342,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
rs = pstmt.executeQuery();
while(rs.next())
{
isRecordExist = true;
itemCode = checkNullAndTrim(rs.getString("ITEM_CODE"));
quantity = rs.getDouble("QUANTITY");
lotNo = checkNullAndTrim(rs.getString("LOT_NO"));
......@@ -423,23 +424,66 @@ public class ScheduleAWMSInOutTasks implements Schedule
int caseCount = pstmtUpdate.executeUpdate();
System.out.println("Updated ="+caseCount);
pstmtUpdate.close();pstmtUpdate = null;
headerFlag = false;
}
//pstmtDet.executeBatch();
//pstmtDet.clearBatch();
pstmt.close();pstmt = null;
rs.close();rs = null;
if("PR".equalsIgnoreCase(refSer))
{
System.out.println(" created successfully PR Case---------------["+tranID+"]refId["+refId);
headerFlag = true;
//tranIdList.add(tranID);
StockTransferConf stkConfAdd = new StockTransferConf();
errString = stkConfAdd.confirm(tranID, xtraParams, "", conn, false);
System.out.println("Stock transfer confirm for ===============PR="+errString);
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
System.out.println("Stock Transfer confirmed successfully------------");
conn.commit();
}
else
{
conn.rollback();
}
}
//pstmtDet.executeBatch();
//pstmtDet.clearBatch();
}
pstmtInterface.close();pstmtInterface = null;
rsInterface.close();rsInterface = null;
if(isRecordExist)
/*
Iterator itr = tranIdList.iterator();
StockTransferConf stkConfAdd = new StockTransferConf();
String pID = "";
System.out.println("REF SER------------"+refSer);
System.out.println("tranIdList------------"+tranIdList.toString());
while(itr.hasNext())
{
pID = (String)itr.next();
System.out.println(" Tran ID------["+pID+"]");
errString = stkConfAdd.confirm(pID, xtraParams, "", conn, false);
System.out.println(" issue created successfully------errString------["+errString+"]");
if( errString != null && errString.indexOf( "VTCONPARM" ) > -1)
{
System.out.println(" issue created successfully-------------");
conn.commit();
}
else
{
conn.rollback();
}
}*/
if(isRecordExist && !"PR".equalsIgnoreCase(refSer))
{
System.out.println("Inside record exist block------------");//CONFSUCC
StockTransferConf stkConf = new StockTransferConf();
errString = stkConf.confirm(tranID, xtraParams, "", conn, false);
System.out.println("Return String from stock transfer="+errString);//CONFSUCC
System.out.println("Return String from stock transfer===="+errString);//CONFSUCC
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
......@@ -459,7 +503,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "VTCONPARM" ) > -1)
{
System.out.println("Despatch/Dist issue created successfully");
System.out.println("Despatch/Dist issue created successfully---------");
conn.commit();
}
else
......@@ -494,6 +538,10 @@ public class ScheduleAWMSInOutTasks implements Schedule
throw new Exception (errString);
}
}
/*else
{
conn.rollback();
}*/
}
catch(Exception e)
{
......@@ -527,8 +575,6 @@ public class ScheduleAWMSInOutTasks implements Schedule
String refSer = "",refId = "",itemCode = "",locCode = "",lotNo = "",lotSl = "";
java.sql.Timestamp currDate = new java.sql.Timestamp( System.currentTimeMillis() );
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
chgTerm = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgTerm" );
......@@ -540,6 +586,9 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
System.out.println("Inside inventory hold");
java.sql.Timestamp currDate = getCurrtDate();
System.out.println("Current date for inventory hold is"+currDate);
lockCode = distComm.getDisparams("999999",lockCodeName,conn);
System.out.println("Lock code is ="+lockCode);
......@@ -568,14 +617,14 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
sql = "SELECT P.ITEM_CODE,P.LOT_NO,P.LOT_SL,"
+ " P.LOC_CODE,P.SITE_CODE,P.PALLET_NO FROM PALLET_DET P,STOCK S WHERE TRAN_ID = ? AND P.LINE_NO = ?"
+ " AND P.ITEM_CODE = S.ITEM_CODE AND P.SITE_CODE = S.SITE_CODE"
+ " AND P.ITEM_CODE = S.ITEM_CODE AND P.SITE_CODE = S.SITE_CODE AND S.QUANTITY > 0"
+ " AND P.LOC_CODE = S.LOC_CODE AND P.LOT_NO = S.LOT_NO AND P.LOT_SL = S.LOT_SL";
}
else if("PR".equalsIgnoreCase(refSer))
{
sql = "SELECT S.ITEM_CODE,S.LOT_NO,S.LOT_SL,S.LOC_CODE,"+
" S.SITE_CODE FROM STOCK S,PALLET_REQ_DET P WHERE S.LOC_CODE = P.PALLET_NO AND S.INV_STAT = 'AWMS'" +
" AND P.TRAN_ID = ? AND P.LINE_NO = ?";
" AND P.TRAN_ID = ? AND P.LINE_NO = ? AND S.QUANTITY > 0";
}
pstmt = conn.prepareStatement(sql);
......@@ -3302,4 +3351,24 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
return input;
}
private java.sql.Timestamp getCurrtDate() throws RemoteException,ITMException
{
String currAppdate = "";
java.sql.Timestamp currDate = null;
try
{
Object date = null;
currDate = new java.sql.Timestamp(System.currentTimeMillis());
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(genericUtility.getDBDateFormat());
date = sdf.parse(currDate.toString());
currDate = java.sql.Timestamp.valueOf(sdf.format(date).toString()+ " 00:00:00.0");
}
catch (Exception e)
{
throw new ITMException(e);
}
return (currDate);
}
}
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