Explorar o código

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_RMA

 Conflicts:
	RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
Zhou.xiaoning %!s(int64=3) %!d(string=hai) anos
pai
achega
8bf0148362
Modificáronse 19 ficheiros con 174 adicións e 56 borrados
  1. 0 17
      RMA/.idea/deploymentTargetDropDown.xml
  2. 0 1
      RMA/.idea/gradle.xml
  3. 1 1
      RMA/.idea/misc.xml
  4. 2 2
      RMA/app/build.gradle
  5. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt
  6. 0 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/swaps/SwapsManager.kt
  7. 19 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/chart/ChartTSData.kt
  8. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  9. 48 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt
  10. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/NumberUtils.java
  11. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/old/timeCharts/TimeChartView.java
  12. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt
  13. 31 15
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/account/RydzAccountActivity.kt
  14. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeFragment.kt
  15. 4 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeViewModel.kt
  16. 12 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartActivity.kt
  17. 11 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt
  18. 13 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingViewModel.kt
  19. 17 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedActivity.kt

+ 0 - 17
RMA/.idea/deploymentTargetDropDown.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="deploymentTargetDropDown">
-    <targetSelectedWithDropDown>
-      <Target>
-        <type value="QUICK_BOOT_TARGET" />
-        <deviceKey>
-          <Key>
-            <type value="VIRTUAL_DEVICE_PATH" />
-            <value value="C:\Users\zhoux\.android\avd\Pixel_4_XL_API_30.avd" />
-          </Key>
-        </deviceKey>
-      </Target>
-    </targetSelectedWithDropDown>
-    <timeTargetWasSelectedWithDropDown value="2022-02-24T06:17:57.595727800Z" />
-  </component>
-</project>

+ 0 - 1
RMA/.idea/gradle.xml

@@ -7,7 +7,6 @@
         <option name="testRunner" value="GRADLE" />
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="gradleJvm" value="Embedded JDK" />
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />

+ 1 - 1
RMA/.idea/misc.xml

@@ -26,7 +26,7 @@
       </map>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 2 - 2
RMA/app/build.gradle

@@ -19,8 +19,8 @@ android {
         applicationId "cn.muchinfo.rma"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 50049
-        versionName "5.0.49"
+        versionCode 50051
+        versionName "5.0.51"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         //指定room.schemaLocation生成的文件路径

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt

@@ -34,6 +34,8 @@ import kotlin.math.pow
  */
 class FutureManager {
 
+    // 所有商品盘面信息
+    var quoteDayList: List<QuoteDayData> = ArrayList()
 
     /**
      * 查询期货子账户

+ 0 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/swaps/SwapsManager.kt

@@ -19,8 +19,6 @@ import java.lang.Exception
  * 掉期相关manager
  */
 class SwapsManager {
-
-
     /**
      * 按单平仓操作
      */

+ 19 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/chart/ChartTSData.kt

@@ -63,7 +63,7 @@ data class ChartTSData(
             var historyTimeEndLong = historyDatas.last().getTime().replace("T"," ").replace("+08:00", "").toLongFormatTime()  // 实际结束时间
             if(historyTimeStartLong == startTimeLong){  // 开始时间一致
                 historyDatas.forEach {
-                    list.add(it.getTime().toShowTime2())
+                    list.add(it.getTime().toShowTimeNoT())
                 }
             }
 
@@ -130,6 +130,24 @@ data class ChartTSData(
         return timeString
     }
 
+
+    @SuppressLint("SimpleDateFormat")
+    fun String.toShowTimeNoT(format : String = "yyyy-MM-dd HH:mm:ss") : String{
+        if (this.isNullOrEmpty()){
+            return "--"
+        }
+        var timeString = ""
+//        if (TimeUtils.isPm(this,SimpleDateFormat("yyyy-MM-dd HH:mm:ss"))){
+//            timeString = this
+//        }else{
+        val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss+08:00", Locale.CHINA)
+        val sdf1 = SimpleDateFormat(format, Locale.CHINA)
+        timeString = sdf1.format(sdf.parse(this.replace("T"," "))!!)
+//        }
+
+        return timeString
+    }
+
     @SuppressLint("SimpleDateFormat")
     fun String.toLongFormatTime(): Long{
         return SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA).parse(this, ParsePosition(0)).time

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -450,7 +450,13 @@ class MainActivity : BaseActivity<MainViewModel>() {
 //                            if (position == 0){
 //                                homeFragment.refrashAccount()
 //                            }
-
+                            // fix bug 错误 #3422  下单和平仓之后资金没有及时刷新
+                            // 每次点击我的按钮时 刷新账户信息
+                            // fixme 这里处理一下bug 通过position去判断当前是不是我的  如果增加新的tab 需要调整此处
+                            if(position == 4) {
+                                // 通知刷新资金账户信息
+                                viewModel.getTaAccounts()
+                            }
                             return false
                         }
 

+ 48 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt

@@ -89,7 +89,14 @@ class MainViewModel : BaseViewModel() {
                 if (isSuccess) {
                     GlobalDataCollection.instance?.accountDataList = respData
                     getUserAccount()//请求成功就继续请求用户账号信息
-                    isSuccess(true)
+                    // 查询所有商品盘面
+                    queryQuoteDay(false) {
+                        if (it) {
+                            isSuccess(true)
+                        } else {
+                            loadingDialogStatus.postValue(TaskUiModel.idel())
+                        }
+                    }
                 } else {
                     loadingDialogStatus.postValue(TaskUiModel.idel())
                 }
@@ -104,6 +111,7 @@ class MainViewModel : BaseViewModel() {
 
         if (SPUtils.getInstance().getString(Constant.oem) == "yrdz" || SPUtils.getInstance().getString(Constant.oem) == "tjmd"){
             queryWrMarketTradeConfig()
+
         }
 
         queryUserFavoriteGoodses()
@@ -166,6 +174,45 @@ class MainViewModel : BaseViewModel() {
     }
 
     /**
+     * 请求盘面信息
+     * @param first Int
+     * @param last Int
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryQuoteDay(
+        isShowLoading: Boolean,
+        callback: (isCompleted: Boolean) -> Unit
+    ) {
+        if (isShowLoading) {
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
+        // 查所有
+        val params = mutableMapOf<String, String>()
+        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                if (respData?.isEmpty()?.not() == true) {
+                    MyApplication.getInstance()?.futureManager?.quoteDayList = respData
+                }
+                if (isShowLoading) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功"))
+                }
+                callback(true)
+            } else {
+                if (isShowLoading) {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = "数据请求失败"
+                            )
+                        )
+                    )
+                }
+                callback(false)
+            }
+        }
+    }
+
+    /**
      * 查询我的自选
      */
     fun queryUserFavoriteGoodses() {

+ 3 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/NumberUtils.java

@@ -62,7 +62,9 @@ public class NumberUtils {
     }
 
     public static String roundNum(double string, int num) {
-        return roundNum(String.valueOf(string), num);
+        java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
+        nf.setGroupingUsed(false);
+        return roundNum(nf.format(string), num);
     }
 
     public static int power(int a, int b) {

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/old/timeCharts/TimeChartView.java

@@ -154,6 +154,7 @@ public class TimeChartView extends FrameLayout implements ITouchEventResponse {
      */
     public void setLastPrice(String lastPrice, int priceColor) {
         // 最新的数据
+//        if(lastPrice == "31.01") return;
         lineChart.setTasLastPrice(lastPrice);
         lineChart.setNewPriceColor(priceColor);
         lineChart.invalidate();

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt

@@ -98,6 +98,8 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                 GlobalDataCollection.instance?.contractTradePositionDataArrayList?.find { it.goodsid?.toInt() == goodid }
             if (goodsInfo?.goodsid.isNullOrEmpty().not()) {
                 viewModel.getUserAccount()
+                // resolve bug  #3429
+                viewModel.resetAccountData()
             }
         }
     }

+ 31 - 15
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/account/RydzAccountActivity.kt

@@ -556,23 +556,39 @@ class MoneyInfoUI(
                             GlobalDataCollection.instance?.getSystemParamsValue(
                                 "087"
                             )
-                        var worth = 0.0
-                        if (parmasvalue == "1") {//1.风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
-                            worth = it?.currentbalance?.plus(
-                                it.valueOfposition
-                            )?.plus(it.valueOfposition_keep_watch_profit_and_loss)
-                                ?.minus(it.otherfreezemargin)
-                                ?.minus(it.outamountfreeze) ?: 0.0
-
-
-                        } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
-                            worth = it?.currentbalance?.plus(it.valueOfposition_keep_watch_profit_and_loss)
-                                ?.minus(it.otherfreezemargin)
-                                ?.minus(it.outamountfreeze) ?: 1.0
-                        }
+//                        var worth = 0.0
+//                        if (parmasvalue == "1") {//1.风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
+//                            worth = it?.currentbalance?.plus(
+//                                it.valueOfposition
+//                            )?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+//                                ?.minus(it.otherfreezemargin)
+//                                ?.minus(it.outamountfreeze) ?: 0.0
+//
+//
+//                        } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
+//                            worth = it?.currentbalance?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+//                                ?.minus(it.otherfreezemargin)
+//                                ?.minus(it.outamountfreeze) ?: 1.0
+//                        }
+                        val worth: Double
+                        worth =
+                            if (parmasvalue == "1") {//1.风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
+                                it?.currentbalance?.plus(
+                                    it.valueOfposition
+                                )
+                                    ?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+                                    ?.minus(it.otherfreezemargin)
+                                    ?.minus(it.outamountfreeze) ?: 0.0
+
+
+                            } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
+                                it?.currentbalance?.plus(it.valueOfposition_keep_watch_profit_and_loss)
+                                    ?.minus(it.otherfreezemargin)
+                                    ?.minus(it.outamountfreeze) ?: 1.0
+                            }
 
                         var risk = 0.0
-                        if (it?.valueOfposition != 0.0) {
+                        if (worth != 0.0) {
                             risk = it?.usedmargin?.div(worth) ?: 0.0
                         }
                         text =

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeFragment.kt

@@ -547,7 +547,7 @@ class TjmdHomeFragment : BaseFragment<TjmdHomeViewModel>(){
                                         .lineWidth(2f)
                                         .name("结算价")
                                         .step(true)
-                                        .data(list?.map { it.s?.toDouble() ?: 0.0 }!!.toTypedArray())
+                                        .data(list?.map { it.c?.toDouble() ?: 0.0 }!!.toTypedArray())
                                     aaChartModel.categories(list.map {
                                         // 时间格式化
                                         TimeUtils.covnDate3(it.getTime())

+ 4 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tjmd/TjmdHomeViewModel.kt

@@ -173,8 +173,8 @@ class TjmdHomeViewModel : BaseViewModel(){
         val params = mutableMapOf<String, String>().apply {
             put("goodsCode", goodsCode)
             put("cycleType", type)
-            put("count", "30")
-            put("isAsc", "true")
+            put("count", "600")
+//            put("isAsc", "true")
         }
         MyApplication.getInstance()?.chartManager?.queryHistoryDatas(params = params) { isSuccess, respData, _ ->
             if (isSuccess) {
@@ -186,8 +186,8 @@ class TjmdHomeViewModel : BaseViewModel(){
                     if (s < wrAverageTradePriceMin) wrAverageTradePriceMin = s.toFloat()
                     if (s > wrAverageTradePriceMax) wrAverageTradePriceMax = s.toFloat()
                 }
-                wrAverageTradePriceDataList.postValue(respData)
-
+                // 顺序排列
+                wrAverageTradePriceDataList.postValue(respData?.sortedBy { it.getTime() })
             }
 
         }

+ 12 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/chart/YrdzChartActivity.kt

@@ -8,8 +8,6 @@ import android.view.ViewGroup
 import android.widget.ImageView
 import android.widget.ProgressBar
 import android.widget.RelativeLayout
-import com.google.android.material.tabs.TabLayout
-
 import android.widget.TextView
 import androidx.appcompat.app.AppCompatActivity
 import androidx.lifecycle.MutableLiveData
@@ -21,7 +19,6 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.data.WrTradeOrderDetailData
 import cn.muchinfo.rma.global.data.chart.HistoryTikData
-import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.isZeroBlankString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
@@ -37,7 +34,11 @@ import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
 import cn.muchinfo.rma.view.base.yrdzpurchase.dealdetails.YrdzDealDetailsActivity
 import cn.muchinfo.rma.view.base.yrdzpurchase.listed.PurchaseListedActivity
 import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
-import com.blankj.utilcode.util.*
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.SPUtils
+import com.blankj.utilcode.util.TimeUtils
+import com.google.android.material.tabs.TabLayout
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
@@ -45,7 +46,10 @@ import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
-import org.jetbrains.anko.*
+import org.jetbrains.anko._FrameLayout
+import org.jetbrains.anko.matchParent
+import org.jetbrains.anko.textColor
+import org.jetbrains.anko.verticalLayout
 
 /**
  * 图表相关
@@ -328,6 +332,8 @@ class YrdzChartActivity : BaseActivity<YrdzChartViewModel>() , View.OnClickListe
         tabLayout.addTab(tabLayout.newTab().setText("1 分").setTag(1))
         tabLayout.addTab(tabLayout.newTab().setText("5 分").setTag(2))
         tabLayout.addTab(tabLayout.newTab().setText("30 分").setTag(3))
+        tabLayout.addTab(tabLayout.newTab().setText("1 时").setTag(4))
+        tabLayout.addTab(tabLayout.newTab().setText("4 时").setTag(240))
 
         tabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener{
             override fun onTabReselected(tab: TabLayout.Tab?) {
@@ -346,7 +352,7 @@ class YrdzChartActivity : BaseActivity<YrdzChartViewModel>() , View.OnClickListe
                         viewModel.queryTimeChart()
                         progressBar.visibility = View.VISIBLE
                     }
-                    1,2,3,11,12,13,14 -> {
+                    1,2,3,11,12,13,14,4,240 -> {
                         kChartView.visibility = View.VISIBLE
                         timeChartView.visibility = View.INVISIBLE
                         viewModel.queryKChart( tab.tag.toString())
@@ -396,7 +402,6 @@ class YrdzChartActivity : BaseActivity<YrdzChartViewModel>() , View.OnClickListe
             timeChartView.refreshDate(ChartDataAdapter().getHisTikData(viewModel.outGoodsCode))
             // 这里更新最新价
             viewModel.refreshTimePrice(timeChartView)
-
         }
     }
 

+ 11 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingActivity.kt

@@ -29,6 +29,7 @@ import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
 import com.blankj.utilcode.util.ToastUtils
+import com.desfate.chart.util.LogUtils
 import com.desfate.chart.util.MathUtil
 import kotlinx.android.synthetic.main.list_head.view.*
 import mtp.polymer.com.autowidget.dialog.creatAccountDataSheetDialog
@@ -105,6 +106,9 @@ class SwapsDelistingActivity : BaseActivity<SwapsDelistingViewModel>(){
         }else if (data.pricemode == "2"){
             priceType.postValue(2)//挂牌单为固定价是,摘牌类型只能为限价
         }
+
+        // 先尝试从缓存中获取盘面信息
+        viewModel.getQuoteDay(quoteGoodsListData.refgoodscode ?: "")
         viewModel.queryQuoteDay(
             tag = thisTag,
             goodsCodes = quoteGoodsListData.refgoodscode ?: "",
@@ -534,7 +538,13 @@ class SwapsDelistingActivity : BaseActivity<SwapsDelistingViewModel>(){
                                 }else{
                                     val numberInput = onePriceInputNumberEdittext.text.toString().toDouble()
                                     if (priceType.value == 1){//市价计算
-                                        text = NumberUtils.roundNum(viewModel.quoteDayData.value?.getPrice()?.times(numberInput)?.times(goodsInfo.agreeunit) ?: 0.0,2) + "  需履约保证金 :" + infoc?.getMargainValue(amout = viewModel.quoteDayData.value?.getPrice()?.times(numberInput)?.times(goodsInfo.agreeunit) ?: 0.0,number = numberInput ?: 0.0,goodsid = goodsId ?: "0")
+                                        val money = viewModel.quoteDayData.value?.getPrice()?.times(numberInput)?.times(goodsInfo.agreeunit)
+//                                        if (money == null) {
+//                                            ToastUtils.showLong("初始化数据异常,请重试")
+//                                            finish()
+//                                            return@bindOptional
+//                                        }
+                                        text = NumberUtils.roundNum(money ?: 0.0,2) + "  需履约保证金 :" + infoc?.getMargainValue(amout = viewModel.quoteDayData.value?.getPrice()?.times(numberInput)?.times(goodsInfo.agreeunit) ?: 0.0,number = numberInput ?: 0.0,goodsid = goodsId ?: "0")
                                     }else{//限价计算
                                         if (limit_price_edittext.text.toString().isNullOrEmpty()){
                                             text = "--"

+ 13 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/delisting/SwapsDelistingViewModel.kt

@@ -79,7 +79,6 @@ class SwapsDelistingViewModel : BaseViewModel(){
         }
     }
 
-
     /**
      * 查询当前选择资金账号的持仓汇总单据
      * @param accountid String 当前资金账号
@@ -203,6 +202,19 @@ class SwapsDelistingViewModel : BaseViewModel(){
 
     }
 
+    /**
+     * 从缓存中获取般面信息
+     */
+    fun getQuoteDay(goodsCodes: String) {
+        val quoteDayList = MyApplication.getInstance()?.futureManager?.quoteDayList
+        if (quoteDayList?.isEmpty()?.not() == true) {
+            quoteDayList.forEach {
+                if (it.goodscode == goodsCodes) {
+                    quoteDayData.postValue(it)
+                }
+            }
+        }
+    }
 
     /**
      * 请求盘面信息

+ 17 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/swaps/listed/SwapsListedActivity.kt

@@ -31,6 +31,7 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
 import cn.muchinfo.rma.view.eventbus.EventConstent
 import cn.muchinfo.rma.view.eventbus.MessageEvent
+import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.ConvertUtils
 import com.blankj.utilcode.util.ToastUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
@@ -130,6 +131,22 @@ class SwapsListedActivity : BaseActivity<SwapsListedViewModel>() {
         }
     }
 
+    //行情推送通知
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onQuoteMessageEvent(quoteMessageEvent: QuoteMessageEvent) {
+        /** 行情推送过来的goodsid **/
+        quoteMessageEvent.goodsid.forEach { goodid ->
+            //找到相应商品信息
+            val goodsInfo =
+                GlobalDataCollection.instance?.contractTradePositionDataArrayList?.find { it.goodsid?.toInt() == goodid }
+            if (goodsInfo?.goodsid.isNullOrEmpty().not()) {
+                // resolve bug  #3429
+                viewModel.resetAccountData()
+                viewModel.getTaAccounts()
+            }
+        }
+    }
+
     override fun onDestroy() {
         super.onDestroy()
         viewModel.removeSubscriptQuote(thisTag)