gongchunyi
2 天以前 a274b897e58c958903c3e00da6c1ccb16646a979
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());
                    }
                }