Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.OverviewManager


  }
 
  @SuppressWarnings("unchecked")
  public void checkCollies(WindowInterface window) throws ProTransException {
    if (!refreshing) {
      OverviewManager overviewManager = (OverviewManager) ModelUtil
          .getBean(packable.getManagerName());
      if (!defaultColliesGenerated()) {
        packable.setDefaultColliesGenerated(1);
        overviewManager.saveObject(packable);
        List<Colli> collies = packable.getColliList();
        List<OrderLine> orderLines = packable.getOrderLineList();
        Colli tmpColli;

        tmpColli = new Colli(null,
            packable.getOrder(), null, null, null, null,
            packable.getPostShipment(), null, null);
        if (collies == null) {
          collies = new ArrayList<Colli>();

        }
        // sjekk om kollier Takstol,Gavl,Gulvspon,Garasjepakke er med
        // for
        // ordre,
        // sjekk mot artikler

        Set<String> colliNames = colliSetup.keySet();
        if (colliNames != null) {
          for (String colliName : colliNames) {
            tmpColli.setColliName(colliName);
            if (!collies.contains(tmpColli)) {
              if(!Hibernate.isInitialized(packable.getCollies())){
                initializePackable(packable);
              }
              if (shouldHaveColli(orderLines, colliSetup
                  .get(colliName),
                  packable.getTransportable())) {
                Colli newColli = new Colli(null, tmpColli
                    .getOrder(), tmpColli.getColliName(),
                    null, null, null, tmpColli
                        .getPostShipment(), null, null);
                packable.addColli(newColli);

                if (colliName.equalsIgnoreCase("Takstein")) {
                  checkTakstein(orderLines, newColli, window);
                }
                managerRepository.getColliManager().saveColli(
                    newColli);
              }
            }
          }
        }
       
        overviewManager.saveObject(packable);
        setPackable(packable, null);
      }
    }
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  private AbstractOrderModel lazyLoadPackable() {
    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();
    OverviewManager overviewManager = (OverviewManager) ModelUtil
        .getBean(abstractOrderModel.getManagerName());

    overviewManager.refreshObject(abstractOrderModel.getObject());
    overviewManager.lazyLoad(abstractOrderModel.getObject(),
        new LazyLoadEnum[][] {
            { LazyLoadEnum.COLLIES, LazyLoadEnum.NONE },
            { LazyLoadEnum.ORDER_LINES, LazyLoadEnum.NONE },
            { LazyLoadEnum.ORDER_COMMENTS, LazyLoadEnum.NONE } });
    return abstractOrderModel;
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  void refreshTableOrder(OrderLine updatedOrderLine, boolean removeColli,
      WindowInterface window, boolean combo) {
    AbstractOrderModel abstractOrderModel=lazyLoadPackable();
    OverviewManager overviewManager = (OverviewManager) ModelUtil
    .getBean(abstractOrderModel.getManagerName());

    int rowCount = tableOrderLines.getRowCount();
    if (combo) {
      rowCount--;
    }

   

    boolean colliDone = true;
    if (removeColli) {
      List<OrderLine> orderLineList1 = (abstractOrderModel
          .getOrderLines());
      OrderLine orderLine = orderLineList1.get(orderLineList1
          .indexOf(updatedOrderLine));
      orderLine.setColli(null);
      if (rowCount == 0) {
        colliDone = false;
      }
    }

    tableOrders.revalidate();
    tablePostShipment.revalidate();

    abstractOrderModel.setStatus(null);
    if (abstractOrderModel.getPackageStarted() == null)
      abstractOrderModel.setPackageStarted(Calendar.getInstance()
          .getTime());

    if (rowCount == 0 && colliDone) {
      abstractOrderModel.setColliesDone(1);

    } else {
      abstractOrderModel.setColliesDone(0);

    }

    try {
      overviewManager.saveObject(abstractOrderModel.getObject());
    } catch (ProTransException e) {
      Util.showErrorDialog(window, "Feil",
          "Ordre er oppdatert av noen andre, oppdater f�r lagring");
      e.printStackTrace();
    } catch (HibernateOptimisticLockingFailureException e) {
View Full Code Here

    presentationModelPackable.triggerCommit();
    AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
        .getBean();

    OverviewManager overviewManager = (OverviewManager) ModelUtil
        .getBean(abstractOrderModel.getManagerName());
    try {
      overviewManager.saveObject(abstractOrderModel.getObject());
    } catch (ProTransException e) {
      Util.showErrorDialog(window, "Feil", e.getMessage());
      e.printStackTrace();
    }
    if (orderSelectionList.hasSelection()) {
View Full Code Here

      AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
          .getBean();

      if (abstractOrderModel != null) {
        OverviewManager overviewManager = (OverviewManager) ModelUtil
            .getBean(abstractOrderModel.getManagerName());
        overviewManager.refreshObject(abstractOrderModel.getObject());

        OrderLine newOrderLine = addArticle(window, abstractOrderModel);
        if (newOrderLine != null) {
          abstractOrderModel.setColliesDone(0);
          newOrderLine.setAttributeInfo(newOrderLine
              .getAttributesAsString());
          try {
            managerRepository.getOrderLineManager().saveOrderLine(
                newOrderLine);
            overviewManager.saveObject(abstractOrderModel
                .getObject());
            abstractOrderModel.addOrderLine(newOrderLine);
            ownOrderLineList.add(newOrderLine);
          } catch (ProTransException e) {
            Util.showErrorDialog(window, "Feil", e.getMessage());
View Full Code Here

                .convertRowIndexToModel(orderLineSelectionList
                    .getSelectionIndex()));
        if (orderLine != null) {
          AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
              .getBean();
          OverviewManager overviewManager = (OverviewManager) ModelUtil
              .getBean(abstractOrderModel.getManagerName());
          ownOrderLineList.remove(orderLine);

          abstractOrderModel.removeOrderLine(orderLine);
          abstractOrderModel.viewToModel();
          try {
            overviewManager.saveObject(abstractOrderModel
                .getObject());
          } catch (ProTransException e) {
            Util.showErrorDialog(window, "Feil", e.getMessage());
            e.printStackTrace();
          }
View Full Code Here

    @SuppressWarnings("unchecked")
    private void handlePackedByAndColliHeight(
        AbstractOrderModel abstractOrderModel, Date orderReady,
        String packedBy, boolean canceled, BigDecimal colliHeight) {
      if (!canceled) {
        OverviewManager overviewManager = (OverviewManager) ModelUtil
            .getBean(abstractOrderModel.getManagerName());

        overviewManager.refreshObject(abstractOrderModel.getObject());
        overviewManager
            .lazyLoad(abstractOrderModel.getObject(),
                new LazyLoadEnum[][] {
                    { LazyLoadEnum.COLLIES,
                        LazyLoadEnum.NONE },
                    { LazyLoadEnum.ORDER_LINES,
                        LazyLoadEnum.NONE },
                    { LazyLoadEnum.ORDER_COMMENTS,
                        LazyLoadEnum.NONE } });
        abstractOrderModel.setOrderReady(orderReady);
        presentationModelPackable.setValue(
            AbstractOrderModel.PROPERTY_PACKED_BY, packedBy);
        if (colliHeight != null) {
          presentationModelPackable.setValue(
              AbstractOrderModel.PROPERTY_GARAGE_COLLI_HEIGHT,
              colliHeight);
        }
        if (abstractOrderModel.isDonePackage()) {
          abstractOrderModel.setOrderComplete(Util.getCurrentDate());
        }
        try {
          overviewManager.saveObject(abstractOrderModel.getObject());
        } catch (ProTransException e) {
          Util.showErrorDialog(window, "Feil", e.getMessage());
          e.printStackTrace();
        }
        setSums();
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.service.OverviewManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.