严智鑫
2025-05-23 1d8bdfc12ad07ac2632b9edd42256624d956fea8
nglib/src/builder/HttpApi.java
@@ -67,21 +67,25 @@
                String color=set.getString(7);//订单原片膜系
                if(not_completed>0){  //有未完成的原片任务
                    JSONObject thisShelfTask = HttpApi.thisShelfTaskApi();//查询仓储当前任务
                    JSONObject jsonObject=new JSONObject();
                    jsonObject.put("thickness", thickness);
                    jsonObject.put("width", largeglass_length);
                    jsonObject.put("height", largeglass_width);
                    jsonObject.put("sameCount", not_completed);
                    jsonObject.put("glassType", color);
                    if (thisShelfTask != null) {
                        double width_shelf = Double.valueOf(thisShelfTask.get("width").toString());
                        double height_shelf = Double.valueOf(thisShelfTask.get("height").toString());
                        int thickness_shelf = Integer.valueOf(thisShelfTask.get("thickness").toString());
                        int sameCount_shelf = Integer.valueOf(thisShelfTask.get("sameCount").toString());
                        String glassType_shelf = thisShelfTask.get("glass_type").toString();
                        String glassType_shelf = thisShelfTask.get("glassType").toString();
                        if(largeglass_length!=width_shelf||largeglass_width!=height_shelf||thickness!=thickness_shelf||!color.equals(glassType_shelf)||sameCount_shelf==0){
                            JSONObject jsonObject=new JSONObject();
                            jsonObject.put("thickness", thickness);
                            jsonObject.put("width", largeglass_length);
                            jsonObject.put("height", largeglass_width);
                            jsonObject.put("sameCount", not_completed);
                            jsonObject.put("glassType", color);
                            JSONObject shelfJosn=shelfTaskApi(jsonObject);
                        }
                        return true;
                    }else{
                        JSONObject shelfJosn=shelfTaskApi(jsonObject);
                        return false;
                    }
                }
@@ -115,7 +119,12 @@
        try {
            String requestURL="http://"+Ip+":5000/GlassInfo";
            JSONObject resultJSON= httpApi(requestURL,"GET",null);
            return resultJSON;
            JSONArray jsonArray=resultJSON.getJSONArray("data");
            if(jsonArray.size()>0){
                JSONObject thisShelfJson=jsonArray.getJSONObject(0);
                return thisShelfJson;
            }
            return null;
        } catch (Exception e) {
            // TODO: handle exception
            System.out.println("HTTP ERROR:http://39.105.110.179:5000/GlassInfo  GET");