| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | 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"); |