package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;

import java.util.List;

/**
 * @author licancan
 * @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service
 * @date 2022-07-18 16:20:16
 */
public interface TInsuranceDetailService extends IService<TInsuranceDetail> {

	/***********************商险办理********************************/

	/**
	 * 每日定时刷新商险到期数据
	 *
	 * @author licancan
	 * @param
	 * @return void
	 */
	void updateOverdueByTask();

	/**
	 * EKP2INSURANCES 更新结算状态
	 *
	 * @author licancan
	 * @param param
	 * @return {@link R<String>}
	 */
	R<String> updateInsuranceSettle(UpdateInsuranceSettleParam param);

	/**
	 * 投保分页查询
	 *
	 * @author licancan
	 * @param page
	 * @param param
	 * @return {@link IPage<InsuranceListVO>}
	 */
	IPage<InsuranceListVO> getInsuranceListPage(Page<InsuranceListVO> page, InsuranceListParam param);

	/**
	 * 投保不分页查询
	 *
	 * @author licancan
	 * @param param
	 * @return {@link R<List<InsuranceListVO>>}
	 */
	R<List<InsuranceListVO>> getInsuranceList(InsuranceListParam param);

	/**
	 * 投保办理分页查询
	 *
	 * @author licancan
	 * @param page
	 * @param param
	 * @return {@link IPage<InsuranceListVO>}
	 */
	IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param);

	/**
	 * 商险新增
	 *
	 * @author licancan
	 * @param paramList
	 * @return {@link R<List<InsuranceAddParam>>}
	 */
	R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo);

	/**
	 * 商险批增
	 *
	 * @author licancan
	 * @param paramList
	 * @return {@link R<List<InsuranceBatchParam>>}
	 */
	R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo);
	/**
	 * 商险替换
	 *
	 * @author licancan
	 * @param paramList
	 * @return {@link R<List<InsuranceReplaceParam>>}
	 */
	R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo);

	/**
	 * 通过id删除
	 *
	 * @author licancan
	 * @param id
	 * @return {@link R<String>}
	 */
	R<String> deleteInsurance(String id);

	/**
	 * 编辑
	 *
	 * @author licancan
	 * @param param
	 * @return {@link R<String>}
	 */
	R<String> editInsurance(InsuranceEditParam param);

	/**
	 * 通过id查询
	 *
	 * @author licancan
	 * @param id
	 * @return {@link InsuranceDetailVO}
	 */
	InsuranceDetailVO getInsuranceDetailById(String id);

	/**
	 * 通过商险id查询操作记录
	 *
	 * @author licancan
	 * @param id
	 * @return {@link List<TInsuranceOperate>}
	 */
	List<TInsuranceOperate> getInsuranceOperateList(String id);

	/**
	 * 导出办理
	 *
	 * @author licancan
	 * @param param
	 * @return {@link R<List<InsuranceExportListVO>>}
	 */
	R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param);

	/**
	 * 投保退回
	 *
	 * @author licancan
	 * @param user
	 * @param paramList
	 * @return {@link R<List<InsuranceListVO>>}
	 */
	R<List<InsuranceListVO>> rollBackInsurance(YifuUser user, List<InsuranceHandleParam> paramList);

	/**
	 * 投保成功/退回办理导入
	 *
	 * @author licancan
	 * @param user
	 * @param param
	 * @return {@link R<List<InsuranceHandleImportParam>>}
	 */
	R<List<InsuranceHandleImportParam>> insuranceHandleImport(YifuUser user,List<InsuranceHandleImportParam> param);

	/**
	 * 办理成功
	 *
	 * @author licancan
	 * @param user
	 * @param paramList
	 * @return {@link R<List<InsuranceListVO>>}
	 */
	R<List<InsuranceListVO>> successfulInsurance(YifuUser user, List<InsuranceHandleParam> paramList);

	/**
	 * 登记保单保费
	 *
	 * @author licancan
	 * @param paramList
	 * @return {@link R<List<InsuranceRegisterParam>>}
	 */
	R<List<InsuranceRegisterParam>> registeredPolicyPremium(List<InsuranceRegisterParam> paramList);

	/***********************减员办理********************************/

	/**
	 * 减员导入
	 *
	 * @author zhaji
	 * @param insuranceRefundCheckList 减员表
	 * @return {@link R}
	 */
	R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList,String orderNo);

	/**
	 * 已投保列表分页查询
	 *
	 * @author zhaji
	 * @param page 分页参数
	 * @param param 查询参数
	 * @return {@link IPage< InsuredListVo>}
	 */
	IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param);

	/**
	 * 已投保列表不分页查询
	 *
	 * @author zhaji
	 * @param param 查询参数
	 * @return {@link List< InsuredListVo>}
	 */
	R getInsuredList(InsuredParam param);

	/**
	 * 已减员列表分页查询
	 *
	 * @author zhaji
	 * @param page 分页数据
	 * @param param 查询参数
	 * @return {@link IPage<  InsuranceRefundListVo >}
	 */
	R  getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param);

	/**
	 * 已减员列表导出
	 *
	 * @author zhaji
	 * @param param 查询参数
	 * @return {@link List<  InsuranceRefundListVo >}
	 */
	R getInsuranceRefundList(InsuranceRefundParam param);

	/**
	 * 减员办理列表分页查询
	 *
	 * @author zhaji
	 * @param page 分页数据
	 * @param param 查询参数
	 * @return {@link IPage<  RefundExportListVo >}
	 */
	IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param);

	/**
	 * 减员办理列表不分页查询
	 *
	 * @author zhaji
	 * @param param 查询参数
	 * @return {@link List<  RefundExportListVo >}
	 */
	R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param);

	/**
	 * 减员办理
	 *
	 * @author zhaji
	 * @param insuranceDetail 办理类
	 * @return {@link R}
	 */
	R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail);

	/**
	 * 减员办理导入
	 *
	 * @author zhaji
	 * @param insuranceRefundImportList 减员办理导入
	 * @return {@link R}
	 */
	R insuranceRefundImport(List<InsuranceHandleImportParam> insuranceRefundImportList);


	/**
	 * 变更结算月
	 *
	 * @author zhaji
	 * @param settleMonthCheckList 变更列表
	 * @return {@link R}
	 */
	R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList);

	/**
	 * 变更所属项目
	 *
	 * @author zhaji
	 * @param deptChangeCheckList 变更列表
	 * @return {@link R}
	 */
	R deptChange(List<DeptChangeCheckParam> deptChangeCheckList);

	/**
	 * 根据保险公司名称查询保单明细
	 *
	 * @author zhaji
	 * @param companyName 保险公司名称
	 * @return {@link R}
	 */
	R selectByCompanyName(String companyName);

	/**
	 * 根据险种id查询保单明细
	 *
	 * @author zhaji
	 * @param id
	 * @return {@link R}
	 */
	R selectByTypeId(String id);

	/**
	 * 出险
	 *
	 * @author zhaji
	 * @param id
	 * @return {@link R}
	 */
	R updateIsUse(String id);

	/**
	 * 更新减员退费
	 *
	 * @author zhaji
	 * @param paramList
	 * @return {@link R}
	 */
	R updateRefundMoney(List<RefundMoneyParam> paramList);

	/**
	 * 查询项目列表
	 *
	 * @author zhaji
	 * @param
	 * @return {@link R}
	 */
	R getDeptList();

	/**
	 * 获取当前登录人的项目列表
	 *
	 * @author zhaji
	 * @param
	 * @return {@link R}
	 */
	R getDeptListByUser();

	/**
	 * EKP紧急出险
	 *
	 * @author zhaji
	 * @param empIdcardNo
	 * @return {@link R}
	 */
	R urgentUpdateIsUse(String empIdcardNo);

	/**
	 * 根据身份证查询商险列表
	 *
	 * @author huyc
	 * @param
	 * @return {@link R}
	 */
	IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard,String deptNo);

	/**
	 * 新增订单商险
	 *
	 * @author zhaji
	 * @param paramList
	 * @return {@link R< List< InsuranceReplaceParam>>}
	 */
	R<List<InsuranceAddParam>> addOrderInsurance(InsuranceListOrderParam paramList);

	/**
	 * 批增订单商险
	 *
	 * @author zhaji
	 * @param paramList
	 * @return {@link R< List< InsuranceBatchParam>>}
	 */
	R<List<InsuranceBatchParam>> batchOrderInsurance(InsuranceOrderBatchParam paramList);

	/**
	 * 替换订单商险
	 *
	 * @author zhaji
	 * @param paramList
	 * @return {@link R< List< InsuranceReplaceParam>>}
	 */
	R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList);

	R refundOrderInsurance(InsuranceOrderRefundParam paramList);

	/**
	 * 订单商险列表查询
	 *
	 * @author zhaji
	 * @param page
	 * @param param
	 * @return {@link IPage< InsuredOrderListVo>}
	 */
	R getOrderInsuredListPage(Page<InsuredOrderListVo> page, InsuredOrderParam param);

	SettleVo getInsuranceDetailSettleStatus(String detailId, String defaultSettleId);
}
