com.ibm.tivoli.maximo.skd.app

Class SKDLaborHrsSet

  • java.lang.Object
    • Constructor Detail

      • SKDLaborHrsSet

        public SKDLaborHrsSet(MboServerInterface ms)
                       throws java.rmi.RemoteException
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • getMboInstance

        protected Mbo getMboInstance(MboSet ms)
                              throws MXException,
                                     java.rmi.RemoteException
        Description copied from class: MboSet
        Factory to create the business objects This must be overridden in derived class
        Specified by:
        getMboInstance in class MboSet
        Throws:
        MXException
        java.rmi.RemoteException
      • populate

        public void populate(boolean isResourceDataPersistedInScheduler)
                      throws MXException,
                             java.rmi.RemoteException
        This method is called from the bean when user clicks on calculate labor hours button.
        Parameters:
        isResourceDataPersistedInScheduler - - This flag is used to indicate whether the Resource and Reservations data is persisted on Scheduler tables: SKDRESOURCE and SKDRESERVATION. If this is true, SQL queries should match data with those tables for calculations, otherwise they should consider Maximo standard tables: CRAFT, AMCREWT and ASSIGNMENT.
        Throws:
        MXException
        java.rmi.RemoteException
      • populate

        public void populate(java.lang.String startWeekDay,
                             long SKDProjectId,
                             boolean isResourceDataPersistedInScheduler)
                      throws java.lang.Exception,
                             java.rmi.RemoteException
        This method populates skdlaborhrs table.
        Parameters:
        isResourceDataPersistedInScheduler - - This flag is used to indicate whether the Resource and Reservations data is persisted on Scheduler tables: SKDRESOURCE and SKDRESERVATION. If this is true, SQL queries should match data with those tables for calculations, otherwise they should consider Maximo standard tables: CRAFT, AMCREWT and ASSIGNMENT.
        startWeekDay -
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • recalculateSKDLaborHrsTemp

        public void recalculateSKDLaborHrsTemp(long SKDProjectId,
                                               java.util.HashMap craftWorkHoursMap,
                                               java.util.HashMap craftNonWorkHoursMap)
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
        Throws:
        java.lang.Exception
        java.rmi.RemoteException
      • getWeekHrs

        public double getWeekHrs(java.util.Date actStartWeekDate,
                                 java.util.HashMap crafHoursMap,
                                 java.lang.String craft,
                                 java.util.Date minActDate,
                                 java.util.Date maxActDate)
                          throws SchedulerException,
                                 java.rmi.RemoteException,
                                 java.text.ParseException
        Throws:
        SchedulerException
        java.rmi.RemoteException
        java.text.ParseException
      • getMonthHrs

        public double getMonthHrs(java.lang.String year,
                                  java.lang.String actTimePeriod,
                                  java.util.HashMap crafHoursMap,
                                  java.lang.String craft,
                                  java.util.Date minActDate,
                                  java.util.Date maxActDate)
                           throws SchedulerException,
                                  java.rmi.RemoteException,
                                  java.text.ParseException
        Throws:
        SchedulerException
        java.rmi.RemoteException
        java.text.ParseException
      • getResourceAvailData

        public java.util.HashMap getResourceAvailData(java.lang.Long projectId,
                                                      boolean workTime,
                                                      boolean isResourceDataPersistedInScheduler)
                                               throws SchedulerException,
                                                      java.rmi.RemoteException
        Get resource availability data.
        Parameters:
        objectName -
        projectId -
        isResourceDataPersistedInScheduler - - This flag is used to indicate whether the Resource and Reservations data is persisted on Scheduler tables: SKDRESOURCE and SKDRESERVATION. If this is true, SQL queries should match data with those tables for calculations, otherwise they should consider Maximo standard tables: CRAFT, AMCREWT and ASSIGNMENT.
        Throws:
        SchedulerException
        java.rmi.RemoteException
      • getCrewAvailData

        public java.util.HashMap getCrewAvailData(java.lang.Long projectId,
                                                  boolean workTime)
                                           throws SchedulerException,
                                                  java.rmi.RemoteException
        get resource availability data.
        Parameters:
        objectName -
        projectId -
        Throws:
        SchedulerException
        java.rmi.RemoteException
      • deleteSKDLaborHours

        public void deleteSKDLaborHours()
                                 throws MXException,
                                        java.rmi.RemoteException
        This method deletes the data from skdlaborhrs table.
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteSKDLaborHrs

        public void deleteSKDLaborHrs(long SKDProjectId)
                               throws MXException,
                                      java.rmi.RemoteException
        This method deletes the data from skdlaborhrs table for a given projectid.
        Parameters:
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteSKDLaborHrsTemp

        public void deleteSKDLaborHrsTemp()
                                   throws MXException,
                                          java.rmi.RemoteException
        This method deletes the data from skdlaborhrstemp table.
        Throws:
        MXException
        java.rmi.RemoteException
      • deleteSKDLaborHrsTemp

        public void deleteSKDLaborHrsTemp(long SKDProjectId)
                                   throws MXException,
                                          java.rmi.RemoteException
        This method deletes the data from skdlaborhrstemp table for a given projectid.
        Parameters:
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
      • populateLaborHrs

        public void populateLaborHrs()
                              throws java.lang.Exception,
                                     java.rmi.RemoteException
        Populate LaborHrs
        Throws:
        java.lang.Exception
        java.rmi.RemoteException
      • populatePlannedAvblHrs

        public void populatePlannedAvblHrs(java.lang.String startWeekDay,
                                           long SKDProjectId,
                                           boolean isResourceDataPersistedInScheduler)
                                    throws java.lang.Exception,
                                           java.rmi.RemoteException
        Creates the sql based on database and populate Labor Hrs.
        Parameters:
        startWeekDay -
        SKDProjectId -
        Throws:
        MXException
        RemoteExceptio
        java.lang.Exception
        java.rmi.RemoteException
      • populatePlannedLaborHrsDaily

        public void populatePlannedLaborHrsDaily(long SKDProjectId,
                                                 java.lang.String yearDate,
                                                 java.lang.String monthDate,
                                                 java.lang.String monthDateP,
                                                 java.lang.String weekDate,
                                                 java.lang.String dayDate,
                                                 java.lang.String startWeekDate,
                                                 java.lang.String workDate,
                                                 boolean isResourceDataPersistedInScheduler)
                                          throws MXException,
                                                 java.rmi.RemoteException
        Calculate planned labor hours.
        Parameters:
        SKDProjectId -
        yearDate, -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        dailyDate -
        Throws:
        MXException
        java.rmi.RemoteException
      • addSKDLaborHrsTemp

        public void addSKDLaborHrsTemp(long SKDProjectId,
                                       java.util.HashMap craftActivityListMap,
                                       java.lang.String cond)
                                throws MXException,
                                       java.rmi.RemoteException
        add to skdlaborhrstemp table.
        Throws:
        MXException
        java.rmi.RemoteException
      • populatePMPlannedLaborHrsDaily

        public void populatePMPlannedLaborHrsDaily(long SKDProjectId,
                                                   java.lang.String yearDate,
                                                   java.lang.String monthDate,
                                                   java.lang.String monthDateP,
                                                   java.lang.String weekDate,
                                                   java.lang.String dayDate,
                                                   java.lang.String startWeekDate,
                                                   java.lang.String workDate,
                                                   java.lang.String newdatesql)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Calculate PM planned labor hours.
        Parameters:
        SKDProjectId -
        yearDate, -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        dailyDate -
        newdatesql -
        Throws:
        MXException
        java.rmi.RemoteException
      • populatePlannedCrewHrsDaily

        public void populatePlannedCrewHrsDaily(long SKDProjectId,
                                                java.lang.String yearDate,
                                                java.lang.String monthDate,
                                                java.lang.String monthDateP,
                                                java.lang.String weekDate,
                                                java.lang.String dayDate,
                                                java.lang.String startWeekDate,
                                                java.lang.String workDate,
                                                boolean isResourceDataPersisted)
                                         throws MXException,
                                                java.rmi.RemoteException
        Calculate Planned crew hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        dailyDate -
        Throws:
        MXException
        java.rmi.RemoteException
      • populatePMPlannedCrewHrsDaily

        public void populatePMPlannedCrewHrsDaily(long SKDProjectId,
                                                  java.lang.String yearDate,
                                                  java.lang.String monthDate,
                                                  java.lang.String monthDateP,
                                                  java.lang.String weekDate,
                                                  java.lang.String dayDate,
                                                  java.lang.String startWeekDate,
                                                  java.lang.String workDate,
                                                  java.lang.String newdatesql)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Calculate PM Planned crew hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        dailyDate -
        newdatesql -
        Throws:
        MXException
        java.rmi.RemoteException
      • populatePlannedHrsWeeklyMonthy

        public void populatePlannedHrsWeeklyMonthy(long SKDProjectId,
                                                   java.lang.String yearDate,
                                                   java.lang.String monthDate,
                                                   java.lang.String monthDateP,
                                                   java.lang.String weekDate,
                                                   java.lang.String dayDate,
                                                   java.lang.String startWeekDate,
                                                   java.lang.String workDate)
                                            throws MXException,
                                                   java.rmi.RemoteException
        This method calculates the weekly and monthly labor and crew planned hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        workDate -
        Throws:
        MXException
        java.rmi.RemoteException
      • populateAvblLaborHrsDaily

        public void populateAvblLaborHrsDaily(long SKDProjectId,
                                              java.lang.String yearDate,
                                              java.lang.String monthDate,
                                              java.lang.String monthDateP,
                                              java.lang.String weekDate,
                                              java.lang.String dayDate,
                                              java.lang.String startWeekDate,
                                              java.lang.String actDate,
                                              java.lang.String workDate)
                                       throws java.lang.Exception,
                                              java.rmi.RemoteException
        This method populates the available labor hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        actDate -
        workDate -
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • populatePMAvblLaborHrsDaily

        public void populatePMAvblLaborHrsDaily(long SKDProjectId,
                                                java.lang.String yearDate,
                                                java.lang.String monthDate,
                                                java.lang.String monthDateP,
                                                java.lang.String weekDate,
                                                java.lang.String dayDate,
                                                java.lang.String startWeekDate,
                                                java.lang.String actDate,
                                                java.lang.String workDate,
                                                java.lang.String newdatesql)
                                         throws java.lang.Exception,
                                                java.rmi.RemoteException
        This method populates the PM available labor hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        actDate -
        workDate -
        newdate -
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • populateAvblCrewHrsDaily

        public void populateAvblCrewHrsDaily(long SKDProjectId,
                                             java.lang.String yearDate,
                                             java.lang.String monthDate,
                                             java.lang.String monthDateP,
                                             java.lang.String weekDate,
                                             java.lang.String dayDate,
                                             java.lang.String startWeekDate,
                                             java.lang.String actDate,
                                             java.lang.String workDate)
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
        This method populates the available crew hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        actDate -
        workDate -
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • populatePMAvblCrewHrsDaily

        public void populatePMAvblCrewHrsDaily(long SKDProjectId,
                                               java.lang.String yearDate,
                                               java.lang.String monthDate,
                                               java.lang.String monthDateP,
                                               java.lang.String weekDate,
                                               java.lang.String dayDate,
                                               java.lang.String startWeekDate,
                                               java.lang.String actDate,
                                               java.lang.String workDate,
                                               java.lang.String newdatesql)
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
        This method populates the PM available crew hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        actDate -
        workDate -
        newdate -
        Throws:
        MXException
        java.rmi.RemoteException
        java.lang.Exception
      • populateAvblHrsWeeklyMonthly

        public void populateAvblHrsWeeklyMonthly(long SKDProjectId,
                                                 java.lang.String yearDate,
                                                 java.lang.String monthDate,
                                                 java.lang.String monthDateP,
                                                 java.lang.String weekDate,
                                                 java.lang.String dayDate,
                                                 java.lang.String startWeekDate,
                                                 java.lang.String actDate,
                                                 java.lang.String workDate)
                                          throws java.lang.Exception,
                                                 java.rmi.RemoteException
        This method calculates the weekly and monthly labor and crew available hours.
        Parameters:
        SKDProjectId -
        yearDate -
        monthDate -
        monthDateP -
        weekDate -
        dayDate -
        startWeekDate -
        actDate -
        workDate -
        Throws:
        java.lang.Exception
        java.rmi.RemoteException
      • updateSKDTemp

        public void updateSKDTemp()
                           throws MXException,
                                  java.rmi.RemoteException
        This method updates the labor and crew available and planned hours to zero if the value is null.
        Throws:
        MXException
        java.rmi.RemoteException
      • updateSKDTemp

        public void updateSKDTemp(long SKDProjectId)
                           throws MXException,
                                  java.rmi.RemoteException
        This method updates the labor and crew available and planned hours to zero if the value is null for a given project.
        Parameters:
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
      • isSKDTempEmpty

        public boolean isSKDTempEmpty()
                               throws MXException,
                                      java.rmi.RemoteException
        This method checks in the Skd temp table is empty.
        Parameters:
        SKDProjectId -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • isSKDTempEmpty

        public boolean isSKDTempEmpty(long SKDProjectId)
                               throws MXException,
                                      java.rmi.RemoteException
        This method checks in the Skd temp table is empty for a given skdprojectid.
        Parameters:
        SKDProjectId -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • populateSKDLaborHrs

        public void populateSKDLaborHrs()
                                 throws MXException,
                                        java.rmi.RemoteException
        This method calculates
        Throws:
        MXException
        java.rmi.RemoteException
      • populateSKDLaborHrs

        public void populateSKDLaborHrs(long SKDProjectId)
                                 throws MXException,
                                        java.rmi.RemoteException
        This method populates the skdlaborhrs table based on grouping data by daily, weekly and monthly
        Parameters:
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
      • updateTimePeriod

        public void updateTimePeriod()
                              throws MXException,
                                     java.rmi.RemoteException
        This method updates the timeperid in skdlaborhrs based on timeperiod domain.
        Throws:
        MXException
        java.rmi.RemoteException
      • updateTimePeriod

        public void updateTimePeriod(long SKDProjectId)
                              throws MXException,
                                     java.rmi.RemoteException
        This method updates the timeperid in skdlaborhrs based on timeperiod domain for a skdprojectid.
        Parameters:
        SKDProjectId -
        Throws:
        MXException
        java.rmi.RemoteException
      • executeStatement

        public void executeStatement(java.lang.String sqlStatement)
                              throws MXException,
                                     java.rmi.RemoteException
        This method executes the sql statement.
        Parameters:
        sqlStatement -
        Throws:
        MXException
        java.rmi.RemoteException
      • isOverlaping

        public boolean isOverlaping(com.ibm.tivoli.maximo.skd.app.SKDLaborHrsSet.WOActivity activity,
                                    com.ibm.tivoli.maximo.skd.app.SKDLaborHrsSet.Shift shift)
                             throws SchedulerException
        checks if activity is in shift.
        Parameters:
        acitivity -
        shift -
        Returns:
        Throws:
        SchedulerException
      • loadShiftData

        public void loadShiftData(java.lang.Long SKDProjectId)
                           throws MXException,
                                  java.rmi.RemoteException
        Load shift data
        Throws:
        MXException
        java.rmi.RemoteException