| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.config.AliDingConfig; |
| | | import com.ruoyi.framework.util.AliDingUtils; |
| | | import com.ruoyi.production.pojo.ProductMaterial; |
| | | import com.ruoyi.production.pojo.ProductMaterialSku; |
| | | import com.ruoyi.production.service.ProductMaterialService; |
| | | import com.ruoyi.production.service.ProductMaterialSkuService; |
| | | import com.ruoyi.productionPlan.enums.DataSourceTypeEnum; |
| | | import com.ruoyi.productionPlan.pojo.ProductionPlan; |
| | | import com.ruoyi.productionPlan.pojo.SalesDelivery; |
| | |
| | | |
| | | @Autowired |
| | | private SalesDeliveryMapper salesDeliveryMapper; |
| | | |
| | | @Autowired |
| | | private ProductMaterialSkuService productMaterialSkuService; |
| | | |
| | | @Autowired |
| | | private ProductMaterialService productMaterialService; |
| | | |
| | | @Autowired |
| | | private AliDingConfig aliDingConfig; |
| | |
| | | salesDelivery.setSalesman(formData.getString("textField_ladnkyu1"));//业务员 |
| | | salesDelivery.setDeliveryMethod(formData.getString("radioField_ldoc0027"));//发货方式 |
| | | String materialCode = row.getString("textField_l92dg1tc"); |
| | | // 根据物料编码查询物料信息表,关联物料ID |
| | | // if (StringUtils.isNotEmpty(materialCode)) { |
| | | // LambdaQueryWrapper<ProductMaterialSku> skuQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // skuQueryWrapper.eq(ProductMaterialSku::getMaterialCode, materialCode); |
| | | // ProductMaterialSku sku = productMaterialSkuService.getOne(skuQueryWrapper); |
| | | // if (sku != null) { |
| | | // salesDelivery.setProductMaterialSkuId(sku.getId()); |
| | | // } |
| | | // } |
| | | String productName = row.getString("textField_l96srw8x"); |
| | | String model = row.getString("textField_l9tljfl8"); |
| | | // 如果名字为空编码不为空 |
| | | if (StringUtils.isNotEmpty(materialCode) && StringUtils.isEmpty(productName)) { |
| | | LambdaQueryWrapper<ProductMaterialSku> skuQueryWrapper = new LambdaQueryWrapper<>(); |
| | | skuQueryWrapper.eq(ProductMaterialSku::getMaterialCode, materialCode); |
| | | ProductMaterialSku sku = productMaterialSkuService.getOne(skuQueryWrapper); |
| | | if (sku != null) { |
| | | ProductMaterial material = productMaterialService.getById(sku.getProductId()); |
| | | productName=material.getProductName(); |
| | | model=sku.getModel(); |
| | | } |
| | | }else if (StringUtils.isEmpty(productName) && StringUtils.isEmpty(materialCode)){ |
| | | continue; |
| | | } |
| | | salesDelivery.setMaterialCode(materialCode);//物料编码 |
| | | salesDelivery.setProductName(row.getString("textField_l96srw8x"));//产品名称 |
| | | salesDelivery.setModel(row.getString("textField_l9tljfl8"));//产品规格 |
| | | salesDelivery.setProductName(productName);//产品名称 |
| | | salesDelivery.setModel(model);//产品规格 |
| | | salesDelivery.setVolume(row.getBigDecimal("numberField_kt8b0qsg_value"));//方量 |
| | | salesDelivery.setUnitPrice(row.getBigDecimal("numberField_la0tb2x9_value"));//单价 |
| | | salesDelivery.setPrice(row.getBigDecimal("numberField_l9w2piwf"));//价格 |