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
...@@ -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);
} }
} }
...@@ -1387,10 +1384,56 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1387,10 +1384,56 @@ 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));
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")) else if(childNodeName.equalsIgnoreCase("date_from"))
{ {
System.out.println(":::Inside date_from Validation:::"); System.out.println(":::: Inside date_from Validation ::::");
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom)); 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);
...@@ -1419,17 +1462,38 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1419,17 +1462,38 @@ 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");
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", dom1));
if(mDate2Str != null && mDate2Str.trim().length() > 0)
{
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)
{ {
mDate2Str = checkNull(genericUtility.getColumnValue("date_from", dom));
mDate1 = Timestamp.valueOf(genericUtility.getValidDateString(mDate2Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
mDate3Str = checkNull(genericUtility.getColumnValue("date_to", dom));
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(mDate2 != null && mDate3 != null)
{
if(mDate1.after(mDate2) || mDate1.equals(mDate2)) if(mDate1.after(mDate2) || mDate1.equals(mDate2))
{ {
if(mDate1.after(mDate3)) if(mDate1.after(mDate3))
...@@ -1454,6 +1518,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1454,6 +1518,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
} }
} }
} }
}
else else
{ {
errList.add("VMDTNUL1"); errList.add("VMDTNUL1");
...@@ -1467,63 +1532,15 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1467,63 +1532,15 @@ 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)
...@@ -1531,7 +1548,7 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1531,7 +1548,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");
} }
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)
{ {
...@@ -1549,6 +1566,18 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1549,6 +1566,18 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
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)
...@@ -1562,10 +1591,9 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote ...@@ -1562,10 +1591,9 @@ public class TourIC extends ValidatorEJB implements TourICLocal,TourICRemote
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");
......
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