package org.springblade.manager.feign;

import org.springblade.manager.entity.WbsTreeContract;
import org.springblade.manager.vo.WbsTreeContractTreeVOS;
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 static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;

@FeignClient(value = APPLICATION_NAME_PREFIX +  "manager")
public interface WbsTreeContractClient {

    /**
     * 接口前缀
     */
    String API_PREFIX = "/api/manager/WbsTreeContract";

    @PostMapping(API_PREFIX + "/updateContractNodeParameter")
    Boolean updateContractNodeParameter(@RequestBody WbsTreeContract node);

    @GetMapping(API_PREFIX + "/getContractNodeByPrimaryKeyId")
    WbsTreeContract getContractNodeByPrimaryKeyId(@RequestParam String primaryKeyId);

    @PostMapping(API_PREFIX + "/removeContractTreeNode")
    Boolean removeContractTreeNode(@RequestParam String ids);

    /**
     * 根据primaryKeyId获取合同段划分树的节点信息
     * @param primaryKeyId 节点唯一主键
     * @return 信息
     */
    @PostMapping(API_PREFIX + "/getContractWbsTreeByPrimaryKeyId")
    WbsTreeContract getContractWbsTreeByPrimaryKeyId(@RequestParam Long primaryKeyId);

    @PostMapping(API_PREFIX + "/queryContractWbsTreeAll")
    List<WbsTreeContractTreeVOS> queryContractWbsTreeAll(@RequestParam String contractId, @RequestParam Integer wbsType, @RequestParam String parentId);

    /**
     * 根据项目ID获取合同段
     * @return 结果集
     */
    @GetMapping(API_PREFIX + "/queryContractWbsTreeByContractIdAndType")
    List<WbsTreeContractTreeVOS> queryContractWbsTreeByContractIdAndType(@RequestParam String contractId, @RequestParam Integer wbsType, @RequestParam String parentId);

    @GetMapping(API_PREFIX + "/queryCurrentContractLogList")
    List<WbsTreeContractTreeVOS> queryCurrentContractLogList(@RequestParam String contractId);

}
