rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/AgvServiceImpl.java
@@ -269,6 +269,8 @@ if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; @@ -331,12 +333,14 @@ // boolean matches = containers.stream() // .map(BasContainer::getCodeType) // .anyMatch(codeType -> barcode.matches(codeType)); if (!matches) { throw new CoolException("条码与站点不匹配"); } if (!matches2) { throw new CoolException("查询到的容器不支持目标库区"); } if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/InBoundServiceImpl.java
@@ -94,6 +94,68 @@ if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; } private BasStation checkStaStatus(String barcode, String sta,String area) { if (Cools.isEmpty(barcode)) { throw new CoolException("容器码不能为空"); } if (Cools.isEmpty(sta)) { throw new CoolException("接驳位不能为空"); } BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getBarcode, barcode) , false ); if (!Cools.isEmpty(isBarcodeSta)) { throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定"); } BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getStationName, sta) ); if (Cools.isEmpty(basStation)) { throw new CoolException("未找到站点信息"); } if (!basStation.getUseStatus().equals("O")) { throw new CoolException("站点状态不为空闲"); } if (!Cools.isEmpty(basStation.getContainerType())) { List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); List<BasContainer> containers = basContainerService.list( new LambdaQueryWrapper<BasContainer>() .in(BasContainer::getContainerType, longs1) ); boolean matches = false; boolean matches2 = true; for (BasContainer container : containers) { String codeType = container.getCodeType(); // 获取正则表达式 if (barcode.matches(codeType)) { // 判断条码是否符合这个正则 List<String> areaList2 = JSONObject.parseArray(container.getAreas(), String.class); if (!areaList2.contains(area)) { matches2 = false; continue; } matches = true; break; // 找到匹配的就退出循环 } } // boolean matches = containers.stream() // .map(BasContainer::getCodeType) // .anyMatch(codeType -> barcode.matches(codeType)); if (!matches2) { throw new CoolException("查询到的容器不支持目标库区"); } if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; @@ -122,7 +184,7 @@ // throw new CoolException("容器未维护入库,请维护后再操作!!"); // } //验证基础信息 BasStation basStation = checkStaStatus(param.getContainerNo(), param.getTransferStationNo()); checkStaStatus(param.getContainerNo(), param.getTransferStationNo()); /**获取库位*/ String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), null); if (Cools.isEmpty(targetLoc)) { rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -341,7 +341,7 @@ // } //验证基础信息 BasStation basStation = checkStaStatus(pakin.getBarcode(), deviceSite.getSite()); checkStaStatus(pakin.getBarcode(), deviceSite.getSite(),warehouseArea.getId().toString()); /**获取库位*/ String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId(), null); if (Cools.isEmpty(targetLoc)) { @@ -449,6 +449,76 @@ return R.ok("任务生成完毕!"); } private BasStation checkStaStatus(String barcode, String sta,String area) { if (Cools.isEmpty(barcode)) { throw new CoolException("容器码不能为空"); } if (Cools.isEmpty(sta)) { throw new CoolException("接驳位条码不能为空"); } WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() .eq(WaitPakin::getBarcode, barcode) .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val) ); if (Cools.isEmpty(waitPakin)) { throw new CoolException("容器码未找到组托信息,请检查组托状态"); } BasStation isBarcodeSta = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getBarcode, barcode) , false ); if (!Cools.isEmpty(isBarcodeSta)) { throw new CoolException("该条码已被" + isBarcodeSta.getStationName() + "站绑定"); } BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() .eq(BasStation::getStationName, sta) ); if (Cools.isEmpty(basStation)) { throw new CoolException("未找到站点信息"); } if (!basStation.getUseStatus().equals("O")) { throw new CoolException("站点状态不为空闲"); } List<String> areaList = JSONObject.parseArray(basStation.getCrossZoneArea(), String.class); if (!areaList.contains(area)) { throw new CoolException("当前站点不支持目标库区"); } if (!Cools.isEmpty(basStation.getContainerType())) { List<Long> longs1 = JSONObject.parseArray(basStation.getContainerType(), Long.class); List<BasContainer> containers = basContainerService.list( new LambdaQueryWrapper<BasContainer>() .in(BasContainer::getContainerType, longs1) ); boolean matches = false; boolean matches2 = true; for (BasContainer container : containers) { String codeType = container.getCodeType(); // 获取正则表达式 if (barcode.matches(codeType)) { // 判断条码是否符合这个正则 List<String> areaList2 = JSONObject.parseArray(container.getAreas(), String.class); if (!areaList2.contains(area)) { matches2 = false; continue; } matches = true; break; // 找到匹配的就退出循环 } } // boolean matches = containers.stream() // .map(BasContainer::getCodeType) // .anyMatch(codeType -> barcode.matches(codeType)); if (!matches2) { throw new CoolException("查询到的容器不支持目标库区"); } if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; } private BasStation checkStaStatus(String barcode, String sta) { if (Cools.isEmpty(barcode)) { @@ -493,6 +563,8 @@ if (!matches) { throw new CoolException("条码与站点不匹配"); } } else { throw new CoolException("数据异常:验证基础信息"); } return basStation; @@ -535,8 +607,7 @@ //验证基础信息 BasStation basStation1 = checkStaStatus(pakin.getBarcode(),basStation.getStationName()); checkStaStatus(pakin.getBarcode(),basStation.getStationName(),warehouseArea.getId().toString()); // BasContainer container = basContainerService.getOne(new LambdaUpdateWrapper<BasContainer>() // .eq(BasContainer::getCode, pakin.getBarcode())); // if (Objects.isNull(container)) {