|
|
@@ -7,9 +7,9 @@ import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
|
import { mergeObj } from '@/utils/objHandle';
|
|
|
import { Package40 } from '@/utils/websocket/package';
|
|
|
import Long from 'long';
|
|
|
+import moment from 'moment';
|
|
|
import { SubscribeInfoType } from '../interface';
|
|
|
import { byteArrayToUInt, subscribeInfosToByteArrary } from './byteUtils';
|
|
|
-import moment from 'moment';
|
|
|
|
|
|
/**
|
|
|
* 构建行情订阅请求包
|
|
|
@@ -29,6 +29,7 @@ export function buildSubscribePeq(subscribeInfos: SubscribeInfoType[]): Package4
|
|
|
*/
|
|
|
export function parseSubscribeRsp(rspPackage: any): Promise<string | SubscribeInfoType[]> {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
+ debugger
|
|
|
const content = rspPackage.content;
|
|
|
if (content.length === 0) {
|
|
|
// 有可能空订阅,也有可能订阅返回数据为空,但其实已经订阅了商品
|
|
|
@@ -37,10 +38,10 @@ export function parseSubscribeRsp(rspPackage: any): Promise<string | SubscribeIn
|
|
|
resolve('');
|
|
|
}
|
|
|
const count = byteArrayToUInt(content.subarray(0, 4), false);
|
|
|
- if (count > 1000) {
|
|
|
- // 游客模式 刷新成长问题,为了不让页面卡死,暂时处理
|
|
|
- return null;
|
|
|
- }
|
|
|
+ // if (count > 1000) {
|
|
|
+ // // 游客模式 刷新成长问题,为了不让页面卡死,暂时处理
|
|
|
+ // return null;
|
|
|
+ // }
|
|
|
switch (count) {
|
|
|
case -1:
|
|
|
reject('订阅失败');
|
|
|
@@ -165,7 +166,7 @@ export function parseReceivePush(quotationData: any) {
|
|
|
goodsQuoteTik.preclose = goodsQuoteTik.preclose ? (fn(goodsQuoteTik.preclose)) : '--'
|
|
|
goodsQuoteTik.settle = goodsQuoteTik.settle ? (fn(goodsQuoteTik.settle)) : '--'
|
|
|
goodsQuoteTik.strikeprice = goodsQuoteTik.strikeprice ? (fn(goodsQuoteTik.strikeprice)) : '--'
|
|
|
-
|
|
|
+
|
|
|
goodsQuoteTik.lasttime = moment(goodsQuoteTik.date + goodsQuoteTik.time, 'YYYYMMDDHHmmss').format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
|
// !goodsQuoteTik.bidvolume && (goodsQuoteTik.bidvolume = '--')
|
|
|
@@ -189,7 +190,7 @@ export function parseReceivePush(quotationData: any) {
|
|
|
|
|
|
// 注意:此处已 go 服务查询出来的盘面数据为基准,查询盘面 先修改成go 服务,第一次进入项目时候回查询一次所有盘面
|
|
|
// 之前是 通过 websocket 查询的,故 可能存在字段发生变化问题,如遇到,则进行优化处理
|
|
|
-
|
|
|
+
|
|
|
// 判断是一下行情时间是否比现在的要早
|
|
|
const quoteTime = moment(goodsQuoteTik.lasttime, 'YYYY-MM-DD HH:mm:ss')
|
|
|
const localTime = moment(itemQuote.lasttime, 'YYYY-MM-DD HH:mm:ss')
|