src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -13,6 +13,7 @@
import com.ruoyi.approve.vo.ApproveProcessVO;
import com.ruoyi.common.utils.OrderUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.common.utils.uuid.UUID;
import com.ruoyi.framework.security.LoginUser;
@@ -60,12 +61,13 @@
    @Override
    public boolean add(SalesQuotationDto salesQuotationDto) {
        boolean isApprove = StringUtils.isNotEmpty(salesQuotationDto.getApproveUserIds()) ? true : false;
        LoginUser loginUser = SecurityUtils.getLoginUser();
        SalesQuotation salesQuotation = new SalesQuotation();
        BeanUtils.copyProperties(salesQuotationDto, salesQuotation);
        String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT");
        salesQuotation.setQuotationNo(quotationNo);
        salesQuotation.setStatus("待审批");
        salesQuotation.setStatus(isApprove ? "待审批" : "通过");
        salesQuotationMapper.insert(salesQuotation);
        if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){
            return true;
@@ -77,6 +79,8 @@
            return salesQuotationProduct;
        }).collect(Collectors.toList());
        salesQuotationProductService.saveBatch(products);
        // 审核人不为空
        if(isApprove){
        // 报价审批
        ApproveProcessVO approveProcessVO = new ApproveProcessVO();
        approveProcessVO.setApproveType(6);
@@ -92,6 +96,7 @@
            log.error("SalesQuotationServiceImpl error:{}", e);
            throw new RuntimeException("审批失败");
        }
        }
        return true;
    }
    @Override