云
4 天以前 f02d0df2f1dfc7a8b775cf50d45375e57628a5ef
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java
@@ -5,6 +5,7 @@
import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.receivable.CrmReceivableSaveReqVO;
import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableItemDO;
import jakarta.validation.Valid;
import java.math.BigDecimal;
@@ -37,12 +38,29 @@
    void updateReceivable(@Valid CrmReceivableSaveReqVO updateReqVO);
    /**
     * 更新回款流程审批结果
     * 提交回款审批(创建 BPM 流程实例)
     *
     * @param id        回款编号
     * @param id     编号
     * @param remark 审批备注,可为空
     * @param userId 发起人编号
     */
    void submitReceivable(Long id, String remark, Long userId);
    /**
     * 更新回款审批结果(由 BPM 流程状态监听器调用)
     *
     * @param id        编号
     * @param bpmResult BPM 审批结果
     */
    void updateReceivableAuditStatus(Long id, Integer bpmResult);
    /**
     * 更新回款的状态(审核/反审核)
     *
     * @param id     编号
     * @param status 状态
     */
    void updateReceivableStatus(Long id, Integer status);
    /**
     * 删除回款
@@ -50,14 +68,6 @@
     * @param id 编号
     */
    void deleteReceivable(Long id);
    /**
     * 发起回款审批流程
     *
     * @param id     回款编号
     * @param userId 用户编号
     */
    void submitReceivable(Long id, Long userId);
    /**
     * 获得回款
@@ -74,6 +84,22 @@
     * @return 回款列表
     */
    List<CrmReceivableDO> getReceivableList(Collection<Long> ids);
    /**
     * 获得回款的核销明细
     *
     * @param receivableId 回款编号
     * @return 核销明细列表
     */
    List<CrmReceivableItemDO> getReceivableItemList(Long receivableId);
    /**
     * 获得客户下全部回款的核销明细
     *
     * @param customerId 客户编号
     * @return 核销明细列表(按回款倒序)
     */
    List<CrmReceivableItemDO> getReceivableItemListByCustomerId(Long customerId);
    /**
     * 获得回款 Map
@@ -123,6 +149,14 @@
    Map<Long, BigDecimal> getReceivablePriceMapByContractId(Collection<Long> contractIds);
    /**
     * 获得开票已回款金额 Map(草稿 + 审批中 + 审批通过)
     *
     * @param invoiceIds 开票编号
     * @return 已回款金额 Map
     */
    Map<Long, BigDecimal> getReceivablePriceMapByInvoiceId(Collection<Long> invoiceIds);
    /**
     * 根据合同编号查询回款数量
     *
     * @param contractId 合同编号
@@ -130,4 +164,27 @@
     */
    Long getReceivableCountByContractId(Long contractId);
    /**
     * 根据合同编号查询已回款金额
     *
     * @param contractId 合同编号
     * @return 已回款金额
     */
    BigDecimal getReceivablePriceByContractId(Long contractId);
    /**
     * 获取总回款金额
     *
     * @return 总回款金额
     */
    BigDecimal getReceivablePriceSum();
    /**
     * 根据负责人查询回款金额
     *
     * @param ownerUserId 负责人编号
     * @return 回款金额
     */
    BigDecimal getReceivablePriceByOwnerUserId(Long ownerUserId);
}