|
|
@@ -5,12 +5,16 @@ import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.data.AccountData
|
|
|
import cn.muchinfo.rma.global.data.ContractTradePositionData
|
|
|
import cn.muchinfo.rma.global.data.UserAccountData
|
|
|
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
|
|
|
+import cn.muchinfo.rma.global.database.DataBase
|
|
|
import cn.muchinfo.rma.netManage.base.InteractiveException
|
|
|
import cn.muchinfo.rma.view.MyApplication
|
|
|
import cn.muchinfo.rma.view.base.BaseViewModel
|
|
|
import cn.muchinfo.rma.view.base.app.Constant
|
|
|
+import cn.muchinfo.rma.view.base.home.tjmd.TjmdDemoData
|
|
|
import cn.muchinfo.rma.view.eventbus.EventConstent
|
|
|
import cn.muchinfo.rma.view.eventbus.MessageEvent
|
|
|
+import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.GlobalScope
|
|
|
import kotlinx.coroutines.launch
|
|
|
import mtp.polymer.com.autowidget.utils.TaskUiModel
|
|
|
@@ -156,9 +160,30 @@ class HnstMainViewmodel : BaseViewModel(){
|
|
|
}
|
|
|
resetAccountData()
|
|
|
getUserAccount()
|
|
|
+
|
|
|
+ val contractTradePositionDataArrayList = GlobalDataCollection.instance?.contractTradePositionDataArrayList
|
|
|
+ MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
|
|
|
+ "11111",
|
|
|
+ contractTradePositionDataArrayList!!.map { it.goodscode ?: "" }.toSet()
|
|
|
+ ) { isCompleted, err ->
|
|
|
+
|
|
|
+ }
|
|
|
// positionDataList.postValue(newList)
|
|
|
-// queryPositionQuoteDay(Constant.position_tag,newList)
|
|
|
- }
|
|
|
+// queryPositionQuoteDay(newList)
|
|
|
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 订阅行情
|
|
|
+ * @param tag String
|
|
|
+ * @param goodsInfoList List<GoodsInfo>
|
|
|
+ */
|
|
|
+ fun addSubscriptQuote(tag: String, goodsInfoList: List<TjmdDemoData>) {
|
|
|
+ GlobalScope.launch {
|
|
|
+ MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
|
|
|
+ tag = tag, goodsCodeSet = goodsInfoList.map { it.goodsInfo?.goodscode?.toUpperCase() ?: "" }.toSet()
|
|
|
+ ) { isCompleted, err ->
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|