package digital.laboratory.platform.inspection.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.core.util.R;
import digital.laboratory.platform.inspection.dto.ExportSewageAnalystReportsDTO;
import digital.laboratory.platform.inspection.dto.SewageDataDto;
import digital.laboratory.platform.inspection.dto.TaskInfoDto;
import digital.laboratory.platform.inspection.entity.TaskInfo;
import digital.laboratory.platform.sewage.vo.SewageJobIdentificationMaterialVO;

import java.time.LocalDate;
import java.io.IOException;
import java.util.List;

/*
 *@title EntrustInfoService
 *@description
 *@author xy
 *@version 1.0
 *@create 2023/12/7 15:31
 */
public interface TaskInfoService extends IService<TaskInfo> {

    /**
     * 根据目标任务的开始时间进行排序 取4个任务的id
     * @param targetTask
     * @return
     */
    List<TaskInfo> getTaskIdByOrderStartTimeLimit4(TaskInfo targetTask);

    TaskInfo addTaskInfo(TaskInfoDto taskInfo);//添加任务信息
    TaskInfo updateTaskInfo(TaskInfo taskInfo);//修改任务信息
    Boolean deleteTaskInfo(String id);//删除任务信息
    IPage getTaskPageList(Page page, TaskInfo taskInfo,String keywords);
    List<TaskInfo> getTaskList(TaskInfo taskInfo,String keywords);
    Boolean checkExist(String id);

    void createUploadItem(List<String> sampleNos);

    List<SewageDataDto> createSewageReportData(String taskId, Double dailySmokingPerCapita);

    /**
     * 根据污水任务检材列表和人均日吸烟 处理报表数据，最后返回数据列表
     * @param dailySmokingPerCapita
     * @param voList
     * @return
     */
    List<SewageDataDto> processSewageDataDtos(Double dailySmokingPerCapita, List<SewageJobIdentificationMaterialVO> voList);

//    String createSewageReportExcel(List<SewageDataDto> sewageDataDtos) throws IOException;

    /**
     * 导出污水专项检测毒品分析报告
     * @param dto
     * @return
     */
    R exportSewageAnalystReports(ExportSewageAnalystReportsDTO dto);
    String createSewageReportExcel(List<SewageDataDto> sewageDataDtos,String id) throws IOException;
}
