package jnpf.personnels;

import jnpf.model.attendance.vo.DailyApprovalVo;
import jnpf.model.personnels.dto.emp.FtbEmpQueryDTO;
import jnpf.model.personnels.dto.roster.meta.FtbPersonnlesJobTenureDTO;
import jnpf.model.personnels.dto.secondment.FtbSecondMentQueryDTO;
import jnpf.model.personnels.dto.staff.roster.FtbPersonnelsStaffRosterDto;
import jnpf.model.personnels.vo.roster.FtbPersonnelsChangeInfoVO;
import jnpf.model.personnels.vo.roster.FtbPersonnlesJobTenureVO;
import jnpf.model.personnels.vo.secondment.FtbPersonnelsSecondmentVO;
import jnpf.util.NoDataSourceBind;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @Author: peng.hao
 * @create: 2025/10/3
 */
@FeignClient(name = "jnpf-ftb")
public interface FtbPersonneApi {

    /**
     *根据userId 查询人事异动信息
     */
    @GetMapping("/web-app/staff-home-page/get-personnel-change-info")
    FtbPersonnelsChangeInfoVO getPersonnelChangeInfo(@RequestParam(name = "userId") String userId);


    @PostMapping("/web-app/staff-home-page/get-personnel-change-info-batch")
    Map<String, FtbPersonnelsChangeInfoVO> getPersonnelChangeInfoBatch(@RequestBody List<String> userIds);
    /**
     * 根据userI 和开始时间结束时间查询借调记录
     */
    @GetMapping("/web/secondment/get-secondment-record")
     List<FtbPersonnelsSecondmentVO> getSecondmentRecord(@RequestParam("userId") String userId,
                                                               @RequestParam(value = "startLeaveTime",required = false) String startLeaveTime,
                                                               @RequestParam(value = "endLeaveTime",required = false)String endLeaveTime);

    /**
     * 批量查询审批中和审批完成的借调记录
     */
    @PostMapping("/web/secondment/get-secondment-record-bath")
    List<FtbPersonnelsSecondmentVO> getSecondmentRecordBath(@RequestBody FtbSecondMentQueryDTO dto);


    /**
     * 查询审批中和审批完成的借调记录
     */
    @PostMapping("/web/secondment/list-query-approval")
    List<DailyApprovalVo> queryListApproval(@RequestBody FtbSecondMentQueryDTO  dto);

    /**
     * 模糊搜索 电话 名称
     */
    @PostMapping("/web/personnels-emp-entry/search-phone-name")
    List<FtbPersonnelsStaffRosterDto> searchPhoneName(@RequestBody FtbEmpQueryDTO dto);

    /**
     * 查询岗龄
     * @param req
     * @return
     */
    @PostMapping("/web-app/staff-home-page/query-positionTenure-age")
    @NoDataSourceBind
    List<FtbPersonnlesJobTenureVO> queryPositionTenureAge(@RequestBody FtbPersonnlesJobTenureDTO req);
}
