add: 创建任务添加扩展字段
This commit is contained in:
@@ -66,7 +66,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
@Autowired
|
||||
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 心跳
|
||||
*/
|
||||
Integer heartbeat = 0;
|
||||
@@ -76,17 +76,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
*/
|
||||
Integer item_deviceCode = 0;
|
||||
Integer last_item_deviceCode = 0;
|
||||
/**
|
||||
/**
|
||||
* 工作模式
|
||||
*/
|
||||
Integer mode = 0;
|
||||
Integer last_mode = 0;
|
||||
/**
|
||||
*作业状态
|
||||
* 作业状态
|
||||
*/
|
||||
Integer command = 0;
|
||||
Integer last_command = 0;
|
||||
/**
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
Integer task = 0;
|
||||
@@ -111,7 +111,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
*/
|
||||
Integer y = 0;
|
||||
Integer last_y = 0;
|
||||
/**
|
||||
/**
|
||||
* 行走开关信号
|
||||
*/
|
||||
Float move = 0F;
|
||||
@@ -121,12 +121,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
*/
|
||||
Float cargoMove = 0F;
|
||||
Float last_cargoMove = 0F;
|
||||
/**
|
||||
/**
|
||||
* 行走动作信号
|
||||
*/
|
||||
Float action = 0F;
|
||||
Float last_action = 0F;
|
||||
/**
|
||||
/**
|
||||
* 行走激光数值
|
||||
*/
|
||||
Integer distancex = 0;
|
||||
@@ -137,41 +137,41 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
Integer distancey = 0;
|
||||
Integer last_distancey = 0;
|
||||
/**
|
||||
*载货台超限信号
|
||||
* 载货台超限信号
|
||||
*/
|
||||
Float cargoError = 0F;
|
||||
Float last_cargoError = 0F;
|
||||
/**
|
||||
*货叉探货信号
|
||||
* 货叉探货信号
|
||||
*/
|
||||
Float forkCargo = 0F;
|
||||
Float last_forkCargo = 0F;
|
||||
/**
|
||||
*货叉位置信号
|
||||
* 货叉位置信号
|
||||
*/
|
||||
Float forkLocation = 0F;
|
||||
Float last_forkLocation = 0F;
|
||||
/**
|
||||
*货叉动作信号
|
||||
* 货叉动作信号
|
||||
*/
|
||||
Float forkAction = 0F;
|
||||
Float last_forkAction = 0F;
|
||||
/**
|
||||
/**
|
||||
* 特殊开关量1
|
||||
*/
|
||||
Float special1 = 0F;
|
||||
Float last_special1 = 0F;
|
||||
/**
|
||||
/**
|
||||
* 特殊开关量2
|
||||
*/
|
||||
Float special2 = 0F;
|
||||
Float last_special2 = 0F;
|
||||
/**
|
||||
*托盘条码
|
||||
* 托盘条码
|
||||
*/
|
||||
int[] trayCode;
|
||||
int[] last_trayCode;
|
||||
/**
|
||||
/**
|
||||
* 水箱和消防缓存位有无货
|
||||
*/
|
||||
Float storage_cache = 0F;
|
||||
@@ -181,58 +181,58 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
*/
|
||||
Integer stacker_rpm = 0;
|
||||
Integer last_stacker_rpm = 0;
|
||||
/**
|
||||
/**
|
||||
* 电流
|
||||
*/
|
||||
Integer stacker_electricCurrent = 0;
|
||||
Integer last_stacker_electricCurrent = 0;
|
||||
/**
|
||||
/**
|
||||
* 轴运行次数
|
||||
*/
|
||||
Integer stacker_runing_time = 0;
|
||||
Integer last_stacker_runing_time = 0;
|
||||
/**
|
||||
/**
|
||||
* 轴工作时间(小时)
|
||||
*/
|
||||
Integer stacker_workingHours = 0;
|
||||
Integer last_stacker_workingHours = 0;
|
||||
/**
|
||||
*载货台速度(转/分钟)
|
||||
* 载货台速度(转/分钟)
|
||||
*/
|
||||
Integer cargo_rpm = 0;
|
||||
Integer last_cargo_rpm = 0;
|
||||
/**
|
||||
*载货台电流
|
||||
* 载货台电流
|
||||
*/
|
||||
Integer cargo_electric_Current = 0;
|
||||
Integer last_cargo_electric_Current = 0;
|
||||
/**
|
||||
*载货台轴工作小时数
|
||||
* 载货台轴工作小时数
|
||||
*/
|
||||
Integer cargo_workingHour = 0;
|
||||
Integer last_cargo_workingHour = 0;
|
||||
/**
|
||||
*载货台轴运行次数
|
||||
* 载货台轴运行次数
|
||||
*/
|
||||
Integer cargo_runingTimes = 0;
|
||||
Integer last_cargo_runingTimes = 0;
|
||||
/**
|
||||
*货叉速度(转/分钟
|
||||
* 货叉速度(转/分钟
|
||||
*/
|
||||
Integer fork_rpm = 0;
|
||||
Integer last_fork_rpm = 0;
|
||||
/**
|
||||
*货叉电流
|
||||
* 货叉电流
|
||||
*/
|
||||
Integer fork_electric_Current = 0;
|
||||
Integer last_fork_electric_Current = 0;
|
||||
/**
|
||||
*货叉轴工作时间(小时
|
||||
* 货叉轴工作时间(小时
|
||||
*/
|
||||
Integer fork_workingHours = 0;
|
||||
Integer last_fork_workingHours = 0;
|
||||
/**
|
||||
*货叉轴运行次数
|
||||
* 货叉轴运行次数
|
||||
*/
|
||||
Integer fork_runingTimes = 0;
|
||||
Integer last_fork_runingTimes = 0;
|
||||
@@ -250,7 +250,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
List<String> getDeviceCodeList = null;
|
||||
List<String> putDeviceCodeList = null;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 请求成功标记
|
||||
*/
|
||||
Boolean requireSucess = false;
|
||||
@@ -459,7 +459,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
//更改指令状态
|
||||
if (task > 0) {
|
||||
Instruction inst = checkInst();
|
||||
if (inst != null) {
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "0")) {
|
||||
inst.setInstruction_status(CommonFinalParam.ONE);
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
@@ -730,7 +730,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
map.put("to_x", inst.getFrom_y());
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(map)){
|
||||
if (ObjectUtil.isNotEmpty(map)) {
|
||||
list.add(map);
|
||||
this.writing(list);
|
||||
}
|
||||
@@ -828,7 +828,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
if (command == 8) {
|
||||
map.put("to_command", 8);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(map)){
|
||||
if (ObjectUtil.isNotEmpty(map)) {
|
||||
list.add(map);
|
||||
this.writing(list);
|
||||
}
|
||||
@@ -873,6 +873,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成指令
|
||||
*
|
||||
@@ -926,7 +927,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 将扩展表中的字符串数据转换成集合
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -176,6 +176,13 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
List<TaskDto> queryByStauts(String task_status);
|
||||
|
||||
/**
|
||||
* 根绝状态查询缓存
|
||||
* @param task_status
|
||||
* @return
|
||||
*/
|
||||
List<TaskDto> findByTaskStatus(String task_status);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
|
||||
@@ -456,7 +456,21 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return ConvertUtil.convertList(taskList, TaskDto.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaskDto> findByTaskStatus(String status) {
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
if (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if(StrUtil.equals(task.getTask_status(), status)){
|
||||
taskDtoList.add(task);
|
||||
}
|
||||
}
|
||||
return taskDtoList;
|
||||
}
|
||||
|
||||
|
||||
public void create(TaskDto dto) throws Exception {
|
||||
dto = foramte(dto);
|
||||
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
||||
|
||||
@@ -45,8 +45,7 @@ public class CreateDDJInst {
|
||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
DeviceExtraService deviceExtra = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
|
||||
List<TaskDto> taskDtos = taskserver.queryByStauts("0");
|
||||
List<TaskDto> taskDtos = taskserver.findByTaskStatus("0");
|
||||
List<TaskDto> taskDtoList = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(taskDtos) || taskDtos.size() < 1) {
|
||||
} else {
|
||||
@@ -69,7 +68,7 @@ public class CreateDDJInst {
|
||||
if (ObjectUtils.isEmpty(list)) {
|
||||
throw new BadRequestException("路由不通");
|
||||
}
|
||||
RouteLineDto routeLineDto = (RouteLineDto) list.get(0);
|
||||
RouteLineDto routeLineDto = list.get(0);
|
||||
String[] path = routeLineDto.getPath().split("->");
|
||||
List<String> pathlist = Arrays.asList(path);
|
||||
String deviceType = appService.findDeviceByCode(pathlist.get(1)).getDevice_type();
|
||||
@@ -137,7 +136,6 @@ public class CreateDDJInst {
|
||||
RouteLineDto routeLineDto1 = shortPathsList.get(0);
|
||||
|
||||
String path1 = routeLineDto1.getPath();
|
||||
String type1 = routeLineDto1.getType();
|
||||
String[] str = path1.split("->");
|
||||
|
||||
List<String> pathlist1 = Arrays.asList(str);
|
||||
|
||||
Reference in New Issue
Block a user