package jnpf.personnels;

import jnpf.model.personnels.dto.roster.meta.PersonnelsMetaDTO;
import jnpf.model.personnels.dto.salary.FtbXcCustomFieldDto;
import jnpf.model.personnels.req.roster.FtbPersonnelsMetaDataReq;
import jnpf.model.personnels.req.roster.FtbPersonnelsMetaFuctionReq;
import jnpf.model.personnels.vo.salary.FtbXcCustomFieldVo;
import jnpf.personnels.fallback.FtbPersonnelsMetaDataManagerFallBackApi;
import jnpf.util.NoDataSourceBind;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

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


@FeignClient(name = "jnpf-ftb", fallback = FtbPersonnelsMetaDataManagerFallBackApi.class, path = "/web/personnels/metaData")
public interface FtbPersonnelsMetaDataManagerApi {

    @PostMapping("/getMetaData")
    @NoDataSourceBind
    public List<PersonnelsMetaDTO> getMetaData(@RequestBody FtbPersonnelsMetaDataReq info);

    /**
     * 查询用户当月是否已经离职
     *
     * @param userId   用户ID
     * @param tenantId 租户ID
     * @return true-已经离职  false-未离职
     */
    @GetMapping("/queryCurrMonthDepartStatus/{userId}/{tenantId}")
    @NoDataSourceBind
    public Boolean queryCurrMonthDepartStatus(@PathVariable("userId") String userId, @PathVariable("tenantId") String tenantId);


    /**
     * 查询用户当月是否已经离职
     *
     * @param req   请求
     * @return true-已经离职  false-未离职
     */
    @PostMapping("/queryCurrMonthDepartStatusByDate")
    @NoDataSourceBind
    Boolean queryCurrMonthDepartStatusByDate(@RequestBody FtbPersonnelsMetaFuctionReq req);

    /**
     * 批量查询员工是否离职
     */
    @PostMapping("/query-current-month-leave")
    @NoDataSourceBind
    Map<String,Boolean> queryCurrMonthLeave(@RequestBody FtbPersonnelsMetaFuctionReq req);

    /**
     * 批量查询员工自定义字段
     */
    @PostMapping("/query-custom-filed")
    List<FtbXcCustomFieldVo> queryCustomFiled(@RequestBody FtbXcCustomFieldDto req);
}
