Commit 784c56e1 authored by chenjianrong's avatar chenjianrong
Browse files

others#000,修复账套号下拉报错

parent d591567f
No related merge requests found
Pipeline #11651 passed with stages
in 56 seconds
Showing with 11 additions and 10 deletions
+11 -10
......@@ -13,6 +13,7 @@ import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.UriBuilder;
import java.util.List;
......@@ -35,17 +36,17 @@ public class AccountSelector implements LfsSelectorStrategy {
*/
@Override
public LfsBaseResp selector(SelectorReq req) {
String url;
if (Utils4General.isEmpty(req.getQuery())) {
url = "/api/v1/sys-tenant-account/selector";
} else {
url = "/api/v1/sys-tenant-account/selector?query=" + req.getQuery();
}
return lfsWebClient.post().uri(uriBuilder ->
uriBuilder.path(url).build()
).contentType(MediaType.APPLICATION_JSON).retrieve()
.bodyToMono(new ParameterizedTypeReference<LfsBaseResp<List<AccountNoRes>>>() {
return lfsWebClient.post()
.uri(uriBuilder -> {
UriBuilder builder = uriBuilder.path("/api/v1/sys-tenant-account/selector");
if (!Utils4General.isEmpty(req.getQuery())) {
builder.queryParam("query", req.getQuery()); // 单独设置查询参数
}
return builder.build();
})
.contentType(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(new ParameterizedTypeReference<LfsBaseResp<List<AccountNoRes>>>() {})
.block();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment