Class WorkOrder

java.lang.Object
overit.geocallapp.wfm.core.bl.workorder.WorkOrder
All Implemented Interfaces:
Serializable, Iterable<BOWorkOrderOperation>

public class WorkOrder extends Object implements Iterable<BOWorkOrderOperation>, Serializable
Business object representing a work order. It consists of a header BOWorkOrderHeader, a technical object TechnicalObject and a list of operations BOWorkOrderOperation
Since:
9.2
See Also:
GCApi:
bo
  • Field Details

  • Constructor Details

    • WorkOrder

      public WorkOrder()
      Instantiates a new work order.
  • Method Details

    • getMeta

      public WorkOrder.MetaData getMeta()
      Returns the work order's metadata.
      Returns:
      the metadata
      See Also:
    • setOperations

      public void setOperations(List<BOWorkOrderOperation> operations)
      Sets the work order's operations.
      Parameters:
      operations - the operations
    • getHeader

      public BOWorkOrderHeader getHeader()
      Returns the work order's header.
      Returns:
      the header
    • setHeader

      public void setHeader(BOWorkOrderHeader header)
      Sets the work order's header.
      Parameters:
      header - the header
    • isNew

      public boolean isNew()
      Checks if the work order is new.
      Returns:
      true, if is new
    • isClosed

      public boolean isClosed()
      Says if the work order is closed
      Returns:
      true, if the work order is closed
    • getId

      public Long getId()
      Returns the work order's header id.
      Returns:
      the the work order's header id
    • getIdImpiantiOdl

      public LongSet getIdImpiantiOdl()
      Returns the set of ids of the meters associated to the work order
      Returns:
      the set of meters ids
    • loadImpiantiOdl

      public void loadImpiantiOdl(PooledConnection conn)
      Loads the set of ids of the meters associated to the work order
      Parameters:
      conn - the pooled connection
    • setIdImpiantiOdl

      public void setIdImpiantiOdl(LongSet lsIdImpiantiOdl)
      Sets the ids of the meters associated to the work order
      Parameters:
      lsIdImpiantiOdl - the set of meters ids
    • isByOrder

      public boolean isByOrder()
      Checks if the work order's header is by order.
      Returns:
      true, if is by order
    • getParentOperation

      public BOWorkOrderOperation getParentOperation()
      Returns the work order parent operation.
      Returns:
      the parent operation
    • getTechnicalObject

      public TechnicalObject getTechnicalObject()
      Returns the work order's technical object.
      Returns:
      the technical object
    • setTechnicalObject

      public void setTechnicalObject(TechnicalObject technicalObject)
      Sets the work order's technical object.
      Parameters:
      technicalObject - the technical object
    • getOperations

      public List<BOWorkOrderOperation> getOperations()
      Returns the work order's operations.
      Returns:
      a list of BO work order operation elements of type BOWorkOrderOperation
      See Also:
    • getOperationById

      public BOWorkOrderOperation getOperationById(Long operationId)
      Returns the work order's operation by id.
      Parameters:
      operationId - the operation id
      Returns:
      the operation by id
    • addOperation

      public void addOperation(BOWorkOrderOperation toAdd)
      Adds a work order's operation.
      Parameters:
      toAdd - the operation to add
    • removeOperation

      public void removeOperation(int index)
      Removes the work order's operation.
      Parameters:
      index - the index of the operation to remove
    • clearOperations

      public void clearOperations()
      Clears operations.
    • getRemovedOperations

      public Set<BOWorkOrderOperation> getRemovedOperations()
      Returns the removed operations.
      Returns:
      the removed operations
    • sortOperations

      public void sortOperations(Comparator<BOWorkOrderOperation> comparator)
      Sorts the work order's operations.
      Parameters:
      comparator - the comparator
    • findOperation

      public BOWorkOrderOperation findOperation(Predicate<BOWorkOrderOperation> searchFunction)
      Find the work order's operation by the given search function
      Parameters:
      searchFunction - the search function
      Returns:
      the BO work order operation
    • iterator

      public Iterator<BOWorkOrderOperation> iterator()
      Returns an iterator on the work order's operations.
      Specified by:
      iterator in interface Iterable<BOWorkOrderOperation>
      Returns:
      the iterator