Commit f54b2500 authored by kmandhre's avatar kmandhre

sun source merge mail by rohan


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92848 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1b699945
/**
* PURPOSE : EJB component CenvatCrCapitalIC for calling itm_default
* AUTHOR : Changed By sankara
*/
package ibase.webitm.ejb.dis;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.*;
import java.text.SimpleDateFormat;
import org.w3c.dom.*;
@javax.ejb.Stateless
public class CenvatCrCapitalIC extends ValidatorEJB implements CenvatCrCapitalICLocal, CenvatCrCapitalICRemote
{
GenericUtility genericUtility = GenericUtility.getInstance();
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
Document dom1 = null;
Document dom2 = null;
String valueXmlString = "";
try
{
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
if (xmlString != null && xmlString.trim().length()!=0)
{
dom = genericUtility.parseString(xmlString);
}
if (xmlString1 != null && xmlString1.trim().length()!=0)
{
dom1 = genericUtility.parseString(xmlString1);
}
if (xmlString2 != null && xmlString2.trim().length()!=0)
{
dom2 = genericUtility.parseString(xmlString2);
}
valueXmlString = itemChanged( dom, dom1, dom2, objContext, currentColumn, editFlag, xtraParams );
}
catch(Exception e)
{
System.out.println("Exception : [TrainingEJB][itemChanged(String,String)] :==>\n"+e.getMessage());
throw new ITMException( e );
}
return valueXmlString;
}
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
int currentFormNo = 0 ;
String siteCode = "";
String chgTerm = "";
java.util.Date currDate = null;
String currDateStr = null;
ConnDriver connDriver = new ConnDriver();
GenericUtility genericUtility = GenericUtility.getInstance();
try
{
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver=null;
String applDateFormat = genericUtility.getApplDateFormat();
currDate = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat(applDateFormat);
currDateStr = sdf.format(currDate);
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
}
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></header>");
chgTerm = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgTerm" ));
System.out.println("**************ITEM DEFAULT CALLED");
switch(currentFormNo)
{
case 1 :
{
valueXmlString.append("<Detail1 domID='1' selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{
siteCode = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
System.out.println("**************SITECODE="+siteCode);
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode +"]]>").append("</site_code>");
}
valueXmlString.append("</Detail1>");
}
break;
}
valueXmlString.append("</Root>");
System.out.println("=================["+valueXmlString+"]");
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("Exception ::"+e.getMessage());
throw new ITMException(e);
}
finally
{
try
{
if(conn!=null)
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
}
catch(Exception d)
{
d.printStackTrace();
}
}
return valueXmlString.toString();
}
private boolean checkNumeric( String noOfLabel ) throws Exception
{
char[] cArray = noOfLabel.toCharArray();
boolean isNumber = true;
for(int i = 0; i < cArray.length;i++)
{
if( !Character.isDigit(cArray[i]) )
{
isNumber = false;
}
}
return isNumber;
}
private String checkNull(String string)
{
if(string == null)
{
string = "";
}
return string;
}
}
/**
* PURPOSE : Local Interface for CartonNoGenIC
* AUTHOR : Changed By Chaitali On 25/11/2011
*/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.*;
@javax.ejb.Local
public interface CenvatCrCapitalICLocal extends ValidatorLocal
{
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlCurrFrmString, String xmlHdrFrmString,String xmlAllFrmString, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document currDom, Document hdrDom, Document allDom, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
/**
* PURPOSE : Local Interface for CartonNoGenIC
* AUTHOR : Changed By Chaitali On 25/11/2011
*/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.*;
@javax.ejb.Remote
public interface CenvatCrCapitalICRemote extends ValidatorRemote
{
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlCurrFrmString, String xmlHdrFrmString,String xmlAllFrmString, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document currDom, Document hdrDom, Document allDom, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
This diff is collapsed.
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Local
public interface CenvatCrCapitalPrcLocal extends ProcessLocal
{
public String process() throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface CenvatCrCapitalPrcRemote extends ProcessRemote
{
public String process() throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
This diff is collapsed.
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.ProcessLocal;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
@javax.ejb.Local
public interface PorcpProcessLocal extends ProcessLocal
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData( String xmlString_, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData( Document dom_, Document dom1,Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString_, String xmlString1,String xmlString2, 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;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
@javax.ejb.Remote
public interface PorcpProcessRemote extends ProcessRemote
{
public String wfValData() throws RemoteException,ITMException;
public String wfValData(String xmlString_, String xmlString1,String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom_,Document dom1,Document dom2,String objContext,String editFlag,String xtraParams) throws RemoteException,ITMException;
public String itemChanged() throws RemoteException,ITMException;
public String itemChanged(String xmlString_, String xmlString1,String xmlString2, 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;
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException,ITMException;
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,7 +8,6 @@ import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.*;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import ibase.webitm.ejb.*;
......@@ -228,6 +227,15 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
int ctr = 0;
int currentFormNo = 0;
String errCode = "";
//Changed by Rohan on 13-03-13 for define variables.start
String batchPart1 = "";
String batchPart2 = "";
String batchPart3 = "";
String batchPart4 = "";
String batchPartStr = "";
int batchPartInt = 0;
int remChar = 0;
//Changed by Rohan on 13-03-13 for define variables.end
java.sql.PreparedStatement pstmt=null;
java.sql.ResultSet rs = null;
StringBuffer valueXmlString = new StringBuffer();
......@@ -246,6 +254,14 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
String finEnt =null;
String trandateToTsStr=null;
String trandateFromTsStr=null;
//Changed by Rohna on 19-03-13 for define variable.start
String processDateStr = null;
java.sql.Timestamp processDate = null;
java.sql.Timestamp trandateToTs=null;
java.sql.Timestamp trandateFromTS=null;
String batchNoStr=null;
String procDate = "";
//Changed by Rohna on 19-03-13 for define variable.end
double cloBal=0;
String sCloBal = null;
String siteCode=null;
......@@ -470,9 +486,7 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
else
{
java.sql.Timestamp trandateToTs=null;
java.sql.Timestamp trandateFromTS=null;
String batchNoStr=null;
//String trandateTo =null;
//String trandateFrom=null;
//From Filter
......@@ -480,8 +494,8 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
trandateFrom = getColumnValue("tran_date__from",dom);
System.out.println("tran_date__to(APPL)::["+trandateTo+"]");
System.out.println("tran_date__from(APPL)::["+trandateFrom+"]");
System.out.println("DrCr Type in else :: " + currentColumn);
siteCode = getColumnValue("site_code",dom);
System.out.println("DrCr Type in else :: " + currentColumn+"siteCode:::"+siteCode);
//converting to dbdate format
trandateToTsStr = genericUtility.getValidDateString(trandateTo,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
trandateFromTsStr = genericUtility.getValidDateString(trandateTo,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
......@@ -490,22 +504,33 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
//convert timestring to timestamp object
//Changed by Rohan on 19-03-13 for check finantial period depending on process date.start
/*
trandateToTs = Timestamp.valueOf(trandateToTsStr+" 00:00:00");
trandateFromTS = Timestamp.valueOf(trandateToTsStr+" 00:00:00");
System.out.println("Tran Date(DB) ::["+trandateToTs+"]");
System.out.println("Tran Date(DB) ::["+trandateFromTS+"]");
*/
//Changed by Rohan on 19-03-13 for check finantial period depending on process date.end
//calculating the trandate from and to from account perion table
//Changed by Rohan on 19-03-13 for check finantial period depending on process date.start
/*
sql ="select fr_date,to_date from acctprd where ? >= fr_date and ?<=to_date";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,trandateFromTS);
pstmt.setTimestamp(2,trandateToTs);
*/
procDate = getColumnValue("proc_date",dom);
System.out.println("Processing Date"+procDate);
processDateStr = genericUtility.getValidDateString(procDate,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
processDate = Timestamp.valueOf(processDateStr+" 00:00:00");
sql ="select fr_date,to_date from acctprd where ? between fr_date and to_date ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,processDate);
//Changed by Rohan on 19-03-13 for check finantial period depending on process date.end
rs = pstmt.executeQuery();
System.out.println("Query Executed::::::::::"+sql);
System.out.println("Setting Parameter ::["+trandateFromTS+"]");
System.out.println("Setting Parameter ::["+trandateToTs+"]");
if(rs.next())
{
trandateFromTS = rs.getTimestamp(1);;
......@@ -541,6 +566,56 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
System.out.println("Setting Parameter ::["+trandateFromTS+"]");
System.out.println("Setting Parameter ::["+trandateToTs+"]");
System.out.println("batchNoStr::["+batchNoStr+"]");
//Changed by Rohan on 13-03-13 for generating automatic batch number.start
sql ="SELECT DOC_PREFIX FROM SITE WHERE SITE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,siteCode);
rs = pstmt.executeQuery();
if(rs.next())
{
batchPart1 = rs.getString("DOC_PREFIX");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
batchPart2 = String.valueOf(trandateToTs).substring(2,4);
if(batchNoStr != null && batchNoStr.trim().length() > 0)
{
if(batchNoStr.trim().length() == 10)
{
batchPart4 = batchNoStr.substring(5,10);
}
else
{
batchPart4 = "0";
}
}
else
{
batchPart4 = "0";
}
batchPartInt = Integer.parseInt(batchPart4) + 1;
batchPart4 = String.valueOf(batchPartInt);
remChar = 10 - (batchPart1+batchPart2+batchPart4).trim().length();
for(int i = 0;i < remChar ; i++)
{
batchPart3 = batchPart3.concat("0");
}
System.out.println("batchPart1"+batchPart1+"batchPart2"+batchPart2+"batchPart3"+batchPart3+"batchPart4"+batchPart4);
batchNoStr = batchPart1+batchPart2+batchPart3+batchPart4;
System.out.println("batchNoStr---->"+batchNoStr);
//Changed by Rohan on 13-03-13 for generating automatic batch number.end
valueXmlString.append("<bal_group__adj protect=\"0\">").append(" ").append("</bal_group__adj>\r\n");
valueXmlString.append("<adj_amt protect=\"0\">").append(" ").append("</adj_amt>\r\n");
......@@ -548,9 +623,13 @@ public class TaxSchIc extends ValidatorEJB implements TaxSchIcLocal, TaxSchIcRem
// by msalam on 19/06/07 for req Id :: DI78SUN049
//If batchNoStr is coming null from database the put blank else put it as it is.
if(batchNoStr == null || batchNoStr.length() == 0)
valueXmlString.append("<batch_no protect=\"0\">").append(" ").append("</batch_no>\r\n");
//Changed by Rohan on 13-02-13 for making batch no feild not editable & automatic
//valueXmlString.append("<batch_no protect=\"0\">").append(" ").append("</batch_no>\r\n");
valueXmlString.append("<batch_no protect=\"1\">").append(" ").append("</batch_no>\r\n");
else
valueXmlString.append("<batch_no protect=\"0\">").append(batchNoStr).append("</batch_no>\r\n");
//Changed by Rohan on 13-02-13 for making batch no feild not editable & automatic
//valueXmlString.append("<batch_no protect=\"0\">").append(batchNoStr).append("</batch_no>\r\n");
valueXmlString.append("<batch_no protect=\"1\">").append(batchNoStr).append("</batch_no>\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