Merge remote-tracking branch 'origin/master' into master_merge
This commit is contained in:
@@ -537,7 +537,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code());
|
||||
//异常
|
||||
jo.put("fault", this.getError_message());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("message",message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1516,7 +1516,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
jo.put("task_code", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code());
|
||||
//异常
|
||||
jo.put("fault", this.getError_message());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("message", message);
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ public class XgagvDeviceDriver extends AbstractOpcDeviceDriver implements Device
|
||||
JSONObject jo = new JSONObject();
|
||||
String mode = "";
|
||||
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("address", address);
|
||||
jo.put("stop", stop);
|
||||
|
||||
@@ -256,7 +256,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
|
||||
if (move != 0 && task > 0) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
// 异步更新指令状态
|
||||
try {
|
||||
update_instruction_status();
|
||||
@@ -264,7 +264,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
future.thenRun(() -> System.out.println("异步更新任务已完成"));
|
||||
}
|
||||
|
||||
} catch (Exception var17) {
|
||||
|
||||
@@ -851,7 +851,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("message", message);
|
||||
jo.put("inst_message", this.inst_message);
|
||||
jo.put("task", this.getTask());
|
||||
jo.put("barcode", plcbarcode);
|
||||
|
||||
@@ -112,10 +112,10 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
}
|
||||
|
||||
if (i > 0) {
|
||||
ThreadUtl.sleep(300L);
|
||||
ThreadUtl.sleep(100L);
|
||||
}
|
||||
|
||||
if (i > 3) {
|
||||
if (i >= 3) {
|
||||
// log.info("写入次数超过3次而失败");
|
||||
throw new RuntimeException("写入次数超过3次而失败");
|
||||
}
|
||||
|
||||
@@ -398,6 +398,12 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
String response = acsToWmsService.applyTowToOne(param);
|
||||
JSONObject jo = JSON.parseObject(response);
|
||||
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()
|
||||
.device_code(device_code)
|
||||
.content("二楼到一楼输送线申请行架任务,参数,接口返回:" + jo)
|
||||
|
||||
@@ -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)){
|
||||
message = "universal_notCreateInstMessage8";
|
||||
}
|
||||
|
||||
@@ -259,10 +259,9 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
String data = jo.getString("data");
|
||||
JSONObject datas = JSON.parseObject(data);
|
||||
packagePLCData(datas);
|
||||
String isUncap = datas.get("isUncap").toString();
|
||||
|
||||
packagePLCData(jo);
|
||||
String isUncap = jo.getString("isUncap");
|
||||
if ("1".equals(isUncap)){
|
||||
List list1 = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
@@ -277,6 +276,8 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("value", 99);
|
||||
list1.add(map);
|
||||
this.writing(list1);
|
||||
Instruction inst = checkInst();
|
||||
finish_instruction(inst);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -290,10 +291,10 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
}
|
||||
|
||||
private void packagePLCData(JSONObject datas) {
|
||||
String length = datas.get("boxLength").toString();
|
||||
String weight = datas.get("boxWidth").toString();
|
||||
String height = datas.get("boxHigh").toString();
|
||||
String desiccant = datas.get("desiccantTemplat").toString();
|
||||
String length = datas.getString("boxLength");
|
||||
String weight = datas.getString("boxWidth");
|
||||
String height = datas.getString("boxHigh");
|
||||
String desiccant = datas.getString("desiccantTemplat");
|
||||
List list = new ArrayList();
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code", "to_length");
|
||||
@@ -341,6 +342,11 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
|
||||
instructionService.finish(inst);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
protected void thingToNothing() throws Exception {
|
||||
requireSucess = false;
|
||||
|
||||
@@ -321,6 +321,24 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
return false;
|
||||
} else {
|
||||
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)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||
@@ -369,6 +387,63 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
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) {
|
||||
//获取指令信息
|
||||
|
||||
@@ -216,7 +216,11 @@ public class CreateDDJInst {
|
||||
Instruction instdto = new Instruction();
|
||||
if (CollUtil.isEmpty(byDeviceCodes)) {
|
||||
//判断有没有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_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
|
||||
@@ -175,6 +175,45 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</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-card>
|
||||
|
||||
@@ -347,7 +386,9 @@ export default {
|
||||
is_release: true,
|
||||
link_device_code: [],
|
||||
get_device_code: [],
|
||||
put_device_code: []
|
||||
put_device_code: [],
|
||||
error_get_device_code: [],
|
||||
error_put_device_code: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user