From a274b897e58c958903c3e00da6c1ccb16646a979 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 12 三月 2026 11:54:13 +0800
Subject: [PATCH] feat: 物料规格和物料的新增、修改和删除
---
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
index 1fa88f9..de8cfe4 100644
--- a/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
+++ b/src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -15,9 +15,9 @@
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.config.AliDingConfig;
-import com.ruoyi.production.pojo.ProductMaterial;
+import com.ruoyi.production.pojo.ProductMaterialSku;
import com.ruoyi.production.pojo.ProductOrder;
-import com.ruoyi.production.service.ProductMaterialService;
+import com.ruoyi.production.service.ProductMaterialSkuService;
import com.ruoyi.production.service.ProductOrderService;
import com.ruoyi.productionPlan.dto.ProductionPlanDto;
import com.ruoyi.productionPlan.dto.ProductionPlanImportDto;
@@ -72,7 +72,7 @@
private ProductOrderPlanMapper productOrderPlanMapper;
@Autowired
- private ProductMaterialService productMaterialService;
+ private ProductMaterialSkuService productMaterialSkuService;
/**
* 鍚屾閿侊紝纭繚鎵嬪姩鍜屽畾鏃朵换鍔′笉鍚屾椂鎵ц
@@ -386,11 +386,11 @@
String materialCode = row.getString("textField_l9xo62q5");
// 鏍规嵁鐗╂枡缂栫爜鏌ヨ鐗╂枡淇℃伅琛紝鍏宠仈鐗╂枡ID
if (StringUtils.isNotEmpty(materialCode)) {
- LambdaQueryWrapper<ProductMaterial> queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(ProductMaterial::getMaterialCode, materialCode);
- ProductMaterial productMaterial = productMaterialService.getOne(queryWrapper);
- if (productMaterial != null) {
- plan.setProductMaterialId(productMaterial.getId());
+ LambdaQueryWrapper<ProductMaterialSku> skuQueryWrapper = new LambdaQueryWrapper<>();
+ skuQueryWrapper.eq(ProductMaterialSku::getMaterialCode, materialCode);
+ ProductMaterialSku sku = productMaterialSkuService.getOne(skuQueryWrapper);
+ if (sku != null && sku.getMaterialId() != null) {
+ plan.setProductMaterialId(sku.getMaterialId().intValue());
}
}
--
Gitblit v1.9.3