|
@@ -1,4 +1,5 @@
|
|
|
import APP from '@/services';
|
|
import APP from '@/services';
|
|
|
|
|
+import { getGoodsByCode } from '@/services/bus/goods';
|
|
|
import { getLongTypeLoginID, isLogin } from '@/services/bus/login';
|
|
import { getLongTypeLoginID, isLogin } from '@/services/bus/login';
|
|
|
import { getToken } from '@/services/bus/token';
|
|
import { getToken } from '@/services/bus/token';
|
|
|
import { funCode } from '@/services/funcode/index';
|
|
import { funCode } from '@/services/funcode/index';
|
|
@@ -120,6 +121,19 @@ export function parseReceivePush(quotationData: any) {
|
|
|
const quoteDayInfo = APP.getRef('quoteDayInfo');
|
|
const quoteDayInfo = APP.getRef('quoteDayInfo');
|
|
|
const itemQuote = quoteDayInfo.value.find((el: QueryQuoteDayRsp) => el.goodscode === goodsQuoteTik.goodscode);
|
|
const itemQuote = quoteDayInfo.value.find((el: QueryQuoteDayRsp) => el.goodscode === goodsQuoteTik.goodscode);
|
|
|
if (itemQuote) {
|
|
if (itemQuote) {
|
|
|
|
|
+ const goods = getGoodsByCode(itemQuote.goodscode);
|
|
|
|
|
+ if (goods) {
|
|
|
|
|
+ // 处理报价小数为
|
|
|
|
|
+ const decimalplace = goods.decimalplace
|
|
|
|
|
+ const num = Math.pow(10, decimalplace)
|
|
|
|
|
+ const fn = (value: number) => +(value / num).toFixed(decimalplace)
|
|
|
|
|
+ goodsQuoteTik.last && (goodsQuoteTik.last = fn(goodsQuoteTik.last))
|
|
|
|
|
+ goodsQuoteTik.settle && (goodsQuoteTik.settle = fn(goodsQuoteTik.settle))
|
|
|
|
|
+ goodsQuoteTik.presettle && (goodsQuoteTik.presettle = fn(goodsQuoteTik.presettle))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.warn(`行情推送的商品goods:${itemQuote.goodscode}在商品列表里不存在`)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 注意:此处已 go 服务查询出来的盘面数据为基准,查询盘面 先修改成go 服务,第一次进入项目时候回查询一次所有盘面
|
|
// 注意:此处已 go 服务查询出来的盘面数据为基准,查询盘面 先修改成go 服务,第一次进入项目时候回查询一次所有盘面
|
|
|
// 之前是 通过 websocket 查询的,故 可能存在字段发生变化问题,如遇到,则进行优化处理
|
|
// 之前是 通过 websocket 查询的,故 可能存在字段发生变化问题,如遇到,则进行优化处理
|
|
|
mergeObj(itemQuote, goodsQuoteTik);
|
|
mergeObj(itemQuote, goodsQuoteTik);
|