rev 更新同一点位有任务不能请求mes
This commit is contained in:
@@ -32,7 +32,9 @@ import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -60,6 +62,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
NDCAgvServiceImpl agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
@Autowired
|
||||
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
|
||||
|
||||
//线体状态
|
||||
int status = 0;
|
||||
@@ -550,7 +554,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
return false;
|
||||
} else {
|
||||
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
|
||||
TaskDto taskDto = taskService.findByNextCode(device_code);
|
||||
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode()) && taskDto == null) {
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("type", StatusEnum.KZ_EMPTY_REQ.getCode());
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
@@ -576,7 +581,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
return false;
|
||||
} else {
|
||||
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode())) {
|
||||
TaskDto taskDto = taskService.findByStartCode(device_code);
|
||||
if (produceshiftorderDto != null && StrUtil.equals(produceshiftorderDto.getIs_needmove(), StatusEnum.NEED_MOVE.getCode()) && taskDto == null) {
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
reqParam.put("type", StatusEnum.KZ_FULL_REQ.getCode());
|
||||
|
||||
@@ -32,7 +32,9 @@ import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -60,6 +62,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
@Autowired
|
||||
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
|
||||
|
||||
int heartbeat = 0;
|
||||
int packer_ready = 0;//包装机就绪
|
||||
@@ -458,7 +462,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
} else {
|
||||
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (produceshiftorderDto != null && produceshiftorderDto.getIs_needmove().equals(StatusEnum.NEED_MOVE.getCode())) {
|
||||
TaskDto taskDto = taskService.findByStartCode(device_code);
|
||||
if (produceshiftorderDto != null && produceshiftorderDto.getIs_needmove().equals(StatusEnum.NEED_MOVE.getCode()) && taskDto == null) {
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
reqParam.put("type", StatusEnum.BZ_EMPTY_REQ.getCode());
|
||||
@@ -484,7 +489,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
return false;
|
||||
} else {
|
||||
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||
if (produceshiftorderDto != null && produceshiftorderDto.getIs_needmove().equals(StatusEnum.NEED_MOVE.getCode())) {
|
||||
TaskDto taskDto = taskService.findByNextCode(device_code);
|
||||
if (produceshiftorderDto != null && produceshiftorderDto.getIs_needmove().equals(StatusEnum.NEED_MOVE.getCode()) && taskDto == null) {
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
reqParam.put("type", StatusEnum.BZ_FULL_REQ.getCode());
|
||||
|
||||
@@ -62,6 +62,8 @@ public class AutoCreateInst {
|
||||
.stream()
|
||||
.sorted((t1, t2) -> t1.getIs_send().compareTo(t2.getIs_send()))
|
||||
.collect(Collectors.toList());
|
||||
//生产指令关联编号
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
|
||||
//如果分组后任务数量为1 下发单任务,分组后任务数量为2 下发双任务
|
||||
if (tasks.size() == TASK_SIZE_1) {
|
||||
@@ -72,8 +74,6 @@ public class AutoCreateInst {
|
||||
continue;
|
||||
}
|
||||
|
||||
//生成指令的关联编号
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
Instruction instDto = instructionService.createInstDtoByTask(taskDto, link_no);
|
||||
|
||||
try {
|
||||
@@ -90,7 +90,6 @@ public class AutoCreateInst {
|
||||
|
||||
} else if (tasks.size() == TASK_SIZE_2) {
|
||||
|
||||
String link_no = CodeUtil.getNewCode("LINK_NO");
|
||||
|
||||
TaskDto taskDto1 = tasks.get(0);
|
||||
TaskDto taskDto2 = tasks.get(1);
|
||||
|
||||
Reference in New Issue
Block a user