rev:优化烘箱行架任务逻辑

This commit is contained in:
2024-11-18 13:43:57 +08:00
parent 32b0710a37
commit 4135200271
20 changed files with 194 additions and 174 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.acs.agv.server.impl; package org.nl.acs.agv.server.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -81,8 +82,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
@LokiLog(type = LokiLogType.AGV) @LokiLog(type = LokiLogType.AGV)
@Override @Override
public void sendAgvInstToNDC(String agv_system_type, Instruction inst) { public void sendAgvInstToNDC(String agv_system_type, Instruction inst) {
log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
",nextAddress:" + inst.getNext_point_code()); ",nextAddress:" + inst.getNext_point_code());
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
if (!StrUtil.equals(agv_system_type, "1")) { if (!StrUtil.equals(agv_system_type, "1")) {
@@ -109,8 +110,16 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte fhdlow2 = (byte) IntToHexLow(nextAddress2); byte fhdlow2 = (byte) IntToHexLow(nextAddress2);
byte prioritylow = (byte) IntToHexLow(priority); byte prioritylow = (byte) IntToHexLow(priority);
String str = "十进制下发:"; String str = "十进制下发:";
String str1 = "十六进制下发:"; String str1 = "十六进制下发:";
if (ObjectUtil.isNotEmpty(inst.getCarno())) {
int carNo = Integer.parseInt(inst.getCarno());
byte agvnohigh = (byte) IntToHexHigh(carNo);
byte agvnolow = (byte) IntToHexLow(carNo);
str += "agv车号 /carNo:" + (carNo);
str1 += "agv车号 /carNo:" + hexToString(agvnolow & 0xFF);
}
str += "任务号 ikey:" + (Integer.parseInt(instcode)); str += "任务号 ikey:" + (Integer.parseInt(instcode));
str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF); str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
@@ -132,22 +141,45 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte[] b = new byte[]{}; byte[] b = new byte[]{};
if (type == 1) { if (type == 1) {
b = new byte[]{(byte) 0X87, (byte) 0XCD, if (ObjectUtil.isNotEmpty(inst.getCarno())) {
(byte) 0X00, (byte) 0X08, int carNo = Integer.parseInt(inst.getCarno());
(byte) 0X00, (byte) 0X16, byte agvnohigh = (byte) IntToHexHigh(carNo);
(byte) 0X00, (byte) 0X01, byte agvnolow = (byte) IntToHexLow(carNo);
(byte) 0X00, (byte) 0X71, b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X12, (byte) 0X00, (byte) 0X08,
(byte) 0X01, prioritylow, (byte) 0X00, (byte) 0X18,
(byte) 0X00, (byte) 0X01, (byte) 0X00, (byte) 0X01,
(byte) ikeyhigh, (byte) ikeylow, (byte) 0X00, (byte) 0X71,
(byte) ikeyhigh, (byte) ikeylow, (byte) 0X00, (byte) 0X14,
(byte) typehigh, (byte) typelow, (byte) 0X01, prioritylow,
(byte) qhdhigh, (byte) qhdlow, (byte) 0X00, (byte) 0X01,
(byte) qhdhigh2, (byte) qhdlow2, (byte) ikeyhigh, (byte) ikeylow,
(byte) fhdhigh, (byte) fhdlow, (byte) ikeyhigh, (byte) ikeylow,
(byte) fhdhigh2, (byte) fhdlow2 (byte) typehigh, (byte) typelow,
}; (byte) qhdhigh, (byte) qhdlow,
(byte) qhdhigh2, (byte) qhdlow2,
(byte) fhdhigh, (byte) fhdlow,
(byte) fhdhigh2, (byte) fhdlow2,
(byte) agvnohigh, (byte) agvnolow
};
} else {
b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08,
(byte) 0X00, (byte) 0X16,
(byte) 0X00, (byte) 0X01,
(byte) 0X00, (byte) 0X71,
(byte) 0X00, (byte) 0X12,
(byte) 0X01, prioritylow,
(byte) 0X00, (byte) 0X01,
(byte) ikeyhigh, (byte) ikeylow,
(byte) ikeyhigh, (byte) ikeylow,
(byte) typehigh, (byte) typelow,
(byte) qhdhigh, (byte) qhdlow,
(byte) qhdhigh2, (byte) qhdlow2,
(byte) fhdhigh, (byte) fhdlow,
(byte) fhdhigh2, (byte) fhdlow2
};
}
} else if (type == 2) { } else if (type == 2) {
b = new byte[]{(byte) 0X87, (byte) 0XCD, b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08, (byte) 0X00, (byte) 0X08,

View File

@@ -465,7 +465,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight); logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight);
message = "上报满卷重量,weight:" + weight + ",指令号:" + ikey; message = "上报满卷重量,weight:" + weight + ",指令号:" + ikey;
task.setWeight(String.valueOf(weight)); task.setWeight(String.valueOf(weight));
task.setCarno(this.device_code); task.setCar_no(this.device_code);
taskService.update(task); taskService.update(task);
} }
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);

View File

@@ -146,4 +146,6 @@ public class CreateTaskRequest extends BaseRequest {
private String paper_array; private String paper_array;
private String car_no;
} }

View File

@@ -774,6 +774,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String route_plan_code = request.getRoute_plan_code(); String route_plan_code = request.getRoute_plan_code();
String task_type = request.getTask_type(); String task_type = request.getTask_type();
String truss_type = request.getTruss_type(); String truss_type = request.getTruss_type();
String car_no = request.getCar_no();
String is_bushing = request.getIs_bushing(); String is_bushing = request.getIs_bushing();
String version = request.getVersion(); String version = request.getVersion();
String bushing_num = request.getBushing_num(); String bushing_num = request.getBushing_num();
@@ -968,6 +969,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("vehicle_type", vehicle_type); jo.put("vehicle_type", vehicle_type);
jo.put("storage_task_type", storage_task_type); jo.put("storage_task_type", storage_task_type);
jo.put("agv_system_type", agv_system_type); jo.put("agv_system_type", agv_system_type);
jo.put("car_no", car_no);
jo.put("start_height", start_height); jo.put("start_height", start_height);
jo.put("next_height", next_height); jo.put("next_height", next_height);
jo.put("oven_time", (int) Math.ceil(oven_time)); jo.put("oven_time", (int) Math.ceil(oven_time));

View File

@@ -303,7 +303,7 @@ public class TaskDto implements Serializable {
/** /**
* 车号 * 车号
*/ */
private String carno; private String car_no;
/** /**
* agv取货高度 * agv取货高度
@@ -353,6 +353,7 @@ public class TaskDto implements Serializable {
@Override @Override
public String toString(){ public String toString(){
return "task_code:" + this.getTask_code() return "task_code:" + this.getTask_code()

View File

@@ -774,8 +774,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (ObjectUtil.isNotEmpty(dto.getWeight())) { if (ObjectUtil.isNotEmpty(dto.getWeight())) {
feed_jo.put("weight", dto.getWeight()); feed_jo.put("weight", dto.getWeight());
} }
if (ObjectUtil.isNotEmpty(dto.getCarno())) { if (ObjectUtil.isNotEmpty(dto.getCar_no())) {
feed_jo.put("car_no", dto.getCarno()); feed_jo.put("car_no", dto.getCar_no());
} }
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
ja.add(feed_jo); ja.add(feed_jo);
@@ -1188,7 +1188,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
map.put("立库任务类型", acsTask.getStorage_task_type()); map.put("立库任务类型", acsTask.getStorage_task_type());
map.put("烘箱温度", acsTask.getTemperature()); map.put("烘箱温度", acsTask.getTemperature());
map.put("烘箱时间", acsTask.getOven_time()); map.put("烘箱时间", acsTask.getOven_time());
map.put("agv车号", acsTask.getCarno()); map.put("agv车号", acsTask.getCar_no());
map.put("路由方案名称", acsTask.getRoute_plan_name()); map.put("路由方案名称", acsTask.getRoute_plan_name());
map.put("路由方案编码", acsTask.getRoute_plan_code()); map.put("路由方案编码", acsTask.getRoute_plan_code());
map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback()); map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback());

View File

@@ -68,6 +68,7 @@ public class AutoCreateInst {
String route_plan_code = acsTask.getRoute_plan_code(); String route_plan_code = acsTask.getRoute_plan_code();
String vehicleType = acsTask.getVehicle_type(); String vehicleType = acsTask.getVehicle_type();
String agv_system_type = acsTask.getAgv_system_type(); String agv_system_type = acsTask.getAgv_system_type();
String carno = acsTask.getCar_no();
String start_height = acsTask.getStart_height(); String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height(); String next_height = acsTask.getNext_height();
@@ -141,6 +142,7 @@ public class AutoCreateInst {
instdto.setExecute_device_code(start_point_code); instdto.setExecute_device_code(start_point_code);
instdto.setVehicle_type(vehicleType); instdto.setVehicle_type(vehicleType);
instdto.setAgv_system_type(agv_system_type); instdto.setAgv_system_type(agv_system_type);
instdto.setCarno(carno);
instdto.setStart_height(start_height); instdto.setStart_height(start_height);
instdto.setNext_height(next_height); instdto.setNext_height(next_height);
//判断agv系统 //判断agv系统

View File

@@ -2,7 +2,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev active: prod
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

View File

@@ -124,4 +124,6 @@ public interface XianGongAgvService {
* @return * @return
*/ */
HttpResponse sendOrderSequencesToForklift(Instruction dto, InteractionJsonDTO interactionJsonDTO); HttpResponse sendOrderSequencesToForklift(Instruction dto, InteractionJsonDTO interactionJsonDTO);
} }

View File

@@ -1,5 +1,6 @@
package org.nl.acs.agv.server.impl; package org.nl.acs.agv.server.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -74,17 +75,15 @@ public class NDCAgvServiceImpl implements NDCAgvService {
} }
@Override @Override
public void sendAgvInstToNDC(String agv_system_type, Instruction inst) { public void sendAgvInstToNDC(String agv_system_type, Instruction inst) {
log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() + log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() + ",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
",nextAddress:" + inst.getNext_point_code()); ",nextAddress:" + inst.getNext_point_code());
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
if (!StrUtil.equals(agv_system_type, "1")) { if (!StrUtil.equals(agv_system_type, "1")) {
String instcode = inst.getInstruction_code(); String instcode = inst.getInstruction_code();
int type = Integer.parseInt(inst.getAgv_inst_type()); int type = Integer.parseInt(inst.getAgv_inst_type());
int carNo = Integer.parseInt(inst.getCarno());
int priority = Integer.parseInt(inst.getPriority()) + 128; int priority = Integer.parseInt(inst.getPriority()) + 128;
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
@@ -96,8 +95,6 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode)); byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
byte typehigh = (byte) IntToHexHigh(type); byte typehigh = (byte) IntToHexHigh(type);
byte typelow = (byte) IntToHexLow(type); byte typelow = (byte) IntToHexLow(type);
byte agvnohigh = (byte) IntToHexHigh(carNo);
byte agvnolow = (byte) IntToHexLow(carNo);
byte qhdhigh = (byte) IntToHexHigh(startAddress); byte qhdhigh = (byte) IntToHexHigh(startAddress);
byte qhdlow = (byte) IntToHexLow(startAddress); byte qhdlow = (byte) IntToHexLow(startAddress);
byte qhdhigh2 = (byte) IntToHexHigh(startAddress2); byte qhdhigh2 = (byte) IntToHexHigh(startAddress2);
@@ -107,7 +104,6 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte fhdhigh2 = (byte) IntToHexHigh(nextAddress2); byte fhdhigh2 = (byte) IntToHexHigh(nextAddress2);
byte fhdlow2 = (byte) IntToHexLow(nextAddress2); byte fhdlow2 = (byte) IntToHexLow(nextAddress2);
byte prioritylow = (byte) IntToHexLow(priority); byte prioritylow = (byte) IntToHexLow(priority);
String str = "十进制下发:"; String str = "十进制下发:";
String str1 = "十六进制下发:"; String str1 = "十六进制下发:";
str += "任务号 ikey:" + (Integer.parseInt(instcode)); str += "任务号 ikey:" + (Integer.parseInt(instcode));
@@ -128,8 +124,6 @@ public class NDCAgvServiceImpl implements NDCAgvService {
str += "优先级 /priority:" + (priority); str += "优先级 /priority:" + (priority);
str1 += "优先级 /priority:" + hexToString(prioritylow & 0xFF); str1 += "优先级 /priority:" + hexToString(prioritylow & 0xFF);
str += "agv车号 /carNo:" + (carNo);
str1 += "agv车号 /carNo:" + hexToString(agvnolow & 0xFF);
byte[] b = new byte[]{}; byte[] b = new byte[]{};
if (type == 1) { if (type == 1) {
@@ -341,7 +335,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
} }
@Override @Override
public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity) { public byte[] sendAgvTwoModeInst(int phase, int index, int result, int offset, int quantity) {
if (phase < 0 || index < 0) if (phase < 0 || index < 0)
return null; return null;
byte indexhigh = (byte) IntToHexHigh(index); byte indexhigh = (byte) IntToHexHigh(index);
@@ -368,7 +362,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:" log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:"
+ hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF)+",是否侧移: "+(offset == 1?"侧移":"不测移") + ",偏离量: " + quantity); + hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF) + ",是否侧移: " + (offset == 1 ? "侧移" : "不测移") + ",偏离量: " + quantity);
System.out.println("反馈agv动作数据:" + Bytes2HexString(b)); System.out.println("反馈agv动作数据:" + Bytes2HexString(b));
return b; return b;
@@ -520,7 +514,6 @@ public class NDCAgvServiceImpl implements NDCAgvService {
} }
@Override @Override
public Map<String, AgvDto> findAllAgvFromCache() { public Map<String, AgvDto> findAllAgvFromCache() {
return AGVDeviceStatus; return AGVDeviceStatus;

View File

@@ -1082,6 +1082,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
} }
/** /**
* 追加动作块 * 追加动作块
* *

View File

@@ -338,16 +338,26 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
List<TaskDto> taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList()); List<TaskDto> taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList());
if (ObjectUtil.isNotEmpty(taskDtoStream)) { if (ObjectUtil.isNotEmpty(taskDtoStream)) {
TaskDto taskDto = taskDtos.get(0); TaskDto taskDto = taskDtos.get(0);
if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDto.getTask_type())) {
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code()); //存在行架->暂存的AGV任务 需要过滤
String start_device_code = instruction.getStart_device_code(); // 6 行架任务 8烘箱任务
String next_device_code = instruction.getNext_device_code(); if (!StrUtil.equals(taskDto.getTask_type(), "6") && !StrUtil.equals(taskDto.getTask_type(), "8")) {
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); taskDto = null;
Device startdevice = deviceAppService.findDeviceByCode(start_device_code); continue;
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; }
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDto.getTask_code());
OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; if (ObjectUtil.isEmpty(instruction)) {
break;
}
String start_device_code = instruction.getStart_device_code();
String next_device_code = instruction.getNext_device_code();
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver;
/*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof RangingStationsDeviceDriver) { /*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver();
standardInspectSiteDeviceDriver = (RangingStationsDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (RangingStationsDeviceDriver) nextdevice.getDeviceDriver();
@@ -378,111 +388,104 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
return false; return false;
} }
}*/ }*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { // if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 1) { if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
//判断关联的同一列烘箱设备是否都关门 都关门返回false有一个不关门就返回true
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
//未关门结束
if (isCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false; return false;
} }
// }
}
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
// if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
// }
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
}
//判断关联的同一列烘箱设备是否都关门 都关门返回false有一个不关门就返回true
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
//未关门结束
if (isCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false;
}
/*instruction.setInstruction_status("1"); /*instruction.setInstruction_status("1");
instruction.setUpdate_time(DateUtil.now()); instruction.setUpdate_time(DateUtil.now());
instructionService.update(instruction);*/ instructionService.update(instruction);*/
Device startDevice = deviceAppService.findDeviceByCode(start_device_code); Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) { if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
String msg = "当前设备:" + device_code + ",下发指令:"
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code();
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(msg)
.build();
logDto.setLog_level(3);
luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList<>();
Map map = new HashMap();
map.put("code", "to_onset");
map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0");
Map map1 = new HashMap();
map1.put("code", "to_target");
map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0");
Map map2 = new HashMap();
map2.put("code", "to_task");
map2.put("value", instruction.getInstruction_code());
Map map3 = new HashMap();
map3.put("code", "to_command");
map3.put("value", "1");
list.add(map);
list.add(map1);
list.add(map2);
list.add(map3);
this.writing(list);
this.setRequireSucess(true);
return true;
} }
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
}
String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString();
String msg = "当前设备:" + device_code + ",下发指令:"
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code();
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(msg)
.build();
logDto.setLog_level(3);
luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList<>();
Map map = new HashMap();
map.put("code", "to_onset");
map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0");
Map map1 = new HashMap();
map1.put("code", "to_target");
map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0");
Map map2 = new HashMap();
map2.put("code", "to_task");
map2.put("value", instruction.getInstruction_code());
Map map3 = new HashMap();
map3.put("code", "to_command");
map3.put("value", "1");
list.add(map);
list.add(map1);
list.add(map2);
list.add(map3);
this.writing(list);
this.setRequireSucess(true);
return true;
} else { } else {
List<TaskDto> taskDtoList = taskserver.findByTrappedManipulatorReady(); List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) { if (ObjectUtil.isNotEmpty(taskDtoList)) {
List<TaskDto> taskDtosReady = new ArrayList<>(); for (int j = 0; j < taskDtoList.size(); j++) {
for (TaskDto taskDto1 : taskDtoList) { //按照优先级排序 优先级相等按照创建时间排序
if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) { taskDtoList = this.sortTask(taskDtoList);
taskDtosReady.add(taskDto1); task = taskDtoList.get(j);
// 6 行架任务 8烘箱任务
if (!StrUtil.equals(task.getTask_type(), "6") && !StrUtil.equals(task.getTask_type(), "8")) {
task = null;
continue;
}
if (ObjectUtil.isNotEmpty(task)) {
break;
} }
} }
// task = taskDtosReady.get(0);
List<TaskDto> readyTaskDtos = new ArrayList<>();
for (int j = 0; j < taskDtosReady.size(); j++) {
task = taskDtosReady.get(j);
readyTaskDtos.add(task);
}
//按照优先级排序 优先级相等按照创建时间排序
readyTaskDtos = this.sortTask(readyTaskDtos);
task = readyTaskDtos.get(0);
}
if (ObjectUtil.isNotEmpty(task)) {
break;
} }
} }
} }
@@ -524,12 +527,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}*/ }*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { // if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 1) { if (standardInspectSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!"; notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!";
return false; return false;
}
} }
// }
} }
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
@@ -548,12 +551,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) { // if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
if (standardInspectSiteDeviceDriver.getMove() != 0) { if (standardInspectSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!"; notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!";
return false; return false;
}
} }
// }
} }
String taskid = task.getTask_id(); String taskid = task.getTask_id();
@@ -664,11 +667,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
list.add(map3); list.add(map3);
this.writing(list); this.writing(list);
this.setRequireSucess(true); this.setRequireSucess(true);
return true;
} else { } else {
notCreateInstMessage = "未找到关联设备的任务,指令无法创建"; notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
} }
return true; return true;
} }
} }

View File

@@ -226,9 +226,4 @@ public class CreateTaskRequest extends BaseRequest {
* 17 木箱堆叠行架任务 * 17 木箱堆叠行架任务
*/ */
private String class_type; private String class_type;
/**
* agv编号
*/
private String agv_no;
} }

View File

@@ -133,7 +133,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String route_plan_code = request.getRoute_plan_code(); String route_plan_code = request.getRoute_plan_code();
String task_type = request.getTask_type(); String task_type = request.getTask_type();
String class_type = request.getClass_type(); String class_type = request.getClass_type();
String agv_no = request.getAgv_no();
String truss_type = request.getTruss_type(); String truss_type = request.getTruss_type();
Integer agv_action_type = request.getAgv_action_type(); Integer agv_action_type = request.getAgv_action_type();
String empty_site = request.getEmpty_site(); String empty_site = request.getEmpty_site();
@@ -355,7 +354,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("next_device_code2", next_device_code2); jo.put("next_device_code2", next_device_code2);
jo.put("put_device_code", put_device_code); jo.put("put_device_code", put_device_code);
jo.put("agv_action_type", agv_action_type); jo.put("agv_action_type", agv_action_type);
jo.put("agv_no", agv_no);
jo.put("priority", priority); jo.put("priority", priority);
jo.put("vehicle_code", vehicle_code); jo.put("vehicle_code", vehicle_code);
jo.put("vehicle_code2", vehicle_code2); jo.put("vehicle_code2", vehicle_code2);

View File

@@ -247,11 +247,6 @@ public class Task extends CommonModel<Task> implements Serializable {
private Integer agv_action_type; private Integer agv_action_type;
/**
* agv编号
*/
private String agv_no;
/** /**
* 任务类型 * 任务类型
* 9 子卷下线行架任务 * 9 子卷下线行架任务

View File

@@ -370,9 +370,4 @@ public class TaskDto implements Serializable {
* 15 RGV输送任务 * 15 RGV输送任务
*/ */
private String class_type; private String class_type;
/**
* agv编号
*/
private String agv_no;
} }

View File

@@ -88,7 +88,6 @@ public class AutoCreateInst {
String route_plan_code = acsTask.getRoute_plan_code(); String route_plan_code = acsTask.getRoute_plan_code();
String vehicleType = acsTask.getVehicle_type(); String vehicleType = acsTask.getVehicle_type();
String agv_system_type = acsTask.getAgv_system_type(); String agv_system_type = acsTask.getAgv_system_type();
String agv_no = acsTask.getAgv_no();
String start_height = acsTask.getStart_height(); String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height(); String next_height = acsTask.getNext_height();
@@ -167,7 +166,6 @@ public class AutoCreateInst {
instdto.setStart_height(start_height); instdto.setStart_height(start_height);
instdto.setNext_height(next_height); instdto.setNext_height(next_height);
instdto.setAgv_action_type(agvActionType); instdto.setAgv_action_type(agvActionType);
instdto.setCarno(agv_no);
//判断agv系统 //判断agv系统
//1、1楼叉车系统 //1、1楼叉车系统
//2、2楼1区域AGV系统 //2、2楼1区域AGV系统

View File

@@ -130,6 +130,9 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
}catch (Exception ex){ }catch (Exception ex){
throw new RuntimeException(); throw new RuntimeException();
} }
if ("123456".equals(sysUser.getPassword())) {
sysUser.setPassword(SaSecureUtil.md5BySalt("123456", "salt"));
}
sysUser.setUpdate_time(new Date()); sysUser.setUpdate_time(new Date());
sysUser.setUpdate_id(SecurityUtils.getCurrentUserId()); sysUser.setUpdate_id(SecurityUtils.getCurrentUserId());
this.updateById(sysUser); this.updateById(sysUser);

View File

@@ -1,7 +1,7 @@
import store from '@/store' import store from '@/store'
export default { export default {
inserted(el, binding) { inserted(el, binding, vnode) {
const { value } = binding const { value } = binding
const roles = store.getters && store.getters.roles const roles = store.getters && store.getters.roles
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {

View File

@@ -10,7 +10,7 @@ spring:
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# username: ${DB_USER:root} # username: ${DB_USER:root}
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:root} password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数
initial-size: 5 initial-size: 5
# 最小连接数 # 最小连接数