Commit 26bb6362 authored by cpatil's avatar cpatil

modify code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95007 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1c96624b
/********************************************************
Title : ShipmentLocICLocal
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
......
/********************************************************
Title : ShipmentLocICRemote
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis; package ibase.webitm.ejb.dis;
......
/********************************************************
Title : RecalFrtAct
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.*; import java.sql.*;
...@@ -35,14 +42,11 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -35,14 +42,11 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
System.out.println("RecalFrtAct called........"); System.out.println("RecalFrtAct called........");
String sql = ""; String sql = "";
String errString = "" ; String errString = "" ;
//String status = "",conf = "";
Connection conn = null; Connection conn = null;
//ConnDriver connDriver = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
System.out.println("tran id = "+tranId); System.out.println("tran id = "+tranId);
//GenericUtility genericUtility = null;
Timestamp sysdate = null; Timestamp sysdate = null;
String confirmed=""; String confirmed="";
ITMDBAccessLocal itmDBAccessLocal = new ITMDBAccessEJB(); ITMDBAccessLocal itmDBAccessLocal = new ITMDBAccessEJB();
...@@ -154,7 +158,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -154,7 +158,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
throws RemoteException, ITMException throws RemoteException, ITMException
{ {
PreparedStatement pstmt = null, pstmt1 = null, pstmtSql = null; PreparedStatement pstmt = null, pstmt1 = null;
ResultSet rs = null,rs1 = null; ResultSet rs = null,rs1 = null;
int cnt = 0,updCnt=0; int cnt = 0,updCnt=0;
String retString = "", sql = "", sql1 = "",errCode = ""; String retString = "", sql = "", sql1 = "",errCode = "";
...@@ -162,16 +166,15 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -162,16 +166,15 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
int sequence=0; int sequence=0;
//String confirmed="",lrNo="",lorryNo="",recallFrt="",despId="",lrNoUpd="",lorryNoUpd="",distOrdIssId="";
double frtAmt=0; double frtAmt=0;
String freightType="",chargesMode="",lineNo="",chargeCodeAdd="",chargeCode="",chargeAdd1="",chargeAdd=""; String freightType="",chargesMode="",lineNo="",chargeCodeAdd="",chargeCode="",chargeAdd1="",chargeAdd="";
double grossWeightDesp=0,grossWeightDist=0,val=0,freightRate=0,minValue=0,addChgs=0,chargeRate=0,tempNetWeight=0,tempNettWeight=0; double grossWeightDesp=0,grossWeightDist=0,val=0,freightRate=0,minValue=0,addChgs=0,chargeRate=0,tempNetWeight=0,tempNettWeight=0;
double grossWeightCIss=0;
try try
{ {
System.out.println("@@@@@@@@@@@@@@@ recalFrtAct method called next.............."); System.out.println("@@@@@@@@@@@@@@@ recalFrtAct method called next..............");
Calendar currentDate = Calendar.getInstance(); Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
...@@ -200,7 +203,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -200,7 +203,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
if("G".equalsIgnoreCase(freightType)) // ls_frt_type = 'G' then if("G".equalsIgnoreCase(freightType)) // ls_frt_type = 'G' then
{ {
sql = " select nvl(sum(gross_weight),0) " + sql = " select nvl(sum(gross_weight),0) " +
// " into :lc_gross " +
" from despatch where shipment_id = ? and confirmed = 'Y' "; " from despatch where shipment_id = ? and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
...@@ -230,18 +232,32 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -230,18 +232,32 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("@@@@@@@@grossWeightDist["+grossWeightDist+"]"); System.out.println("@@@@@@@@grossWeightDist["+grossWeightDist+"]");
// added cpatil for c-iss on 19/04/14
sql = " select nvl(sum(gross_weight),0) from CONSUME_ISS " +
" where cons_issue in ( select ref_id from ship_docs where shipment_id = ? ) and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if( rs.next())
{
grossWeightCIss = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@grossWeightCIss["+grossWeightCIss+"]");
// end cpatil
//lc_val = lc_frt_rate * (lc_gross + lc_gross_dist) //lc_val = lc_frt_rate * (lc_gross + lc_gross_dist)
val = freightRate * ( grossWeightDesp + grossWeightDist ); val = freightRate * ( grossWeightDesp + grossWeightDist + grossWeightCIss ); // added grossWeightCIss for c-iss recalculation
System.out.println("@@@@@@@val["+val+"]minValue["+minValue+"]"); System.out.println("@@@@@@@val["+val+"]minValue["+minValue+"]");
if( val > minValue ) // lc_val > lc_minval then if( val > minValue ) // lc_val > lc_minval then
{ {
//dw_edit.setitem(1,'freight_amt',lc_val)
sql = " update shipment set freight_amt = ? where shipment_id = ? "; sql = " update shipment set freight_amt = ? where shipment_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, val); pstmt.setDouble(1, val);
...@@ -254,8 +270,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -254,8 +270,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
} }
else else
{ {
//dw_edit.setitem(1,'freight_amt',lc_minval)
sql = " update shipment set freight_amt = ? where shipment_id = ? "; sql = " update shipment set freight_amt = ? where shipment_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, minValue); pstmt.setDouble(1, minValue);
...@@ -268,8 +282,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -268,8 +282,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
} //end if } //end if
// lc_add_chgs = dw_edit.GetItemNumber(1,'add_chgs')
sql = " select add_chgs from shipment where shipment_id = ? "; sql = " select add_chgs from shipment where shipment_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -289,8 +301,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -289,8 +301,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
System.out.println("@@@@@@@@ val["+val+"]"); System.out.println("@@@@@@@@ val["+val+"]");
//dw_edit.SetItem(1,"total_freight",lc_val)
sql = " update shipment set total_freight = ? where shipment_id = ? "; sql = " update shipment set total_freight = ? where shipment_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, val); pstmt.setDouble(1, val);
...@@ -302,7 +312,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -302,7 +312,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
} }
else if("F".equalsIgnoreCase(freightType)) // ls_frt_type = 'F' then else if("F".equalsIgnoreCase(freightType)) // ls_frt_type = 'F' then
{ {
// lc_frt_amt = dw_edit.getitemnumber(1,"freight_amt")
sql = " select freight_amt from shipment where shipment_id = ? "; sql = " select freight_amt from shipment where shipment_id = ? ";
...@@ -336,15 +345,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -336,15 +345,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
chargeCodeAdd = rs.getString("charge_code__add"); chargeCodeAdd = rs.getString("charge_code__add");
sequence = rs.getInt("sequence"); sequence = rs.getInt("sequence");
/* System.out.println("@@@@@@@@@ chargesMode["+chargesMode+"]chargeCodeAdd["+chargeCodeAdd+"]chargeRate["+chargeRate+"]");
ls_line_no = dw_detbrow_main.getitemstring(ll_cnt,'line_no')
ls_chg_code = dw_detbrow_main.getitemstring(ll_cnt,'charge_code')
ls_mode = dw_detbrow_main.getitemstring(ll_cnt,'charges_mode')
lc_chg_rate = dw_detbrow_main.getitemnumber(ll_cnt,'charge_rate')
ls_chgs_add = dw_detbrow_main.getitemstring(ll_cnt,'charge_code__add')
ll_seq = dw_detbrow_main.getitemnumber(ll_cnt,'sequence')
*/
System.out.println("@@@@@@@@@ chargesMode["+chargesMode+"]chargeCodeAdd["+chargeCodeAdd+"]");
if("P".equalsIgnoreCase(chargesMode)) //ls_mode = 'P' then//percentage on basic freight if("P".equalsIgnoreCase(chargesMode)) //ls_mode = 'P' then//percentage on basic freight
{ {
if( chargeCodeAdd != null ) // not isnull(ls_chgs_add) then if( chargeCodeAdd != null ) // not isnull(ls_chgs_add) then
...@@ -401,7 +402,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -401,7 +402,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
sql1 = " select nvl(sum(net_weight),0) " + sql1 = " select nvl(sum(net_weight),0) " +
" from distord_iss where shipment_id = ? and confirmed = 'Y' "; " from distord_iss where shipment_id = ? and confirmed = 'Y' ";
...@@ -417,24 +417,33 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -417,24 +417,33 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
// added cpatil for c-iss on 19/04/14
sql1 = " select nvl(sum(gross_weight),0) from CONSUME_ISS " +
" where cons_issue in ( select ref_id from ship_docs where shipment_id = ? ) and confirmed = 'Y' ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
grossWeightCIss = rs1.getDouble(1);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
System.out.println("@@@@@@@@grossWeightCIss["+grossWeightCIss+"]");
// end cpatil
val = ( tempNettWeight + tempNetWeight ) * chargeRate ;
val = ( tempNettWeight + tempNetWeight + grossWeightCIss ) * chargeRate ;
} // end if } // end if
if( "W".equalsIgnoreCase(chargesMode) || "P".equalsIgnoreCase(chargesMode) ) if( "W".equalsIgnoreCase(chargesMode) || "P".equalsIgnoreCase(chargesMode) )
//ls_mode = 'W' or ls_mode = 'P' then //ls_mode = 'W' or ls_mode = 'P' then
{ {
//if isnull(lc_val) then lc_val = 0
// dw_detedit_main.setitem(1,'shipment_id',ls_shipment)
// dw_detedit_main.setitem(1,'line_no',ls_line_no)
// dw_detedit_main.setitem(1,'charge_code',ls_chg_code)
// dw_detedit_main.setitem(1,'sequence',ll_seq)
// dw_detedit_main.setitem(1,'charges_mode',ls_mode)
// dw_detedit_main.setitem(1,'charge_rate',lc_chg_rate)
// dw_detedit_main.setitem(1,'charge_code__add',ls_chgs_add)
// dw_detedit_main.setitem(1,'amount',lc_val)
// dw_detedit_main.setcolumn('charge_code')
sql1 = " update shipment_det set charge_code = ?, sequence = ?, charges_mode= ?, charge_rate= ?," + sql1 = " update shipment_det set charge_code = ?, sequence = ?, charges_mode= ?, charge_rate= ?," +
" charge_code__add= ? , amount=? where shipment_id = ? and line_no = ? "; " charge_code__add= ? , amount=? where shipment_id = ? and line_no = ? ";
...@@ -453,11 +462,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -453,11 +462,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
System.out.println("@@@@@ updCnt["+updCnt+"]"); System.out.println("@@@@@ updCnt["+updCnt+"]");
// popobj = dw_detedit_main
// formno = 1
// dw_detedit_main.triggerevent('ue_postrec')
// formno = 0
// end if
} // next } // next
} // end while } // end while
...@@ -467,7 +471,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -467,7 +471,6 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} // end try } // end try
catch (Exception e) catch (Exception e)
{ {
...@@ -477,7 +480,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R ...@@ -477,7 +480,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
} }
return errCode; return errCode;
} }
......
/********************************************************
Title : RecalFrtActLocal
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
......
/********************************************************
Title : RecalFrtActRemote
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
//import javax.ejb.EJBObject; //import javax.ejb.EJBObject;
......
/******************************************************** /********************************************************
Title : ShipmentConfLocal Title : ShipmentLocConfLocal
Date : 01/06/2012 Date : 25/04/2014
Developer: Mahesh Patidar Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/ ********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
......
/******************************************************** /*******************************************************
Title : ShipmentRemote Title : ShipmentLocConfRemote
Date : 01/06/2012 Date : 25/04/2014
Developer: Mahesh Patidar Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/ ********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
......
/********************************************************
Title : ShipmentLocDefaultAct
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
......
/********************************************************
Title : ShipmentLocDefaultActLocal
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
......
/********************************************************
Title : ShipmentLocDefaultActRemote
Date : 25/04/2014
Developer: chandrakant patil
req id : DI3GSUN047
********************************************************/
package ibase.webitm.ejb.dis.adv; package ibase.webitm.ejb.dis.adv;
......
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