diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java index 6cb914ddc..549d5d63e 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceClient.java @@ -3,8 +3,10 @@ package com.logpm.trunkline.feign; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import org.springblade.common.constant.ModuleNameConstant; 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; @FeignClient( value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME @@ -16,5 +18,7 @@ public interface ITrunklineAdvanceClient { @PostMapping(API_PREFIX+"/addAdvanceReturnId") Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity); + @GetMapping(API_PREFIX+"/findAdvanceLimitOneByOrderCode") + TrunklineAdvanceEntity findAdvanceLimitOneByOrderCode(@RequestParam String orderCode); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java index 93e0c4e8e..deda62844 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceClient.java @@ -1,5 +1,6 @@ package com.logpm.trunkline.feign; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.service.ITrunklineAdvanceService; import lombok.AllArgsConstructor; @@ -23,4 +24,12 @@ public class TrunklineAdvanceClient implements ITrunklineAdvanceClient{ } return trunklineAdvanceEntity.getId(); } + + @Override + public TrunklineAdvanceEntity findAdvanceLimitOneByOrderCode(String orderCode) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("order_code",orderCode) + .last("limit 1"); + return advanceService.getOne(queryWrapper); + } }