fix: 管芯库启用
This commit is contained in:
@@ -384,49 +384,49 @@ public class AutoCallEmptyVehicle {
|
||||
JSONArray device_ja = new JSONArray();
|
||||
device_ja.add(device_jo);
|
||||
// 获取管芯数据
|
||||
// JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
|
||||
// JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||
JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
|
||||
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
|
||||
JSONArray task_rows = new JSONArray();
|
||||
boolean same_flag = false;
|
||||
// todo: 临时测试
|
||||
// 原:false
|
||||
boolean need_cz = true;
|
||||
// for (int i = 0; i < rows.size(); i++) {
|
||||
// JSONObject row = rows.getJSONObject(i);
|
||||
// int num = row.getIntValue("num");
|
||||
// if (num == 2) {
|
||||
// same_flag = true;
|
||||
// }
|
||||
// String material_code = row.getString("paper_code");
|
||||
// for (int j = 1; j < 13; j++) {
|
||||
// String material_key = "material" + j;
|
||||
// String qty_key = "qty" + j;
|
||||
// String ivt_code = data.getString(material_key);
|
||||
// int ivt_num = data.getIntValue(qty_key);
|
||||
// if (StrUtil.isNotEmpty(ivt_code) && ivt_code.equals(material_code)) {
|
||||
// JSONObject task_jo = new JSONObject();
|
||||
// task_jo.put("device_code", j);
|
||||
// task_jo.put("material_code", material_code);
|
||||
// if (ivt_num >= num) {
|
||||
// task_jo.put("qty", num);
|
||||
// num = 0;
|
||||
// } else {
|
||||
// task_jo.put("qty", ivt_num);
|
||||
// num -= ivt_num;
|
||||
// }
|
||||
// task_rows.add(task_jo);
|
||||
// if (num == 0) {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if (num > 0) {
|
||||
// log.info("子卷号为:" + row.getString("pcsn") + "所需的纸管在纸管库中库存不足!不进行套管");
|
||||
// } else {
|
||||
// need_cz = true;
|
||||
// }
|
||||
// }
|
||||
boolean need_cz = false;
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
int num = row.getIntValue("num");
|
||||
if (num == 2) {
|
||||
same_flag = true;
|
||||
}
|
||||
String material_code = row.getString("paper_code");
|
||||
for (int j = 1; j < 13; j++) {
|
||||
String material_key = "material" + j;
|
||||
String qty_key = "qty" + j;
|
||||
String ivt_code = data.getString(material_key);
|
||||
int ivt_num = data.getIntValue(qty_key);
|
||||
if (StrUtil.isNotEmpty(ivt_code) && ivt_code.equals(material_code)) {
|
||||
JSONObject task_jo = new JSONObject();
|
||||
task_jo.put("device_code", j);
|
||||
task_jo.put("material_code", material_code);
|
||||
if (ivt_num >= num) {
|
||||
task_jo.put("qty", num);
|
||||
num = 0;
|
||||
} else {
|
||||
task_jo.put("qty", ivt_num);
|
||||
num -= ivt_num;
|
||||
}
|
||||
task_rows.add(task_jo);
|
||||
if (num == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (num > 0) {
|
||||
log.info("子卷号为:" + row.getString("pcsn") + "所需的纸管在纸管库中库存不足!不进行套管");
|
||||
} else {
|
||||
need_cz = true;
|
||||
}
|
||||
}
|
||||
if (need_cz) {
|
||||
//生成出纸管的任务
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user