package org.sky.scientific.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import jakarta.servlet.http.HttpServletResponse;
import org.sky.core.mp.base.BaseService;
import org.sky.scientific.excel.TechnicianExcel;
import org.sky.scientific.pojo.dto.TechnicianDTO;
import org.sky.scientific.pojo.dto.XmSalaryDto;
import org.sky.scientific.pojo.dto.XmTechnicianDto;
import org.sky.scientific.pojo.entity.TechnicianEntity;
import org.sky.scientific.pojo.entity.XmTechnicianEntity;
import org.sky.scientific.pojo.vo.*;

import java.util.HashMap;
import java.util.List;

/**
 * 技术人员花名册 服务类
 *
 * @author sky
 * @since 2025-06-10
 */
public interface ITechnicianService extends BaseService<TechnicianEntity> {

	/**
	 * 新增
	 * @param technician
	 * @return
	 */
	boolean saveOrUpdateTechnician(TechnicianEntity technician);

	/**
	 * 自定义分页
	 *
	 * @param page 分页参数
	 * @param technician 查询参数
	 * @return IPage<TechnicianVO>
	 */
	IPage<TechnicianVO> selectTechnicianPage(IPage<TechnicianVO> page, TechnicianDTO technician);


	/**
	 * 导出数据
	 *
	 * @param technician 查询条件
	 * @return List<TechnicianExcel>
	 */
	void exportTechnician(HttpServletResponse response, TechnicianDTO technician);

	/**
	 * 导入
	 * @param data
	 * @param yearAndMonth 月份，2025-05
	 */
	void importTechnician(List<TechnicianExcel> data, String yearAndMonth);

	/**
	 * 读取上个月人员名单
	 * @param technician
	 * @return
	 */
	boolean fetchLastMonthData(TechnicianEntity technician);

	/*
		批量删除
	 */
	boolean batchDelete(List<TechnicianEntity> list);

	/**
	 * 每月实际参研人员名单-直接引用预算表名单
	 * @param dto
	 * @return
	 */
	void zhijieyinyongyusuanbiaomingdan(String yearAndMonth);


	/**
	 * 每月实际参研人员名单-分页
	 * @param entity
	 * @param page
	 * @return
	 */
	IPage<XmTechnicianEntity> meiyueshijicanyuanrenyuanmingdan(IPage<XmTechnicianEntity> page,XmTechnicianDto entity);

	/**
	 * 每月实际参研人员名单-新增或修改
	 * @param entity
	 * @return
	 */
	boolean submitXmTechnicianMonthly(XmTechnicianEntity entity);

	/**
	 * 每月实际参研人员名单-删除
	 * @param ids
	 * @return
	 */
	boolean physicalDeleteXmTechnicianMonthlyByIds(List<Long> ids);

	/**
	 * 每月实际参研人员名单-导出
	 */
	void exportXmTechnicianMonthly(HttpServletResponse response,XmTechnicianDto dto);

	/**
	 * 分页-主要用于查询项目周期内的技术人员数据,传入项目的开始和结束日期，startDate, endDate, 格式：20250509
	 * @param page
	 * @param param
	 * @return
	 */
	IPage<TechnicianEntity> selectTechnicianPageByDateInterval(IPage<TechnicianEntity> page, HashMap<String,String> param);

	/**
	 * 项目参研人员汇总表
	 * @param page
	 * @param entity
	 * @return
	 */
	IPage<XmTechnicianSummary> xiangmucanyanrenyuanhuizongbiao(IPage<XmTechnicianSummary> page, XmTechnicianEntity entity);


	/**
	 * 参研人员花名册
	 * @param page
	 * @param entity
	 * @return
	 */
	IPage<XmTechnicianVO> canyanrenyuanhuamingce(IPage<XmTechnicianVO> page, XmTechnicianDto entity);

	/**
	 * 年度科技人员汇总表
	 */
	IPage<TechnicianVO> niandugaokejirenyuanhuizongbiao(IPage<TechnicianVO> page, TechnicianDTO dto);

	/**
	 * 月度研发人员人工费用分配表
	 * @param page
	 * @param dto
	 * @return
	 */
	IPage<XmTechnicianSalaryVO> meiyueyanfarengongfeiyongfeifenpeibiao(IPage<XmTechnicianSalaryVO> page, XmTechnicianDto dto);

	/**
	 * 每月研发项目人工分配汇总表-按月
	 * @param page
	 * @param dto
	 * @return
	 */
	IPage<XmSalaryVO> meiyueyanfaxiangmurengongfenpeihuizongbiao(IPage<XmSalaryVO> page, XmSalaryDto dto);

	void exportCyryhmc(HttpServletResponse response, XmTechnicianDto dto);

	void exportXmcyryhzb(HttpServletResponse response, XmTechnicianEntity dto);

	void exportNdgkjryhzb(HttpServletResponse response, TechnicianDTO dto);
}
