Commit f92d933a authored by ngadkari's avatar ngadkari

Request Id - S17KGTP006 Fin entity wise period open/close facility will be made available.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@180984 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a1296efe
......@@ -85,10 +85,15 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
String siteCode = "", currDate = "", retString ="", dateFormat = "";
boolean selectFlag=false,offerSelect=false;
int existCnt=0;
InitialContext ctx = null;
ResultSet rs=null;
PreparedStatement pstmt=null;
String finEntity="",prdCodeFrm="",prdCodeTo="";
String nodeName = "";
String errCode ="";
String effFrom1=null,validUpto1=null,remarks=null,prdCode=null;
int domID = 0, detDomId = 0,previousCnt=0;
Connection conn = null;
......@@ -123,10 +128,10 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
case 1:
{
System.out.println(" -------- Inside itemchange case 1111111 ------------ ");
int existCnt=0;
existCnt=0;
Timestamp effFrom=null,validUpto=null;
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ))
{
System.out.println("loginUser"+loginUser);
......@@ -150,11 +155,7 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
if( currentColumn.trim().equalsIgnoreCase( "itm_default" ))
{
String finEntity="",prdCodeFrm="",prdCodeTo="";
String nodeName = "";
String errCode ="";
String effFrom1=null,validUpto1=null,remarks=null,prdCode=null;
int domID = 0, detDomId = 0,previousCnt=0;
finEntity=checkNull(e12genericUtility.getColumnValue("fin_entity",dom1));
prdCodeFrm=checkNull(e12genericUtility.getColumnValue("prd_code__from",dom1));
......@@ -198,6 +199,11 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
......@@ -215,7 +221,17 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
finally
{
try
{
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(!conn.isClosed() && conn != null)
{
conn.close();
......@@ -320,8 +336,18 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
System.out.println("Child name --->> "+childNodeName);
if(childNodeName.equalsIgnoreCase("fin_entity"))
{
{
finEntity=e12genericUtility.getColumnValue("fin_entity", currFormDataDom);
if ( finEntity == null || finEntity.trim().length() == 0 )
{
errCode="VEFENTY2";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
String sql="Select count(*) from site where fin_entity= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
......@@ -348,9 +374,16 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
prdCodeFrm=e12genericUtility.getColumnValue("prd_code__from", currFormDataDom);
if ( prdCodeFrm == null || prdCodeFrm.equals("null") || prdCodeFrm.trim().length() == 0 )
{
errCode="VTBLNKPRD";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
if (prdCodeFrm!=null)
{
if(!"0".equalsIgnoreCase(prdCodeFrm.trim()))
if(!"0".equalsIgnoreCase(prdCodeFrm.trim()) && !"00".equalsIgnoreCase(prdCodeFrm.trim()) )
{
......@@ -368,12 +401,12 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
rs.close();
rs=null;
if(count==0)
{
{
errCode="CNDIPRDINV";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
......@@ -384,7 +417,17 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
prdCodeTo=e12genericUtility.getColumnValue("prd_code__to", currFormDataDom);
if ( prdCodeTo == null || prdCodeTo.equals("null") || prdCodeTo.trim().length() == 0 )
{
errCode="VTBLNKPRD";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
if (prdCodeTo!=null)
{
if( !"zz".equalsIgnoreCase(prdCodeTo.trim()) )
{
String sql1="Select count(*) FROM period_stat WHERE PRD_CODE= ?";
pstmt=conn.prepareStatement(sql1);
pstmt.setString(1, prdCodeTo);
......@@ -406,6 +449,8 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
}
}
}
}
......@@ -583,7 +628,11 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
while( rs.next() )
{
msgType = rs.getString("MSG_TYPE");
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch (Exception ex)
{
......@@ -603,6 +652,11 @@ public class PeriodStatUpdWiz extends ValidatorEJB implements PeriodStatUpdWizLo
pstmt.close();
pstmt = null;
}
if(!conn.isClosed() && conn != null)
{
conn.close();
conn = null;
}
}
catch ( Exception e )
{
......
......@@ -67,7 +67,7 @@ public class PeriodStatUpdWizServlet extends HttpServlet
System.out.println(" wizard object found....");
request.getSession().removeAttribute( "WIZARD_BEAN_" + objName );
//Added by Santosh on 31/03/2017 to remove editorID from session
request.getSession().removeAttribute( "WIZARD_BEAN_ID_" + objName );
System.out.println("WIZARD_BEAN_ and WIZARD_BEAN_ID_ removed from session");
request.getRequestDispatcher("/webitm/jsp/PeriodStatUpdWiz.jsp").forward(request, response);
......
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