puzhibing
2026-09-29 a70433b2ee5bb37823ab73422a01251343cb5f58
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/TCompanyAllocateRecordService.java
@@ -46,4 +46,28 @@
     */
    boolean recordConsume(Integer companyId, Integer userType, String userInfo, String userName,
                          BigDecimal beforeBalance, BigDecimal amount, String chargingOrderCode, String remark);
    /**
     * 写入一条消费流水(结算场景,允许金额为 0)。
     * <p>与 {@link #recordConsume} 语义一致,仅放开「金额为0不写流水」限制:
     * 0 消费订单同样需要落一条流水,作为「该订单已结算」的幂等标记,
     * 保证结算失败回退后的补偿重试不会重复结算(同事务写入)。</p>
     *
     * @return 是否写入成功(已存在视为成功)
     */
    boolean recordSettleConsume(Integer companyId, Integer userType, String userInfo, String userName,
                                BigDecimal beforeBalance, BigDecimal amount, String chargingOrderCode, String remark);
    /**
     * 判断指定充电订单是否已在账户侧落消费流水(结算幂等判定使用)
     */
    boolean existsConsumeRecord(String chargingOrderCode);
    /**
     * 批量查询已落消费流水的订单号集合(订单侧兜底扫描判定使用)
     *
     * @param orderCodes 待判定的充电订单号
     * @return 已存在消费流水的订单号集合,无匹配返回空集合
     */
    java.util.List<String> listConsumedOrderCodes(java.util.List<String> orderCodes);
}