index.ts 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. import { v4 } from 'uuid'
  2. import { RequestConfig } from '@/services/http/types'
  3. import { useLoginStore, useAccountStore } from '@/stores'
  4. import http from '@/services/http'
  5. const loginStore = useLoginStore()
  6. const accountStore = useAccountStore()
  7. /**
  8. * 账户资金信息请求
  9. */
  10. export function accountFundInfoReq(config: RequestConfig<Proto.AccountFundInfoReq>) {
  11. return http.mqRequest<Proto.AccountFundInfoRsp>({
  12. data: config.data,
  13. requestCode: 'AccountFundInfoReq',
  14. responseCode: 'AccountFundInfoRsp',
  15. })
  16. }
  17. /**
  18. * 银行签约
  19. */
  20. export function t2bBankSign(config: RequestConfig<Partial<Proto.t2bBankSignReq>>) {
  21. return http.mqRequest<Proto.t2bBankSignRsp>({
  22. data: config.data,
  23. requestCode: 't2bBankSignReq',
  24. responseCode: 't2bBankSignRsp',
  25. })
  26. }
  27. /**
  28. * 短信验证码请求
  29. */
  30. export function t2bSMSVerificationCode(config: RequestConfig<Partial<Proto.t2bSWSVerificationCodeReq>>) {
  31. return http.mqRequest<Proto.t2bSWSVerificationCodeRsp>({
  32. data: config.data,
  33. requestCode: 't2bSMSVerificationCodeReq',
  34. responseCode: 't2bSMSVerificationCodeRsp',
  35. })
  36. }
  37. /**
  38. * 银行解约
  39. */
  40. export function t2bBankCancelSign(config: RequestConfig<Partial<Proto.t2bBankCancelSignReq>>) {
  41. return http.mqRequest<Proto.t2bBankCancelSignRsp>({
  42. data: config.data,
  43. requestCode: 't2bBankCancelSignReq',
  44. responseCode: 't2bBankCancelSignRsp',
  45. })
  46. }
  47. /**
  48. * 出金申请
  49. */
  50. export function t2bBankWithdraw(config: RequestConfig<Partial<Proto.t2bBankWithdrawReq>>) {
  51. return http.mqRequest<Proto.t2bBankWithdrawRsp>({
  52. data: config.data,
  53. requestCode: 't2bBankWithdrawReq',
  54. responseCode: 't2bBankWithdrawRsp',
  55. })
  56. }
  57. /**
  58. * 入金申请
  59. */
  60. export function t2bBankDeposit(config: RequestConfig<Partial<Proto.t2bBankDepositReq>>) {
  61. return http.mqRequest<Proto.t2bBankDepositRsp>({
  62. data: config.data,
  63. requestCode: 't2bBankDepositReq',
  64. responseCode: 't2bBankDepositRsp',
  65. })
  66. }
  67. /**
  68. * 云缴费代扣入金申请
  69. */
  70. export function YJF_WithholdInApply(config: RequestConfig<Partial<Proto.YJF_WithholdInApplyReq>>) {
  71. return http.mqRequest<Proto.YJF_WithholdInApplyRsp>({
  72. data: config.data,
  73. requestCode: 'YJF_WithholdInApplyReq',
  74. responseCode: 'YJF_WithholdInApplyRsp',
  75. })
  76. }
  77. /**
  78. * 云缴费代扣解约
  79. */
  80. export function YJF_WithholdSignOut(config: RequestConfig<Partial<Proto.YJF_WithholdSignOutReq>>) {
  81. return http.mqRequest<Proto.YJF_WithholdSignOutRsp>({
  82. data: config.data,
  83. requestCode: 'YJF_WithholdSignOutReq',
  84. responseCode: 'YJF_WithholdSignOutRsp',
  85. })
  86. }
  87. /**
  88. * 云缴费代扣签约
  89. */
  90. export function YJF_WithholdSignInSMS(config: RequestConfig<Partial<Proto.YJF_WithholdSignInSMSReq>>) {
  91. return http.mqRequest<Proto.YJF_WithholdSignInSMSRsp>({
  92. data: config.data,
  93. requestCode: 'YJF_WithholdSignInSMSReq',
  94. responseCode: 'YJF_WithholdSignInSMSRsp',
  95. })
  96. }
  97. /**
  98. * 云缴费获取代扣签约短信验证码
  99. */
  100. export function YJF_GetWithholdSignInSMSVCode(config: RequestConfig<Partial<Proto.YJF_GetWithholdSignInSMSVCodeReq>>) {
  101. return http.mqRequest<Proto.YJF_GetWithholdSignInSMSVCodeRsp>({
  102. data: config.data,
  103. requestCode: 'YJF_GetWithholdSignInSMSVCodeReq',
  104. responseCode: 'YJF_GetWithholdSignInSMSVCodeRsp',
  105. })
  106. }
  107. /**
  108. * 数字账户转入转出申请
  109. */
  110. export function DigitalAccountTransferApply(config: RequestConfig<Partial<Proto.DigitalAccountTransferApplyReq>>) {
  111. return http.mqRequest<Proto.DigitalAccountTransferApplyRsp>({
  112. data: {
  113. OperateSrc: 2,
  114. ClientTicket: v4(),
  115. ...config.data
  116. },
  117. requestCode: 'DigitalAccountTransferApplyReq',
  118. responseCode: 'DigitalAccountTransferApplyRsp',
  119. marketId: 19
  120. })
  121. }
  122. /**
  123. * 查询托管银行
  124. */
  125. export function queryCusBankSignBank(config: RequestConfig = {}) {
  126. return http.commonRequest<Model.CusBankSignBankRsp[]>({
  127. url: '/Qhj/QueryCusBankSignBank',
  128. params: config.data,
  129. })
  130. }
  131. /**
  132. * 查询开户行
  133. */
  134. export function queryBankInfo(config: RequestConfig = {}) {
  135. return http.commonRequest<Model.BankInfoRsp[]>({
  136. url: '/Qhj/QueryBankInfo',
  137. params: config.data,
  138. })
  139. }
  140. /**
  141. * 查询签约银行信息(出金账户管理)
  142. */
  143. export function queryBankAccountSign(config: RequestConfig<Model.BankAccountSignReq> = {}) {
  144. return http.commonRequest<Model.BankAccountSignRsp[]>({
  145. url: '/Qhj/QueryBankAccountSign',
  146. params: {
  147. userid: loginStore.userId,
  148. ...config.data
  149. },
  150. })
  151. }
  152. /**
  153. * 查询充值出金
  154. */
  155. export function queryAccountInOutApply(config: RequestConfig<Model.AccountInOutApplyReq> = {}) {
  156. return http.commonRequest<Model.AccountOutInApplyRsp[]>({
  157. url: '/Qhj/QueryAccountInOutApply',
  158. params: {
  159. userid: loginStore.userId,
  160. ...config.data
  161. },
  162. })
  163. }
  164. /**
  165. * 获取银行支付地址
  166. */
  167. export function getAmtInByPaidUrl(config: RequestConfig<Model.AmtInByPaidUrlReq> = {}) {
  168. return http.commonRequest<Model.AmtInByPaidUrlRsp>({
  169. url: '/Bank/GetAmtInByPaidUrl',
  170. params: {
  171. accountid: accountStore.currentAccountId,
  172. ...config.data
  173. },
  174. })
  175. }
  176. /**
  177. * 资金流水查询(历史)
  178. */
  179. export function queryHisAmountLog(config: RequestConfig<Model.HisAmountLogReq> = {}) {
  180. return http.commonRequest<Model.HisAmountLogRsp[]>({
  181. url: '/TaAccount/QueryHisAmountLog',
  182. params: {
  183. accountID: accountStore.currentAccountId.toString(),
  184. ...config.data
  185. },
  186. })
  187. }
  188. /**
  189. * 资金流水查询(当前)
  190. */
  191. export function queryAmountLog(config: RequestConfig<Model.AmountLogReq> = {}) {
  192. return http.commonRequest<Model.AmountLogRsp[]>({
  193. url: '/TaAccount/QueryAmountLog',
  194. params: {
  195. accountID: accountStore.currentAccountId.toString(),
  196. ...config.data
  197. },
  198. })
  199. }
  200. /**
  201. * 查询托管银行扩展配置信息
  202. */
  203. export function queryBankCusBankExtendConfigs(config: RequestConfig<Model.BankCusBankExtendConfigReq> = {}) {
  204. return http.commonRequest<Model.BankCusBankExtendConfigRsp[]>({
  205. url: '/Bank/QueryBankCusBankExtendConfigs',
  206. params: {
  207. ...config.data
  208. },
  209. })
  210. }
  211. /**
  212. * 查询银行支行联行号信息表
  213. */
  214. export function queryBankBranChnumInfo(config: RequestConfig<Model.BankBranChnumInfoReq> = {}) {
  215. return http.commonRequest<Model.BankBranChnumInfoRsp[]>({
  216. url: '/Bank/QueryBankBranChnumInfo',
  217. params: config.data,
  218. })
  219. }
  220. /**
  221. * 获取代扣签约信息表
  222. */
  223. export function queryGetGtwithholdsigninfo(config: RequestConfig<Model.GTWithHoldSignInfoReq> = {}) {
  224. return http.commonRequest<Model.GTWithHoldSignInfoRsp[]>({
  225. url: '/TaAccount/GetGtwithholdsigninfo',
  226. params: {
  227. userid: loginStore.userId,
  228. ...config.data
  229. },
  230. })
  231. }
  232. /**
  233. * 查询代扣入金申请表
  234. */
  235. export function queryGtwithholddepositapply(config: RequestConfig<Model.GTWithHoldDepositApplyReq> = {}) {
  236. return http.commonRequest<Model.GTWithHoldDepositApplyRsp[]>({
  237. url: '/TaAccount/QueryGtwithholddepositapply',
  238. params: {
  239. userid: loginStore.userId,
  240. ...config.data
  241. }
  242. })
  243. }
  244. /**
  245. * 查询所属机构托管银行
  246. */
  247. export function queryMemberCusBankInfo(config: RequestConfig<Model.BankAccountSignReq> = {}) {
  248. return http.commonRequest<Model.CusBankSignBankRsp[]>({
  249. url: '/Qhj/QueryMemberCusBankInfo',
  250. params: {
  251. userid: loginStore.userId,
  252. ...config.data
  253. },
  254. })
  255. }
  256. /**
  257. * 获取支付中心混合支付渠道配置信息列表
  258. */
  259. export function getHybridConfigs(config: RequestConfig = {}) {
  260. return http.commonRequest<Model.PaymentCenterHybridConfigs[]>({
  261. url: '/Bank/GetHybridConfigs',
  262. params: config.data,
  263. })
  264. }
  265. /**
  266. * 查询混合支付出金接收者信息
  267. */
  268. export function queryHybridReceiverOnboards(config: RequestConfig = {}) {
  269. return http.commonRequest<Model.HybridReceiverOnboard[]>({
  270. url: '/Bank/QueryHybridReceiverOnboards',
  271. params: config.data,
  272. })
  273. }