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