Пример #1
0
  @GET
  @Path("/getcomponents/{orderid}")
  @Produces(MediaType.APPLICATION_JSON)
  public List<OutViewComponent> getComponentsByOrder(@PathParam("orderid") String orderid) {
    List<OutViewComponent> returnValue = new ArrayList<OutViewComponent>();
    try {
      int id = Integer.parseInt(orderid);
      returnValue = DataManager.getInstance().getComponentsForView(id);
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }

    return returnValue;
  }
Пример #2
0
  @GET
  @Path("/gettypes/{groupid}")
  @Produces(MediaType.APPLICATION_JSON)
  public List<String> getTypesByGroup(@PathParam("groupid") String groupid) {
    List<String> returnValue = new ArrayList<String>();
    try {
      for (Types type : DataManager.getInstance().getTypes(groupid)) {
        returnValue.add(type.getCode());
      }
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }

    return returnValue;
  }
Пример #3
0
  @GET
  @Path("/getgroups/{weightid}")
  @Produces(MediaType.APPLICATION_JSON)
  public List<String> getGroupsByWeight(@PathParam("weightid") String weightid) {
    List<String> returnValue = new ArrayList<String>();
    try {
      for (Groups group : DataManager.getInstance().getGroups(weightid)) {
        returnValue.add(group.getCode());
      }
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }

    return returnValue;
  }
Пример #4
0
  @GET
  @Path("/getresult/{orderid}/{componentid}")
  @Produces(MediaType.APPLICATION_JSON)
  public List<OutViewResult> getResultByOrderComponent(
      @PathParam("orderid") String orderid, @PathParam("componentid") String componentid) {
    List<OutViewResult> returnValue = new ArrayList<OutViewResult>();
    try {
      int ordId = Integer.parseInt(orderid);
      int cmpId = Integer.parseInt(componentid);
      returnValue = DataManager.getInstance().getResultsForView(ordId, cmpId);
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }

    return returnValue;
  }
Пример #5
0
 @GET
 @Path("/getallorders")
 @Produces(MediaType.APPLICATION_JSON)
 public List<OutViewChemical> getAllOrders() {
   return DataManager.getInstance().getAllOrdersForView();
 }