package cn.gov.customs.wxjy.analyze.service.impl;

import cn.gov.customs.wxjy.analyze.pojo.EntryList;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

import com.github.pagehelper.PageInfo;
import cn.gov.customs.wxjy.analyze.dao.GoodsEntryDao;
import cn.gov.customs.wxjy.analyze.pojo.Entry;
import cn.gov.customs.wxjy.analyze.pojo.EntryHead;
import cn.gov.customs.wxjy.analyze.pojo.EntryQuery;
import cn.gov.customs.wxjy.analyze.service.IGoodsEntryService;

/**
 * 危险品报关单头Service业务层处理
 *
 * @author xiong
 * @date 2025-12-04
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class GoodsEntryServiceImpl implements IGoodsEntryService {

    private final GoodsEntryDao mapper;

    /**
     * 查询危险品报关单头
     *
     * @param entryId 危险品报关单头主键
     * @return 危险品报关单头
     */
    @Override
    public EntryHead selectByEntryId(String entryId) {
        return mapper.selectByEntryId(entryId);
    }

    /**
     * 分页查询危险品报关单头列表
     *
     * @param query
     * @return 危险品报关单头
     */
    @Override
    public PageInfo<Entry> selectPageList(EntryQuery query) {
        return PageInfo.of(mapper.selectPageList(query));
    }

    @Override
    public List<EntryList> getEntryList(String entryId) {
        return this.mapper.getEntryList(entryId);
    }

    /**
     * 导出危险品报关单头列表
     *
     * @param query
     * @return 危险品报关单头
     */
    @Override
    public List<Entry> exportList(EntryQuery query) {
        return mapper.selectPageList(query);
    }
}
