Merge remote-tracking branch 'origin/master' into master_merge

This commit is contained in:
2024-06-11 09:43:31 +08:00
12 changed files with 150 additions and 19 deletions

View File

@@ -537,7 +537,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code()); jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code());
//异常 //异常
jo.put("fault", this.getError_message()); jo.put("fault", this.getError_message());
jo.put("message", LangProcess.msg(message)); jo.put("message",message);
return jo; return jo;
} }

View File

@@ -1516,7 +1516,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code()); jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code());
//异常 //异常
jo.put("fault", this.getError_message()); jo.put("fault", this.getError_message());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
return jo; return jo;
} }

View File

@@ -349,7 +349,7 @@ public class XgagvDeviceDriver extends AbstractOpcDeviceDriver implements Device
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
String mode = ""; String mode = "";
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("is_click", true); jo.put("is_click", true);
jo.put("address", address); jo.put("address", address);
jo.put("stop", stop); jo.put("stop", stop);

View File

@@ -256,7 +256,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
} }
if (move != 0 && task > 0) { if (move != 0 && task > 0) {
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
// 异步更新指令状态 // 异步更新指令状态
try { try {
update_instruction_status(); update_instruction_status();
@@ -264,7 +264,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
e.printStackTrace(); e.printStackTrace();
} }
}); });
future.thenRun(() -> System.out.println("异步更新任务已完成"));
} }
} catch (Exception var17) { } catch (Exception var17) {

View File

@@ -851,7 +851,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError()); jo.put("error", this.getError());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", LangProcess.msg(message)); jo.put("message", message);
jo.put("inst_message", this.inst_message); jo.put("inst_message", this.inst_message);
jo.put("task", this.getTask()); jo.put("task", this.getTask());
jo.put("barcode", plcbarcode); jo.put("barcode", plcbarcode);

View File

@@ -112,10 +112,10 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
} }
if (i > 0) { if (i > 0) {
ThreadUtl.sleep(300L); ThreadUtl.sleep(100L);
} }
if (i > 3) { if (i >= 3) {
// log.info("写入次数超过3次而失败"); // log.info("写入次数超过3次而失败");
throw new RuntimeException("写入次数超过3次而失败"); throw new RuntimeException("写入次数超过3次而失败");
} }

View File

@@ -398,6 +398,12 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
String response = acsToWmsService.applyTowToOne(param); String response = acsToWmsService.applyTowToOne(param);
JSONObject jo = JSON.parseObject(response); JSONObject jo = JSON.parseObject(response);
if (response == null || jo.getInteger("status") == 200) { if (response == null || jo.getInteger("status") == 200) {
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", 25);
list1.add(map);
this.writing(list1);
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("二楼到一楼输送线申请行架任务,参数,接口返回:" + jo) .content("二楼到一楼输送线申请行架任务,参数,接口返回:" + jo)

View File

@@ -311,7 +311,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
} }
//子卷入库申请入库任务 //子卷入库申请入库任务
if (mode == 7 && !requireSucess){ if (mode == 7 && move == 1 && !requireSucess){
if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){ if (StrUtil.isEmpty(barcode)||StrUtil.isEmpty(material_barcode)){
message = "universal_notCreateInstMessage8"; message = "universal_notCreateInstMessage8";
} }

View File

@@ -259,10 +259,9 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
.build(); .build();
logDto2.setLog_level(4); logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
String data = jo.getString("data");
JSONObject datas = JSON.parseObject(data); packagePLCData(jo);
packagePLCData(datas); String isUncap = jo.getString("isUncap");
String isUncap = datas.get("isUncap").toString();
if ("1".equals(isUncap)){ if ("1".equals(isUncap)){
List list1 = new ArrayList(); List list1 = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
@@ -277,6 +276,8 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
map.put("value", 99); map.put("value", 99);
list1.add(map); list1.add(map);
this.writing(list1); this.writing(list1);
Instruction inst = checkInst();
finish_instruction(inst);
} }
} }
@@ -290,10 +291,10 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
} }
private void packagePLCData(JSONObject datas) { private void packagePLCData(JSONObject datas) {
String length = datas.get("boxLength").toString(); String length = datas.getString("boxLength");
String weight = datas.get("boxWidth").toString(); String weight = datas.getString("boxWidth");
String height = datas.get("boxHigh").toString(); String height = datas.getString("boxHigh");
String desiccant = datas.get("desiccantTemplat").toString(); String desiccant = datas.getString("desiccantTemplat");
List list = new ArrayList(); List list = new ArrayList();
Map map4 = new HashMap(); Map map4 = new HashMap();
map4.put("code", "to_length"); map4.put("code", "to_length");
@@ -341,6 +342,11 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
return true; return true;
} }
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
instructionService.finish(inst);
return true;
}
protected void thingToNothing() throws Exception { protected void thingToNothing() throws Exception {
requireSucess = false; requireSucess = false;

View File

@@ -321,6 +321,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
return false; return false;
} else { } else {
this.instruction_head_time = date; this.instruction_head_time = date;
String link_device_code = String.valueOf(this.getDevice().getExtraValue().get("link_device_code"));
Device device = deviceAppservice.findDeviceByCode(link_device_code);
SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver;
if (device.getDeviceDriver()instanceof SlitTwoManipulatorDeviceDriver) {
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
//如果禁用
if (slitTwoManipulatorDeviceDriver.getIs_disable()==1){
//就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑
try {
flag = instruction_require2();
} catch (Exception e) {
flag = false;
}
if (flag) {
return false;
}
}
}
//抓取工位 //抓取工位
if (ObjectUtil.isEmpty(getDeviceCodeList)) { if (ObjectUtil.isEmpty(getDeviceCodeList)) {
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code"); getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
@@ -369,6 +387,63 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
return flag; return flag;
} }
//关联设备异常申请任务
public synchronized boolean instruction_require2() {
boolean flag = false;
Date date = new Date();
if (date.getTime() - this.instruction_head_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_head_time);
return false;
} else {
this.instruction_head_time = date;
//抓取工位
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
getDeviceCodeList = this.getExtraDeviceCodes("error_get_device_code");
}
//放货工位
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
putDeviceCodeList = this.getExtraDeviceCodes("error_put_device_code");
}
TaskDto task = null;
for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtos)) {
//按照优先级排序 优先级相等按照创建时间排序
taskDtos = this.sortTask(taskDtos);
TaskDto taskDto = taskDtos.get(0);
truss_type = taskDto.getTruss_type();
//查询任务是行架任务
if (!StrUtil.equals(taskDto.getTask_type(), "6")) {
taskDto = null;
continue;
}
flag = this.executeReadyInst(taskDto);
} else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) {
//按照优先级排序 优先级相等按照创建时间排序
taskDtoList = this.sortTask(taskDtoList);
for (int j = 0; j < taskDtoList.size(); j++) {
task = taskDtoList.get(j);
// 9 行架任务
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
task = null;
continue;
}
if (ObjectUtil.isNotEmpty(task)) break;
}
}
}
}
if (!ObjectUtil.isEmpty(task)) {
flag = this.executeReadyTask(task);
}
}
return flag;
}
//执行已有就绪指令 //执行已有就绪指令
public synchronized boolean executeReadyInst(TaskDto taskDto) { public synchronized boolean executeReadyInst(TaskDto taskDto) {
//获取指令信息 //获取指令信息

View File

@@ -216,7 +216,11 @@ public class CreateDDJInst {
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
if (CollUtil.isEmpty(byDeviceCodes)) { if (CollUtil.isEmpty(byDeviceCodes)) {
//判断有没有DDJ对接位出入库的指令 //判断有没有DDJ对接位出入库的指令
instructionService.findByCodeAndExcute(next_device_code); List<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
if (CollUtil.isNotEmpty(byCodeAndExcute)){
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位出入库的指令");
return;
}
instdto.setInstruction_type(task_type); instdto.setInstruction_type(task_type);
instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(route_plan_code); instdto.setRoute_plan_code(route_plan_code);

View File

@@ -175,6 +175,45 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="8">
<el-form-item label="关联设备异常时取货点" prop="device_code" label-width="200">
<el-select
v-model="form.error_get_device_code"
multiple
filterable
reserve-keyword
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联设备异常时放货点" prop="device_code" label-width="200">
<el-select
v-model="form.error_put_device_code"
filterable
reserve-keyword
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:key="item.device_code"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</el-card> </el-card>
@@ -347,7 +386,9 @@ export default {
is_release: true, is_release: true,
link_device_code: [], link_device_code: [],
get_device_code: [], get_device_code: [],
put_device_code: [] put_device_code: [],
error_get_device_code: [],
error_put_device_code: []
}, },
rules: {} rules: {}
} }