更新
This commit is contained in:
@@ -232,13 +232,14 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
|
|
||||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
map.put("code", "to_command");
|
map.put("code", "to_command");
|
||||||
map.put("value", "2");
|
map.put("value", "2");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
siemensConveyorDeviceDriver.writing(list);
|
siemensConveyorDeviceDriver.writing(list);
|
||||||
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.acs.ext.wms.service.impl;
|
package org.nl.acs.ext.wms.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -62,7 +63,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
|||||||
String status = requestParam.getState();
|
String status = requestParam.getState();
|
||||||
String carNo = requestParam.getRobotId();
|
String carNo = requestParam.getRobotId();
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
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());
|
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 取消
|
// 1 已接收 2 开始执行 3执行完成 4 5 取消
|
||||||
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
||||||
task.setTask_status("1");
|
task.setTask_status("1");
|
||||||
@@ -102,8 +125,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
|||||||
String status = requestParam.getState();
|
String status = requestParam.getState();
|
||||||
String carNo = requestParam.getRobotId();
|
String carNo = requestParam.getRobotId();
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
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());
|
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 空洞
|
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
|
||||||
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
||||||
task.setTask_status("1");
|
task.setTask_status("1");
|
||||||
@@ -159,8 +203,29 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
|||||||
String status = requestParam.getState();
|
String status = requestParam.getState();
|
||||||
String carNo = requestParam.getRobotId();
|
String carNo = requestParam.getRobotId();
|
||||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
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());
|
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") ){
|
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
||||||
task.setTask_status("1");
|
task.setTask_status("1");
|
||||||
taskService.update(task);
|
taskService.update(task);
|
||||||
|
|||||||
@@ -602,8 +602,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||||
|
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
removeByCodeFromCache(dto.getInstruction_code());
|
||||||
this.reload();
|
instructions.add(dto);
|
||||||
|
// this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -735,7 +736,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeByCodeFromCache(entity.getInstruction_code());
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
this.reload();
|
// this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -979,7 +980,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
removeByCodeFromCache(entity.getInstruction_code());
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
}
|
}
|
||||||
this.reload();
|
// this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1320,11 +1321,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean removeByCodeFromCache(String code) {
|
public boolean removeByCodeFromCache(String code) {
|
||||||
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
|
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
|
||||||
instructions.removeIf((instruction) -> {
|
instructions.removeIf((inst) -> {
|
||||||
instruction.getInstruction_code().equals(code);
|
return inst.getInstruction_code().equals(code);
|
||||||
return true;
|
});
|
||||||
});
|
|
||||||
// while (iterator.hasNext()) {
|
// while (iterator.hasNext()) {
|
||||||
// Instruction instruction = iterator.next();
|
// Instruction instruction = iterator.next();
|
||||||
// if (instruction.getInstruction_code().equals(code)) {
|
// if (instruction.getInstruction_code().equals(code)) {
|
||||||
@@ -1332,7 +1332,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ 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.concurrent.CopyOnWriteArrayList;
|
||||||
|
import java.util.function.Predicate;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -525,7 +526,12 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
|
|
||||||
wo.insert(json);
|
wo.insert(json);
|
||||||
synchronized(TaskServiceImpl.class){
|
synchronized(TaskServiceImpl.class){
|
||||||
|
System.out.println("-------------------"+dto.getTask_code());
|
||||||
|
System.out.println("-------------1"+tasks.size());
|
||||||
|
|
||||||
tasks.add(dto);
|
tasks.add(dto);
|
||||||
|
System.out.println("-------------2"+tasks.size());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1271,10 +1277,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
public boolean removeByCodeFromCache(String code) {
|
public boolean removeByCodeFromCache(String code) {
|
||||||
CopyOnWriteArrayList<TaskDto> taskDtos = (CopyOnWriteArrayList<TaskDto>) this.tasks;
|
CopyOnWriteArrayList<TaskDto> taskDtos = (CopyOnWriteArrayList<TaskDto>) this.tasks;
|
||||||
taskDtos.removeIf((task) -> {
|
taskDtos.removeIf((task) -> {
|
||||||
task.getTask_code().equals(code);
|
return task.getTask_code().equals(code);
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user