|
|
@ -511,49 +511,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse queryMagicAgvDeviceStatus() { |
|
|
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/v1/vehicles"; |
|
|
|
|
|
|
|
HttpResponse result = HttpRequest.get(agvurl) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
System.out.println("查询agv状态数据:" + result.body()); |
|
|
|
if (result.getStatus() == 200) { |
|
|
|
JSONArray ja = JSONArray.fromObject(result.body()); |
|
|
|
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 positionAngle = jo.getString("positionAngle"); |
|
|
|
String positionX = jo.getString("positionX"); |
|
|
|
String positionY = jo.getString("positionY"); |
|
|
|
AgvDto dto = new AgvDto(); |
|
|
|
dto.setName(name); |
|
|
|
dto.setEnergyLevel(energyLevel); |
|
|
|
dto.setState(state); |
|
|
|
dto.setPositionAngle(positionAngle); |
|
|
|
dto.setPositionX(positionX); |
|
|
|
dto.setPositionY(positionY); |
|
|
|
dto.setTransportOrder(transportOrder); |
|
|
|
|
|
|
|
if (AGVDeviceStatus.containsKey(name)) { |
|
|
|
AGVDeviceStatus.remove(name); |
|
|
|
AGVDeviceStatus.put(name, dto); |
|
|
|
} else { |
|
|
|
AGVDeviceStatus.put(name, dto); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} else { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List queryMagicAgvStatus() { |
|
|
@ -591,9 +550,10 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse queryXZAgvDeviceStatus() { |
|
|
|
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(acsConfigService.findByCode(AcsConfig.FORKAGV).getValue().toString(), "1")) { |
|
|
|
String agvurl = acsConfigService.findByCode(AcsConfig.AGVURL).getValue(); |
|
|
|
String agvport = acsConfigService.findByCode(AcsConfig.AGVPORT).getValue(); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/robotsStatus"; |
|
|
|
|
|
|
@ -603,99 +563,110 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
System.out.println("查询agv状态数据:" + result.body()); |
|
|
|
if (result.getStatus() == 200) { |
|
|
|
JSONArray ja = JSONArray.fromObject(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"); |
|
|
|
JSONObject detailjo = JSONObject.fromObject(result.body()); |
|
|
|
JSONObject item = (JSONObject) detailjo.get(name); |
|
|
|
if(ObjectUtil.isEmpty(detailjo.get(name))){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
String x = item.getString("x"); |
|
|
|
String y = item.getString("y"); |
|
|
|
String angle = item.getString("angle"); |
|
|
|
String battery_temp = item.getString("battery_temp"); |
|
|
|
String blocked = item.getString("blocked"); |
|
|
|
String brake = item.getString("brake"); |
|
|
|
String charging = item.getString("charging"); |
|
|
|
String controller_temp = item.getString("controller_temp"); |
|
|
|
String current_map = item.getString("current_map"); |
|
|
|
String current_station = item.getString("current_station"); |
|
|
|
String emergency = item.getString("emergency"); |
|
|
|
String odo = item.getString("odo"); |
|
|
|
String requestCurrent = item.getString("requestCurrent"); |
|
|
|
String requestVoltage = item.getString("requestVoltage"); |
|
|
|
String soft_emc = item.getString("soft_emc"); |
|
|
|
String today_odo = item.getString("today_odo"); |
|
|
|
String voltage = item.getString("voltage"); |
|
|
|
String vx = item.getString("vx"); |
|
|
|
String vy = item.getString("vy"); |
|
|
|
String w = item.getString("w"); |
|
|
|
|
|
|
|
|
|
|
|
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.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); |
|
|
|
dto.setBattery_temp(battery_temp); |
|
|
|
dto.setBlocked(blocked); |
|
|
|
dto.setBrake(brake); |
|
|
|
dto.setCharging(charging); |
|
|
|
dto.setController_temp(controller_temp); |
|
|
|
dto.setCurrent_station(current_station); |
|
|
|
dto.setEmergency(emergency); |
|
|
|
dto.setOdo(odo); |
|
|
|
dto.setRequestCurrent(requestCurrent); |
|
|
|
dto.setRequestVoltage(requestVoltage); |
|
|
|
dto.setVoltage(voltage); |
|
|
|
dto.setSoft_emc(soft_emc); |
|
|
|
dto.setVx(vx); |
|
|
|
dto.setVy(vy); |
|
|
|
dto.setW(w); |
|
|
|
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; |
|
|
|
} else { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse queryXZAgvInstStatus(String instCode) { |
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
agvurl = agvurl + ":" + agvport + "/api/route/transportOrders/" + instCode; |
|
|
|
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999"; |
|
|
|
List<Instruction> insts = instructionService.findAllInstFromCache(); |
|
|
|
if (!insts.isEmpty()) { |
|
|
|
JSONObject where = new JSONObject(); |
|
|
|
where.put("relation", "OR"); |
|
|
|
JSONArray predicates = new JSONArray(); |
|
|
|
where.put("predicates", predicates); |
|
|
|
for (Instruction instruction : insts) { |
|
|
|
JSONArray row = new JSONArray(); |
|
|
|
row.add("id"); |
|
|
|
row.add("EQ"); |
|
|
|
row.add(instruction.getInstruction_code()); |
|
|
|
predicates.add(row); |
|
|
|
} |
|
|
|
agvurl = agvurl+ "&where=" + where; |
|
|
|
} |
|
|
|
|
|
|
|
HttpResponse result = HttpRequest.get(agvurl) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
System.out.println("查询agv指令数据:" + result.body()); |
|
|
|
|
|
|
|
return result; |
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -742,25 +713,24 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse deleteXZAgvInst(String instCode) { |
|
|
|
|
|
|
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) { |
|
|
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV), "1")) { |
|
|
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); |
|
|
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); |
|
|
|
|
|
|
|
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); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -1081,24 +1051,26 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
if (StrUtil.isBlank(address)) { |
|
|
|
throw new BadRequestException("请求失败,地址为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
String startcode=inst.getStart_device_code(); |
|
|
|
//请求取货
|
|
|
|
if (address.contains("INGET")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getStart_device_code()); |
|
|
|
jo.put("device_status","enter"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","1"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
for(Object key:jo.keySet()){ |
|
|
|
JSONObject jo1=new JSONObject(); |
|
|
|
jo1.put(key,jo.get(key)); |
|
|
|
ja.add(jo1); |
|
|
|
} |
|
|
|
ja.add(jo); |
|
|
|
HttpResponse result=acsToWmsService.vehicle(ja); |
|
|
|
log.info("请求取货请求参数:{}", ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
log.info("上位反馈请求取货请求参数:{}",response); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("上位允许取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许取货"); |
|
|
|
} |
|
|
@ -1107,40 +1079,45 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
if (address.contains("OUTGET")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getStart_device_code()); |
|
|
|
jo.put("device_status","left"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","2"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
for(Object key:jo.keySet()){ |
|
|
|
JSONObject jo1=new JSONObject(); |
|
|
|
jo1.put(key,jo.get(key)); |
|
|
|
ja.add(jo1); |
|
|
|
} |
|
|
|
ja.add(jo); |
|
|
|
log.info("取货完成离开请求参数:{}", ja); |
|
|
|
HttpResponse result=acsToWmsService.vehicle(ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
log.info("上位反馈取货完成离开请求参数:{}",response); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("上位允许取货离开 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许取货完成离开"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//请求放货
|
|
|
|
if (address.contains("INPUT")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getNext_device_code()); |
|
|
|
jo.put("device_status","enter"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","3"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
for(Object key:jo.keySet()){ |
|
|
|
JSONObject jo1=new JSONObject(); |
|
|
|
jo1.put(key,jo.get(key)); |
|
|
|
ja.add(jo1); |
|
|
|
} |
|
|
|
ja.add(jo); |
|
|
|
log.info("请求放货请求参数:{}", ja); |
|
|
|
HttpResponse result=acsToWmsService.vehicle(ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
log.info("上位反馈请求放货请求参数:{}",response); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("上位允许放货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许请求放货"); |
|
|
|
} |
|
|
@ -1150,19 +1127,21 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
if (address.contains("OUTPUT")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getNext_device_code()); |
|
|
|
jo.put("device_status","left"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","4"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
for(Object key:jo.keySet()){ |
|
|
|
JSONObject jo1=new JSONObject(); |
|
|
|
jo1.put(key,jo.get(key)); |
|
|
|
ja.add(jo1); |
|
|
|
} |
|
|
|
ja.add(jo); |
|
|
|
log.info("放货完成离开:{}", ja); |
|
|
|
HttpResponse result=acsToWmsService.vehicle(ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
log.info("上位反馈放货完成离开请求参数:{}",response); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("status",200); |
|
|
|
log.info("上位允许放货离开 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
}else{ |
|
|
|
throw new BadRequestException("上位系统不允许放货完成离开"); |
|
|
|
} |
|
|
@ -1540,7 +1519,6 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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); |
|
|
@ -1568,7 +1546,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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(); |
|
|
@ -1594,7 +1572,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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(); |
|
|
@ -1615,7 +1593,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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(); |
|
|
@ -1628,22 +1606,249 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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 json1 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4031")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3031")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3012")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4012")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3001")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4001")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4027")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3027")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3027")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4028")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3028")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4017")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3017")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4036")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3036")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3036")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4032")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3032")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4033")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3033")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4034")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3034")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4015")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3035")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4003")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3003")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3034")&&inst.getNext_device_code().equals("4018")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3035")&&inst.getNext_device_code().equals("4018")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3018")&&inst.getNext_device_code().equals("4034")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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); |
|
|
|
}else if(inst.getStart_device_code().equals("3018")&&inst.getNext_device_code().equals("4035")){ |
|
|
|
com.alibaba.fastjson.JSONObject operation_args = new com.alibaba.fastjson.JSONObject(); |
|
|
|
operation_args.put("increase_spin_angle",3.14);//弧度值,如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()); |
|
|
@ -1657,7 +1862,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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(); |
|
|
@ -1987,6 +2192,58 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject releaseBlockGroup(JSONObject requestParam) { |
|
|
|
JSONArray datas = JSONArray.fromObject(requestParam); |
|
|
|
log.info("仙工AGV离开进入管制区域,请求参数 - {}", requestParam); |
|
|
|
for (int i = 0; i < requestParam.size(); i++) { |
|
|
|
JSONObject jo = datas.getJSONObject(i); |
|
|
|
// String robot_name = jo.optString("robot_name");
|
|
|
|
// jo.put("device code", robot_name);
|
|
|
|
jo.put("status", 6); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
HttpResponse result = acsToWmsService.vehicle(ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("message","ok"); |
|
|
|
jo2.put("code",200); |
|
|
|
log.info("上位允许仙工AGV请求离开管制区 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} |
|
|
|
throw new BadRequestException("请求失败,参数错误!"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject getBlockGroup(JSONObject requestParam) { |
|
|
|
JSONArray datas = JSONArray.fromObject(requestParam); |
|
|
|
log.info("仙工AGV请求进入管制区域,请求参数 - {}", requestParam); |
|
|
|
for (int i = 0; i < requestParam.size(); i++) { |
|
|
|
JSONObject jo = datas.getJSONObject(i); |
|
|
|
// String robot_name = jo.optString("robot_name");
|
|
|
|
// jo.put("device code",robot_name);
|
|
|
|
jo.put("status", "5"); |
|
|
|
log.info("请求参数:{}", jo); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
HttpResponse result = acsToWmsService.vehicle(ja); |
|
|
|
com.alibaba.fastjson.JSONObject response = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("message","ok"); |
|
|
|
jo2.put("code",200); |
|
|
|
log.info("上位允许仙工AGV请求进入管制区域 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} else { |
|
|
|
throw new BadRequestException("上位不允许仙工AGV请求进入管制区域"); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new BadRequestException("请求失败,参数错误!"); |
|
|
|
} |
|
|
|
|
|
|
|
String hexToString(int i) { |
|
|
|
return (i < 16 ? "0" + Integer.toHexString(i) : Integer.toHexString(i)).toUpperCase(); |
|
|
|
} |
|
|
@ -2023,4 +2280,5 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
System.out.println(address); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|