Commit e7f30f07 authored by cpatil's avatar cpatil

add validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99898 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 92c88ca9
...@@ -579,7 +579,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -579,7 +579,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
System.out.println("@@@@@@@@@@@@childNodeListLength["+childNodeListLength+"]"); System.out.println("Detail4@@@@@@@@@@@@childNodeListLength["+childNodeListLength+"]");
for(ctr = 0; ctr < childNodeListLength; ctr++) for(ctr = 0; ctr < childNodeListLength; ctr++)
{ {
childNode = childNodeList.item(ctr); childNode = childNodeList.item(ctr);
...@@ -677,6 +677,119 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -677,6 +677,119 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
if( childNodeName.equalsIgnoreCase("ref_id") )
{
String refSer = checkNull(genericUtility.getColumnValue("ref_ser", dom));
String refId = checkNull(genericUtility.getColumnValue("ref_id", dom));
System.out.println("@@@@@@@@ refSer["+refSer+"]refId["+refId+"]");
if( refSer != null && refSer.trim().length() > 0 && refId != null && refId.trim().length() > 0 )
{
refSer = refSer.trim();
refId = refId.trim();
if("S-DSP".equalsIgnoreCase(refSer) )
{
System.out.println("@@@@@@@@@ for despatch validation....");
sql = " select count(1) from despatch where desp_id = ? and confirmed = 'N' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt == 0 )
{
errCode = "VMREFIDCNF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("P-ORD".equalsIgnoreCase(refSer) )
{
System.out.println("@@@@@@@@@ for porder validation....");
sql = " select count(1) from porder where purc_order = ? and confirmed = 'N' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt == 0 )
{
errCode = "VMREFIDCNF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("D-ISS".equalsIgnoreCase(refSer) )
{
System.out.println("@@@@@@@@@ for distord_iss validation....");
sql = " select count(1) from distord_iss where tran_id = ? and confirmed = 'N' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt == 0 )
{
errCode = "VMREFIDCNF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("C-ISS".equalsIgnoreCase(refSer) )
{
System.out.println("@@@@@@@@@ for consume_iss validation....");
sql = " select count(1) from consume_iss where cons_issue = ? and confirmed = 'N' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt == 0 )
{
errCode = "VMREFIDCNF";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
else
{
errCode = "VMREFIDNUL";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
} // end for } // end for
break; // case 4 end break; // case 4 end
...@@ -1315,14 +1428,20 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S ...@@ -1315,14 +1428,20 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
String freightAmtStr = genericUtility.getColumnValue("freight_amt", dom)==null?"0":genericUtility.getColumnValue("freight_amt", dom); String freightAmtStr = genericUtility.getColumnValue("freight_amt", dom)==null?"0":genericUtility.getColumnValue("freight_amt", dom);
String addChgsStr = genericUtility.getColumnValue("add_chgs", dom)==null?"0":genericUtility.getColumnValue("add_chgs", dom); String addChgsStr = genericUtility.getColumnValue("add_chgs", dom)==null?"0":genericUtility.getColumnValue("add_chgs", dom);
totalFreight = Double.parseDouble(freightAmtStr) + Double.parseDouble(addChgsStr); totalFreight = Double.parseDouble(freightAmtStr) + Double.parseDouble(addChgsStr);
valueXmlString.append("<total_freight>").append("<![CDATA["+exchRate+"]]>").append("</total_freight>"); System.out.println("@@@@@@@@ totalFreight["+totalFreight+"]");
valueXmlString.append("<total_freight>").append("<![CDATA["+totalFreight+"]]>").append("</total_freight>");
} }
//else if( currentColumn.trim().equalsIgnoreCase("gross_weight") || currentColumn.trim().equalsIgnoreCase("tare_weight")) else if( currentColumn.trim().equalsIgnoreCase("gross_weight") || currentColumn.trim().equalsIgnoreCase("tare_weight"))
//{ {
// no code in pb // no code in pb
//} System.out.println("@@@@@@@@ itemchange gross_weight / tare_weight called @@@@@@@@");
grossWeight = Double.parseDouble(genericUtility.getColumnValue("gross_weight", dom)==null?"0":genericUtility.getColumnValue("gross_weight", dom));
tareWeight = Double.parseDouble(genericUtility.getColumnValue("tare_weight", dom)==null?"0":genericUtility.getColumnValue("tare_weight", dom));
netWeight = grossWeight - tareWeight;
System.out.println("@@@@@@@@ grossWeight["+grossWeight+"]- tareWeight["+tareWeight+"]===netWeight["+netWeight+"]");
valueXmlString.append("<net_weight>").append("<![CDATA["+netWeight+"]]>").append("</net_weight>");
}
// case 1 end // case 1 end
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
......
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