Commit a18918e3 authored by pbhosale's avatar pbhosale

* Poonam B changes done for Financial Entitywise Accounting Period obj_name: finent_acctprd

FinEntAcctPrd.java
w_finent_acctprd.sql


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205039 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a62c3816
......@@ -9,22 +9,20 @@ import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import javax.ejb.Stateless;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
/**
* Session Bean implementation class FinEntAcctPrd
*/
@Stateless
//@Stateless
public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote, FinEntAcctPrdLocal
{
// VALIDATION START
......@@ -39,7 +37,9 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
Document dom1 = null;
Document dom2 = null;
String errString = "";
GenericUtility genericUtility = GenericUtility.getInstance();
//Modified by POONAM on 24/06/2019.start
E12GenericUtility genericUtility = new E12GenericUtility();
//Modified by POONAM on 24/06/2019.End
try
{
if (xmlString != null && xmlString.trim().length() != 0)
......@@ -61,6 +61,8 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
System.out.println("Exception : FinEntAcctPrd : wfValData(String xmlString) : ==>" + e.getMessage());
errString = genericUtility.createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
return (errString);
}
......@@ -71,29 +73,33 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int currentFormNo = 0, childNodeListLength = 0;
int currentFormNo = 0;
int childNodeListLength = 0;
String userId = "";
String childNodeName = null;
String errString = "";
String msgType = "";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
SimpleDateFormat simpleDateFormat = null;
String msgType = "";
GenericUtility genericUtility = GenericUtility.getInstance();
//Modified by POONAM on 24/06/2019.Start
E12GenericUtility genericUtility = new E12GenericUtility();
//Modified by POONAM on 24/06/2019.End
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
//Modified by POONAM on 24/06/2019.Start
//ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("DriverITM");
//conn.setAutoCommit(false);
conn=getConnection();
//Modified by POONAM on 24/06/2019.End
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (objContext != null && objContext.trim().length() > 0)
......@@ -123,11 +129,11 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
String finEnt = checkNull(genericUtility.getColumnValue("fin_entity", dom));
// FIN_ENTITY is mandatory
if (finEnt.length() == 0)
if ((finEnt == null || finEnt.trim().length() == 0))
{
System.out.println("fin_entity is empty");
errList.add("VMFENACP01");
errFields.add(childNodeName.toLowerCase());
......@@ -143,9 +149,7 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
// FIN_ENTITY must be present in FINENT table.
int cnt = 0;
String finent = checkNull(genericUtility.getColumnValue("fin_entity", dom));
System.out.println("fin_entity invalid");
String sql = " select count(1) as RowCount from finent where fin_entity = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finent);
......@@ -239,7 +243,6 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
}
}
// FIN_ENTITY AND ACCT_PRD SHOULD NOT EXIST IN FINENT_ACCTPRD TABLE
if (editFlag.equalsIgnoreCase("A"))
{
......@@ -321,6 +324,7 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
{
break;
}
throw new ITMException(e);
}
java.sql.Timestamp toDateSql = null;
......@@ -444,6 +448,7 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
{
break;
}
throw new ITMException(e);
}
// TO_DATE SHOULD BE GREATER THAN FR_DATE
......@@ -668,7 +673,9 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
int errListSize = errList.size();
StringBuffer errStringXml = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root><Errors>");
// Modified BY POONAM on 24/06/2019.Start
ITMDBAccessEJB itmdbAccessEJB =new ITMDBAccessEJB();
//Modified BY POONAM on 24/06/2019.END
//ERRORLIST
if (errList != null && errListSize > 0)
{
......@@ -677,8 +684,9 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
String errCode = (String) errList.get(cnt);
String errFldName = (String) errFields.get(cnt);
System.out.println("errCode .........." + errCode);
errString = getErrorString(errFldName, errCode, userId);
//Modified BY POONAM on 24/06/2019.Start
errString =itmdbAccessEJB.getErrorString(errFldName, errCode, userId, "", conn);
//Modified BY POONAM on 24/06/2019.END
System.out.println("errString is : ::::>>>> " + errString);
msgType = errorType(conn, errCode);
if (errString.length() > 0)
......@@ -713,6 +721,7 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
System.out.println("Exception ::" + e);
e.printStackTrace();
errString = e.getMessage();
throw new ITMException(e);
}
finally
{
......@@ -721,12 +730,22 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
if (conn != null)
{
conn.close();
}
conn = null;
}
if (rs != null)
{
rs.close();
rs=null;
}
if (pstmt != null)
{
pstmt.close();
}
}
catch (Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
System.out.println("ErrString ::" + errString);
......@@ -765,14 +784,14 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
catch (Exception e)
{
System.out.println("Exception : FinEntAcctPrd : [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
{
GenericUtility genericUtility = null;
E12GenericUtility genericUtility = null;
Connection conn = null;
int currentFormNo = 0;
......@@ -793,10 +812,14 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
try
{
valueXmlString = new StringBuffer();
genericUtility = new GenericUtility();
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
genericUtility = new E12GenericUtility();
//Modified by Poonam on 26/06/2019.start
//ConnDriver connDriver = new ConnDriver();
//conn = connDriver.getConnectDB("DriverITM");
//conn.setAutoCommit(false);
//Modified by Poonam on 26/06/2019.End
conn=getConnection();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
valueXmlString = new StringBuffer(
......@@ -949,9 +972,21 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
conn.close();
conn = null;
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
} catch (Exception e1)
{
e1.printStackTrace();
throw new ITMException(e1);
}
}
System.out.println("valueXmlString:::::" + valueXmlString.toString());
......@@ -986,6 +1021,7 @@ public class FinEntAcctPrd extends ValidatorEJB implements FinEntAcctPrdRemote,
{
try
{
if (rs != null)
{
rs.close();
......
This diff is collapsed.
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