From 83f6a929a4a9ee2f67cfa6dd7d059c998380141d Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 12 三月 2026 17:56:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_宁夏_中盛建材' into dev_宁夏_中盛建材
---
src/main/java/com/ruoyi/production/service/impl/ProductMaterialServiceImpl.java | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductMaterialServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductMaterialServiceImpl.java
index bd32f1f..41aa10f 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductMaterialServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductMaterialServiceImpl.java
@@ -302,10 +302,17 @@
for (ProductMaterialSku sku : list) {
- ProductMaterialSku exist =
- productMaterialSkuService.getOne(new LambdaQueryWrapper<ProductMaterialSku>()
- .eq(ProductMaterialSku::getMaterialId, sku.getMaterialId())
- .eq(ProductMaterialSku::getSpecification, sku.getSpecification()));
+ LambdaQueryWrapper<ProductMaterialSku> wrapper = new LambdaQueryWrapper<>();
+ wrapper.eq(ProductMaterialSku::getMaterialId, sku.getMaterialId())
+ .eq(ProductMaterialSku::getSpecification, sku.getSpecification());
+
+ if (StringUtils.isNotEmpty(sku.getMaterialCode())) {
+ wrapper.eq(ProductMaterialSku::getMaterialCode, sku.getMaterialCode());
+ } else {
+ wrapper.isNull(ProductMaterialSku::getMaterialCode);
+ }
+
+ ProductMaterialSku exist = productMaterialSkuService.getOne(wrapper);
if (exist == null) {
productMaterialSkuService.save(sku);
affected++;
--
Gitblit v1.9.3