NDC接口调整
This commit is contained in:
@@ -29,7 +29,7 @@ public interface NDCAgvService {
|
||||
*/
|
||||
public void sendAgvInstToNDC(String agv_system_type,Instruction inst) throws Exception;
|
||||
|
||||
public byte[] sendAgvOneModeInst(int phase, int index,int result);
|
||||
public byte[] sendAgvOneModeInst(int phase, int index,int result,int startPoint,int nextPoint,int startHigh,int nextHigh);
|
||||
|
||||
public byte[] sendAgvTwoModeInst(int phase, int index,int result);
|
||||
|
||||
|
||||
@@ -125,23 +125,35 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sendAgvOneModeInst(int phase, int index, int result) {
|
||||
public byte[] sendAgvOneModeInst(int phase, int index, int result,int startPoint,int nextPoint,int startHigh,int nextHigh) {
|
||||
if (phase < 0 || index < 0)
|
||||
return null;
|
||||
byte indexhigh = (byte) IntToHexHigh(index);
|
||||
byte indexlow = (byte) IntToHexLow(index);
|
||||
byte phasehigh = (byte) IntToHexHigh(phase);
|
||||
byte phaselow = (byte) IntToHexLow(phase);
|
||||
byte startPointHigh =(byte) IntToHexHigh(startPoint);
|
||||
byte startPointLow =(byte) IntToHexLow(startPoint);
|
||||
byte nextPointHigh =(byte) IntToHexHigh(nextPoint);
|
||||
byte nextPointLow =(byte) IntToHexLow(nextPoint);
|
||||
byte startHighHigh =(byte) IntToHexHigh(startHigh);
|
||||
byte startHighLow =(byte) IntToHexLow(startHigh);
|
||||
byte nextHighHigh =(byte) IntToHexHigh(nextHigh);
|
||||
byte nextHighLow =(byte) IntToHexLow(nextHigh);
|
||||
|
||||
byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X0A,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X6D,
|
||||
(byte) 0X00, (byte) 0X06,
|
||||
(byte) 0X00, (byte) 0X0E,
|
||||
(byte) indexhigh, (byte) indexlow,
|
||||
(byte) 0X01, (byte) 0X12,
|
||||
(byte) phasehigh, (byte) phaselow
|
||||
(byte) 0X01, (byte) 0X14,
|
||||
(byte) phasehigh, (byte) phaselow,
|
||||
(byte) startPointHigh, (byte) startPointLow,
|
||||
(byte) nextPointHigh, (byte) nextPointLow,
|
||||
(byte) startHighHigh, (byte) startHighLow,
|
||||
(byte) nextHighHigh, (byte) nextHighLow
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
inst.setSend_status("1");
|
||||
instructionService.update(inst);
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
//任务完毕
|
||||
//(无车id及状态)
|
||||
@@ -168,13 +168,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
} else {
|
||||
log.warn("指令号:{},未反馈wms任务完成,因为agv上报指令号查询指令为空!");
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
log.info("指令号:{},已反馈agv任务完成!");
|
||||
}
|
||||
//请求删除任务
|
||||
//(需要WCS反馈)
|
||||
else if (phase == 0x30) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(0x8F, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(0x8F, index, 0,0,0,0,0);
|
||||
}
|
||||
//任务删除确认
|
||||
//(需要WCS反馈)
|
||||
@@ -185,7 +185,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
||||
}
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
|
||||
} else {
|
||||
//上报异常信息
|
||||
|
||||
@@ -111,7 +111,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (arr[18] * 256 + arr[19] == 0) {
|
||||
|
||||
}
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
|
||||
//普通站点
|
||||
@@ -179,7 +179,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("status") == 200) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
log.info("指令号:{},acs请求wms取货申请成功,wms允许agv申请取货,已反馈agv允许取货", inst.getInstruction_code());
|
||||
} else {
|
||||
log.warn("指令号:{},acs请求wms取货申请成功,wms不允许agv申请取货,未反馈agv允许取货", inst.getInstruction_code());
|
||||
@@ -188,8 +188,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.warn("指令号:{},acs请求wms取货申请失败,连接被拒绝,未反馈agv允许取货", inst.getInstruction_code());
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
//到达取货等待点
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x04) {
|
||||
//取货完毕
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x05) {
|
||||
@@ -240,7 +243,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("status") == 200) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
log.info("指令号:{},acs反馈wms取货完成成功,wms允许agv取货完成,已反馈agv取货完成", inst.getInstruction_code());
|
||||
} else {
|
||||
log.warn("指令号:{},acs反馈wms取货完成成功,wms不允许agv取货完成,未反馈agv取货完成", inst.getInstruction_code());
|
||||
@@ -249,8 +252,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.warn("指令号:{},acs反馈wms取货完成失败,连接被拒绝,未反馈agv取货完成", inst.getInstruction_code());
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
//到达放货等待点
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x06) {
|
||||
//到达放货点
|
||||
//(需要WCS反馈)
|
||||
} else if (phase == 0x07) {
|
||||
@@ -297,7 +303,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
JSONObject resp = JSONObject.parseObject(httpResponse.body());
|
||||
if (resp.getInteger("status") == 200) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
||||
} else {
|
||||
log.warn("指令号:{},acs请求wms放货申请成功,wms不允许agv申请放货,未反馈agv允许放货", inst.getInstruction_code());
|
||||
@@ -306,7 +312,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
//放货完毕
|
||||
//(需要WCS反馈)
|
||||
@@ -353,13 +359,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
req.add(map);
|
||||
HttpResponse httpResponse = acsToWmsService.feedAgvTaskStatus(req);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
log.info("指令号:{},acs请求wms放货申请成功,wms允许agv申请放货,已反馈agv允许放货", inst.getInstruction_code());
|
||||
} else {
|
||||
log.warn("指令号:{},acs请求wms放货申请失败,连接被拒绝,未反馈agv允许放货", inst.getInstruction_code());
|
||||
}
|
||||
} else {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
//到达位置点
|
||||
@@ -368,13 +374,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
//1、根据货位id找到对应三工位设备,赋给agv属性地址对应的满料位设备
|
||||
agvaddr = arr[18] * 256 + arr[19];
|
||||
agvaddr_copy = agvaddr;
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
} else if (phase == 0x50) {//进入交通灯区域
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
} else if (phase == 0x51) {//离开交通灯区域
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0,0,0,0,0);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + data);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(data)) {
|
||||
|
||||
@@ -442,6 +442,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
this.time = date;
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setDevice_code(devicecode);
|
||||
request.setMaterial_type(String.valueOf(material_type));
|
||||
request.setVehicle_code(String.valueOf(barcode));
|
||||
if (devicecode.startsWith("TBX")&&type==5) {
|
||||
//满架下料
|
||||
|
||||
@@ -41,5 +41,10 @@ public class FeedBackTaskStatusRequest extends BaseRequest {
|
||||
*/
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 1-正极板;2-负极板;3-边负极板
|
||||
*/
|
||||
private String material_type;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user