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 ...@@ -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" /*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 = ?" +" 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";*/ + "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 " +" FROM DISTORD_ISSDET D,DISTORD_ISS H,STOCK S "
+" WHERE D.TRAN_ID = H.TRAN_ID AND H.CONFIRMED = 'N' AND D.DIST_ORDER = ?" +" 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" +" 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 ...@@ -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.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"; + " 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); pstmtQc = conn.prepareStatement(sqlQc);
} }
else if("PR".equalsIgnoreCase(refSer)) else if("PR".equalsIgnoreCase(refSer))
...@@ -397,11 +398,14 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -397,11 +398,14 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("Before location code TO is=["+locCodeTo+"]"); System.out.println("Before location code TO is=["+locCodeTo+"]");
pstmtQc.setString(1, siteCode); /*pstmtQc.setString(1, siteCode);
pstmtQc.setString(2, locCodeFrom); pstmtQc.setString(2, locCodeFrom);
pstmtQc.setString(3, itemCode); pstmtQc.setString(3, itemCode);
pstmtQc.setString(4, lotNo); 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(); rsQc = pstmtQc.executeQuery();
if(rsQc.next()) if(rsQc.next())
{ {
...@@ -431,6 +435,7 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -431,6 +435,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
{ {
locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE")); locCodeFrom = checkNullAndTrim(rs.getString("LOC_CODE"));
allocQty = rs.getDouble("ALLOC_QTY"); 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)) if(countDso == 0 && "D-SO".equalsIgnoreCase(refSer))
{ {
...@@ -462,31 +467,35 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -462,31 +467,35 @@ public class ScheduleAWMSInOutTasks implements Schedule
System.out.println("UPdate in stock transfer det="+updCnt); System.out.println("UPdate in stock transfer det="+updCnt);
pstmtDet.clearParameters(); 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))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)) 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("PR".equalsIgnoreCase(refSer) || "PRS".equalsIgnoreCase(refSer) || "D-SO".equalsIgnoreCase(refSer))
{ {
System.out.println("Going for Allocation location code from for PR/PRS"); if((quantity-allocQty) > 0)
HashMap hashMap = new HashMap(); {
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis())); System.out.println("Going for Allocation location code from for PR/PRS");
hashMap.put("ref_ser",refSer); HashMap hashMap = new HashMap();
hashMap.put("ref_id", refId);//Changed by wasim on 03-12-2015 from tranId to refId. hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_line", lineNoInterface);//Changed by wasim on 03-12-2015 from stringValueof to normal hashMap.put("ref_ser",refSer);
hashMap.put("item_code", itemCode); hashMap.put("ref_id", refId);//Changed by wasim on 03-12-2015 from tranId to refId.
hashMap.put("site_code", siteCode); hashMap.put("ref_line", lineNoInterface);//Changed by wasim on 03-12-2015 from stringValueof to normal
hashMap.put("loc_code",locCodeFrom); hashMap.put("item_code", itemCode);
hashMap.put("lot_no",lotNo); hashMap.put("site_code", siteCode);
hashMap.put("lot_sl",lotSl); hashMap.put("loc_code",locCodeFrom);
hashMap.put("alloc_qty", (quantity-allocQty));//Changed by wasim on 03-12-2015 to allocate quantity which is remaining hashMap.put("lot_no",lotNo);
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI"); hashMap.put("lot_sl",lotSl);
hashMap.put("chg_user", userId); hashMap.put("alloc_qty", (quantity-allocQty));//Changed by wasim on 03-12-2015 to allocate quantity which is remaining
hashMap.put("chg_term", chgTerm); hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", userId);
distStkUpd = getComponent("DistStkUpd"); hashMap.put("chg_term", chgTerm);
if (distStkUpd.updAllocTrace(hashMap, conn) > 0)
{ distStkUpd = getComponent("DistStkUpd");
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!"); if (distStkUpd.updAllocTrace(hashMap, conn) > 0)
} {
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
}
}
} }
//Changed by wasim on 17-11-2015 to allocate quantity to location code to //Changed by wasim on 17-11-2015 to allocate quantity to location code to
//else if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer)) //else if("D-SO".equalsIgnoreCase(refSer) || "S-ORD".equalsIgnoreCase(refSer))
...@@ -568,7 +577,8 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -568,7 +577,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1) 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] //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); 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. 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 ...@@ -606,7 +616,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
if( errString != null && errString.indexOf( "CONFSUCC" ) > -1) 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); System.out.println("Return from alloc To="+errString);
if(errString != null && (errString.indexOf("CONFSTKSUCC") > -1)) if(errString != null && (errString.indexOf("CONFSTKSUCC") > -1))
...@@ -651,8 +662,9 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -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 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(); conn.commit();
System.out.println("Stock Transfer for D-SO completed successfully and committed");
} }
} }
else else
...@@ -3873,7 +3885,8 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -3873,7 +3885,8 @@ public class ScheduleAWMSInOutTasks implements Schedule
} }
return (currDate); 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 = ""; String result = "",locCodeTo = "",sqlUpdate = "",tranIdList = "";
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
...@@ -3884,7 +3897,7 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -3884,7 +3897,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
try try
{ {
System.out.println("Inside allocStockLocCodeTo"); System.out.println("Inside allocStockLocCodeTo");
System.out.println("Count DSO="+countDso); //System.out.println("Count DSO="+countDso);
Iterator itr = stkList.iterator(); Iterator itr = stkList.iterator();
System.out.println("Array List size="+stkList.size()); System.out.println("Array List size="+stkList.size());
...@@ -3902,7 +3915,7 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -3902,7 +3915,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
count++; count++;
} }
if("D-SO".equalsIgnoreCase(refSer) && countDso == 0) /*if("D-SO".equalsIgnoreCase(refSer) && countDso == 0)
{ {
locCodeTo = distComm.getDisparams("999999",refSer,conn); locCodeTo = distComm.getDisparams("999999",refSer,conn);
...@@ -3934,7 +3947,7 @@ public class ScheduleAWMSInOutTasks implements Schedule ...@@ -3934,7 +3947,7 @@ public class ScheduleAWMSInOutTasks implements Schedule
int upctr = pstmt.executeUpdate(); int upctr = pstmt.executeUpdate();
System.out.println("NO OF ROW UPDATED = "+upctr); System.out.println("NO OF ROW UPDATED = "+upctr);
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
} }*/
} }
catch(Exception e) 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