src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -14,6 +14,7 @@
import com.ruoyi.basic.mapper.CustomerMapper;
import com.ruoyi.basic.pojo.Customer;
import com.ruoyi.common.enums.IsDeleteEnum;
import com.ruoyi.common.utils.AmountUtils;
import com.ruoyi.common.utils.OrderUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
@@ -52,14 +53,33 @@
            return salesQuotationDtoIPage;
        }
        salesQuotationDtoIPage.getRecords().forEach(record -> {
            record.setTotalAmount(AmountUtils.scaleAmount(record.getTotalAmount()));
            List<SalesQuotationProduct> products = salesQuotationProductMapper.selectBySalesQuotationId(record.getId());
            if (!CollectionUtils.isEmpty(products)) {
                products.forEach(product -> {
                    product.setUnitPrice(AmountUtils.scaleAmount(product.getUnitPrice()));
                    product.setAmount(AmountUtils.scaleAmount(product.getAmount()));
                });
            }
            record.setProducts(products);
        });
        return salesQuotationDtoIPage;
    }
    private void normalizeAmounts(SalesQuotationDto salesQuotationDto) {
        salesQuotationDto.setTotalAmount(AmountUtils.scaleAmount(salesQuotationDto.getTotalAmount()));
        if (CollectionUtils.isEmpty(salesQuotationDto.getProducts())) {
            return;
        }
        salesQuotationDto.getProducts().forEach(product -> {
            product.setUnitPrice(AmountUtils.scaleAmount(product.getUnitPrice()));
            product.setAmount(AmountUtils.scaleAmount(product.getAmount()));
        });
    }
    @Override
    public boolean add(SalesQuotationDto salesQuotationDto) {
        normalizeAmounts(salesQuotationDto);
        LoginUser loginUser = SecurityUtils.getLoginUser();
        SalesQuotation salesQuotation = new SalesQuotation();
        BeanUtils.copyProperties(salesQuotationDto, salesQuotation);
@@ -101,6 +121,7 @@
    }
    @Override
    public boolean edit(SalesQuotationDto salesQuotationDto) {
        normalizeAmounts(salesQuotationDto);
        SalesQuotation salesQuotation = new SalesQuotation();
        BeanUtils.copyProperties(salesQuotationDto, salesQuotation);
        ApproveGetAndUpdateVo vo = new ApproveGetAndUpdateVo();