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;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
// import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat;
......@@ -32,9 +31,7 @@ import java.sql.Timestamp;
public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, ShipmentLocICRemote
{
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
GenericUtility genericUtility = GenericUtility.getInstance();
//method for validation
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
......@@ -98,6 +95,8 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
Timestamp shipmentDate=null;
String isExistFlag="",exchRateStr="",chargeCode="",stanCodeShip="",stanCodeDlv="",shipmentId="";
double exchRate=0;
String currCodeFrt="",currCodeBc="";
try
{
......@@ -124,7 +123,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
if(childNodeName.equalsIgnoreCase("shipment_id"))
{
shipmentId = checkNull(genericUtility.getColumnValue("shipment_id", dom));
shipmentId = genericUtility.getColumnValue("shipment_id", dom);
//Shipment Date should not be blank.
String keyFlag = setDescription("key_flag", "transetup", "tran_window", "w_shipment_loc", conn);
......@@ -625,6 +624,57 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
errFields.add(childNodeName.toLowerCase());
}
}
// 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
break; // case 4 end
......@@ -721,7 +771,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt > 0)
{
retStr = "TRUE";
......@@ -782,8 +831,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
int currentFormNo =0;
......@@ -803,7 +851,6 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
int i=0,noArt=0;
Timestamp despDate=null;
double netWeightCIss=0;
try
{
......@@ -1297,13 +1344,13 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
{
System.out.println("@@@@@@@@ itemchange charge_code called @@@@@@@@");
chargeCode = genericUtility.getColumnValue("charge_code", dom)==null?"":genericUtility.getColumnValue("charge_code", dom).trim();
shipmentId = genericUtility.getColumnValue("shipment_id", dom1)==null?"":genericUtility.getColumnValue("shipment_id", dom1).trim();
chargeCode = genericUtility.getColumnValue("charge_code", dom);
shipmentId = genericUtility.getColumnValue("shipment_id", dom1);
frtList = genericUtility.getColumnValue("frt_list", dom1)==null?"":genericUtility.getColumnValue("frt_list", dom1).trim();
stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1)==null?"":genericUtility.getColumnValue("stan_code__from", dom1).trim();
stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1)==null?"":genericUtility.getColumnValue("stan_code__to", dom1).trim();
loadType = genericUtility.getColumnValue("load_type", dom1)==null?"":genericUtility.getColumnValue("load_type", dom1).trim();
frtList = genericUtility.getColumnValue("frt_list", dom1);
stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1);
stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1);
loadType = genericUtility.getColumnValue("load_type", dom1);
/*
sql = " select c.descr,b.charges_mode,b.amount,b.charge_code__add,sequence " +
" from shipment a, freight_rate_det b, gencodes c " +
......@@ -1338,9 +1385,9 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.setString(3,stanCodeTo );
pstmt.setString(4,loadType );
// pstmt.setString(5,shipmentId );
pstmt.setString(5,"CHARGE_CODE" );
pstmt.setString(6,chargeCode );
pstmt.setString(5,shipmentId );
pstmt.setString(6,"CHARGE_CODE" );
pstmt.setString(7,chargeCode );
rs = pstmt.executeQuery();
if(rs.next())
......@@ -1438,24 +1485,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.close();
pstmt = null;
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, 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;
nettWeight = (nettWeight + netWeight) * amount;
valueXmlString.append("<amount>").append("<![CDATA["+nettWeight+"]]>").append("</amount>");
}
else if ("V".equalsIgnoreCase(mode) ) //volume
......@@ -1515,7 +1545,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
System.out.println("@@@@@2 stanCodeShip ["+ stanCodeShip + "]");
stationaDescr = setDescription("descr", "station", "stan_code", stanCodeShip, conn);
valueXmlString.append("<stationa_descr protect = \"1\">").append("<![CDATA["+stationaDescr+"]]>").append("</stationa_descr>");
} //stationa_descr
}
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