package net.northking.cctp.dw.api.service;

import net.northking.cctp.dw.db.entity.MidProjectInfo;
import net.northking.cctp.dw.db.entity.MtTestChart;
import net.northking.cctp.dw.dto.ChartProgressQueryDto;
import net.northking.cctp.dw.dto.MtTestChartDto;
import net.northking.cctp.dw.dto.ProjectDataVo;

import java.util.Date;
import java.util.List;

/**
 * @author: puchao.ma
 * @date: 2021/12/15 16:16
 */
public interface ChartApiService {
    void addBatchTestChart(List<MtTestChart> pointProgress);

    /**
     * 根据系统id和类型查询进度数据
     * @param queryDto
     * @return
     */
    List<MtTestChartDto> queryChartProgress(ChartProgressQueryDto queryDto);

    /**
     * 总体测试报告
     * @return
     */
    List<MtTestChart> createOverallTestReportProgress();

    void deleteTodayData(String tenantId);

    void deleteByPrimaryKeys(List<Object> chartIds);

    List<MtTestChart> queryToday(List<MidProjectInfo> midProjectInfos);

    /**
     * 进度图数据处理
     * @param projectId
     * @param planAmount
     * @param startTime
     * @param endTime
     * @param testType
     */
    void progressDataDeal(String projectId, Integer planAmount, Date startTime, Date endTime, Integer testType);

    /**
     * 修改总进度数据
     *
     * @param projectId
     */
    void progressDataDeal(String projectId);

    /**
     * 若未设置计划数或者时间，则删除数据
     * @param projectId
     * @param detailType
     */
    void deleteByProjectIdAndDetailType(String projectId, Integer detailType);

    List<MtTestChart> findMaxDateGroupByProId(Integer testType);

    Integer queryTodayDeleted(List<MidProjectInfo> dataList);

    List<ProjectDataVo> getProjectIds(String tenantId);

    List<String> getNoDeletedProjectIds(String tenantId);
}
