|
|
@ -12,8 +12,9 @@ import lombok.Setter; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.acs.device.device.domain.Device; |
|
|
|
import org.nl.acs.device.device.enums.DeviceType; |
|
|
|
import org.nl.acs.device.device.service.DeviceAppService; |
|
|
|
import org.nl.acs.device.device.service.DeviceAssignedService; |
|
|
|
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.CommandEnum; |
|
|
|
import org.nl.acs.device.enums.RequestTypeEnum; |
|
|
@ -26,7 +27,6 @@ import org.nl.acs.monitor.DeviceStageMonitor; |
|
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
|
|
import org.nl.acs.task.enums.TaskStatusEnum; |
|
|
|
import org.nl.acs.task.enums.TaskTypeEnum; |
|
|
|
import org.nl.acs.task.service.TaskService; |
|
|
|
import org.nl.acs.task.service.dto.TaskDto; |
|
|
|
import org.nl.common.utils.CodeUtil; |
|
|
@ -35,7 +35,6 @@ import org.nl.config.SpringContextHolder; |
|
|
|
import org.nl.config.lucene.service.LuceneExecuteLogService; |
|
|
|
import org.nl.config.lucene.service.dto.LuceneLogDto; |
|
|
|
|
|
|
|
import java.io.Serializable; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.locks.Lock; |
|
|
|
import java.util.concurrent.locks.ReentrantLock; |
|
|
@ -58,6 +57,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
private final TaskService taskService = SpringContextHolder.getBean(TaskService.class); |
|
|
|
private final RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); |
|
|
|
private final DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); |
|
|
|
private final DeviceAssignedService deviceAssignedService = SpringContextHolder.getBean(DeviceAssignedService.class); |
|
|
|
|
|
|
|
private static final Lock LOCK = new ReentrantLock(); |
|
|
|
|
|
|
@ -149,7 +149,8 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
/** |
|
|
|
* 请求标记 |
|
|
|
*/ |
|
|
|
boolean requireSuccess = false; |
|
|
|
private boolean requireSuccess = false; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 请求时间 |
|
|
@ -172,6 +173,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
*/ |
|
|
|
private boolean isError = false; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Device getDevice() { |
|
|
|
return this.device; |
|
|
@ -193,20 +195,21 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
this.loadAssignData(currentDeviceCode, ItemProtocol.class); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void executeLogic() { |
|
|
|
private void executeLogicBefore() { |
|
|
|
if (this.move != this.lastMove) { |
|
|
|
this.requireSuccess = false; |
|
|
|
} |
|
|
|
if (!StrUtil.equals(this.barcode, this.lastBarcode)) { |
|
|
|
if (!StrUtil.equals(this.barcode, this.lastBarcode) && this.move == 1) { |
|
|
|
this.requireInTaskTime = System.currentTimeMillis(); |
|
|
|
} |
|
|
|
if (this.move != 0 && this.task > 0) { |
|
|
|
this.update_instruction_status_by_task(); |
|
|
|
} |
|
|
|
// else if (this.move != 0 && StrUtil.isNotEmpty(this.barcode)) {
|
|
|
|
// this.update_instruction_status_by_barcode();
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void executeLogic() { |
|
|
|
this.executeLogicBefore(); |
|
|
|
if (!this.online) { |
|
|
|
this.message = "设备离线"; |
|
|
|
} else if (this.mode == 0) { |
|
|
@ -220,18 +223,21 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
//编写业务逻辑方法
|
|
|
|
if (this.mode == 2 && this.move > 0 && StrUtil.isNotEmpty(this.barcode) && !requireSuccess) { |
|
|
|
//查询入库信息
|
|
|
|
this.createInInstruction2(); |
|
|
|
this.createInInstruction(); |
|
|
|
} else if (this.mode == 2 && this.move == 0 && !requireSuccess) { |
|
|
|
//查询出库信息
|
|
|
|
String cacheDeviceCode = Optional.ofNullable(this.getExtraValue().get("cacheDeviceCode")).map(Object::toString).orElse(""); |
|
|
|
if (ObjectUtil.isNotEmpty(cacheDeviceCode)) { |
|
|
|
this.createOutInstruction2(cacheDeviceCode); |
|
|
|
this.createOutInstruction(cacheDeviceCode); |
|
|
|
} else { |
|
|
|
this.createOutInstruction2(this.currentDeviceCode); |
|
|
|
this.createOutInstruction(this.currentDeviceCode); |
|
|
|
} |
|
|
|
} else if (this.mode == 6 && move > 0 && !requireSuccess) { |
|
|
|
//向上位申请任务
|
|
|
|
this.applyInTask(); |
|
|
|
} else if (this.mode == 2 && this.move > 0 && StrUtil.isEmpty(this.barcode) && !requireSuccess) { |
|
|
|
//下发输送线指令信息
|
|
|
|
this.distribute(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -251,11 +257,9 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
} else { |
|
|
|
this.requireTime = currentTimeMillis; |
|
|
|
JSONObject requestParam = new JSONObject(); |
|
|
|
requestParam.put("device_code", this.currentDeviceCode); |
|
|
|
requestParam.put("device_code1", this.currentDeviceCode); |
|
|
|
requestParam.put("type", RequestTypeEnum.APPLY_IN_TASK.getType()); |
|
|
|
requestParam.put("barcode", this.barcode); |
|
|
|
requestParam.put("weight", this.weight); |
|
|
|
requestParam.put("height", this.height); |
|
|
|
requestParam.put("barcode1", this.barcode); |
|
|
|
UnifiedResponse<JSONObject> response = acsToWmsService.applyTaskToWms(requestParam); |
|
|
|
if (response.isSuccess()) { |
|
|
|
this.requireSuccess = true; |
|
|
@ -263,58 +267,7 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// public void createInInstruction() {
|
|
|
|
// long currentTimeMillis = System.currentTimeMillis();
|
|
|
|
// if (!isTimeValid(currentTimeMillis)) {
|
|
|
|
// log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut);
|
|
|
|
// } else {
|
|
|
|
// TaskDto taskDto = taskService.findReadyByStartDeviceCode(this.currentDeviceCode);
|
|
|
|
// Instruction instDto = instructionService.findReadyInst(this.currentDeviceCode);
|
|
|
|
// if (ObjectUtil.isNotEmpty(taskDto) && ObjectUtil.isEmpty(instDto)) {
|
|
|
|
// instDto = new Instruction();
|
|
|
|
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskDto.getStart_device_code(), taskDto.getNext_device_code(), taskDto.getRoute_plan_code());
|
|
|
|
// if (CollectionUtil.isEmpty(shortPathsList)) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 不存在该点的路由信息!"));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// RouteLineDto routeLineDto = shortPathsList.get(0);
|
|
|
|
// String path = routeLineDto.getPath();
|
|
|
|
// String[] str = path.split("->");
|
|
|
|
// List<String> pathList = Arrays.asList(str);
|
|
|
|
// int start = 0;
|
|
|
|
// String start_device_code = pathList.get(start);
|
|
|
|
// String next_device_code = pathList.get(start + 1);
|
|
|
|
// setInstruction(instDto, taskDto, start_device_code, next_device_code);
|
|
|
|
// Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
|
|
|
// if (nextDevice == null) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 未配置指令终点驱动信息, 终点: " + instDto.getNext_device_code()));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// try {
|
|
|
|
// instructionService.create(instDto);
|
|
|
|
// taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
|
|
|
// taskService.update(taskDto);
|
|
|
|
// 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()));
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 原因:" + e.getMessage()));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// this.requireSuccess = true;
|
|
|
|
// } else if (ObjectUtil.isEmpty(taskDto) && ObjectUtil.isNotEmpty(instDto)) {
|
|
|
|
// String next_device_code = instDto.getNext_device_code();
|
|
|
|
// Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
|
|
|
// if (nextDevice != null && StrUtil.equals(nextDevice.getDevice_type(), "conveyor")) {
|
|
|
|
// 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.requireSuccess = true;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
public void createInInstruction2() { |
|
|
|
public void createInInstruction() { |
|
|
|
long currentTimeMillis = System.currentTimeMillis(); |
|
|
|
if (!isTimeValid(currentTimeMillis)) { |
|
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut); |
|
|
@ -323,7 +276,6 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
Instruction instDto = instructionService.findReadyInstByVehicleCode(this.barcode); |
|
|
|
if (ObjectUtil.isNotEmpty(taskDto) && ObjectUtil.isEmpty(instDto)) { |
|
|
|
if (!StrUtil.equals(this.currentDeviceCode, taskDto.getStart_device_code())) { |
|
|
|
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "当前载具号:" + this.barcode + ", 对应的设备号, 与查询到的任务起点: " + taskDto.getStart_device_code() + " 不一致, 无法生成指令。")); |
|
|
|
return; |
|
|
|
} |
|
|
|
instDto = new Instruction(); |
|
|
@ -336,15 +288,28 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
String path = routeLineDto.getPath(); |
|
|
|
String[] str = path.split("->"); |
|
|
|
List<String> pathList = Arrays.asList(str); |
|
|
|
int start = 0; |
|
|
|
String start_device_code = pathList.get(start); |
|
|
|
String next_device_code = pathList.get(start + 1); |
|
|
|
setInstruction(instDto, taskDto, start_device_code, next_device_code); |
|
|
|
String start_device_code = taskDto.getStart_device_code(); |
|
|
|
int index = 0; |
|
|
|
for (int m = 0; m < pathList.size(); m++) { |
|
|
|
if (pathList.get(m).equals(start_device_code)) { |
|
|
|
index = m + 1; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
String next_device_code = pathList.get(index); |
|
|
|
// int start = 0;
|
|
|
|
// String start_device_code = pathList.get(start);
|
|
|
|
// String next_device_code = pathList.get(start + 1);
|
|
|
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); |
|
|
|
if (nextDevice == null) { |
|
|
|
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 未配置指令终点驱动信息, 终点: " + instDto.getNext_device_code())); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (nextDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) { |
|
|
|
setInstruction(instDto, taskDto, start_device_code, next_device_code); |
|
|
|
} else { |
|
|
|
setInstruction(instDto, taskDto, start_device_code, taskDto.getStart_point_code(), next_device_code, taskDto.getNext_point_code()); |
|
|
|
} |
|
|
|
try { |
|
|
|
instructionService.create(instDto); |
|
|
|
taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex()); |
|
|
@ -367,59 +332,10 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
this.requireSuccess = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 暂时不要删除
|
|
|
|
// public void createOutInstruction() {
|
|
|
|
// long currentTimeMillis = System.currentTimeMillis();
|
|
|
|
// if (!isTimeValid(currentTimeMillis)) {
|
|
|
|
// log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut);
|
|
|
|
// } else {
|
|
|
|
// TaskDto taskDto = taskService.findReadyTaskByNextDeviceCode(this.currentDeviceCode);
|
|
|
|
// Instruction instDto = instructionService.findReadyInstByEnd(this.currentDeviceCode);
|
|
|
|
// if (ObjectUtil.isNotEmpty(taskDto) && ObjectUtil.isEmpty(instDto)) {
|
|
|
|
// instDto = new Instruction();
|
|
|
|
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskDto.getStart_device_code(), taskDto.getNext_device_code(), taskDto.getRoute_plan_code());
|
|
|
|
// if (CollectionUtil.isEmpty(shortPathsList)) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 不存在该点的路由信息!"));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// RouteLineDto routeLineDto = shortPathsList.get(0);
|
|
|
|
// String path = routeLineDto.getPath();
|
|
|
|
// String[] str = path.split("->");
|
|
|
|
// List<String> pathList = Arrays.asList(str);
|
|
|
|
// int start = 0;
|
|
|
|
// String start_device_code = pathList.get(start);
|
|
|
|
// String next_device_code = pathList.get(start + 1);
|
|
|
|
// String start_point_code = null;
|
|
|
|
// if (StrUtil.equals(deviceAppService.findDeviceTypeByCode(start_device_code), "storage")) {
|
|
|
|
// start_point_code = start_device_code + "-" + taskDto.getFrom_y() + "-" + taskDto.getFrom_z();
|
|
|
|
// } else {
|
|
|
|
// start_point_code = start_device_code;
|
|
|
|
// }
|
|
|
|
// setInstruction(instDto, taskDto, start_device_code, start_point_code, next_device_code, next_device_code);
|
|
|
|
// Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
|
|
|
// if (nextDevice == null) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 未配置指令终点驱动信息, 终点: " + instDto.getNext_device_code()));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// try {
|
|
|
|
// instructionService.create(instDto);
|
|
|
|
// taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
|
|
|
// taskService.update(taskDto);
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 原因:" + e.getMessage()));
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// this.requireSuccess = true;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
public void createOutInstruction2(String deviceCode) { |
|
|
|
public void createOutInstruction(String deviceCode) { |
|
|
|
long currentTimeMillis = System.currentTimeMillis(); |
|
|
|
if (!isTimeValid(currentTimeMillis)) { |
|
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut); |
|
|
@ -430,18 +346,32 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
Instruction instDto = instructionService.findReadyInstByEnd(deviceCode); |
|
|
|
if (ObjectUtil.isNotEmpty(taskDto) && ObjectUtil.isEmpty(instDto)) { |
|
|
|
instDto = new Instruction(); |
|
|
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskDto.getStart_device_code(), taskDto.getNext_device_code(), taskDto.getRoute_plan_code()); |
|
|
|
if (CollectionUtil.isEmpty(shortPathsList)) { |
|
|
|
List<DeviceAssignedDto> assignedDtos = deviceAssignedService.queryAssignedByDevice(taskDto.getStart_device_code(), taskDto.getNext_device_code()); |
|
|
|
if (CollectionUtil.isEmpty(assignedDtos)) { |
|
|
|
logService.deviceExecuteLog(new LuceneLogDto(this.currentDeviceCode, "创建指令失败, 不存在该点的路由信息!")); |
|
|
|
return; |
|
|
|
} |
|
|
|
RouteLineDto routeLineDto = shortPathsList.get(0); |
|
|
|
String path = routeLineDto.getPath(); |
|
|
|
String[] str = path.split("->"); |
|
|
|
List<String> pathList = Arrays.asList(str); |
|
|
|
int start = 0; |
|
|
|
String start_device_code = pathList.get(start); |
|
|
|
String next_device_code = pathList.get(start + 1); |
|
|
|
DeviceAssignedDto assignedDto = assignedDtos.get(0); |
|
|
|
String start_device_code = assignedDto.getDevice_code(); |
|
|
|
String next_device_code = assignedDto.getInst_nextDevice_code(); |
|
|
|
Instruction inst = instructionService.findReadyInstByEnd(next_device_code); |
|
|
|
if (ObjectUtil.isNotEmpty(inst)) { |
|
|
|
Device device = deviceAppService.findDeviceByCode(next_device_code); |
|
|
|
if (device != null) { |
|
|
|
//判断另一个拣选位是否禁用
|
|
|
|
String pinkDeviceCode = Optional.ofNullable(device.getExtraValue().get("pinkDeviceCode")).map(Objects::toString).orElse(""); |
|
|
|
Device pinkDevice = deviceAppService.findDeviceByCode(pinkDeviceCode); |
|
|
|
if (pinkDevice != null && pinkDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) { |
|
|
|
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) pinkDevice.getDeviceDriver(); |
|
|
|
if (appearanceInspectionScannerConveyorDeviceDriver.getMode() == 0) { |
|
|
|
String getLinkDeviceCode = Optional.ofNullable(device.getExtraValue().get("getLinkDeviceCode")).map(Objects::toString).orElse(""); |
|
|
|
if (StrUtil.isNotEmpty(getLinkDeviceCode)) { |
|
|
|
next_device_code = getLinkDeviceCode; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String start_point_code = null; |
|
|
|
if (StrUtil.equals(deviceAppService.findDeviceTypeByCode(start_device_code), "storage")) { |
|
|
|
start_point_code = start_device_code + "-" + taskDto.getFrom_y() + "-" + taskDto.getFrom_z(); |
|
|
@ -471,6 +401,28 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 下发输送线指令 |
|
|
|
*/ |
|
|
|
private void distribute() { |
|
|
|
long currentTimeMillis = System.currentTimeMillis(); |
|
|
|
if (!isTimeValid(currentTimeMillis)) { |
|
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.requireTimeOut); |
|
|
|
} else { |
|
|
|
this.requireTime = currentTimeMillis; |
|
|
|
Instruction inst = instructionService.findReadyInst(this.currentDeviceCode); |
|
|
|
if (ObjectUtil.isNotEmpty(inst)) { |
|
|
|
String next_device_code = inst.getNext_device_code(); |
|
|
|
Device next_device = deviceAppService.findDeviceByCode(next_device_code); |
|
|
|
if (next_device != null && next_device.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) { |
|
|
|
Integer address = Optional.ofNullable(next_device.getExtraValue().get("address")).map(Object::toString).map(Integer::parseInt).orElse(0); |
|
|
|
this.writing(Arrays.asList(ItemProtocol.TO_COMMAND.getKey(), ItemProtocol.TO_TASK.getKey(), ItemProtocol.TO_TARGET.getKey()), Arrays.asList(CommandEnum.COMMAND_1.getValue(), inst.getInstruction_code(), address)); |
|
|
|
this.requireSuccess = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 更新指令状态 |
|
|
@ -483,14 +435,6 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@SneakyThrows |
|
|
|
private void update_instruction_status_by_barcode() { |
|
|
|
Instruction instruction = instructionService.findByVehicleCodeFromCache(this.barcode); |
|
|
|
if (ObjectUtil.isNotEmpty(instruction)) { |
|
|
|
update_inst_status(instruction); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@SneakyThrows |
|
|
|
private void update_inst_status(Instruction instruction) { |
|
|
|
if (InstructionStatusEnum.READY.getIndex().equals(instruction.getInstruction_status()) && this.currentDeviceCode.equals(instruction.getStart_device_code())) { |
|
|
|