package cn.ey.biz.module.external.api.fd.feign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.ey.biz.common.pojo.R;
import cn.ey.biz.module.external.api.fd.feign.config.ExternalServiceFeignConfiguration;
import cn.ey.biz.module.external.api.fd.feign.reqdto.ActivityInfoReqDTO;
import cn.ey.biz.module.external.api.fd.feign.reqdto.EngAgementRequest;
import cn.ey.biz.module.external.api.fd.feign.reqdto.EngGlobalSearchRequest;
import cn.ey.biz.module.external.api.fd.feign.reqdto.EngagementListForCodeGropRequest;
import cn.ey.biz.module.external.api.fd.feign.reqdto.ExistAnyEngRequestDTO;
import cn.ey.biz.module.external.api.fd.feign.reqdto.LeaveCodeRequest;
import cn.ey.biz.module.external.api.fd.feign.reqdto.TeExpenseDetailRequest;
import cn.ey.biz.module.external.api.fd.feign.reqdto.TimesheetDetailRequest;
import cn.ey.biz.module.external.api.fd.feign.resdto.ActivityInfoResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.EngagementInfoResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.LeaveCodeResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.StatisticsTeExpenseDetailResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.StatisticsTimesheetDetailResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.TeExpenseDetailResponseDTO;
import cn.ey.biz.module.external.api.fd.feign.resdto.TimesheetDetailResponseDTO;
import cn.ey.biz.module.external.common.Constants;
import cn.ey.biz.module.external.common.Page;

/**
 * 财务扩展服务 接口feign服务
 * @author 86182
 *
 */

@FeignClient(name= Constants.EXTERNAL_SERVER, configuration = ExternalServiceFeignConfiguration.class,contextId = "FD-EXTERNAL",path = "/rpc-api/external")
public interface IFdExternalFeignService {
	
	/**
	 * 项目列表查询 按条件_分页查
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/list/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<EngagementInfoResponseDTO>> getEngagementPageList(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目列表查询 按条件_分页查(code组合场景)
	 * @param requestget
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/list/pageforcodegroup",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<EngagementInfoResponseDTO>> getEngagementPageListForCodeGroup(@RequestBody EngagementListForCodeGropRequest engagementReq);
	
	/**
	 *  工时Gds项目列表查询 按条件_分页查
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/gds/list/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<EngagementInfoResponseDTO>> getGdsEngagementPageList(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目列表查询 按条件_全部查
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/list/all",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<EngagementInfoResponseDTO>> getEngagementList(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目列表查询 全局检索
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/globalsearch",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<EngagementInfoResponseDTO>> getEngagementListGlobalSearch(@RequestBody EngGlobalSearchRequest engAgementGlobalSearchReq);
	
	/**
	 * 项目列表查询_根据engCodes
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/getEngagementsByEngCodes",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<EngagementInfoResponseDTO>> getEngagementsByEngCodes(@RequestBody List<String> engCodes);
	
	/**
	 * 判断是否存在满足条件engCodes,statuss的任意项目
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/existAnyEng",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Boolean> existAnyEng(@RequestBody ExistAnyEngRequestDTO existAnyEngRequest);
	
	/**
	 * 项目详情查询_id
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/detailByMainId",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<EngagementInfoResponseDTO> getEngagementInfoBymainId(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目详情查询_根据项目code
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/detailByEngagementCode",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<EngagementInfoResponseDTO> getEngagementInfoByEngagementCode(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目详情查询_根据8位项目code1
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/detailByEngagementCode1",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<EngagementInfoResponseDTO> getEngagementInfoByEngagementCode1(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目详情查询_根据8位项目code1
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/gds/detailByEngagementCode1",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<EngagementInfoResponseDTO> getGdsEngagementInfoByEngagementCode1(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目详情查询_根据ProcessNo
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/detailByProcessNo",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<EngagementInfoResponseDTO> getEngagementInfoByProcessNo(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 项目权限判断
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/permission",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Boolean> hasEngagementPermission(@RequestBody EngAgementRequest engagementReq);
	
	/**
	 * 判断 budgetPlanId 下是否有项目存在
	 * @param budgetPlanId
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/engagement/hasEngagementsByBudgetPlanId",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Boolean> hasEngagementsByBudgetPlanId(@RequestBody String budgetPlanId);
	
	/**
	 * 项目财年查询
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.GET, value="/engagement/financial/calendar",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<String>> getEngagementFinancialCalendar();
	
	/**
	 * 休假code查询
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/leave/code/list",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<LeaveCodeResponseDTO> getLeaveCodes(@RequestBody LeaveCodeRequest leaveCodeReq);
	
	
	/**
	 * 人员工时_分页
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/timesheet/list/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<TimesheetDetailResponseDTO>> getTimesheetDetailPageList(@RequestBody TimesheetDetailRequest timesheetDetailReq);
	
	/**
	 * 人员工时_全部
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/timesheet/list/all",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<TimesheetDetailResponseDTO>> getTimesheetDetailAllList(@RequestBody TimesheetDetailRequest timesheetDetailReq);
	
	/**O
	 * 人员工时_时间段数量统计
	 * @param request
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/timesheet/statistics",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<StatisticsTimesheetDetailResponseDTO> statisticsTimesheetDetail(@RequestBody TimesheetDetailRequest timesheetDetailReq);
	
	
	
	/**
	 * 费用明细_分页
	 * @param reqParam
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/expensedetail/list/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<TeExpenseDetailResponseDTO>> getTeExpenseDetailPageList(@RequestBody TeExpenseDetailRequest reqParam);
		
	/**
	 * 费用明细_全部
	 * @param reqParam
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/expensedetail/list/all",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<TeExpenseDetailResponseDTO>> getTeExpenseDetailAllList(@RequestBody TeExpenseDetailRequest reqParam);
		
	
	/**
	 * 费用明细_时间段数量统计
	 * @param reqParam
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/expensedetail/statistics",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<StatisticsTeExpenseDetailResponseDTO> statisticsTeExpenseDetail(@RequestBody TeExpenseDetailRequest reqParam);
	
	/**
	 * 活动列表查询
	 * @param reqParam
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/activity/list/page",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<Page<ActivityInfoResponseDTO>> getActivityPageList(@RequestBody ActivityInfoReqDTO reqParam);
	
	/**
	 * 活动列表查询_根据id全量查
	 * @param reqParam
	 * @return
	 */
	@RequestMapping(method= RequestMethod.POST, value="/activity/list/byCodes",
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.APPLICATION_JSON_VALUE)
	R<List<ActivityInfoResponseDTO>> getEngagementActiveInfosByActivityCodes(@RequestBody List<String> activityCodes);
	
	
}
