Commit e9259814 authored by msharma's avatar msharma

Remove Campaign no. condition and make common for all cases


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98203 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 40f1c0d3
......@@ -549,8 +549,6 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
retTabSepStrBuff.append("<remarks>").append("<![CDATA[" + remarks +"]]>").append("</remarks>");
reasCode = disCommon .getDisparams("999999","DEFAULT_REAS_CODE",conn);
retTabSepStrBuff.append("<reas_code>").append("<![CDATA[" + checkNull(reasCode) +"]]>").append("</reas_code>");
retTabSepStrBuff.append("<loc_code>").append("<![CDATA[" + rs.getString("loc_code") +"]]>").append("</loc_code>");
......@@ -1334,9 +1332,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
}
xmlBuff.append("<REF_SER__FOR><![CDATA[" + "W-ORD" +"]]></REF_SER__FOR>");
// 02/07/15 Manoharan
if (reasCode == null || "null".equals(reasCode) || reasCode.trim().length() == 0)
if (reasCode == null || "null".equals(reasCode))
{
reasCode = disCommon .getDisparams("999999","DEFAULT_REAS_CODE",connOne);
reasCode = "";
}
// end 02/07/15 Manoharan
xmlBuff.append("<reas_code><![CDATA[" + reasCode+" ]]></reas_code>");
......@@ -1401,7 +1399,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
" and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? ";*/
//sql changed by sagar on 28/04/15.
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,exp_lev "+
" 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')) "+
" and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? "
......@@ -1431,6 +1429,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
hashMap.put("loc_code__fr",rs.getString("loc_code"));
hashMap.put("exp_lev",rs.getString("exp_lev"));
System.out.println("Calling DistStkUpdEJB....."+ddlg);
if (distStkUpd.updAllocTrace(hashMap, connOne) > 0)
{
......@@ -1465,6 +1465,8 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
hashMap.put("loc_code__fr",locCodeFr);
hashMap.put("exp_lev",explev);
//Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB.....");
......@@ -1528,38 +1530,22 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
}
// code for by cpatil for supreme on 16/04/15 for multiple issue start
// Changed by Manoj dtd 06/07/2015 Remove Campaign no. condition and make common for all cases
System.out.println("Remove Campaign no. condition and make common for all cases");
System.out.println("@@@cpatil::campNo["+campNo+"]tranId["+tranId+"]lineno["+lineno+"]siteCode["+siteCode+"]itemCode["+itemCode+"]lotno["+lotno+"]lotsl["+lotsl+"]allocQty["+allocQty+"]reasCode["+reasCode+"]locCodeFr["+locCodeFr+"]explev["+explev+"]locCodeTo["+locCodeTo+"]worder["+worder+"]tranIdInvAlloc["+tranIdInvAlloc+"]actualPropQty["+actualPropQty+"]actualQty["+actualQty+"]batchQuantity["+batchQuantity+"]");
boolean campFlag= false;
if(campNo != null && campNo.trim().length() > 0)
{
System.out.println("Campain no found:-["+campNo+"] Directily moving to [locationTo]");
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 = ? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,locCodeTo);
pstmt.setString(2,campNo);
pstmt.setString(3,itemCode);
pstmt.setString(4,lotno);
pstmt.setString(5,lotsl);
pstmt.setString(6,locCodeFr);
pstmt.setString(7,siteCode);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
pstmt = null;
}
else if(campFlag == false)
for(int i=0;i<hashMapList.size();i++)
{
hashMap=(HashMap) hashMapList.get(i);
tranId=(String) hashMap.get("ref_id");
siteCode=(String) hashMap.get("site_code");
itemCode=(String) hashMap.get("item_code");
lotno=(String) hashMap.get("lot_no");
lotsl=(String) hashMap.get("lot_sl");
locCodeFr=(String) hashMap.get("loc_code__fr");
explev=(String) hashMap.get("exp_lev");
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 = ? ";
+ "and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,tranId);
pstmt.setString(2,itemCode);
......@@ -1567,6 +1553,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.setString(4,lotsl);
pstmt.setString(5,locCodeTo);
pstmt.setString(6,siteCode);
pstmt.setString(7,explev);
rs = pstmt.executeQuery();
if ( rs.next() )
{
......@@ -1579,16 +1566,16 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.close();
pstmt = null;
String deAllocated="N";
if( batchQuantity == totWoQty)
if( (batchQuantity == totWoQty) || campflag1)
{
deAllocated="Y";
}
if(count == 0)
{
if( batchQuantity == totWoQty)
if( (batchQuantity == totWoQty) || campflag1)
{
sql = " update inv_alloc_det set loc_code = ? where tran_id = ? 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 = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? and exp_lev=?";
pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,locCodeTo);
pstmt.setString(2,tranId);
......@@ -1597,6 +1584,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
pstmt.setString(5,lotsl);
pstmt.setString(6,locCodeFr);
pstmt.setString(7,siteCode);
pstmt.setString(8,explev);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
......@@ -1732,60 +1720,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(pstmt != null)
pstmt.close();
pstmt = null;
/*double lcToqty=0.0;
sql = " select quantity 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.setString(1,tranId);
pstmt.setString(2,itemCode);
pstmt.setString(3,lotno);
pstmt.setString(4,lotsl);
pstmt.setString(5,locCodeTo);
pstmt.setString(6,siteCode);
rs = pstmt.executeQuery();
if ( rs.next() )
{
lcToqty = rs.getDouble(1);
}
if(rs != null)
rs.close();
rs = null;
if(pstmt != null)
pstmt.close();
pstmt = null;*/
// comment and modify below by cpatil on 16/04/15
/*sql = "update inv_alloc_det set quantity = ? ,ISSUE_QTY = ? where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(lcToqty + actualPropQty));
pstmt.setDouble(2,(lcToqty + actualPropQty));
pstmt.setString(3,tranId);
pstmt.setString(4,itemCode);
pstmt.setString(5,lotno);
pstmt.setString(6,lotsl);
pstmt.setString(7,locCodeTo);
pstmt.setString(8,siteCode);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
pstmt = null;*/
/*Commented by manoj dtd 20/05/2015
sql = " update inv_alloc_det set quantity = ? , alloc_qty = ? " +
" where tran_id = ? and item_code = ? and lot_no = ? and lot_sl = ? and loc_code = ? and site_code = ? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setDouble(1,(lcToqty + actualPropQty));
pstmt.setDouble(2,(lcToqty + actualPropQty));
pstmt.setString(3,tranId);
pstmt.setString(4,itemCode);
pstmt.setString(5,lotno);
pstmt.setString(6,lotsl);
pstmt.setString(7,locCodeTo);
pstmt.setString(8,siteCode);
pstmt.executeUpdate();
if(pstmt != null)
pstmt.close();
pstmt = null;*/
}
}
......
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