package com.jwipc.finance.logic.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwipc.finance.dto.PaymentNoticeDTO;
import com.jwipc.finance.entity.PaymentNotice;
import com.jwipc.finance.entity.PaymentReceipt;
import com.jwipc.finance.logic.PaymentReceiptLogic;
import com.jwipc.finance.model.po.PaymentNoticePO;
import com.jwipc.finance.model.query.PaymentReceiptQuery;
import com.jwipc.finance.service.IPaymentReceiptService;
import com.jwipc.page.PageUtil;
import com.jwipc.page.PageView;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shenyang.ou
 * @date 2025/12/5 16:52
 * @desc
 */
@Service
@RequiredArgsConstructor
public class PaymentReceiptLogicImpl implements PaymentReceiptLogic {
    private final IPaymentReceiptService paymentReceiptService;
    @Override
    public PageView findByPage(PaymentReceiptQuery query) {
        final Page<PaymentReceipt> dbPage = PageUtil.toPage(query);
        List<PaymentReceipt> priceInfoAuditPOS = paymentReceiptService.findPageByQuery(dbPage, query);
        return PageUtil.getPV(priceInfoAuditPOS, dbPage==null?0:dbPage.getTotal());
    }
}
