Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.OrderLineManager


        .convertNumberToBoolean(packable.getDefaultColliesGenerated());
  }

  private boolean shouldHaveColli(List<OrderLine> orderLines,
      String articleName, Transportable transportable) {
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    if (orderLines != null) {
      for (OrderLine orderLine : orderLines) {
        if (orderLine.getHasArticle() == null) {
          orderLineManager
              .lazyLoad(
                  orderLine,
                  new LazyLoadOrderLineEnum[] { LazyLoadOrderLineEnum.ORDER_LINE_ATTRIBUTE });
        }
        if (orderLine.getArticleName().equalsIgnoreCase(articleName)
View Full Code Here


        .getBean(ApplicationUserManager.MANAGER_NAME);
    when(managerRepository.getApplicationUserManager()).thenReturn(applicationUserManager);
    final ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
        .getBean(ArticleTypeManager.MANAGER_NAME);
    when(managerRepository.getArticleTypeManager()).thenReturn(articleTypeManager);
    final OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean(OrderLineManager.MANAGER_NAME);
    when(managerRepository.getOrderLineManager()).thenReturn(orderLineManager);
    final AttributeManager attributeManager = (AttributeManager) ModelUtil
        .getBean(AttributeManager.MANAGER_NAME);
View Full Code Here

        .getBean(OrderManager.MANAGER_NAME);
    when(managerRepository.getOrderManager()).thenReturn(orderManager);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean(OrderLineManager.MANAGER_NAME);
    when(managerRepository.getOrderLineManager()).thenReturn(
        orderLineManager);
    ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
        .getBean(ArticleTypeManager.MANAGER_NAME);
View Full Code Here

  }

  private OrderLine applyObject(PackableListItem object, boolean applied,
      WindowInterface window, final String aColliName,
      final boolean isMainArticle) {
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    OrderLine orderLine = orderLineManager.findByOrderLineId(object
        .getOrderLineId());
    OrderLine appliedOrderLine = null;
    if (orderLine != null) {

      appliedOrderLine = handleApply(applied, window, orderLineManager,
View Full Code Here

     * @see no.ugland.utransprod.gui.model.ApplyListInterface#setApplied(no.ugland.utransprod.gui.model.Applyable,
     *      boolean, no.ugland.utransprod.gui.WindowInterface)
     */
    public void setApplied(final PackableListItem object, final boolean applied, final WindowInterface window) {
        if (object != null) {
            OrderLineManager orderLineManager = (OrderLineManager) ModelUtil.getBean("orderLineManager");
            OrderLine orderLine = orderLineManager.findByOrderLineId(object.getOrderLineId());
            if (orderLine != null) {

                handleApply(applied, window, orderLineManager, orderLine,null,true);

                checkAndSavePostShipment(orderLine);
View Full Code Here

  private void doPackage(final OrderLine orderLine, final String aColliName)
      throws ProTransException {
    String currentColliName = aColliName != null ? aColliName : colliName;
    ColliManager colliManager = (ColliManager) ModelUtil
        .getBean("colliManager");
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    Colli colli;
    if (orderLine.getPostShipment() != null) {
      colli = colliManager.findByNameAndPostShipment(currentColliName,
          orderLine.getPostShipment());
    } else {
      colli = colliManager.findByNameAndOrder(currentColliName, orderLine
          .getOrder());
    }
    if (colli == null) {
      if (orderLine.getPostShipment() != null) {
        colli = new Colli(null, null, currentColliName, null, null,
            null, orderLine.getPostShipment(), null, Util
                .getCurrentDate());
      } else {
        colli = new Colli(null, orderLine.getOrder(), currentColliName,
            null, null, null, null, null, Util.getCurrentDate());
      }
    } else {
      colliManager.lazyLoad(colli, new LazyLoadEnum[][] { {
          LazyLoadEnum.ORDER_LINES, LazyLoadEnum.NONE } });
    }
    colli.addOrderLine(orderLine);
    colliManager.saveColli(colli);

    orderLine.setColli(colli);

    orderLineManager.saveOrderLine(orderLine);
    checkCompleteness(colli, true);

  }
View Full Code Here

  }

  protected void handleApply(final Produceable object, final boolean applied,
      final WindowInterface window, final String aColliName) {
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    OrderLine orderLine = orderLineManager.findByOrderLineId(object
        .getOrderLineId());
    if (orderLine != null) {

      try {
        if (applied) {
View Full Code Here

    return null;
  }

  public void setProductionUnit(ProductionUnit productionUnit,
      Produceable object, WindowInterface window) {
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    OrderLine orderLine = orderLineManager.findByOrderLineId(object
        .getOrderLineId());
    if (orderLine != null) {
      orderLine.setProductionUnit(productionUnit);
      refreshAndSaveOrder(window, orderLine);
      applyListManager.refresh(object);
View Full Code Here

        deviationManager);
    FrontProductionVManager frontProductionVManager = (FrontProductionVManager) ModelUtil
        .getBean(FrontProductionVManager.MANAGER_NAME);
    when(managerRepository.getFrontProductionVManager()).thenReturn(
        frontProductionVManager);
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean(OrderLineManager.MANAGER_NAME);
    when(managerRepository.getOrderLineManager()).thenReturn(
        orderLineManager);
    ColliManager colliManager=(ColliManager)ModelUtil.getBean(ColliManager.MANAGER_NAME);
    when(managerRepository.getColliManager()).thenReturn(colliManager);
View Full Code Here

  public static void setGavlKledning() {
    ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean("constructionTypeManager");
    ConstructionTypeArticleManager constructionTypeArticleManager = (ConstructionTypeArticleManager) ModelUtil
    .getBean("constructionTypeArticleManager");
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
   

    List<ConstructionType> garasjer = constructionTypeManager.findAllIncludeMaster();

    Set<ConstructionTypeArticle> artikler;

    ConstructionTypeArticle gavl = null;
    ConstructionTypeArticle kledning = null;

    for (ConstructionType garasje : garasjer) {
      constructionTypeManager
          .lazyLoad(
              garasje,
              new LazyLoadConstructionTypeEnum[] { LazyLoadConstructionTypeEnum.CONSTRUCTION_TYPE_ARTICLE });
      artikler = garasje.getConstructionTypeArticles();


      for (ConstructionTypeArticle artikkel : artikler) {
       
        if (artikkel.getArticleName().equalsIgnoreCase("Gavl")) {
          gavl = artikkel;
          break;

        }
      }
     
     

      ConstructionTypeArticle gavlkledning = null;

      for (ConstructionTypeArticle artikkel : artikler) {
        Set<ConstructionTypeArticle> gavlkledningArtikler;
        if (artikkel.getArticleName().equalsIgnoreCase("Gavlkledning")) {
          gavlkledning = artikkel;
          constructionTypeManager
              .lazyLoadArticle(
                  artikkel,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.CONSTRUCTION_TYPE_ARTICLES });
          gavlkledningArtikler = artikkel
              .getConstructionTypeArticles();

          for (ConstructionTypeArticle gavlkledningArtikkel : gavlkledningArtikler) {
            if (gavlkledningArtikkel.getArticleName()
                .equalsIgnoreCase("Kledning")) {
              gavlkledningArtikkel
                  .setConstructionTypeArticleRef(gavl);
              kledning=gavlkledningArtikkel;
            }

          }
         
          if(kledning!=null){
          constructionTypeArticleManager.saveConstructionTypeArticle(kledning);
          }

          constructionTypeManager
              .lazyLoadArticle(
                  gavlkledning,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ORDER_LINE });
          Set<OrderLine> orderLines = gavlkledning.getOrderLines();
          Order order = null;
          Set<OrderLine> orderOrderLines;
          OrderLine gavlOrderLine = null;

          for (OrderLine orderLine : orderLines) {
            order = orderLine.getOrder();
            orderLineManager
                .lazyLoadOrder(
                    order,
                    new LazyLoadOrderEnum[] { LazyLoadOrderEnum.ORDER_LINES });

            orderOrderLines = order.getOrderLines();

            gavlOrderLine=null;
            for (OrderLine orderOrderLine : orderOrderLines) {
              if (orderOrderLine.getArticleName()
                  .equalsIgnoreCase("Gavl")) {
                gavlOrderLine = orderOrderLine;
              }
            }

            //if(gavlOrderLine!=null){
           
            for (OrderLine orderOrderLine : orderOrderLines) {
              if (orderOrderLine.getArticlePath()
                  .equalsIgnoreCase("Gavlkledning$Kledning")) {
                if(gavlOrderLine==null){
                  gavlOrderLine=new OrderLine(null,orderOrderLine.getOrder(),gavl,null,null,null,null,null,null,null,"Gavl",null,1,null,null,null,null,null,null,null,null,null);
                  orderLineManager.saveOrderLine(gavlOrderLine);
                }
                orderOrderLine.setOrderLineRef(gavlOrderLine);
                orderOrderLine.setArticlePath("Gavl$Kledning");
                orderLineManager.saveOrderLine(orderOrderLine);
                orderLineManager.lazyLoadTree(gavlOrderLine);
                gavlOrderLine.setAttributeInfo(gavlOrderLine.getAttributesAsString());
                orderLineManager.saveOrderLine(gavlOrderLine);
              }
            }
            //}

            // gavlkledning.removeOrderLine(orderLine);
View Full Code Here

TOP

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

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.