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) 0X00, (byte) 0X08,
(byte) 0X00, (byte) 0X0E,
(byte) 0X00, (byte) 0X0A,
(byte) 0X00, (byte) 0X01,
(byte) 0X00, (byte) 0X6D,
(byte) 0X00, (byte) 0X0A,
(byte) 0X00, (byte) 0X06,
(byte) indexhigh, (byte) indexlow,
(byte) 0X01, (byte) 0X12,
(byte) phasehigh, (byte) phaselow,
(byte) offsethigh, (byte) offsetlow,
(byte) quantityhigh, (byte) quantitylow
(byte) phasehigh, (byte) phaselow
};

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.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.oven_manipulator.OvenGantryManipulatorDeviceDriver;
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.waste_foil_weighing_station.WasteFoilWeighingStationDriver;
@@ -304,27 +305,40 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
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 {
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);
//收卷锟对接位先交互后写信号
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
byte[] dataSJG = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
TwoNDCSocketConnectionAutoRun.write(dataSJG);
Thread.sleep(3000);
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
}else {
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
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 {
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) {
@@ -566,31 +580,64 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
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();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
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())
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
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);
try {
manipulatorAgvStationDeviceDriver.writing(3);
} catch (Exception e) {
e.printStackTrace();
}
} 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();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
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) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
@@ -1022,6 +1069,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
String linkDeviceCode = linkDeviceCodes.get(0);
Device linkDevice = deviceAppService.findDeviceByCode(linkDeviceCode);
RollUpRollerManipulatorDeviceDriver rollUpRollerManipulatorDeviceDriver;
OvenGantryManipulatorDeviceDriver ovenGantryManipulatorDeviceDriver;
//收卷锟行架
if (linkDevice.getDeviceDriver() instanceof RollUpRollerManipulatorDeviceDriver) {
rollUpRollerManipulatorDeviceDriver = (RollUpRollerManipulatorDeviceDriver) linkDevice.getDeviceDriver();
if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1 && rollUpRollerManipulatorDeviceDriver.getMode() != 3)) {
@@ -1042,6 +1091,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
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 {
if ((manipulatorAgvStationDeviceDriver.getAction() == 6 && manipulatorAgvStationDeviceDriver.getMove() == 1)) {
@@ -1514,7 +1584,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
//申请烘箱行架任务
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);
luceneExecuteLogService.deviceExecuteLog(logDto2);
if (jo.getInteger("status") == 200) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
manipulatorAgvStationDeviceDriver.setOvenGantryTask(true);
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_apply_time = new Date();
private int instruction_require_time_out = 3000;
private int finish_require_time_out = 8000;
public int heartbeat = 0;
public int mode = 0;
@@ -238,8 +239,8 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
private void apply_finish() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.finish_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.finish_require_time_out);
return;
} else {
this.instruction_require_time = date;
@@ -255,16 +256,17 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
JSONObject jo = JSON.parseObject(str);
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;
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);
}
public int getTo_new_onset() {
return this.getOpcIntegerValue(item_to_new_onset);
public String getTo_new_onset() {
return this.getOpcStringValue(item_to_new_onset);
}
public int getTo_new_target() {
return this.getOpcIntegerValue(item_to_new_target);
public String getTo_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 to_target = 0;
int to_new_target = 0;
String to_new_target = null;
int last_to_target = 0;
int to_onset = 0;
int to_new_onset = 0;
String to_new_onset = null;
int last_to_onset = 0;
@@ -137,6 +137,7 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000;
private int error_require_time_out = 5000;
//行架机械手申请任务成功标识
boolean requireSucess = false;
@@ -355,70 +356,76 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
}
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 {
param.put("target", inst.getNext_device_code());
}
param.put("type", code);
if (inst != null) {
param.put("task_code", inst.getTask_code());
}
LuceneLogDto logDto = LuceneLogDto.builder()
.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);
JSONObject param = new JSONObject();
param.put("barcode", barcode);
if (target != null) {
DeviceDto byAdress = deviceService.findByAdress(target);
param.put("target", byAdress.getDevice_code());
} else {
param.put("target", inst.getNext_device_code());
}
if (error2 == 3) {
map1.put("code", "to_command");
map1.put("value", 8);
list.add(map1);
param.put("type", code);
if (inst != null) {
param.put("task_code", inst.getTask_code());
}
map2.put("code", "to_new_target");
map2.put("value", targetAddress);
list.add(map2);
this.writing(list);
this.actionRequireSucess = true;
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("管芯库满入或空出请求lms,返回参数:" + jo)
.content("管芯库满入或空出请求lms,参数:" + param)
.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返回失败");
}
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) {
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) {

View File

@@ -70,6 +70,10 @@ public class ItemProtocol {
*/
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);
}
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_x, "行走列号", "DB101.B10"));
list.add(new ItemDto(item_y, "行走层号", "DB101.B11"));
list.add(new ItemDto(item_error2, "报警信号2", "DB1.B11"));
return list;
}

View File

@@ -133,6 +133,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000;
private int error_require_time_out = 5000;
//行架机械手申请任务成功标识
boolean requireSucess = false;
@@ -156,6 +157,8 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
String notCreateInstMessage = "";
String feedMessage = "";
int error2 = 0;
List<String> getDeviceCodeList = null;
@@ -209,15 +212,15 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
message = "universal_off-line";
//有报警
} else if (error != 0) {
} else if (error != 0 || error2 != 0) {
this.setIserror(true);
message = "universal_message3";
//满入空出分配新点位
if (error == 2 || error == 3) {
if (error2 == 2 || error2 == 3) {
if (task == 0 || target == null) {
notCreateInstMessage = "管芯规格或库位为空";
} else {
if (error == 2) {
if (error2 == 2) {
errorDispose(PointErrorTypeEnum.IN.getCode());
} else {
errorDispose(PointErrorTypeEnum.OUT.getCode());
@@ -226,7 +229,11 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
}
}
//无报警
} else {
}
else {
this.setIsonline(true);
this.setIserror(false);
message = "";
@@ -334,67 +341,72 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
}
private void errorDispose(Integer code) {
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)
.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;
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);
} 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)
.content("管芯库满入或空出请求lms,返回参数:" + jo)
.content("管芯库满入或空出请求lms,参数:" + param)
.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返回失败");
}
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 (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() {

View File

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

View File

@@ -146,6 +146,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String storage_task_type = request.getDtl_type();
String agv_system_type = request.getAgv_system_type();
String remark = request.getRemark();
String carNo = request.getCar_no();
double oven_time = 0.00d;
if (StrUtil.isNotEmpty(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("version", JSONUtil.toJsonStr(version));
jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num));
jo.put("car_no", carNo);
if (!StrUtil.isEmpty(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 device_code;
/**
* 出入库排序
*/
private Integer sort;
}

View File

@@ -24,7 +24,7 @@
</if>
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')
ORDER BY p.update_time
ORDER BY p.sort desc , p.update_time asc
</select>
<select id="getHotNotTaskPoint" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
SELECT p.*
@@ -64,7 +64,7 @@
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
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 id="getWindRollConformRawNotTaskPoints" resultType="org.nl.wms.sch.point.service.dao.SchBasePoint">
SELECT

View File

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

View File

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

View File

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