package com.prolog.cs.biz.outbound.resource;

import com.prolog.cs.basic.common.model.*;
import com.prolog.cs.basic.common.model.print.PrintInfo;
import com.prolog.cs.basic.common.model.print.PrintParam;
import com.prolog.cs.basic.common.model.print.PrintStrategyParam;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import io.swagger.annotations.ApiOperation;
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;

@FeignClient(value = "${prolog.service.common}")
public interface CommonClient {

	/**
	 * 服务调用，查询养护类型关联商品大类
	 */
	@GetMapping("/dict/findUpKeepDict")
	public RestMessage<Map<String,String>> findUpKeepDict(@RequestParam("isProtected") Integer isProtected);

	/**
	 * 服务调用，查询养护类型关联商品大类
	 */
	@GetMapping("/dicttype")
	public RestMessage<BaseCommonDictType> getDictTypeById(String id);
	
	/**
	 * 服务调用，查询养护类型关联商品大类
	 */
	@GetMapping("/dicttype/getDictTypeByCode")
	public RestMessage<BaseCommonDictType> getDictTypeByCode(@RequestParam("code") String code);

	@GetMapping("/dict/basic/type-list")
	public RestMessage<List<BaseCommonDict>> getDictBasicListByCodes(@RequestParam("typeCode") String typeCode, @RequestParam("dictCodes") String[] dictCodes);

	/**
	 * 查询报告单图片
	 */
	@GetMapping("/bizFile/findAll")
	public RestMessage<List<BaseBizFile>> findAll(@RequestParam("bizId") String bizId,@RequestParam("code") String code,@RequestParam("name") String name);

	@PostMapping("/bizFile/add")
	public RestMessage<Object> add(List<BaseBizFile> dataList);

	@PostMapping("/print/executePrint")
	RestMessage<?> executePrint(@RequestBody List<PrintParam> printParamList);

	@PostMapping("/print/executePrintSingle")
	RestMessage<PrintInfo> executePrintSingle(@RequestBody PrintParam printParam);

	@PostMapping("/print/getPrintInfo")
	RestMessage<PrintInfo> getPrintInfo(@RequestBody PrintParam printParam);

	/**
	 * 查询人员策略关联方案
	 */
	@ApiOperation("人员策略关联方案列表查询")
	@GetMapping("/print/strategy/listPersonStrategy")
	RestMessage<List<SysPrintStrategyPerson>> listPersonStrategy(@RequestParam("warehouseId") String warehouseId, @RequestParam("consignorId") String consignorId, @RequestParam("printStrategy") String printStrategy, @RequestParam("strategyId") String strategyId);

	/**
	 * 条件分页查询接口
	 */
	@ApiOperation("打印策略配置-查询列表")
	@PostMapping("/print/strategy/list")
	 RestMessage<Page<SysPrintStrategy>> strategylist(@RequestBody PrintStrategyParam printStrategyParam);

    @GetMapping("/registry/get-code")
    RestMessage<SysRegistry> getRegistryInfo(@RequestParam("regCode") String regCode, @RequestParam("enterpriseId") String enterpriseId);
}
