fix:任务代码修改

add:手持接口部分增加
This commit is contained in:
songxiaopeng
2024-03-22 09:38:42 +08:00
parent f78bb7c1f0
commit 352f5a31af
21 changed files with 652 additions and 1241 deletions

View File

@@ -125,7 +125,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
StandardStorageDeviceDriver standardStorageDeviceDriver;
//
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
TaskDto task=new TaskDto();
TaskDto task = new TaskDto();
if (ObjectUtil.isNotEmpty(inst)) {
task = taskService.findById(inst.getTask_id());
}
@@ -175,17 +175,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
return;
}
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if(device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getAction()==1){
if (standardInspectSiteDeviceDriver.getAction() == 1) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
}else{
} else {
log.info("当前涂板线未允许取货");
return;
}
}
BaseRequest request = new BaseRequest();
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
request.setPhase("3");
JSONObject resp = JSONObject.parseObject(acsToWmsService.feedbackState(request));
if ("200".equals(resp.getString("code"))) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
log.info("指令号:{},phase:{},acs请求wms到达取货点申请成功", inst.getInstruction_code(), phase);
} else {
log.info("指令号:{},phase:{},acs请求wms到达取货点申请失败", inst.getInstruction_code(), phase);
}
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
//到达取货等待点
//(需要WCS反馈)
} else if (phase == 0x04) {
@@ -228,14 +238,23 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
}
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if(device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
if(standardInspectSiteDeviceDriver.getAction()==1){
if (standardInspectSiteDeviceDriver.getAction() == 1) {
standardInspectSiteDeviceDriver.writing(2);
}
}
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
BaseRequest request = new BaseRequest();
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
request.setPhase("5");
JSONObject resp = JSONObject.parseObject(acsToWmsService.feedbackState(request));
if ("200".equals(resp.getString("code"))) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
log.info("指令号:{},phase:{},acs请求wms离开取货点申请成功", inst.getInstruction_code(), phase);
} else {
log.info("指令号:{},phase:{},acs请求wms离开取货点申请失败", inst.getInstruction_code(), phase);
}
//到达放货等待点
//(需要WCS反馈)
} else if (phase == 0x06) {
@@ -273,8 +292,19 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到关联编号{}对应的指令", ikey);
return;
}
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
BaseRequest request = new BaseRequest();
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
request.setPhase("7");
JSONObject resp = JSONObject.parseObject(acsToWmsService.feedbackState(request));
if ("200".equals(resp.getString("code"))) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
log.info("指令号:{},phase:{},acs请求wms到达放货点申请成功", inst.getInstruction_code(), phase);
} else {
log.info("指令号:{},phase:{},acs请求wms到达放货点申请失败", inst.getInstruction_code(), phase);
}
//放货完毕
//(需要WCS反馈)
} else if (phase == 0x09) {
@@ -309,7 +339,18 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到编号{}对应的指令", ikey);
return;
}
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
// data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
BaseRequest request = new BaseRequest();
request.setRequestNo(IdUtil.simpleUUID());
request.setTaskId(task.getExt_task_id());
request.setPhase("9");
JSONObject resp = JSONObject.parseObject(acsToWmsService.feedbackState(request));
if ("200".equals(resp.getString("code"))) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
log.info("指令号:{},phase:{},acs请求wms离开放货点申请成功", inst.getInstruction_code(), phase);
} else {
log.info("指令号:{},phase:{},acs请求wms离开放货点申请失败", inst.getInstruction_code(), phase);
}
}
//到达位置点
//(需要WCS反馈)

View File

@@ -68,5 +68,9 @@ public class BaseRequest {
*/
private String taskId;
/**
* 阶段
*/
private String phase;
}