跟新
This commit is contained in:
@@ -891,6 +891,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||||
|
if(ObjectUtil.isEmpty(instruction)){
|
||||||
|
message = "指令号"+task+"未找到对应指令";
|
||||||
|
return;
|
||||||
|
}
|
||||||
message = "申请AGV搬运任务中...";
|
message = "申请AGV搬运任务中...";
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
|
|||||||
@@ -5,13 +5,15 @@ import org.nl.acs.device_driver.DeviceDriver;
|
|||||||
|
|
||||||
public interface ExecutableDeviceDriver extends DeviceDriver {
|
public interface ExecutableDeviceDriver extends DeviceDriver {
|
||||||
default void executeAuto() {
|
default void executeAuto() {
|
||||||
try {
|
// try {
|
||||||
|
// this.execute();
|
||||||
|
// } catch (Throwable var6) {
|
||||||
|
// String message = "线程调用异常:" + var6.getMessage();
|
||||||
|
// Log.error(message);
|
||||||
|
// } finally {
|
||||||
|
// }
|
||||||
this.execute();
|
this.execute();
|
||||||
} catch (Throwable var6) {
|
|
||||||
String message = "线程调用异常:" + var6.getMessage();
|
|
||||||
Log.error(message);
|
|
||||||
} finally {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void execute();
|
void execute();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
package org.nl.acs.instruction.service.impl;
|
package org.nl.acs.instruction.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -55,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -68,7 +70,7 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class InstructionServiceImpl implements InstructionService, ApplicationAutoInitial {
|
public class InstructionServiceImpl implements InstructionService, ApplicationAutoInitial {
|
||||||
|
|
||||||
List<Instruction> instructions = new ArrayList();
|
List<Instruction> instructions = new CopyOnWriteArrayList();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceAppService deviceAppService;
|
DeviceAppService deviceAppService;
|
||||||
@@ -1218,7 +1220,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
public Instruction findByDeviceCodeFromCache(String devicecode) {
|
public Instruction findByDeviceCodeFromCache(String devicecode) {
|
||||||
|
|
||||||
List<Instruction> instructionList = instructions;
|
List<Instruction> instructionList = instructions;
|
||||||
Collections.sort(instructionList, new Comparator<Instruction>() {
|
ListUtil.sort(instructionList, new Comparator<Instruction>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(Instruction o1, Instruction o2) {
|
public int compare(Instruction o1, Instruction o2) {
|
||||||
return o1.getCreate_time().compareTo(o2.getCreate_time());
|
return o1.getCreate_time().compareTo(o2.getCreate_time());
|
||||||
|
|||||||
Reference in New Issue
Block a user