package com.zcxk.rmcp.web.service.install;

import com.zcxk.core.common.pojo.ResultMessage;
import com.zcxk.core.mysql.pageing.Pagination;
import com.zcxk.rmcp.api.dto.install.InstallDetailDto;
import com.zcxk.rmcp.api.dto.install.InstallPlanInputDto;
import com.zcxk.rmcp.api.query.InstallPlanQueryCondition;
import com.zcxk.rmcp.api.vo.InstallPlanVo;
import com.zcxk.rmcp.api.vo.PlanStatisticsVo;
import com.zcxk.rmcp.core.entity.InstallPlan;
import com.zcxk.rmcp.web.excel.model.ExcelData;
import com.zcxk.rmcp.web.excel.model.InstallPlanExcelData;
import com.zcxk.rmcp.web.excel.model.InstallPlanInfoData;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 
 * @author linqingwei
 * @date 2021-07-21 10:03
 */
public interface InstallPlanService{


    int insertSelective(InstallPlan record);

    int updateByPrimaryKeySelective(InstallPlan record);

    /*
     * @description 获取计划分页
     * @param condition
     * @param pageNum
     * @param pageSize
     * @return com.zcxk.core.mysql.pageing.Pagination<com.zcxk.rmcp.api.vo.InstallPlanVo>
     * @author linqingwei
     **/
    Pagination<InstallPlanVo> getPage(InstallPlanQueryCondition condition, int pageNum, int pageSize);

    /*
     * @description 添加计划
     * @param installPlanInput
     * @return void
     * @author linqingwei
     **/
    void add(InstallPlanInputDto installPlanInput);

    /*
     * @description 批量删除
     * @param ids
     * @return void
     * @author linqingwei
     **/
    void batchDelete(List<Integer> ids);

    /*
     * @description 全部删除
     * @param condition
     * @return void
     * @author linqingwei
     **/
    void allDel(InstallPlanQueryCondition condition);

    /*
     * @description 获取计划详情
     * @param id
     * @return com.zcxk.rmcp.api.dto.install.InstallDetailDto
     * @author linqingwei
     **/
    InstallDetailDto getInstallDetail(Integer id);

    /*
     * @description 下载计划模板
     * @param response
     * @return void
     * @author linqingwei
     **/
    void downPlanTemplate(HttpServletResponse response);

    /*
     * @description 下载安表模板
     * @param id 计划id
     * @param response
     * @return void
     * @author linqingwei
     **/
    void downInstallMeterTemplate(Integer id, HttpServletResponse response);

    /*
     * @description Excel创建计划
     * @param excelData
     * @return com.zcxk.rmcp.core.entity.InstallPlan
     * @author linqingwei
     **/
    InstallPlan createPlanExcel(ExcelData excelData);

    /*
     * @description 处理Excel数据
     * @param data
     * @param excelData
     * @return com.zcxk.core.common.pojo.ResultMessage
     * @author linqingwei
     **/
    ResultMessage handleExcelData(InstallPlanExcelData data, ExcelData excelData);

    /*
     * @description 保存excel数据
     * @param excelData
     * @return void
     * @author linqingwei
     **/
    void saveExcelData(ExcelData excelData);

    PlanStatisticsVo statistics(Integer id);
}
