ManagerUcardGlobalController.java 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. package com.crm.ucard.controller;
  2. import com.crm.rely.backend.core.constant.FeignClientAnnotation;
  3. import com.crm.rely.backend.core.dto.base.BaseReportResultDto;
  4. import com.crm.rely.backend.core.dto.base.BaseResultDto;
  5. import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
  6. import com.crm.rely.backend.core.dto.ucard.GlobalOrderDto;
  7. import com.crm.rely.backend.core.dto.ucard.GlobalOrderSumDto;
  8. import com.crm.rely.backend.core.dto.wasabi.WasabiAvailableCurrenciesListDto;
  9. import com.crm.rely.backend.core.entity.base.BaseEntity;
  10. import com.crm.rely.backend.core.entity.ucard.*;
  11. import com.crm.rely.backend.core.entity.wasabi.WasabiTransactionSubmitRfiEntity;
  12. import com.crm.rely.backend.exception.ServiceException;
  13. import com.crm.ucard.service.GlobalService;
  14. import com.crm.ucard.service.UcardExportService;
  15. import lombok.extern.slf4j.Slf4j;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17. import org.springframework.validation.annotation.Validated;
  18. import org.springframework.web.bind.annotation.PostMapping;
  19. import org.springframework.web.bind.annotation.RequestBody;
  20. import org.springframework.web.bind.annotation.RequestMapping;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import java.util.List;
  23. /**
  24. * 银行卡服务接口
  25. */
  26. @Slf4j
  27. @RestController
  28. @RequestMapping("/ucard/global/manager")
  29. public class ManagerUcardGlobalController {
  30. @Autowired
  31. private GlobalService globalService;
  32. @Autowired
  33. private UcardExportService ucardExportService;
  34. /**
  35. * 速汇订单导出
  36. */
  37. @PostMapping("/order/list/export")
  38. @FeignClientAnnotation
  39. public BaseResultDto<List<GlobalOrderDto>> globalOrderListExport(@RequestBody GlobalOrderPageEntity entity) throws ServiceException {
  40. return ucardExportService.globalOrderListExport(entity);
  41. }
  42. /**
  43. * 同步币种信息
  44. */
  45. @PostMapping("/currencies/save")
  46. @FeignClientAnnotation
  47. public BaseResultDto saveAvailableCurrencies() throws Exception {
  48. return globalService.saveCurrencies();
  49. }
  50. /**
  51. * 币种分页列表
  52. */
  53. @PostMapping("/currencies/list")
  54. @FeignClientAnnotation
  55. ResultWithPagerDto<WasabiAvailableCurrenciesListDto> getCurrenciesPageList(@RequestBody GlobalCurrenciesPageListEntity entity) throws ServiceException {
  56. return globalService.getCurrenciesPageList(entity);
  57. }
  58. /**
  59. * 支持的币种下拉列表
  60. */
  61. @PostMapping("/currencies/dropdown")
  62. @FeignClientAnnotation
  63. public BaseResultDto getCurrenciesDropdown(@RequestBody GlobalCurrenciesDropdownEntity entity) throws ServiceException {
  64. return globalService.getCurrenciesDropdown(entity);
  65. }
  66. /**
  67. * 币种字段和可选值列表
  68. */
  69. @PostMapping("/currencies/field/list")
  70. @FeignClientAnnotation
  71. public BaseResultDto getCurrenciesFieldList(@RequestBody @Validated GlobalCurrenciesFieldListEntity entity) throws ServiceException {
  72. return globalService.getCurrenciesFieldList(entity);
  73. }
  74. /**
  75. * 币种所有字段名称
  76. */
  77. @PostMapping("/field/params")
  78. @FeignClientAnnotation
  79. public BaseResultDto getGlobalFieldParams() throws ServiceException {
  80. return globalService.getGlobalFieldParams();
  81. }
  82. /**
  83. * 创建交易订单
  84. */
  85. @PostMapping("/create/order")
  86. @FeignClientAnnotation
  87. public BaseResultDto globalCreateOrder(@RequestBody GlobalCreateOrderEntity entity) throws Exception {
  88. return globalService.globalCreateOrder(entity);
  89. }
  90. /**
  91. * 取消交易订单
  92. */
  93. @PostMapping("/cancel/order")
  94. @FeignClientAnnotation
  95. public BaseResultDto globalCancelOrder(@RequestBody GlobalCancelOrderEntity entity) throws Exception {
  96. return globalService.globalCancelOrder(entity);
  97. }
  98. /**
  99. * 币种配置更改
  100. */
  101. @PostMapping("/currencies/config")
  102. @FeignClientAnnotation
  103. public BaseResultDto globalCurrenciesConfig(@RequestBody GlobalCurrenciesConfigEntity entity) throws ServiceException {
  104. return globalService.globalCurrenciesConfig(entity);
  105. }
  106. /**
  107. * 查询汇率和手续费率
  108. */
  109. @PostMapping("/query/exchange/rate")
  110. @FeignClientAnnotation
  111. public BaseResultDto queryExchangeRate(@RequestBody GlobalQueryExchangeRateEntity entity) throws Exception {
  112. return BaseResultDto.success(globalService.queryExchangeRate(entity));
  113. }
  114. /**
  115. * 查询最新汇率
  116. */
  117. @PostMapping("/query/latest/exchange/rate")
  118. @FeignClientAnnotation
  119. public BaseResultDto getExchangeRateByCurrency(@RequestBody GlobalQueryExchangeRateEntity entity) throws Exception {
  120. return BaseResultDto.success(globalService.getExchangeRateByCurrency(entity.getPayoutCurrency(), entity.getTransferTypeId(), entity.getPayoutMethodId()));
  121. }
  122. /**
  123. * 查询支持的城市列表
  124. */
  125. @PostMapping("/query/bank/cities")
  126. @FeignClientAnnotation
  127. public BaseResultDto queryBankCities(@RequestBody CardBankCitiesEntity entity) throws ServiceException {
  128. return globalService.queryBankCities(entity);
  129. }
  130. /**
  131. * 查询币种全局配置
  132. */
  133. @PostMapping("/query/currencies/config")
  134. @FeignClientAnnotation
  135. public BaseResultDto getCurrenciesGlobalConfig() throws ServiceException {
  136. return globalService.getCurrenciesGlobalConfig();
  137. }
  138. /**
  139. * 速汇订单分页列表
  140. */
  141. @PostMapping("/order/page/list")
  142. @FeignClientAnnotation
  143. public BaseReportResultDto<List<GlobalOrderDto>, GlobalOrderSumDto> globalOrderPageList(@RequestBody GlobalOrderPageEntity entity) throws Exception {
  144. return globalService.globalOrderPageList(entity);
  145. }
  146. /**
  147. * 补充资料
  148. */
  149. @PostMapping("/supplementary/data")
  150. @FeignClientAnnotation
  151. public BaseResultDto supplementaryData(@RequestBody WasabiTransactionSubmitRfiEntity entity) throws Exception {
  152. return globalService.supplementaryData(entity);
  153. }
  154. /**
  155. * 速汇订单审批
  156. */
  157. @PostMapping("/order/approve")
  158. @FeignClientAnnotation
  159. public BaseResultDto globalOrderApprove(@RequestBody GlobalOrderApproveEntity entity) throws Exception {
  160. return globalService.globalOrderApprove(entity);
  161. }
  162. /**
  163. * 查询速汇订单详情
  164. */
  165. @PostMapping("/order/details")
  166. @FeignClientAnnotation
  167. public BaseResultDto queryGlobalOrderDetails(@RequestBody BaseEntity entity) throws ServiceException {
  168. return globalService.queryGlobalOrderDetails(entity);
  169. }
  170. /**
  171. * 获取收款用户列表
  172. */
  173. @PostMapping("/receiver/user/list")
  174. @FeignClientAnnotation
  175. BaseResultDto getGlobalReceiverUserList(@RequestBody GlobalReceiverUserEntity entity) throws ServiceException {
  176. return globalService.getGlobalReceiverUserList(entity);
  177. }
  178. /**
  179. * 删除收款用户
  180. */
  181. @PostMapping("/receiver/user/delete")
  182. @FeignClientAnnotation
  183. BaseResultDto deleteGlobalReceiverUser(@RequestBody BaseEntity entity) throws ServiceException{
  184. return globalService.deleteGlobalReceiverUser(entity);
  185. }
  186. }