Commit 1d38b880 authored by wansari's avatar wansari

W15GSUN003 updated source for updating loc code function call


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99364 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 407c44ac
......@@ -270,7 +270,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
/*sql = "SELECT D.TRAN_ID,D.ITEM_CODE,D.LINE_NO,D.QUANTITY,D.LOT_NO,D.LOT_SL,D.LOC_CODE,H.SITE_CODE"
+" FROM DISTORD_ISSDET D,DISTORD_ISS H WHERE D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = 'N' AND D.DIST_ORDER = ?"
+ "AND D.LINE_NO = ? AND D.QUANTITY > 0";*/
sql = "SELECT D.TRAN_ID,D.ITEM_CODE,D.LINE_NO,S.QUANTITY,D.LOT_NO,D.LOT_SL,D.LOC_CODE,H.SITE_CODE,S.ALLOC_QTY"
sql = "SELECT D.TRAN_ID,D.ITEM_CODE,D.LINE_NO,S.QUANTITY,D.LOT_NO,D.LOT_SL,D.LOC_CODE,H.SITE_CODE,S.ALLOC_QTY,D.NO_ART"
+" FROM DISTORD_ISSDET D,DISTORD_ISS H,STOCK S "
+" WHERE D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = 'N' AND D.DIST_ORDER = ?"
+" AND D.LINE_NO = ? AND D.QUANTITY > 0 AND S.LOC_CODE = D.LOC_CODE AND S.LOT_NO = D.LOT_NO"
......@@ -294,7 +294,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
+ " AND P.ITEM_CODE = S.ITEM_CODE AND P.SITE_CODE = S.SITE_CODE"
+ " AND P.LOC_CODE = S.LOC_CODE AND P.LOT_NO = S.LOT_NO AND P.LOT_SL = S.LOT_SL AND S.QUANTITY > 0";
sqlQc = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND LOC_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
//sqlQc = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND LOC_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ? AND LOT_SL = ?";
sqlQc = "SELECT STATUS FROM QC_ORDER WHERE SITE_CODE = ? AND ITEM_CODE = ? AND LOT_NO = ?";
pstmtQc = conn.prepareStatement(sqlQc);
}
else if("PR".equalsIgnoreCase(refSer))
......@@ -397,11 +398,14 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("Before location code TO is=["+locCodeTo+"]");
pstmtQc.setString(1, siteCode);
/*pstmtQc.setString(1, siteCode);
pstmtQc.setString(2, locCodeFrom);
pstmtQc.setString(3, itemCode);
pstmtQc.setString(4, lotNo);
pstmtQc.setString(5, lotSl);
pstmtQc.setString(5, lotSl);*/
pstmtQc.setString(1, siteCode);
pstmtQc.setString(2, itemCode);
pstmtQc.setString(3, lotNo);
rsQc = pstmtQc.executeQuery();
if(rsQc.next())
{
......@@ -431,6 +435,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
{
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
allocQty = rs.getDouble("ALLOC_QTY");
noArt = checkNullAndTrim(rs.getString("NO_ART"));//Changed by wasim on 07-12-2015
if(countDso == 0 && "D-SO".equalsIgnoreCase(refSer))
{
......@@ -462,9 +467,12 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("UPdate in stock transfer det="+updCnt);
pstmtDet.clearParameters();
System.out.println("@@Quantity=["+quantity+"]Alloc Qty=["+allocQty+"]");
//if("PR".equalsIgnoreCase(refSer))Changed by wasim on 19-11-2015 to add new ref ser PRS
//if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer)) Changed by wasim on 19-11-2015 to add new ref ser D-SO to allocate stock on from location
if("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "D-SO".equalsIgnoreCase(refSer))
{
if((quantity-allocQty) > 0)
{
System.out.println("Going for Allocation location code from for PR/PRS");
HashMap hashMap = new HashMap();
......@@ -488,6 +496,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
}
}
}
//Changed by wasim on 17-11-2015 to allocate quantity to location code to
//else if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer))
//Changed by wasim on 19-11-2015 to add new ref ser PRS
......@@ -568,7 +577,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
//Changed by wasim on 30-11-2015 to not allow to allocate stock for location code to for PR/PRS [END]
errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);
//errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);//Changed by wasim on 07-12-2015 to allocate stock for any ref ser and removed D-SO update
errString = allocStockLocCodeTo(allocList,conn);
System.out.println("Return from alloc To for PR/PRS="+errString);
allocList.clear();//Changed by wasim on to clear list for PR/PRS as we take pallet one by one for this ref ser.
......@@ -606,7 +616,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1)
{
errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);
//errString = allocStockLocCodeTo(allocList,tranIdIssList,refSer,refId,countDso,conn);//Changed by wasim on 07-12-2015 to allocate stock for any ref ser and removed D-SO update
errString = allocStockLocCodeTo(allocList,conn);
System.out.println("Return from alloc To="+errString);
if(errString != null && (errString.indexOf("CONFSTKSUCC") > -1))
......@@ -651,8 +662,9 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
else if ("D-SO".equalsIgnoreCase(refSer))//D-SO is required if dist_issue already created then only stock transfer will be done
{
System.out.println("Stock Transfer for D-SO completed successfully and committed");
updateLocation(locationList,conn);
conn.commit();
System.out.println("Stock Transfer for D-SO completed successfully and committed");
}
}
else
......@@ -3873,7 +3885,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
}
return (currDate);
}
private String allocStockLocCodeTo(ArrayList stkList,ArrayList tranIdIssList,String refSer,String refId,int countDso,Connection conn) throws ITMException, Exception
//private String allocStockLocCodeTo(ArrayList stkList,ArrayList tranIdIssList,String refSer,String refId,int countDso,Connection conn) throws ITMException, Exception
private String allocStockLocCodeTo(ArrayList stkList,Connection conn) throws ITMException, Exception
{
String result = "",locCodeTo = "",sqlUpdate = "",tranIdList = "";
PreparedStatement pstmt=null;
......@@ -3884,7 +3897,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
try
{
System.out.println("Inside allocStockLocCodeTo");
System.out.println("Count DSO="+countDso);
//System.out.println("Count DSO="+countDso);
Iterator itr = stkList.iterator();
System.out.println("Array List size="+stkList.size());
......@@ -3902,7 +3915,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
count++;
}
if("D-SO".equalsIgnoreCase(refSer) && countDso == 0)
/*if("D-SO".equalsIgnoreCase(refSer) && countDso == 0)
{
locCodeTo = distComm.getDisparams("999999",refSer,conn);
......@@ -3934,7 +3947,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
int upctr = pstmt.executeUpdate();
System.out.println("NO OF ROW UPDATED = "+upctr);
pstmt.close();pstmt = null;
}
}*/
}
catch(Exception e)
{
......
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