|
|
@ -47,136 +47,123 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
@Autowired |
|
|
|
private ParamService paramService; |
|
|
|
@Autowired |
|
|
|
TaskService taskService; |
|
|
|
@Autowired |
|
|
|
private AcsToWmsService acsToWmsService; |
|
|
|
@Autowired |
|
|
|
InstructionService instructionService; |
|
|
|
@Autowired |
|
|
|
AcsToWmsZDService acsToWmsZDService; |
|
|
|
@Autowired |
|
|
|
AcsConfigService acsConfigService; |
|
|
|
|
|
|
|
Map<String, AgvDto> AGVDeviceStatus = new HashMap(); |
|
|
|
|
|
|
|
|
|
|
|
@Value("${agvToAcs.addr}") |
|
|
|
private String addr; |
|
|
|
@LokiLog(type = LokiLogType.AGV) |
|
|
|
@Override |
|
|
|
public String waitPointRequest(String param) { |
|
|
|
log.info("收到AGV请求参数:{}", param); |
|
|
|
String[] strs = param.split("-"); |
|
|
|
String address = strs[0]; |
|
|
|
String inst_code = strs[1]; |
|
|
|
String type = strs[2]; |
|
|
|
String newaddress = null; |
|
|
|
// 前置点会加上p
|
|
|
|
if (address.endsWith("IN")) { |
|
|
|
newaddress = address.substring(0, address.length() - 2); |
|
|
|
} else if (address.endsWith("OUT")) { |
|
|
|
newaddress = address.substring(0, address.length() - 3); |
|
|
|
} else if (address.endsWith("P") || address.endsWith("L") || address.endsWith("R")) { |
|
|
|
newaddress = address.substring(0, address.length() - 1); |
|
|
|
} else if (address.endsWith("CZ")) { |
|
|
|
newaddress = address.substring(0, address.length() - 2); |
|
|
|
} else if (address.endsWith("IQ") || address.endsWith("OQ")) { |
|
|
|
newaddress = address.substring(0, address.length() - 2); |
|
|
|
} else { |
|
|
|
newaddress = address; |
|
|
|
public JSONObject xgAGVWaitPointRequest(JSONObject requestParam) { |
|
|
|
log.info("仙工AGV请求取放货,请求参数 - {}", requestParam); |
|
|
|
String instCode = requestParam.getString("task_code"); |
|
|
|
Instruction inst = instructionService.findByCodeFromCache(instCode); |
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
throw new BadRequestException("请求失败,未找到指令!"); |
|
|
|
} |
|
|
|
TaskDto task = taskService.findByCodeFromCache(inst.getTask_code()); |
|
|
|
if (ObjectUtil.isEmpty(task)) { |
|
|
|
throw new BadRequestException("请求失败,未找到指令对应任务!"); |
|
|
|
} |
|
|
|
String address = requestParam.getString("address"); |
|
|
|
if (StrUtil.isBlank(address)) { |
|
|
|
throw new BadRequestException("请求失败,地址为空!"); |
|
|
|
} |
|
|
|
boolean is_feedback = false; |
|
|
|
Device device = deviceAppService.findDeviceByCode(newaddress); |
|
|
|
Instruction inst = instructionService.findByCodeFromCache(inst_code); |
|
|
|
TaskService taskService = SpringContextHolder.getBean("taskServiceImpl"); |
|
|
|
AcsToWmsZDService acsToWmsZDService = SpringContextHolder.getBean("acsToWmsZDServiceImpl"); |
|
|
|
TaskDto task = taskService.findByCode(inst.getTask_code()); |
|
|
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); |
|
|
|
//请求取货
|
|
|
|
if (StrUtil.equals(type, "01") && address.endsWith("IN")) { |
|
|
|
if (address.contains("INGET")) { |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("taskCode", task.getTask_code()); |
|
|
|
jo.put("carId", inst.getCarno()); |
|
|
|
jo.put("taskType ", task.getTask_type()); |
|
|
|
jo.put("feedbackStatus", "applyTake"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
log.info("请求取货请求参数:{}", jo); |
|
|
|
HttpResponse result = acsToWmsZDService.taskFeedback(jo); |
|
|
|
JSONObject response = JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("responseCode"); |
|
|
|
if (responseCode == 0) { |
|
|
|
is_feedback = true; |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许取货"); |
|
|
|
} |
|
|
|
} |
|
|
|
//取货完成
|
|
|
|
else if (StrUtil.equals(type, "02")) { |
|
|
|
if (address.contains("OUTGET")) { |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("taskCode", task.getTask_code()); |
|
|
|
jo.put("carId", inst.getCarno()); |
|
|
|
jo.put("taskType ", task.getTask_type()); |
|
|
|
jo.put("feedbackStatus", "takeFinish"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
log.info("取货完成请求参数:{}", jo); |
|
|
|
HttpResponse result = acsToWmsZDService.taskFeedback(jo); |
|
|
|
JSONObject response = JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("responseCode"); |
|
|
|
if (responseCode == 0) { |
|
|
|
is_feedback = true; |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许取货完成离开"); |
|
|
|
} |
|
|
|
} |
|
|
|
//取货完成离开
|
|
|
|
else if (StrUtil.equals(type, "05") && address.endsWith("OUT")) { |
|
|
|
is_feedback = true; |
|
|
|
} |
|
|
|
// //取货完成离开
|
|
|
|
// else if (StrUtil.equals(type, "05") && address.endsWith("OUT")) {
|
|
|
|
// is_feedback = true;
|
|
|
|
// }
|
|
|
|
//请求放货
|
|
|
|
else if (StrUtil.equals(type, "03") && address.endsWith("IN")) { |
|
|
|
if (address.contains("INPUT")) { |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("taskCode", task.getTask_code()); |
|
|
|
jo.put("carId", inst.getCarno()); |
|
|
|
jo.put("taskType ", task.getTask_type()); |
|
|
|
jo.put("feedbackStatus", "applyPut"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
log.info("请求放货请求参数:{}", jo); |
|
|
|
HttpResponse result = acsToWmsZDService.taskFeedback(jo); |
|
|
|
JSONObject response = JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("responseCode"); |
|
|
|
if (responseCode == 0) { |
|
|
|
is_feedback = true; |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许请求放货"); |
|
|
|
} |
|
|
|
} |
|
|
|
//放货完成
|
|
|
|
else if (StrUtil.equals(type, "04")) { |
|
|
|
if (address.contains("OUTPUT")) { |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("taskCode", task.getTask_code()); |
|
|
|
jo.put("carId", inst.getCarno()); |
|
|
|
jo.put("taskType ", task.getTask_type()); |
|
|
|
jo.put("feedbackStatus", "putFinish"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
log.info("放货完成请求参数:{}", jo); |
|
|
|
HttpResponse result = acsToWmsZDService.taskFeedback(jo); |
|
|
|
JSONObject response = JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("responseCode"); |
|
|
|
if (responseCode == 0) { |
|
|
|
is_feedback = true; |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("请求ZDwcs成功,申请取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许放货完成离开"); |
|
|
|
} |
|
|
|
} |
|
|
|
//放货完成离开
|
|
|
|
else if (StrUtil.equals(type, "06") && address.endsWith("OUT") |
|
|
|
&& standardOrdinarySiteDeviceDriver.getMove() != 0) { |
|
|
|
is_feedback = true; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
if (is_feedback) { |
|
|
|
jo.put("name", param); |
|
|
|
jo.put("lastAction", "wait"); |
|
|
|
jo.put("lastActionStatus", "DONE"); |
|
|
|
jo.put("status", "IDLE"); |
|
|
|
} else { |
|
|
|
jo.put("name", param); |
|
|
|
jo.put("lastAction", "wait"); |
|
|
|
jo.put("lastActionStatus", "FAILED"); |
|
|
|
jo.put("status", "IDLE"); |
|
|
|
} |
|
|
|
is_feedback = false; |
|
|
|
log.info("反馈AGV请求参数:{}", jo.toString()); |
|
|
|
return jo.toString(); |
|
|
|
throw new BadRequestException("请求失败,IN OUT 站点错误!"); |
|
|
|
} |
|
|
|
|
|
|
|
@LokiLog(type = LokiLogType.AGV) |
|
|
@ -208,53 +195,80 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
@Override |
|
|
|
public HttpResponse queryXZAgvDeviceStatus() { |
|
|
|
|
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { |
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue().toString(), "1")) { |
|
|
|
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); |
|
|
|
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); |
|
|
|
|
|
|
|
String agvurl1 = agvurl + ":" + agvport + "/api/route/vehicles"; |
|
|
|
String agvurl2 = agvurl + ":" + agvport + "/api/route/vehicleDetails"; |
|
|
|
agvurl = agvurl + ":" + agvport + "/robotsStatus"; |
|
|
|
|
|
|
|
HttpResponse result = HttpRequest.get(agvurl1) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
|
|
|
|
|
|
|
|
HttpResponse result2 = HttpRequest.get(agvurl2) |
|
|
|
HttpResponse result = HttpRequest.get(agvurl) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
|
|
|
|
System.out.println("查询agv状态数据:" + result.body()); |
|
|
|
if (result.getStatus() == 200) { |
|
|
|
JSONArray ja = (JSONArray) JSONArray.parse(result.body()); |
|
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject body = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
com.alibaba.fastjson.JSONArray ja = body.getJSONArray("report"); |
|
|
|
for (int i = 0; i < ja.size(); i++) { |
|
|
|
JSONObject jo = (JSONObject) ja.get(i); |
|
|
|
String name = jo.getString("name"); |
|
|
|
String state = jo.getString("state"); |
|
|
|
String energyLevel = jo.getString("energyLevel"); |
|
|
|
String transportOrder = jo.getString("transportOrder"); |
|
|
|
String vehicle=jo.getString("getString"); |
|
|
|
JSONObject detailjo = (JSONObject) JSONObject.parse(result2.body()); |
|
|
|
JSONObject item = (JSONObject) detailjo.get(name); |
|
|
|
String x = item.getString("x"); |
|
|
|
String y = item.getString("y"); |
|
|
|
String angle = item.getString("angle"); |
|
|
|
com.alibaba.fastjson.JSONObject jo = ja.getJSONObject(i); |
|
|
|
//机器人编码
|
|
|
|
String agv_code = jo.getString("uuid"); |
|
|
|
//机器人详细状态信息
|
|
|
|
com.alibaba.fastjson.JSONObject rbk_report = jo.getJSONObject("rbk_report"); |
|
|
|
//是否正在充电
|
|
|
|
Boolean charging = rbk_report.getBoolean("charging"); |
|
|
|
//电池电量
|
|
|
|
float battery_level1 = rbk_report.getFloatValue("battery_level"); |
|
|
|
float battery_level=battery_level1*100; |
|
|
|
//当前地图
|
|
|
|
String current_map = rbk_report.getString("current_map"); |
|
|
|
//角度
|
|
|
|
float angle = rbk_report.getFloatValue("angle"); |
|
|
|
//执行运单信息
|
|
|
|
com.alibaba.fastjson.JSONObject current_order = jo.getJSONObject("current_order"); |
|
|
|
int task_status=rbk_report.getInteger("task_status"); |
|
|
|
String state=null; |
|
|
|
if(task_status==0){ |
|
|
|
state="NONE"; |
|
|
|
}if(task_status==1){ |
|
|
|
state="WAITING"; |
|
|
|
}if(task_status==2){ |
|
|
|
state="RUNNING"; |
|
|
|
}if(task_status==3){ |
|
|
|
state="SUSPENDED"; |
|
|
|
}if(task_status==4){ |
|
|
|
state="COMPLETED"; |
|
|
|
}if(task_status==5){ |
|
|
|
state="FAILED"; |
|
|
|
}if(task_status==6){ |
|
|
|
state="CANCELED"; |
|
|
|
} |
|
|
|
Integer connectionStatus = jo.getInteger("connection_status"); |
|
|
|
String inst_code = current_order.getString("id"); |
|
|
|
String taskNo= "0"; |
|
|
|
if (StrUtil.isNotEmpty(inst_code)) { |
|
|
|
Instruction inst = instructionService.findByCodeFromCache(inst_code); |
|
|
|
if (ObjectUtil.isNotEmpty(inst)) { |
|
|
|
//任务号
|
|
|
|
taskNo = inst.getTask_code(); |
|
|
|
} |
|
|
|
} |
|
|
|
//x坐标
|
|
|
|
float x = rbk_report.getFloatValue("x"); |
|
|
|
//y坐标
|
|
|
|
float y = rbk_report.getFloatValue("y"); |
|
|
|
AgvDto dto = new AgvDto(); |
|
|
|
dto.setName(name); |
|
|
|
dto.setEnergyLevel(energyLevel); |
|
|
|
dto.setState(state); |
|
|
|
dto.setTransportOrder(transportOrder); |
|
|
|
dto.setVehicle(vehicle); |
|
|
|
dto.setPositionAngle(angle); |
|
|
|
dto.setName(agv_code); |
|
|
|
dto.setCurrent_map(current_map); |
|
|
|
dto.setCharging(charging); |
|
|
|
dto.setBattery_level(battery_level); |
|
|
|
dto.setTransportOrder(taskNo); |
|
|
|
dto.setPositionX(x); |
|
|
|
dto.setPositionY(y); |
|
|
|
if (AGVDeviceStatus.containsKey(name)) { |
|
|
|
AGVDeviceStatus.remove(name); |
|
|
|
AGVDeviceStatus.put(name, dto); |
|
|
|
} else { |
|
|
|
AGVDeviceStatus.put(name, dto); |
|
|
|
} |
|
|
|
dto.setPositionAngle(angle); |
|
|
|
dto.setConnection_status(connectionStatus); |
|
|
|
dto.setState(state); |
|
|
|
AGVDeviceStatus.put(agv_code, dto); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
@ -268,9 +282,9 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
@LokiLog(type = LokiLogType.AGV) |
|
|
|
@Override |
|
|
|
public HttpResponse queryXZAgvInstStatus() { |
|
|
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { |
|
|
|
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); |
|
|
|
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999"; |
|
|
|
List<Instruction> insts = instructionService.findAllInstFromCache(); |
|
|
@ -307,9 +321,13 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); |
|
|
|
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/api/route/transportOrders/" + instCode + "/withdrawal"; |
|
|
|
com.alibaba.fastjson.JSONObject param = new com.alibaba.fastjson.JSONObject(); |
|
|
|
param.put("id", instCode); |
|
|
|
param.put("disableVehicle", false); |
|
|
|
agvurl = agvurl + ":" + agvport + "/terminate"; |
|
|
|
log.info("删除agv指令请求agvurl:{}", agvurl); |
|
|
|
HttpResponse result = HttpRequest.post(agvurl) |
|
|
|
.body(param.toJSONString()) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
log.info("删除agv指令请求反馈:{}", result); |
|
|
@ -322,18 +340,19 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
@LokiLog(type = LokiLogType.AGV) |
|
|
|
@Override |
|
|
|
public HttpResponse sendOrderSequencesToXZ(Instruction inst) throws Exception { |
|
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo.put("id", inst.getInstruction_code()); |
|
|
|
jo.put("complete", true); |
|
|
|
jo.put("blocks", createBlocksData(inst)); |
|
|
|
jo.put("priority", inst.getPriority()); |
|
|
|
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString()); |
|
|
|
|
|
|
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV), "1")) { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { |
|
|
|
log.info("准备下发"); |
|
|
|
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); |
|
|
|
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); |
|
|
|
agvurl = agvurl + ":" + agvport + "/setOrder"; |
|
|
|
|
|
|
|
log.info("下发地址为{}",agvurl); |
|
|
|
HttpResponse result = HttpRequest.post(agvurl) |
|
|
|
.body(String.valueOf(jo))//表单内容
|
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
@ -347,6 +366,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
} |
|
|
|
public com.alibaba.fastjson.JSONArray createBlocksData(Instruction inst) { |
|
|
|
com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray(); |
|
|
|
com.alibaba.fastjson.JSONObject jo9 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo9.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo9.put("location", inst.getStart_point_code() + "INGET"); |
|
|
|
jo9.put("binTask", "ForkLoad"); |
|
|
|
ja.add(jo9); |
|
|
|
Device startDevice = deviceAppService.findDeviceByCode(inst.getStart_device_code()); |
|
|
|
if ("true".equals(startDevice.getExtraValue().get("ignore_pickup_check"))) { |
|
|
|
//取货前等待
|
|
|
@ -355,7 +379,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo.put("location", inst.getStart_point_code() + "INGET"); |
|
|
|
jo.put("operation", "script"); |
|
|
|
jo.put("id", inst.getStart_point_code() + "INGET"); |
|
|
|
jo.put("script_name", "userpy/interact.py"); |
|
|
|
jo.put("script_name", "userpy/interact1.py"); |
|
|
|
com.alibaba.fastjson.JSONObject script_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
script_args.put("addr", addr); |
|
|
|
com.alibaba.fastjson.JSONObject data = new com.alibaba.fastjson.JSONObject(); |
|
|
@ -368,11 +392,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo.put("script_args", script_args); |
|
|
|
ja.add(jo); |
|
|
|
} |
|
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject jo1 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo1.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo1.put("location", inst.getStart_point_code()); |
|
|
|
jo1.put("operation", "JackLoad"); |
|
|
|
jo1.put("binTask", "ForkLoad"); |
|
|
|
ja.add(jo1); |
|
|
|
|
|
|
|
//取货完成等待
|
|
|
@ -381,7 +404,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo2.put("location", inst.getStart_point_code() + "OUTGET"); |
|
|
|
jo2.put("operation", "script"); |
|
|
|
jo2.put("id", inst.getStart_point_code() + "OUTGET"); |
|
|
|
jo2.put("script_name", "userpy/interact.py"); |
|
|
|
jo2.put("script_name", "userpy/interact1.py"); |
|
|
|
com.alibaba.fastjson.JSONObject script_args2 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
script_args2.put("addr", addr); |
|
|
|
com.alibaba.fastjson.JSONObject data2 = new com.alibaba.fastjson.JSONObject(); |
|
|
@ -393,7 +416,16 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
script_args2.put("protocol", "HTTP"); |
|
|
|
jo2.put("script_args", script_args2); |
|
|
|
ja.add(jo2); |
|
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject jo6 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo6.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo6.put("location", inst.getStart_point_code() + "OUTGET"); |
|
|
|
jo6.put("binTask", "ForkUnload"); |
|
|
|
ja.add(jo6); |
|
|
|
com.alibaba.fastjson.JSONObject jo7 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo7.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo7.put("location", inst.getNext_point_code() + "INPUT"); |
|
|
|
jo7.put("binTask", "ForkLoad"); |
|
|
|
ja.add(jo7); |
|
|
|
Device nextDevice = deviceAppService.findDeviceByCode(inst.getNext_device_code()); |
|
|
|
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) { |
|
|
|
//放货前等待
|
|
|
@ -402,7 +434,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo3.put("location", inst.getNext_point_code() + "INPUT"); |
|
|
|
jo3.put("operation", "script"); |
|
|
|
jo3.put("id", inst.getNext_point_code() + "INPUT"); |
|
|
|
jo3.put("script_name", "userpy/interact.py"); |
|
|
|
jo3.put("script_name", "userpy/interact1.py"); |
|
|
|
com.alibaba.fastjson.JSONObject script_args3 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
script_args3.put("addr", addr); |
|
|
|
com.alibaba.fastjson.JSONObject data3 = new com.alibaba.fastjson.JSONObject(); |
|
|
@ -415,26 +447,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo3.put("script_args", script_args3); |
|
|
|
ja.add(jo3); |
|
|
|
} |
|
|
|
|
|
|
|
// //放货前下发旋转角度
|
|
|
|
// com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject();
|
|
|
|
// AcsPointAngleDto acsPointAngleDto = acsPointAngleService.findByCode(inst.getStart_device_code(),inst.getNext_device_code());
|
|
|
|
// if (ObjectUtil.isNotEmpty(acsPointAngleDto)){
|
|
|
|
// log.info("acsPointAngleDto----參數,{}", acsPointAngleDto.toString());
|
|
|
|
// com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject();
|
|
|
|
// BigDecimal next_point_angle = acsPointAngleDto.getNext_point_angle();
|
|
|
|
// operation_args.put("increase_spin_angle",next_point_angle);//弧度值,如3.14
|
|
|
|
// operation_args.put("skill_name","GoByOdometer");
|
|
|
|
// json1.put("blockId", IdUtil.simpleUUID());
|
|
|
|
// json1.put("location", inst.getNext_point_code() + "INPUT");
|
|
|
|
// json1.put("operation_args",operation_args);
|
|
|
|
// ja.add(json1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo4.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo4.put("location", inst.getNext_point_code()); |
|
|
|
jo4.put("operation", "JackUnload"); |
|
|
|
jo4.put("binTask", "ForkUnload"); |
|
|
|
ja.add(jo4); |
|
|
|
|
|
|
|
if ("true".equals(nextDevice.getExtraValue().get("ignore_release_check"))) { |
|
|
@ -444,7 +460,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo5.put("location", inst.getNext_point_code() + "OUTPUT"); |
|
|
|
jo5.put("operation", "script"); |
|
|
|
jo5.put("id", inst.getNext_point_code() + "OUTPUT"); |
|
|
|
jo5.put("script_name", "userpy/interact.py"); |
|
|
|
jo5.put("script_name", "userpy/interact1.py"); |
|
|
|
com.alibaba.fastjson.JSONObject script_args5 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
script_args5.put("addr", addr); |
|
|
|
com.alibaba.fastjson.JSONObject data5 = new com.alibaba.fastjson.JSONObject(); |
|
|
@ -457,6 +473,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { |
|
|
|
jo5.put("script_args", script_args5); |
|
|
|
ja.add(jo5); |
|
|
|
} |
|
|
|
com.alibaba.fastjson.JSONObject jo8 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
jo8.put("blockId", IdUtil.simpleUUID()); |
|
|
|
jo8.put("location", inst.getNext_point_code() + "OUTPUT"); |
|
|
|
jo8.put("binTask", "ForkUnload"); |
|
|
|
ja.add(jo8); |
|
|
|
return ja; |
|
|
|
} |
|
|
|
|
|
|
|