fix 1楼查询指令
This commit is contained in:
@@ -32,20 +32,20 @@ public class QueryOneZDAgvTaskStatus {
|
|||||||
|
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
try {
|
try {
|
||||||
HttpResponse response = agvService.queryAgvInstStatus("1");
|
HttpResponse response2 = agvService.queryAgvInstStatus("1");
|
||||||
//查询AGV指令列表
|
//查询AGV指令列表
|
||||||
JSONArray inst_rows = JSONArray.parseArray(response.body());
|
JSONArray inst_rows2 = JSONArray.parseArray(response2.body());
|
||||||
for (int i = 0; i < inst_rows.size(); i++) {
|
for (int i = 0; i < inst_rows2.size(); i++) {
|
||||||
JSONObject inst_jo = inst_rows.getJSONObject(i);
|
JSONObject inst_jo = inst_rows2.getJSONObject(i);
|
||||||
String inst_code = inst_jo.getString("task_code");
|
String inst_code = inst_jo.getString("task_code");
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
||||||
if (ObjectUtil.isEmpty(inst)) {
|
if (ObjectUtil.isEmpty(inst)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//反馈结果状态
|
//反馈结果状态
|
||||||
log.info("instcode:" + inst_code + "," + inst_jo.toString());
|
log.info("instcode:" + inst_code + "," + inst_jo.toString());
|
||||||
|
|
||||||
String state = inst_jo.getString("state");
|
String status = inst_jo.getString("status");
|
||||||
String vehicle = "";
|
String vehicle = "";
|
||||||
//正在执行指令agv车号
|
//正在执行指令agv车号
|
||||||
if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) {
|
if (!StrUtil.isEmpty(inst_jo.getString("vehicle"))) {
|
||||||
@@ -62,17 +62,17 @@ public class QueryOneZDAgvTaskStatus {
|
|||||||
// UNROUTABLE:无法规划该业务订单的执行路线
|
// UNROUTABLE:无法规划该业务订单的执行路线
|
||||||
|
|
||||||
//执行中
|
//执行中
|
||||||
if ("BEING_PROCESSED".equals(state) || "ACTIVE".equals(state)) {
|
if ("BEING_PROCESSED".equals(status) || "ACTIVE".equals(status)) {
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst.setInstruction_status("1");
|
inst.setInstruction_status("1");
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
}
|
}
|
||||||
} else if ("FINISHED".equals(state)) {
|
} else if ("FINISHED".equals(status)) {
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst.setInstruction_status("2");
|
inst.setInstruction_status("2");
|
||||||
instructionService.finish(inst);
|
instructionService.finish(inst);
|
||||||
}
|
}
|
||||||
} else if ("WITHDRAWN".equals(state) || "FAILED".equals(state)) {
|
} else if ("WITHDRAWN".equals(status) || "FAILED".equals(status)) {
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst.setInstruction_status("3");
|
inst.setInstruction_status("3");
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
@@ -96,7 +96,7 @@ public class QueryOneZDAgvTaskStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user