// JSONArray jsonArry = new JSONArray();
// JSONObject tmpObj;
//
// for (int i = 0; i < checkDoneVos.size(); i++) {
//
// tmpObj = new JSONObject();
//
// try {
// tmpObj.put("BARCODE", checkDoneVos.get(i).getBARCODE());
// tmpObj.put("CHECK_QTY", checkDoneVos.get(i).getALREADYPICK_QTY());
// tmpObj.put("CHECK_TIME", checkDoneVos.get(i).getCHECK_TIME());
//
// } catch (JSONException e) {
// e.printStackTrace();
// }
//
//
// jsonArry.put(tmpObj);
// }
//
// String DetDatas = jsonArry.toString();
// JSONObject tmpObj;
//
// for (int i = 0; i < checkDoneVos.size(); i++) {
//
// tmpObj = new JSONObject();
//
// try {
// tmpObj.put("BARCODE", checkDoneVos.get(i).getBARCODE());
// tmpObj.put("CHECK_QTY", checkDoneVos.get(i).getALREADYPICK_QTY());
// tmpObj.put("CHECK_TIME", checkDoneVos.get(i).getCHECK_TIME());
//
// } catch (JSONException e) {
// e.printStackTrace();
// }
//
//
// jsonArry.put(tmpObj);
// }
//
// String DetDatas = jsonArry.toString();
本文介绍了一种使用Java构建JSON数组的方法,通过遍历集合并将其元素转换为JSON对象,再将这些对象添加到JSON数组中。该过程涉及对每个元素的特定属性进行抓取,包括条形码、已检查的数量和检查时间。
4946

被折叠的 条评论
为什么被折叠?



