Commit 401c96dd authored by syadav's avatar syadav

to insert confirm NO and show error if no day and shift in workcntrshft for given work center


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91221 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3934cc52
...@@ -210,7 +210,6 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -210,7 +210,6 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
{ {
return errString = itmDBAccessEJB.getErrorString("","VMSITE1",chgUser); return errString = itmDBAccessEJB.getErrorString("","VMSITE1",chgUser);
}//VMWCTR1 }//VMWCTR1
} }
if(wokCntr != null) if(wokCntr != null)
{ {
...@@ -229,7 +228,6 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -229,7 +228,6 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
{ {
return errString = itmDBAccessEJB.getErrorString("","VMWCTR1",chgUser); return errString = itmDBAccessEJB.getErrorString("","VMWCTR1",chgUser);
} }
} }
if(datefrom == null || datefrom.trim().length() == 0 || dateto == null || dateto.trim().length() == 0) if(datefrom == null || datefrom.trim().length() == 0 || dateto == null || dateto.trim().length() == 0)
{ {
...@@ -315,6 +313,12 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -315,6 +313,12 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
System.out.println("Connection commited................. "); System.out.println("Connection commited................. ");
errString = itmDBAccessEJB.getErrorString("","WRKCALSUCC",chgUser); errString = itmDBAccessEJB.getErrorString("","WRKCALSUCC",chgUser);
} }
else if(errString.equals("VTNORECFND"))
{
System.out.println("Connection rollbacked");
oraConn.rollback();
errString = itmDBAccessEJB.getErrorString("","VTNORECFND",chgUser);
}
else else
{ {
System.out.println("Connection rollbacked"); System.out.println("Connection rollbacked");
...@@ -489,12 +493,14 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -489,12 +493,14 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(dayMap.size() > 0 && shiftMap.size() > 0)
{
Iterator it = dayMap.keySet().iterator(); Iterator it = dayMap.keySet().iterator();
Iterator itshft = shiftMap.keySet().iterator(); Iterator itshft = shiftMap.keySet().iterator();
System.out.println("Reading data...... " ); System.out.println("Reading data...... " );
while( itshft.hasNext() ) while( itshft.hasNext() )
{ {
while( it.hasNext() ) while(it.hasNext() )
{ {
System.out.println("Inside map.................."); System.out.println("Inside map..................");
InsertPstmt.setString(1,siteCode); InsertPstmt.setString(1,siteCode);
...@@ -527,8 +533,13 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -527,8 +533,13 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
} }
} }
InsertPstmt.executeBatch(); InsertPstmt.executeBatch();
}
else
{
errString = "VTNORECFND";
}
//oraConn.commit(); //oraConn.commit();
System.out.println("data inserted in work calendar sucesfully!" + upd); //System.out.println("data inserted in work calendar sucesfully!" + upd);
} }
while( FromDate.before(ToDate) ); while( FromDate.before(ToDate) );
}//end try }//end try
...@@ -537,7 +548,7 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal, ...@@ -537,7 +548,7 @@ public class WorkCalendarPrc extends ProcessEJB implements WorkCalendarPrcLocal,
exception.printStackTrace(); exception.printStackTrace();
errString = exception.getMessage(); errString = exception.getMessage();
} }
System.out.println("errString in insert schedule.........." + errString); //System.out.println("errString in insert schedule.........." + errString);
return errString; return errString;
}//end inser schedule }//end inser schedule
......
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