Commit 8f741124 authored by ysawant's avatar ysawant

Updated component of Tour Programme menu

TourIC.java



git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216875 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ebb09ab4
...@@ -141,7 +141,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -141,7 +141,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
System.out.println("currentFormNo...." + currentFormNo); System.out.println("currentFormNo...." + currentFormNo);
if (objContext != null && objContext.trim().length() > 0) if (objContext != null && objContext.trim().length() > 0)
{ {
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
...@@ -379,19 +379,19 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -379,19 +379,19 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("mDate1 ========"+mDate1); System.out.println("mDate1 ========"+mDate1);
} }
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom));
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom)); tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom));
tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom)); tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom));
valueXmlString.append("<start_time>").append("<![CDATA["+mDate1Str+"]]>").append("</start_time>"); valueXmlString.append("<start_time>").append("<![CDATA["+mDate1Str+"]]>").append("</start_time>");
if("B".equalsIgnoreCase(tourStarts) || "B".equalsIgnoreCase(tourEnds)) if("B".equalsIgnoreCase(tourStarts) || "B".equalsIgnoreCase(tourEnds))
{ {
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
...@@ -434,7 +434,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -434,7 +434,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
{ {
if(mDate1.after(mDate2)) if(mDate1.after(mDate2))
...@@ -442,36 +442,36 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -442,36 +442,36 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1; noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1;
} }
} }
if(String.valueOf(noDays) == null ||noDays < 0) if(String.valueOf(noDays) == null ||noDays < 0)
{ {
noDays = 0; noDays = 0;
} }
valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>"); valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>");
} }
else if(currentColumn.trim().equalsIgnoreCase("date_to")) else if(currentColumn.trim().equalsIgnoreCase("date_to"))
{ {
System.out.println("::::Inside date_to::::"); System.out.println("::::Inside date_to::::");
mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom)); mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom));
if(mDate1Str != null && mDate1Str.trim().length() > 0) if(mDate1Str != null && mDate1Str.trim().length() > 0)
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom));
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom)); tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom));
tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom)); tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom));
valueXmlString.append("<end_time>").append("<![CDATA["+mDate2Str+"]]>").append("</end_time>"); valueXmlString.append("<end_time>").append("<![CDATA["+mDate2Str+"]]>").append("</end_time>");
if("B".equalsIgnoreCase(tourStarts) || "B".equalsIgnoreCase(tourEnds)) if("B".equalsIgnoreCase(tourStarts) || "B".equalsIgnoreCase(tourEnds))
{ {
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
...@@ -499,7 +499,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -499,7 +499,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
} }
else else
{ {
...@@ -515,7 +515,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -515,7 +515,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
{ {
if(mDate2.before(mDate1)) if(mDate2.before(mDate1))
...@@ -523,14 +523,14 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -523,14 +523,14 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1; noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1;
} }
} }
if(String.valueOf(noDays) == null ||noDays < 0) if(String.valueOf(noDays) == null ||noDays < 0)
{ {
noDays = 0; noDays = 0;
} }
valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>"); valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>");
} }
else if(currentColumn.trim().equalsIgnoreCase("tour_starts")) else if(currentColumn.trim().equalsIgnoreCase("tour_starts"))
{ {
...@@ -538,7 +538,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -538,7 +538,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom)); tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom));
noDaysStr = checkNull(genericUtility.getColumnValue("no_days", dom)); noDaysStr = checkNull(genericUtility.getColumnValue("no_days", dom));
if(noDaysStr != null && noDaysStr.trim().length()>0) if(noDaysStr != null && noDaysStr.trim().length()>0)
{ {
noDays = Double.parseDouble(noDaysStr); noDays = Double.parseDouble(noDaysStr);
...@@ -555,7 +555,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -555,7 +555,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
{ {
if(mDate1.before(mDate2) || mDate1.equals(mDate2)) if(mDate1.before(mDate2) || mDate1.equals(mDate2))
...@@ -588,7 +588,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -588,7 +588,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1; noDays = utilmethod.DaysAfter(mDate1, mDate2) + 1;
} }
} }
if(String.valueOf(noDays) == null ||noDays < 0) if(String.valueOf(noDays) == null ||noDays < 0)
{ {
...@@ -605,7 +605,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -605,7 +605,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom)); tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom));
noDaysStr = checkNull(genericUtility.getColumnValue("no_days", dom)); noDaysStr = checkNull(genericUtility.getColumnValue("no_days", dom));
if(noDaysStr != null && noDaysStr.trim().length()>0) if(noDaysStr != null && noDaysStr.trim().length()>0)
{ {
noDays = Double.parseDouble(noDaysStr); noDays = Double.parseDouble(noDaysStr);
...@@ -616,13 +616,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -616,13 +616,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom));
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
{ {
if(mDate2.after(mDate1) || mDate2.equals(mDate1)) if(mDate2.after(mDate1) || mDate2.equals(mDate1))
...@@ -660,7 +660,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -660,7 +660,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
{ {
noDays = 0; noDays = 0;
} }
valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>"); valueXmlString.append("<no_days>").append("<![CDATA["+noDays+"]]>").append("</no_days>");
} }
valueXmlString.append ("</Detail1>\r\n"); valueXmlString.append ("</Detail1>\r\n");
...@@ -687,16 +687,16 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -687,16 +687,16 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
{ {
System.out.println("::::Inside itm_default case 2::::"); System.out.println("::::Inside itm_default case 2::::");
System.out.println("xtraParams ==="+xtraParams); System.out.println("xtraParams ==="+xtraParams);
tourId = checkNull(genericUtility.getColumnValue("tour_id", dom)); tourId = checkNull(genericUtility.getColumnValue("tour_id", dom));
System.out.println("tourId---->"+tourId); System.out.println("tourId---->"+tourId);
valueXmlString.append("<tour_id>").append("<![CDATA["+tourId+"]]>").append("</tour_id>"); valueXmlString.append("<tour_id>").append("<![CDATA["+tourId+"]]>").append("</tour_id>");
lineStr = checkNull(genericUtility.getColumnValue("line_no", dom)); lineStr = checkNull(genericUtility.getColumnValue("line_no", dom));
System.out.println("lineStr---->"+lineStr); System.out.println("lineStr---->"+lineStr);
if(lineStr != null && lineStr.trim().length() > 0) if(lineStr != null && lineStr.trim().length() > 0)
{ {
liLine = Long.parseLong(lineStr); liLine = Long.parseLong(lineStr);
...@@ -747,13 +747,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -747,13 +747,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
valueXmlString.append("<stan_code>").append("<![CDATA["+mstancd+"]]>").append("</stan_code>"); valueXmlString.append("<stan_code>").append("<![CDATA["+mstancd+"]]>").append("</stan_code>");
valueXmlString.append("<to_place>").append("<![CDATA["+mplace+"]]>").append("</to_place>"); valueXmlString.append("<to_place>").append("<![CDATA["+mplace+"]]>").append("</to_place>");
if(mdtfr != null) if(mdtfr != null)
{ {
mdtfrStr = genericUtility.getValidDateString(mdtfr, genericUtility.getApplDateFormat()); mdtfrStr = genericUtility.getValidDateString(mdtfr, genericUtility.getApplDateFormat());
} }
valueXmlString.append("<date_from>").append("<![CDATA["+mdtfrStr+"]]>").append("</date_from>"); valueXmlString.append("<date_from>").append("<![CDATA["+mdtfrStr+"]]>").append("</date_from>");
if(mdtto != null) if(mdtto != null)
{ {
mdttoStr = genericUtility.getValidDateString(mdtto, genericUtility.getApplDateFormat()); mdttoStr = genericUtility.getValidDateString(mdtto, genericUtility.getApplDateFormat());
...@@ -762,7 +762,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -762,7 +762,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
valueXmlString.append("<purpose>").append("<![CDATA["+mpurpose+"]]>").append("</purpose>"); valueXmlString.append("<purpose>").append("<![CDATA["+mpurpose+"]]>").append("</purpose>");
valueXmlString.append("<mode_travel>").append("<![CDATA["+mroad+"]]>").append("</mode_travel>"); valueXmlString.append("<mode_travel>").append("<![CDATA["+mroad+"]]>").append("</mode_travel>");
} }
else if(currentColumn.trim().equalsIgnoreCase("stan_code")) else if(currentColumn.trim().equalsIgnoreCase("stan_code"))
{ {
System.out.println("::::Inside stan_code::::"); System.out.println("::::Inside stan_code::::");
...@@ -932,7 +932,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -932,7 +932,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
System.out.println(" ***********Validation for Tour "+currentFormNo + " ***********"); System.out.println(" ***********Validation for Tour "+currentFormNo + " ***********");
sql = "select usr_lev from users where code = ? "; sql = "select usr_lev from users where code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userId); pstmt.setString(1, userId);
...@@ -982,7 +982,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -982,7 +982,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
System.out.println(":::Inside emp_code Validation:::"); System.out.println(":::Inside emp_code Validation:::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
sql = "select count(*) as cnt from employee where emp_code = ? and work_site = (case when ? > 1 then ? else work_site end)"; sql = "select count(*) as cnt from employee where emp_code = ? and work_site = (case when ? > 1 then ? else work_site end)";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode); pstmt.setString(1,empCode);
...@@ -1067,7 +1067,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1067,7 +1067,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
System.out.println("empCode :::["+empCode+"]"); System.out.println("empCode :::["+empCode+"]");
System.out.println("tour empCode :::["+mtpemp+"]"); System.out.println("tour empCode :::["+mtpemp+"]");
if(!empCode.equalsIgnoreCase(mtpemp)) if(!empCode.equalsIgnoreCase(mtpemp))
{ {
errList.add("VTEMPNF"); errList.add("VTEMPNF");
...@@ -1125,12 +1125,12 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1125,12 +1125,12 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
System.out.println(":::Inside no_days Validation:::"); System.out.println(":::Inside no_days Validation:::");
noDays =checkNull(genericUtility.getColumnValue("no_days", dom)); noDays =checkNull(genericUtility.getColumnValue("no_days", dom));
if(noDays != null && noDays.trim().length() > 0) if(noDays != null && noDays.trim().length() > 0)
{ {
lval = Double.parseDouble(noDays); lval = Double.parseDouble(noDays);
} }
if(lval <= 0) if(lval <= 0)
{ {
errList.add("VTTOUR0003"); errList.add("VTTOUR0003");
...@@ -1148,13 +1148,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1148,13 +1148,13 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom));
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom)); tourStarts = checkNull(genericUtility.getColumnValue("tour_starts", dom));
tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom)); tourEnds = checkNull(genericUtility.getColumnValue("tour_ends", dom));
...@@ -1206,11 +1206,11 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1206,11 +1206,11 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
else if(childNodeName.equalsIgnoreCase("plan_id")) else if(childNodeName.equalsIgnoreCase("plan_id"))
{ {
System.out.println(":::Inside plan_id Validation:::"); System.out.println(":::Inside plan_id Validation:::");
planId = checkNull(genericUtility.getColumnValue("plan_id", dom)); planId = checkNull(genericUtility.getColumnValue("plan_id", dom));
if(planId != null && planId.trim().length() > 0) if(planId != null && planId.trim().length() > 0)
{ {
sql = "select count(*) as cnt from tourplan where plan_id = ?"; sql = "select count(*) as cnt from tourplan where plan_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,planId); pstmt.setString(1,planId);
...@@ -1245,17 +1245,17 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1245,17 +1245,17 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
else if(childNodeName.equalsIgnoreCase("date_to")) else if(childNodeName.equalsIgnoreCase("date_to"))
{ {
System.out.println(":::Inside date_to Validation:::"); System.out.println(":::Inside date_to Validation:::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom));
System.out.println("mDate2Str---->"+mDate2Str); System.out.println("mDate2Str---->"+mDate2Str);
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("mDate2---->"+mDate2); System.out.println("mDate2---->"+mDate2);
} }
sql = "select relieve_date from employee where emp_code = ?"; sql = "select relieve_date from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode); pstmt.setString(1,empCode);
...@@ -1274,7 +1274,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1274,7 +1274,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(ldRel != null && mDate2 != null && mDate2.after(ldRel)) if(ldRel != null && mDate2 != null && mDate2.after(ldRel))
{ {
errList.add("VTRELDT"); errList.add("VTRELDT");
...@@ -1286,14 +1286,14 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1286,14 +1286,14 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
System.out.println("--after relive date---"); System.out.println("--after relive date---");
mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom)); mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom));
if(mDate1Str != null && mDate1Str.trim().length() > 0) if(mDate1Str != null && mDate1Str.trim().length() > 0)
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("mDate1---->"+mDate1); System.out.println("mDate1---->"+mDate1);
} }
if(mDate1 == null || mDate2 == null) if(mDate1 == null || mDate2 == null)
{ {
errList.add("VEDATE"); errList.add("VEDATE");
...@@ -1339,14 +1339,11 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1339,14 +1339,11 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
break; break;
} }
} }
if(mDate != null && mDate2 != null) if(mDate.after(mDate2) || mDate.equals(mDate2)) //if mdate >= mdate2 then
{ {
if(mDate.after(mDate2) || mDate.equals(mDate2)) //if mdate >= mdate2 then break;
{ }
break; mDate = utilmethod.RelativeDate(mDate, 1);
}
mDate = utilmethod.RelativeDate(mDate, 1);
}
} while (true); } while (true);
} }
} }
...@@ -1370,7 +1367,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1370,7 +1367,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
continue; continue;
} }
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if(childNodeName.equalsIgnoreCase("to_place")) if(childNodeName.equalsIgnoreCase("to_place"))
{ {
System.out.println(":::Inside to_place Validation:::"); System.out.println(":::Inside to_place Validation:::");
...@@ -1387,11 +1384,57 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1387,11 +1384,57 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
else if(childNodeName.equalsIgnoreCase("date_from")) else if(childNodeName.equalsIgnoreCase("line_no__plan"))
{ {
System.out.println(":::Inside date_from Validation:::"); System.out.println(":::Inside line_no__plan Validation:::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
lineNo = checkNull(genericUtility.getColumnValue("line_no__plan", dom));
planId = checkNull(genericUtility.getColumnValue("plan_id", dom1));
System.out.println("lineNo -->"+lineNo);
System.out.println("planId -->"+planId);
if(lineNo != null && lineNo.trim().length() > 0)
{
lval = Double.parseDouble(lineNo);
sql = "select count(*) as cnt from Tourplandet where plan_id = ? and line_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,planId);
pstmt.setDouble(2,lval);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errList.add("VMPLANLINE");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMPLANLINE");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
else if(childNodeName.equalsIgnoreCase("date_from"))
{
System.out.println(":::: Inside date_from Validation ::::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom1));
System.out.println("EMPCODE =="+empCode);
sql = "select work_site from employee where emp_code = ?"; sql = "select work_site from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode); pstmt.setString(1,empCode);
...@@ -1410,29 +1453,61 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1410,29 +1453,61 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom)); mDate1Str = checkNull(genericUtility.getColumnValue("date_from", dom));
System.out.println("mDate1Str---->>"+mDate1Str); System.out.println("mDate1Str---->>"+mDate1Str);
if(mDate1Str != null && mDate1Str.trim().length() > 0) if(mDate1Str != null && mDate1Str.trim().length() > 0)
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
errCode = finCommon.nfCheckPeriod("ADM", mDate1, lsSite, conn); errCode = finCommon.nfCheckPeriod("ADM", mDate1, lsSite, conn);
System.out.println("errCode -->"+errCode);
if(errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
} }
if(errCode == null || errCode.trim().length() == 0) if(errCode == null || errCode.trim().length() == 0)
{ {
if(mDate1 == null) if(mDate1 != null)
{ {
mDate2Str = checkNull(genericUtility.getColumnValue("date_from", dom)); mDate2Str = checkNull(genericUtility.getColumnValue("date_from", dom1));
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); if(mDate2Str != null && mDate2Str.trim().length() > 0)
mDate3Str = checkNull(genericUtility.getColumnValue("date_to", dom));
mDate3 = Timestamp.valueOf(genericUtility.getValidDateString(mDate3Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
if(mDate1.after(mDate2) || mDate1.equals(mDate2))
{ {
if(mDate1.after(mDate3)) mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
mDate3Str = checkNull(genericUtility.getColumnValue("date_to", dom1));
if(mDate3Str != null && mDate3Str.trim().length() > 0)
{
mDate3 = Timestamp.valueOf(genericUtility.getValidDateString(mDate3Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(mDate2 != null && mDate3 != null)
{
if(mDate1.after(mDate2) || mDate1.equals(mDate2))
{
if(mDate1.after(mDate3))
{
errList.add("VTDTFR1");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VTDTFR1");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
else
{ {
errList.add("VTDTFR1"); errList.add("VTDTFR1");
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
...@@ -1443,16 +1518,6 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1443,16 +1518,6 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
else
{
errList.add("VTDTFR1");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VTDTFR1");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
} }
else else
{ {
...@@ -1466,78 +1531,30 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1466,78 +1531,30 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
else if(childNodeName.equalsIgnoreCase("line_no__plan"))
{
System.out.println(":::Inside line_no__plan Validation:::");
lineNo = checkNull(genericUtility.getColumnValue("line_no__plan", dom));
System.out.println("lineNo -->"+lineNo);
if(lineNo != null && lineNo.trim().length() > 0)
{
lval = Double.parseDouble(lineNo);
}
planId = checkNull(genericUtility.getColumnValue("plan_id", dom1));
System.out.println("planId -->"+planId);
if(String.valueOf(lval) != null)
{
sql = "select count(*) as cnt from Tourplandet where plan_id = ? and line_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,planId);
pstmt.setDouble(2,lval);
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt("cnt");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errList.add("VMPLANLINE");
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, "VMPLANLINE");
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
else if(childNodeName.equalsIgnoreCase("date_to")) else if(childNodeName.equalsIgnoreCase("date_to"))
{ {
System.out.println(":::Inside date_to Validation form 2:::"); System.out.println(":::: Inside date_to Validation form 2 ::::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", dom1));
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom)); System.out.println("emp-Code -->"+empCode);
mDate2Str = checkNull(genericUtility.getColumnValue("date_to", dom1));
System.out.println("Dom 1 mDate2Str --> "+mDate2Str); System.out.println("Dom 1 mDate2Str --> "+mDate2Str);
if(mDate2Str != null && mDate2Str.trim().length() > 0) if(mDate2Str != null && mDate2Str.trim().length() > 0)
{ {
mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate2 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
mDate1Str = checkNull(genericUtility.getColumnValue("date_to", dom1)); mDate1Str = checkNull(genericUtility.getColumnValue("date_to", dom));
System.out.println("mDate1Str --> "+mDate1Str); System.out.println("mDate1Str --> "+mDate1Str);
if(mDate1Str != null && mDate1Str.trim().length() > 0) if(mDate1Str != null && mDate1Str.trim().length() > 0)
{ {
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
sql = "select work_site from employee where emp_code = ?"; sql = "select work_site from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,empCode); pstmt.setString(1,empCode);
...@@ -1545,10 +1562,22 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1545,10 +1562,22 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
if (rs.next()) if (rs.next())
{ {
lsSite = checkNull(rs.getString("work_site")); lsSite = checkNull(rs.getString("work_site"));
if(mDate1 != null) if(mDate1 != null)
{ {
errCode = admCommon.gbfEmp(empCode, mDate1, lsSite, loginSiteCode, conn); errCode = admCommon.gbfEmp(empCode, mDate1, lsSite, loginSiteCode, conn);
System.out.println("errCode -->"+errCode);
if(errCode != null && errCode.trim().length() > 0)
{
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
errorType = errorType(conn, errCode);
if(errorType.equalsIgnoreCase("E"))
{
break;
}
}
} }
} }
if (rs != null) if (rs != null)
...@@ -1561,16 +1590,15 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1561,16 +1590,15 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(mDate1 != null && mDate2 != null) if(mDate1 != null && mDate2 != null)
{ {
mDate3Str = checkNull(genericUtility.getColumnValue("date_from", dom)); mDate3Str = checkNull(genericUtility.getColumnValue("date_from", dom1));
if(mDate3Str != null && mDate3Str.trim().length() > 0) if(mDate3Str != null && mDate3Str.trim().length() > 0)
{ {
mDate3 = Timestamp.valueOf(genericUtility.getValidDateString(mDate3Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); mDate3 = Timestamp.valueOf(genericUtility.getValidDateString(mDate3Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
} }
if(mDate1.before(mDate2) || mDate1.equals(mDate2) && mDate3 != null) if(mDate1.before(mDate2) || mDate1.equals(mDate2) && mDate3 != null)
{ {
if(mDate1.before(mDate3)) if(mDate1.before(mDate3))
...@@ -1752,7 +1780,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1752,7 +1780,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
return msgType; return msgType;
} }
private String checkNull(String input) private String checkNull(String input)
{ {
if (input == null) if (input == 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