package digital.laboratory.platform.imr.feign;


import digital.laboratory.platform.common.core.constant.SecurityConstants;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.imr.feign.dto.UpdateHolderDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;

/**
 * 这个feign接口是用于调整流转模块的其他信息
 */
@FeignClient("dlp-identification-material-transfer")
public interface TransferFeignService {



    /*@PutMapping(value = "/sample_transfer/test",headers = SecurityConstants.HEADER_FROM_IN)
    @LoadBalanced
    public void testTransfer();*/


    /**
     * 修改样本当前持有人
     */
    @PutMapping(value = "/sample/holder",headers = SecurityConstants.HEADER_FROM_IN)
    void updateSampleHolder(@RequestBody UpdateHolderDTO dto );//样本id和当前持有人id

    /**
     * 出库添加流转记录表(不考虑流转质量)
     * 入库-->出库也不需要使用质量
     */
    @PostMapping(value = "/sample_transfer/out/{sampleId}/{userId}",headers = SecurityConstants.HEADER_FROM_IN)
    void addTransferByOut(@PathVariable("sampleId") String sampleId,@PathVariable("userId") String userId);


    /**
     * 入库添加流转记录表(考虑流转质量)
     */
    @PostMapping(value = "/sample_transfer/in/{sampleId}/{unit}/{quality}/{userId}",headers = SecurityConstants.HEADER_FROM_IN)
    void addTransferByIn(@PathVariable("sampleId") String sampleId, @PathVariable("unit") String unit, @PathVariable("quality") BigDecimal quality, @PathVariable("userId") String userId);

    /**
     * 入库添加流转记录表(不考虑流转质量)
     */
    @PostMapping(value = "/sample_transfer/inbound/{sampleId}/{userId}",headers = SecurityConstants.HEADER_FROM_IN)
    void addTransferByInbound(@PathVariable("sampleId") String sampleId,@PathVariable("userId") String userId);

    /**
     * 修改当前样本sample表格中状态
     */

    @PostMapping(value = "/sample/updateStatus/{sampleId}/{status}",headers = SecurityConstants.HEADER_FROM_IN)
    void updateStatus(@PathVariable("sampleId") String sampleId,@PathVariable("status") Integer status);

}
