Examples of SgwtRestFetchResponseBase


Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

      list = coreManager.searchSupplier(text, start, end);
    }else{
      list = coreManager.getAllSupplier();
    }
   
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(list);
    return ret;
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

      SgwtRestErrorResponse resp = new SgwtRestErrorResponse(-1);
      resp.addError("exeption", e.getMessage());
      return resp;
    }
   
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(savedSupp);
   
    return ret;
    }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

    this.coreManager = coreManager;
  }

  @Get("json")
  public SgwtRestResponseBase getRepresent(){
    SgwtRestFetchResponseBase resp = null;
    Integer promoId = RequestUtil.getInteger(getRequestAttributes().get("promoId"));
    List<PromoDetail> details = coreManager.getPromoDetails(promoId);
       
    List<DisplayPromoDetail> resultList = new ArrayList<DisplayPromoDetail>();

    for (PromoDetail promoDetail : details) {
      ProductMeasurement productMeasurement = null;
      if(promoDetail.getProduct().getProductMeasurement() != null && !promoDetail.getProduct().getProductMeasurement().isEmpty()){
        productMeasurement = promoDetail.getProduct().getProductMeasurement().iterator().next();
      }
     
      DisplayPromoDetail det = mapper.map(promoDetail, DisplayPromoDetail.class);

      if(productMeasurement != null){
        det.getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
      }

      resultList.add(det);

    }

    resp = new SgwtRestFetchResponseBase(resultList);
   
    return resp;
   
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

      SgwtRestErrorResponse resp1 = new SgwtRestErrorResponse(-1);
      resp1.addError("exception", e.getMessage());
      return resp1;       
    }
       
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(resp);   
    return ret;
   
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      User actor = (User)auth.getPrincipal();
     
      DisplayLogin disp = mapper.map(actor, DisplayLogin.class);
     
      SgwtRestFetchResponseBase resp = new SgwtRestFetchResponseBase(disp);
   
    return resp;
     
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

    TransferOrder transfer = coreManager.get(TransferOrder.class, id);
    if(transfer != null){
      DisplayTransferOrder dto = mapper.map(transfer, DisplayTransferOrder.class);
      resp = dto;
    }
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(resp);
    return ret;
   
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

      SgwtRestErrorResponse resp1 = new SgwtRestErrorResponse(-1);
      resp1.addError("exception", e.getMessage());
      return resp1;       
    }
   
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(resp);
    return ret;
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

    if(ro != null){
      DisplayReceivingOrder disp = mapper.map(ro, DisplayReceivingOrder.class);
      resp = disp;
    }
   
    SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(resp);
    return ret;
   
  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

    this.coreManager = coreManager;
  }

  @Get("json")
  public SgwtRestResponseBase getRepresent(){
    SgwtRestFetchResponseBase resp = null;
    Integer roId = RequestUtil.getInteger(getRequestAttributes().get("roId"));
   
    List<ReceivingOrderDetail> details = coreManager.getReceivingOrderDetails(roId);
   
    List<DisplayReceivingOrderDetail> resultList = new ArrayList<DisplayReceivingOrderDetail>();
   
    for (ReceivingOrderDetail receivingOrderDetail : details) {
     
      ProductMeasurement productMeasurement = null;
     
      if(receivingOrderDetail.getPoDetail().getProduct().getProductMeasurement() != null && !receivingOrderDetail.getPoDetail().getProduct().getProductMeasurement().isEmpty()){
        productMeasurement = receivingOrderDetail.getPoDetail().getProduct().getProductMeasurement().iterator().next();
      }
           
      DisplayReceivingOrderDetail det = mapper.map(receivingOrderDetail, DisplayReceivingOrderDetail.class);
      det.setCostPrice(receivingOrderDetail.getPoDetail().getProduct().getBuying().getCostPrice());
     
      if(productMeasurement != null){
        det.getPoDetail().getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
      }     
     
      resultList.add(det);
    }
   
    resp = new SgwtRestFetchResponseBase(resultList);
   
    return resp;

  }
View Full Code Here

Examples of com.swinarta.sunflower.server.model.SgwtRestFetchResponseBase

   
      String actionId = (String) request.getData().get("actionId");
     
      if("getAll".equalsIgnoreCase(actionId)){
        ResultList<CategoryWithMainCategory> list = coreManager.getAllCategory();       
        SgwtRestFetchResponseBase ret = new SgwtRestFetchResponseBase(list);       
        return ret;
      }
     
    }else if(request.getOperationType() == OPERATION_TYPE.ADD){
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.