소스 검색

市场运行信息

huangbin 4 년 전
부모
커밋
3f714c1f16

+ 1 - 1
src/common/constants/enumCommon.ts

@@ -120,7 +120,7 @@ export enum TradeMode {
 
 // 协议类型
 export enum AgreementType {
-    register = 1,   // 注册 
+    register = 1,   // 注册
     login,  // 登录
     trade,  // 交易
 }

+ 2 - 1
src/services/bus/index.ts

@@ -9,6 +9,7 @@ import { setServiceURL } from '@/services/request/serviceURL';
 import ProtobufCtr from '@/services/socket/protobuf/index';
 import { localStorageUtil } from '@/utils/storage';
 import { message } from 'ant-design-vue';
+import { queryMarketRun } from '../go/commonMarket';
 import { GetErmcpGoods, QueryDeliveryGoodsDetail } from '../go/ermcp/goodsInfo';
 import { getTaAccount } from '../go/TaAccount';
 
@@ -35,7 +36,7 @@ export async function globalDataRefresh(): Promise<string> {
             } else {
                 // token校验成功 马上轮询
                 checkTokenLoop();
-                await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount()])
+                await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount(), queryMarketRun()])
             }
         } else {
             // 重置数据中心数据

+ 2 - 1
src/services/bus/login.ts

@@ -7,6 +7,7 @@ import { GetLoginID, LoginQuery } from '@/services/go/useInfo/index';
 import { localStorageUtil } from '@/utils/storage';
 import { sessionStorageUtil } from '@/utils/storage/index';
 import Long from 'long';
+import { queryMarketRun } from '../go/commonMarket';
 import { getTaAccount } from '../go/TaAccount';
 import { logoutResponse } from '../socket/login';
 import { loginAction } from '../socket/login/index';
@@ -25,7 +26,7 @@ export const login = async (logidCode: string, password: string, byteArr: Uint8A
         const loginData = await loginAction(account, password, byteArr, isEncryt);
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
-        await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount()])
+        await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount(), queryMarketRun()])
         // await GetPCMenus();
         // await QueryTableDefine();
         // 获取服务时间

+ 13 - 1
src/services/bus/market.ts

@@ -1,7 +1,19 @@
 import { TradeMode } from "@/common/constants/enumCommon";
 import APP from '@/services';
+import { Marketrun } from "../go/commonMarket/interface";
 import { Market } from "../go/useInfo/interface";
 
-export function getMarketByTradeMode(trademode: TradeMode) {
+export function getMarketByTradeMode(trademode: TradeMode): Market | undefined {
     return APP.get('markets').find((el: Market) => el.trademode === trademode)
+}
+
+// 获取市场运行信息
+export function getMarketRunByTradeMode(trademode: TradeMode): Marketrun | null {
+    const marketInfo = getMarketByTradeMode(trademode)
+    let result = null
+    if (marketInfo) {
+        const temp = APP.get('marketRun').find((el: Market) => el.marketid === marketInfo.marketid)
+        result = temp ? temp : null;
+    }
+    return result
 }

+ 3 - 2
src/services/dataCenter/index.ts

@@ -1,5 +1,5 @@
 import { reactive, toRefs } from 'vue';
-import { LastUpdateTimeModel, LoginaccountModel, TradeDateModel, userAccountModel, UserInfoModel } from './initDataModel/account';
+import { LastUpdateTimeModel, LoginaccountModel, MarketrunModal, TradeDateModel, UserAccountModel, UserInfoModel } from './initDataModel/account';
 import { NeedClearSourceDataType, NoClearSourceDataType } from './interface';
 
 /**
@@ -12,7 +12,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     loginAccount: new LoginaccountModel(),
     markets: [],
     systemParams: [], // 系统参数
-    userAccount: new userAccountModel(), // 用户账号信息
+    userAccount: new UserAccountModel(), // 用户账号信息
     userInfo: new UserInfoModel(), // 用户信息
     username: '',
     menus: [],
@@ -20,6 +20,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     areaRoles: [],// 所属角色信息
     Goods: [],
     DeliveryGoodsList: [],
+    marketRun: new MarketrunModal(), // 市场运行信息
 
     queryClientFixedADConfigs: [],
     // checkTokenTimeDiff: Math.floor(Math.random() * 6 + 5) * 60 * 1000,

+ 27 - 1
src/services/dataCenter/initDataModel/account.ts

@@ -1,4 +1,5 @@
 import { LastUpdateTime, TradeDate } from '@/services/dataCenter/interafce/account';
+import { Marketrun } from '@/services/go/commonMarket/interface';
 import { Loginaccount, Useraccount, Userinfo } from '@/services/go/useInfo/interface';
 
 /**
@@ -111,7 +112,7 @@ export class LoginaccountModel implements Loginaccount {
     unfreezetime = '';
     userid = 0;
 }
-export class userAccountModel implements Useraccount {
+export class UserAccountModel implements Useraccount {
     accountname = '';
     accountstatus = 0;
     auditremark = '';
@@ -139,3 +140,28 @@ export class userAccountModel implements Useraccount {
     userid = 0;
     usertype = 0;
 }
+
+
+export class MarketrunModal implements Marketrun {
+    afternexttradedate = ''; //下下交易日
+    clearquoteflag = 0;//行情清盘标志- 1:未发送 2:已发送 3:已回复
+    lastreckondate = '';//最新交易日(结算成功)
+    machinedate = '';//机器时间
+    manualflag = 0;//手动开市标志- number;
+    //:否 1:是 (市场为手动时,是否触发了手动开市标志)
+    marketid = 0;//市场ID
+    nexttradedate = '';//下一交易日
+    pretradedate = '';//上一交易日
+    reckonflag = 0;//结算标识 - number;
+    //: 停止结算 1: 正常(管理端控制此字段,交易服务根据此字段判断是否做结算)
+    runstatus = 1;//运行状态 - number;
+    //:初始化 1:待开市 2:开市 3:休市 4:手工休市 5:闭市 6:确认行权开始 7:确认行权结束 1number;
+    //:日终处理开始 11:日终处理成功 12:日终处理失败 13基础服务结算开始 14基础服务结算成功 23.资金结算开始 24.资金结算成功 25.资金结算失败 26.系统结算成功 27.系统结算失败 28.盘中处理开始 29.盘中处理成功 3number;
+    //.盘中处理失败 31.资金结算开始(内) 32.资金结算成功(内) 33.资金结算失败(内) 4number;
+    //.签到开始 41.签到成功 42.签到部份成功 43.签到失败 44.签退开始 45.签退成功 46.签退部份成功 47.签退失败 48.对账开始 49.对账成功 5number;
+    //.对账失败 51.清算开始 52.清算成功 53.清算失败 54.清算部分成功 55. 系统结算开始 62.今日免清算
+    sectionid = 0;//时间段号[多时段时用]
+    tradedate = '';//当前交易日(服务) 资金结算完成即变更,供交易服务使用
+    tradedate2 = '';//当前交易日(行情) 在第一个市场待开市时变更为TradeDate,供行情及终端系统使用
+    updatetime = '';//更新时间
+}

+ 2 - 0
src/services/dataCenter/interface.ts

@@ -3,6 +3,7 @@ import { ErmcpDeliveryGoodsDetailEx, Goods } from '@/services/go/ermcp/goodsInfo
 import * as useInfo from '@/services/go/useInfo/interface';
 import * as mineType from '@/services/http/mine/interface';
 import * as Type from '@/services/http/notice/interface';
+import { Marketrun } from '../go/commonMarket/interface';
 import * as advert from '../http/advert/interface';
 import { QuoteDay } from '../http/quote/interface';
 import { AccountListItem, LastUpdateTime, TradeDate } from './interafce/account';
@@ -38,6 +39,7 @@ export interface NeedClearSourceDataType {
     Goods: Goods[],
     areaRoles: useInfo.Arearole[],
     DeliveryGoodsList: ErmcpDeliveryGoodsDetailEx[], // 现货品种
+    marketRun: Marketrun, // 市场运行信息
 
     queryClientFixedADConfigs: advert.fixedADConfigs[]; //首页图片广告
     checkTokenTimeDiff: number; // 轮休校验token时间差

+ 8 - 3
src/services/go/commonMarket/index.ts

@@ -1,7 +1,6 @@
 import APP from '@/services';
 import moment from 'moment';
 import { commonSearch_go } from '../index';
-import {Marketrun, QueryMarketRunReq} from "@/services/go/commonMarket/interface";
 // import * as type from './interface';
 
 /**
@@ -24,9 +23,15 @@ export function getServerTime(): Promise<string> {
 /**
  * 查询市场运行信息
  * /Market/QueryMarketRun
+ * marketID 市场ID,不传返回所有
  */
-export function queryMarketRun(req: QueryMarketRunReq): Promise<Marketrun> {
-    return commonSearch_go('/Market/QueryMarketRun', req).catch((err) => {
+export function queryMarketRun(marketID?: number): Promise<string> {
+    const param = marketID ? { marketID } : {}
+    return commonSearch_go('/Market/QueryMarketRun', param).then(res => {
+        console.log('市场运行信息', res)
+        APP.set('marketRun', res);
+        return 'ok';
+    }).catch((err) => {
         throw new Error(`查询市场运行信息: ${err}`);
     });
 }