Commit e12ddd8d authored by asikarwar's avatar asikarwar

change in ejb for period validation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93118 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 61da2977
...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.fin; ...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.fin;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.utility.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -25,6 +26,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -25,6 +26,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
String winName = null; String winName = null;
FinCommon finCommon = null; FinCommon finCommon = null;
DistCommon disCommon = null;
ValidatorEJB validator = null; ValidatorEJB validator = null;
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException, ITMException
...@@ -144,6 +146,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -144,6 +146,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
try try
{ {
this.finCommon = new FinCommon(); this.finCommon = new FinCommon();
this.disCommon = new DistCommon();
this.validator = new ValidatorEJB(); this.validator = new ValidatorEJB();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode"); userId = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
...@@ -168,9 +171,18 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -168,9 +171,18 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
if (childNodeName.equalsIgnoreCase("tran_date")) if (childNodeName.equalsIgnoreCase("tran_date"))
{ {
tranDateS=this.genericUtility.getColumnValue("tran_date", dom); tranDateS=this.genericUtility.getColumnValue("tran_date", dom);
siteCode = this.genericUtility.getColumnValue("site_code", dom);
if (tranDateS != null && !tranDateS.matches("\\d{4}-[01]\\d-[0-3]\\d")) if (tranDateS != null && !tranDateS.matches("\\d{4}-[01]\\d-[0-3]\\d"))
{ {
tranDate = dateFormat2.parse(tranDateS); tranDate = dateFormat2.parse(tranDateS);
/* errCode = this.checkPeriod("FIN", siteCode, tranDate, conn);
if(errCode != null && errCode.trim().length() >0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
} }
else else
{ {
...@@ -311,6 +323,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -311,6 +323,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
} }
if ((errCode == null) || (errCode.trim().length() == 0)) if ((errCode == null) || (errCode.trim().length() == 0))
{ {
System.out.println("prioddddddddd");
tranDate = dateFormat2.parse(this.genericUtility.getColumnValue("tran_date", dom)); tranDate = dateFormat2.parse(this.genericUtility.getColumnValue("tran_date", dom));
errCode = checkPeriod("FIN", siteCode, tranDate, conn); errCode = checkPeriod("FIN", siteCode, tranDate, conn);
if(errCode != null && errCode.trim().length() >0) if(errCode != null && errCode.trim().length() >0)
...@@ -1326,11 +1339,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -1326,11 +1339,13 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
else if (childNodeName.equalsIgnoreCase("cctr_code")) else if (childNodeName.equalsIgnoreCase("cctr_code"))
{ {
cctrCode = this.genericUtility.getColumnValue("cctr_code", dom); cctrCode = this.genericUtility.getColumnValue("cctr_code", dom);
System.out.println("CTTC CODE "+cctrCode);
if(cctrCode != null && cctrCode.trim().length() > 0) if(cctrCode != null && cctrCode.trim().length() > 0)
{ {
acctCode = this.genericUtility.getColumnValue("acct_code", dom); acctCode = this.genericUtility.getColumnValue("acct_code", dom);
if(acctCode == null || acctCode.trim().length() == 0){acctCode="";} //if(acctCode == null || acctCode.trim().length() == 0){acctCode="";}
errCode = validateCctrCode(cctrCode , acctCode, conn); System.out.println("CTTC CODE 111["+cctrCode+""+acctCode);
errCode = validateCctrCode(cctrCode, acctCode, conn);
if(errCode != null && errCode.trim().length() > 0) if(errCode != null && errCode.trim().length() > 0)
{ {
errList.add(errCode); errList.add(errCode);
...@@ -1343,6 +1358,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -1343,6 +1358,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
else if (childNodeName.equalsIgnoreCase("anal_code")) else if (childNodeName.equalsIgnoreCase("anal_code"))
{ {
analCode = this.genericUtility.getColumnValue("anal_code", dom); analCode = this.genericUtility.getColumnValue("anal_code", dom);
System.out.println("CTTC CODE "+cctrCode);
if(analCode != null && analCode.trim().length() > 0) if(analCode != null && analCode.trim().length() > 0)
{ {
sql = "select count(*) from analysis where anal_code = ?"; sql = "select count(*) from analysis where anal_code = ?";
...@@ -3637,6 +3653,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt ...@@ -3637,6 +3653,11 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
errorCode = "VTPRDTFIN"; errorCode = "VTPRDTFIN";
} }
} }
else
{
errorCode = "VMSTATSND";
}
pst.close(); pst.close();
pst = null; pst = 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