|
|
@ -1,10 +1,12 @@ |
|
|
|
package org.nl.acs.agv.server.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import net.sf.json.JSONArray; |
|
|
@ -16,10 +18,10 @@ import org.nl.acs.config.server.AcsConfigService; |
|
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
|
import org.nl.acs.device.service.impl.DeviceServiceImpl; |
|
|
|
import org.nl.acs.device_driver.agv_site.AgvSiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.feedback_agv_status.FeedbackAgvStatusDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.machines_site.MachinesSiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.magic3.Magic3DeviceDriver; |
|
|
|
import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.special_ordinary_site.SpecialOrdinarySiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; |
|
|
@ -27,8 +29,6 @@ import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSi |
|
|
|
import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipulatorInspectSiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.weighing_site.WeighingSiteDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.ykbk_special.YkbkSpecialDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.yzja_special.YzjaSpecialDeviceDriver; |
|
|
|
import org.nl.acs.ext.erp.service.AcsToErpService; |
|
|
|
import org.nl.acs.ext.wms.service.AcsToWmsService; |
|
|
@ -49,10 +49,11 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
@ -78,10 +79,17 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
|
|
|
|
private final LogServer logServer; |
|
|
|
|
|
|
|
private boolean startPointInget = false; |
|
|
|
private boolean startPointOutget = false; |
|
|
|
private boolean endPointInput = false; |
|
|
|
private boolean endPointOutput = false; |
|
|
|
private String instcode = null; |
|
|
|
|
|
|
|
Map<String, AgvDto> AGVDeviceStatus = new HashMap(); |
|
|
|
|
|
|
|
@Value("${agvToAcs.addr}") |
|
|
|
private String addr; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获得之后num个天的时间 |
|
|
|
* |
|
|
@ -537,7 +545,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
if (result.getStatus() == 200) { |
|
|
|
arr.add(result.body()); |
|
|
|
} |
|
|
|
} catch (Exception e ){ |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
@ -560,11 +568,25 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
HttpResponse result = HttpRequest.get(agvurl) |
|
|
|
.timeout(20000)//超时,毫秒
|
|
|
|
.execute(); |
|
|
|
|
|
|
|
log.info("查询agv状态:{}", result.body()); |
|
|
|
System.out.println("查询agv状态数据:" + result.body()); |
|
|
|
if (result.getStatus() == 200) { |
|
|
|
if (200 == 200) { |
|
|
|
com.alibaba.fastjson.JSONObject body = com.alibaba.fastjson.JSONObject.parseObject(result.body()); |
|
|
|
com.alibaba.fastjson.JSONArray ja = body.getJSONArray("report"); |
|
|
|
com.alibaba.fastjson.JSONObject alarms = body.getJSONObject("alarms"); |
|
|
|
AtomicBoolean flag = new AtomicBoolean(false); |
|
|
|
if (ObjectUtil.isNotEmpty(alarms) && CollUtil.isNotEmpty(alarms.getJSONArray("errors"))) { |
|
|
|
com.alibaba.fastjson.JSONArray errors = alarms.getJSONArray("errors"); |
|
|
|
errors.forEach(e -> { |
|
|
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(e); |
|
|
|
String code = jsonObject.getStr("code"); |
|
|
|
if (StrUtil.equals(code, "52106")) { |
|
|
|
flag.set(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
//0=可推送;1=正在更新场景;2=正在执行运单。
|
|
|
|
Integer upload_scene_status = body.getInteger("upload_scene_status"); |
|
|
|
for (int i = 0; i < ja.size(); i++) { |
|
|
|
com.alibaba.fastjson.JSONObject jo = ja.getJSONObject(i); |
|
|
|
//机器人编码
|
|
|
@ -575,44 +597,125 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
Boolean charging = rbk_report.getBoolean("charging"); |
|
|
|
//电池电量
|
|
|
|
float battery_level1 = rbk_report.getFloatValue("battery_level"); |
|
|
|
float battery_level=battery_level1*100; |
|
|
|
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"; |
|
|
|
int task_status = rbk_report.getInteger("task_status"); |
|
|
|
//机器人是否被阻挡
|
|
|
|
Boolean blocked = rbk_report.getBoolean("blocked"); |
|
|
|
//true 表示急停按钮处于激活状态(按下), false 表示急停按钮处于非激活状态(拔起)
|
|
|
|
Boolean emergency = rbk_report.getBoolean("emergency"); |
|
|
|
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"; |
|
|
|
} |
|
|
|
//0表示断连,1表示连接上
|
|
|
|
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(); |
|
|
|
String inst_code = null; |
|
|
|
String taskNo = "0"; |
|
|
|
Instruction inst = null; |
|
|
|
if (CollUtil.isNotEmpty(current_order)) { |
|
|
|
inst_code = current_order.getString("id"); |
|
|
|
if (StrUtil.isNotEmpty(inst_code)) { |
|
|
|
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"); |
|
|
|
//是否正在执行用户下发的运单
|
|
|
|
Integer procBusiness = jo.getInteger("procBusiness"); |
|
|
|
Device deviceByCode = deviceAppService.findDeviceByCode(agv_code); |
|
|
|
if (ObjectUtil.isNotNull(deviceByCode) && deviceByCode.getDeviceDriver() instanceof FeedbackAgvStatusDeviceDriver) { |
|
|
|
FeedbackAgvStatusDeviceDriver deviceDriver = (FeedbackAgvStatusDeviceDriver) deviceByCode.getDeviceDriver(); |
|
|
|
if (deviceDriver.getWork() != procBusiness) { |
|
|
|
//工作中
|
|
|
|
deviceDriver.writing("work", procBusiness); |
|
|
|
//休息中
|
|
|
|
deviceDriver.writing("resting", procBusiness == 1 ? 0 : 1); |
|
|
|
} else if ((charging ? 1 : 0) != deviceDriver.getCharging()) { |
|
|
|
//充电中
|
|
|
|
deviceDriver.writing("charging", charging ? 1 : 0); |
|
|
|
deviceDriver.writing("resting", charging ? 0 : 1); |
|
|
|
} else if ((CollUtil.isEmpty(alarms) ? 0 : 1) == deviceDriver.getError()) { |
|
|
|
//故障
|
|
|
|
deviceDriver.writing("error", (ObjectUtil.isEmpty(alarms) ? 0 : 1)); |
|
|
|
} else if ((connectionStatus == 0 && deviceDriver.getPick_up() == 0) || (connectionStatus == 1 && deviceDriver.getPick_up() == 1)) { |
|
|
|
//离线中
|
|
|
|
deviceDriver.writing("pick_up", connectionStatus == 1 ? 0 : 1); |
|
|
|
} else if (task_status == 2 && deviceDriver.getTask_start() != 1) { |
|
|
|
//任务开始
|
|
|
|
deviceDriver.writing("task_start", 1); |
|
|
|
deviceDriver.writing("ma", 0); |
|
|
|
} else if (task_status == 4 && deviceDriver.getMa() != 1) { |
|
|
|
//任务完成
|
|
|
|
deviceDriver.writing("task_start", 0); |
|
|
|
deviceDriver.writing("ma", 1); |
|
|
|
deviceDriver.writing("tss", 0); |
|
|
|
deviceDriver.writing("eots", 0); |
|
|
|
deviceDriver.writing("rtg", 0); |
|
|
|
deviceDriver.writing("tric", 0); |
|
|
|
deviceDriver.writing("rap", 0); |
|
|
|
deviceDriver.writing("rtrtg", 0); |
|
|
|
startPointInget = false; |
|
|
|
endPointOutput = false; |
|
|
|
startPointOutget = false; |
|
|
|
endPointInput = false; |
|
|
|
} else if ((startPointOutget ? 1 : 0) != deviceDriver.getRtg() && Objects.equals(instcode, inst_code)) { |
|
|
|
//取货完成
|
|
|
|
deviceDriver.writing("rtg", startPointOutget ? 1 : 0); |
|
|
|
} else if ((endPointOutput ? 1 : 0) != deviceDriver.getTric() && Objects.equals(inst_code, instcode)) { |
|
|
|
//放货完成
|
|
|
|
deviceDriver.writing("tric", endPointOutput ? 1 : 0); |
|
|
|
} else if ((startPointInget ? 1 : 0) != deviceDriver.getRap() && Objects.equals(inst_code, instcode)) { |
|
|
|
//申请取货
|
|
|
|
deviceDriver.writing("rap", startPointInget ? 1 : 0); |
|
|
|
} else if ((endPointInput ? 1 : 0) != deviceDriver.getRtrtg() && Objects.equals(inst_code, instcode)) { |
|
|
|
//申请放货
|
|
|
|
deviceDriver.writing("rtrtg", endPointInput ? 1 : 0); |
|
|
|
} else if ((flag.get() ? 1 : 0) != deviceDriver.getCac()) { |
|
|
|
//被管制区域管制
|
|
|
|
deviceDriver.writing("cac", flag.get() ? 1 : 0); |
|
|
|
} else if ((blocked ? 1 : 0) != deviceDriver.getBlocked()) { |
|
|
|
//被阻挡
|
|
|
|
deviceDriver.writing("blocked", blocked ? 1 : 0); |
|
|
|
} else if ((emergency ? 1 : 0) != deviceDriver.getEs()) { |
|
|
|
//急停
|
|
|
|
deviceDriver.writing("es", emergency ? 1 : 0); |
|
|
|
} else if (!StrUtil.equals(taskNo, "0") && ObjectUtil.isNotNull(inst)) { |
|
|
|
//任务开始站点
|
|
|
|
deviceDriver.writing("tss", Integer.parseInt(inst.getStart_point_code())); |
|
|
|
//任务结束站点
|
|
|
|
deviceDriver.writing("eots", Integer.parseInt(inst.getNext_point_code())); |
|
|
|
} |
|
|
|
} |
|
|
|
AgvDto dto = new AgvDto(); |
|
|
|
dto.setName(agv_code); |
|
|
|
dto.setCurrent_map(current_map); |
|
|
@ -627,7 +730,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
AGVDeviceStatus.put(agv_code, dto); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return null; |
|
|
|
} else { |
|
|
|
return null; |
|
|
|
} |
|
|
@ -656,7 +759,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
row.add(instruction.getInstruction_code()); |
|
|
|
predicates.add(row); |
|
|
|
} |
|
|
|
agvurl = agvurl+ "&where=" + where; |
|
|
|
agvurl = agvurl + "&where=" + where; |
|
|
|
} |
|
|
|
|
|
|
|
HttpResponse result = HttpRequest.get(agvurl) |
|
|
@ -870,7 +973,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
yzjaSpecialDeviceDriver.setManua_confirm(0); |
|
|
|
inst.setExecute_status("1"); |
|
|
|
is_feedback = true; |
|
|
|
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")){ |
|
|
|
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("1")) { |
|
|
|
yzjaSpecialDeviceDriver.setManua_confirm(1); |
|
|
|
} |
|
|
|
} else { |
|
|
@ -886,7 +989,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
yzjaSpecialDeviceDriver.setManua_confirm(0); |
|
|
|
inst.setExecute_status("3"); |
|
|
|
is_feedback = true; |
|
|
|
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")){ |
|
|
|
} else if (ObjectUtil.isEmpty(inst.getExecute_status()) || !inst.getExecute_status().equals("3")) { |
|
|
|
yzjaSpecialDeviceDriver.setManua_confirm(1); |
|
|
|
} |
|
|
|
} else { |
|
|
@ -1040,6 +1143,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
log.info("仙工AGV请求取放货,请求参数 - {}", requestParam); |
|
|
|
String instCode = requestParam.getString("task_code"); |
|
|
|
Instruction inst = instructionService.findByCodeFromCache(instCode); |
|
|
|
instcode = instCode; |
|
|
|
if (ObjectUtil.isEmpty(inst)) { |
|
|
|
throw new BadRequestException("请求失败,未找到指令!"); |
|
|
|
} |
|
|
@ -1051,101 +1155,105 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
if (StrUtil.isBlank(address)) { |
|
|
|
throw new BadRequestException("请求失败,地址为空!"); |
|
|
|
} |
|
|
|
String startcode=inst.getStart_device_code(); |
|
|
|
//请求取货
|
|
|
|
String startcode = inst.getStart_device_code(); |
|
|
|
//请求取货
|
|
|
|
if (address.contains("INGET")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getStart_device_code()); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","1"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
HttpResponse result=acsToWmsService.vehicle(ja); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("device_code", inst.getStart_device_code()); |
|
|
|
jo.put("task_code", inst.getTask_code()); |
|
|
|
jo.put("status", "1"); |
|
|
|
jo.put("vehicle_code", inst.getVehicle_code()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
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("上位系统不允许取货"); |
|
|
|
} |
|
|
|
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); |
|
|
|
startPointInget = true; |
|
|
|
log.info("上位允许取货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} else { |
|
|
|
throw new BadRequestException("上位系统不允许取货"); |
|
|
|
} |
|
|
|
//取货完成离开
|
|
|
|
} |
|
|
|
//取货完成离开
|
|
|
|
if (address.contains("OUTGET")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getStart_device_code()); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","2"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("device_code", inst.getStart_device_code()); |
|
|
|
jo.put("task_code", inst.getTask_code()); |
|
|
|
jo.put("status", "2"); |
|
|
|
jo.put("vehicle_code", inst.getVehicle_code()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
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("上位系统不允许取货完成离开"); |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
startPointOutget = true; |
|
|
|
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("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","3"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("device_code", inst.getNext_device_code()); |
|
|
|
jo.put("task_code", inst.getTask_code()); |
|
|
|
jo.put("status", "3"); |
|
|
|
jo.put("vehicle_code", inst.getVehicle_code()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
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("上位系统不允许请求放货"); |
|
|
|
} |
|
|
|
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); |
|
|
|
endPointInput = true; |
|
|
|
log.info("上位允许放货 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} else { |
|
|
|
throw new BadRequestException("上位系统不允许请求放货"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//放货完成离开
|
|
|
|
//放货完成离开
|
|
|
|
if (address.contains("OUTPUT")) { |
|
|
|
JSONObject jo=new JSONObject(); |
|
|
|
jo.put("device_code",inst.getNext_device_code()); |
|
|
|
jo.put("task_code",inst.getTask_code()); |
|
|
|
jo.put("status","4"); |
|
|
|
jo.put("vehicle_code",inst.getVehicle_code()); |
|
|
|
JSONArray ja=new JSONArray(); |
|
|
|
ja.add(jo); |
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("device_code", inst.getNext_device_code()); |
|
|
|
jo.put("task_code", inst.getTask_code()); |
|
|
|
jo.put("status", "4"); |
|
|
|
jo.put("vehicle_code", inst.getVehicle_code()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
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("上位系统不允许放货完成离开"); |
|
|
|
} |
|
|
|
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(); |
|
|
|
endPointOutput = true; |
|
|
|
jo2.put("status", 200); |
|
|
|
log.info("上位允许放货离开 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} else { |
|
|
|
throw new BadRequestException("上位系统不允许放货完成离开"); |
|
|
|
} |
|
|
|
} |
|
|
|
throw new BadRequestException("请求失败,IN OUT 站点错误!"); |
|
|
|
} |
|
|
|
|
|
|
@ -1535,6 +1643,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public com.alibaba.fastjson.JSONArray createBlocksData(Instruction inst) { |
|
|
|
com.alibaba.fastjson.JSONArray ja = new com.alibaba.fastjson.JSONArray(); |
|
|
|
|
|
|
@ -1608,245 +1717,245 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
} |
|
|
|
//放货前下发旋转角度
|
|
|
|
com.alibaba.fastjson.JSONObject json1 = new com.alibaba.fastjson.JSONObject(); |
|
|
|
if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4031")){ |
|
|
|
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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3031")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3012")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4012")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3001")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4001")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4027")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3027")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3027")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4028")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3028")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4017")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3017")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3019")&&inst.getNext_device_code().equals("4036")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3036")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3036")&&inst.getNext_device_code().equals("4019")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4032")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3032")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4033")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3033")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4034")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3034")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4015")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3035")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3010")&&inst.getNext_device_code().equals("4003")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3003")&&inst.getNext_device_code().equals("4010")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3034")&&inst.getNext_device_code().equals("4018")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3035")&&inst.getNext_device_code().equals("4018")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3018")&&inst.getNext_device_code().equals("4034")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
}else if(inst.getStart_device_code().equals("3018")&&inst.getNext_device_code().equals("4035")){ |
|
|
|
} 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"); |
|
|
|
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); |
|
|
|
json1.put("operation_args", operation_args); |
|
|
|
ja.add(json1); |
|
|
|
} |
|
|
|
com.alibaba.fastjson.JSONObject jo4 = new com.alibaba.fastjson.JSONObject(); |
|
|
@ -1877,6 +1986,7 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
} |
|
|
|
return ja; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public HttpResponse addOrderSequences(Instruction inst) throws Exception { |
|
|
|
JSONObject orderjo = createOrederData(inst, "1"); |
|
|
@ -2014,8 +2124,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
//起点
|
|
|
|
if (startdevice.getDeviceDriver() instanceof StandardManipulatorInspectSiteDeviceDriver) { |
|
|
|
standardManipulatorInspectSiteDeviceDriver = (StandardManipulatorInspectSiteDeviceDriver) startdevice.getDeviceDriver(); |
|
|
|
if(ObjectUtil.equal(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("is_pickup_spin"),"true") && |
|
|
|
ObjectUtil.isNotEmpty(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("pickup_spin")) ){ |
|
|
|
if (ObjectUtil.equal(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("is_pickup_spin"), "true") && |
|
|
|
ObjectUtil.isNotEmpty(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("pickup_spin"))) { |
|
|
|
ja.add(destination2(startAddress + "IQ", "Spin", "2", |
|
|
|
standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("pickup_spin").toString())); |
|
|
|
} |
|
|
@ -2049,8 +2159,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
//终点
|
|
|
|
if (nextdevice.getDeviceDriver() instanceof StandardManipulatorInspectSiteDeviceDriver) { |
|
|
|
standardManipulatorInspectSiteDeviceDriver = (StandardManipulatorInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); |
|
|
|
if(ObjectUtil.equal(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("is_release_spin"),"true") && |
|
|
|
ObjectUtil.isNotEmpty(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("release_spin")) ){ |
|
|
|
if (ObjectUtil.equal(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("is_release_spin"), "true") && |
|
|
|
ObjectUtil.isNotEmpty(standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("release_spin"))) { |
|
|
|
ja.add(destination2(nextAddress + "IQ", "Spin", "2", |
|
|
|
standardManipulatorInspectSiteDeviceDriver.getExtraValue().get("release_spin").toString())); |
|
|
|
} |
|
|
@ -2208,8 +2318,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
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); |
|
|
|
jo2.put("message", "ok"); |
|
|
|
jo2.put("code", 200); |
|
|
|
log.info("上位允许仙工AGV请求离开管制区 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} |
|
|
@ -2233,8 +2343,8 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
int responseCode = response.getInteger("status"); |
|
|
|
if (responseCode == 200) { |
|
|
|
JSONObject jo2 = new JSONObject(); |
|
|
|
jo2.put("message","ok"); |
|
|
|
jo2.put("code",200); |
|
|
|
jo2.put("message", "ok"); |
|
|
|
jo2.put("code", 200); |
|
|
|
log.info("上位允许仙工AGV请求进入管制区域 请求结果{}", responseCode); |
|
|
|
return jo2; |
|
|
|
} else { |
|
|
@ -2273,12 +2383,9 @@ public class AgvServiceImpl implements AgvService { |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
String address = "L1-01-01"; |
|
|
|
if (address.indexOf("-") > 0) { |
|
|
|
String str = address.substring(address.indexOf("-"), address.length()); |
|
|
|
address = address.substring(0, address.indexOf("-")); |
|
|
|
System.out.println(address); |
|
|
|
} |
|
|
|
String msg = null; |
|
|
|
String msg1 = null; |
|
|
|
System.out.println("msg = " + Objects.equals(msg,msg1)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|