gongchunyi
3 天以前 423ac2a5e7e451248d8cdfc2cda3f32dba0ec8f8
src/main/java/com/ruoyi/productionPlan/service/impl/ProductionPlanServiceImpl.java
@@ -15,7 +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.ProductOrder;
import com.ruoyi.production.service.ProductMaterialService;
import com.ruoyi.production.service.ProductOrderService;
import com.ruoyi.productionPlan.dto.ProductionPlanDto;
import com.ruoyi.productionPlan.dto.ProductionPlanImportDto;
@@ -68,6 +70,9 @@
    @Autowired
    private ProductOrderPlanMapper productOrderPlanMapper;
    @Autowired
    private ProductMaterialService productMaterialService;
    /**
     * 同步锁,确保手动和定时任务不同时执行
@@ -380,7 +385,19 @@
                plan.setApplyNo(formData.getString("textField_l7fytfco"));
                plan.setCustomerName(formData.getString("textField_lbkozohg"));
                plan.setMaterialCode(row.getString("textField_l9xo62q5"));
                String materialCode = row.getString("textField_l9xo62q5");
                plan.setMaterialCode(materialCode);
                // 根据物料编码查询物料信息表,关联物料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());
                    }
                }
                plan.setProductName(row.getString("textField_l9xo62q7"));
                plan.setProductSpec(row.getString("textField_l9xo62q8"));
                plan.setLength(row.getInteger("numberField_lb7lgatg_value"));