WasabiCardController.java 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  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.*;
  7. import com.crm.rely.backend.core.dto.ucard.vaultody.VaultodyDepositAddressDto;
  8. import com.crm.rely.backend.core.dto.wasabi.*;
  9. import com.crm.rely.backend.core.entity.base.BaseDeleteEntities;
  10. import com.crm.rely.backend.core.entity.base.BaseEntity;
  11. import com.crm.rely.backend.core.entity.base.SingleLongEntity;
  12. import com.crm.rely.backend.core.entity.custom.info.InfoEntity;
  13. import com.crm.rely.backend.core.entity.custom.kyc.WebsdkLinkAliEntity;
  14. import com.crm.rely.backend.core.entity.ucard.*;
  15. import com.crm.rely.backend.core.entity.ucard.crypto.currency.vaultody.VaultodyDepositAddressPageEntity;
  16. import com.crm.rely.backend.core.entity.ucard.crypto.currency.vaultody.VaultodyResetDepositAddressEntity;
  17. import com.crm.rely.backend.core.entity.wasabi.*;
  18. import com.crm.rely.backend.exception.ServiceException;
  19. import com.crm.rely.backend.util.GetIpAndMac;
  20. import com.crm.ucard.service.UcardService;
  21. import com.crm.ucard.service.VaultodyService;
  22. import com.crm.ucard.service.WasabiCardService;
  23. import lombok.extern.slf4j.Slf4j;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.scheduling.annotation.Scheduled;
  26. import org.springframework.validation.annotation.Validated;
  27. import org.springframework.web.bind.annotation.*;
  28. import org.springframework.web.multipart.MultipartFile;
  29. import javax.servlet.http.HttpServletRequest;
  30. import java.util.List;
  31. /**
  32. * 银行卡服务接口
  33. */
  34. @Slf4j
  35. @RestController
  36. @RequestMapping("/wasabi/manager")
  37. public class WasabiCardController {
  38. @Autowired
  39. private UcardService ucardService;
  40. @Autowired
  41. private WasabiCardService wasabiCardService;
  42. @Autowired
  43. private VaultodyService vaultodyService;
  44. /**
  45. * 获取卡片类型列表
  46. */
  47. @PostMapping("/card/types/page")
  48. @FeignClientAnnotation
  49. public ResultWithPagerDto<CardTypeDto> getCardTypePageList(@RequestBody CardTypePageEntity entity) throws ServiceException {
  50. return ucardService.getCardTypePageList(entity);
  51. }
  52. /**
  53. * 更新卡类型配置
  54. */
  55. @PostMapping("/card/type/config/update")
  56. @FeignClientAnnotation
  57. public BaseResultDto updateCardTypeConfig(@RequestBody CardTypeConfigUpdateEntity entity) throws ServiceException {
  58. return wasabiCardService.updateCardTypeConfig(entity);
  59. }
  60. /**
  61. * 更新卡片类型和基本信息
  62. */
  63. @PostMapping("/card/types")
  64. @FeignClientAnnotation
  65. public BaseResultDto getCardTypes() throws ServiceException {
  66. wasabiCardService.saveCardTypeList();
  67. wasabiCardService.cardUpdateCountry();
  68. wasabiCardService.updateOccupationList();
  69. return BaseResultDto.success();
  70. }
  71. /**
  72. * 商户用户分页列表
  73. */
  74. @PostMapping("/merchant/user/page")
  75. @FeignClientAnnotation
  76. public ResultWithPagerDto<MerchantUserDto> getMerchantUserPageList(@RequestBody MerchantUserPageEntity entity) throws ServiceException {
  77. return ucardService.getMerchantUserPageList(entity);
  78. }
  79. /**
  80. * 商户用户注册
  81. */
  82. @PostMapping("/merchant/user/register")
  83. @FeignClientAnnotation
  84. public BaseResultDto managerRegisterMerchantUser(@RequestBody @Validated CardMerchantUserEntity request, HttpServletRequest servletRequest) throws ServiceException {
  85. String ip = GetIpAndMac.getIp(servletRequest);
  86. request.setIpAddress(ip);
  87. return wasabiCardService.registerMerchantUser(request);
  88. }
  89. /**
  90. * 更新商户用户信息
  91. */
  92. @PostMapping("/merchant/user/update")
  93. @FeignClientAnnotation
  94. public BaseResultDto updateMerchantUser(@RequestBody @Validated CardMerchantUserEntity request) throws ServiceException {
  95. return wasabiCardService.updateMerchantUser(request);
  96. }
  97. /**
  98. * 配置用户汇率
  99. */
  100. @PostMapping("/merchant/user/rate/config")
  101. @FeignClientAnnotation
  102. public BaseResultDto cardUserRateConfig(@RequestBody CardUserRateConfigEntity request) throws ServiceException {
  103. return wasabiCardService.cardUserRateConfig(request);
  104. }
  105. /**
  106. * 更新用户邮寄地址
  107. */
  108. @PostMapping("/merchant/user/address/update")
  109. @FeignClientAnnotation
  110. public BaseResultDto updateUserMailingAddress(@RequestBody WasabiSaveUserMailingAddressEntity request) throws ServiceException {
  111. return wasabiCardService.updateUserMailingAddress(request);
  112. }
  113. /**
  114. * 获取kyc认证分页列表
  115. */
  116. @PostMapping("/merchant/kyc/page")
  117. @FeignClientAnnotation
  118. ResultWithPagerDto<CardKycStatusDto> getKycPageList(@RequestBody CardKycStatusPageEntity entity) throws ServiceException {
  119. return ucardService.getKycPageList(entity);
  120. }
  121. /**
  122. * 手动审核KYC认证
  123. */
  124. @PostMapping("/merchant/kyc/manual/submit")
  125. @FeignClientAnnotation
  126. public BaseResultDto manualSubmitKyc(@RequestBody CardKycApproveEntity entity) throws ServiceException {
  127. return wasabiCardService.manualSubmitKyc(entity);
  128. }
  129. /**
  130. * 申请开卡
  131. */
  132. @PostMapping("/card/apply")
  133. @FeignClientAnnotation
  134. public BaseResultDto applyCard(@RequestBody CardApplyEntity request) throws Exception {
  135. return wasabiCardService.applyCard(request);
  136. }
  137. /**
  138. * 开卡审批
  139. */
  140. @PostMapping("/card/apply/approve")
  141. @FeignClientAnnotation
  142. public BaseResultDto cardApplyApprove(@RequestBody CardApplyApproveEntity request) throws Exception {
  143. return wasabiCardService.cardApplyApprove(request);
  144. }
  145. /**
  146. * 查询开卡进度
  147. */
  148. @PostMapping("/card/apply/progress")
  149. @FeignClientAnnotation
  150. public BaseResultDto queryApplyProgress(@RequestBody CardApplyProgressEntity request) throws Exception {
  151. return wasabiCardService.queryApplyProgress(request);
  152. }
  153. /**
  154. * 获取卡片申请列表
  155. */
  156. @PostMapping("/card/apply/page")
  157. @FeignClientAnnotation
  158. public ResultWithPagerDto<CardApplyDto> getCardApplyPageList(@RequestBody CardApplyPageEntity entity) throws ServiceException {
  159. return ucardService.getCardApplyPageList(entity);
  160. }
  161. /**
  162. * 获取卡片申请详情
  163. */
  164. @PostMapping("/card/apply/details")
  165. @FeignClientAnnotation
  166. public BaseResultDto cardApplyDetails(@RequestBody BaseEntity entity) throws ServiceException {
  167. return wasabiCardService.cardApplyDetails(entity);
  168. }
  169. /**
  170. * 获取卡片列表
  171. */
  172. @PostMapping("/card/page")
  173. @FeignClientAnnotation
  174. public ResultWithPagerDto<UcardCardDto> getCardPageList(@RequestBody CardPageEntity entity) throws ServiceException {
  175. return ucardService.getCardPageList(entity);
  176. }
  177. /**
  178. * 银行卡激活
  179. */
  180. @PostMapping("/card/activate")
  181. @FeignClientAnnotation
  182. public BaseResultDto<WasabiActiveCardDto> activateCard(@RequestBody @Validated WasabiActiveCardEntity request) throws ServiceException {
  183. return wasabiCardService.activeCard(request);
  184. }
  185. /**
  186. * 银行卡充值
  187. */
  188. @PostMapping("/card/recharge")
  189. @FeignClientAnnotation
  190. public BaseResultDto rechargeCard(@RequestBody WasabiBalanceEntity request) throws ServiceException {
  191. return wasabiCardService.cardDeposit(request);
  192. }
  193. /**
  194. * 银行卡充值审批
  195. */
  196. @PostMapping("/card/recharge/approve")
  197. @FeignClientAnnotation
  198. public BaseResultDto rechargeCardApprove(@RequestBody WasabiDepositApproveEntity request) throws Exception {
  199. return wasabiCardService.cardDepositApprove(request);
  200. }
  201. /**
  202. * 卡扣款
  203. */
  204. @PostMapping("/card/withdraw")
  205. @FeignClientAnnotation
  206. public BaseResultDto cardWithdraw(@RequestBody WasabiWithdrawEntity request) throws Exception {
  207. return wasabiCardService.cardWithdraw(request);
  208. }
  209. /**
  210. * 销卡
  211. */
  212. @PostMapping("/card/cancel")
  213. @FeignClientAnnotation
  214. public BaseResultDto cardCancel(@RequestBody WasabiCancelEntity request) throws Exception {
  215. return wasabiCardService.cardCancel(request);
  216. }
  217. /**
  218. * 查询用户钱包余额
  219. */
  220. @PostMapping("/card/wallet/balance")
  221. @FeignClientAnnotation
  222. public BaseResultDto<WalletBalanceDto> walletBalance(@RequestBody WalletBalanceEntity request) throws ServiceException {
  223. return wasabiCardService.walletBalance(request);
  224. }
  225. /**
  226. * 获取用户钱包记录列表
  227. */
  228. @PostMapping("/card/wallet/record/page")
  229. @FeignClientAnnotation
  230. public ResultWithPagerDto<CardWalletRecordDto> getCardWalletRecordPageList(@RequestBody CardWalletRecordPageEntity entity) throws ServiceException {
  231. return wasabiCardService.getCardWalletRecordPageList(entity);
  232. }
  233. /**
  234. * 查询充值订单
  235. */
  236. @PostMapping("/card/recharge/order")
  237. @FeignClientAnnotation
  238. public BaseResultDto queryRechargeOrder(@RequestBody CardRechargeOrderQueryEntity request) throws Exception {
  239. return wasabiCardService.queryDepositOrder(request);
  240. }
  241. /**
  242. * 查询充值记录
  243. */
  244. @PostMapping("/card/recharge/records")
  245. @FeignClientAnnotation
  246. public BaseResultDto<List<WasabiTransactionDto>> queryRechargeRecords(@RequestBody WasabiTransactionEntity entity) throws Exception {
  247. entity.setType("deposit");
  248. return BaseResultDto.success(wasabiCardService.getCardTransactionList(entity));
  249. }
  250. /**
  251. * 充值记录分页查询
  252. */
  253. @PostMapping("/card/recharge/page")
  254. @FeignClientAnnotation
  255. public BaseReportResultDto<List<CardRechargeOrderDto>, CardRechargeOrderSumDto> queryRechargePageList(@RequestBody CardRechargePageEntity entity) throws ServiceException {
  256. return ucardService.queryRechargePageList(entity);
  257. }
  258. /**
  259. * 查询卡片余额
  260. */
  261. @PostMapping("/card/balance")
  262. @FeignClientAnnotation
  263. public BaseResultDto<WasabiBalanceInfoDto> queryCardBalance(@RequestBody WasabiBalanceInfoEntity request) throws ServiceException {
  264. return wasabiCardService.getBalanceInfo(request);
  265. }
  266. /**
  267. * 调整余额
  268. */
  269. @PostMapping("/card/wallet/balance/update")
  270. @FeignClientAnnotation
  271. public BaseResultDto updateBalance(@RequestBody WasabiUpdateBalanceEntity request) throws ServiceException {
  272. return wasabiCardService.updateBalance(request);
  273. }
  274. /**
  275. * 找回密码
  276. */
  277. @PostMapping("/card/password/reset")
  278. @FeignClientAnnotation
  279. public BaseResultDto<WasabiUpdatePinDto> resetPassword(@RequestBody WasabiUpdatePinEntity entity) throws ServiceException {
  280. return wasabiCardService.updatePin(entity);
  281. }
  282. /**
  283. * 查询交易记录分页列表
  284. */
  285. @PostMapping("/card/transac/page")
  286. @FeignClientAnnotation
  287. public ResultWithPagerDto<CardTransacOrderDto> getTransactionPageList(@RequestBody CardTransacOrderPageEntity request) throws ServiceException {
  288. return ucardService.getTransacOrderPageList(request);
  289. }
  290. /**
  291. * 冻结卡片
  292. */
  293. @PostMapping("/card/freeze")
  294. @FeignClientAnnotation
  295. public BaseResultDto freezeCard(@RequestBody WasabiFreezeAndUnfreezeEntity request) throws Exception {
  296. return wasabiCardService.cardFreeze(request);
  297. }
  298. /**
  299. * 解冻卡片
  300. */
  301. @PostMapping("/card/unfreeze")
  302. @FeignClientAnnotation
  303. public BaseResultDto unfreezeCard(@RequestBody WasabiFreezeAndUnfreezeEntity request) throws Exception {
  304. return wasabiCardService.cardUnfreeze(request);
  305. }
  306. /**
  307. * 校验文件
  308. */
  309. @PostMapping("/validated/file")
  310. @FeignClientAnnotation
  311. public void validatedFile(@RequestParam(value = "file") MultipartFile file) throws ServiceException {
  312. wasabiCardService.validatedFile(file);
  313. }
  314. /**
  315. * 查询国家和城市
  316. */
  317. @PostMapping("/card/country")
  318. @FeignClientAnnotation
  319. public BaseResultDto getCardCountry(@RequestBody CardCountryEntity request) throws ServiceException {
  320. request.setCardCategory(2);
  321. return BaseResultDto.success(ucardService.getCardCountryList(request));
  322. }
  323. /**
  324. * 查询职业信息
  325. */
  326. @PostMapping("/card/occupation/list")
  327. @FeignClientAnnotation
  328. public BaseResultDto<List<WasabiOccupationsDto>> getOccupationList() throws ServiceException {
  329. return wasabiCardService.getOccupationList();
  330. }
  331. /**
  332. * 查询激活码
  333. */
  334. @PostMapping("/get/activation/code")
  335. @FeignClientAnnotation
  336. public BaseResultDto<WasabiThird3dsTransactionDto> getActivationCode(@RequestBody WasabiThird3dsTransactionEntity entity) throws ServiceException {
  337. return wasabiCardService.getActivationCode(entity);
  338. }
  339. /**
  340. * 卡信息刷新
  341. */
  342. @PostMapping("/card/info/refresh")
  343. @FeignClientAnnotation
  344. public BaseResultDto refreshCardInfo(@RequestBody CardInfoRefreshEntity entity) throws ServiceException {
  345. return wasabiCardService.refreshCardInfo(entity);
  346. }
  347. /**
  348. * 卡权限分页列表
  349. */
  350. @PostMapping("/card/permission/page")
  351. @FeignClientAnnotation
  352. public ResultWithPagerDto<CardPermissionDto> queryPermissionPageList(@RequestBody CardPermissionPageEntity entity) throws ServiceException {
  353. return wasabiCardService.queryPermissionPageList(entity);
  354. }
  355. /**
  356. * 新增卡权限
  357. */
  358. @PostMapping("/card/permission/add")
  359. @FeignClientAnnotation
  360. public BaseResultDto permissionAdd(@RequestBody CardPermissionAddEntity entity) throws ServiceException {
  361. return wasabiCardService.addPermission(entity);
  362. }
  363. /**
  364. * 更新卡权限
  365. */
  366. @PostMapping("/card/permission/update")
  367. @FeignClientAnnotation
  368. public BaseResultDto permissionAdd(@RequestBody CardPermissionUpdateEntity entity) throws ServiceException {
  369. return wasabiCardService.updatePermission(entity);
  370. }
  371. /**
  372. * 删除卡权限
  373. */
  374. @PostMapping("/card/permission/delete")
  375. @FeignClientAnnotation
  376. public BaseResultDto permissionDelete(@RequestBody CardPermissionDeleteEntity entity) throws ServiceException {
  377. return wasabiCardService.deletePermission(entity);
  378. }
  379. /**
  380. * 操作记录分页列表
  381. */
  382. @PostMapping("/card/operate/page")
  383. @FeignClientAnnotation
  384. public ResultWithPagerDto<CardOperateDto> queryOperatePageList(@RequestBody CardOperatePageEntity entity) throws ServiceException {
  385. return wasabiCardService.queryOperatePageList(entity);
  386. }
  387. /**
  388. * kyc认证详情
  389. */
  390. @PostMapping("/kyc/status/single")
  391. @FeignClientAnnotation
  392. public BaseResultDto kycStatusSingle(@RequestBody SingleLongEntity entity) throws ServiceException {
  393. return wasabiCardService.kycStatusSingle(entity);
  394. }
  395. /**
  396. * 重新充值默认开卡金额
  397. */
  398. @PostMapping("/recharge/default/amount")
  399. @FeignClientAnnotation
  400. public BaseResultDto rechargeDefaultAmount(@RequestBody CardRechargeDefaultAmountEntity entity) throws Exception {
  401. return wasabiCardService.rechargeDefaultAmount(entity);
  402. }
  403. /**
  404. * 校验实体卡卡号是否使用过
  405. */
  406. @PostMapping("/card/number/verify")
  407. @FeignClientAnnotation
  408. public BaseResultDto cardNumberVerify(@RequestBody @Validated CardNumberVerifyEntity entity) throws ServiceException {
  409. return wasabiCardService.cardNumberVerify(entity);
  410. }
  411. /**
  412. * 身份认证获取web链接
  413. *
  414. * @param entity
  415. * @return
  416. */
  417. @PostMapping("/getWebsdkLink")
  418. public BaseResultDto getWebsdkLink(@RequestBody WebsdkLinkAliEntity entity, InfoEntity infoEntity) throws Exception {
  419. return wasabiCardService.getWebsdkLink(entity, infoEntity.getCustomInfo().getId());
  420. }
  421. /**
  422. * 手动上传证件照
  423. *
  424. * @param entity
  425. * @return
  426. */
  427. @PostMapping("/card/photo/manually")
  428. @FeignClientAnnotation
  429. public BaseResultDto uploadCardPhotoManually(@RequestBody CardPhotoUploadManuallyEntity entity) throws ServiceException {
  430. return wasabiCardService.uploadCardPhotoManually(entity);
  431. }
  432. /**
  433. * 证件类型配置列表
  434. *
  435. * @param entity
  436. * @return
  437. */
  438. @PostMapping("/card/id/type/config/list")
  439. @FeignClientAnnotation
  440. public ResultWithPagerDto<CardIdTypeConfigDto> getCardIdTypeConfigList(@RequestBody CardIdTypeConfigPageEntity entity) throws ServiceException {
  441. return wasabiCardService.getCardIdTypeConfigList(entity);
  442. }
  443. /**
  444. * 批量新增证件类型配置
  445. *
  446. * @param entitys
  447. * @return
  448. */
  449. @PostMapping("/card/id/type/config/add")
  450. @FeignClientAnnotation
  451. public BaseResultDto batchAddCardIdTypeConfig(@RequestBody List<CardIdTypeConfigAddEntity> entitys) throws ServiceException {
  452. return wasabiCardService.batchAddCardIdTypeConfig(entitys);
  453. }
  454. /**
  455. * 修改证件类型配置
  456. *
  457. * @param entity
  458. * @return
  459. */
  460. @PostMapping("/card/id/type/config/update")
  461. @FeignClientAnnotation
  462. public BaseResultDto updateCardIdTypeConfig(@RequestBody CardIdTypeConfigUpdateEntity entity) throws ServiceException {
  463. return wasabiCardService.updateCardIdTypeConfig(entity);
  464. }
  465. /**
  466. * 删除证件类型配置
  467. *
  468. * @param entity
  469. * @return
  470. */
  471. @PostMapping("/card/id/type/config/delete")
  472. @FeignClientAnnotation
  473. public BaseResultDto deleteCardIdTypeConfig(@RequestBody BaseDeleteEntities entity) throws ServiceException {
  474. return wasabiCardService.deleteCardIdTypeConfig(entity);
  475. }
  476. /**
  477. * 查询cvv码
  478. */
  479. @PostMapping("/card/query/cvv")
  480. @FeignClientAnnotation
  481. public BaseResultDto cardQueryCvv(@RequestBody CardVerifyGoogleCodeEntity entity) throws ServiceException {
  482. return wasabiCardService.cardQueryCvv(entity);
  483. }
  484. /**
  485. * 根据卡号查询卡信息
  486. */
  487. @PostMapping("/card/info/query")
  488. @FeignClientAnnotation
  489. public BaseResultDto queryCardInfoByCardNumber(@RequestBody CardInfoQueryEntity entity) throws ServiceException {
  490. return wasabiCardService.queryCardInfoByCardNumber(entity);
  491. }
  492. /**
  493. * 导入卡号
  494. */
  495. @PostMapping("/card/number/import")
  496. @FeignClientAnnotation
  497. BaseResultDto cardNumberImport(@RequestBody List<CardNumberAddEntity> entityList) throws ServiceException {
  498. return wasabiCardService.cardNumberImport(entityList);
  499. }
  500. /**
  501. * 卡号列表
  502. */
  503. @PostMapping("/card/number/list")
  504. @FeignClientAnnotation
  505. ResultWithPagerDto<CardNumberDto> queryCardNumberList(@RequestBody CardNumberPageEntity entity) throws ServiceException {
  506. return wasabiCardService.queryCardNumberList(entity);
  507. }
  508. /**
  509. * 卡号列表
  510. */
  511. @PostMapping("/card/number/dropdown")
  512. @FeignClientAnnotation
  513. BaseResultDto queryCardNumberDropdown(@RequestBody CardNumberPageEntity entity) throws ServiceException {
  514. return wasabiCardService.queryCardNumberDropdown(entity);
  515. }
  516. /**
  517. * 修改卡号状态
  518. */
  519. @PostMapping("/card/number/update/status")
  520. @FeignClientAnnotation
  521. BaseResultDto saveCardNumberStatus(@RequestBody CardNumberUpdateEntity entity) throws ServiceException {
  522. return wasabiCardService.saveCardNumberStatus(entity);
  523. }
  524. /**
  525. * 删除实体卡卡号
  526. */
  527. @PostMapping("/card/number/delete")
  528. @FeignClientAnnotation
  529. public BaseResultDto deleteCardNumber(@RequestBody BaseDeleteEntities entity) throws ServiceException {
  530. return wasabiCardService.deleteCardNumber(entity);
  531. }
  532. /**
  533. * 用户信息导出
  534. */
  535. @PostMapping("/merchant/user/list/export")
  536. @FeignClientAnnotation
  537. public BaseResultDto<List<MerchantUserDto>> merchantUserListExport(@RequestBody MerchantUserPageEntity entity) throws ServiceException {
  538. return wasabiCardService.merchantUserListExport(entity);
  539. }
  540. /**
  541. * kyc认证列表导出
  542. */
  543. @PostMapping("/merchant/kyc/list/export")
  544. @FeignClientAnnotation
  545. BaseResultDto<List<CardKycStatusDto>> merchantKycListExport(@RequestBody CardKycStatusPageEntity entity) throws ServiceException {
  546. return wasabiCardService.merchantKycListExport(entity);
  547. }
  548. /**
  549. * 卡片申请列表导出
  550. */
  551. @PostMapping("/card/apply/list/export")
  552. @FeignClientAnnotation
  553. public BaseResultDto<List<CardApplyDto>> cardApplyListExport(@RequestBody CardApplyPageEntity entity) throws ServiceException {
  554. return wasabiCardService.cardApplyListExport(entity);
  555. }
  556. /**
  557. * 卡片列表导出
  558. */
  559. @PostMapping("/card/list/export")
  560. @FeignClientAnnotation
  561. public BaseResultDto<List<UcardCardDto>> cardListExport(@RequestBody CardPageEntity entity) throws ServiceException {
  562. return wasabiCardService.cardListExport(entity);
  563. }
  564. /**
  565. * 交易记录列表导出
  566. */
  567. @PostMapping("/card/transac/record/export")
  568. @FeignClientAnnotation
  569. public BaseResultDto<List<CardTransacOrderDto>> cardTransacRecordExport(@RequestBody CardTransacOrderPageEntity request) throws ServiceException {
  570. return wasabiCardService.cardTransacRecordExport(request);
  571. }
  572. /**
  573. * 钱包余额记录列表导出
  574. */
  575. @PostMapping("/card/wallet/record/export")
  576. @FeignClientAnnotation
  577. public BaseResultDto<List<CardWalletRecordDto>> cardWalletRecordExport(@RequestBody CardWalletRecordPageEntity request) throws ServiceException {
  578. return wasabiCardService.cardWalletRecordExport(request);
  579. }
  580. /**
  581. * 操作记录列表导出
  582. */
  583. @PostMapping("/card/operate/record/export")
  584. @FeignClientAnnotation
  585. public BaseResultDto<List<CardOperateDto>> cardOperateRecordExport(@RequestBody CardOperatePageEntity entity) throws ServiceException {
  586. return wasabiCardService.cardOperateRecordExport(entity);
  587. }
  588. /**
  589. * 充值记录导出
  590. */
  591. @PostMapping("/card/recharge/list/export")
  592. @FeignClientAnnotation
  593. public BaseResultDto<List<CardRechargeOrderDto>> cardRechargeListExport(@RequestBody CardRechargePageEntity entity) throws ServiceException {
  594. return wasabiCardService.cardRechargeListExport(entity);
  595. }
  596. /**
  597. * 速汇订单导出
  598. */
  599. @PostMapping("/global/order/list/export")
  600. @FeignClientAnnotation
  601. public BaseResultDto<List<GlobalOrderDto>> globalOrderListExport(@RequestBody GlobalOrderPageEntity entity) throws ServiceException {
  602. return wasabiCardService.globalOrderListExport(entity);
  603. }
  604. /**
  605. * 添加文件记录
  606. */
  607. @PostMapping("/card/file/add")
  608. @FeignClientAnnotation
  609. public BaseResultDto cardVideoAdd(@RequestBody @Validated CardFileAddEntity entity) throws ServiceException {
  610. return wasabiCardService.cardFileAdd(entity);
  611. }
  612. /**
  613. * 修改文件
  614. */
  615. @PostMapping("/card/file/update")
  616. @FeignClientAnnotation
  617. public BaseResultDto cardVideoUpdate(@RequestBody @Validated CardFileUpdateEntity entity) throws ServiceException {
  618. return wasabiCardService.cardFileUpdate(entity);
  619. }
  620. /**
  621. * 删除文件
  622. */
  623. @PostMapping("/card/file/delete")
  624. @FeignClientAnnotation
  625. public BaseResultDto cardVideoDelete(@RequestBody BaseDeleteEntities entity) throws ServiceException {
  626. return wasabiCardService.cardFileDelete(entity);
  627. }
  628. /**
  629. * 文件分页列表
  630. */
  631. @PostMapping("/card/file/search/list")
  632. @FeignClientAnnotation
  633. public ResultWithPagerDto<CardFileDto> cardFileSearchList(@RequestBody CardFilePageEntity entity) throws ServiceException {
  634. return wasabiCardService.cardFileSearchList(entity);
  635. }
  636. /**
  637. * 同步币种信息
  638. */
  639. @PostMapping("/global/currencies/save")
  640. @FeignClientAnnotation
  641. public BaseResultDto saveAvailableCurrencies() throws ServiceException {
  642. return wasabiCardService.saveAvailableCurrencies();
  643. }
  644. /**
  645. * 币种分页列表
  646. */
  647. @PostMapping("/global/currencies/list")
  648. @FeignClientAnnotation
  649. ResultWithPagerDto<WasabiAvailableCurrenciesListDto> getCurrenciesPageList(@RequestBody GlobalCurrenciesPageListEntity entity) throws ServiceException {
  650. return wasabiCardService.getCurrenciesPageList(entity);
  651. }
  652. /**
  653. * 支持的币种下拉列表
  654. */
  655. @PostMapping("/global/currencies/dropdown")
  656. @FeignClientAnnotation
  657. public BaseResultDto getCurrenciesDropdown(@RequestBody GlobalCurrenciesDropdownEntity entity) throws ServiceException {
  658. return wasabiCardService.getCurrenciesDropdown(entity);
  659. }
  660. /**
  661. * 币种字段和可选值列表
  662. */
  663. @PostMapping("/global/currencies/field/list")
  664. @FeignClientAnnotation
  665. public BaseResultDto getCurrenciesFieldList(@RequestBody @Validated GlobalCurrenciesFieldListEntity entity) throws ServiceException {
  666. return wasabiCardService.getCurrenciesFieldList(entity);
  667. }
  668. /**
  669. * 创建交易订单
  670. */
  671. @PostMapping("/global/create/order")
  672. @FeignClientAnnotation
  673. public BaseResultDto globalCreateOrder(@RequestBody GlobalCreateOrderEntity entity) throws Exception {
  674. return wasabiCardService.globalCreateOrder(entity);
  675. }
  676. /**
  677. * 取消交易订单
  678. */
  679. @PostMapping("/global/cancel/order")
  680. @FeignClientAnnotation
  681. public BaseResultDto globalCancelOrder(@RequestBody GlobalCancelOrderEntity entity) throws Exception {
  682. return wasabiCardService.globalCancelOrder(entity);
  683. }
  684. /**
  685. * 查询已认证用户列表
  686. */
  687. @PostMapping("/card/query/user/list")
  688. @FeignClientAnnotation
  689. public BaseResultDto queryUcardUserList() throws ServiceException {
  690. return wasabiCardService.queryUcardUserList();
  691. }
  692. /**
  693. * 币种配置更改
  694. */
  695. @PostMapping("/global/currencies/config")
  696. @FeignClientAnnotation
  697. public BaseResultDto globalCurrenciesConfig(@RequestBody GlobalCurrenciesConfigEntity entity) throws ServiceException {
  698. return wasabiCardService.globalCurrenciesConfig(entity);
  699. }
  700. /**
  701. * 查询汇率和手续费率
  702. */
  703. @PostMapping("/global/query/exchange/rate")
  704. @FeignClientAnnotation
  705. public BaseResultDto queryExchangeRate(@RequestBody GlobalQueryExchangeRateEntity entity) throws ServiceException {
  706. return BaseResultDto.success(wasabiCardService.queryExchangeRate(entity));
  707. }
  708. /**
  709. * 查询最新汇率
  710. */
  711. @PostMapping("/global/query/latest/exchange/rate")
  712. @FeignClientAnnotation
  713. public BaseResultDto getExchangeRateByCurrency(@RequestBody GlobalQueryExchangeRateEntity entity) throws ServiceException {
  714. return BaseResultDto.success(wasabiCardService.getExchangeRateByCurrency(entity.getPayoutCurrency(), entity.getTransferTypeId(), entity.getPayoutMethodId()));
  715. }
  716. /**
  717. * 查询账户信息
  718. */
  719. @PostMapping("/card/account/dropdown")
  720. @FeignClientAnnotation
  721. public BaseResultDto cardAccountDropdown(@RequestBody CardAccountDropdownEntity entity) throws ServiceException {
  722. return wasabiCardService.cardAccountDropdown(entity);
  723. }
  724. /**
  725. * 查询支持的城市列表
  726. */
  727. @PostMapping("/global/query/bank/cities")
  728. @FeignClientAnnotation
  729. public BaseResultDto queryBankCities(@RequestBody CardBankCitiesEntity entity) throws ServiceException {
  730. return wasabiCardService.queryBankCities(entity);
  731. }
  732. /**
  733. * 查询币种全局配置
  734. */
  735. @PostMapping("/global/query/currencies/config")
  736. @FeignClientAnnotation
  737. public BaseResultDto getCurrenciesGlobalConfig() throws ServiceException {
  738. return wasabiCardService.getCurrenciesGlobalConfig();
  739. }
  740. /**
  741. * 速汇订单分页列表
  742. */
  743. @PostMapping("/global/order/page/list")
  744. @FeignClientAnnotation
  745. public ResultWithPagerDto<GlobalOrderDto> globalOrderPageList(@RequestBody GlobalOrderPageEntity entity) throws Exception {
  746. return wasabiCardService.globalOrderPageList(entity);
  747. }
  748. /**
  749. * 补充资料
  750. */
  751. @PostMapping("/global/supplementary/data")
  752. @FeignClientAnnotation
  753. public BaseResultDto supplementaryData(@RequestBody WasabiTransactionSubmitRfiEntity entity) throws Exception {
  754. return wasabiCardService.supplementaryData(entity);
  755. }
  756. /**
  757. * 速汇订单审批
  758. */
  759. @PostMapping("/global/order/approve")
  760. @FeignClientAnnotation
  761. public BaseResultDto globalOrderApprove(@RequestBody GlobalOrderApproveEntity entity) throws Exception {
  762. return wasabiCardService.globalOrderApprove(entity);
  763. }
  764. /**
  765. * 查询速汇订单详情
  766. */
  767. @PostMapping("/global/order/details")
  768. @FeignClientAnnotation
  769. public BaseResultDto queryGlobalOrderDetails(@RequestBody BaseEntity entity) throws ServiceException {
  770. return wasabiCardService.queryGlobalOrderDetails(entity);
  771. }
  772. /**
  773. * 获取收款用户列表
  774. */
  775. @PostMapping("/global/receiver/user/list")
  776. @FeignClientAnnotation
  777. BaseResultDto getGlobalReceiverUserList(@RequestBody GlobalReceiverUserEntity entity) throws ServiceException {
  778. return wasabiCardService.getGlobalReceiverUserList(entity);
  779. }
  780. /**
  781. * 删除收款用户
  782. */
  783. @PostMapping("/global/receiver/user/delete")
  784. @FeignClientAnnotation
  785. BaseResultDto deleteGlobalReceiverUser(@RequestBody BaseEntity entity) throws ServiceException{
  786. return wasabiCardService.deleteGlobalReceiverUser(entity);
  787. }
  788. /**
  789. * 区块链配置列表
  790. */
  791. @PostMapping("/card/blockchain/config/page")
  792. @FeignClientAnnotation
  793. ResultWithPagerDto<CardBlockchainConfigDto> getCardBlockchainConfigPageList(@RequestBody CardBlockchainConfigPageEntity entity) throws ServiceException{
  794. return wasabiCardService.getCardBlockchainConfigPageList(entity);
  795. }
  796. /**
  797. * 区块链下拉列表
  798. */
  799. @PostMapping("/card/blockchain/dropdown")
  800. @FeignClientAnnotation
  801. BaseResultDto getCardBlockchainDropdown() throws ServiceException{
  802. return wasabiCardService.getCardBlockchainDropdown();
  803. }
  804. /**
  805. * 新增区块链配置
  806. */
  807. @PostMapping("/card/blockchain/config/add")
  808. @FeignClientAnnotation
  809. BaseResultDto addCardBlockchainConfig(@RequestBody CardBlockchainConfigAddEntity entity) throws ServiceException{
  810. return wasabiCardService.addCardBlockchainConfig(entity);
  811. }
  812. /**
  813. * 修改区块链配置
  814. */
  815. @PostMapping("/card/blockchain/config/update")
  816. @FeignClientAnnotation
  817. BaseResultDto updateCardBlockchainConfig(@RequestBody CardBlockchainConfigUpdateEntity entity) throws ServiceException{
  818. return wasabiCardService.updateCardBlockchainConfig(entity);
  819. }
  820. /**
  821. * 删除区块链配置
  822. */
  823. @PostMapping("/card/blockchain/config/delete")
  824. @FeignClientAnnotation
  825. BaseResultDto deleteCardBlockchainConfig(@RequestBody BaseDeleteEntities entity) throws ServiceException{
  826. return wasabiCardService.deleteCardBlockchainConfig(entity);
  827. }
  828. /**
  829. * 区块链配置列表
  830. */
  831. @PostMapping("/card/blockchain/rate/config/page")
  832. @FeignClientAnnotation
  833. ResultWithPagerDto<CardBlockchainRateConfigDto> getCardBlockchainRateConfigPageList(@RequestBody CardBlockchainRateConfigPageEntity entity) throws ServiceException{
  834. return wasabiCardService.getCardBlockchainRateConfigPageList(entity);
  835. }
  836. /**
  837. * 新增区块链配置
  838. */
  839. @PostMapping("/card/blockchain/rate/config/add")
  840. @FeignClientAnnotation
  841. BaseResultDto addCardBlockchainRateConfig(@RequestBody CardBlockchainRateConfigAddEntity entity) throws ServiceException{
  842. return wasabiCardService.addCardBlockchainRateConfig(entity);
  843. }
  844. /**
  845. * 修改区块链配置
  846. */
  847. @PostMapping("/card/blockchain/rate/config/update")
  848. @FeignClientAnnotation
  849. BaseResultDto updateCardBlockchainRateConfig(@RequestBody CardBlockchainRateConfigUpdateEntity entity) throws ServiceException{
  850. return wasabiCardService.updateCardBlockchainRateConfig(entity);
  851. }
  852. /**
  853. * 删除区块链配置
  854. */
  855. @PostMapping("/card/blockchain/rate/config/delete")
  856. @FeignClientAnnotation
  857. BaseResultDto deleteCardBlockchainRateConfig(@RequestBody BaseDeleteEntities entity) throws ServiceException{
  858. return wasabiCardService.deleteCardBlockchainRateConfig(entity);
  859. }
  860. /**
  861. * 钱包地址分页列表
  862. */
  863. @PostMapping("/card/deposit/address/page")
  864. @FeignClientAnnotation
  865. ResultWithPagerDto<VaultodyDepositAddressDto> getDepositAddressPage(@RequestBody VaultodyDepositAddressPageEntity entity) throws ServiceException{
  866. return vaultodyService.getDepositAddressPage(entity);
  867. }
  868. /**
  869. * 重置钱包地址
  870. */
  871. @PostMapping("/card/deposit/address/reset")
  872. @FeignClientAnnotation
  873. BaseResultDto resetDepositAddress(@RequestBody VaultodyResetDepositAddressEntity entity) throws ServiceException{
  874. return vaultodyService.resetDepositAddress(entity);
  875. }
  876. /**
  877. * 加密货币交易分页列表
  878. */
  879. @PostMapping("/encrypted/wallet/transaction/page")
  880. @FeignClientAnnotation
  881. ResultWithPagerDto<EncryptedWalletTransactionDto> getEncryptedWalletTransactionPage(@RequestBody EncryptedWalletTransactionPageEntity entity) throws ServiceException{
  882. return wasabiCardService.getEncryptedWalletTransactionPage(entity);
  883. }
  884. /**
  885. * 加密货币交易记录导出
  886. */
  887. @PostMapping("/encrypted/wallet/transaction/list/export")
  888. @FeignClientAnnotation
  889. BaseResultDto<List<EncryptedWalletTransactionDto>> encryptedWalletTransactionListExport(@RequestBody EncryptedWalletTransactionPageEntity entity) throws ServiceException{
  890. return wasabiCardService.encryptedWalletTransactionListExport(entity);
  891. }
  892. /**
  893. * 卡扣款分页列表
  894. */
  895. @PostMapping("/card/withdraw/page")
  896. @FeignClientAnnotation
  897. ResultWithPagerDto<CardWithdrawDto> queryCardWithdrawPage(@RequestBody CardWithdrawPageEntity entity) throws ServiceException{
  898. return wasabiCardService.queryCardWithdrawPage(entity);
  899. }
  900. /**
  901. * 卡扣款列表导出
  902. */
  903. @PostMapping("/card/withdraw/list/export")
  904. @FeignClientAnnotation
  905. BaseResultDto<List<CardWithdrawDto>> cardWithdrawListExport(@RequestBody CardWithdrawPageEntity entity) throws ServiceException{
  906. return wasabiCardService.cardWithdrawListExport(entity);
  907. }
  908. /**
  909. * 卡3ds分页列表
  910. */
  911. @PostMapping("/card/3ds/transaction/page")
  912. @FeignClientAnnotation
  913. ResultWithPagerDto<Card3dsTransactionDto> queryCard3dsTransactionPage(@RequestBody Card3dsTransactionPageEntity entity) throws ServiceException{
  914. return wasabiCardService.queryCard3dsTransactionPage(entity);
  915. }
  916. /**
  917. * 3ds列表导出
  918. */
  919. @PostMapping("/card/3ds/transaction/list/export")
  920. @FeignClientAnnotation
  921. BaseResultDto<List<Card3dsTransactionDto>> card3dsTransactionListExport(@RequestBody Card3dsTransactionPageEntity entity) throws ServiceException{
  922. return wasabiCardService.card3dsTransactionListExport(entity);
  923. }
  924. /**
  925. * 银行卡授权交易信息数据定时同步查询
  926. */
  927. @Scheduled(cron = "0 0 1 * * ?")
  928. public void queryOrderInfo() throws ServiceException {
  929. log.info("银行卡授权交易信息数据定时同步查询开始: .............................");
  930. try {
  931. wasabiCardService.queryOrderInfo();
  932. } catch (Exception e) {
  933. log.error("银行卡授权交易信息数据定时同步任务执行失败", e);
  934. }
  935. log.info("银行卡授权交易信息数据定时同步查询结束: .............................");
  936. }
  937. /**
  938. * 激活处理中数据查询卡信息并更新数据库
  939. */
  940. @Scheduled(cron = "0 0 * * * ?")
  941. public void queryCardInfo() throws Exception {
  942. log.info("激活中数据同步定时任务开始: .............................");
  943. try {
  944. wasabiCardService.queryCardInfo();
  945. } catch (Exception e) {
  946. log.error("激活中数据同步定时任务执行失败", e);
  947. }
  948. log.info("激活中数据同步定时任务结束: .............................");
  949. }
  950. /**
  951. * 待激活卡片更新邮寄状态任务
  952. */
  953. @Scheduled(cron = "0 0 * * * ?")
  954. public void queryCardLogisticsStatus() throws Exception {
  955. log.info("待激活卡片更新邮寄状态任务开始: .............................");
  956. try {
  957. wasabiCardService.queryCardLogisticsStatus();
  958. } catch (Exception e) {
  959. log.error("待激活卡片更新邮寄状态任务执行失败", e);
  960. }
  961. log.info("待激活卡片更新邮寄状态任务结束: .............................");
  962. }
  963. }