Commit 16110886 authored by ysawant's avatar ysawant

*Updated ShiftPattern component

w_shift_pattern.sql
ShiftPattern.java
ShiftPatternRemote.java
shift-pattern.png
shift-patternwht.png


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@205850 ce508802-f39f-4f6c-b175-0d175dae99d5
parent eb894e40
......@@ -74,7 +74,7 @@ update pophelp set sql_str = 'select shift_pattern from shift_pattern', default_
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VTSPCANT ','shift Can''t null','Shift Pattern can not insert null.','E','Y',null,null,null,to_date('2006-03-23','RRRR-MM-DD'),'BASE ','01BASE215 ',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VTWSNOTM ','Invalid Workshift','Work shift code not matching work site of employee.','E','Y',null,null,null,to_date('2006-03-23','RRRR-MM-DD'),'BASE ','01BASE215 ',null,null);
--------------------------------------------------Yashwant 22-08-2019[Start]
--------------------------------------------------Added on Yashwant 22-08-2019[Start]
delete from obj_actions where obj_name = 'shift_pattern' and line_no in (3,8,39,41,42,43);
......@@ -82,4 +82,10 @@ update obj_actions set image = 'ibase/resource/objaction/edit.svg' where obj_nam
update obj_actions set image = 'ibase/resource/objaction/Audit-trail.svg' where obj_name = 'shift_pattern' and line_no = '21';
update obj_actions set image = 'ibase/resource/objaction/exprtExl.svg' where obj_name = 'shift_pattern' and line_no = '22';
--------------------------------------------------Yashwant 22-08-2019[End]
--------------------------------------------------Added on Yashwant 22-08-2019[End]
--------------------------------------------------Added on Yashwant 22-08-2019[Start]
update itm2menu set icon_path = 'shift-pattern.png', CLOSE_ICON = 'shift-patternwht.png' where win_name = 'w_shift_pattern';
--------------------------------------------------Added on Yashwant 22-08-2019[End]
......@@ -4,7 +4,6 @@ import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
// Changed by Dhiraj 07/10/10 [AD01SUN008]
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -13,10 +12,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ITMDBAccessLocal;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
......@@ -26,7 +23,7 @@ public class ShiftPattern extends ValidatorEJB implements ShiftPatternLocal,Shif
{
String returnValue12 = "";
public String wfValData() throws RemoteException,ITMException
public String wfValData() throws RemoteException,ITMException
{
return "";
}
......@@ -73,21 +70,21 @@ public String wfValData() throws RemoteException,ITMException
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
boolean checkNextCol = true;
//boolean checkNextCol = true;
//String count = "";
String dayslist2 = "";
ArrayList dayslist = new ArrayList();
String columnName = "";
String columnValue = "";
String columnValue1 = "";
//String columnName = "";
//String columnValue = "";
//String columnValue1 = "";
String userId = "";
String sql = "";
String errString = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
String returnValue = "";
String returnValue2 = "";
java.util.Date returnDate = null;
//String returnValue = "";
//String returnValue2 = "";
//java.util.Date returnDate = null;
//Date columnDate = null;
//SimpleDateFormat columnDate1 = null;
NodeList parentList = null;
......@@ -96,8 +93,9 @@ public String wfValData() throws RemoteException,ITMException
Node childNode = null;
String childNodeName = null;
String shiftPattern = null;
String patternCode= "";
//String dayslist = null;
Statement st = null;
//Statement st = null;
Connection conn = null;
String site_code = "";
int ctr ;
......@@ -110,7 +108,7 @@ public String wfValData() throws RemoteException,ITMException
E12GenericUtility e12GenericUtility = new E12GenericUtility();
//ConnDriver connDriver = new ConnDriver();
ITMDBAccessLocal itmDBAccessLocal = null;
//ITMDBAccessLocal itmDBAccessLocal = null;
//ITMDBAccess itmDBAccess = null;//commented for ejb3
ITMDBAccessEJB itmDBAccess = null; // added for ejb3
itmDBAccess = new ITMDBAccessEJB();
......@@ -150,11 +148,21 @@ public String wfValData() throws RemoteException,ITMException
{
childNode = childList.item(ctr);
childNodeName = childNode.getNodeName();
//Added by Yashwant on 23/08/19 [Start]
if (childNodeName.equals("pattern_code"))
{
patternCode=checkNull(e12GenericUtility.getColumnValue("pattern_code", dom2));
if(patternCode == null || patternCode.trim().length() == 0)
{
errString=itmDBAccess.getErrorString("shift_pattern", "VTPCCANT", userId,"", conn);
}
}
//Added by Yashwant on 23/08/19 [End]
if (childNodeName.equals("shift_pattern"))
{
shiftPattern=e12GenericUtility.getColumnValue("shift_pattern", dom2);
shiftPattern = checkNull(e12GenericUtility.getColumnValue("shift_pattern", dom2));
//if(childNode.getFirstChild() == null)
if(shiftPattern==null || shiftPattern.trim().length()==0)
if(shiftPattern == null || shiftPattern.trim().length() == 0)
{
//Changed by Dhiraj 07/10/10 [AD01SUN008]
//errString = itmDBAccess.getErrorString("shift_pattern","VTSPCANT",userId,errString,connectionObject);
......@@ -215,7 +223,7 @@ public String wfValData() throws RemoteException,ITMException
{
//Changed by Dhiraj 07/10/10 [AD01SUN008]
//errString = itmDBAccess.getErrorString("shift_pattern","VTWSNOTM",userId,errString,connectionObject);
errString = getErrorString("shift_pattern","VTWSNOTM",userId);
//errString = getErrorString("shift_pattern","VTWSNOTM",userId);
errString=itmDBAccess.getErrorString("shift_pattern", "VTWSNOTM", userId,"", conn);
}
}
......@@ -262,7 +270,7 @@ public String wfValData() throws RemoteException,ITMException
System.out.println("error :"+errString);
return (errString);
}
//item change logic
//item change logic
public String itemChanged() throws RemoteException,ITMException
{
return "";
......@@ -306,31 +314,31 @@ public String wfValData() throws RemoteException,ITMException
}
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
char days ;
//char days ;
int shift_no = 0;
String dayslist1 = "";
int total_days = 0;
ArrayList dayslist = new ArrayList();
String columnValue = "";
String site_code = "";
String sql = "";
//String sql = "";
Connection conn = null;
PreparedStatement pstmt=null;
ResultSet rs = null;
// Changed by Dhiraj 07/10/10 [AD01SUN008].start
String loginSite = "";
String siteCodeDescr = "";
//String loginSite = "";
//String siteCodeDescr = "";
// Changed by Dhiraj 07/10/10 [AD01SUN008] .end
StringBuffer valueXmlString = new StringBuffer();
ConnDriver connDriver = new ConnDriver();
//ConnDriver connDriver = new ConnDriver();
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility e12GenericUtility = new E12GenericUtility();
try
{
//conn = connDriver.getConnectDB("DriverITM");
conn=getConnection();
columnValue = e12GenericUtility.getColumnValue(currentColumn,dom);
columnValue = checkNull(e12GenericUtility.getColumnValue(currentColumn,dom));
System.out.println("columnValue :"+columnValue);
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><Header><editFlag>");
valueXmlString.append(editFlag).append("</editFlag></Header>");
......@@ -357,15 +365,22 @@ public String wfValData() throws RemoteException,ITMException
}
else if (currentColumn.trim().equals("shift_pattern"))
{
if(columnValue.trim() != null && columnValue.trim().length() > 0)
{
dayslist = e12GenericUtility.getTokenList(columnValue, ";");
System.out.println("--------------------dayslist="+dayslist.size());
//System.out.println("--------------------dayslist="+dayslist.size());
System.out.println("dayslist = "+dayslist);
for(int ctr = 0; ctr < dayslist.size(); ctr++)
{
String strDaysList =dayslist.get(ctr).toString();
System.out.println("strDaysList:"+strDaysList);
int index = strDaysList.indexOf('-');
System.out.println("index:"+index);
if(index >= 0)
{
dayslist1 = strDaysList.substring(0,index);
System.out.println("dayslist:-------------------------"+dayslist1);
shift_no = Integer.parseInt(dayslist1.toString());
......@@ -377,8 +392,12 @@ public String wfValData() throws RemoteException,ITMException
total_days = total_days + shift_no;
System.out.println("--------------------dayslist="+total_days);
}
}
System.out.println("-----------------------------total_days ="+total_days);
valueXmlString.append("<no_of_days>").append(total_days).append("</no_of_days>\r\n");
}
//GenericUtility.getInstance();
}
valueXmlString.append("</Detail1>\r\n");
......@@ -418,7 +437,8 @@ public String wfValData() throws RemoteException,ITMException
conn = null;
}
// Modified by Piyush on 08/12/2011 to close the connection/statements/resultsets in finally block .Start
}catch(Exception e)
}
catch(Exception e)
{
//Modified by Yashwant-throw the Excecption on 09/07/2019[Start]
e.printStackTrace();
......
package ibase.webitm.ejb.adm;
import java.rmi.RemoteException;
import org.w3c.dom.Document;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException; public interface ShiftPatternRemote extends ValidatorRemote
{
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException; public String itemChanged(Document dom, Document dom1,Document dom2, String objContext, String currentColumn, 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 ;
public String wfValData(Document dom, Document dom1, Document dom2,String objContext, String editFlag, String xtraParams)throws RemoteException, ITMException;
}
package ibase.webitm.ejb.adm;import java.rmi.RemoteException;//import javax.ejb.EJBObject; import org.w3c.dom.*; import ibase.webitm.utility.ITMException; import ibase.webitm.ejb.*; import javax.ejb.Remote; // added for ejb3 @Remote // added for ejb3 public interface ShiftPatternRemote extends ValidatorRemote //,EJBObject { public String itemChanged() throws RemoteException,ITMException; public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException; public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException; }
\ No newline at end of file
......
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