Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.PostShipmentManager


                    orderManager.saveOrder(order);
                }
            } else {
                PostShipment postShipment = orderLine.getPostShipment();
                if (postShipment != null) {
                    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
                            .getBean("postShipmentManager");
                    if (applied) {
                        postShipmentManager.lazyLoad(postShipment,
                                new LazyLoadPostShipmentEnum[] { LazyLoadPostShipmentEnum.ORDER_LINES });
                        if (postShipment.isDonePackage()) {
                            postShipment.setPostShipmentComplete(Util.getCurrentDate());
                            postShipmentManager.savePostShipment(postShipment);
                        }
                    } else {
                        postShipment.setPostShipmentComplete(null);
                        postShipmentManager.savePostShipment(postShipment);
                    }
                }
            }
        }
    }
View Full Code Here


          orderManager.saveOrder(order);
        }
      } else {
        PostShipment postShipment = colli.getPostShipment();
        if (postShipment != null) {
          PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
              .getBean("postShipmentManager");
          if (applied) {
            postShipmentManager
                .lazyLoad(
                    postShipment,
                    new LazyLoadPostShipmentEnum[] { LazyLoadPostShipmentEnum.ORDER_LINES });
            if (postShipment.isDonePackage()) {
              postShipment.setPostShipmentComplete(Util
                  .getCurrentDate());
              postShipmentManager.savePostShipment(postShipment);
            }
          } else {
            postShipment.setPostShipmentComplete(null);
            postShipmentManager.savePostShipment(postShipment);
          }
        }
      }
    }
  }
View Full Code Here

        if (transportable instanceof Order) {
          ((OrderManager) overviewManager)
              .refreshObject((Order) transportable);
        } else {
          PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
              .getBean("postShipmentManager");
          postShipmentManager
              .refreshObject((PostShipment) transportable);
        }
        initTransportable(transportable, window);
        Util.setDefaultCursor(window.getComponent());
      }
View Full Code Here

                LazyLoadOrderEnum.COLLIES });
      }
      transportable.cacheComments();
    } else {
      if (load) {
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
            .getBean("postShipmentManager");
        postShipmentManager.lazyLoad((PostShipment) transportable,
            new LazyLoadPostShipmentEnum[] {
                LazyLoadPostShipmentEnum.ORDER_COMMENTS,
                LazyLoadPostShipmentEnum.COLLIES });
      }
      transportable.cacheComments();
View Full Code Here

   *
   * @param transportable
   * @param window
   */
  void initTransportable(Transportable transportable, WindowInterface window) {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    CustTrManager custTrManager = (CustTrManager) ModelUtil
        .getBean("custTrManager");
    Set<String> checkers = statusCheckers.keySet();
    Map<String, String> statusMap;

    String status;
    StatusCheckerInterface<Transportable> checker;
    boolean orderLoaded = false;
    boolean needToSave = false;

    transportable.setCustTrs(custTrManager.findByOrderNr(transportable
        .getOrder().getOrderNr()));

    statusMap = Util.createStatusMap(transportable.getStatus());
    for (String checkerName : checkers) {
      checker = statusCheckers.get(checkerName);
      status = statusMap.get(checker.getArticleName());

      if (status == null) {
        needToSave = true;
        if (!orderLoaded && transportable instanceof Order) {
          ((OrderManager) overviewManager).lazyLoadOrder(
              (Order) transportable, new LazyLoadOrderEnum[] {
                  LazyLoadOrderEnum.COLLIES,
                  LazyLoadOrderEnum.ORDER_LINES,
                  LazyLoadOrderEnum.ORDER_LINE_ORDER_LINES,
                  LazyLoadOrderEnum.COMMENTS,
                  LazyLoadOrderEnum.PROCENT_DONE });
          orderLoaded = true;
        } else if (!orderLoaded
            && transportable instanceof PostShipment) {
          postShipmentManager
              .lazyLoad(
                  (PostShipment) transportable,
                  new LazyLoadPostShipmentEnum[] {
                      LazyLoadPostShipmentEnum.COLLIES,
                      LazyLoadPostShipmentEnum.ORDER_LINES,
                      LazyLoadPostShipmentEnum.ORDER_LINE_ORDER_LINES,
                      LazyLoadPostShipmentEnum.ORDER_COMMENTS });
          orderLoaded = true;
        }
        status = checker.getArticleStatus(transportable);

      }
      statusMap.put(checker.getArticleName(), status);

    }
    transportable.setStatus(Util.statusMapToString(statusMap));

    if (transportable.getComment() == null) {
      needToSave = true;
      cacheComment(transportable, window, !orderLoaded);
      orderLoaded = true;
    }

    if (needToSave) {
      if (transportable instanceof Order) {
        try {
          ((OrderManager) overviewManager)
              .saveOrder((Order) transportable);
        } catch (ProTransException e) {
          Util.showErrorDialog(window, "Feil", e.getMessage());
          e.printStackTrace();
        }
      } else {
        postShipmentManager
            .savePostShipment((PostShipment) transportable);
      }
    }
    if (transportable instanceof Order
        && !Hibernate.isInitialized(((Order) transportable)
View Full Code Here

      List<Order> allOrders = ((OrderManager) overviewManager)
          .findAllNotSent();
      if (allOrders != null) {
        objectList.addAll(allOrders);
      }
      PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
          .getBean("postShipmentManager");
      List<PostShipment> allPostShipments = postShipmentManager
          .findAllNotSent();
      if (allPostShipments != null) {
        objectList.addAll(allPostShipments);
      }
      Collections.sort(objectList, new TransportableComparator());
View Full Code Here

  public void doRefresh(WindowInterface window) {
    orderViewHandler
        .initAndGetOrderPanelSelectionList(OrderPanelTypeEnum.NEW_ORDERS);
    transportWeekView.changeWeek(null);

    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    List<PostShipment> postShipmentLines = postShipmentManager
        .findAllWithoutTransport();
    postShipmentList.clear();
    if (postShipmentLines != null) {
      postShipmentList.addAll(postShipmentLines);
    }
View Full Code Here

  /**
   * Oppdaterer etterleveringer
   */
  void refreshPostShipment() {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    postShipmentList.clear();
    List<PostShipment> postShipmentLines = postShipmentManager
        .findAllWithoutTransport();
    if (postShipmentLines != null) {
      initPostShipmentList(postShipmentManager, postShipmentLines);
      postShipmentList.addAll(postShipmentLines);
    }
View Full Code Here

   *
   * @param window
   * @return tabell
   */
  public JXTable getTablePostShipment(WindowInterface window) {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");

    ColorHighlighter pattern = new ColorHighlighter(new PatternPredicate(
        "Ja", 6), ColorEnum.GREEN.getColor(), null);

    tablePostShipment = new JXTable();
    tablePostShipment.addHighlighter(pattern);
    postShipmentList.clear();
    List<PostShipment> postShipmentLines = postShipmentManager
        .findAllWithoutTransport();
    if (postShipmentLines != null) {
      initPostShipmentList(postShipmentManager, postShipmentLines);
      postShipmentList.addAll(postShipmentLines);

View Full Code Here

   * @param postShipment
   * @param window
   */
  public static void showContentForPostShipment(PostShipment postShipment,
      WindowInterface window) {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    if (postShipment != null) {
      postShipmentManager
          .lazyLoad(
              postShipment,
              new LazyLoadPostShipmentEnum[] { LazyLoadPostShipmentEnum.ORDER_LINES });
      Set<OrderLine> content = postShipment.getOrderLines();
      if (content != null) {
View Full Code Here

TOP

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

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.