package org.jeecg.modules.ai.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.jeecg.modules.ai.entity.PreReviewRecordsDetail;
import org.jeecg.modules.ai.mapper.PreReviewRecordsDetailMapper;
import org.jeecg.modules.ai.qo.PreReviewRecordsDetailQuery;
import org.jeecg.modules.ai.service.IPreReviewRecordsDetailService;
import org.jeecg.modules.ai.vo.PreReviewRecordsDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 办事预审记录详情
 * @Author: jeecg-boot
 * @Date:   2023-11-25
 * @Version: V1.0
 */
@Service
public class PreReviewRecordsDetailServiceImpl extends ServiceImpl<PreReviewRecordsDetailMapper, PreReviewRecordsDetail> implements IPreReviewRecordsDetailService {

	@Resource
	private PreReviewRecordsDetailMapper preReviewRecordsDetailMapper;
	
	/**
	 * 根据参数关联查询事项信息
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	@Override
	public IPage<PreReviewRecordsDetailVo> getPreReviewRecordsDetailList(Page page, PreReviewRecordsDetailQuery query){
		return preReviewRecordsDetailMapper.getPreReviewRecordsDetailList(page, query);
	}
	
	/**
	 * 获取已提交的资料信息
	 * @param eventCode
	 * @param userId
	 * @return
	 */
	@Override
	public List<PreReviewRecordsDetailVo> getSubmittedMaterialList(String eventCode,String userId){
		//获取已提交事项
		PreReviewRecordsDetailQuery query = new PreReviewRecordsDetailQuery();
		query.setUserId(userId);
		query.setEventCode(eventCode);
		query.setReviewResult("通过");
		return preReviewRecordsDetailMapper.getPreReviewRecordsDetailList(query);
	}
}
