diff --git a/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/configSuppliersInfo/service/impl/ConfigSuppliersInfoServiceImpl.java b/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/configSuppliersInfo/service/impl/ConfigSuppliersInfoServiceImpl.java index 8fcb0ff8..cab0e969 100644 --- a/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/configSuppliersInfo/service/impl/ConfigSuppliersInfoServiceImpl.java +++ b/nursing-unit-invoicing/nu-invoicing-biz/src/main/java/com/nu/modules/configSuppliersInfo/service/impl/ConfigSuppliersInfoServiceImpl.java @@ -92,41 +92,41 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl xs != null) // 过滤掉null的供应商物料 .anyMatch(xs -> { // 安全的字段比较,允许null值 - boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) || - (wl.getMaterialName() != null && xs.getMaterialName() != null && - wl.getMaterialName().equals(xs.getMaterialName())); +// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) || +// (wl.getMaterialName() != null && xs.getMaterialName() != null && +// wl.getMaterialName().equals(xs.getMaterialName())); +// +// boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) || +// (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null && +// wl.getSpecificationModel().equals(xs.getSpecificationModel())); +// +// boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) || +// (wl.getBrandType() != null && xs.getBrandType() != null && +// wl.getBrandType().equals(xs.getBrandType())); - boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) || - (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null && - wl.getSpecificationModel().equals(xs.getSpecificationModel())); - - boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) || - (wl.getBrandType() != null && xs.getBrandType() != null && - wl.getBrandType().equals(xs.getBrandType())); - - return materialNameMatch && specificationModelMatch && brandTypeMatch; + return true; }) ) .map(wl -> { // 找到对应的xs项目 NuBizSuppliersMaterialInfo matchedXs = xsList.stream() .filter(xs -> xs != null) - .filter(xs -> { - // 同样的匹配逻辑 - boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) || - (wl.getMaterialName() != null && xs.getMaterialName() != null && - wl.getMaterialName().equals(xs.getMaterialName())); - - boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) || - (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null && - wl.getSpecificationModel().equals(xs.getSpecificationModel())); - - boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) || - (wl.getBrandType() != null && xs.getBrandType() != null && - wl.getBrandType().equals(xs.getBrandType())); - - return materialNameMatch && specificationModelMatch && brandTypeMatch; - }) +// .filter(xs -> { +// // 同样的匹配逻辑 +// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) || +// (wl.getMaterialName() != null && xs.getMaterialName() != null && +// wl.getMaterialName().equals(xs.getMaterialName())); +// +// boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) || +// (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null && +// wl.getSpecificationModel().equals(xs.getSpecificationModel())); +// +// boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) || +// (wl.getBrandType() != null && xs.getBrandType() != null && +// wl.getBrandType().equals(xs.getBrandType())); +// +// return materialNameMatch && specificationModelMatch && brandTypeMatch; +// }) .findFirst() .orElse(null);