rev 增加agv未到位不允许人工点确认
This commit is contained in:
@@ -729,7 +729,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(data)) {
|
if (!ObjectUtil.isEmpty(data)) {
|
||||||
phase =0;
|
//phase =0;
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
||||||
if (StrUtil.equals(inst.getAgv_system_type(), "2")) {
|
if (StrUtil.equals(inst.getAgv_system_type(), "2")) {
|
||||||
TwoNDCSocketConnectionAutoRun.write(data);
|
TwoNDCSocketConnectionAutoRun.write(data);
|
||||||
|
|||||||
@@ -550,10 +550,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
String url = wmsUrl + methods_url;
|
String url = wmsUrl + methods_url;
|
||||||
// log.info("sendDeviceStatus - 请求参数 {}", param);
|
// log.info("sendDeviceStatus - 请求参数 {}", param);
|
||||||
// HttpRequest
|
HttpRequest
|
||||||
// .post(url)
|
.post(url)
|
||||||
// .body(param.toString())
|
.body(param.toString())
|
||||||
// .execute();
|
.execute();
|
||||||
// log.info("sendDeviceStatus - 返回参数 {}", response.body());
|
// log.info("sendDeviceStatus - 返回参数 {}", response.body());
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
|
|||||||
@@ -883,6 +883,29 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
String task_code = jsonObject.getString("task_code");
|
String task_code = jsonObject.getString("task_code");
|
||||||
//1-允许取放; 2-允许离开
|
//1-允许取放; 2-允许离开
|
||||||
String option = jsonObject.getString("option");
|
String option = jsonObject.getString("option");
|
||||||
|
Instruction inst = instructionService.findByTaskcode(task_code);
|
||||||
|
if(ObjectUtil.isEmpty(inst)){
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("task_code",task_code);
|
||||||
|
jo.put("message","未找到对应任务");
|
||||||
|
errArr.add(jo);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
String carNo = inst.getCarno();
|
||||||
|
if(ObjectUtil.isEmpty(carNo)) {
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("task_code", task_code);
|
||||||
|
jo.put("message", "未找到任务对应车号");
|
||||||
|
errArr.add(jo);
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
Device device = deviceAppService.findDeviceByCode(carNo);
|
||||||
|
AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver;
|
||||||
|
if(device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver ){
|
||||||
|
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver)device.getDeviceDriver();
|
||||||
|
int phase = agvNdcTwoDeviceDriver.getPhase();
|
||||||
|
if(phase == 0x03 || phase == 0x05 || phase == 0x08)
|
||||||
|
{
|
||||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||||
Device device_k = deviceAppService.findDeviceByCode(device_code + "_K");
|
Device device_k = deviceAppService.findDeviceByCode(device_code + "_K");
|
||||||
Device device_m = deviceAppService.findDeviceByCode(device_code + "_M");
|
Device device_m = deviceAppService.findDeviceByCode(device_code + "_M");
|
||||||
@@ -894,9 +917,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
|
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
|
||||||
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
|
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("task_code", task_code);
|
||||||
|
jo.put("message", "AGV未就绪无法设置");
|
||||||
|
errArr.add(jo);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
JSONObject resultJson = new JSONObject();
|
JSONObject resultJson = new JSONObject();
|
||||||
if (ObjectUtil.isEmpty(errArr)) {
|
if (ObjectUtil.isEmpty(errArr)) {
|
||||||
resultJson.put("status", HttpStatus.OK.value());
|
resultJson.put("status", HttpStatus.OK.value());
|
||||||
|
|||||||
Reference in New Issue
Block a user