Commit 96a8a191 authored by ysawant's avatar ysawant

Added Updated component of Department master[14-01-2020]

DeptIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215092 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 999fd54c
...@@ -13,6 +13,7 @@ import org.w3c.dom.NodeList; ...@@ -13,6 +13,7 @@ import org.w3c.dom.NodeList;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.sys.UtilMethods; import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -67,9 +68,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -67,9 +68,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
String objContext, String currentColumn, String editFlag, String objContext, String currentColumn, String editFlag,
String xtraParams) throws RemoteException, ITMException String xtraParams) throws RemoteException, ITMException
{ {
String colName = " ", mcode = " ", mdescr = " ", mdescr1 = " "; String mcode = " ", mdescr = " ", mdescr1 = " ";
String deptCodeParent = " ", deptCode = " "; String deptCodeParent = " ", deptCode = " ";
colName = currentColumn;
Connection connectionObject = null; Connection connectionObject = null;
int currentFormNo = 0; int currentFormNo = 0;
StringBuffer valueXmlString = null; StringBuffer valueXmlString = null;
...@@ -300,34 +300,39 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -300,34 +300,39 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
if (deptCodeParent != null && deptCodeParent.trim().length() > 0) if (deptCodeParent != null && deptCodeParent.trim().length() > 0)
{ {
deptCode = genericUtility.getColumnValue("dept_code",dom); deptCode = genericUtility.getColumnValue("dept_code",dom);
if (!deptCodeParent.trim().equalsIgnoreCase(deptCode.trim()))
if (deptCode != null && deptCode.trim().length() > 0)
{ {
sql = "select FN_GET_DEPT_DESCR(?) from dual"; if (!deptCodeParent.trim().equalsIgnoreCase(deptCode.trim()))
pstmt = connectionObject.prepareStatement(sql);
pstmt.setString(1, deptCodeParent);
resultSet = pstmt.executeQuery();
if (resultSet.next())
{ {
mdescr = resultSet.getString(1); sql = "select FN_GET_DEPT_DESCR(?) from dual";
} pstmt = connectionObject.prepareStatement(sql);
if (resultSet != null) pstmt.setString(1, deptCodeParent);
{ resultSet = pstmt.executeQuery();
resultSet.close();
resultSet = null; if (resultSet.next())
} {
if (pstmt != null) mdescr = resultSet.getString(1);
}
if (resultSet != null)
{
resultSet.close();
resultSet = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
else
{ {
pstmt.close(); mdescr = genericUtility.getColumnValue("descr", dom);
pstmt = null;
} }
valueXmlString.append("<parent_dept_descr>").append(mdescr).append("</parent_dept_descr>\r\n");
}
else
{
mdescr = genericUtility.getColumnValue("descr", dom);
} }
valueXmlString.append("<parent_dept_descr>").append(mdescr).append("</parent_dept_descr>\r\n");
} }
} }
...@@ -560,8 +565,10 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -560,8 +565,10 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
UtilMethods utilmethod = new UtilMethods(); UtilMethods utilmethod = new UtilMethods();
try { try
{
connectionObject = getConnection(); connectionObject = getConnection();
ITMDBAccessEJB itmdbaccess = new ITMDBAccessEJB();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("Line no--468"); System.out.println("Line no--468");
if(objContext != null && objContext.trim().length() > 0) { if(objContext != null && objContext.trim().length() > 0) {
...@@ -591,7 +598,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -591,7 +598,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
{ {
if(mVal == null || mVal.length() == 0) if(mVal == null || mVal.length() == 0)
{ {
errString = getErrorString("dept_code","VEDEP2", userId); errString = itmdbaccess.getErrorString("dept_code","VEDEP2", userId, "", connectionObject);
return errString;
} }
else else
{ {
...@@ -605,7 +613,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -605,7 +613,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt > 0) if(cnt > 0)
{ {
errString = getErrorString("dept_code","VMDUPL1", userId); errString = itmdbaccess.getErrorString("dept_code","VMDUPL1", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -626,7 +635,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -626,7 +635,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
mVal = genericUtility.getColumnValue("descr", dom); mVal = genericUtility.getColumnValue("descr", dom);
if(mVal == null || mVal.length() == 0) if(mVal == null || mVal.length() == 0)
{ {
errString = getErrorString("descr", "VTDESC1",userId); errString = itmdbaccess.getErrorString("descr","VTDESC1", userId, "", connectionObject);
return errString;
} }
} }
else if(childNodeName.equalsIgnoreCase("dept_head")) else if(childNodeName.equalsIgnoreCase("dept_head"))
...@@ -645,7 +655,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -645,7 +655,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("dept_head","VMEMP1", userId); errString = itmdbaccess.getErrorString("dept_head","VMEMP1", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -675,7 +686,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -675,7 +686,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("dept_head_1","VMDEPTHD01", userId); errString = itmdbaccess.getErrorString("dept_head_1","VMDEPTHD01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -705,7 +717,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -705,7 +717,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("acct_code", "VMACCT1",userId); errString = itmdbaccess.getErrorString("acct_code","VMACCT1", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -735,7 +748,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -735,7 +748,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if (cnt == 0) if (cnt == 0)
{ {
errString = getErrorString("cctr_code","VMCCTR1", userId); errString = itmdbaccess.getErrorString("cctr_code","VMCCTR1", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -751,7 +765,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -751,7 +765,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
else if(childNodeName.equalsIgnoreCase("acct_code__ap")) else if(childNodeName.equalsIgnoreCase("acct_code__ap"))
{ {
//cnt = 0;
System.out.println(":::::::::acct_code__ap::::::::::"); System.out.println(":::::::::acct_code__ap::::::::::");
acctCodeAp = genericUtility.getColumnValue("acct_code__ap", dom); acctCodeAp = genericUtility.getColumnValue("acct_code__ap", dom);
if(acctCodeAp != null && acctCodeAp.trim().length() > 0) if(acctCodeAp != null && acctCodeAp.trim().length() > 0)
...@@ -766,7 +779,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -766,7 +779,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("acct_code__ap", "VMDEPTAC01",userId); errString = itmdbaccess.getErrorString("acct_code__ap","VMDEPTAC01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -782,7 +796,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -782,7 +796,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
else if(childNodeName.equalsIgnoreCase("cctr_code__ap")) else if(childNodeName.equalsIgnoreCase("cctr_code__ap"))
{ {
//cnt = 0;
System.out.println(":::::::::::cctr_code__ap::::::::::::"); System.out.println(":::::::::::cctr_code__ap::::::::::::");
cctrCodeAp = genericUtility.getColumnValue("cctr_code__ap", dom); cctrCodeAp = genericUtility.getColumnValue("cctr_code__ap", dom);
if(cctrCodeAp !=null && cctrCodeAp.trim().length() > 0) if(cctrCodeAp !=null && cctrCodeAp.trim().length() > 0)
...@@ -797,7 +810,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -797,7 +810,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if (cnt == 0) if (cnt == 0)
{ {
errString = getErrorString("cctr_code__ap","VMDEPTCC01", userId); errString = itmdbaccess.getErrorString("cctr_code__ap","VMDEPTCC01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -827,7 +841,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -827,7 +841,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("pay_table","VMPYTAB2", userId); errString = itmdbaccess.getErrorString("pay_table","VMPYTAB2", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -861,7 +876,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -861,7 +876,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("dept_code__parent", "VMDEPTPD01",userId); errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -894,7 +910,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -894,7 +910,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt > 0) if(cnt > 0)
{ {
errString = getErrorString("dept_code__parent","VMDEPTPD02", userId); errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD02", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -912,7 +929,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -912,7 +929,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
else else
{ {
errString = getErrorString("dept_code__parent","VMDEPTPD03", userId); errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD03", userId, "", connectionObject);
return errString;
} }
} }
else if(childNodeName.equalsIgnoreCase("bu_code")) else if(childNodeName.equalsIgnoreCase("bu_code"))
...@@ -932,7 +950,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -932,7 +950,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if (cnt == 0) if (cnt == 0)
{ {
errString = getErrorString("bu_code","VMDEPTBU01", userId); errString = itmdbaccess.getErrorString("bu_code","VMDEPTBU01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -963,7 +982,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -963,7 +982,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("func_code","VMDEPTFU01", userId); errString = itmdbaccess.getErrorString("func_code","VMDEPTFU01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
...@@ -995,9 +1015,20 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -995,9 +1015,20 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
{ {
cnt = resultSet.getInt("cnt"); cnt = resultSet.getInt("cnt");
} }
if (resultSet != null)
{
resultSet.close();
resultSet = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("emp_code__funchead", "VMDEPTFH01",userId); errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH01", userId, "", connectionObject);
return errString;
} }
else else
{ {
...@@ -1010,15 +1041,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -1010,15 +1041,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
mVal1 = resultSet.getString("status"); mVal1 = resultSet.getString("status");
mdate1 = resultSet.getTimestamp("relieve_date"); mdate1 = resultSet.getTimestamp("relieve_date");
} }
if(mVal1 != null && mVal1.trim().equalsIgnoreCase("S"))
{
errString = getErrorString("emp_code__funchead", "VMDEPTFH02",userId);
}
else if(mdate1 != null &&( utilmethod.date(mdate1).equals(utilmethod.today()) || utilmethod.date(mdate1).before(utilmethod.today())))
{
errString = getErrorString("emp_code__funchead", "VMDEPTFH03",userId);
System.out.println("relieve_date line 835>>>>"+mdate1);
}
if (resultSet != null) if (resultSet != null)
{ {
resultSet.close(); resultSet.close();
...@@ -1029,16 +1051,16 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -1029,16 +1051,16 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} if(mVal1 != null && mVal1.trim().equalsIgnoreCase("S"))
if (resultSet != null) {
{ errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH02", userId, "", connectionObject);
resultSet.close(); return errString;
resultSet = null; }
} else if(mdate1 != null &&( utilmethod.date(mdate1).equals(utilmethod.today()) || utilmethod.date(mdate1).before(utilmethod.today())))
if (pstmt != null) {
{ errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH03", userId, "", connectionObject);
pstmt.close(); return errString;
pstmt = null; }
} }
} }
...@@ -1060,7 +1082,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal ...@@ -1060,7 +1082,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
} }
if(cnt == 0) if(cnt == 0)
{ {
errString = getErrorString("item_ser", "VMDEPTIS01",userId); errString = itmdbaccess.getErrorString("item_ser","VMDEPTIS01", userId, "", connectionObject);
return errString;
} }
if (resultSet != null) if (resultSet != null)
{ {
......
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