opt: 物料图片显示,修复冲床先取上再取下的问题

This commit is contained in:
yanps
2024-11-20 16:32:35 +08:00
parent d92ec484fa
commit 462f516c3f
16 changed files with 307 additions and 73 deletions

View File

@@ -161,8 +161,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte indexlow = (byte) IntToHexLow(index);
byte phasehigh = (byte) IntToHexHigh(phase);
byte phaselow = (byte) IntToHexLow(phase);
byte nextPointHigh =(byte) IntToHexHigh(nextPoint);
byte nextPointLow =(byte) IntToHexLow(nextPoint);
byte startPointHigh =(byte) IntToHexHigh(startPoint);
byte startPointLow =(byte) IntToHexLow(startPoint);
byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08,
@@ -173,7 +173,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
(byte) indexhigh, (byte) indexlow,
(byte) 0X01, (byte) 0X12,
(byte) phasehigh, (byte) phaselow,
(byte) nextPointHigh,(byte) nextPointLow
(byte) startPointHigh,(byte) startPointLow
};
log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:" + hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF));

View File

@@ -582,19 +582,27 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
private byte[] getData(byte[] data, int index, Instruction inst, TaskDto task) {
String hasWms = paramService.findByCode("hasWms").getValue();
if ("3".equals(task.getTask_type()) && StrUtil.isNotEmpty(hasWms) && "1".equals(hasWms)) {
String resp = acsToWmsService.requestTaskAgain(task.getNext_point_code(), task.getExt_task_id(), inst.getVehicle_code());
if ("2".equals(task.getTask_type())) {
String resp = acsToWmsService.requestTaskAgain(task.getStart_point_code(), task.getExt_task_id(), inst.getVehicle_code());
if (StrUtil.isEmpty(resp)) {
log.info("申请分配二次点位失败,响应参数:{}", resp);
return null;
}
String start_point_code = task.getStart_point_code();
JSONObject respjson = JSONObject.parseObject(resp);
String point_code = respjson.getString("point_code");
task.setStart_device_code2(point_code);
int start_address = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
int next_address = deviceService.queryAddressBydeviceCode(point_code);
task.setStart_device_code(point_code);
task.setStart_point_code(point_code);
task.setPut_device_code(start_point_code);
task.setPut_point_code(start_point_code);
inst.setPut_device_code(start_point_code);
inst.setPut_point_code(start_point_code);
inst.setStart_device_code(point_code);
inst.setStart_point_code(point_code);
taskService.update(task);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, start_address, next_address, 0, 0);
instructionService.update(inst);
int start_address = deviceService.queryAddressBydeviceCode(point_code);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, start_address, 0, 0, 0);
log.info("指令号:{},phase:{},acs请求wms申请成功", inst.getInstruction_code(), phase);
} else {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);

View File

@@ -157,8 +157,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jo.put("device_code",address);
String result2 = null;
AddressDto addressDto = addressService.findByCode("requestTaskAgain");
String methods_url = addressDto.getMethods_url();
String methods_url = "/api/wms/task/feedAgvAgain";
String url = wmsurl + methods_url;
log.info("requestTaskAgain----请求参数{}", jo);