zhou.xiaoning 4 年之前
父節點
當前提交
152cb90e35

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.business.future
 
+import android.annotation.SuppressLint
 import cn.muchinfo.rma.business.contract.adapter.ContractAdapter
 import cn.muchinfo.rma.business.future.adapter.ChannelOrderReqData
 import cn.muchinfo.rma.business.future.adapter.FutureAdapter
@@ -27,7 +28,9 @@ import cn.muchinfo.rma.view.base.app.ServiceFunApi
 import com.blankj.utilcode.util.SPUtils
 import okhttp3.Call
 import java.lang.Exception
+import java.text.SimpleDateFormat
 import java.util.ArrayList
+import java.util.logging.SimpleFormatter
 
 /**
  * 期货管理类
@@ -69,11 +72,16 @@ class FutureManager {
     /**
      * 把数据库中的商品信息暂存本地数据中心
      */
-    private fun putGoodsInfoAndQuotesList(){
+    private fun putGoodsInfoAndQuotesList() {
         val goodsInfoList = Builder.getDatabase<AppDatabase>().goodsInfoDao.all
         val goodsInfoAndQuotesList = GlobalDataCollection.instance?.goodsInfoAndQuotesList
-        goodsInfoList.forEach{
-            goodsInfoAndQuotesList?.add(GoodsInfoAndQuotes(outgoodscode = it.outgoodscode,goodsInfo = it))
+        goodsInfoList.forEach {
+            goodsInfoAndQuotesList?.add(
+                GoodsInfoAndQuotes(
+                    outgoodscode = it.outgoodscode,
+                    goodsInfo = it
+                )
+            )
         }
     }
 
@@ -85,12 +93,13 @@ class FutureManager {
     fun queryQuoteDay(
         params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<QuoteDayData>?, error: Error?) -> Unit
-    ){
+    ) {
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Quote/QueryQuoteDay",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Quote/QueryQuoteDay",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<QuoteDayData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<QuoteDayData>>>() {
                 override fun onResponse(response: BaseResult<List<QuoteDayData>>?, id: Int) {
                     insertQuoteInGoodsInfoAndQuotesList(response?.data)
                     responseBack(true, response?.data, null)
@@ -108,10 +117,10 @@ class FutureManager {
      * 把查询到的盘面信息依据outgoodscode插入暂存的商品盘面信息内
      * @param quoteList List<QuoteDayData>
      */
-    private fun insertQuoteInGoodsInfoAndQuotesList(quoteList : List<QuoteDayData>?){
+    private fun insertQuoteInGoodsInfoAndQuotesList(quoteList: List<QuoteDayData>?) {
         val goodsInfoAndQuotesList = GlobalDataCollection.instance?.goodsInfoAndQuotesList
-        quoteList?.forEach {data ->
-            val goodsInfoAndQuotes =  goodsInfoAndQuotesList?.find {
+        quoteList?.forEach { data ->
+            val goodsInfoAndQuotes = goodsInfoAndQuotesList?.find {
                 if (it != null) {
                     data.goodscode == it.outgoodscode
                 } else {
@@ -125,22 +134,55 @@ class FutureManager {
     }
 
     /**
+     * 实时行情更新盘面
+     * @param goodsQuoteTiks List<Map<String, String>> 实时行情信息列表
+     */
+    @SuppressLint("SimpleDateFormat")
+    fun updateQuoteInfo(goodsQuoteTiks: List<Map<String, String>>) {
+        goodsQuoteTiks.forEach continuing@{ goodsQuoteTik ->
+            // 获取对应的商品信息
+            val goodsInfo = GlobalDataCollection.instance?.goodsInfoList?.find {
+                it.outgoodscode == goodsQuoteTik["GoodsCode"]
+            }
+            // 获取对应的盘面信息
+            val goodsInfoAndQuote = GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find {
+                it.outgoodscode == goodsQuoteTik["GoodsCode"]
+            }
+
+            if (goodsInfo != null && goodsInfoAndQuote != null) {
+                val date = goodsQuoteTik["Date"].guard { return@continuing }
+                val time = goodsQuoteTik["Time"].guard { return@continuing }
+                val quoteTime = SimpleDateFormat("yyyyMMddHHmmss").parse("$date$time")
+                    .guard { return@continuing }
+                // 实时行情需要判断行情时间是否比盘面的时间要早,如果要早则抛弃
+                if (quoteTime.before(SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(goodsInfoAndQuote.quoteDayData.lasttime))) {
+                    return@continuing
+                }
+
+
+            }
+        }
+    }
+
+    /**
      * 获取企业风管期货历史委托单信息
      * @param params Map<String, String> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
      */
     fun queryErmcpHisEntrustDetails(
         responseBack: (isSuccess: Boolean, respData: List<FutureEntrustData>?, error: Error?) -> Unit
-    ){
+    ) {
         val params = mutableMapOf<String, String>()
         params["accountID"] = SPUtils.getInstance().getLong(Constant.SELECT_ACCOUNT_ID).toString()
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpHisOrderDetails",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpHisOrderDetails",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<FutureEntrustData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<FutureEntrustData>>>() {
                 override fun onResponse(response: BaseResult<List<FutureEntrustData>>?, id: Int) {
-                    GlobalDataCollection.instance?.futureHisEntrustData = response?.data as ArrayList<FutureEntrustData>?
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
                     responseBack(true, response?.data, null)
                 }
 
@@ -161,12 +203,13 @@ class FutureManager {
     fun queryErmcpHisTradeDetails(
         params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<FutureDetailsData>?, error: Error?) -> Unit
-    ){
+    ) {
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpHisTradeDetails",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpHisTradeDetails",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<FutureDetailsData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<FutureDetailsData>>>() {
                 override fun onResponse(response: BaseResult<List<FutureDetailsData>>?, id: Int) {
                     responseBack(true, response?.data, null)
                 }
@@ -185,17 +228,20 @@ class FutureManager {
      * @param params Map<String, String> accountID/资金账户ID
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
      */
-    fun queryErmcpEntrustDetails(responseBack: (isSuccess: Boolean, respData: List<FutureEntrustData>?, error: Error?) -> Unit
-    ){
+    fun queryErmcpEntrustDetails(
+        responseBack: (isSuccess: Boolean, respData: List<FutureEntrustData>?, error: Error?) -> Unit
+    ) {
         val params = mutableMapOf<String, String>()
         params["accountID"] = GlobalDataCollection.instance?.accountId.toString()
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpOrderDetails",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpOrderDetails",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<FutureEntrustData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<FutureEntrustData>>>() {
                 override fun onResponse(response: BaseResult<List<FutureEntrustData>>?, id: Int) {
-                    GlobalDataCollection.instance?.futureEntrustData = response?.data as ArrayList<FutureEntrustData>?
+                    GlobalDataCollection.instance?.futureEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
                     responseBack(true, response?.data, null)
                 }
 
@@ -217,12 +263,13 @@ class FutureManager {
     fun queryErmcpTradeDetails(
         params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<DealOrderData>?, error: Error?) -> Unit
-    ){
+    ) {
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpTradeDetails",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpTradeDetails",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<DealOrderData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<DealOrderData>>>() {
                 override fun onResponse(response: BaseResult<List<DealOrderData>>?, id: Int) {
                     responseBack(true, response?.data, null)
                 }
@@ -236,7 +283,6 @@ class FutureManager {
     }
 
 
-
     /**
      * 获取企业风管期货持仓头寸信息
      * @param params Map<String, String> accountID/资金账户ID marketID/所属市场ID
@@ -245,12 +291,13 @@ class FutureManager {
     fun queryErmcpTradePosition(
         params: Map<String, String>,
         responseBack: (isSuccess: Boolean, respData: List<FutureHoldData>?, error: Error?) -> Unit
-    ){
+    ) {
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpTradePosition",
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryErmcpTradePosition",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<FutureHoldData>>>(){
+            callback = object : ResponseCallback<BaseResult<List<FutureHoldData>>>() {
                 override fun onResponse(response: BaseResult<List<FutureHoldData>>?, id: Int) {
                     GlobalDataCollection.instance?.futureHoldData = response?.data?.toArrayList()
                     responseBack(true, response?.data, null)
@@ -272,7 +319,7 @@ class FutureManager {
     fun tradeRequest(
         data: ChannelOrderReqData,
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
@@ -302,5 +349,4 @@ class FutureManager {
     }
 
 
-
 }

+ 263 - 127
RMA/app/src/main/java/cn/muchinfo/rma/business/quote/adapter/QuoteAdapter.kt

@@ -7,6 +7,7 @@ import cn.muchinfo.rma.protobuf.classNumber.ClassNumber
 import java.lang.Exception
 import java.nio.ByteBuffer
 import java.nio.ByteOrder
+import java.nio.charset.Charset
 
 /**
  * 行情数据解析类
@@ -100,16 +101,22 @@ class QuoteAdapter {
             }
 
             // 分解行正则
-            val regRow = """/10\s.*?11/""".toRegex()
+            val regRow = """10\s.*?11""".toRegex()
             // 分解单行 key 正则
-            val regKey = """/01\s.*?02/""".toRegex()
+            val regKey = """01\s.*?02""".toRegex()
             // 分解单行 value 正则
-            val regValue = """/02\s.*?01|02\s.*?11/""".toRegex()
+            val regValue = """02\s.*?01|02\s.*?11""".toRegex()
 
             // ByteArray to Hex string
             // FF 10 01 55 02 45 46 47 48 01 66 02 48 47 46 45 11 10 01 77 02 AA BB CC DD 11 00
             val hexString =
-                data.joinToString(separator = " ") { Integer.toHexString(it.toInt()) }
+                data.joinToString(separator = " ") {
+                    var str = Integer.toHexString(it.toInt())
+                    if (str.length == 1) {
+                        str = "0$str"
+                    }
+                    return@joinToString str
+                }
 
             val goodsQuoteTiks = arrayListOf<Map<String, String>>()
 
@@ -131,7 +138,11 @@ class QuoteAdapter {
 
                     // 02 45 46 47 48 01
                     // 02 48 47 46 45 11
-                    val value = values[i].split(" ").map { it.toByte(16) }.toString()
+                    val tmpValue = values[i]
+                    val value = String(
+                        tmpValue.slice(3 until tmpValue.length - 3).split(" ")
+                            .map { a -> a.toByte(16) }.toByteArray(), Charsets.US_ASCII
+                    )
                     getQuoteTikField(goodsQuoteTik, key, value)
                 }
 
@@ -141,250 +152,375 @@ class QuoteAdapter {
             return goodsQuoteTiks
         }
 
-        private fun getQuoteTikField(goodsQuoteTik: MutableMap<String, String>, key: Int, value: String)  {
+        private fun getQuoteTikField(
+            goodsQuoteTik: MutableMap<String, String>,
+            key: Int,
+            value: String
+        ) {
             when (key) {
                 0x56 -> {
-                    goodsQuoteTik["ExchangeCode"] = value }
+                    goodsQuoteTik["ExchangeCode"] = value
+                }
                 0x21 -> {
-                    goodsQuoteTik["GoodsCode"] = value }
+                    goodsQuoteTik["GoodsCode"] = value
+                }
                 0x24 -> {
-                    goodsQuoteTik["Last"] = value }
+                    goodsQuoteTik["Last"] = value
+                }
                 0x5B -> {
-                    goodsQuoteTik["HoldVolume"] = value }
+                    goodsQuoteTik["HoldVolume"] = value
+                }
                 0x25 -> {
-                    goodsQuoteTik["LastVolume"] = value }
+                    goodsQuoteTik["LastVolume"] = value
+                }
                 0x3C -> {
-                    goodsQuoteTik["PreHoldVolume"] = value }
+                    goodsQuoteTik["PreHoldVolume"] = value
+                }
                 0x32 -> {
-                    goodsQuoteTik["PreSettle"] = value }
+                    goodsQuoteTik["PreSettle"] = value
+                }
                 0x33 -> {
-                    goodsQuoteTik["Settle"] = value }
+                    goodsQuoteTik["Settle"] = value
+                }
                 0x29 -> {
-                    goodsQuoteTik["TotalTurnover"] = value }
+                    goodsQuoteTik["TotalTurnover"] = value
+                }
                 0x28 -> {
-                    goodsQuoteTik["TotalVolume"] = value }
+                    goodsQuoteTik["TotalVolume"] = value
+                }
                 0x35 -> {
-                    goodsQuoteTik["LimitHigh"] = value }
+                    goodsQuoteTik["LimitHigh"] = value
+                }
                 0x36 -> {
-                    goodsQuoteTik["LimitLow"] = value }
+                    goodsQuoteTik["LimitLow"] = value
+                }
                 "L".toInt() -> {
-                    goodsQuoteTik["Ask"] = value }
+                    goodsQuoteTik["Ask"] = value
+                }
                 "M".toInt() -> {
-                    goodsQuoteTik["Ask2"] = value }
+                    goodsQuoteTik["Ask2"] = value
+                }
                 "N".toInt() -> {
-                    goodsQuoteTik["Ask3"] = value }
+                    goodsQuoteTik["Ask3"] = value
+                }
                 "O".toInt() -> {
-                    goodsQuoteTik["Ask4"] = value }
+                    goodsQuoteTik["Ask4"] = value
+                }
                 "P".toInt() -> {
-                    goodsQuoteTik["Ask5"] = value }
+                    goodsQuoteTik["Ask5"] = value
+                }
                 "Q".toInt() -> {
-                    goodsQuoteTik["AskVolume"] = value }
+                    goodsQuoteTik["AskVolume"] = value
+                }
                 "R".toInt() -> {
-                    goodsQuoteTik["AskVolume2"] = value }
+                    goodsQuoteTik["AskVolume2"] = value
+                }
                 "S".toInt() -> {
-                    goodsQuoteTik["AskVolume3"] = value }
+                    goodsQuoteTik["AskVolume3"] = value
+                }
                 "T".toInt() -> {
-                    goodsQuoteTik["AskVolume4"] = value }
+                    goodsQuoteTik["AskVolume4"] = value
+                }
                 "U".toInt() -> {
-                    goodsQuoteTik["AskVolume5"] = value }
+                    goodsQuoteTik["AskVolume5"] = value
+                }
                 "B".toInt() -> {
-                    goodsQuoteTik["Bid"] = value }
+                    goodsQuoteTik["Bid"] = value
+                }
                 "C".toInt() -> {
-                    goodsQuoteTik["Bid2"] = value }
+                    goodsQuoteTik["Bid2"] = value
+                }
                 "D".toInt() -> {
-                    goodsQuoteTik["Bid3"] = value }
+                    goodsQuoteTik["Bid3"] = value
+                }
                 "E".toInt() -> {
-                    goodsQuoteTik["Bid4"] = value }
+                    goodsQuoteTik["Bid4"] = value
+                }
                 "F".toInt() -> {
-                    goodsQuoteTik["Bid5"] = value }
+                    goodsQuoteTik["Bid5"] = value
+                }
                 "G".toInt() -> {
-                    goodsQuoteTik["BidVolume"] = value }
+                    goodsQuoteTik["BidVolume"] = value
+                }
                 "H".toInt() -> {
-                    goodsQuoteTik["BidVolume2"] = value }
+                    goodsQuoteTik["BidVolume2"] = value
+                }
                 "I".toInt() -> {
-                    goodsQuoteTik["BidVolume3"] = value }
+                    goodsQuoteTik["BidVolume3"] = value
+                }
                 "J".toInt() -> {
-                    goodsQuoteTik["BidVolume4"] = value }
+                    goodsQuoteTik["BidVolume4"] = value
+                }
                 "K".toInt() -> {
-                    goodsQuoteTik["BidVolume5"] = value }
+                    goodsQuoteTik["BidVolume5"] = value
+                }
                 ",".toInt() -> {
-                    goodsQuoteTik["Highest"] = value }
+                    goodsQuoteTik["Highest"] = value
+                }
                 "-".toInt() -> {
-                    goodsQuoteTik["Lowest"] = value }
+                    goodsQuoteTik["Lowest"] = value
+                }
                 "@".toInt() -> {
-                    goodsQuoteTik["Date"] = value }
+                    goodsQuoteTik["Date"] = value
+                }
                 "A".toInt() -> {
-                    goodsQuoteTik["Time"] = value }
+                    goodsQuoteTik["Time"] = value
+                }
                 "+".toInt() -> {
-                    goodsQuoteTik["PreClose"] = value }
+                    goodsQuoteTik["PreClose"] = value
+                }
                 ".".toInt() -> {
-                    goodsQuoteTik["Opened"] = value }
+                    goodsQuoteTik["Opened"] = value
+                }
                 0x5C -> {
-                    goodsQuoteTik["ExercisePrice"] = value }
+                    goodsQuoteTik["ExercisePrice"] = value
+                }
                 0x7A -> {
-                    goodsQuoteTik["Inventory"] = value }
+                    goodsQuoteTik["Inventory"] = value
+                }
                 0x7C -> {
-                    goodsQuoteTik["ExchangeDate"] = value }
+                    goodsQuoteTik["ExchangeDate"] = value
+                }
                 0x70 -> {  // 1011 新增
-                    goodsQuoteTik["strBidOrder"] = value }
+                    goodsQuoteTik["strBidOrder"] = value
+                }
                 0x71 -> {
-                    goodsQuoteTik["strBidOrder2"] = value }
+                    goodsQuoteTik["strBidOrder2"] = value
+                }
                 0x72 -> {
-                    goodsQuoteTik["strBidOrder3"] = value }
+                    goodsQuoteTik["strBidOrder3"] = value
+                }
                 0x73 -> {
-                    goodsQuoteTik["strBidOrder4"] = value }
+                    goodsQuoteTik["strBidOrder4"] = value
+                }
                 0x74 -> {
-                    goodsQuoteTik["strBidOrder5"] = value }
+                    goodsQuoteTik["strBidOrder5"] = value
+                }
                 0x75 -> {
-                    goodsQuoteTik["strAskOrder"] = value }
+                    goodsQuoteTik["strAskOrder"] = value
+                }
                 0x76 -> {
-                    goodsQuoteTik["strAskOrder2"] = value }
+                    goodsQuoteTik["strAskOrder2"] = value
+                }
                 0x77 -> {
-                    goodsQuoteTik["strAskOrder3"] = value }
+                    goodsQuoteTik["strAskOrder3"] = value
+                }
                 0x78 -> {
-                    goodsQuoteTik["strAskOrder4"] = value }
+                    goodsQuoteTik["strAskOrder4"] = value
+                }
                 0x79 -> {
-                    goodsQuoteTik["strAskOrder5"] = value }
+                    goodsQuoteTik["strAskOrder5"] = value
+                }
                 0x7D -> {
-                    goodsQuoteTik["putOptionPremiums"] = value }
+                    goodsQuoteTik["putOptionPremiums"] = value
+                }
                 0x7E -> {
-                    goodsQuoteTik["putOptionPremiums2"] = value }
+                    goodsQuoteTik["putOptionPremiums2"] = value
+                }
                 0x80 -> {
-                    goodsQuoteTik["putOptionPremiums3"] = value }
+                    goodsQuoteTik["putOptionPremiums3"] = value
+                }
                 0x81 -> {
-                    goodsQuoteTik["putOptionPremiums4"] = value }
+                    goodsQuoteTik["putOptionPremiums4"] = value
+                }
                 0x82 -> {
-                    goodsQuoteTik["putOptionPremiums5"] = value }
+                    goodsQuoteTik["putOptionPremiums5"] = value
+                }
                 0x83 -> {
-                    goodsQuoteTik["callOptionPremiums"] = value }
+                    goodsQuoteTik["callOptionPremiums"] = value
+                }
                 0x84 -> {
-                    goodsQuoteTik["callOptionPremiums2"] = value }
+                    goodsQuoteTik["callOptionPremiums2"] = value
+                }
                 0x85 -> {
-                    goodsQuoteTik["callOptionPremiums3"] = value }
+                    goodsQuoteTik["callOptionPremiums3"] = value
+                }
                 0x86 -> {
-                    goodsQuoteTik["callOptionPremiums4"] = value }
+                    goodsQuoteTik["callOptionPremiums4"] = value
+                }
                 0x87 -> {
-                    goodsQuoteTik["callOptionPremiums5"] = value }
+                    goodsQuoteTik["callOptionPremiums5"] = value
+                }
                 0x7B -> {
-                    goodsQuoteTik["orderID "] = value }
+                    goodsQuoteTik["orderID "] = value
+                }
                 0x88 -> { // 非交易成交总量
-                    goodsQuoteTik["nonTotalVolume"] = value }
+                    goodsQuoteTik["nonTotalVolume"] = value
+                }
                 0x89 -> { // 非交易总持仓量
-                    goodsQuoteTik["nonTotalHolderVolume"] = value }
+                    goodsQuoteTik["nonTotalHolderVolume"] = value
+                }
                 0x8A -> { // 非交易成交总金额
-                    goodsQuoteTik["nonTotalTurnover"] = value }
+                    goodsQuoteTik["nonTotalTurnover"] = value
+                }
                 0x8B -> { // 非交易成交总数
-                    goodsQuoteTik["nonTotalLot"] = value }
+                    goodsQuoteTik["nonTotalLot"] = value
+                }
                 0x8C -> {
-                    goodsQuoteTik["markPrice"] = value }
+                    goodsQuoteTik["markPrice"] = value
+                }
                 0x8D -> {
-                    goodsQuoteTik["fundSrate"] = value }
+                    goodsQuoteTik["fundSrate"] = value
+                }
                 0x92 -> {
-                    goodsQuoteTik["BidVolume6"] = value }
+                    goodsQuoteTik["BidVolume6"] = value
+                }
                 0x93 -> {
-                    goodsQuoteTik["BidVolume7"] = value }
+                    goodsQuoteTik["BidVolume7"] = value
+                }
                 0x94 -> {
-                    goodsQuoteTik["BidVolume8"] = value }
+                    goodsQuoteTik["BidVolume8"] = value
+                }
                 0x95 -> {
-                    goodsQuoteTik["BidVolume9"] = value }
+                    goodsQuoteTik["BidVolume9"] = value
+                }
                 0x96 -> {
-                    goodsQuoteTik["BidVolume10"] = value }
+                    goodsQuoteTik["BidVolume10"] = value
+                }
                 0x97 -> {
-                    goodsQuoteTik["Ask6"] = value }
+                    goodsQuoteTik["Ask6"] = value
+                }
                 0x98 -> {
-                    goodsQuoteTik["Ask7"] = value }
+                    goodsQuoteTik["Ask7"] = value
+                }
                 0x99 -> {
-                    goodsQuoteTik["Ask8"] = value }
+                    goodsQuoteTik["Ask8"] = value
+                }
                 0x9A -> {
-                    goodsQuoteTik["Ask9"] = value }
+                    goodsQuoteTik["Ask9"] = value
+                }
                 0x9B -> {
-                    goodsQuoteTik["Ask10"] = value }
+                    goodsQuoteTik["Ask10"] = value
+                }
                 0x9C -> {
-                    goodsQuoteTik["AskVolume6"] = value }
+                    goodsQuoteTik["AskVolume6"] = value
+                }
                 0x9D -> {
-                    goodsQuoteTik["AskVolume7"] = value }
+                    goodsQuoteTik["AskVolume7"] = value
+                }
                 0x9E -> {
-                    goodsQuoteTik["AskVolume8"] = value }
+                    goodsQuoteTik["AskVolume8"] = value
+                }
                 0xA0 -> {
-                    goodsQuoteTik["AskVolume9"] = value }
+                    goodsQuoteTik["AskVolume9"] = value
+                }
                 0xA1 -> {
-                    goodsQuoteTik["AskVolume10"] = value }
+                    goodsQuoteTik["AskVolume10"] = value
+                }
                 0xA2 -> {
-                    goodsQuoteTik["strBidOrder6"] = value }
+                    goodsQuoteTik["strBidOrder6"] = value
+                }
                 0xA3 -> {
-                    goodsQuoteTik["strBidOrder7"] = value }
+                    goodsQuoteTik["strBidOrder7"] = value
+                }
                 0xA4 -> {
-                    goodsQuoteTik["strBidOrder8"] = value }
+                    goodsQuoteTik["strBidOrder8"] = value
+                }
                 0xA5 -> {
-                    goodsQuoteTik["strBidOrder9"] = value }
+                    goodsQuoteTik["strBidOrder9"] = value
+                }
                 0xA6 -> {
-                    goodsQuoteTik["strBidOrder10"] = value }
+                    goodsQuoteTik["strBidOrder10"] = value
+                }
                 0xA7 -> {
-                    goodsQuoteTik["strAskOrder6"] = value }
+                    goodsQuoteTik["strAskOrder6"] = value
+                }
                 0xA8 -> {
-                    goodsQuoteTik["strAskOrder7"] = value }
+                    goodsQuoteTik["strAskOrder7"] = value
+                }
                 0xA9 -> {
-                    goodsQuoteTik["strAskOrder8"] = value }
+                    goodsQuoteTik["strAskOrder8"] = value
+                }
                 0xAA -> {
-                    goodsQuoteTik["strAskOrder9"] = value }
+                    goodsQuoteTik["strAskOrder9"] = value
+                }
                 0xAB -> {
-                    goodsQuoteTik["strAskOrder10"] = value }
+                    goodsQuoteTik["strAskOrder10"] = value
+                }
                 0xAC -> {
-                    goodsQuoteTik["Bid6"] = value }
+                    goodsQuoteTik["Bid6"] = value
+                }
                 0xAD -> {
-                    goodsQuoteTik["Bid7"] = value }
+                    goodsQuoteTik["Bid7"] = value
+                }
                 0x8E -> {
-                    goodsQuoteTik["Bid8"] = value }
+                    goodsQuoteTik["Bid8"] = value
+                }
                 0x90 -> {
-                    goodsQuoteTik["Bid9"] = value }
+                    goodsQuoteTik["Bid9"] = value
+                }
                 0x91 -> {
-                    goodsQuoteTik["Bid10"] = value }
+                    goodsQuoteTik["Bid10"] = value
+                }
                 0xAE -> { // 买2的订单数量
-                    goodsQuoteTik["bidOrderVol1"] = value }
+                    goodsQuoteTik["bidOrderVol1"] = value
+                }
                 0xAF -> { // 买2的订单数量
-                    goodsQuoteTik["bidOrderVol2"] = value }
+                    goodsQuoteTik["bidOrderVol2"] = value
+                }
                 0xB0 -> { // 买3的订单数量
-                    goodsQuoteTik["bidOrderVol3"] = value }
+                    goodsQuoteTik["bidOrderVol3"] = value
+                }
                 0xB1 -> { // 买4的订单数量
-                    goodsQuoteTik["bidOrderVol4"] = value }
+                    goodsQuoteTik["bidOrderVol4"] = value
+                }
                 0xB2 -> { // 买5的订单数量
-                    goodsQuoteTik["bidOrderVol5"] = value }
+                    goodsQuoteTik["bidOrderVol5"] = value
+                }
                 0xB3 -> { // 买6的订单数量
-                    goodsQuoteTik["bidOrderVol6"] = value }
+                    goodsQuoteTik["bidOrderVol6"] = value
+                }
                 0xB4 -> { // 买7的订单数量
-                    goodsQuoteTik["bidOrderVol7"] = value }
+                    goodsQuoteTik["bidOrderVol7"] = value
+                }
                 0xB5 -> { // 买8的订单数量
-                    goodsQuoteTik["bidOrderVol8"] = value }
+                    goodsQuoteTik["bidOrderVol8"] = value
+                }
                 0xB6 -> { // 买9的订单数量
-                    goodsQuoteTik["bidOrderVol9"] = value }
+                    goodsQuoteTik["bidOrderVol9"] = value
+                }
                 0xB7 -> { // 买10的订单数量
-                    goodsQuoteTik["bidOrderVol10"] = value }
+                    goodsQuoteTik["bidOrderVol10"] = value
+                }
                 0xB8 -> { // 卖1的订单数量
-                    goodsQuoteTik["askOrderVol1"] = value }
+                    goodsQuoteTik["askOrderVol1"] = value
+                }
                 0xB9 -> { // 卖2的订单数量
-                    goodsQuoteTik["askOrderVol2"] = value }
+                    goodsQuoteTik["askOrderVol2"] = value
+                }
                 0xBA -> { // 卖3的订单数量
-                    goodsQuoteTik["askOrderVol3"] = value }
+                    goodsQuoteTik["askOrderVol3"] = value
+                }
                 0xBB -> { // 卖4的订单数量
-                    goodsQuoteTik["askOrderVol4"] = value }
+                    goodsQuoteTik["askOrderVol4"] = value
+                }
                 0xBC -> { // 卖5的订单数量
-                    goodsQuoteTik["askOrderVol5"] = value }
+                    goodsQuoteTik["askOrderVol5"] = value
+                }
                 0xBD -> { // 卖6的订单数量
-                    goodsQuoteTik["askOrderVol6"] = value }
+                    goodsQuoteTik["askOrderVol6"] = value
+                }
                 0xBE -> { // 卖7的订单数量
-                    goodsQuoteTik["askOrderVol7"] = value }
+                    goodsQuoteTik["askOrderVol7"] = value
+                }
                 0xBF -> { // 卖8的订单数量
-                    goodsQuoteTik["askOrderVol8"] = value }
+                    goodsQuoteTik["askOrderVol8"] = value
+                }
                 0xC0 -> { // 卖9的订单数量
-                    goodsQuoteTik["askOrderVol9"] = value }
+                    goodsQuoteTik["askOrderVol9"] = value
+                }
                 0xC1 -> { // 卖10的订单数量
-                    goodsQuoteTik["askOrderVol10"] = value }
+                    goodsQuoteTik["askOrderVol10"] = value
+                }
                 0x59 -> { // 买经济盘数据
-                    goodsQuoteTik["bidQueueInfo"] = value }
+                    goodsQuoteTik["bidQueueInfo"] = value
+                }
                 0x5A -> { // 卖经济盘数据
-                    goodsQuoteTik["askQueueInfo"] = value }
+                    goodsQuoteTik["askQueueInfo"] = value
+                }
                 0x6B -> {  // 交易类型
-                    goodsQuoteTik["publicTradetype"] = value }
+                    goodsQuoteTik["publicTradetype"] = value
+                }
             }
         }
     }

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/BaseGlobalData.java

@@ -91,6 +91,9 @@ public class BaseGlobalData {
     private ArrayList<FutureEntrustData> futureHisEntrustData;
     private ArrayList<FutureHoldData> futureHoldData; // 持仓头寸信息
 
+    /**
+     * 盘面信息
+     */
     public ArrayList<GoodsInfoAndQuotes> getGoodsInfoAndQuotesList() {
         if (goodsInfoAndQuotesList == null){
             goodsInfoAndQuotesList = new ArrayList<>();

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

@@ -250,7 +250,7 @@ class MyApplication : BaseApplication() {
 
         override fun onReceivePush(socket: MTP2Socket<Packet40>?, data: Packet40?) {
             when (data?.mainClassNumber?.toInt()) {
-                ClassNumber.MainClassNumber_Quota_SubscriptRsp -> { // 实时行情推送
+                ClassNumber.MainClassNumber_Quota_QuotaPush -> { // 实时行情推送
                     if (data.content.size >= 23) {
                         // 分解行情
                         val goodsQuoteTiks = QuoteAdapter.splitQuoteGoods(data.content)