| | |
| | | new LambdaQueryWrapper<BasContainer>() |
| | | .in(BasContainer::getContainerType, longs1) |
| | | ); |
| | | boolean matches = containers.stream() |
| | | .map(BasContainer::getCodeType) |
| | | .anyMatch(codeType -> barcode.matches(codeType)); |
| | | boolean matches = false; |
| | | for (BasContainer container : containers) { |
| | | String codeType = container.getCodeType(); // 获取正则表达式 |
| | | if (barcode.matches(codeType)) { // 判断条码是否符合这个正则 |
| | | matches = true; |
| | | break; // 找到匹配的就退出循环 |
| | | } |
| | | } |
| | | // boolean matches = containers.stream() |
| | | // .map(BasContainer::getCodeType) |
| | | // .anyMatch(codeType -> barcode.matches(codeType)); |
| | | if (!matches) { |
| | | throw new CoolException("条码与站点不匹配"); |
| | | } |