Commit 3a66ac80 authored by vlagad's avatar vlagad

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194969 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d6c5cc4c
...@@ -75,7 +75,7 @@ public class SchemaBalance extends ValidatorEJB ...@@ -75,7 +75,7 @@ public class SchemaBalance extends ValidatorEJB
ArrayList <String> errList = new ArrayList<String>(); ArrayList <String> errList = new ArrayList<String>();
ArrayList <String>errFields = new ArrayList <String> (); ArrayList <String>errFields = new ArrayList <String> ();
String errorType = ""; String errorType = "";
String custCode = "", effFrom="",effUpto="",itemCode="",balaceFreeQty="",usedFreeQty="",schmeCode=""; String custCode = "", effFrom="",effUpto="",itemCode="",balaceFreeQty="",usedFreeQty="",schmeCode="",autoReplCredit="",custCodeRepl="";
Timestamp eff_from=null,eff_upto=null,toDate=null,fromDate=null; Timestamp eff_from=null,eff_upto=null,toDate=null,fromDate=null;
//String rate=null,unit=null; //String rate=null,unit=null;
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
...@@ -323,6 +323,43 @@ public class SchemaBalance extends ValidatorEJB ...@@ -323,6 +323,43 @@ public class SchemaBalance extends ValidatorEJB
}*/ }*/
//Commented by Vikas L to remove validation [17/10/2018]end //Commented by Vikas L to remove validation [17/10/2018]end
} }
else if(childNodeName.equalsIgnoreCase("cust_code__repl"))
{
custCodeRepl = E12GenericUtility.checkNull(genericUtility.getColumnValue("cust_code__repl", dom));
System.out.println("Customer code:"+custCodeRepl);
if(E12GenericUtility.checkNull(custCodeRepl).length() <= 0)
{
errCode = "VTRPLCST";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
else
{
String str = "select count(1) from customer where cust_code = ?";
int count = 0;
pstmt = conn.prepareStatement(str);
pstmt.setString(1, custCodeRepl);
rs = pstmt.executeQuery();
if(rs.next())
{
count = rs.getInt(1);
}
System.out.println("count : "+count);
pstmt.close();
pstmt = null;
rs.close();
rs = null;
if(count == 0)
{
errCode = "RPLNOEXT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
break;
}
}
}
} }
} }
break; break;
...@@ -453,6 +490,9 @@ public class SchemaBalance extends ValidatorEJB ...@@ -453,6 +490,9 @@ public class SchemaBalance extends ValidatorEJB
*/ */
public String itemChanged( Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged( Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
String siteCode="";
String custCode ="";
String siteCodePbus="";
String sql = ""; String sql = "";
String columnValue = ""; String columnValue = "";
String loginSiteCode = ""; String loginSiteCode = "";
...@@ -472,6 +512,7 @@ public class SchemaBalance extends ValidatorEJB ...@@ -472,6 +512,7 @@ public class SchemaBalance extends ValidatorEJB
{ {
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" ); userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginCode" );
siteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
columnValue = genericUtility.getColumnValue( currentColumn, dom ); columnValue = genericUtility.getColumnValue( currentColumn, dom );
conn = getConnection(); conn = getConnection();
if( objContext != null && objContext.trim().length() > 0 ) if( objContext != null && objContext.trim().length() > 0 )
...@@ -486,8 +527,28 @@ public class SchemaBalance extends ValidatorEJB ...@@ -486,8 +527,28 @@ public class SchemaBalance extends ValidatorEJB
valueXmlString.append( "<Detail1>\r\n" ); valueXmlString.append( "<Detail1>\r\n" );
if("itm_default".equalsIgnoreCase(currentColumn)) if("itm_default".equalsIgnoreCase(currentColumn))
{ {
//Added by Vikas on 27-dec-2018[start]
sql="select cust_code,site_code__pbus from customer where site_code= ? and channel_partner='Y'";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1, siteCode);
rs=pStmt.executeQuery();
int count=0;
while(rs.next())
{
count++;
}
System.out.println("Count :::::"+count);
if( count == 1 )
{
if(rs.next())
{
custCode=rs.getString("cust_code");
siteCodePbus=rs.getString("site_code__pbus");
System.out.println("Cust Code 123::: ["+custCode+"] ["+siteCodePbus+"]");
}
valueXmlString.append( "<cust_code>").append(custCode).append( "</cust_code>\r\n" );
}
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
String loginCode=getValueFromXTRA_PARAMS(xtraParams,"loginCode"); String loginCode=getValueFromXTRA_PARAMS(xtraParams,"loginCode");
String chg_term=getValueFromXTRA_PARAMS( xtraParams, "chgTerm" ); String chg_term=getValueFromXTRA_PARAMS( xtraParams, "chgTerm" );
currentDate = new Date(); currentDate = new Date();
...@@ -502,6 +563,10 @@ public class SchemaBalance extends ValidatorEJB ...@@ -502,6 +563,10 @@ public class SchemaBalance extends ValidatorEJB
valueXmlString.append( "<balance_free_value>").append("0").append( "</balance_free_value>\r\n" ); valueXmlString.append( "<balance_free_value>").append("0").append( "</balance_free_value>\r\n" );
valueXmlString.append( "<used_free_value>").append("0").append( "</used_free_value>\r\n" ); valueXmlString.append( "<used_free_value>").append("0").append( "</used_free_value>\r\n" );
//Added by Saiprasad G.on [20-DEC-18] END //Added by Saiprasad G.on [20-DEC-18] END
valueXmlString.append( "<site_code>").append(siteCode).append( "</site_code>\r\n" );
valueXmlString.append( "<site_code__repl>").append(siteCodePbus).append( "</site_code__repl>\r\n" );
valueXmlString.append( "<auto_repl_credit ><![CDATA[").append("Y").append( "]]></auto_repl_credit>\r\n" );
//Added by Vikas L on 27-dec-18 [end]
} }
else if("itm_defaultedit".equalsIgnoreCase(currentColumn)) else if("itm_defaultedit".equalsIgnoreCase(currentColumn))
{ {
...@@ -612,7 +677,31 @@ public class SchemaBalance extends ValidatorEJB ...@@ -612,7 +677,31 @@ public class SchemaBalance extends ValidatorEJB
} }
valueXmlString.append("<gencodes_descr>").append(schemeDescr).append("</gencodes_descr>"); valueXmlString.append("<gencodes_descr>").append(schemeDescr).append("</gencodes_descr>");
} }
//Added By Vikas L on 27-Dec-18[start]
else if(("CUST_CODE__REPL").equalsIgnoreCase(currentColumn))
{
//siteCode = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" );
System.out.println("site_code<<<<<<<<<"+siteCode);
String siteCodeRepl="";
String cust_code_repl=E12GenericUtility.checkNull(genericUtility.getColumnValue("cust_code__repl", dom));
sql= "select site_code__pbus,cust_name from customer where cust_code = ?";
pStmt=conn.prepareStatement(sql);
pStmt.setString(1,cust_code_repl);
rs=pStmt.executeQuery();
if(rs.next())
{
siteCodeRepl=E12GenericUtility.checkNull(rs.getString("site_code__pbus"));
custName=rs.getString("cust_name");
System.out.println("site_code__pbus ::::"+siteCodeRepl);
}
if( siteCodeRepl.equals(""))
{
valueXmlString.append("<site_code__repl>").append(siteCodeRepl).append("</site_code__repl>");
}
valueXmlString.append("<site_code__repl>").append(siteCode).append("</site_code__repl>");
valueXmlString.append("<cust_repl_name>").append(custName).append("</cust_repl_name>");
}
//Added By Vikas L on 27-Dec-18[start]
valueXmlString.append( "</Detail1>\r\n" ); valueXmlString.append( "</Detail1>\r\n" );
} }
......
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