Commit fa7c34bd authored by cpatil's avatar cpatil

added validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99548 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f93c3035
...@@ -10,8 +10,7 @@ package ibase.webitm.ejb.dis; ...@@ -10,8 +10,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
// import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -32,9 +31,7 @@ import java.sql.Timestamp; ...@@ -32,9 +31,7 @@ import java.sql.Timestamp;
public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, ShipmentLocICRemote public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, ShipmentLocICRemote
{ {
GenericUtility genericUtility = GenericUtility.getInstance();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
//method for validation //method for validation
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
...@@ -99,6 +96,8 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -99,6 +96,8 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
String isExistFlag="",exchRateStr="",chargeCode="",stanCodeShip="",stanCodeDlv="",shipmentId=""; String isExistFlag="",exchRateStr="",chargeCode="",stanCodeShip="",stanCodeDlv="",shipmentId="";
double exchRate=0; double exchRate=0;
String currCodeFrt="",currCodeBc="";
try try
{ {
System.out.println("@@@@@@@@ wfvaldata called"); System.out.println("@@@@@@@@ wfvaldata called");
...@@ -124,7 +123,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -124,7 +123,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
if(childNodeName.equalsIgnoreCase("shipment_id")) if(childNodeName.equalsIgnoreCase("shipment_id"))
{ {
shipmentId = checkNull(genericUtility.getColumnValue("shipment_id", dom)); shipmentId = genericUtility.getColumnValue("shipment_id", dom);
//Shipment Date should not be blank. //Shipment Date should not be blank.
String keyFlag = setDescription("key_flag", "transetup", "tran_window", "w_shipment_loc", conn); String keyFlag = setDescription("key_flag", "transetup", "tran_window", "w_shipment_loc", conn);
...@@ -626,6 +625,57 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -626,6 +625,57 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
} }
} }
// new
if( childNodeName.equalsIgnoreCase("curr_code__frt") )
{
currCodeFrt = checkNull(genericUtility.getColumnValue("curr_code__frt", dom));
if( currCodeFrt != null && currCodeFrt.trim().length() > 0 )
{
isExistFlag = isExist("currency", "curr_code", currCodeFrt, conn);
if("FALSE".equalsIgnoreCase(isExistFlag))
{
errCode = "VMCURR1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
{
errCode = "VMCUR2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if( childNodeName.equalsIgnoreCase("curr_code__bc") )
{
currCodeBc = checkNull(genericUtility.getColumnValue("curr_code__bc", dom));
if( currCodeBc != null && currCodeBc.trim().length() > 0 )
{
isExistFlag = isExist("currency", "curr_code", currCodeBc, conn);
if("FALSE".equalsIgnoreCase(isExistFlag))
{
errCode = "VMCURR1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
{
errCode = "VMCUR2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} // end for } // end for
break; // case 4 end break; // case 4 end
...@@ -721,7 +771,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -721,7 +771,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt > 0) if( cnt > 0)
{ {
retStr = "TRUE"; retStr = "TRUE";
...@@ -782,8 +831,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -782,8 +831,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null ; ResultSet rs = null ;
// GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
int currentFormNo =0; int currentFormNo =0;
...@@ -803,7 +851,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -803,7 +851,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
int i=0,noArt=0; int i=0,noArt=0;
Timestamp despDate=null; Timestamp despDate=null;
double netWeightCIss=0;
try try
{ {
...@@ -1297,13 +1344,13 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -1297,13 +1344,13 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
{ {
System.out.println("@@@@@@@@ itemchange charge_code called @@@@@@@@"); System.out.println("@@@@@@@@ itemchange charge_code called @@@@@@@@");
chargeCode = genericUtility.getColumnValue("charge_code", dom)==null?"":genericUtility.getColumnValue("charge_code", dom).trim(); chargeCode = genericUtility.getColumnValue("charge_code", dom);
shipmentId = genericUtility.getColumnValue("shipment_id", dom1)==null?"":genericUtility.getColumnValue("shipment_id", dom1).trim(); shipmentId = genericUtility.getColumnValue("shipment_id", dom1);
frtList = genericUtility.getColumnValue("frt_list", dom1)==null?"":genericUtility.getColumnValue("frt_list", dom1).trim(); frtList = genericUtility.getColumnValue("frt_list", dom1);
stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1)==null?"":genericUtility.getColumnValue("stan_code__from", dom1).trim(); stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1);
stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1)==null?"":genericUtility.getColumnValue("stan_code__to", dom1).trim(); stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1);
loadType = genericUtility.getColumnValue("load_type", dom1)==null?"":genericUtility.getColumnValue("load_type", dom1).trim(); loadType = genericUtility.getColumnValue("load_type", dom1);
/* /*
sql = " select c.descr,b.charges_mode,b.amount,b.charge_code__add,sequence " + sql = " select c.descr,b.charges_mode,b.amount,b.charge_code__add,sequence " +
" from shipment a, freight_rate_det b, gencodes c " + " from shipment a, freight_rate_det b, gencodes c " +
...@@ -1338,9 +1385,9 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -1338,9 +1385,9 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.setString(3,stanCodeTo ); pstmt.setString(3,stanCodeTo );
pstmt.setString(4,loadType ); pstmt.setString(4,loadType );
// pstmt.setString(5,shipmentId ); pstmt.setString(5,shipmentId );
pstmt.setString(5,"CHARGE_CODE" ); pstmt.setString(6,"CHARGE_CODE" );
pstmt.setString(6,chargeCode ); pstmt.setString(7,chargeCode );
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
...@@ -1438,24 +1485,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -1438,24 +1485,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = " select nvl(sum(gross_weight),0) from CONSUME_ISS " + nettWeight = (nettWeight + netWeight) * amount;
" where cons_issue in ( select ref_id from ship_docs where shipment_id = ? ) and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, shipmentId);
rs = pstmt.executeQuery();
if( rs.next())
{
grossWeightCIss = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@grossWeightCIss["+grossWeightCIss+"]");
nettWeight = (nettWeight + netWeight + grossWeightCIss ) * amount;
valueXmlString.append("<amount>").append("<![CDATA["+nettWeight+"]]>").append("</amount>"); valueXmlString.append("<amount>").append("<![CDATA["+nettWeight+"]]>").append("</amount>");
} }
else if ("V".equalsIgnoreCase(mode) ) //volume else if ("V".equalsIgnoreCase(mode) ) //volume
...@@ -1515,7 +1545,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -1515,7 +1545,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
System.out.println("@@@@@2 stanCodeShip ["+ stanCodeShip + "]"); System.out.println("@@@@@2 stanCodeShip ["+ stanCodeShip + "]");
stationaDescr = setDescription("descr", "station", "stan_code", stanCodeShip, conn); stationaDescr = setDescription("descr", "station", "stan_code", stanCodeShip, conn);
valueXmlString.append("<stationa_descr protect = \"1\">").append("<![CDATA["+stationaDescr+"]]>").append("</stationa_descr>"); valueXmlString.append("<stationa_descr protect = \"1\">").append("<![CDATA["+stationaDescr+"]]>").append("</stationa_descr>");
} //stationa_descr }
else if( currentColumn.trim().equalsIgnoreCase( "stan_code__dlv" ) ) else if( currentColumn.trim().equalsIgnoreCase( "stan_code__dlv" ) )
......
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