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