opt:acs联调NDC优化

This commit is contained in:
2025-09-19 17:52:49 +08:00
parent c29cbbbaef
commit 258dcb8c45
5 changed files with 28 additions and 66 deletions

View File

@@ -143,42 +143,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
(byte) ikeyhigh, (byte) ikeylow,
(byte) typehigh, (byte) typelow,
(byte) qhdhigh, (byte) qhdlow,
(byte) fhdhigh, (byte) fhdlow,
(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,
(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) 0X00, (byte) 0X00,
(byte) fhdhigh, (byte) fhdlow,
(byte) 0X00, (byte) 0X00
};
} else if (type == 3) {
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
};
}

View File

@@ -1506,18 +1506,30 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
return 0;
}
@Override
public String queryDeviceCodeByAddress(int code) {
Iterator iterator = storageCells.iterator();
while (iterator.hasNext()) {
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
if (storageCellDto.getAddress() == code) {
return storageCellDto.getStorage_code();
}
@Override
public String queryDeviceCodeByAddress(int code) {
// 检查storageCells是否为空如果为空则重新加载
if (storageCells == null || storageCells.isEmpty()) {
log.info("storageCells is empty, reloading data..."+ "int =" + code);
this.reload();
// 再次检查防止reload()后仍然为空
if (storageCells == null || storageCells.isEmpty()) {
log.warn("Failed to reload storageCells data" + "int =" + code);
return "0";
}
return "0";
}
Iterator iterator = storageCells.iterator();
while (iterator.hasNext()) {
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
// 检查storageCellDto是否为null
if (storageCellDto != null && storageCellDto.getAddress() == code) {
return storageCellDto.getStorage_code();
}
}
return "0";
}
@Override
public List<Device> findCacheDevice() {
List<Device> list = deviceAppService.findAllDevice();

View File

@@ -169,7 +169,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.put(log_file_type, log_type);
log.info("申请入库-----请求参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyIn");
AddressDto addressDto = addressService.findByCode("applyTaskToWms");
String url = wmsurl + addressDto.getMethods_url();
try {
result2 = HttpRequest.post(url)

View File

@@ -456,7 +456,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (ObjectUtils.isEmpty(shortPathsList)) {
throw new Exception(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由不通");
}
if (StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
throw new BadRequestException(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由类型不是agv类型");
}
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {

View File

@@ -626,6 +626,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
String route_plan_code = dto.getRoute_plan_code();
//本项目默认为2
dto.setAgv_system_type("2");
dto.setCreate_by(StrUtil.isNotEmpty(currentUsername) ? currentUsername : "LMS");
dto.setUpdate_by(currentUsername);
dto.setUpdate_time(now);
@@ -1108,26 +1110,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setNext_height(next_height);
instdto.setAgv_action_type(acsTask.getAgv_action_type());
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type());
}
} else {
instdto.setAgv_inst_type("1");
} else {
instdto.setAgv_inst_type("4");
}
instructionservice.create2(instdto);