This commit is contained in:
USER-20220102CG\noblelift
2023-02-07 16:09:17 +08:00
parent 92cfac8432
commit 8fb452f27f
4 changed files with 87 additions and 16 deletions

View File

@@ -232,13 +232,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
siemensConveyorDeviceDriver.writing(list);
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
}
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {

View File

@@ -1,5 +1,6 @@
package org.nl.acs.ext.wms.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@@ -62,7 +63,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
String status = requestParam.getState();
String carNo = requestParam.getRobotId();
Instruction inst = instructionService.findByCodeFromCache(inst_code);
if (ObjectUtil.isEmpty(inst)) {
InStoreReportResponse inStoreReportResponse = new InStoreReportResponse();
inStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应指令");
result.put("data", inStoreReportResponse );
log.info("入库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new InStoreReportResponse());
}
TaskDto task = taskService.findByCodeFromCache(inst.getTask_code());
if (ObjectUtil.isEmpty(task)) {
InStoreReportResponse inStoreReportResponse = new InStoreReportResponse();
inStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应任务");
result.put("data", inStoreReportResponse );
log.info("入库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new InStoreReportResponse());
}
// 1 已接收 2 开始执行 3执行完成 4 5 取消
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
task.setTask_status("1");
@@ -102,8 +125,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
String status = requestParam.getState();
String carNo = requestParam.getRobotId();
Instruction inst = instructionService.findByCodeFromCache(inst_code);
if (ObjectUtil.isEmpty(inst)) {
OutStoreReportResponse outStoreReportResponse = new OutStoreReportResponse();
outStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应指令");
result.put("data", outStoreReportResponse );
log.info("出库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new OutStoreReportResponse());
}
TaskDto task = taskService.findByCodeFromCache(inst.getTask_code());
if (ObjectUtil.isEmpty(task)) {
OutStoreReportResponse outStoreReportResponse = new OutStoreReportResponse();
outStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应任务");
result.put("data", outStoreReportResponse );
log.info("出库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new OutStoreReportResponse());
}
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
task.setTask_status("1");
@@ -159,8 +203,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
String status = requestParam.getState();
String carNo = requestParam.getRobotId();
Instruction inst = instructionService.findByCodeFromCache(inst_code);
if (ObjectUtil.isEmpty(inst)) {
MoveStoreReportResponse moveStoreReportResponse = new MoveStoreReportResponse();
moveStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应指令");
result.put("data", moveStoreReportResponse );
log.info("移库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new MoveStoreReportResponse());
}
TaskDto task = taskService.findByCodeFromCache(inst.getTask_code());
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
if (ObjectUtil.isEmpty(task)) {
MoveStoreReportResponse moveStoreReportResponse = new MoveStoreReportResponse();
moveStoreReportResponse.setOrderId(inst_code);
JSONObject result = new JSONObject();
result.put("result", "false");
result.put("code", "0");
result.put("comment", "未找到对应任务");
result.put("data", moveStoreReportResponse );
log.info("移库任务状态反馈-----输出参数{}", result);
return RespUtil.getResp(result.toString(), new MoveStoreReportResponse());
} // 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
task.setTask_status("1");
taskService.update(task);

View File

@@ -602,8 +602,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.update(json);
this.reload();
removeByCodeFromCache(dto.getInstruction_code());
instructions.add(dto);
// this.reload();
}
@Override
@@ -735,7 +736,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
}
removeByCodeFromCache(entity.getInstruction_code());
this.reload();
// this.reload();
}
@Override
@@ -979,7 +980,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
}
removeByCodeFromCache(entity.getInstruction_code());
}
this.reload();
// this.reload();
}
@Override
@@ -1320,11 +1321,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override
public boolean removeByCodeFromCache(String code) {
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
instructions.removeIf((instruction) -> {
instruction.getInstruction_code().equals(code);
return true;
});
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
instructions.removeIf((inst) -> {
return inst.getInstruction_code().equals(code);
});
// while (iterator.hasNext()) {
// Instruction instruction = iterator.next();
// if (instruction.getInstruction_code().equals(code)) {
@@ -1332,7 +1332,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// return true;
// }
// }
return true;
return true;
}
@Override

View File

@@ -54,6 +54,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -525,7 +526,12 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
wo.insert(json);
synchronized(TaskServiceImpl.class){
System.out.println("-------------------"+dto.getTask_code());
System.out.println("-------------1"+tasks.size());
tasks.add(dto);
System.out.println("-------------2"+tasks.size());
}
}
@@ -1271,10 +1277,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
public boolean removeByCodeFromCache(String code) {
CopyOnWriteArrayList<TaskDto> taskDtos = (CopyOnWriteArrayList<TaskDto>) this.tasks;
taskDtos.removeIf((task) -> {
task.getTask_code().equals(code);
return true;
return task.getTask_code().equals(code);
});
return false;
return true;
}
@Override