package com.gree.mall.manager.logic.material.manage;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.bean.admin.AdminUserCom;
import com.gree.mall.manager.bean.material.manage.WebsitPartsRefundRecordVO;
import com.gree.mall.manager.commonmapper.MaterialMapper;
import com.gree.mall.manager.logic.common.CommonLogic;
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
import com.gree.mall.manager.zfire.util.FieldUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class WebsitPartsRefundRecordLogic {

    private final CommonLogic commonLogic;
    private final MaterialMapper materialMapper;

    public IPage<WebsitPartsRefundRecordVO> pageList(ZfireParamBean zfireParamBean) {
        AdminUserCom adminUser = commonLogic.getAdminUser();
        FieldUtils.materialParam(zfireParamBean, WebsitPartsRefundRecordVO.class, adminUser);
        IPage<WebsitPartsRefundRecordVO> page = materialMapper.websitPartsRefundRecordPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
        return page;
    }
}
