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;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -81,8 +82,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
@LokiLog(type = LokiLogType.AGV)
@Override
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() +
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
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() +
",nextAddress:" + inst.getNext_point_code());
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
if (!StrUtil.equals(agv_system_type, "1")) {
@@ -109,8 +110,16 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte fhdlow2 = (byte) IntToHexLow(nextAddress2);
byte prioritylow = (byte) IntToHexLow(priority);
String str = "十进制下发:";
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));
str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
@@ -132,22 +141,45 @@ public class NDCAgvServiceImpl implements NDCAgvService {
byte[] b = new byte[]{};
if (type == 1) {
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
};
if (ObjectUtil.isNotEmpty(inst.getCarno())) {
int carNo = Integer.parseInt(inst.getCarno());
byte agvnohigh = (byte) IntToHexHigh(carNo);
byte agvnolow = (byte) IntToHexLow(carNo);
b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08,
(byte) 0X00, (byte) 0X18,
(byte) 0X00, (byte) 0X01,
(byte) 0X00, (byte) 0X71,
(byte) 0X00, (byte) 0X14,
(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,
(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) {
b = new byte[]{(byte) 0X87, (byte) 0XCD,
(byte) 0X00, (byte) 0X08,

View File

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

View File

@@ -146,4 +146,6 @@ public class CreateTaskRequest extends BaseRequest {
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 task_type = request.getTask_type();
String truss_type = request.getTruss_type();
String car_no = request.getCar_no();
String is_bushing = request.getIs_bushing();
String version = request.getVersion();
String bushing_num = request.getBushing_num();
@@ -968,6 +969,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("vehicle_type", vehicle_type);
jo.put("storage_task_type", storage_task_type);
jo.put("agv_system_type", agv_system_type);
jo.put("car_no", car_no);
jo.put("start_height", start_height);
jo.put("next_height", next_height);
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取货高度
@@ -353,6 +353,7 @@ public class TaskDto implements Serializable {
@Override
public String toString(){
return "task_code:" + this.getTask_code()

View File

@@ -774,8 +774,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (ObjectUtil.isNotEmpty(dto.getWeight())) {
feed_jo.put("weight", dto.getWeight());
}
if (ObjectUtil.isNotEmpty(dto.getCarno())) {
feed_jo.put("car_no", dto.getCarno());
if (ObjectUtil.isNotEmpty(dto.getCar_no())) {
feed_jo.put("car_no", dto.getCar_no());
}
JSONArray ja = new JSONArray();
ja.add(feed_jo);
@@ -1188,7 +1188,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
map.put("立库任务类型", acsTask.getStorage_task_type());
map.put("烘箱温度", acsTask.getTemperature());
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_code());
map.put("是否需要反馈上位系统", acsTask.getIs_needfeedback());

View File

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