opt:acs联调NDC优化
This commit is contained in:
@@ -143,42 +143,8 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
|||||||
(byte) ikeyhigh, (byte) ikeylow,
|
(byte) ikeyhigh, (byte) ikeylow,
|
||||||
(byte) typehigh, (byte) typelow,
|
(byte) typehigh, (byte) typelow,
|
||||||
(byte) qhdhigh, (byte) qhdlow,
|
(byte) qhdhigh, (byte) qhdlow,
|
||||||
|
(byte) fhdhigh, (byte) fhdlow,
|
||||||
(byte) qhdhigh2, (byte) qhdlow2,
|
(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
|
(byte) fhdhigh2, (byte) fhdlow2
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1506,18 +1506,30 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String queryDeviceCodeByAddress(int code) {
|
public String queryDeviceCodeByAddress(int code) {
|
||||||
Iterator iterator = storageCells.iterator();
|
// 检查storageCells是否为空,如果为空则重新加载
|
||||||
while (iterator.hasNext()) {
|
if (storageCells == null || storageCells.isEmpty()) {
|
||||||
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
|
log.info("storageCells is empty, reloading data..."+ "int =" + code);
|
||||||
if (storageCellDto.getAddress() == code) {
|
this.reload();
|
||||||
return storageCellDto.getStorage_code();
|
// 再次检查,防止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
|
@Override
|
||||||
public List<Device> findCacheDevice() {
|
public List<Device> findCacheDevice() {
|
||||||
List<Device> list = deviceAppService.findAllDevice();
|
List<Device> list = deviceAppService.findAllDevice();
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
log.info("申请入库-----请求参数{}", param);
|
log.info("申请入库-----请求参数{}", param);
|
||||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("applyIn");
|
AddressDto addressDto = addressService.findByCode("applyTaskToWms");
|
||||||
String url = wmsurl + addressDto.getMethods_url();
|
String url = wmsurl + addressDto.getMethods_url();
|
||||||
try {
|
try {
|
||||||
result2 = HttpRequest.post(url)
|
result2 = HttpRequest.post(url)
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||||
throw new Exception(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由不通");
|
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类型");
|
throw new BadRequestException(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由类型不是agv类型");
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "2")) {
|
||||||
|
|||||||
@@ -626,6 +626,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
String start_device_code = dto.getStart_device_code();
|
String start_device_code = dto.getStart_device_code();
|
||||||
String next_device_code = dto.getNext_device_code();
|
String next_device_code = dto.getNext_device_code();
|
||||||
String route_plan_code = dto.getRoute_plan_code();
|
String route_plan_code = dto.getRoute_plan_code();
|
||||||
|
//本项目默认为2
|
||||||
|
dto.setAgv_system_type("2");
|
||||||
dto.setCreate_by(StrUtil.isNotEmpty(currentUsername) ? currentUsername : "LMS");
|
dto.setCreate_by(StrUtil.isNotEmpty(currentUsername) ? currentUsername : "LMS");
|
||||||
dto.setUpdate_by(currentUsername);
|
dto.setUpdate_by(currentUsername);
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
@@ -1108,26 +1110,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
instdto.setNext_height(next_height);
|
instdto.setNext_height(next_height);
|
||||||
instdto.setAgv_action_type(acsTask.getAgv_action_type());
|
instdto.setAgv_action_type(acsTask.getAgv_action_type());
|
||||||
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
|
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
|
||||||
// task_type
|
instdto.setAgv_inst_type("1");
|
||||||
//1、生箔; Itype=1:取空,取满,放空,放满;
|
} else {
|
||||||
//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("4");
|
instdto.setAgv_inst_type("4");
|
||||||
}
|
}
|
||||||
instructionservice.create2(instdto);
|
instructionservice.create2(instdto);
|
||||||
|
|||||||
Reference in New Issue
Block a user