修改bug
This commit is contained in:
parent
f96efd2460
commit
887d1bea1b
|
|
@ -92,41 +92,41 @@ public class ConfigSuppliersInfoServiceImpl extends ServiceImpl<ConfigSuppliersI
|
||||||
.filter(xs -> xs != null) // 过滤掉null的供应商物料
|
.filter(xs -> xs != null) // 过滤掉null的供应商物料
|
||||||
.anyMatch(xs -> {
|
.anyMatch(xs -> {
|
||||||
// 安全的字段比较,允许null值
|
// 安全的字段比较,允许null值
|
||||||
boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
|
// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
|
||||||
(wl.getMaterialName() != null && xs.getMaterialName() != null &&
|
// (wl.getMaterialName() != null && xs.getMaterialName() != null &&
|
||||||
wl.getMaterialName().equals(xs.getMaterialName()));
|
// 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) ||
|
return true;
|
||||||
(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;
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.map(wl -> {
|
.map(wl -> {
|
||||||
// 找到对应的xs项目
|
// 找到对应的xs项目
|
||||||
NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
|
NuBizSuppliersMaterialInfo matchedXs = xsList.stream()
|
||||||
.filter(xs -> xs != null)
|
.filter(xs -> xs != null)
|
||||||
.filter(xs -> {
|
// .filter(xs -> {
|
||||||
// 同样的匹配逻辑
|
// // 同样的匹配逻辑
|
||||||
boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
|
// boolean materialNameMatch = (wl.getMaterialName() == null && xs.getMaterialName() == null) ||
|
||||||
(wl.getMaterialName() != null && xs.getMaterialName() != null &&
|
// (wl.getMaterialName() != null && xs.getMaterialName() != null &&
|
||||||
wl.getMaterialName().equals(xs.getMaterialName()));
|
// wl.getMaterialName().equals(xs.getMaterialName()));
|
||||||
|
//
|
||||||
boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) ||
|
// boolean specificationModelMatch = (wl.getSpecificationModel() == null && xs.getSpecificationModel() == null) ||
|
||||||
(wl.getSpecificationModel() != null && xs.getSpecificationModel() != null &&
|
// (wl.getSpecificationModel() != null && xs.getSpecificationModel() != null &&
|
||||||
wl.getSpecificationModel().equals(xs.getSpecificationModel()));
|
// wl.getSpecificationModel().equals(xs.getSpecificationModel()));
|
||||||
|
//
|
||||||
boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) ||
|
// boolean brandTypeMatch = (wl.getBrandType() == null && xs.getBrandType() == null) ||
|
||||||
(wl.getBrandType() != null && xs.getBrandType() != null &&
|
// (wl.getBrandType() != null && xs.getBrandType() != null &&
|
||||||
wl.getBrandType().equals(xs.getBrandType()));
|
// wl.getBrandType().equals(xs.getBrandType()));
|
||||||
|
//
|
||||||
return materialNameMatch && specificationModelMatch && brandTypeMatch;
|
// return materialNameMatch && specificationModelMatch && brandTypeMatch;
|
||||||
})
|
// })
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue