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.AccountStatement;
import com.jwipc.finance.entity.PaymentNotice;
import com.jwipc.finance.logic.ImgCodeLogic;
import com.jwipc.finance.model.po.ImgCodePO;
import com.jwipc.finance.model.po.PaymentNoticePO;
import com.jwipc.finance.model.query.ImgCodeQuery;
import com.jwipc.finance.service.IAccountStatementService;
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/10/29 15:56
 * @desc
 */
@Service
@RequiredArgsConstructor
public class ImgCodeLogicImpl implements ImgCodeLogic {
    private final IAccountStatementService accountStatementService;
    @Override
    public PageView findByPage(ImgCodeQuery query) {
        final Page<AccountStatement> dbPage = PageUtil.toPage(query);
        List<ImgCodePO> priceInfoAuditPOS = accountStatementService.findImgCodePage(dbPage, query);
        return PageUtil.getPV(priceInfoAuditPOS, dbPage.getTotal());
    }

    @Override
    public List<ImgCodePO> listAll(ImgCodeQuery query) {
        return accountStatementService.findImgCodePage(null, query);
    }
}
