add: 生箔下料到分切上料试运行

This commit is contained in:
ls
2024-12-07 08:11:49 +08:00
parent 6091ad4684
commit e181617d6f
14 changed files with 300 additions and 186 deletions

View File

@@ -359,15 +359,13 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD, byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08, (byte) 0X00, (byte) 0X08,
(byte) 0X00, (byte) 0X0E, (byte) 0X00, (byte) 0X0A,
(byte) 0X00, (byte) 0X01, (byte) 0X00, (byte) 0X01,
(byte) 0X00, (byte) 0X6D, (byte) 0X00, (byte) 0X6D,
(byte) 0X00, (byte) 0X0A, (byte) 0X00, (byte) 0X06,
(byte) indexhigh, (byte) indexlow, (byte) indexhigh, (byte) indexlow,
(byte) 0X01, (byte) 0X12, (byte) 0X01, (byte) 0X12,
(byte) phasehigh, (byte) phaselow, (byte) phasehigh, (byte) phaselow
(byte) offsethigh, (byte) offsetlow,
(byte) quantityhigh, (byte) quantitylow
}; };

View File

@@ -25,6 +25,7 @@ import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDr
import org.nl.acs.device_driver.driver.AbstractDeviceDriver; import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver; import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDeviceDriver; import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.roll_up_roller_manipulator.RollUpRollerManipulatorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.roll_up_roller_manipulator.RollUpRollerManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver; import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver;
@@ -304,27 +305,40 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try { //收卷锟对接位先交互后写信号
manipulatorAgvStationDeviceDriver.writing(2); if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
} catch (Exception e) { && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
e.printStackTrace(); byte[] dataSJG = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
} TwoNDCSocketConnectionAutoRun.write(dataSJG);
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) { Thread.sleep(3000);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); try {
LuceneLogDto logDto = LuceneLogDto.builder() manipulatorAgvStationDeviceDriver.writing(2);
.device_code(this.getDeviceCode()) } catch (Exception e) {
.content("agvphase:" + phase + "反馈:" + data) e.printStackTrace();
.build(); }
logDto.setLog_level(4); }else {
luceneExecuteLogService.deviceExecuteLog(logDto); try {
} else { manipulatorAgvStationDeviceDriver.writing(2);
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey); } catch (Exception e) {
LuceneLogDto logDto = LuceneLogDto.builder() e.printStackTrace();
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode()) }
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
.build(); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
logDto.setLog_level(4); LuceneLogDto logDto = LuceneLogDto.builder()
luceneExecuteLogService.deviceExecuteLog(logDto); .device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} }
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
@@ -566,31 +580,64 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try { if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
manipulatorAgvStationDeviceDriver.writing(3); && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
} catch (Exception e) { try {
e.printStackTrace(); manipulatorAgvStationDeviceDriver.writing(2);
} } catch (Exception e) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); e.printStackTrace();
LuceneLogDto logDto = LuceneLogDto.builder() }
.device_code(this.getDeviceCode()) if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
.content("agvphase:" + phase + "反馈:" + data) data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
.build(); LuceneLogDto logDto = LuceneLogDto.builder()
logDto.setLog_level(4); .device_code(this.getDeviceCode())
luceneExecuteLogService.deviceExecuteLog(logDto); .content("agvphase:" + phase + "反馈:" + data)
String task_code = inst.getTask_code(); .build();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) logDto.setLog_level(4);
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { luceneExecuteLogService.deviceExecuteLog(logDto);
JSONObject jsonObject = new JSONObject(); try {
jsonObject.put("task_code", task_code); manipulatorAgvStationDeviceDriver.writing(3);
jsonObject.put("device_code", device_code); } catch (Exception e) {
LuceneLogDto logDto1 = LuceneLogDto.builder() e.printStackTrace();
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) }
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) } else {
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}else {
try {
manipulatorAgvStationDeviceDriver.writing(3);
} catch (Exception e) {
e.printStackTrace();
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build(); .build();
logDto1.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1); luceneExecuteLogService.deviceExecuteLog(logDto);
acsToWmsService.actionFinishRequest2(jsonObject); String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
jsonObject.put("device_code", device_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
}
} }
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
@@ -1022,6 +1069,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
String linkDeviceCode = linkDeviceCodes.get(0); String linkDeviceCode = linkDeviceCodes.get(0);
Device linkDevice = deviceAppService.findDeviceByCode(linkDeviceCode); Device linkDevice = deviceAppService.findDeviceByCode(linkDeviceCode);
RollUpRollerManipulatorDeviceDriver rollUpRollerManipulatorDeviceDriver; RollUpRollerManipulatorDeviceDriver rollUpRollerManipulatorDeviceDriver;
OvenGantryManipulatorDeviceDriver ovenGantryManipulatorDeviceDriver;
//收卷锟行架
if (linkDevice.getDeviceDriver() instanceof RollUpRollerManipulatorDeviceDriver) { if (linkDevice.getDeviceDriver() instanceof RollUpRollerManipulatorDeviceDriver) {
rollUpRollerManipulatorDeviceDriver = (RollUpRollerManipulatorDeviceDriver) linkDevice.getDeviceDriver(); rollUpRollerManipulatorDeviceDriver = (RollUpRollerManipulatorDeviceDriver) linkDevice.getDeviceDriver();
if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 && rollUpRollerManipulatorDeviceDriver.getMode() != 3)) { if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 && rollUpRollerManipulatorDeviceDriver.getMode() != 3)) {
@@ -1042,6 +1091,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} }
//烘箱行架
if (linkDevice.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
ovenGantryManipulatorDeviceDriver = (OvenGantryManipulatorDeviceDriver) linkDevice.getDeviceDriver();
if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && ovenGantryManipulatorDeviceDriver.getMode() != 3)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "光电信号:" + manipulatorAgvStationDeviceDriver.getMove() + ",行架信号:" + ovenGantryManipulatorDeviceDriver.getMode() + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "信号不满足条件")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
} else { } else {
if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1)) { if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1)) {
@@ -1514,7 +1584,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
//申请烘箱行架任务 //申请烘箱行架任务
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task")) if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
@@ -1538,6 +1608,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto2.setLog_level(4); logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
manipulatorAgvStationDeviceDriver.setOvenGantryTask(true); manipulatorAgvStationDeviceDriver.setOvenGantryTask(true);
manipulatorAgvStationDeviceDriver.writing(4); manipulatorAgvStationDeviceDriver.writing(4);

View File

@@ -72,6 +72,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
private Date instruction_finished_time = new Date(); private Date instruction_finished_time = new Date();
private Date instruction_apply_time = new Date(); private Date instruction_apply_time = new Date();
private int instruction_require_time_out = 3000; private int instruction_require_time_out = 3000;
private int finish_require_time_out = 8000;
public int heartbeat = 0; public int heartbeat = 0;
public int mode = 0; public int mode = 0;
@@ -238,8 +239,8 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
private void apply_finish() { private void apply_finish() {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { if (date.getTime() - this.instruction_require_time.getTime() < (long) this.finish_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); log.trace("触发时间因为小于{}毫秒,而被无视", this.finish_require_time_out);
return; return;
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
@@ -255,16 +256,17 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
JSONObject jo = JSON.parseObject(str); JSONObject jo = JSON.parseObject(str);
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("烘箱完成反馈LMS,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
message = "烘箱完成反馈LMS,参数,接口返回:" + jo;
requireSucess = true; requireSucess = true;
return; return;
} }
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("烘箱完成反馈LMS,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
message = "烘箱完成反馈LMS,参数,接口返回:" + jo;
} }
} }

View File

@@ -114,11 +114,11 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_target); return this.getOpcIntegerValue(item_to_target);
} }
public int getTo_new_onset() { public String getTo_new_onset() {
return this.getOpcIntegerValue(item_to_new_onset); return this.getOpcStringValue(item_to_new_onset);
} }
public int getTo_new_target() { public String getTo_new_target() {
return this.getOpcIntegerValue(item_to_new_target); return this.getOpcStringValue(item_to_new_target);
} }

View File

@@ -103,11 +103,11 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
int last_to_command = 0; int last_to_command = 0;
int to_target = 0; int to_target = 0;
int to_new_target = 0; String to_new_target = null;
int last_to_target = 0; int last_to_target = 0;
int to_onset = 0; int to_onset = 0;
int to_new_onset = 0; String to_new_onset = null;
int last_to_onset = 0; int last_to_onset = 0;
@@ -137,6 +137,7 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000; private int instruction_require_time_out = 3000;
private int error_require_time_out = 5000;
//行架机械手申请任务成功标识 //行架机械手申请任务成功标识
boolean requireSucess = false; boolean requireSucess = false;
@@ -355,70 +356,76 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
} }
private void errorDispose(Integer code, Instruction inst) { private void errorDispose(Integer code, Instruction inst) {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.error_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.error_require_time_out);
JSONObject param = new JSONObject();
param.put("barcode", barcode);
if (target != null) {
DeviceDto byAdress = deviceService.findByAdress(target);
param.put("target", byAdress.getDevice_code());
} else { } else {
param.put("target", inst.getNext_device_code()); JSONObject param = new JSONObject();
} param.put("barcode", barcode);
param.put("type", code); if (target != null) {
if (inst != null) { DeviceDto byAdress = deviceService.findByAdress(target);
param.put("task_code", inst.getTask_code()); param.put("target", byAdress.getDevice_code());
} } else {
LuceneLogDto logDto = LuceneLogDto.builder() param.put("target", inst.getNext_device_code());
.device_code(device_code)
.content("管芯库满入或空出请求lms,参数:" + param)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyPipeCoreRackNewPoint(param);
JSONObject jo = JSON.parseObject(response);
if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
Device gxDevice = deviceAppService.findDeviceByCode(jo.getString("device_code"));
String targetAddress = gxDevice.getExtraValue().get("address").toString();
Map<String, Object> map1 = new HashMap<>();
Map<String, Object> map2 = new HashMap<>();
List list = new ArrayList();
if (error2 == 2) {
map1.put("code", "to_command");
map1.put("value", 7);
list.add(map1);
} }
if (error2 == 3) { param.put("type", code);
map1.put("code", "to_command"); if (inst != null) {
map1.put("value", 8); param.put("task_code", inst.getTask_code());
list.add(map1);
} }
map2.put("code", "to_new_target"); LuceneLogDto logDto = LuceneLogDto.builder()
map2.put("value", targetAddress);
list.add(map2);
this.writing(list);
this.actionRequireSucess = true;
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("管芯库满入或空出请求lms,返回参数:" + jo) .content("管芯库满入或空出请求lms,参数:" + param)
.build(); .build();
logDto2.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList(); String response = acsToWmsService.applyPipeCoreRackNewPoint(param);
Map<String, Object> map1 = new HashMap<>(); JSONObject jo = JSON.parseObject(response);
map1.put("code", "to_command"); if (jo.getInteger("status") == 200) {
map1.put("value", 99); LuceneLogDto logDto2 = LuceneLogDto.builder()
list.add(map1); .device_code(device_code)
this.writing(list); .content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
throw new BadRequestException("管芯库满入或空出请求lms返回失败"); .build();
} logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
Device gxDevice = deviceAppService.findDeviceByCode(jo.getString("device_code"));
String targetAddress = gxDevice.getExtraValue().get("address").toString();
Map<String, Object> map1 = new HashMap<>();
Map<String, Object> map2 = new HashMap<>();
List list = new ArrayList();
if (error2 == 2) {
map1.put("code", "to_command");
map1.put("value", 7);
list.add(map1);
}
if (error2 == 3) {
map1.put("code", "to_command");
map1.put("value", 8);
list.add(map1);
}
map2.put("code", "to_new_target");
map2.put("value", targetAddress);
list.add(map2);
this.writing(list);
this.actionRequireSucess = true;
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,返回参数:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 99);
list.add(map1);
this.writing(list);
throw new BadRequestException("管芯库满入或空出请求lms返回失败");
}
}
} }
private void creatAGV(Integer actionType, int toCommand) { private void creatAGV(Integer actionType, int toCommand) {

View File

@@ -70,6 +70,10 @@ public class ItemProtocol {
*/ */
public static String item_to_target = "to_target"; public static String item_to_target = "to_target";
/**
* 报警2
*/
public static String item_error2 = "error2";
/** /**
@@ -141,6 +145,9 @@ public class ItemProtocol {
return this.getOpcFloatValue(item_y); return this.getOpcFloatValue(item_y);
} }
public int getError2() {
return this.getOpcIntegerValue(item_error2);
}
@@ -208,6 +215,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
list.add(new ItemDto(item_x, "行走列号", "DB101.B10")); list.add(new ItemDto(item_x, "行走列号", "DB101.B10"));
list.add(new ItemDto(item_y, "行走层号", "DB101.B11")); list.add(new ItemDto(item_y, "行走层号", "DB101.B11"));
list.add(new ItemDto(item_error2, "报警信号2", "DB1.B11"));
return list; return list;
} }

View File

@@ -133,6 +133,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000; private int instruction_require_time_out = 3000;
private int error_require_time_out = 5000;
//行架机械手申请任务成功标识 //行架机械手申请任务成功标识
boolean requireSucess = false; boolean requireSucess = false;
@@ -156,6 +157,8 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
String notCreateInstMessage = ""; String notCreateInstMessage = "";
String feedMessage = ""; String feedMessage = "";
int error2 = 0;
List<String> getDeviceCodeList = null; List<String> getDeviceCodeList = null;
@@ -209,15 +212,15 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
message = "universal_off-line"; message = "universal_off-line";
//有报警 //有报警
} else if (error != 0) { } else if (error != 0 || error2 != 0) {
this.setIserror(true); this.setIserror(true);
message = "universal_message3"; message = "universal_message3";
//满入空出分配新点位 //满入空出分配新点位
if (error == 2 || error == 3) { if (error2 == 2 || error2 == 3) {
if (task == 0 || target == null) { if (task == 0 || target == null) {
notCreateInstMessage = "管芯规格或库位为空"; notCreateInstMessage = "管芯规格或库位为空";
} else { } else {
if (error == 2) { if (error2 == 2) {
errorDispose(PointErrorTypeEnum.IN.getCode()); errorDispose(PointErrorTypeEnum.IN.getCode());
} else { } else {
errorDispose(PointErrorTypeEnum.OUT.getCode()); errorDispose(PointErrorTypeEnum.OUT.getCode());
@@ -226,7 +229,11 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
} }
} }
//无报警 //无报警
} else { }
else {
this.setIsonline(true); this.setIsonline(true);
this.setIserror(false); this.setIserror(false);
message = ""; message = "";
@@ -334,67 +341,72 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
} }
private void errorDispose(Integer code) { private void errorDispose(Integer code) {
Instruction instruction = checkInst(); Date date = new Date();
JSONObject param = new JSONObject(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.error_require_time_out) {
param.put("target", target); log.trace("触发时间因为小于{}毫秒,而被无视", this.error_require_time_out);
param.put("type", code);
param.put("task_code", instruction.getTask_code());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,参数:" + param)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.secondaryAllocationPoint(param);
JSONObject jo = JSON.parseObject(response);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
if (jo.getInteger("status") == 200) {
List list = new ArrayList();
if (error == 2) {
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 7);
list.add(map1);
Map<String, Object> map2 = new HashMap<>();
map2.put("code", "to_new_target");
map2.put("value", jo.getInteger("target"));
list.add(map1);
this.writing(list);
}
if (error == 3) {
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 8);
list.add(map1);
Map<String, Object> map2 = new HashMap<>();
map2.put("code", "to_new_target");
map2.put("value", jo.getInteger("target"));
list.add(map1);
this.writing(list);
}
this.actionRequireSucess = true;
} else { } else {
LuceneLogDto logDto3 = LuceneLogDto.builder() Instruction instruction = checkInst();
JSONObject param = new JSONObject();
param.put("target", target);
param.put("type", code);
param.put("task_code", instruction.getTask_code());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("管芯库满入或空出请求lms,返回参数:" + jo) .content("管芯库满入或空出请求lms,参数:" + param)
.build(); .build();
logDto3.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto3); luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList(); String response = acsToWmsService.secondaryAllocationPoint(param);
Map<String, Object> map1 = new HashMap<>(); JSONObject jo = JSON.parseObject(response);
map1.put("code", "to_command"); LuceneLogDto logDto2 = LuceneLogDto.builder()
map1.put("value", 99); .device_code(device_code)
list.add(map1); .content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
this.writing(list); .build();
throw new BadRequestException("管芯库满入或空出请求lms返回失败"); logDto2.setLog_level(4);
} luceneExecuteLogService.deviceExecuteLog(logDto2);
if (jo.getInteger("status") == 200) {
List list = new ArrayList();
if (error2 == 2) {
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 7);
list.add(map1);
Map<String, Object> map2 = new HashMap<>();
map2.put("code", "to_new_target");
map2.put("value", jo.getInteger("target"));
list.add(map1);
this.writing(list);
}
if (error2 == 3) {
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 8);
list.add(map1);
Map<String, Object> map2 = new HashMap<>();
map2.put("code", "to_new_target");
map2.put("value", jo.getInteger("target"));
list.add(map1);
this.writing(list);
}
this.actionRequireSucess = true;
} else {
LuceneLogDto logDto3 = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,返回参数:" + jo)
.build();
logDto3.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto3);
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", 99);
list.add(map1);
this.writing(list);
throw new BadRequestException("管芯库满入或空出请求lms返回失败");
}
}
} }
private void updateInstructionStatus() { private void updateInstructionStatus() {

View File

@@ -205,6 +205,10 @@ public class CreateTaskRequest extends BaseRequest {
* 是否拔轴 0/1 * 是否拔轴 0/1
*/ */
private String is_pulling; private String is_pulling;
/**
* 车号
*/
private String car_no;
/** /**
* agv二次分配类型1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配 * agv二次分配类型1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配

View File

@@ -146,6 +146,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String storage_task_type = request.getDtl_type(); String storage_task_type = request.getDtl_type();
String agv_system_type = request.getAgv_system_type(); String agv_system_type = request.getAgv_system_type();
String remark = request.getRemark(); String remark = request.getRemark();
String carNo = request.getCar_no();
double oven_time = 0.00d; double oven_time = 0.00d;
if (StrUtil.isNotEmpty(request.getOven_time())) { if (StrUtil.isNotEmpty(request.getOven_time())) {
oven_time = Double.parseDouble(request.getOven_time()); oven_time = Double.parseDouble(request.getOven_time());
@@ -368,6 +369,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("size", JSONUtil.toJsonStr(size)); jo.put("size", JSONUtil.toJsonStr(size));
jo.put("version", JSONUtil.toJsonStr(version)); jo.put("version", JSONUtil.toJsonStr(version));
jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num)); jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num));
jo.put("car_no", carNo);
if (!StrUtil.isEmpty(ext_task_id)) { if (!StrUtil.isEmpty(ext_task_id)) {
jo.put("ext_task_id", ext_task_id); jo.put("ext_task_id", ext_task_id);
} }

View File

@@ -148,5 +148,9 @@ public class SchBasePoint implements Serializable {
private String material_id; private String material_id;
private String device_code; private String device_code;
/**
* 出入库排序
*/
private Integer sort;
} }

View File

@@ -24,7 +24,7 @@
</if> </if>
AND p.is_used = TRUE AND p.is_used = TRUE
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.point_code1 = p.point_code AND t.task_status <![CDATA[<]]> '07') AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.point_code1 = p.point_code AND t.task_status <![CDATA[<]]> '07')
ORDER BY p.update_time ORDER BY p.sort desc , p.update_time asc
</select> </select>
<select id="getHotNotTaskPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint"> <select id="getHotNotTaskPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
SELECT p.* SELECT p.*
@@ -64,7 +64,7 @@
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[<]]> '07' AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[<]]> '07'
AND (t.point_code1 = p.point_code OR t.point_code2 = p.point_code OR t.point_code3 = p.point_code AND (t.point_code1 = p.point_code OR t.point_code2 = p.point_code OR t.point_code3 = p.point_code
OR t.point_code4 = p.point_code)) OR t.point_code4 = p.point_code))
ORDER BY p.in_order_seq, p.update_time ORDER BY p.sort , p.in_order_seq, p.update_time
</select> </select>
<select id="getWindRollConformRawNotTaskPoints" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint"> <select id="getWindRollConformRawNotTaskPoints" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
SELECT SELECT

View File

@@ -52,6 +52,8 @@ public class RawCallRollAGVTask extends AbstractTask {
task.setPoint_code2(task.getPoint_code2()); task.setPoint_code2(task.getPoint_code2());
task.setHandle_class(THIS_CLASS); task.setHandle_class(THIS_CLASS);
task.setTask_status(TaskStatus.START_AND_POINT.getCode()); task.setTask_status(TaskStatus.START_AND_POINT.getCode());
//生箔agv
task.setCar_no("1");
setUpdateByPC(task); setUpdateByPC(task);
taskService.save(task); taskService.save(task);
} }

View File

@@ -90,6 +90,8 @@ public class RawDownAGVTask extends AbstractTask {
// 保存任务参数 // 保存任务参数
task.setHandle_class(THIS_CLASS); task.setHandle_class(THIS_CLASS);
task.setTask_status(TaskStatus.START_AND_POINT.getCode()); task.setTask_status(TaskStatus.START_AND_POINT.getCode());
//生箔agv
task.setCar_no("1");
setUpdateByPC(task); setUpdateByPC(task);
taskService.save(task); taskService.save(task);
}); });

View File

@@ -84,6 +84,8 @@ public class SlitterUpAGVTask extends AbstractTask {
// 创建任务 // 创建任务
task.setHandle_class(THIS_CLASS); task.setHandle_class(THIS_CLASS);
task.setTask_status(TaskStatus.START_AND_POINT.getCode()); task.setTask_status(TaskStatus.START_AND_POINT.getCode());
//分切上料agv
task.setCar_no("2");
setUpdateByPC(task); setUpdateByPC(task);
taskService.save(task); taskService.save(task);
log.info("任务创建成功:{}", task); log.info("任务创建成功:{}", task);