package com.skr.mdm.api.system.service.impl;

import com.github.pagehelper.PageHelper;
import com.skr.mdm.api.system.service.MdmImportHistoryService;
import com.skr.mdm.bean.qo.system.MdmImportHistoryPageQO;
import com.skr.mdm.dao.MdmImportHistoryDao;
import com.skr.mdm.dto.LoginAdminDTO;
import com.skr.mdm.result.ResponseResult;
import com.skr.mdm.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author nfq
 * @date 2023-02-22 9:21
 */
@Service
public class MdmImportHistoryServiceImpl implements MdmImportHistoryService {

    @Autowired
    private MdmImportHistoryDao importHistoryDao;

    @Override
    public ResponseResult listImportHistory(MdmImportHistoryPageQO importHistoryPageQO, LoginAdminDTO loginAdminDTO) {
        importHistoryPageQO.setCompanyId(loginAdminDTO.getCompanyId());
        PageHelper.startPage(importHistoryPageQO.getPageNum(), importHistoryPageQO.getPageSize());
        return ResponseResult.success(PageUtil.getPageResult(importHistoryDao.listMdmImportHistoryVO(importHistoryPageQO)));
    }
}
