protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            String productionType = request.getParameter("id");

            if (productionType == null) {
                return;//TODO : hata kodu basılacak
            }

            if (productionType.equals("")) {
                return;//TODO : hata kodu basılacak
            }
            
            Integer prodcutionTypeId = Integer.parseInt(productionType);
            
            if(prodcutionTypeId == null) {
                return;
            }
            
            OrderPotDBManager orderPotDBManager = new OrderPotDBManager();
            List<OrderPot> orderPots = orderPotDBManager.getListByOrderByProductionType(prodcutionTypeId);
            
            List<Integer> serviceOrderIds = new ArrayList<Integer>();
            for(OrderPot orderPot : orderPots) {
                serviceOrderIds.add(orderPot.getId());
            }
            
            ServiceOrderPotDBManager serviceOrderPotDBManager = new ServiceOrderPotDBManager();
            List<ServiceOrderPot> serviceOrderPots = serviceOrderPotDBManager.getListByOrderIds(serviceOrderIds);

            List<Integer> ids = new ArrayList<Integer>();
            for(ServiceOrderPot serviceOrderPot : serviceOrderPots) {
                if(ids.contains(serviceOrderPot.getServiceOrderId())) {
                    continue;
                }
                
                ids.add(serviceOrderPot.getServiceOrderId());
            }
            
            ServiceOrderDBManager serviceOrderDBManager = new ServiceOrderDBManager();
            List<ServiceOrder> serviceOrders = serviceOrderDBManager.getList(ids);
            
            ServiceOrderHelper serviceOrderHelper = new ServiceOrderHelper();
            JSONArray resultArray = new JSONArray();
            for(ServiceOrder serviceOrder : serviceOrders) {
                serviceOrder = serviceOrderHelper.getDetailed(serviceOrder);
                JSONObject serviceOrderJSON = serviceOrder.toJSon();
                resultArray.add(serviceOrderJSON);
            }
            
            out.println(resultArray);
        } finally {
            out.close();
        }
    }