更新
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.maGang;
|
|||||||
|
|
||||||
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.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -185,6 +186,12 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
|
//查询任务表中是否有同一起点的任务
|
||||||
|
List<TaskDto> taskDtos = taskserver.queryTaskByStartDeviceCode(this.getDevice_code());
|
||||||
|
//如果有就不生成任务
|
||||||
|
if (ObjectUtil.isNotEmpty(taskDtos)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
List<String> link_device_codes = this.getExtraDeviceCodes("link_device_code");
|
List<String> link_device_codes = this.getExtraDeviceCodes("link_device_code");
|
||||||
String next_device_code = "";
|
String next_device_code = "";
|
||||||
MaGangConveyorDeviceDriver maGangConveyorDeviceDriver;
|
MaGangConveyorDeviceDriver maGangConveyorDeviceDriver;
|
||||||
|
|||||||
@@ -104,6 +104,13 @@ public interface TaskService {
|
|||||||
*/
|
*/
|
||||||
List<TaskDto> queryTaskByDeviceCode(String device_code);
|
List<TaskDto> queryTaskByDeviceCode(String device_code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param device_code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TaskDto> queryTaskByStartDeviceCode(String device_code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据关联编号查询非立刻下发的关联任务
|
* 根据关联编号查询非立刻下发的关联任务
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -273,6 +273,19 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TaskDto> queryTaskByStartDeviceCode(String start_device_code) {
|
||||||
|
List<TaskDto> list = new ArrayList<>();
|
||||||
|
Iterator<TaskDto> iterator = tasks.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
TaskDto task = iterator.next();
|
||||||
|
if (task.getStart_device_code().equals(start_device_code)) {
|
||||||
|
list.add(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskDto queryTaskByLinkNum(String link_num) {
|
public TaskDto queryTaskByLinkNum(String link_num) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ public class QueryXZAgvDeviceStatus {
|
|||||||
if (!StrUtil.equals(kepType, task_type)) {
|
if (!StrUtil.equals(kepType, task_type)) {
|
||||||
maGangAgvDeviceDriver.writing("type", task_type);
|
maGangAgvDeviceDriver.writing("type", task_type);
|
||||||
}
|
}
|
||||||
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x) + "");
|
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x));
|
||||||
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y) + "");
|
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user