Browse Source

更新

master
gengby 2 years ago
parent
commit
ad4da7489e
  1. 7
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java
  2. 7
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java
  3. 15
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java
  4. 4
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java

7
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java

@ -2,6 +2,7 @@ package org.nl.acs.device_driver.maGang;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
@ -185,6 +186,12 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen
return false;
} else {
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");
String next_device_code = "";
MaGangConveyorDeviceDriver maGangConveyorDeviceDriver;

7
acs/nladmin-system/src/main/java/org/nl/acs/task/service/TaskService.java

@ -104,6 +104,13 @@ public interface TaskService {
*/
List<TaskDto> queryTaskByDeviceCode(String device_code);
/**
*
* @param device_code
* @return
*/
List<TaskDto> queryTaskByStartDeviceCode(String device_code);
/**
* 根据关联编号查询非立刻下发的关联任务
*/

15
acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java

@ -248,7 +248,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
public List<TaskDto> queryAllUnfinished(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONArray arr = wo.query("task_status < 2 ").getResultJSONArray(0);
List<TaskDto> list =arr.toJavaList(TaskDto.class);
List<TaskDto> list = arr.toJavaList(TaskDto.class);
return list;
}
@ -273,6 +273,19 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
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
public TaskDto queryTaskByLinkNum(String link_num) {
return null;

4
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java

@ -107,8 +107,8 @@ public class QueryXZAgvDeviceStatus {
if (!StrUtil.equals(kepType, task_type)) {
maGangAgvDeviceDriver.writing("type", task_type);
}
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x) + "");
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y) + "");
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x));
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y));
}
}
}

Loading…
Cancel
Save