From 9d1b13d4d39fce6980a4469b8d853e893bd90487 Mon Sep 17 00:00:00 2001 From: zhaoqing <1670883518@qq.com> Date: Wed, 6 May 2026 17:43:47 +0800 Subject: [PATCH] =?UTF-8?q?OMS-GW=E6=8E=A8=E9=80=81-=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=B8=81=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mhd/system/api/WlhyServiceFeign.java | 8 +++ .../factory/RemoteWlhyFallbackFactory.java | 5 ++ .../ExchangeRateApplicationService.java | 59 +++++++++++++++++++ .../facade/exchangeRate/ExchangeRateApi.java | 37 ++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java create mode 100644 mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java index da0eb2638..d2b8ed1fb 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WlhyServiceFeign.java @@ -538,4 +538,12 @@ public interface WlhyServiceFeign { @GetMapping("/feign/order/cancelIssueDocuments") public AjaxResult cancelIssueDocuments(@RequestParam(name="executeOrderId") String executeOrderId); + + @GetMapping(value = "/ntocc/tmsSettlementExchangeRate/queryList") + public AjaxResult queryList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="pushStatus", required = false) String pushStatus, + @RequestParam(name="organizationId", required = false) String organizationId); + + } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java index 23fb98c50..be28da5dd 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWlhyFallbackFactory.java @@ -550,6 +550,11 @@ public class RemoteWlhyFallbackFactory implements FallbackFactory queryList(Integer pageNo, Integer pageSize, String pushStatus, String organizationId) { + return AjaxResult.error(cause.getMessage()); + } }; } } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java new file mode 100644 index 000000000..f9376ee76 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java @@ -0,0 +1,59 @@ +package com.mhd.oms.application.service.exchangeRate; + + +import com.mhd.common.core.web.domain.AjaxResult; +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.system.api.WlhyServiceFeign; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + + +@Service +@Slf4j +public class ExchangeRateApplicationService { + + @Resource + private WlhyServiceFeign wlhyServiceFeign; + + public TableDataInfo queryExchangeRateList(Integer pageNum, Integer pageSize, String pushStatus, String organizationId) { + try { + log.info("查询汇率列表: pageNum={}, pageSize={}, pushStatus={}, organizationId={}", + pageNum, pageSize, pushStatus, organizationId); + AjaxResult result = wlhyServiceFeign.queryList(pageNum, pageSize, pushStatus, organizationId); + log.info("查询汇率列表结果: code={}, result={}", result.get("code"), result.get("result")); + + if (result != null) { + Object wlhyResult = result.get("result"); + if (wlhyResult != null) { + Map map = (Map) wlhyResult; + Object records = map.get("records"); + Object total = map.get("total"); + List list = records instanceof List ? (List) records : new ArrayList<>(); + + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(total instanceof Number ? ((Number) total).longValue() : list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } + } + } catch (Exception e) { + log.error("查询汇率列表异常: {}", e.getMessage()); + e.printStackTrace(); + } + return buildTableDataInfo(new ArrayList<>()); + } + + private TableDataInfo buildTableDataInfo(List list) { + TableDataInfo tableDataInfo = new TableDataInfo(); + tableDataInfo.setData(list); + tableDataInfo.setTotal(list.size()); + tableDataInfo.setCode(200); + return tableDataInfo; + } +} diff --git a/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java new file mode 100644 index 000000000..825287645 --- /dev/null +++ b/mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/exchangeRate/ExchangeRateApi.java @@ -0,0 +1,37 @@ +package com.mhd.oms.interfaces.facade.exchangeRate; + + +import com.mhd.common.core.web.page.TableDataInfo; +import com.mhd.oms.application.service.exchangeRate.ExchangeRateApplicationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static com.mhd.common.core.utils.PageUtils.startPage; + + +@Api(tags = "汇率管理") +@RestController +@RequestMapping("exchangeRateApi") +public class ExchangeRateApi { + + @Resource + private ExchangeRateApplicationService exchangeRateApplicationService; + + @ApiOperation("查询汇率列表") + @GetMapping("/list") + public TableDataInfo list(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(value = "pushStatus", required = false) String pushStatus, + @RequestParam(value = "organizationId", required = false) String organizationId) { + startPage(); + return exchangeRateApplicationService.queryExchangeRateList(pageNum, pageSize, pushStatus, organizationId); + } + +}