package jnpf.personnels.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.model.cultivate.req.paper.SavePaperReq;
import jnpf.model.personnels.dto.staff.employment.FtbPersonnelsEmployApplyDto;
import jnpf.model.personnels.dto.staff.employment.FtbPersonnelsStaffEmploymentApplyDto;
import jnpf.model.personnels.po.FtbPersonnelsStaffEmploymentApply;
import jnpf.model.personnels.req.employment.*;
import jnpf.model.personnels.vo.app.FtbPersonnelsBubbleCountVO;
import jnpf.model.personnels.vo.employment.AddStaffEmploymentApplyExcelERRVO;
import jnpf.model.personnels.vo.employment.AddStaffEmploymentApplyExcelVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface FtbPersonnelsStaffEmploymentApplyService extends IService<FtbPersonnelsStaffEmploymentApply> {

    /**
     * 查询列表
     *
     * @param req
     * @return
     */
    PageInfo<FtbPersonnelsStaffEmploymentApplyDto> getPageList(QueryStaffEmploymentApplyListReq req);

    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    FtbPersonnelsStaffEmploymentApplyDto getInfo(String id);

    /**
     * 新增
     *
     * @param req
     */
    String insertData(AddStaffEmploymentApplyReq req);

    /**
     * 修改
     *
     * @param req
     */
    void updateData(SavePaperReq req);

    /**
     * 删除
     *
     * @param id 主键
     */
    void deleteData(String id);

    /**
     * 批量删除 根据id
     *
     * @param ids 主键集合
     */
    void deleteBatchData(List<String> ids);

    /**
     * 修改用户确认到岗状态
     *
     * @param id
     */
    void updateConfirmArrivalStatus(String id);

    FtbPersonnelsStaffEmploymentApply queryAndCheckStaffEmploymentApply(String id);

    /**
     * APP 查询入职关联
     * @param req
     * @return
     */
    PageInfo<FtbPersonnelsStaffEmploymentApplyDto> getAppPageList(QueryAppStaffEmploymentApplyListReq req,String loginUserId);

    /**
     * 审批
     * @param id
     * @param dto
     */
    void approval( EmploymentApplyCheckDto dto);

    /**
     * 重新审批
     * @param id
     * @param dto
     */
    void reApproval(String id, AddStaffEmploymentApplyReq dto);


    void saveInRedis(List<AddStaffEmploymentApplyExcelVO> nomarlData, List<AddStaffEmploymentApplyExcelERRVO> errorData);

    void importDataClick();

    Map<String, Object> importData(InputStream inputStream);

    void exportErrData(HttpServletResponse response);

    void exportDate(BatchByPrimaryIdReq req, HttpServletResponse response);

    PageInfo<FtbPersonnelsStaffEmploymentApplyDto> getWebMyCheckList(MyWebEmploymentApplyCheckListReq req);

    String checkPhoneStatus(String phone);

    void saveShortUrl(String id, String shortUrl);


    void sendPhoneMsg(String phone);

    /**
     * 检测是否需要填写入职登记表
     *
     * @param phone
     * @return true 需要填写 ，false 不需要填写
     */
    Boolean checkFillRegistrationForm(String phone);

    /**
     * 查询邀请码
     * @return
     */
    String queryCode();

    /**
     * 修改员工逾期到岗状态
     */
    void updateEmploymentApplyStatus();

    void deleteByPhone(String phone);

    /**
     * 校验是否有信息绑定
     * @param positionId 岗位
     * @param positionGradesId 职等
     */
    void verifyUserBound(String positionId, String positionGradesId);

    FtbPersonnelsBubbleCountVO getListCont(String flag);

    void exportDateNew(QueryStaffEmploymentApplyListReq req, HttpServletResponse response) throws IOException;

    ActionResult<Void> handleJoinJobForOA(AddStaffEmploymentApplyReq req);

    ActionResult<Void> approvalForOA(EmploymentApplyCheckDto dto);

    /**
     * 重新审批
     * @param id
     * @param dto
     */
    ActionResult<Void> reApprovalForOA(String id, AddStaffEmploymentApplyReq dto);

    PageListVO<FtbPersonnelsEmployApplyDto> onboardingList(QueryStaffEmploymentApplyListReq req);

}
