Commit fa7b35b7 authored by vhegde's avatar vhegde

Changed by sankara on 09/05/14 updated...

Changed by sankara on 09/05/14 updated DeallocArtConf,DockTranPos,PoRcpPos,ReplIssIc,WaveCancelEJB for wms bugs


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95052 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f0e01aa5
...@@ -13,6 +13,7 @@ import ibase.webitm.ejb.fin.*; ...@@ -13,6 +13,7 @@ import ibase.webitm.ejb.fin.*;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.*; import java.util.*;
import java.util.Date;
import java.text.*; import java.text.*;
import java.sql.*; import java.sql.*;
......
...@@ -34,7 +34,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -34,7 +34,9 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
{ {
return ""; return "";
} }
public String postSave(String domString, String tranId,String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException //Changed By Pragyan 09-MAY-14 to Take Local connection
//public String postSave(String domString, String tranId,String editFlag, String xtraParams, Connection conn ) throws RemoteException,ITMException
public String postSave(String domString, String tranId,String editFlag, String xtraParams, Connection conn1 ) throws RemoteException,ITMException
{ {
System.out.println( "Calling DockTranPos.........................................." ); System.out.println( "Calling DockTranPos.........................................." );
...@@ -70,7 +72,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -70,7 +72,7 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
InvAllocTraceBean invAllocTrace = null; InvAllocTraceBean invAllocTrace = null;
HashMap strAllocate = null; HashMap strAllocate = null;
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
stagingLoc = distCommon.getDisparams( "999999", "STAGING_LOC", conn ); //stagingLoc = distCommon.getDisparams( "999999", "STAGING_LOC", conn );
stkUpdate = new StockUpdate(); stkUpdate = new StockUpdate();
invAllocTrace = new InvAllocTraceBean(); invAllocTrace = new InvAllocTraceBean();
double stkRate = 0.0,stkGrossRate = 0.0,convQtyStduom = 0.0,batchSize = 0.0; double stkRate = 0.0,stkGrossRate = 0.0,convQtyStduom = 0.0,batchSize = 0.0;
...@@ -93,8 +95,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -93,8 +95,23 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
//Changed By 02/05/13 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end //Changed By 02/05/13 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end
//Changed By Pragyan 09-MAY-14 to Take Local connection.Start
ConnDriver connDriver = null;
Connection conn=null;
try try
{ {
//Changed By Pragyan 09-MAY-14 to Take Local connection.Start
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverValidator");
if(conn==null)
{
System.out.println("Connection is null");
return "";
}
stagingLoc = distCommon.getDisparams( "999999", "STAGING_LOC", conn );
//Changed By Pragyan 09-MAY-14 to Take Local connection.end
updateRowMap = new HashMap() ; updateRowMap = new HashMap() ;
String applDateFormat = genericUtility.getApplDateFormat(); String applDateFormat = genericUtility.getApplDateFormat();
String dbDateFormat = genericUtility.getDBDateFormat(); String dbDateFormat = genericUtility.getDBDateFormat();
...@@ -862,7 +879,18 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT ...@@ -862,7 +879,18 @@ public class DockTranPos extends ValidatorEJB implements DockTranPosLocal, DockT
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception "+e.getMessage()); System.out.println("Exception before rollback "+e.getMessage());
try
{
conn.rollback();
}
catch (SQLException e1)
{
e1.printStackTrace();
}
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
......
...@@ -665,7 +665,12 @@ public class PoRcpPos extends ValidatorEJB implements PoRcpPosLocal, PoRcpPosRem ...@@ -665,7 +665,12 @@ public class PoRcpPos extends ValidatorEJB implements PoRcpPosLocal, PoRcpPosRem
pstmt1 = null; pstmt1 = null;
} }
} }
//Changed By Pragyan 09-MAY-14 To return previous message for quantity mismatch.start
else
{
return errString = itmDBAccessEJB.getErrorString("","VTNTCNF","");
}
//Changed By Pragyan 09-MAY-14 To return previous message for quantity mismatch.end
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -509,8 +509,12 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC ...@@ -509,8 +509,12 @@ public class ReplIssIC extends ValidatorEJB implements ReplIssICLocal, ReplIssIC
pickOrder = checkNull(genericUtility.getColumnValue( "REPL_ORDER", currFormDataDom )); pickOrder = checkNull(genericUtility.getColumnValue( "REPL_ORDER", currFormDataDom ));
//Changed By Pragyan 08-May-14 to check the cancel mode for hold stocks
/*sql = " select count (*) from stock where (item_code, site_code, loc_code, lot_no, lot_sl ) in " +
" ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? ) and ( hold_qty > 0 ) ";*/
sql = " select count (*) from stock where (item_code, site_code, loc_code, lot_no, lot_sl ) in " + sql = " select count (*) from stock where (item_code, site_code, loc_code, lot_no, lot_sl ) in " +
" ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? ) and ( hold_qty > 0 ) "; " ( select item_code, site_code, loc_code, lot_no, lot_sl from repl_ord_det where repl_order = ? " +
" and case when cancel_mode is null then 'N' else cancel_mode end <> 'Y') and ( hold_qty > 0 )";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,replOrder); pstmt.setString(1,replOrder);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
......
...@@ -46,7 +46,8 @@ import com.adsionline.ADSIShippingWS.StringReturn; ...@@ -46,7 +46,8 @@ import com.adsionline.ADSIShippingWS.StringReturn;
public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLocal, WaveCancelEJBRemote public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLocal, WaveCancelEJBRemote
{ {
HashMap<String,String> replHashMap = new HashMap<String,String>(); HashMap<String,String> replHashMap = new HashMap<String,String>();
HashMap<String,String> manStkReplMap = new HashMap<String,String>(); //changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel
//HashMap<String,String> manStkReplMap = new HashMap<String,String>();
/** /**
* The public method is used for confirming the service complaint transaction * The public method is used for confirming the service complaint transaction
* Returns confirmation message on successfull confirm otherwise returns error message * Returns confirmation message on successfull confirm otherwise returns error message
...@@ -195,9 +196,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -195,9 +196,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
ResultSet rsMan1 = null; ResultSet rsMan1 = null;
repalnishmentOrd = replOrder; repalnishmentOrd = replOrder;
repalnishmentline = replLineNo; repalnishmentline = replLineNo;
boolean isManualReplMap = false; //changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel
//boolean isManualReplMap = false;
boolean isManualStock = false; boolean isManualStock = false;
manStkReplMap.clear(); //changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel
//manStkReplMap.clear();
PreparedStatement pstmtTask = null; PreparedStatement pstmtTask = null;
ResultSet rsTask = null; ResultSet rsTask = null;
PreparedStatement pstmtInv = null; PreparedStatement pstmtInv = null;
...@@ -397,9 +400,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -397,9 +400,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
replOrder = checkNull( rsPick.getString("REPL_ORDER") ); replOrder = checkNull( rsPick.getString("REPL_ORDER") );
replLineNo = checkNull( rsPick.getString("LINE_NO") ); replLineNo = checkNull( rsPick.getString("LINE_NO") );
} }
//changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel start.
//Creating map of repanishment which contains manual repanishment.start //Creating map of repanishment which contains manual repanishment.start
if(!isManualReplMap) /*if(!isManualReplMap)
{ {
System.out.println("*******going for populating Manual Map*************"); System.out.println("*******going for populating Manual Map*************");
sqlMan1 = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? "; sqlMan1 = "SELECT PICK_ORDER,LINE_NO__PICK FROM REPL_ORD_DET WHERE REPL_ORDER = ? AND LINE_NO = ? ";
...@@ -453,9 +456,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -453,9 +456,11 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
if(isManualReplMap) if(isManualReplMap)
{ {
isManualStock = isManualAllocStock(saleOrder,lineNoSord,conn); isManualStock = isManualAllocStock(saleOrder,lineNoSord,conn);
} } */
isManualStock = isManualAllocStock(saleOrder,lineNoSord,conn);
System.out.println("isManualStock:::"+isManualStock); System.out.println("isManualStock:::"+isManualStock);
//changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel end
//Changed by Rohan on 22-01-13 to cancle independent Repanishment.start //Changed by Rohan on 22-01-13 to cancle independent Repanishment.start
/* /*
...@@ -470,7 +475,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -470,7 +475,9 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
System.out.println("Quantity"+quantity+"refSer"+refSer); System.out.println("Quantity"+quantity+"refSer"+refSer);
//Changed by Rohan on 01-08-13 to check sale order line item is manually allocate.If stk is manual allocate then do not deallacate qty for line item. //Changed by Rohan on 01-08-13 to check sale order line item is manually allocate.If stk is manual allocate then do not deallacate qty for line item.
//if(quantity > 0 || !(refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO"))) //if(quantity > 0 || !(refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO")))
if((quantity > 0 || !(refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO"))) && !isManualStock) //changed by sankara on 08/05/14 for manual stock alloc case wave_cancel update in repl ord det
//if((quantity > 0 || !(refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO"))) && !isManualStock)
if((quantity > 0 || !(refSer.trim().equalsIgnoreCase("S-DOC") || refSer.equalsIgnoreCase("RP-PND") || refSer.equalsIgnoreCase("RP-PSO"))) )
{ {
/*if(!refSer.trim().equalsIgnoreCase("S-DOC") && !refSer.equalsIgnoreCase("RP-PND") && !refSer.equalsIgnoreCase("RP-PSO")) /*if(!refSer.trim().equalsIgnoreCase("S-DOC") && !refSer.equalsIgnoreCase("RP-PND") && !refSer.equalsIgnoreCase("RP-PSO"))
{ {
...@@ -849,77 +856,80 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -849,77 +856,80 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
// 22/02/10 manoharan if allocation found in sordalloc then deallocate // 22/02/10 manoharan if allocation found in sordalloc then deallocate
//if (count > 0 ) // 04/04/12 manoharan //if (count > 0 ) // 04/04/12 manoharan
System.out.println("qtyAlloc["+qtyAlloc+"]"); System.out.println("qtyAlloc["+qtyAlloc+"]");
if (qtyAlloc > 0) // 04/04/12 manoharan //changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel in manual tock alloc
if(!isManualStock)
{ {
if (qtyAlloc - qtyStduom <= 0) if (qtyAlloc > 0) // 04/04/12 manoharan
{ {
sqlSord = "DELETE FROM SORDALLOC WHERE SALE_ORDER = ? " if (qtyAlloc - qtyStduom <= 0)
+"AND LINE_NO = ? " {
+"AND EXP_LEV = ? " sqlSord = "DELETE FROM SORDALLOC WHERE SALE_ORDER = ? "
+"AND ITEM_CODE__ORD = ? " +"AND LINE_NO = ? "
+"AND ITEM_CODE = ? " +"AND EXP_LEV = ? "
+"AND LOT_NO = ? " +"AND ITEM_CODE__ORD = ? "
+"AND LOT_SL = ? " +"AND ITEM_CODE = ? "
+"AND LOC_CODE = ? "; +"AND LOT_NO = ? "
System.out.println("Delete sql sqlSord :"+sqlSord); +"AND LOT_SL = ? "
pstmt = conn.prepareStatement(sqlSord); +"AND LOC_CODE = ? ";
pstmt.setString(1,saleOrder); System.out.println("Delete sql sqlSord :"+sqlSord);
pstmt.setString(2,lineNoSord); pstmt = conn.prepareStatement(sqlSord);
pstmt.setString(3,expLev); pstmt.setString(1,saleOrder);
pstmt.setString(4,itemCode); pstmt.setString(2,lineNoSord);
pstmt.setString(5,itemCode); pstmt.setString(3,expLev);
pstmt.setString(6,lotNo); pstmt.setString(4,itemCode);
pstmt.setString(7,lotSl); pstmt.setString(5,itemCode);
pstmt.setString(8,locCode); pstmt.setString(6,lotNo);
updateCnt = pstmt.executeUpdate(); pstmt.setString(7,lotSl);
pstmt.close(); pstmt.setString(8,locCode);
pstmt = null; updateCnt = pstmt.executeUpdate();
} pstmt.close();
else pstmt = null;
{ }
sqlSord = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC - ? " else
+"WHERE SALE_ORDER = ? " {
+"AND LINE_NO = ? " sqlSord = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC - ? "
+"AND EXP_LEV = ? " +"WHERE SALE_ORDER = ? "
+"AND ITEM_CODE__ORD = ? " +"AND LINE_NO = ? "
+"AND ITEM_CODE = ? " +"AND EXP_LEV = ? "
+"AND LOT_NO = ? " +"AND ITEM_CODE__ORD = ? "
+"AND LOT_SL = ? " +"AND ITEM_CODE = ? "
+"AND LOC_CODE = ? "; +"AND LOT_NO = ? "
System.out.println("Update sql sqlSord :"+sqlSord); +"AND LOT_SL = ? "
pstmt = conn.prepareStatement(sqlSord); +"AND LOC_CODE = ? ";
System.out.println("Update sql sqlSord :"+sqlSord);
pstmt = conn.prepareStatement(sqlSord);
pstmt.setDouble(1,qtyStduom);
pstmt.setString(2,saleOrder);
pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev);
pstmt.setString(5,itemCode);
pstmt.setString(6,itemCode);
pstmt.setString(7,lotNo);
pstmt.setString(8,lotSl);
pstmt.setString(9,locCode);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records are : updateCnt :"+updateCnt);
}
sqlSordItem = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Update sql sqlSordItem :"+sqlSordItem);
pstmt = conn.prepareStatement(sqlSordItem);
pstmt.setDouble(1,qtyStduom); pstmt.setDouble(1,qtyStduom);
pstmt.setString(2,saleOrder); pstmt.setString(2,saleOrder);
pstmt.setString(3,lineNoSord); pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev); pstmt.setString(4,expLev);
pstmt.setString(5,itemCode);
pstmt.setString(6,itemCode);
pstmt.setString(7,lotNo);
pstmt.setString(8,lotSl);
pstmt.setString(9,locCode);
updateCnt = pstmt.executeUpdate(); updateCnt = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("Updated the no of records are : updateCnt :"+updateCnt); System.out.println("Updated the no of records : updateCnt :"+updateCnt);
}
sqlSordItem = "UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? " line = " " + lineNo;
+"WHERE SALE_ORDER = ? " System.out.println("line :"+line);
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Update sql sqlSordItem :"+sqlSordItem);
pstmt = conn.prepareStatement(sqlSordItem);
pstmt.setDouble(1,qtyStduom);
pstmt.setString(2,saleOrder);
pstmt.setString(3,lineNoSord);
pstmt.setString(4,expLev);
updateCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("Updated the no of records : updateCnt :"+updateCnt);
line = " " + lineNo;
System.out.println("line :"+line);
//Changed by Rohan on 10/8/12 to give proper loc code.start //Changed by Rohan on 10/8/12 to give proper loc code.start
...@@ -968,6 +978,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -968,6 +978,8 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
*/ */
}//qty allocate > 0 }//qty allocate > 0
}//changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel
//Changed by Rohna on 26/03/13 for wave Cancellation error if qty <= 0.start //Changed by Rohna on 26/03/13 for wave Cancellation error if qty <= 0.start
//else //else
//{ //{
...@@ -1723,14 +1735,17 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca ...@@ -1723,14 +1735,17 @@ public class WaveCancelEJB extends ActionHandlerEJB implements WaveCancelEJBLoca
} }
} }
//changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel start.
//Changed by Rohan on 02-08-13 for cheking stock is allocate from manual shipment.start //Changed by Rohan on 02-08-13 for cheking stock is allocate from manual shipment.start
System.out.println("manStkReplMap"+manStkReplMap.toString()+"replOrdOrg["+replOrdOrg+"]replLineOrg["+replLineOrg+"]"); /* System.out.println("manStkReplMap"+manStkReplMap.toString()+"replOrdOrg["+replOrdOrg+"]replLineOrg["+replLineOrg+"]");
if(manStkReplMap.containsKey(replOrdOrg.trim()+":"+replLineOrg.trim())) if(manStkReplMap.containsKey(replOrdOrg.trim()+":"+replLineOrg.trim()))
{ {
isManStk = true; isManStk = true;
System.out.println("************************Manually Stock Allocated************************"); System.out.println("************************Manually Stock Allocated************************");
} }
//Changed by Rohan on 02-08-13 for cheking stock is allocate from manual shipment.end //Changed by Rohan on 02-08-13 for cheking stock is allocate from manual shipment.end
*/
//changed by sankara on 08/05/14 for update calcel_mode in repl_ord_det through wave cancel end.
if(pstmt1 != null) if(pstmt1 != null)
{ {
pstmt1.close(); pstmt1.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