gaoluyang
7 天以前 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/quotation/listener/CrmSaleQuotationStatusListener.java
@@ -11,12 +11,10 @@
import org.springframework.stereotype.Component;
/**
 * 销售报价审批的结果监听器实现类
 * 销售报价审批的结果监听器
 *
 * 通过 businessKey(报价单ID)匹配,而不是固定的流程定义 Key,
 * 这样可以支持分类下任意 Key 的流程模型。
 *
 * @author 芋道源码
 * 通过 businessKey(报价单 ID)匹配,而不是固定的流程定义 Key,
 * 这样可以支持「销售报价审批」分类下任意 Key 的流程模型。
 */
@Component
@Slf4j
@@ -37,20 +35,18 @@
            return; // businessKey 不是数字,忽略
        }
        CrmSaleQuotationDO saleQuotation = saleQuotationMapper.selectById(quotationId);
        if (saleQuotation == null) {
            return; // 不是销售报价,忽略
        CrmSaleQuotationDO quotation = saleQuotationMapper.selectById(quotationId);
        if (quotation == null) {
            return; // 不是报价单,忽略
        }
        // 只有审批中状态的报价单才处理
        if (!CrmSaleQuotationStatusEnum.PROCESS.getStatus().equals(saleQuotation.getStatus())) {
            log.warn("[onApplicationEvent] 销售报价单({}) 不处于审批中状态,当前状态: {}", quotationId, saleQuotation.getStatus());
        if (!CrmSaleQuotationStatusEnum.PROCESS.getStatus().equals(quotation.getStatus())) {
            log.warn("[onApplicationEvent] 报价单({}) 不处于审批中状态,当前状态: {}", quotationId, quotation.getStatus());
            return;
        }
        log.info("[onApplicationEvent] 销售报价单({}) 审批状态更新: {}", quotationId, event.getStatus());
        // 更新审批状态
        log.info("[onApplicationEvent] 报价单({}) 审批状态更新: {}", quotationId, event.getStatus());
        saleQuotationService.updateSaleQuotationAuditStatus(quotationId, event.getStatus());
    }
}
}