Ver Fonte

feat: 新掉期 接口

huangbin há 4 anos atrás
pai
commit
8cfefc6a82

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.135:8080/cfg?key=test_135"
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
 }

+ 8 - 0
src/router/index.ts

@@ -1724,6 +1724,14 @@ const routes: Array<RouteRecordRaw> = [
                                     requireAuth: true,
                                 },
                             },
+                            {
+                                path: '/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap',
+                                name: 'spot_trade_order_transaction_swap',
+                                component: () => import('@/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue'),
+                                meta: {
+                                    requireAuth: true,
+                                },
+                            },
                         ]
                     },
                     {

+ 41 - 0
src/services/go/Tjmd/index.ts

@@ -0,0 +1,41 @@
+import { commonSearch_go } from "@/services/go";
+import * as type from './interface';
+
+/**
+ * 查询掉期报价列表  /Tjmd/QueryQuoteGoodsList
+ */
+export function queryQuoteGoodsList(req: type.QueryQuoteGoodsListReq): Promise<type.QueryQuoteGoodsListRsp[]> {
+    return commonSearch_go('/Tjmd/QueryQuoteGoodsList', req).catch((err) => {
+        throw new Error(`查询掉期报价列表 : ${err}`);
+    });
+}
+
+/**
+ * 查询今日账户保证金配置  /Tjmd/QueryTjmdTodayAccountMargin
+ */
+export function queryTjmdTodayAccountMargin(req: type.QueryTjmdTodayAccountMarginReq): Promise<type.TjmdTodayAccountMarginReq[]> {
+    return commonSearch_go('/Tjmd/QueryTjmdTodayAccountMargin', req).catch((err) => {
+        throw new Error(`查询今日账户保证金配置 : ${err}`);
+    });
+}
+
+/**
+ * 查询掉期买卖大厅  /Tjmd/QueryTjmdTradeOrderDetail
+ */
+export function queryTjmdTradeOrderDetail(req: type.QueryTjmdTradeOrderDetailReq): Promise<type.QueryTjmdTradeOrderDetailRsp[]> {
+    return commonSearch_go('/Tjmd/QueryTjmdTradeOrderDetail', req).catch((err) => {
+        throw new Error(`查询掉期买卖大厅 : ${err}`);
+    });
+}
+
+/**
+ * 查询掉期协议单  /Tjmd/QueryTjmdTransferApply
+ */
+export function queryTjmdTransferApply(req: type.QueryTjmdTransferApplyReq): Promise<type.QueryTjmdTransferApplyRsp[]> {
+    return commonSearch_go('/Tjmd/QueryTjmdTransferApply', req).catch((err) => {
+        throw new Error(`查询掉期协议单 : ${err}`);
+    });
+}
+
+
+

+ 91 - 0
src/services/go/Tjmd/interface.ts

@@ -0,0 +1,91 @@
+export interface QueryQuoteGoodsListReq {
+    usertype: number;//用户类型
+    marketids?: string;//市场id, 格式 1,2,3
+    goodsgroupid?: number;//商品组id
+    goodsid?: number;//商品id
+}
+
+export interface QueryQuoteGoodsListRsp {
+    buyqty: number;//买量(暂不做, 无值, 保留字段)
+    goodscode: string;//合约代码
+    goodsgroupid: number;//商品组ID(自增ID)
+    goodsgroupname: string;//商品组名称
+    goodsid: number;//合约id
+    goodsname: string;//合约名称
+    refgoodscode: string;//标的合约代码
+    refgoodsid: number;//标的合约id
+    refgoodsname: string;//标的合约名称
+    sellqty: number;//卖量(暂不做, 无值, 保留字段)
+}
+
+export interface QueryTjmdTodayAccountMarginReq {
+    marketids?: string;//市场id, 格式 1,2,3
+    goodsid?: number;//商品id
+    accountid?: string; // 资金账号
+}
+
+export interface GoodsMarginCfgStruct {
+    CustomerTypeID: number;//投资者客户类型
+    GoodsID: number;//商品ID
+    IsDefault: number;//是否默认标志位
+    LockMarginValue: number;//锁仓保证金
+    MarginAlgorithm: number;//保证金计算方式
+    MarketMarginValue: number;//即市保证金值
+    RealMarginAlgorithm: number;//实付保证金计算方式
+    RealMarginValue: number;//实付比例
+    ReckonMarginValue: number;//结算保证金值
+}
+
+export interface TjmdTodayAccountMarginReq {
+    accountid: number; // 账号ID
+    goodsid: number; // 商品ID
+    marketid: number; // 市场ID
+    infoc: GoodsMarginCfgStruct[]
+}
+
+export interface QueryTjmdTradeOrderDetailReq {
+    page?: number; // 页码
+    pagesize?: number; // 每页条数
+    userid: number; // 用户id
+    usertype: number; // 用户类型
+    marketids?: string; // 市场id, 格式 1,2,3
+    goodsid: number; // 商品id
+    buyorsell: 0 | 1; // 买卖方向 0-买 1-卖
+}
+
+export interface QueryTjmdTradeOrderDetailRsp {
+    buyorsell: number;//买卖方向 number;
+    //-买 1-卖
+    goodsid: number;//商品id
+    marketmaxsub: number;//市价最大偏移范围 [浮动价 - 点差]
+    orderid: string;//委托单号
+    orderprice: number;//委托价格
+    orderqty: number;//委托数量
+    pricemode: number;//取价方式 - 1:市价 2: 限价 3:浮动价
+    userid: number;//用户id
+    username: string;//用户名称(已脱敏)
+}
+
+export interface QueryTjmdTransferApplyReq {
+    applytype: 1 | 2  // 类型 1-我的申请 2-对方申请
+    marketids?: string  // 市场id, 格式 1,2,3
+    accountids?: string  // 资金账号, 格式 25000000001,25000000003
+}
+
+export interface QueryTjmdTransferApplyRsp {
+    applyid: number;//申请ID(自增ID SEQ_TRADE_HOLDTRANSFERAPPLY)
+    applystatus: number;//状态 - number;
+    //:未提交 1:待审核 2:审核中 3:审核通过 4:审核拒绝 5:审核失败 6:已撤销
+    applytime: string;//申请时间(时间)
+    auditremark: string;//审核备注(拒绝原因?)
+    buyorsell: number;//买卖 - number;
+    //:买 1:卖
+    goodscode: string;//商品代码
+    goodsid: number;//商品ID
+    goodsname: string;//商品名称
+    marketid: number;//市场ID
+    qty: number;//转让数量(数量)
+    tradeid: string;//成交单号(关联持仓)
+    transferamount: number;//转让总金额(金额)
+    transferprice: number;//转让价格(协议价格)
+}

+ 128 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue

@@ -0,0 +1,128 @@
+<template>
+  <!--订单交易 挂牌转让-->
+  <div class="topTableHeight">
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'secondTabTable' : 'secondTabTableNoBottom', getQuoteList().length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 407px)' : 'calc(100vh - 167px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="goodscode"
+             ref="tableRef"
+             :data-source="getQuoteList()">
+      <template #totalturnover="{ text }">
+        <span>{{changeUnit(text)}}</span>
+      </template>
+      <!-- 涨跌 -->
+      <template #change="{ record }">
+        <span>{{quoteChange(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 幅度 -->
+      <template #amplitude="{ record }">
+        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+      </template>
+      <!-- 振幅 -->
+      <template #vibration="{ record }">
+        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+      </template>
+      <template #index="{ index }">
+        <span>{{index + 1}}</span>
+      </template>
+      <!-- 买价 -->
+      <template #bid="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 卖价 -->
+      <template #ask="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最新价 -->
+      <template #last="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最低价 -->
+      <template #lowest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+      <!-- 最高价 -->
+      <template #highest="{ text, record }">
+        <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
+      </template>
+    </a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="btnList"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               :deliverGoods="findDeilverGoodsByGoodsCode(selectedRow.goodscode)"
+               @cancel="closeComponent"></component>
+  </div>
+</template>
+
+<script lang="ts">
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
+
+import { handleDeliveryRelation } from '../setup';
+
+import { handleSubcriteOnDemandQuote, handleQuotePriceColor, quoteChange, quoteAmplitude, quoteAmplituOfVibration } from '@/common/setup/table/tableQuote';
+import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
+import { columnsList } from '../setup';
+
+import { handleTableEventAndData } from '@/common/setup/table/compose';
+import { TableParam } from '@/common/setup/table/interface';
+import { BtnListType } from '@/common/components/btnList/interface';
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
+import { getShowBottomValue } from '@/common/config/constrolBottom';
+import { ref } from 'vue';
+
+export default defineComponent({
+    name: 'spot_trade_order_transaction_swap',
+    components: {
+        contextMenu,
+        BuyAndSell: defineAsyncComponent(() => import('../components/buy-sell-market/index.vue')),
+        Listing: defineAsyncComponent(() => import('../components/listing/index.vue')),
+        Detail: defineAsyncComponent(() => import('../components/detail/index.vue')),
+    },
+    setup() {
+        const isBottom = getShowBottomValue();
+        const loading = ref<boolean>(false);
+        const param: TableParam = {
+            columnsList,
+            queryFn: () => {},
+            clickName: 'BuyAndSell',
+        };
+        const btnList: BtnListType[] = [
+            { lable: '挂牌求购', code: 'Listing', className: 'btnDeafault' },
+            { lable: '详情', code: 'Detail', className: 'btnDeafault' },
+            { lable: '买卖大厅', code: 'BuyAndSell', className: 'btnDeafault' },
+        ];
+        const { deliverGoods, getQuoteList, goodsList, findDeilverGoodsByGoodsCode } = handleDeliveryRelation([1, 3]);
+        // 行情按需订阅
+        handleSubcriteOnDemandQuote<QueryDeliveryRelationRsp>(deliverGoods);
+
+        return {
+            isBottom,
+            ...handleTableEventAndData<QueryQuoteDayRsp>(param),
+            deliverGoods,
+            btnList,
+            handleQuotePriceColor,
+            quoteChange,
+            quoteAmplitude,
+            quoteAmplituOfVibration,
+            getQuoteList,
+            findDeilverGoodsByGoodsCode,
+            goodsList,
+            loading,
+        };
+    },
+});
+</script>
+<style lang="less">
+.noData {
+    .position(absolute, 28px, 0, 0, 0);
+}
+</style>

+ 0 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts


+ 16 - 46
swagger-to-ts/swagger.ts

@@ -1,47 +1,17 @@
-export interface Name {
-    accountid: number;//摘牌资金账号
-    applyprice: string;//申请价格(议价价格)
-    applyqty: number;//摘牌数量(议价数量)
-    applyremark: string;//申请备注
-    applystatus: number;//申请状态(议价状态) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
-    applytime: string;//申请时间(议价时间)
-    buyorsell: number;//买卖(挂牌类型) - number;
-    //:买 1:卖
-    confirmremark: string;//确认备注
-    confirmtime: string;//确认时间
-    confirmuserid: number;//确认人
-    deliverygoodscode: string;//品种代码
-    deliverygoodsid: number;//品种ID
-    deliverygoodsname: string;//品种名称
-    deliverymonth: string;//交收月
-    enumdicname: string;//单位名称
-    fixedprice: number;//挂牌价格
-    handlestatus: number;//处理状态
-    marginvalue: number;//履约保证金比例
-    marketid: number;//市场ID
-    matchaccountid: number;//挂牌方资金账号
-    matchuserid: number;//挂牌方用户id
-    matchusername: string;//挂牌方用户名称(已脱敏)
-    minivalue: number;//现货商品最小变动值
-    optioncompare: string;//选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
-    orderqty: number;//挂牌数量
-    refprice: string;//参考价格
-    retcode: number;//委托返回代码
-    templatename: string;//履约方式(履约模板名称)
-    tradedate: string;//交易日(yyyyMMdd)
-    userid: number;//摘牌人用户ID(议价人ID)
-    username: string;//议价人名字(已脱敏)
-    validtime: string;//有效期限
-    warehouseid: number;//仓库ID
-    warehousename: string;//仓库名称
-    wrbargainid: string;//议价申请单ID(327+Unix秒时间戳(1number;
-    //位)+xxxxxx)
-    wrfactortypeid: string;//仓单要素类型ID(212+Unix秒时间戳(1number;
-    //位)+xxxxxx)
-    wrfactortypename: string;//仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
-    wrstandardcode: string;//现货商品代码
-    wrstandardid: number;//现货商品ID
-    wrstandardname: string;//商品名称
-    wrtradeorderid: string;//关联委托单ID
-    wrtypename: string;//商品
+export interface Name{
+    applyid	:number;//申请ID(自增ID SEQ_TRADE_HOLDTRANSFERAPPLY)
+applystatus	:number;//状态 - number;
+//:未提交 1:待审核 2:审核中 3:审核通过 4:审核拒绝 5:审核失败 6:已撤销
+applytime	:string;//申请时间(时间)
+auditremark	:string;//审核备注(拒绝原因?)
+buyorsell	:number;//买卖 - number;
+//:买 1:卖
+goodscode	:string;//商品代码
+goodsid	:number;//商品ID
+goodsname	:string;//商品名称
+marketid	:number;//市场ID
+qty	:number;//转让数量(数量)
+tradeid	:string;//成交单号(关联持仓)
+transferamount	:number;//转让总金额(金额)
+transferprice	:number;//转让价格(协议价格)
 }

+ 22 - 109
swagger-to-ts/swagger.txt

@@ -1,127 +1,40 @@
 {
-    accountid	integer
-摘牌资金账号
-
-applyprice	string
-申请价格(议价价格)
-
-applyqty	number
-摘牌数量(议价数量)
-
-applyremark	string
-申请备注
+    applyid	integer
+申请ID(自增ID SEQ_TRADE_HOLDTRANSFERAPPLY)
 
 applystatus	integer
-申请状态(议价状态) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+状态 - 0:未提交 1:待审核 2:审核中 3:审核通过 4:审核拒绝 5:审核失败 6:已撤销
 
 applytime	string
-申请时间(议价时间)
-
-buyorsell	integer
-买卖(挂牌类型) - 0:买 1:卖
-
-confirmremark	string
-确认备注
-
-confirmtime	string
-确认时间
-
-confirmuserid	integer
-确认人
-
-deliverygoodscode	string
-品种代码
+申请时间(时间)
 
-deliverygoodsid	integer
-品种ID
+auditremark	string
+审核备注(拒绝原因?)
 
-deliverygoodsname	string
-品种名称
-
-deliverymonth	string
-交收月
-
-enumdicname	string
-单位名称
+buyorsell	integer
+买卖 - 0:买 1:卖
 
-fixedprice	number
-挂牌价格
+goodscode	string
+商品代码
 
-handlestatus	integer
-处理状态
+goodsid	integer
+商品ID
 
-marginvalue	number
-履约保证金比例
+goodsname	string
+商品名称
 
 marketid	integer
 市场ID
 
-matchaccountid	integer
-挂牌方资金账号
-
-matchuserid	integer
-挂牌方用户id
-
-matchusername	string
-挂牌方用户名称(已脱敏)
-
-minivalue	integer
-现货商品最小变动值
-
-optioncompare	string
-选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+qty	number
+转让数量(数量)
 
-orderqty	integer
-挂牌数量
-
-refprice	string
-参考价格
-
-retcode	integer
-委托返回代码
-
-templatename	string
-履约方式(履约模板名称)
-
-tradedate	string
-交易日(yyyyMMdd)
-
-userid	integer
-摘牌人用户ID(议价人ID)
-
-username	string
-议价人名字(已脱敏)
-
-validtime	string
-有效期限
-
-warehouseid	integer
-仓库ID
-
-warehousename	string
-仓库名称
-
-wrbargainid	string
-议价申请单ID(327+Unix秒时间戳(10位)+xxxxxx)
-
-wrfactortypeid	string
-仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
-
-wrfactortypename	string
-仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
-
-wrstandardcode	string
-现货商品代码
-
-wrstandardid	integer
-现货商品ID
-
-wrstandardname	string
-商品名称
+tradeid	string
+成交单号(关联持仓)
 
-wrtradeorderid	string
-关联委托单ID
+transferamount	number
+转让总金额(金额)
 
-wrtypename	string
-商品
+transferprice	number
+转让价格(协议价格)
 }