Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.PostShipmentManager


        } catch (ProTransException e) {
          Util.showErrorDialog(window, "Feil", e.getMessage());
          e.printStackTrace();
        }
        postShipment.cacheComments();
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
            .getBean("postShipmentManager");
        postShipmentManager.savePostShipment(postShipment);
      }

    }
View Full Code Here


   * @see junit.framework.TestCase#tearDown()
   */
  @After
  public void tearDown() throws Exception {
    dialogFixture.cleanUp();
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");

    Deviation deviation = new Deviation();
    deviation.setCustomerName("test");
    List<Deviation> list = deviationManager.findByObject(deviation);
    if (list != null) {
      for (Deviation dev : list) {
        deviationManager.removeObject(dev);
      }
    }
    deviation = new Deviation();
    deviation.setUserName("admin admin");
    list = deviationManager.findByObject(deviation);
    orderManager.lazyLoadOrder(order,
        new LazyLoadOrderEnum[] { LazyLoadOrderEnum.POST_SHIPMENTS });
    Set<PostShipment> postShipments = order.getPostShipments();
    if (postShipments != null) {
      for (PostShipment postShipment : postShipments) {
        order.removePostShipment(postShipment);
        orderManager.saveOrder(order);
        deviation = postShipment.getDeviation();
        try {
          postShipmentManager.refreshObject(postShipment);
          postShipmentManager.removePostShipment(postShipment);
        } catch (HibernateObjectRetrievalFailureException e) {
        } catch (ObjectNotFoundException onfex) {

        }
        deviationManager.removeObject(deviation);
View Full Code Here

  }

  private void handleSendingTransportables(final WindowInterface window) {
    OrderManager orderManager = (OrderManager) ModelUtil
        .getBean("orderManager");
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    List<TransportListable> updatedTransportables = new ArrayList<TransportListable>(
        list);

    for (TransportListable transportlistable : updatedTransportables) {
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  private void registerDeviation(ArrayListModel orderLines,
      TransportListable transportlistable) {
    PostShipment postShipment = new PostShipment();
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");

    DeviationViewHandler deviationViewHandler = deviationViewHandlerFactory.create(transportlistable.getOrder(), false,
        false, false, null, true);

    Deviation deviation = new Deviation();

    DeviationModel deviationModel = new DeviationModel(deviation, true);

    deviationModel.setOrderLines(orderLines);
    deviationModel.setPostShipment(postShipment);
    deviationModel.setOrder(transportlistable.getOrder());

    EditDeviationView editDeviationView = new EditDeviationView(false,
        deviationModel, deviationViewHandler, true, true);

    JDialog dialog = new JDialog(ProTransMain.PRO_TRANS_MAIN, "Avvik", true);
    dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    WindowInterface window = new JDialogAdapter(dialog);

    window.add(editDeviationView.buildPanel(window), BorderLayout.CENTER);

    window.pack();
    Util.locateOnScreenCenter(window);
    window.setVisible(true);

    postShipment = deviation.getPostShipment();

    // postShipment.setDeviation(deviation);
    postShipment.setOrder(transportlistable.getOrder());
    postShipment.cacheComments();

    if (transportlistable instanceof PostShipment) {
      postShipment.setPostShipmentRef((PostShipment) transportlistable);
    }

    postShipmentManager.savePostShipment(postShipment);
    Colli colli;
    Iterator<OrderLine> it = orderLines.iterator();
    while (it.hasNext()) {
      OrderLine orderLine = it.next();
      orderLine.setPostShipment(postShipment);
View Full Code Here

    return heading;
  }

  private void addPostShipmentInfoToHeading(Transportable transportable,
      StringBuilder heading) {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    postShipmentManager.lazyLoadTree((PostShipment) transportable);

    heading.append(POST_SHIPMNET_TEXT);
  }
View Full Code Here

      }
    } else {
      PostShipment postShipment = currentColli.getPostShipment();

      if (postShipment != null) {
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
            .getBean("postShipmentManager");
        postShipmentManager
            .lazyLoad(
                postShipment,
                new LazyLoadPostShipmentEnum[] { LazyLoadPostShipmentEnum.ORDER_LINES });
        if (postShipment.isDonePackage()) {
          postShipment.setPostShipmentComplete(Util.getCurrentDate());
          postShipmentManager.savePostShipment(postShipment);
        }
      }

    }
View Full Code Here

            }
          } else {
            PostShipment postShipment = currentColli
                .getPostShipment();
            if (postShipment != null) {
              PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
                  .getBean("postShipmentManager");
              postShipment.setPostShipmentComplete(null);
              postShipmentManager.savePostShipment(postShipment);
            }

          }
        }
View Full Code Here

                            new LazyLoadOrderLineEnum[] {LazyLoadOrderLineEnum.ORDER_LINE_ATTRIBUTE});
        }
    }

    private void lazyLoadPostShipment() {
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
                .getBean("postShipmentManager");
       
        postShipmentManager
                .lazyLoad(
                        postShipment,
                        new LazyLoadPostShipmentEnum[] {LazyLoadPostShipmentEnum.ORDER_LINES});
       
        if(postShipment.getDeviation()!=null){
View Full Code Here

                orderManager
                        .lazyLoadOrder(
                                (Order) transportable,
                                new LazyLoadOrderEnum[] {LazyLoadOrderEnum.ORDER_LINES,LazyLoadOrderEnum.COLLIES});
            } else {
                PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
                        .getBean("postShipmentManager");
                postShipmentManager
                        .lazyLoad(
                                (PostShipment) transportable,
                                new LazyLoadPostShipmentEnum[] {LazyLoadPostShipmentEnum.ORDER_LINES,LazyLoadPostShipmentEnum.COLLIES});
            }
        }
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.Updateable#doRefresh(no.ugland.utransprod.gui.WindowInterface)
   */
  public void doRefresh(WindowInterface window) {
    // try {
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");
    MainPackageVManager mainPackageVManager = (MainPackageVManager) ModelUtil
        .getBean("mainPackageVManager");
    OrderManager orderManager = (OrderManager) ModelUtil
        .getBean("orderManager");
    refreshing = true;

    setSums();

    List<MainPackageV> orders = new ArrayList<MainPackageV>(
        mainPackageVManager.findAll());
    Collections.sort(orders, new MainPackageVComparator());
    orderSelectionList.clearSelection();
    mainPackageVList.clear();
    if (orders.size() != 0) {
      mainPackageVList.addAll(orders);
    }

    orderSelectionList.clearSelection();

    tableOrders.scrollRowToVisible(0);

    postShipmentSelectionList.clearSelection();
    postShipmentList.clear();
    List<PostShipment> postShipments = postShipmentManager.findAllNotSent();

    if (postShipments != null) {
      for (PostShipment postShipment : postShipments) {
        orderManager.lazyLoadOrder(postShipment.getOrder(),
            new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });
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.