Commit 7762ecc6 authored by vkadam's avatar vkadam

Add exp_level as parameter during Insert and update of inv_alloc_det.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97995 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e9fccea3
...@@ -190,6 +190,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -190,6 +190,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
} }
if(campNo != null && campNo.trim().length() > 0) if(campNo != null && campNo.trim().length() > 0)
{ {
System.out.println("Comp no what i Found :- ["+campNo+"]");
sql = "select sum(quantity) from workorder where CAMPGN_NO = ? "; sql = "select sum(quantity) from workorder where CAMPGN_NO = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,campNo); pstmt.setString(1,campNo);
...@@ -978,7 +979,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -978,7 +979,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if((Double.parseDouble(df.format(actualQty - trfedQty)) >= Double.parseDouble(df.format(allocQty2))) || (Double.parseDouble(df.format(allocQty2 - actualPropQty)) <= integralQty)) if((Double.parseDouble(df.format(actualQty - trfedQty)) >= Double.parseDouble(df.format(allocQty2))) || (Double.parseDouble(df.format(allocQty2 - actualPropQty)) <= integralQty))
{ {
errString = allocStockToWo(campNo,tranId,lineno,siteCode,itemCode,lotno,lotsl,allocQty,reasCode,locCodeFr,explev,locCodeTo,worder,remarks,tranId,actualPropQty,actualQty,batchQuantity,xtraParams,connOne); errString = allocStockToWo(campNo,tranId,lineno,siteCode,itemCode,lotno,lotsl,allocQty,reasCode,locCodeFr,
explev,locCodeTo,worder,remarks,tranId,actualPropQty,actualQty,batchQuantity,xtraParams,connOne);
System.out.println("err String from STOCKTRANS ="+errString); System.out.println("err String from STOCKTRANS ="+errString);
} }
} }
...@@ -1239,7 +1241,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1239,7 +1241,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql1 = "select acct_code__inv, cctr_code__inv,qty_per_art from stock where item_code = ? and site_code = ? and loc_code = ? and lot_no = ? and lot_sl = ? "; sql1 = "select acct_code__inv, cctr_code__inv,qty_per_art from stock where item_code = ? and site_code = ? and loc_code = ?"
+ " and lot_no = ? and lot_sl = ? ";
pstmt = connOne.prepareStatement(sql1); pstmt = connOne.prepareStatement(sql1);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
pstmt.setString(2,siteCode); pstmt.setString(2,siteCode);
...@@ -1394,7 +1397,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1394,7 +1397,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
sql = "select tran_id,line_no,item_code,lot_no,lot_sl,loc_code, quantity "+ sql = "select tran_id,line_no,item_code,lot_no,lot_sl,loc_code, quantity "+
" from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE "+ " from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE "+
" WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "+ " WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "+
" and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? and case when deallocated is null then 'N' else deallocated end = 'N' "; " and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? "
+ "and case when deallocated is null then 'N' else deallocated end = 'N' ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,campNo); pstmt.setString(1,campNo);
...@@ -1522,8 +1526,12 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1522,8 +1526,12 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
boolean campFlag= false; boolean campFlag= false;
if(campNo != null && campNo.trim().length() > 0) if(campNo != null && campNo.trim().length() > 0)
{ {
System.out.println("Campain no found:-["+campNo+"] Directily moving to [locationTo]");
campFlag = true; campFlag = true;
sql = " update inv_alloc_det set loc_code = ? where tran_id in ( SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? )) and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; sql = " update inv_alloc_det set loc_code = ? where tran_id in ("
+ " SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER IN ("
+ "SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? ))"
+ " and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,locCodeTo); pstmt.setString(1,locCodeTo);
pstmt.setString(2,campNo); pstmt.setString(2,campNo);
...@@ -1542,7 +1550,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1542,7 +1550,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
{ {
int count = 0,recIn=0 ; int count = 0,recIn=0 ;
sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; sql = " select count(*) from inv_alloc_det where tran_id = ? and item_code = ? and lot_no = ? "
+ "and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
pstmt.setString(2,itemCode); pstmt.setString(2,itemCode);
...@@ -1603,7 +1612,10 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1603,7 +1612,10 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql="update inv_alloc_det set quantity=quantity-?,alloc_qty=alloc_qty-?,DEALLOC_QTY=DEALLOC_QTY+? where tran_id=? and site_code=? and item_code=? and lot_no=? and lot_sl=? and loc_code=?";
sql="update inv_alloc_det set quantity=quantity-?,alloc_qty=alloc_qty-?,DEALLOC_QTY=DEALLOC_QTY+? "
+ "where tran_id=? and site_code=? and item_code=? and lot_no=? and lot_sl=? and loc_code=?"
+ " AND EXP_LEV=?"; // VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,actualPropQty); pstmt.setDouble(1,actualPropQty);
pstmt.setDouble(2,actualPropQty); pstmt.setDouble(2,actualPropQty);
...@@ -1614,12 +1626,14 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1614,12 +1626,14 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.setString(7,lotno); pstmt.setString(7,lotno);
pstmt.setString(8,lotsl); pstmt.setString(8,lotsl);
pstmt.setString(9,locCodeFr); pstmt.setString(9,locCodeFr);
pstmt.setString(10,explev);// VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " Insert into inv_alloc_det(TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE,LOT_NO,LOT_SL,QUANTITY,REMARKS,REAS_CODE,LOC_CODE,EXP_LEV,ALLOC_QTY)" + sql = " Insert into inv_alloc_det(TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE,LOT_NO,LOT_SL,QUANTITY,REMARKS,REAS_CODE,"
+ "LOC_CODE,EXP_LEV,ALLOC_QTY)" +
" values (?,?,?,?,?,?,?,?,?,?,?,?)"; " values (?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
...@@ -1674,7 +1688,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1674,7 +1688,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
sql = " update inv_alloc_det set quantity = quantity-? ,alloc_qty=alloc_qty-? , " + sql = " update inv_alloc_det set quantity = quantity-? ,alloc_qty=alloc_qty-? , " +
" DEALLOC_QTY = DEALLOC_QTY+? , DEALLOCATED = '"+deAllocated+"' " + " DEALLOC_QTY = DEALLOC_QTY+? , DEALLOCATED = '"+deAllocated+"' " +
" where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; " where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "
+ "AND EXP_LEV=?";//VALLABH KADAM add [EXP_LEV] 21/MAY/15
System.out.println(" SQL::update"+sql); System.out.println(" SQL::update"+sql);
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,actualPropQty); pstmt.setDouble(1,actualPropQty);
...@@ -1686,13 +1701,15 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1686,13 +1701,15 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.setString(7,lotsl); pstmt.setString(7,lotsl);
pstmt.setString(8,locCodeFr); pstmt.setString(8,locCodeFr);
pstmt.setString(9,siteCode); pstmt.setString(9,siteCode);
pstmt.setString(10,explev);// VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " update inv_alloc_det set quantity = quantity+? , alloc_qty = alloc_qty+? " + sql = " update inv_alloc_det set quantity = quantity+? , alloc_qty = alloc_qty+? " +
" where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "; " where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? "
+ "AND EXP_LEV=?";//VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt = connOne.prepareStatement(sql); pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(actualPropQty)); pstmt.setDouble(1,(actualPropQty));
pstmt.setDouble(2,(actualPropQty)); pstmt.setDouble(2,(actualPropQty));
...@@ -1702,6 +1719,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1702,6 +1719,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.setString(6,lotsl); pstmt.setString(6,lotsl);
pstmt.setString(7,locCodeTo); pstmt.setString(7,locCodeTo);
pstmt.setString(8,siteCode); pstmt.setString(8,siteCode);
pstmt.setString(9,explev);// VALLABH KADAM add [EXP_LEV] 21/MAY/15
pstmt.executeUpdate(); pstmt.executeUpdate();
if(pstmt != null) if(pstmt != null)
pstmt.close(); pstmt.close();
......
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