package com.ruoyi.other.api.feignClient;
|
|
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.other.api.domain.TFleet;
|
import com.ruoyi.other.api.domain.TGroupCompany;
|
import com.ruoyi.other.api.factory.GroupCompanyFallbackFactory;
|
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.RequestBody;
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* 公司(企业)/车队服务(VIN码车辆所属公司、车队及初始分配额度扣减使用)
|
*
|
* @author mxcd
|
*/
|
@FeignClient(contextId = "GroupCompanyClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GroupCompanyFallbackFactory.class)
|
public interface GroupCompanyClient {
|
|
/**
|
* 查询公司详情(含账户模式、可用余额)
|
*/
|
@PostMapping("/group-company/remote/get/{id}")
|
R<TGroupCompany> getCompanyById(@PathVariable("id") Integer id);
|
|
/**
|
* 按ID批量查询公司(VIN 码充电订单列表回填公司名称使用)
|
*/
|
@PostMapping("/group-company/remote/list-by-ids")
|
R<List<TGroupCompany>> listCompaniesByIds(@RequestBody List<Integer> ids);
|
|
/**
|
* 扣减公司可用余额(条件更新,余额不足返回失败,返回扣减后余额)
|
*/
|
@PostMapping("/group-company/remote/deduct-balance")
|
R<BigDecimal> deductBalance(@RequestParam("companyId") Integer companyId, @RequestParam("amount") BigDecimal amount);
|
|
/**
|
* 退还公司可用余额(返回退还后余额)
|
*/
|
@PostMapping("/group-company/remote/refund-balance")
|
R<BigDecimal> refundBalance(@RequestParam("companyId") Integer companyId, @RequestParam("amount") BigDecimal amount);
|
|
/**
|
* 查询车队详情
|
*/
|
@PostMapping("/fleet/remote/get/{id}")
|
R<TFleet> getFleetById(@PathVariable("id") Integer id);
|
|
/**
|
* 按ID批量查询车队(VIN列表回填车队名称使用)
|
*/
|
@PostMapping("/fleet/remote/list-by-ids")
|
R<List<TFleet>> listFleetsByIds(@RequestBody List<Integer> ids);
|
}
|