|
|
@ -362,7 +362,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("id",code); |
|
|
|
jo.put("id", code); |
|
|
|
agvurl = agvurl + ":" + agvport + "/markComplete"; |
|
|
|
log.info("关闭agv运单序列请求:{}", agvurl); |
|
|
|
|
|
|
@ -555,26 +555,26 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
String state = arm_info.getString("task_status"); |
|
|
|
String state_name = null; |
|
|
|
if(StrUtil.equals(state,"0")){ |
|
|
|
if (StrUtil.equals(state, "0")) { |
|
|
|
state_name = "NONE"; |
|
|
|
} else if(StrUtil.equals(state,"1")){ |
|
|
|
} else if (StrUtil.equals(state, "1")) { |
|
|
|
state_name = "WAITING"; |
|
|
|
} else if(StrUtil.equals(state,"2")) { |
|
|
|
} else if (StrUtil.equals(state, "2")) { |
|
|
|
state_name = "RUNNING"; |
|
|
|
} else if(StrUtil.equals(state,"3")){ |
|
|
|
} else if (StrUtil.equals(state, "3")) { |
|
|
|
state_name = "SUSPENDED"; |
|
|
|
} else if(StrUtil.equals(state,"4")){ |
|
|
|
} else if (StrUtil.equals(state, "4")) { |
|
|
|
state_name = "COMPLETED"; |
|
|
|
} else if(StrUtil.equals(state,"5")){ |
|
|
|
} else if (StrUtil.equals(state, "5")) { |
|
|
|
state_name = "FAILED"; |
|
|
|
} else if(StrUtil.equals(state,"6")){ |
|
|
|
} else if (StrUtil.equals(state, "6")) { |
|
|
|
state_name = "CANCELED"; |
|
|
|
} |
|
|
|
|
|
|
|
String energyLevel = String.valueOf(rbk_report.getDouble("battery_level")); |
|
|
|
String transportOrder = current_order.getString("id"); |
|
|
|
Instruction inst = instructionService.findByCodeFromCache(transportOrder); |
|
|
|
if(!ObjectUtil.isEmpty(inst)){ |
|
|
|
if (!ObjectUtil.isEmpty(inst)) { |
|
|
|
transportOrder = inst.getTask_code(); |
|
|
|
} else { |
|
|
|
transportOrder = ""; |
|
|
@ -628,7 +628,6 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse queryXZAgvInstStatus(String instCode) { |
|
|
|
|
|
|
@ -719,8 +718,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("id",instCode); |
|
|
|
jo.put("disableVehicle",false); |
|
|
|
jo.put("id", instCode); |
|
|
|
jo.put("disableVehicle", false); |
|
|
|
agvurl = agvurl + ":" + agvport + "/terminate"; |
|
|
|
log.info("删除agv指令请求agvurl:{}", agvurl); |
|
|
|
HttpResponse result = HttpRequest.post(agvurl) |
|
|
@ -1507,15 +1506,15 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/setOrder"; |
|
|
|
System.out.println("请求地址为:"+agvurl); |
|
|
|
System.out.println("请求地址为:" + agvurl); |
|
|
|
HttpResponse result = HttpRequest.post(agvurl) |
|
|
|
.body(String.valueOf(jo))//表单内容
|
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
System.out.println("返回结果为:"+result); |
|
|
|
System.out.println("返回结果为:" + result); |
|
|
|
log.info(agvurl); |
|
|
|
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", inst.getTask_code(), inst.getInstruction_code(), result.getStatus(), result.body()); |
|
|
|
logServer.log(inst.getTask_code(),"sendOrderSequencesToXZ","info","",result.body(), String.valueOf(result.getStatus()),agvurl,inst.getVehicle_code()); |
|
|
|
logServer.log(inst.getTask_code(), "sendOrderSequencesToXZ", "info", "指令号:" + inst.getInstruction_code(), result.body(), String.valueOf(result.getStatus()), agvurl, inst.getVehicle_code()); |
|
|
|
return result; |
|
|
|
} else { |
|
|
|
return null; |
|
|
@ -1575,87 +1574,87 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo.put("location",inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("operation","script"); |
|
|
|
jo.put("id",inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("script_name","userpy/interact.py"); |
|
|
|
jo.put("location", inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("operation", "script"); |
|
|
|
jo.put("id", inst.getStart_point_code() + "IN"); |
|
|
|
jo.put("script_name", "userpy/interact.py"); |
|
|
|
JSONObject script_args = new JSONObject(); |
|
|
|
script_args.put("addr",addr); |
|
|
|
script_args.put("addr", addr); |
|
|
|
JSONObject data = new JSONObject(); |
|
|
|
JSONObject reach = new JSONObject(); |
|
|
|
reach.put("task_code",inst.getInstruction_code()); |
|
|
|
reach.put("address",inst.getStart_point_code() + "IN"); |
|
|
|
data.put("reach",reach); |
|
|
|
script_args.put("data",data); |
|
|
|
script_args.put("protocol","HTTP"); |
|
|
|
jo.put("script_args",script_args); |
|
|
|
reach.put("task_code", inst.getInstruction_code()); |
|
|
|
reach.put("address", inst.getStart_point_code() + "IN"); |
|
|
|
data.put("reach", reach); |
|
|
|
script_args.put("data", data); |
|
|
|
script_args.put("protocol", "HTTP"); |
|
|
|
jo.put("script_args", script_args); |
|
|
|
ja.add(jo); |
|
|
|
|
|
|
|
JSONObject jo1 = new JSONObject(); |
|
|
|
jo1.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo1.put("location",inst.getStart_point_code()); |
|
|
|
jo1.put("operation","JackLoad"); |
|
|
|
jo1.put("location", inst.getStart_point_code()); |
|
|
|
jo1.put("operation", "JackLoad"); |
|
|
|
ja.add(jo1); |
|
|
|
|
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo2.put("location",inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("operation","script"); |
|
|
|
jo2.put("id",inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("script_name","userpy/interact.py"); |
|
|
|
jo2.put("location", inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("operation", "script"); |
|
|
|
jo2.put("id", inst.getStart_point_code() + "OUT"); |
|
|
|
jo2.put("script_name", "userpy/interact.py"); |
|
|
|
JSONObject script_args2 = new JSONObject(); |
|
|
|
script_args2.put("addr",addr); |
|
|
|
script_args2.put("addr", addr); |
|
|
|
JSONObject data2 = new JSONObject(); |
|
|
|
JSONObject reach2 = new JSONObject(); |
|
|
|
reach2.put("task_code",inst.getInstruction_code()); |
|
|
|
reach2.put("address",inst.getStart_point_code() + "OUT"); |
|
|
|
data2.put("reach",reach2); |
|
|
|
script_args2.put("data",data2); |
|
|
|
script_args2.put("protocol","HTTP"); |
|
|
|
jo2.put("script_args",script_args2); |
|
|
|
reach2.put("task_code", inst.getInstruction_code()); |
|
|
|
reach2.put("address", inst.getStart_point_code() + "OUT"); |
|
|
|
data2.put("reach", reach2); |
|
|
|
script_args2.put("data", data2); |
|
|
|
script_args2.put("protocol", "HTTP"); |
|
|
|
jo2.put("script_args", script_args2); |
|
|
|
ja.add(jo2); |
|
|
|
|
|
|
|
JSONObject jo3 = new JSONObject(); |
|
|
|
jo3.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo3.put("location",inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("operation","script"); |
|
|
|
jo3.put("id",inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("script_name","userpy/interact.py"); |
|
|
|
jo3.put("location", inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("operation", "script"); |
|
|
|
jo3.put("id", inst.getNext_point_code() + "IN"); |
|
|
|
jo3.put("script_name", "userpy/interact.py"); |
|
|
|
JSONObject script_args3 = new JSONObject(); |
|
|
|
script_args3.put("addr",addr); |
|
|
|
script_args3.put("addr", addr); |
|
|
|
JSONObject data3 = new JSONObject(); |
|
|
|
JSONObject reach3 = new JSONObject(); |
|
|
|
reach3.put("task_code",inst.getInstruction_code()); |
|
|
|
reach3.put("address",inst.getNext_point_code() + "IN"); |
|
|
|
data3.put("reach",reach3); |
|
|
|
script_args3.put("data",data3); |
|
|
|
script_args3.put("protocol","HTTP"); |
|
|
|
jo3.put("script_args",script_args3); |
|
|
|
reach3.put("task_code", inst.getInstruction_code()); |
|
|
|
reach3.put("address", inst.getNext_point_code() + "IN"); |
|
|
|
data3.put("reach", reach3); |
|
|
|
script_args3.put("data", data3); |
|
|
|
script_args3.put("protocol", "HTTP"); |
|
|
|
jo3.put("script_args", script_args3); |
|
|
|
ja.add(jo3); |
|
|
|
JSONObject jo4 = new JSONObject(); |
|
|
|
jo4.put("blockId",IdUtil.simpleUUID()); |
|
|
|
jo4.put("location",inst.getNext_point_code()); |
|
|
|
jo4.put("operation","JackUnload"); |
|
|
|
jo4.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo4.put("location", inst.getNext_point_code()); |
|
|
|
jo4.put("operation", "JackUnload"); |
|
|
|
ja.add(jo4); |
|
|
|
JSONObject jo5 = new JSONObject(); |
|
|
|
jo5.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo5.put("location",inst.getNext_point_code() + "OUT"); |
|
|
|
jo5.put("operation","script"); |
|
|
|
jo5.put("id",inst.getNext_point_code() + "OUT"); |
|
|
|
jo5.put("script_name","userpy/interact.py"); |
|
|
|
jo5.put("location", inst.getNext_point_code() + "OUT"); |
|
|
|
jo5.put("operation", "script"); |
|
|
|
jo5.put("id", inst.getNext_point_code() + "OUT"); |
|
|
|
jo5.put("script_name", "userpy/interact.py"); |
|
|
|
JSONObject script_args5 = new JSONObject(); |
|
|
|
script_args5.put("addr",addr); |
|
|
|
script_args5.put("addr", addr); |
|
|
|
JSONObject data5 = new JSONObject(); |
|
|
|
JSONObject reach5 = new JSONObject(); |
|
|
|
reach5.put("task_code",inst.getInstruction_code()); |
|
|
|
reach5.put("address",inst.getNext_point_code() + "OUT"); |
|
|
|
data5.put("reach",reach5); |
|
|
|
script_args5.put("data",data5); |
|
|
|
script_args5.put("protocol","HTTP"); |
|
|
|
jo5.put("script_args",script_args5); |
|
|
|
reach5.put("task_code", inst.getInstruction_code()); |
|
|
|
reach5.put("address", inst.getNext_point_code() + "OUT"); |
|
|
|
data5.put("reach", reach5); |
|
|
|
script_args5.put("data", data5); |
|
|
|
script_args5.put("protocol", "HTTP"); |
|
|
|
jo5.put("script_args", script_args5); |
|
|
|
ja.add(jo5); |
|
|
|
System.out.println(ja); |
|
|
|
return ja; |
|
|
|
return ja; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|