Commit 52b56d2a authored by prane's avatar prane

added validation for Next level price list in price list master

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192566 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7467ac00
...@@ -95,6 +95,7 @@ public class PriceListIC extends ValidatorEJB implements PriceListICLocal, Price ...@@ -95,6 +95,7 @@ public class PriceListIC extends ValidatorEJB implements PriceListICLocal, Price
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
ResultSet rs = null; ResultSet rs = null;
String pListNxLev = "";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try try
...@@ -279,6 +280,46 @@ public class PriceListIC extends ValidatorEJB implements PriceListICLocal, Price ...@@ -279,6 +280,46 @@ public class PriceListIC extends ValidatorEJB implements PriceListICLocal, Price
} }
//Changed By Nasruddin [20-SEP-16] end //Changed By Nasruddin [20-SEP-16] end
//Pavan R on 31oct18 [to validate nxt level price list]
else if(childNodeName.equalsIgnoreCase("price_list_nxlev"))
{
System.out.println("Inside PavanR.....Validation");
pListNxLev = checkNullAndTrim(genericUtility.getColumnValue("price_list_nxlev", dom));
if(pListNxLev != null && pListNxLev.trim().length() > 0)
{
sql="select count(*) from pricelist_mst where price_list = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pListNxLev);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if(count == 0)
{
errCode = "VTNXTPLIST";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else
{
priceList = checkNullAndTrim(genericUtility.getColumnValue("price_list", dom));
priceListParent = checkNullAndTrim(genericUtility.getColumnValue("price_list__parent", dom));
if(priceList.equals(pListNxLev))
{
errCode = "VTNXTPLST1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else if(priceListParent.equals(pListNxLev))
{
errCode = "VTNXTPLST2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}
} //Pavan R on 31oct18 end
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
break; break;
...@@ -749,7 +790,9 @@ private double convertNumber(String columnValue) ...@@ -749,7 +790,9 @@ private double convertNumber(String columnValue)
while(rs.next()) while(rs.next())
{ {
msgType = rs.getString("MSG_TYPE"); msgType = rs.getString("MSG_TYPE");
} }
rs.close();rs = null;
pstmt.close(); pstmt = null;
} }
catch(Exception ex) catch(Exception ex)
{ {
......
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