package com.ssj.service.load.data.service.impl;


import com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.sys.homework.domain.StudentWeeklyReport;
import com.ssj.dao.load.data.LoadDataDao;
import com.ssj.framework.core.util.ResponseEntity;
import com.ssj.mapper.load.data.LoadDataMapper;
import com.ssj.service.conch.parents.v2.dto.MonthlyReportDTO;
import com.ssj.service.conch.parents.v2.dto.StudentWeeklyReportDTO;
import com.ssj.service.conch.teacher.library.dto.FeedbackDTO;
import com.ssj.service.es.service.IEsDataRecodeService;
import com.ssj.service.load.data.LoadDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service(version ="1.0")
public class LoadDataServiceImpl   implements LoadDataService {
   @Autowired
    private IEsDataRecodeService esDataRecodeService;

    @Autowired
    private LoadDataDao loadDataDao;

    @Autowired
    private LoadDataMapper loadDataMapper;


    @Override
    public ResponseEntity loadfeedbackHistoryES(String beginDate,String endDate, String indexName, String apiName,int count) {
     //   List<FeedbackDTO> list= loadDataMapper.findFeedbackHistory(beginDate,endDate,new Page<>(1, count));
        return esDataRecodeService.loadDataToEs(beginDate,endDate,indexName,apiName,FeedbackDTO.class,"findFeedbackHistory",count);
    }

    @Override
    public ResponseEntity findWeeklyReportBeginDateAndEndDateES(String beginDate, String endDate, String indexName, String apiName,int count) {
     //   List<StudentWeeklyReport>  list= loadDataMapper.findWeeklyReportBeginDateAndEndDate(beginDate,endDate,new Page<>(1, count));
        return esDataRecodeService.loadDataToEs(beginDate,endDate,indexName,apiName,StudentWeeklyReport.class,"findWeeklyReportBeginDateAndEndDate",count);
    }

    @Override
    public ResponseEntity sconHomeworkCount(String beginDate, String endDate, String indexName, String apiName,int count) {

        return esDataRecodeService.loadDataToEs(beginDate,endDate,indexName,apiName,StudentWeeklyReport.class,"findMonthHomeworkCount",count);
    }

    @Override
    public ResponseEntity loadWeeklyReportHisToES(String beginDate, String endDate, String indexName, String apiName, int count) {
        return esDataRecodeService.loadDataToEs(beginDate,endDate,indexName,apiName,StudentWeeklyReportDTO.class,"findWeeklyReportHistory",count);
    }

    @Override
    public ResponseEntity loadMonthlyReportHistoryToES(String beginDate, String endDate, String indexName, String apiName, int count) {
        return esDataRecodeService.loadDataToEs(beginDate,endDate,indexName,apiName,MonthlyReportDTO.class,"findMonthlyReportHistory",count);
    }

    @Override
    public ResponseEntity loadLearningSituationAbstractToES(String beginDate, String endDate, String indexName, String apiName, int count) {
        return null;
    }
}
