package com.jwipc.spe.logic.impl;

import com.jwipc.page.PageUtil;
import com.jwipc.page.PageView;
import com.jwipc.spe.convert.SupTemQuotaConvert;
import com.jwipc.spe.logic.SupTemQuotaLogic;
import com.jwipc.spe.model.po.SupTemQuotaPO;
import com.jwipc.spe.model.query.SupAppraiseTemplateQuery;
import com.jwipc.spe.service.ISupTemQuotaService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Al
 * @create 2024-02-29 19:24
 */
@Service
@RequiredArgsConstructor
public class SupTemQuotaLogicImpl implements SupTemQuotaLogic {
    private final ISupTemQuotaService  supTemQuotaService;
    private final SupTemQuotaConvert supTemQuotaConvert;
//不需要分页的页面数据展示
    @Override
    public PageView selectDataByQuery(SupAppraiseTemplateQuery query) {

        List<SupTemQuotaPO> supTemQuotaPOS = supTemQuotaService.findPageByQuery(query);

        return PageUtil.getPV(supTemQuotaConvert.po2PageListDTO(supTemQuotaPOS), supTemQuotaPOS.size());
    }
}
