xuhy
2025-03-12 5f0cb7bfdfbbca6ff22f02ce27c43a4b41ca6bfb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.ruoyi.system.service;
 
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.dto.*;
import com.ruoyi.system.model.TBill;
import com.ruoyi.system.query.TBillQuery;
import com.taxi591.bankapi.dto.ChargeBillRequest;
 
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
 
import java.util.List;
 
/**
 * <p>
 * 租金账单 服务类
 * </p>
 *
 * @author xiaochen
 * @since 2025-01-17
 */
public interface TBillService extends IService<TBill> {
 
    PageInfo<TBillDto> queryPage(TBillQuery query);
 
    /**
     *
     * 更新类型  1.仅更新信息及状态 2.更新金额及状态
     * 为1时,仅更新非金额之外的信息及状态
     * 为2时,传入的金额,是需要增加或减少的金额,非计算后的金额
     * 当账单状态为已缴费后,不做任何更新
     * @param tBill
     * @param type
     * @return
     */
    TBill lockAndUpdateInfo(TBill tBill,Integer type);
 
    /**
     * 批量对账单进行金额的分配
     * @param billIds
     * @param amount 支付的总金额,元
     * @param consumer 处理完账单后的回调,参数是处理完成后,最新的bill信息
     * @return
     */
    Boolean lockAndUpdateByAmountBatch(List<TBill> billIds, BigDecimal amount, Consumer<TBill> consumer);
 
 
    void saveBill(TbillSaveDto bill);
 
    boolean checkOfflinePay(OfflinePayCheckDto dto);
 
    void completePay(ChargeBillRequest billRequest);
 
    /**
     * 查询账单id列表
     * @param query
     * @return
     */
    List<String> getBillIds(TBillQuery query);
 
    /**
     * 查询开票列表
     * @param query
     * @return
     */
    PageInfo<TBillDto> invoiceList(TBillQuery query);
 
    /**
     * 根据发票编号查询账单列表
     * @param invoiceId
     * @return
     */
    PageInfo<TBillDto> getBillByInvoiceId(String invoiceId);
 
    Integer sendSmsByBillIds(SmsByBillDto dto);
 
    Integer sendMailBatchByBillIds(SmsByBillDto dto);
 
    TBillDto getDetailByBillId(@NotEmpty String id);
 
    Boolean cashPay(CachPayDto offlinePayDto);
 
    BillStatisticsDto statistics();
 
    Integer batchBillCount(String userId, List<String> billIds);
}