Browse Source

问题处理

yzc 1 year ago
parent
commit
22e9c9cc4e

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -337,6 +337,11 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
                     quotationProductBom.setProductId(quotationProductDto.getProductId());
                     quotationProductBom.setQuotationProductId(quotationProductDto.getId());
                     quotationProductBom.setSaleQuotationId(saleQuotationDto.getId());
+
+                    //如果是原材料,且数量为空默认赋值1
+                    if (ObjectUtil.equals(quotationProductBom.getType(), 1) && ObjectUtil.isEmpty(quotationProductBom.getQuantity())) {
+                        quotationProductBom.setQuantity(BigDecimal.ONE);
+                    }
                 }
                 quotationProductBomService.editLinked(quotationProductBomList, QuotationProductBom::getQuotationProductId, quotationProductDto.getId());