Browse Source

rev:更新

master
gengby 6 months ago
parent
commit
8bb6ffc3ef
  1. 26
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/DeviceDriver.java
  2. 96
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java
  3. 8
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/ItemProtocol.java
  4. 12
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java
  5. 317
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java
  6. 3
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/enums/StrategyEnum.java
  7. 22
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/log/OtherToInterfaceLogAspect.java
  8. 22
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/log/ToOtherInterfaceLogAspect.java
  9. 23
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  10. 2
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java
  11. 29
      nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  12. 66
      nladmin-ui/src/views/acs/device/driver/appearance_inspection_scanner_conveyor_device.vue
  13. 199
      nladmin-ui/src/views/acs/device/driver/standard_stacker_device.vue

26
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/DeviceDriver.java

@ -1,14 +1,17 @@
package org.nl.acs.device.driver;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device.device.domain.Device;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public interface DeviceDriver {
/**
* getDeviceCode
*
* @return
*/
default String getDeviceCode() {
@ -17,18 +20,21 @@ public interface DeviceDriver {
/**
* getDevice
*
* @return
*/
Device getDevice();
/**
* getDriverDefination
*
* @return
*/
DeviceDriverDefination getDriverDefination();
/**
* setDriverDefination
*
* @param var1
* @return
*/
@ -36,6 +42,7 @@ public interface DeviceDriver {
/**
* getDriverDefinationCode
*
* @return
*/
default String getDriverDefinationCode() {
@ -44,6 +51,7 @@ public interface DeviceDriver {
/**
* 将扩展表中的字符串数组数据转换成集合
*
* @param extraName
* @return
*/
@ -62,4 +70,22 @@ public interface DeviceDriver {
return devicesList;
}
default List<JSONObject> getExtraListValue(String extraName) {
String extraListValue = Optional.ofNullable(this.getDevice().getExtraValue().get(extraName)).map(Object::toString).orElse("[]");
String stringValue = extraListValue.substring(1, extraListValue.length() - 1);
List<JSONObject> result = new ArrayList<>();
String[] items = stringValue.split("},\\s*\\{");
for (int i = 0; i < items.length; i++) {
if (i != 0) {
items[i] = "{" + items[i];
}
if (i != items.length - 1) {
items[i] = items[i] + "}";
}
JSONObject jsonObject = JSONObject.parseObject(items[i]);
result.add(jsonObject);
}
return result;
}
}

96
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/appearance_inspection_scannner_conveyor/AppearanceInspectionScannerConveyorDeviceDriver.java

@ -18,6 +18,7 @@ import org.nl.acs.device.device.service.dto.DeviceAssignedDto;
import org.nl.acs.device.driver.*;
import org.nl.acs.device.driver.conveyor.appearance_inspection_scannner_conveyor.enums.*;
import org.nl.acs.device.driver.conveyor.strip_conveyor.StripConveyorDeviceDriver;
import org.nl.acs.device.driver.storage.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.ext.UnifiedResponse;
import org.nl.acs.ext.socket.Online;
import org.nl.acs.ext.wms.data.req.CommonRequest;
@ -37,6 +38,8 @@ import org.nl.config.SpringContextHolder;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@ -144,7 +147,6 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
*/
private boolean requireSuccess = false;
/**
* 关联站点申请任务请求标记
*/
@ -155,7 +157,6 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
*/
private long requireTime = System.currentTimeMillis();
/**
* 申请入库等待时间
*/
@ -191,6 +192,11 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
*/
private static final List<String> No_SET_LOG_KEYS = Arrays.asList(ItemProtocol.HEARTBEAT.getKey());
/**
* 记录创建的出库的任务
*/
private String createTaskCode = null;
@Override
public Device getDevice() {
@ -248,10 +254,18 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
}
}
}
// if (requireSuccess) {
// //去查询是否有该点位的执行中的终点任务
// //如果没有就复位请求标记
// }
if (this.requireSuccess && this.createTaskCode != null) {
TaskDto taskDto = taskService.findByCodeFromCache(this.createTaskCode);
if (ObjectUtil.isEmpty(taskDto)) {
this.requireSuccess = false;
this.createTaskCode = null;
}
} else if (!this.requireSuccess && this.createTaskCode != null) {
TaskDto taskDto = taskService.findByCodeFromCache(this.createTaskCode);
if (ObjectUtil.isEmpty(taskDto)) {
this.createTaskCode = null;
}
}
}
@Override
@ -262,7 +276,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
} else if (this.mode == 0) {
this.message = "设备未联机";
} else if (this.error != 0) {
this.message = "设备报警";
this.message = "设备报警, " + ErrorEnum.getLabel(this.error);
this.isError = true;
} else {
this.isError = false;
@ -327,8 +341,9 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
UnifiedResponse<JSONObject> response = acsToWmsService.apply(request, JSONObject.class);
if (response.isSuccess()) {
JSONObject data = response.getData();
Integer type = data.getInteger("type");
Integer type = data.getInteger("height");
this.writing("toHeight", type);
this.writing("toCommand", this.mode);
this.requireSuccess = true;
}
}
@ -485,9 +500,10 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 未配置指令终点驱动信息, 终点: " + next_device_code));
return;
}
if (!taskDto.getTask_code().endsWith("-") && !Online.isOnline) {
if (!taskDto.getTask_code().startsWith("-") && !Online.isOnline) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "WMS离线,不生成指令, 在线状态: " + Online.isOnline));
this.unExecutedMessage = "WMS离线,不生成指令, 在线状态: " + Online.isOnline;
return;
}
//判断入库任务的起点是否是双向点位,即既是起点又是终点
boolean toWayFlag = Optional.ofNullable(this.getExtraValue().get("toWay")).map(Object::toString).map(Boolean::parseBoolean).orElse(false);
@ -542,7 +558,8 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
List<String> targetDeviceCode = this.getExtraDeviceCodes("targetDeviceCode");
if (targetDeviceCode != null && targetDeviceCode.contains(next_device_code)) {
int nextAddress = Optional.ofNullable(nextDevice.getExtraValue().get("address")).map(Object::toString).map(Integer::parseInt).orElse(0);
this.writing(Arrays.asList(ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_COMMAND.getKey()), Arrays.asList(nextAddress, instDto.getInstruction_code(), CommandEnum.COMMAND_1.getValue()));
this.writing(ItemProtocol.TO_TASK.getKey(), instDto.getInstruction_code());
this.writing(Arrays.asList(ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_COMMAND.getKey()), Arrays.asList(nextAddress, CommandEnum.COMMAND_1.getValue()));
}
}
this.handBarcode = null;
@ -560,7 +577,8 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
List<String> targetDeviceCode = this.getExtraDeviceCodes("targetDeviceCode");
if (targetDeviceCode != null && targetDeviceCode.contains(next_device_code)) {
Integer address = Optional.ofNullable(nextDevice.getExtraValue().get("address")).map(Object::toString).map(Integer::parseInt).orElse(0);
this.writing(Arrays.asList(ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_COMMAND.getKey()), Arrays.asList(instDto.getInstruction_code(), address, CommandEnum.COMMAND_1.getValue()));
this.writing(ItemProtocol.TO_TASK.getKey(), instDto.getInstruction_code());
this.writing(Arrays.asList(ItemProtocol.TO_TARGET.getKey(), ItemProtocol.TO_COMMAND.getKey()), Arrays.asList(address, CommandEnum.COMMAND_1.getValue()));
this.requireSuccess = true;
}
}
@ -653,9 +671,10 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 未配置指令终点驱动信息, 终点: " + next_device_code));
return;
}
if (!taskDto.getTask_code().endsWith("-") && !Online.isOnline) {
if (!taskDto.getTask_code().startsWith("-") && !Online.isOnline) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "WMS离线,不生成指令, 在线状态: " + Online.isOnline));
this.unExecutedMessage = "WMS离线,不生成指令, 在线状态: " + Online.isOnline;
return;
}
boolean toWayFlag = Optional.ofNullable(cacheDevice.getExtraValue().get("toWay")).map(Object::toString).map(Boolean::parseBoolean).orElse(false);
if (toWayFlag) {
@ -703,6 +722,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 原因:" + e.getMessage()));
return;
}
this.createTaskCode = instDto.getTask_code();
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建出库指令成功,指令号:" + instDto.getInstruction_code() + " , 任务号:" + instDto.getTask_code()));
this.unExecutedMessage = "";
this.requireSuccess = true;
@ -716,6 +736,58 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
}
}
private boolean isBind(TaskDto link_task, TaskDto taskDto) {
List<TaskDto> taskDtos = Arrays.asList(link_task);
String from_x = taskDto.getFrom_x();
String from_y = taskDto.getFrom_y();
String from_z = taskDto.getFrom_z();
TaskDto dto = taskDtos.stream()
.filter(dto1 -> taskDto.getFrom_x().equals(from_x) && taskDto.getFrom_z().equals(from_z))
.filter(dto1 -> {
int frontFromY = Integer.parseInt(from_y);
int taskDtoFromY = Integer.parseInt(taskDto.getFrom_y());
int frontGroup = (frontFromY - 1) / 4;
int taskDtoGroup = (taskDtoFromY - 1) / 4;
if (frontGroup != taskDtoGroup) {
return false;
}
int frontMod = frontFromY % 4;
int taskDtoMod = taskDtoFromY % 4;
return (frontMod + taskDtoMod == 2 || frontMod + taskDtoMod == 4);
})
.findFirst()
.orElse(null);
return dto != null;
}
private boolean isBind(List<TaskDto> taskDtos, TaskDto link_task, String task_code) {
String from_x = link_task.getFrom_x();
String from_y = link_task.getFrom_y();
String from_z = link_task.getFrom_z();
TaskDto dto = taskDtos.stream()
.filter(taskDto -> !taskDto.getTask_code().equals(task_code))
.filter(taskDto -> taskDto.getTask_status().equals(TaskStatusEnum.READY.getIndex()))
.filter(taskDto -> taskDto.getFrom_x().equals(from_x) && taskDto.getFrom_z().equals(from_z))
.filter(taskDto -> {
int frontFromY = Integer.parseInt(from_y);
int taskDtoFromY = Integer.parseInt(taskDto.getFrom_y());
int frontGroup = (frontFromY - 1) / 4;
int taskDtoGroup = (taskDtoFromY - 1) / 4;
if (frontGroup != taskDtoGroup) {
return false;
}
int frontMod = frontFromY % 4;
int taskDtoMod = taskDtoFromY % 4;
return (frontMod + taskDtoMod == 2 || frontMod + taskDtoMod == 4);
})
.sorted(Comparator.comparing(TaskDto::getPriority)
.thenComparing(taskDto -> LocalDateTime.parse(taskDto.getCreate_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))))
.findFirst()
.orElse(null);
return dto != null;
}
/**
* 下发输送线指令
*/

8
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/ItemProtocol.java

@ -8,9 +8,11 @@ import java.util.List;
import java.util.ArrayList;
public enum ItemProtocol implements DeviceDriverBaseReader.KeyProvider {
HEARTBEAT("heartbeat", "心跳", "DB1001.B0"),
IN_OUT_MODE("inOutMode", "出入库模式", "DB1001.B1"),
SWITCH_IN_OUT("switchInOut", "允许切换出入库模式", "DB1001.B2"),
HEARTBEAT("heartbeat", "心跳", "DB1001.B0"),
IN_OUT_MODE("inOutMode", "出入库模式", "DB1001.B1"),
SWITCH_IN_OUT("switchInOut", "允许切换出入库模式", "DB1001.B2"),
TO_1207("to1207", "下发1207拣选起停", "DB1001.B4"),
TO_1210("to1210", "下发1210拣选起停", "DB1001.B5"),
TO_COMMAND("toCommand", "下发切换出入库模式", "DB1001.B3");
private final String key;

12
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/conveyor/strip_conveyor/StripConveyorDeviceDriver.java

@ -49,6 +49,18 @@ public class StripConveyorDeviceDriver extends AbstractOpcDeviceDriver implement
*/
private int toCommand = 0;
private int lastToCommand = 0;
/**
* 下发1207启停
*/
private int to1207 = 0;
private int lastTo1207 = 0;
/**
* 下发1210启停
*/
private int to1210 = 0;
private int lastTo1210 = 0;
/**
* 当前设备编号
*/

317
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/StandardStackerDeviceDriver.java

@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@ -38,9 +39,13 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
/**
* @Description 1适用于单/双堆垛机;2默认优先执行移库任务;3其次按照堆垛机设置的策略(入库优先(含拣选出库)策略出库优先策略时间顺序策略)执行;4除移库任务是从任务列表中查找其余任务都是从指令列表中查找就绪状态下的信息
* @Description 1适用于单/双堆垛机;
* 2默认优先执行移库任务;
* 3其次按照堆垛机设置的策略(入库优先(含拣选出库)策略出库优先策略时间顺序策略一进一出策略)执行;
* 4除移库任务是从任务列表中查找其余任务都是从指令列表中查找就绪状态下的信息
* @Author Gengby
* @Date 2024/6/26
*/
@ -249,6 +254,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/
private int to_back_task = 0;
private int lastTo_back_task = 0;
/**
* 当前设备编号
*/
@ -320,6 +326,42 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/
private static final List<String> No_SET_LOG_KEYS = Arrays.asList(ItemProtocol.HEARTBEAT.getKey());
/**
* 默认一楼优先其次二楼最后三楼
*/
private String[] floorPriorities = {"1", "2", "3"};
/**
* 堆垛机在出入库对接点时前叉行走的排列层
*/
private List<String> originPoint;
/**
* 楼层映射出入库对接点
*/
private Map<String, Map<String, List<String>>> floorMappingPoint;
private Map<String, Map<String, List<String>>> createFloorMappingPoint() {
List<JSONObject> floorPoint = this.getExtraListValue("floorPoint");
Map<String, Map<String, List<String>>> floorMappingPoint = new HashMap<>();
for (JSONObject jsonObject : floorPoint) {
if (jsonObject == null) {
continue;
}
Map<String, List<String>> map = new HashMap<>();
String floor = jsonObject.getString("floor");
JSONArray inPoints = jsonObject.getJSONArray("inPoints");
List<String> inPointsList = inPoints != null ? inPoints.toJavaList(String.class) : new ArrayList<>();
map.put("in", inPointsList);
JSONArray outPoints = jsonObject.getJSONArray("outPoints");
List<String> outPointsList = outPoints != null ? outPoints.toJavaList(String.class) : new ArrayList<>();
map.put("out", outPointsList);
floorMappingPoint.put(floor, map);
}
return floorMappingPoint;
}
@Override
public Device getDevice() {
return this.device;
@ -431,17 +473,18 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
@Override
public void executeLogic() {
this.stackerNum = Optional.ofNullable(this.getExtraValue().get("stackerNum")).map(Object::toString).map(Integer::parseInt).orElse(1);
this.floorPriorities = Optional.ofNullable(this.getExtraValue().get("floorPriority")).map(Object::toString).orElse("1,2,3").split(",");
this.originPoint = Arrays.stream(Optional.ofNullable(this.getExtraValue().get("originPoint")).map(Object::toString).orElse("000").split(",")).collect(Collectors.toList());
this.floorMappingPoint = this.createFloorMappingPoint();
if (this.back_command != this.lastBack_command || this.front_command != this.lastFront_command) {
this.requireSuccess = false;
}
if (this.front_Zerror != this.lastFront_Zerror || this.back_Zerror != this.lastBack_Zerror) {
if (AGAIN_ERROR.contains(this.front_Zerror) || AGAIN_ERROR.contains(this.back_Zerror)) {
this.againRequireSuccess = false;
}
}
if (this.front_Zerror == ErrorEnum.MR.getCode()) {
if (!this.againRequireSuccess) {
this.mR(this.front_task, ForkTypeEnum.FRONT.getCode());
@ -453,7 +496,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
return;
}
if (this.front_Zerror == ErrorEnum.KC.getCode() && this.back_Zerror == ErrorEnum.KC.getCode()) {
if (!this.againRequireSuccess) {
this.kC(this.front_task);
@ -479,9 +521,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
return;
}
if (this.front_Zerror == ErrorEnum.ZD.getCode() && this.back_Zerror == ErrorEnum.ZD.getCode()
&& this.front_forkCargo == 0 && this.back_forkCargo == 0
&& this.front_command == CommandEnum.PICKUP.getStatus() && this.back_command == CommandEnum.PICKUP.getStatus()
) {
if (!this.againRequireSuccess) {
this.getzD(this.front_task);
@ -489,26 +530,26 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
} else if (this.front_Zerror == ErrorEnum.ZD.getCode()) {
if (!this.againRequireSuccess) {
if (this.front_forkCargo == 0) {
if (this.front_command == CommandEnum.PICKUP.getStatus()) {
this.getzD(this.front_task);
Instruction back_inst = instructionService.findByCodeFromCache(String.valueOf(this.back_task));
if (ObjectUtil.isNotEmpty(back_inst)) {
this.backWrite(back_inst);
}
} else if (this.front_forkCargo == 2) {
} else if (this.front_command == CommandEnum.RELEASE.getStatus()) {
this.putzD(this.front_task, ForkTypeEnum.FRONT.getCode());
}
}
return;
} else if (this.back_Zerror == ErrorEnum.ZD.getCode()) {
if (!this.againRequireSuccess) {
if (this.back_forkCargo == 0) {
if (this.back_command == CommandEnum.PICKUP.getStatus()) {
this.getzD(this.back_task);
Instruction front_inst = instructionService.findByCodeFromCache(String.valueOf(this.front_task));
if (ObjectUtil.isNotEmpty(front_inst)) {
this.frontWrite(front_inst);
}
} else if (this.back_forkCargo == 2) {
} else if (this.back_command == CommandEnum.RELEASE.getStatus()) {
this.putzD(this.back_task, ForkTypeEnum.BACK.getCode());
}
}
@ -522,10 +563,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} else if (this.mode != ModeEnum.MODE_3.getNum()) {
this.message = "设备未联机";
} else if (this.front_Zerror != 0) {
this.message = "设备前叉报警";
this.message = "设备前叉报警, " + ErrorEnum.getDesc(this.front_Zerror);
this.isError = true;
} else if (this.back_Zerror != 0) {
this.message = "设备后叉报警";
this.message = "设备后叉报警," + ErrorEnum.getDesc(this.back_Zerror);
this.isError = true;
} else {
this.message = "";
@ -546,142 +587,181 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
this.applyTask();
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机工作模式:" + this.mode + ", 前叉作业状态:" + this.front_command + ", 前叉任务号:" + this.front_task + "前叉任务是否为空:" + ObjectUtil.isEmpty(frontInst) + ", 前叉探货信号:" + this.front_forkCargo));
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机工作模式:" + this.mode + ", 后叉作业状态:" + this.back_command + ", 后叉任务号:" + this.back_task + "后叉任务是否为空:" + ObjectUtil.isEmpty(backInst) + ", 后叉探货信号:" + this.back_forkCargo));
if (this.front_forkCargo == 0 && this.back_forkCargo == 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendGetInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo == 0 && this.back_forkCargo == 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isEmpty(backInst)) {
this.sendGetInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo == 0 && this.back_forkCargo == 0 && ObjectUtil.isEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendGetInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo != 0 && this.back_forkCargo == 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendGetInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo == 0 && this.back_forkCargo != 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendGetInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo != 0 && this.back_forkCargo != 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendPutInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo == 0 && this.back_forkCargo != 0 && ObjectUtil.isEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.sendPutInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
} else if (this.front_forkCargo != 0 && this.back_forkCargo == 0 && ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isEmpty(backInst)) {
this.sendPutInfoToPlc(frontInst, backInst);
this.requireSuccess = true;
}
this.requireSuccess = true;
}
}
//取货中
else if (mode == ModeEnum.MODE_3.getNum() && this.isPickup() && !this.requireSuccess) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货中, 前叉作业状态:" + this.front_command + ", 后叉作业状态:" + this.back_command));
this.clearInfoToPlc();
}
//取货完成
else if (mode == ModeEnum.MODE_3.getNum() && this.isPickupComplete() && !requireSuccess) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态:" + this.front_command + ", 后叉作业状态:" + this.back_command));
Instruction frontInst = instructionService.findByCodeFromCache(String.valueOf(this.front_task));
Instruction backInst = instructionService.findByCodeFromCache(String.valueOf(this.back_task));
if (this.front_command == CommandEnum.PICKUP_COMPLETE.getStatus() && this.back_command == CommandEnum.PICKUP_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉和后叉作业状态都是取货完成,下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
} else if (this.front_command == CommandEnum.PICKUP_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成"));
String front_start_device_code = frontInst.getStart_device_code();
String front_next_device_code = frontInst.getNext_device_code();
Device front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
Device front_next_device = deviceAppService.findDeviceByCode(front_next_device_code);
//入库
if (instanceAppearance(front_start_device) && instanceStorage(front_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是入库任务"));
String getLinkDeviceCode = this.handExtraStringValue(front_start_device, "getLinkDeviceCode");
String backNoY = this.handExtraStringValue(this.getDevice(), "backNoY");
if (ObjectUtil.isEmpty(backInst)) {
backInst = instructionService.findReadyInstByLinkDeviceCodeAndStartDeviceCode(getLinkDeviceCode, backNoY);
if (ObjectUtil.isNotEmpty(backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是入库任务, 查询出后叉任务, 下发后叉取货信息"));
String back_start_device_code = backInst.getStart_device_code();
Device back_start_device = deviceAppService.findDeviceByCode(back_start_device_code);
this.backWrite(back_start_device, backInst);
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是入库任务, 未查询出后叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是入库任务, 已存在后叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
}
//出库
else if (instanceStorage(front_start_device) && instanceAppearance(front_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是出库任务"));
String getLinkDeviceCode = this.handExtraStringValue(front_next_device, "getLinkDeviceCode");
String backNoY = this.handExtraStringValue(this.getDevice(), "backNoY");
if (ObjectUtil.isEmpty(backInst)) {
backInst = instructionService.findReadyInstByLinkDeviceCodeAndNextDeviceCode(getLinkDeviceCode, backNoY);
if (ObjectUtil.isNotEmpty(backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是出库任务, 查询出后叉任务, 下发后叉取货信息"));
this.backWrite(backInst);
} else {
//下发前叉放货信息
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是出库任务, 未查询出后叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是出库任务, 已存在后叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else if (instanceAppearance(front_start_device) && instanceAppearance(front_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是特殊任务输送线到输送线"));
if (ObjectUtil.isEmpty(backInst)) {
List<String> getBackDeviceCodeList = this.getExtraDeviceCodes("backDeviceCodeList");
List<String> specialGetDevice = this.getExtraDeviceCodes("specialGetDevice");
List<String> specialPutDevice = this.getExtraDeviceCodes("specialPutDevice");
backInst = instructionService.findReadyInstBySpecialDeviceAndStartDeviceCode(getBackDeviceCodeList, specialGetDevice, specialPutDevice, front_start_device_code);
if (ObjectUtil.isNotEmpty(backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是特殊任务输送线到输送线,查询到特殊任务后叉任务,下发后叉取货信息"));
String back_start_device_code = backInst.getStart_device_code();
Device back_start_device = deviceAppService.findDeviceByCode(back_start_device_code);
this.backWrite(back_start_device, backInst);
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是特殊任务输送线到输送线,未查询到特殊任务后叉任务,下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
}
} else {
//下发前叉放货信息
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉作业状态是取货完成, 是移库任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else if (this.back_command == CommandEnum.PICKUP_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成"));
String back_start_device_code = backInst.getStart_device_code();
String back_next_device_code = backInst.getNext_device_code();
Device back_start_device = deviceAppService.findDeviceByCode(back_start_device_code);
Device back_next_device = deviceAppService.findDeviceByCode(back_next_device_code);
//入库
if (instanceAppearance(back_start_device) && instanceStorage(back_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是入库任务"));
String getLinkDeviceCode = this.handExtraStringValue(back_start_device, "getLinkDeviceCode");
String frontNoY = this.handExtraStringValue(this.getDevice(), "frontNoY");
if (ObjectUtil.isEmpty(frontInst)) {
frontInst = instructionService.findReadyInstByLinkDeviceCodeAndStartDeviceCode(getLinkDeviceCode, frontNoY);
if (ObjectUtil.isNotEmpty(frontInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是入库任务, 查询出前叉任务, 下发前叉取货信息"));
String front_start_device_code = frontInst.getStart_device_code();
Device front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
this.frontWrite(front_start_device, frontInst);
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是入库任务, 未查询出前叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是入库任务, 已存在前叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
}
//出库
else if (instanceStorage(back_start_device) && instanceAppearance(back_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是出库任务"));
String getLinkDeviceCode = this.handExtraStringValue(back_next_device, "getLinkDeviceCode");
String frontNoY = this.handExtraStringValue(this.getDevice(), "frontNoY");
if (ObjectUtil.isEmpty(frontInst)) {
frontInst = instructionService.findReadyInstByLinkDeviceCodeAndNextDeviceCode(getLinkDeviceCode, frontNoY);
if (ObjectUtil.isNotEmpty(frontInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是出库任务, 查询出前叉任务, 下发前叉取货信息"));
this.frontWrite(frontInst);
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是出库任务, 未查询出前叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是出库任务, 已存在前叉任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
} else if (instanceAppearance(back_start_device) && instanceAppearance(back_next_device)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是特殊任务输送线到输送线"));
if (ObjectUtil.isEmpty(backInst)) {
List<String> getFrontDeviceCodeList = this.getExtraDeviceCodes("frontDeviceCodeList");
List<String> specialGetDevice = this.getExtraDeviceCodes("specialGetDevice");
List<String> specialPutDevice = this.getExtraDeviceCodes("specialPutDevice");
frontInst = instructionService.findReadyInstBySpecialDeviceAndStartDeviceCode(getFrontDeviceCodeList, specialGetDevice, specialPutDevice, back_start_device_code);
if (ObjectUtil.isNotEmpty(frontInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是特殊任务输送线到输送线,查询到特殊任务前叉任务,下发前叉取货信息"));
String front_start_device_code = frontInst.getStart_device_code();
Device front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
this.frontWrite(front_start_device, frontInst);
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是特殊任务输送线到输送线,未查询到特殊任务前叉任务,下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉作业状态是取货完成, 是移库任务, 下发放货信息"));
this.sendPutInfoToPlc(frontInst, backInst);
}
}
@ -689,6 +769,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
//放货中
else if (mode == ModeEnum.MODE_3.getNum() && this.isRelease() && !this.requireSuccess) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报放货中, 前叉作业状态:" + this.front_command + ", 后叉作业状态:" + this.back_command));
if (this.lastBack_command != CommandEnum.UNLOAD.getStatus() && this.lastFront_command != CommandEnum.UNLOAD.getStatus()) {
this.clearInfoToPlc();
} else if (this.lastBack_command != CommandEnum.UNLOAD.getStatus() && this.back_command != CommandEnum.STANDY.getStatus()) {
@ -701,25 +782,32 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
//请求卸货
else if (mode == ModeEnum.MODE_3.getNum() && this.isUnload() && !requireSuccess) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报请求卸货, 前叉作业状态:" + this.front_command + ", 后叉作业状态:" + this.back_command));
this.writing(ItemProtocol.TO_COMMAND.getKey(), SendSignalEnum.COMMAND_THREE.getSignalNum());
this.requireSuccess = true;
}
//卸货完成
else if (mode == ModeEnum.MODE_3.getNum() && this.isUnloadComplete() && !requireSuccess) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 前叉作业状态:" + this.front_command + ", 后叉作业状态:" + this.back_command));
if (this.front_command == CommandEnum.UNLOAD_COMPLETE.getStatus() && this.back_command == CommandEnum.UNLOAD_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 前叉和后叉作业状态都是卸货完成,反馈确认卸货完成"));
this.writing(ItemProtocol.TO_COMMAND.getKey(), SendSignalEnum.COMMAND_ELEVEN.getSignalNum());
} else if (this.front_command == CommandEnum.UNLOAD_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 前叉作业状态是卸货完成,反馈确认卸货完成"));
this.writing(ItemProtocol.TO_COMMAND.getKey(), SendSignalEnum.COMMAND_ELEVEN.getSignalNum());
//根据后叉指令号,查询后叉指令,下发后叉放货指令信息
Instruction backTask = instructionService.findByCodeFromCache(String.valueOf(back_task));
if (ObjectUtil.isNotEmpty(backTask)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 前叉作业状态是卸货完成,查询到后叉信息还存在, 下发后叉放货信息"));
this.sendPutInfoToPlc(null, backTask);
}
} else if (this.back_command == CommandEnum.UNLOAD_COMPLETE.getStatus()) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 后叉作业状态是卸货完成,反馈确认卸货完成"));
this.writing(ItemProtocol.TO_COMMAND.getKey(), SendSignalEnum.COMMAND_ELEVEN.getSignalNum());
//根据前叉指令号,查询前叉指令,下发前叉放货指令信息
Instruction frontTask = instructionService.findByCodeFromCache(String.valueOf(front_task));
if (ObjectUtil.isNotEmpty(frontTask)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报卸货完成, 后叉作业状态是卸货完成,查询到前叉信息还存在, 下发前叉放货信息"));
this.sendPutInfoToPlc(frontTask, null);
}
}
@ -884,6 +972,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
case "3":
this.applyTaskByTime();
break;
case "4":
this.applyTaskOneInOneOut();
break;
default:
this.applyInTask();
break;
@ -1167,6 +1258,189 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
/**
* 一进一出策略
* 根据楼层优先级
*/
private void applyTaskOneInOneOut() {
if (!prohibitInWarehouse) {
String currentXYZ = this.front_z + "" + this.front_x + this.front_y;
if (this.originPoint.contains(currentXYZ)) {
this.applyTaskOneIn();
} else {
this.applyTaskOneOut();
}
}
}
private void applyTaskOneIn() {
String currentXYZ = this.front_z + "" + this.front_x + this.front_y;
boolean flag = this.applySpecialTask();
if (flag) {
this.unExecutedMessage = null;
return;
}
Instruction frontInst = null;
Instruction backInst = null;
Device front_start_device = null;
Device back_start_device = null;
for (int i = 0; i < this.floorPriorities.length; i++) {
String floorPriority = this.floorPriorities[i];
Map<String, List<String>> floorPoint = this.floorMappingPoint.get(floorPriority);
if (ObjectUtil.isEmpty(floorPoint)) {
continue;
}
List<String> points = floorPoint.get("in");
if (CollectionUtil.isEmpty(points)) {
continue;
}
List<String> getFrontDeviceCodeList = this.getExtraDeviceCodes("frontDeviceCodeList");
String frontNoY = this.handExtraStringValue(this.getDevice(), "frontNoY");
List<String> getBackDeviceCodeList = this.getExtraDeviceCodes("backDeviceCodeList");
String backNoY = this.handExtraStringValue(this.getDevice(), "backNoY");
List<Instruction> frontInsts = instructionService.findReadyInstByStartDeviceCode(getFrontDeviceCodeList, frontNoY);
if (CollectionUtil.isNotEmpty(frontInsts)) {
for (int j = 0; j < frontInsts.size(); j++) {
Instruction instruction = frontInsts.get(j);
if (points.contains(instruction.getStart_device_code())) {
frontInst = instruction;
break;
}
}
if (ObjectUtil.isNotEmpty(frontInst)) {
String front_start_device_code = frontInst.getStart_device_code();
front_start_device = deviceAppService.findDeviceByCode(front_start_device_code);
if (front_start_device != null) {
String getLinkDeviceCode = this.handExtraStringValue(front_start_device, "getLinkDeviceCode");
backInst = instructionService.findReadyInstByLinkDeviceCodeAndStartDeviceCode(getLinkDeviceCode, backNoY);
if (ObjectUtil.isEmpty(backInst)) {
Instruction inst = instructionService.findBusyInstByNextDeviceCode(getLinkDeviceCode);
if (ObjectUtil.isNotEmpty(inst)) {
return;
}
}
}
}
} else {
if (this.stackerNum == 2) {
List<Instruction> backInsts = instructionService.findReadyInstByStartDeviceCode(getBackDeviceCodeList, backNoY);
if (CollectionUtil.isNotEmpty(backInsts)) {
for (int k = 0; k < backInsts.size(); k++) {
Instruction instruction = backInsts.get(k);
if (points.contains(instruction.getStart_device_code())) {
backInst = instruction;
break;
}
}
}
if (ObjectUtil.isNotEmpty(backInst)) {
String back_start_device_code = backInst.getStart_device_code();
back_start_device = deviceAppService.findDeviceByCode(back_start_device_code);
if (back_start_device != null) {
String getLinkDeviceCode = this.handExtraStringValue(back_start_device, "getLinkDeviceCode");
frontInst = instructionService.findReadyInstByLinkDeviceCodeAndStartDeviceCode(getLinkDeviceCode, frontNoY);
if (ObjectUtil.isEmpty(frontInst)) {
Instruction inst = instructionService.findBusyInstByNextDeviceCode(getLinkDeviceCode);
if (ObjectUtil.isNotEmpty(inst)) {
return;
}
}
}
}
}
}
if (ObjectUtil.isNotEmpty(frontInst) || ObjectUtil.isNotEmpty(backInst)) {
break;
}
}
if (ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.FBWrite(front_start_device, frontInst, backInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else if (ObjectUtil.isNotEmpty(frontInst)) {
this.frontWrite(front_start_device, frontInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else if (ObjectUtil.isNotEmpty(backInst)) {
this.backWrite(back_start_device, backInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else {
if (this.originPoint.contains(currentXYZ)) {
this.applyTaskOneOut();
}
}
}
private void applyTaskOneOut() {
String currentXYZ = this.front_z + "" + this.front_x + this.front_y;
Instruction frontInst = null;
Instruction backInst = null;
for (int i = 0; i < this.floorPriorities.length; i++) {
String floorPriority = this.floorPriorities[i];
Map<String, List<String>> floorPoint = this.floorMappingPoint.get(floorPriority);
if (ObjectUtil.isEmpty(floorPoint)) {
continue;
}
List<String> points = floorPoint.get("out");
if (CollectionUtil.isEmpty(points)) {
continue;
}
List<String> getFrontDeviceCodeList = this.getExtraDeviceCodes("frontDeviceCodeList");
List<String> getBackDeviceCodeList = this.getExtraDeviceCodes("backDeviceCodeList");
String frontNoY = this.handExtraStringValue(this.getDevice(), "frontNoY");
String backNoY = this.handExtraStringValue(this.getDevice(), "backNoY");
List<Instruction> frontInsts = instructionService.findReadyInstByNextDeviceCode(getFrontDeviceCodeList, frontNoY);
if (CollectionUtil.isNotEmpty(frontInsts)) {
for (int j = 0; j < frontInsts.size(); j++) {
Instruction instruction = frontInsts.get(j);
if (points.contains(instruction.getNext_device_code())) {
frontInst = instruction;
break;
}
}
if (ObjectUtil.isNotEmpty(frontInst) && this.stackerNum == 2) {
String front_next_device_code = frontInst.getNext_device_code();
Device front_next_device = deviceAppService.findDeviceByCode(front_next_device_code);
if (front_next_device != null) {
String getLinkDeviceCode = this.handExtraStringValue(front_next_device, "getLinkDeviceCode");
backInst = instructionService.findReadyInstByNextDeviceCode(frontInst, getLinkDeviceCode, backNoY);
}
}
} else {
if (this.stackerNum == 2) {
List<Instruction> backInsts = instructionService.findReadyInstByNextDeviceCode(getBackDeviceCodeList, backNoY);
if (CollectionUtil.isNotEmpty(backInsts)) {
for (int k = 0; k < backInsts.size(); k++) {
Instruction instruction = backInsts.get(k);
if (points.contains(instruction.getNext_device_code())) {
backInst = instruction;
break;
}
}
}
}
}
}
if (ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
this.FBWrite(frontInst, backInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else if (ObjectUtil.isNotEmpty(frontInst)) {
this.frontWrite(frontInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else if (ObjectUtil.isNotEmpty(backInst)) {
this.backWrite(backInst);
this.unExecutedMessage = null;
this.requireSuccess = true;
} else {
if (!this.originPoint.contains(currentXYZ)) {
this.applyTaskOneIn();
}
}
}
/**
* 下发前叉取货信息(取货位是输送线)
*
@ -1355,6 +1629,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
private void sendGetInfoToPlc(Instruction frontInst, Instruction backInst) {
if (ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst)) {
if (this.front_forkCargo == 0 && this.back_forkCargo == 0 && isBindGet(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机待机状态下, 前叉和后叉任务都存在,并且前工位和后工位原位都无货, 可以绑定双任务,下发取货信息"));
String start_device_code = frontInst.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(start_device_code);
if (start_device != null && start_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1366,6 +1641,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getFBKeys(), Arrays.asList(x, y, z, frontInst.getInstruction_code(), backInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_THREE.getSignalNum(), SendSignalEnum.COMMAND_ONE.getSignalNum()));
}
} else if (this.front_forkCargo == 0) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机待机状态下, 前叉和后叉任务都存在,并且前工位原位无货,下发取货信息"));
String start_device_code = frontInst.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(start_device_code);
if (start_device != null && start_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1377,6 +1653,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getFBKeys(), Arrays.asList(x, y, z, frontInst.getInstruction_code(), backInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_ONE.getSignalNum(), SendSignalEnum.COMMAND_ONE.getSignalNum()));
}
} else if (this.back_forkCargo == 0) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机待机状态下, 前叉和后叉任务都存在,并且后工位原位无货,下发取货信息"));
String start_device_code = backInst.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(start_device_code);
if (start_device != null && start_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1389,6 +1666,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
} else if (ObjectUtil.isNotEmpty(frontInst) && !isBindGet(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机待机状态下, 前叉任务存在,下发取货信息"));
String start_device_code = frontInst.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(start_device_code);
if (start_device != null && start_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1400,6 +1678,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getFrontKeys(), Arrays.asList(x, y, z, frontInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_ONE.getSignalNum(), SendSignalEnum.COMMAND_ONE.getSignalNum()));
}
} else if (ObjectUtil.isNotEmpty(backInst) && !isBindGet(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机待机状态下, 后叉任务存在,下发取货信息"));
String start_device_code = backInst.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(start_device_code);
if (start_device != null && start_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1411,6 +1690,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getBackKeys(), Arrays.asList(x, y, z, backInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_TWO.getSignalNum(), SendSignalEnum.COMMAND_ONE.getSignalNum()));
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉和后叉任务都不存在,不下发取货信息"));
this.unExecutedMessage = "未执行放货原因, 堆垛机上报任务号不存在";
}
}
@ -1432,21 +1712,24 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
String back_from_y = backInst.getFrom_y();
String back_from_z = backInst.getFrom_z();
boolean flagX = StrUtil.equals(front_from_x, back_from_x);
// TODO 需要验证规则是否生效
boolean flagY = ((Integer.parseInt(front_from_y) - 1) / 4 == (Integer.parseInt(back_from_y) - 1) / 4) && (((Integer.parseInt(front_from_y) % 4) + (Integer.parseInt(back_from_y) % 4) == 2) || (Integer.parseInt(front_from_y) % 4) + (Integer.parseInt(back_from_z) % 4) == 4);
boolean flagZ = StrUtil.equals(front_from_z, back_from_z);
if (flagX && flagY && flagZ) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上待机状态下,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 能组成双叉取货任务"));
return true;
}
} else if (StrUtil.equals(back_start_device_code, back_device_code)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上待机状态下,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 能组成双叉取货任务"));
return true;
}
}
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上待机状态下,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 不能组成双叉取货任务"));
return false;
}
private void sendPutInfoToPlc(Instruction frontInst, Instruction backInst) {
if (ObjectUtil.isNotEmpty(frontInst) && ObjectUtil.isNotEmpty(backInst) && isBindPut(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉和后叉任务都存在,并且可以绑定双任务,下发放货信息"));
String next_device_code = frontInst.getNext_device_code();
Device next_device = deviceAppService.findDeviceByCode(next_device_code);
if (next_device != null && next_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1458,6 +1741,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getFBKeys(), Arrays.asList(x, y, z, frontInst.getInstruction_code(), backInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_THREE.getSignalNum(), SendSignalEnum.COMMAND_TWO.getSignalNum()));
}
} else if (ObjectUtil.isNotEmpty(frontInst) && !isBindPut(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉任务存在,不可以绑定双任务,下发放货信息"));
String next_device_code = frontInst.getNext_device_code();
Device next_device = deviceAppService.findDeviceByCode(next_device_code);
if (next_device != null && next_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1469,6 +1753,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getFrontKeys(), Arrays.asList(x, y, z, frontInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_ONE.getSignalNum(), SendSignalEnum.COMMAND_TWO.getSignalNum()));
}
} else if (ObjectUtil.isNotEmpty(backInst) && !isBindPut(frontInst, backInst)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 后叉任务存在,不可以绑定双任务,下发放货信息"));
String next_device_code = backInst.getNext_device_code();
Device next_device = deviceAppService.findDeviceByCode(next_device_code);
if (next_device != null && next_device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -1480,6 +1765,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.writing(this.getBackKeys(), Arrays.asList(x, y, z, backInst.getInstruction_code(), SendSignalEnum.CHOOSE_FORK_TWO.getSignalNum(), SendSignalEnum.COMMAND_TWO.getSignalNum()));
}
} else {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成, 前叉和后叉任务都不存在,不下发放货信息"));
this.unExecutedMessage = "未执行放货原因, 堆垛机上报任务号不存在";
}
}
@ -1506,12 +1792,15 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
boolean flagY = ((Integer.parseInt(front_to_y) - 1) / 4 == (Integer.parseInt(back_to_y) - 1) / 4) && (((Integer.parseInt(front_to_y) % 4) + (Integer.parseInt(back_to_y) % 4) == 2) || (Integer.parseInt(front_to_y) % 4) + (Integer.parseInt(back_to_z) % 4) == 4);
boolean flagZ = StrUtil.equals(front_to_z, back_to_z);
if (flagX && flagY && flagZ) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 能组成双叉放货任务"));
return true;
}
} else if (StrUtil.equals(back_next_device_code, back_device_code)) {
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 能组成双叉放货任务"));
return true;
}
}
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "堆垛机上报取货完成,前叉任务号:" + frontInst.getInstruction_code() + ", 后叉任务号:" + backInst.getInstruction_code() + ", 不能组成双叉放货任务"));
return false;
}

3
nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/driver/stacker/double_stacker/enums/StrategyEnum.java

@ -13,7 +13,8 @@ import lombok.Getter;
public enum StrategyEnum {
IN("1", "入库优先(含拣选出库)策略"),
OUT("2", "出库优先策略"),
TIME("3", "时间顺序策略");
TIME("3", "时间顺序策略"),
ONE_IN_ONE_OUT("4", "一进一出策略");
private final String value;
private final String label;

22
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/log/OtherToInterfaceLogAspect.java

@ -6,6 +6,7 @@ import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.nl.acs.ext.wms.IpUtil;
import org.nl.common.exception.BadRequestException;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired;
@ -73,9 +74,24 @@ public class OtherToInterfaceLogAspect {
.content("开始请求")
.build();
logService.interfaceExecuteLog(logDto);
Object result = joinPoint.proceed();
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception e) {
logDto =
LuceneLogDto.builder()
.logType("接口日志")
.request_url(IpUtil.localIP() + classUrlValue + methodUrlValue)
.request_direction(request_direction)
.request_param(JSON.toJSONString(args))
.method(methodName)
.response_param(e.getMessage())
.executeTime(System.currentTimeMillis() - startTime)
.content("响应请求")
.build();
logService.interfaceExecuteLog(logDto);
throw new BadRequestException(e.getMessage());
}
logDto =
LuceneLogDto.builder()
.logType("接口日志")

22
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/log/ToOtherInterfaceLogAspect.java

@ -5,6 +5,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.nl.common.exception.BadRequestException;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired;
@ -103,9 +104,24 @@ public class ToOtherInterfaceLogAspect {
.content("开始请求")
.build();
logService.interfaceExecuteLog(logDto);
Object result = joinPoint.proceed();
Object result = null;
try {
result = joinPoint.proceed();
} catch (Exception e) {
logDto =
LuceneLogDto.builder()
.logType("接口日志")
.request_url(ipPort + String.valueOf(url))
.request_direction(request_direction)
.request_param(JSON.toJSONString(requesr_param))
.method(methodName)
.response_param(e.getMessage())
.executeTime(System.currentTimeMillis() - startTime)
.content("响应请求")
.build();
logService.interfaceExecuteLog(logDto);
throw new BadRequestException(e.getMessage());
}
logDto =
LuceneLogDto.builder()
.logType("接口日志")

23
nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -262,7 +262,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
if (stripConveyorDeviceDriver.getInOutMode() == 0) {
throw new BadRequestException("已经是入库模式,无法再次切换为入库模式");
} else {
if (stripConveyorDeviceDriver.getSwitchInOut() == 0) {
if (stripConveyorDeviceDriver.getSwitchInOut() == 1) {
throw new BadRequestException("输送线不允许切换为入库模式");
}
}
@ -283,7 +283,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
if (stripConveyorDeviceDriver.getInOutMode() == 1) {
throw new BadRequestException("已经是出库模式,无法再次切换为出库模式");
} else {
if (stripConveyorDeviceDriver.getSwitchInOut() == 0) {
if (stripConveyorDeviceDriver.getSwitchInOut() == 1) {
throw new BadRequestException("输送线不允许切换为出库模式");
}
}
@ -306,17 +306,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
if (StrUtil.isBlank(device_code)) {
throw new BadRequestException("设备号不能为空!");
}
String type = reqs.getString("status");
String type = reqs.getString("type");
if (StrUtil.isEmpty(type)) {
throw new BadRequestException("启停状态不能为空!");
}
Device device = deviceAppService.findDeviceByCode(device_code);
if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) device.getDeviceDriver();
Device device = deviceAppService.findDeviceByCode("1001");
if (device != null && device.getDeviceDriver() instanceof StripConveyorDeviceDriver) {
StripConveyorDeviceDriver stripConveyorDeviceDriver = (StripConveyorDeviceDriver) device.getDeviceDriver();
if ("1".equals(type)) {
appearanceInspectionScannerConveyorDeviceDriver.writing("mode", 2);
stripConveyorDeviceDriver.writing("to" + device_code, 0);
stripConveyorDeviceDriver.writing("to" + device_code, 1);
} else {
appearanceInspectionScannerConveyorDeviceDriver.writing("mode", 0);
stripConveyorDeviceDriver.writing("to" + device_code, 0);
stripConveyorDeviceDriver.writing("to" + device_code, 1);
}
} else {
throw new BadRequestException("设备不存在");
@ -340,9 +342,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
throw new BadRequestException("下发参数不能为空");
}
Device device = deviceAppService.findDeviceByCode(device_code);
Integer toHeight = req.getInteger("toHeight");
if (device != null && device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) device.getDeviceDriver();
if (toHeight != null) {
appearanceInspectionScannerConveyorDeviceDriver.writing("toHeight", toHeight);
}
appearanceInspectionScannerConveyorDeviceDriver.writing("toCommand", toCommand);
}
JSONObject resp = new JSONObject();

2
nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java

@ -364,6 +364,8 @@ public interface TaskService extends CommonService<Task> {
TaskDto findReadyTaskByNextDeviceCode(String next_device_code,List<String> checkoutStartDeviceCode);
List<TaskDto> findReadyTasksByNextDeviceCode(String next_device_code,List<String> checkoutStartDeviceCode);
List<TaskDto> findReadyTaskByXDeviceCode(List<String> xDeviceCodeList, String noY);
/**

29
nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -1310,12 +1310,39 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
.filter(taskDto -> TaskStatusEnum.READY.getIndex().equals(taskDto.getTask_status()))
.filter(taskDto -> taskDto.getNext_device_code().equals(next_device_code))
.filter(taskDto -> !checkoutStartDeviceCode.contains(taskDto.getStart_device_code()))
.sorted(Comparator.comparing(TaskDto::getPriority)
.sorted(Comparator.comparingInt((TaskDto taskDto) -> Integer.parseInt(getNumericPart(taskDto.getStart_device_code())) % 4).reversed()
.thenComparing(taskDto -> Integer.parseInt(ObjectUtil.isEmpty(taskDto.getFrom_y()) ? "0" : taskDto.getFrom_y()))
.thenComparing(TaskDto::getPriority)
.thenComparing(taskDto -> LocalDateTime.parse(taskDto.getCreate_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))))
.findFirst()
.orElse(null);
}
@Override
public List<TaskDto> findReadyTasksByNextDeviceCode(String next_device_code, List<String> checkoutStartDeviceCode) {
return Optional.ofNullable(this.tasks)
.orElse(new CopyOnWriteArrayList<>())
.stream()
.filter(taskDto -> TaskStatusEnum.READY.getIndex().equals(taskDto.getTask_status()))
.filter(taskDto -> taskDto.getNext_device_code().equals(next_device_code))
.filter(taskDto -> !checkoutStartDeviceCode.contains(taskDto.getStart_device_code()))
.sorted(Comparator.comparingInt((TaskDto taskDto) -> Integer.parseInt(getNumericPart(taskDto.getStart_device_code())) % 4).reversed()
.thenComparing(taskDto -> Integer.parseInt(ObjectUtil.isEmpty(taskDto.getFrom_z()) ? "0" : taskDto.getFrom_z()))
.thenComparing(taskDto -> Integer.parseInt(ObjectUtil.isEmpty(taskDto.getFrom_y()) ? "0" : taskDto.getFrom_y()))
.thenComparing(TaskDto::getPriority)
.thenComparing(taskDto -> LocalDateTime.parse(taskDto.getCreate_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))))
.collect(Collectors.toList());
}
private String getNumericPart(String device_c0de) {
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(device_c0de);
if (matcher.find()) {
return matcher.group();
}
return "0";
}
@Override
public List<TaskDto> findReadyTaskByXDeviceCode(List<String> xDeviceCodeList, String noY) {
// String currentNoY = noY == null ? "" : noY;

66
nladmin-ui/src/views/acs/device/driver/appearance_inspection_scanner_conveyor_device.vue

@ -52,7 +52,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="电气调度号" label-width="150px">
<el-input v-model="form.address" />
<el-input v-model="form.address"/>
</el-form-item>
</el-col>
</el-row>
@ -67,23 +67,23 @@
<el-row>
<el-col :span="6">
<el-form-item label="堆垛机对接位:" label-width="110px" prop="stackerDock">
<el-switch v-model="form.stackerDock" />
<el-switch v-model="form.stackerDock"/>
</el-form-item>
</el-col>
<span v-if="form.stackerDock">
<el-col :span="6">
<el-form-item label="当前排:" label-width="110px" prop="currentX">
<el-input v-model.number="form.currentX" />
<el-input v-model.number="form.currentX"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="当前列:" label-width="150px" prop="currentY">
<el-input v-model.number="form.currentY" style="width: 130px" />
<el-input v-model.number="form.currentY" style="width: 130px"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="当前层:" label-width="110px" prop="currentZ">
<el-input v-model.number="form.currentZ" style="width: 170px" />
<el-input v-model.number="form.currentZ" style="width: 170px"/>
</el-form-item>
</el-col>
</span>
@ -91,7 +91,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="堆垛机双任务:" label-width="110px" prop="stackerDoubleTask">
<el-switch v-model="form.stackerDoubleTask" />
<el-switch v-model="form.stackerDoubleTask"/>
</el-form-item>
</el-col>
<span v-if="form.stackerDoubleTask">
@ -119,7 +119,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="输送指令起点:" label-width="110px" prop="conveyorStartPoint">
<el-switch v-model="form.conveyorStartPoint" />
<el-switch v-model="form.conveyorStartPoint"/>
</el-form-item>
</el-col>
<span v-if="form.conveyorStartPoint">
@ -145,7 +145,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="关联拣选台:" label-width="150px" prop="linkPinkDevice">
<el-switch v-model="form.linkPinkDevice" />
<el-switch v-model="form.linkPinkDevice"/>
</el-form-item>
</el-col>
<span v-if="form.linkPinkDevice">
@ -174,7 +174,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="输送指令终点:" label-width="110px" prop="conveyorEndPoint">
<el-switch v-model="form.conveyorEndPoint" />
<el-switch v-model="form.conveyorEndPoint"/>
</el-form-item>
</el-col>
<span v-if="form.conveyorEndPoint">
@ -200,12 +200,12 @@
</el-col>
<el-col :span="6">
<el-form-item label="扫码申请AGV任务:" label-width="150px">
<el-switch v-model="form.scanApplyTask" />
<el-switch v-model="form.scanApplyTask"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="自动申请AGV任务:" label-width="150px">
<el-switch v-model="form.applyTask" />
<el-switch v-model="form.applyTask"/>
</el-form-item>
</el-col>
</span>
@ -213,7 +213,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="输送缓存设备:" label-width="110px" prop="conveyorCachePoint">
<el-switch v-model="form.conveyorCachePoint" />
<el-switch v-model="form.conveyorCachePoint"/>
</el-form-item>
</el-col>
<span v-if="form.conveyorCachePoint">
@ -241,7 +241,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="拣选台设备:" label-width="110px" prop="pinkDevicePoint">
<el-switch v-model="form.pinkDevicePoint" />
<el-switch v-model="form.pinkDevicePoint"/>
</el-form-item>
</el-col>
<span v-if="form.pinkDevicePoint">
@ -269,7 +269,7 @@
<el-row>
<el-col :span="6">
<el-form-item label="双向点位:" label-width="110px" prop="toWay">
<el-switch v-model="form.toWay" />
<el-switch v-model="form.toWay"/>
</el-form-item>
</el-col>
<span v-if="form.toWay">
@ -295,7 +295,7 @@
</span>
<el-col :span="6">
<el-form-item label="同一出入点:" label-width="110px" prop="samePoint">
<el-switch v-model="form.samePoint" />
<el-switch v-model="form.samePoint"/>
</el-form-item>
</el-col>
<span v-if="!form.samePoint">
@ -320,6 +320,13 @@
</el-col>
</span>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="靠近前叉:" label-width="110px" prop="isFront">-->
<!-- <el-switch v-model="form.isFront"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
</el-card>
@ -331,12 +338,12 @@
<el-row>
<el-col :span="8">
<el-form-item label="取货">
<el-switch v-model="form.is_pickup" />
<el-switch v-model="form.is_pickup"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="放货">
<el-switch v-model="form.is_release" />
<el-switch v-model="form.is_release"/>
</el-form-item>
</el-col>
</el-row>
@ -355,8 +362,8 @@
size="small"
style="width: 100%;margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="name" label="用途"/>
<el-table-column prop="code" label="别名要求"/>
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
@ -372,7 +379,7 @@
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input" />
<el-input v-model="data1[scope.$index].dbr_value" size="mini" class="edit-input"/>
</template>
</el-table-column>
</el-table>
@ -392,8 +399,8 @@
style="width: 100%;margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="name" label="用途"/>
<el-table-column prop="code" label="别名要求"/>
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
@ -409,7 +416,7 @@
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input"/>
</template>
</el-table-column>
<el-table-column prop="dbw_value">
@ -417,7 +424,7 @@
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input" />
<el-input v-model="data2[scope.$index].dbw_value" size="mini" class="edit-input"/>
</template>
</el-table-column>
</el-table>
@ -426,7 +433,7 @@
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span" />
<span class="role-span"/>
<el-button
:loading="false"
icon="el-icon-check"
@ -449,9 +456,9 @@ import {
testRead,
testwrite
} from '@/api/acs/device/driverConfig'
import { selectOpcList } from '@/api/acs/device/opc'
import { selectPlcList } from '@/api/acs/device/opcPlc'
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
import {selectOpcList} from '@/api/acs/device/opc'
import {selectPlcList} from '@/api/acs/device/opcPlc'
import {selectListByOpcID} from '@/api/acs/device/opcPlc'
import crud from '@/mixins/crud'
import deviceCrud from '@/api/acs/device/device'
@ -504,7 +511,8 @@ export default {
linkInOutDevice: '',
samePoint: false,
scanApplyTask: false,
applyTask: false
applyTask: false,
isFront: false
},
rules: {}
}

199
nladmin-ui/src/views/acs/device/driver/standard_stacker_device.vue

@ -58,7 +58,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="电气调度号" label-width="150px">
<el-input v-model="form.address" />
<el-input v-model="form.address"/>
</el-form-item>
</el-col>
</el-row>
@ -157,18 +157,18 @@
</el-col>
<el-col :span="8">
<el-form-item label="前叉禁止列:" label-width="110px" prop="frontNoY">
<el-input v-model="form.frontNoY" placeholder="以英文, 分隔" />
<el-input v-model="form.frontNoY" placeholder="以英文, 分隔"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="后叉禁止列:" label-width="110px" prop="backNoY">
<el-input v-model="form.backNoY" placeholder="以英文, 分隔" />
<el-input v-model="form.backNoY" placeholder="以英文, 分隔"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="叉数量:" label-width="110px" prop="backNoY">
<el-form-item label="堆垛机类型:" label-width="110px" prop="backNoY">
<el-select
v-model="form.stackerNum"
filterable
@ -224,9 +224,124 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="楼层优先级:" prop="floorPriority" label-width="110px">
<el-select
v-model="form.floorPriority"
filterable
clearable
reserve-keyword
placeholder="请选择楼层优先级"
>
<el-option
v-for=" item in floorPriorityList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="对接位坐标:" label-width="110px" prop="originPoint">
<el-input v-model="form.originPoint" placeholder="排列层以,分隔"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">对接位相关</span>
</div>
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left"/>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
>
新增一行
</el-button>
</span>
</div>
<div class="app-container">
<el-table :data="form.floorPoint" border fit highlight-current-row style="width: 100%;" class="tb-edit">
<el-table-column label="楼层" prop="floor">
<template scope="scope">
<el-select
v-model="scope.row.floor"
filterable
clearable
placeholder="请选择"
>
<el-option
v-for="item in floorList"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="入库对接点" prop="inPoints">
<template scope="scope">
<el-select
v-model="scope.row.inPoints"
filterable
clearable
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:key="item.device_id"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="出库对接点" prop="outPoints">
<template scope="scope">
<el-select
v-model="scope.row.outPoints"
filterable
clearable
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:key="item.device_id"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="170">
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.floorPoint)"
/>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">PLC读取字段</span>
@ -246,8 +361,8 @@
size="small"
style="width: 100%; margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="name" label="用途"/>
<el-table-column prop="code" label="别名要求"/>
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
@ -298,8 +413,8 @@
size="small"
style="width: 100%; margin-bottom: 15px"
>
<el-table-column prop="name" label="用途" />
<el-table-column prop="code" label="别名要求" />
<el-table-column prop="name" label="用途"/>
<el-table-column prop="code" label="别名要求"/>
<el-table-column prop="db" label="DB块">
<template slot-scope="scope">
<el-input
@ -350,7 +465,7 @@
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span" />
<span class="role-span"/>
<el-button
:loading="false"
icon="el-icon-check"
@ -373,13 +488,13 @@ import {
testwrite,
getStrategy
} from '@/api/acs/device/driverConfig'
import { selectOpcList } from '@/api/acs/device/opc'
import { selectPlcList } from '@/api/acs/device/opcPlc'
import { selectListByOpcID } from '@/api/acs/device/opcPlc'
import {selectOpcList} from '@/api/acs/device/opc'
import {selectPlcList} from '@/api/acs/device/opcPlc'
import {selectListByOpcID} from '@/api/acs/device/opcPlc'
import crud from '@/mixins/crud'
import deviceCrud from '@/api/acs/device/device'
import { findDeviceStrategyOption } from '@/api/acs/device/customPolicyType'
import {findDeviceStrategyOption} from '@/api/acs/device/customPolicyType'
export default {
name: 'DoubleStationStacker',
@ -408,14 +523,54 @@ export default {
data2: [],
stackerNums: [
{
label: '1',
label: '单叉',
value: '1'
},
{
label: '双叉',
value: '2'
}
],
floorList: [
{
label: '一楼',
value: '1'
},
{
label: '2',
label: '二楼',
value: '2'
},
{
label: '三楼',
value: '3'
}
],
floorPriorityList: [
{
label: '1L->2L->3L',
value: '1,2,3'
},
{
label: '1L->3L->2L',
value: '1,3,2'
},
{
label: '2L->1L->3L',
value: '2,1,3'
},
{
label: '2L->3L->1L',
value: '2,3,1'
},
{
label: '3L->2L->1L',
value: '3,2,1'
},
{
label: '3L->1L->2L',
value: '3,1,2'
},
],
form: {
strategyValue: '',
backDeviceCodeList: [],
@ -426,7 +581,10 @@ export default {
xDeviceCodeList: '',
stackerNum: '',
specialPutDevice: '',
specialGetDevice: ''
specialGetDevice: '',
floorPoint: [],
floorPriority: null,
originPoint: ''
},
rules: {}
}
@ -479,6 +637,15 @@ export default {
})
},
methods: {
insertdtl() {
if (!Array.isArray(this.form.floorPoint)) {
this.$set(this.form, 'floorPoint', []);
}
this.form.floorPoint.push({floor: '', inPoints: [], outPoints: []});
},
deleteRow(index, rows) {
rows.splice(index, 1)
},
finishReadEdit(data) {
// code,mode
if (data.code.indexOf('mode') !== -1) {

Loading…
Cancel
Save