Parcourir la source

风险管理6月9日提交代码-liu.bolan

Liu.bolan il y a 4 ans
Parent
commit
af06662f17
34 fichiers modifiés avec 1808 ajouts et 136 suppressions
  1. 3 3
      RMA/app/build.gradle
  2. 41 0
      RMA/app/proguard-rules.pro
  3. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  4. 173 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/ContractGoodsManager.kt
  5. 8 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/adapter/ContractGoodsAdapter.kt
  6. 68 15
      RMA/app/src/main/java/cn/muchinfo/rma/global/BaseUrlData.kt
  7. 182 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractHisTradeDetailData.kt
  8. 236 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractHisTradeOrderDetailData.kt
  9. 176 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeDetailData.kt
  10. 239 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeOrderDetailData.kt
  11. 116 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradePositionData.kt
  12. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/VerificationCodeData.kt
  13. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/loginQeruy/GoodsInfo.kt
  14. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/database/AppDatabase.java
  15. 15 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/database/DataBase.kt
  16. 54 41
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  17. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt
  18. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/SplashActivity.kt
  19. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  20. 4 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/ChartActivity.kt
  21. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketBaseModel.kt
  22. 4 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractDetailsActivity.kt
  23. 50 28
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/RegisterViewModel.kt
  24. 79 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureFragment.kt
  25. 74 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureViewModel.kt
  26. 74 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java
  27. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QHjRightData.kt
  28. 14 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QhjRightScrollAdapter.java
  29. 41 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt
  30. 47 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt
  31. 85 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt
  32. 3 3
      RMA/app/src/main/res/layout/layout_item_platinum_content.xml
  33. 0 1
      RMA/app/src/main/res/layout/layout_qhj_item_scroll.xml
  34. 1 1
      RMA/gradle.properties

+ 3 - 3
RMA/app/build.gradle

@@ -19,8 +19,8 @@ android {
         applicationId "cn.muchinfo.rma"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 50007
-        versionName "5.0.07"
+        versionCode 50008
+        versionName "5.0.08"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         //指定room.schemaLocation生成的文件路径
@@ -53,7 +53,7 @@ android {
 
     buildTypes {
         release {
-            minifyEnabled false
+            minifyEnabled true
             signingConfig signingConfigs.release
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }

+ 41 - 0
RMA/app/proguard-rules.pro

@@ -20,6 +20,14 @@
 # hide the original source file name.
 #-renamesourcefileattribute SourceFile
 
+-keep public class * extends android.app.Activity  #所有activity的子类不要去混淆
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+
 -keepclasseswithmembernames class * {
     native <methods>;  #保持 native 的方法不去混淆
 }
@@ -44,6 +52,27 @@
 -dontwarn com.zhy.http.**
 -keep class com.zhy.http.*{*;}
 
+-dontwarn com.tencent.smtt.**
+-keep class com.tencent.smtt.*{*;}
+
+-dontwarn cn.muchinfo.rma.business.**
+-keep class cn.muchinfo.rma.business.*{*;}
+
+-dontwarn cn.muchinfo.rma.view.base.app.**
+-keep class cn.muchinfo.rma.view.base.app.*{*;}
+
+-dontwarn cn.muchinfo.rma.netManage.base
+-keep interface cn.muchinfo.rma.netManage.base.*{*;}
+
+-dontwarn cn.muchinfo.rma.netManage
+-keep class cn.muchinfo.rma.netManage.*{*;}
+
+#https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/README-CN.md
+-keep class com.blankj.utilcode.*{*;}
+-keepclassmembers class com.blankj.utilcode.*{*;}
+-dontwarn com.blankj.utilcode.**
+
+
 #okhttp
 -dontwarn okhttp3.**
 -keep class okhttp3.*{*;}
@@ -92,3 +121,15 @@
 -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
     <init>(java.lang.Throwable);
 }
+
+
+-dontwarn cn.muchinfo.rma.global.*
+-keep class cn.muchinfo.rma.global.*{*;}
+-keepattributes Signature
+# Gson specific classes
+-dontwarn sun.misc.**
+-keep class sun.misc.Unsafe.* { *; }
+# Application classes that will be serialized/deserialized over Gson
+-dontwarn com.google.gson.**
+-keep class com.google.gson.* { *; }
+-keep class com.google.gson.stream.* { *; }

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt

@@ -23,6 +23,7 @@ import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.app.ServiceFunApi
 import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SPUtils
+import com.blankj.utilcode.util.ToastUtils
 import io.reactivex.Observable
 import io.reactivex.android.schedulers.AndroidSchedulers
 import kotlinx.coroutines.GlobalScope

+ 173 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/ContractGoodsManager.kt

@@ -0,0 +1,173 @@
+package cn.muchinfo.rma.business.contractgoods
+
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.ContractHisTradeDetailData
+import cn.muchinfo.rma.global.data.ContractHisTradeOrderDetailData
+import cn.muchinfo.rma.global.data.ContractTradeDetailData
+import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData
+import cn.muchinfo.rma.global.data.futureOrders.FutureEntrustData
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.SPUtils
+import okhttp3.Call
+import java.lang.Exception
+import java.util.ArrayList
+
+/**
+ * 合约市场管理类
+ */
+class ContractGoodsManager {
+
+    /**
+     * 历史成交单查询(合约市场)
+     * @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 queryContractHisTradeDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ContractHisTradeDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Order/QueryHisTradeDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ContractHisTradeDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<ContractHisTradeDetailData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+    /**
+     * 委托单查询请求(合约市场
+     * @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 queryContractHisTradeOrderDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ContractHisTradeOrderDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Order/QueryHisTradeOrderDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ContractHisTradeOrderDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<ContractHisTradeOrderDetailData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+    /**
+     * 成交单查询(合约市场)
+     * @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 queryContractTradeDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ContractTradeDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Order/QueryTradeDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ContractTradeDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<ContractTradeDetailData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+    /**
+     * 委托单查询请求(合约市场)
+     * @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 queryContractTradeOrderDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ContractTradeOrderDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Order/QueryTradeOrderDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ContractTradeOrderDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<ContractTradeOrderDetailData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+
+    /**
+     * 持仓汇总查询(合约市场)
+     * @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 queryContractTradePosition(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<ContractTradeOrderDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Order/QueryTradePosition",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<ContractTradeOrderDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<ContractTradeOrderDetailData>>?, id: Int) {
+                    GlobalDataCollection.instance?.futureHisEntrustData =
+                        response?.data as ArrayList<FutureEntrustData>?
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+}

+ 8 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/adapter/ContractGoodsAdapter.kt

@@ -0,0 +1,8 @@
+package cn.muchinfo.rma.business.contractgoods.adapter
+
+/**
+ * 合约商品报文装箱解箱
+ */
+object ContractGoodsAdapter {
+
+}

+ 68 - 15
RMA/app/src/main/java/cn/muchinfo/rma/global/BaseUrlData.kt

@@ -1,18 +1,71 @@
 package cn.muchinfo.rma.global
 
+import android.os.Parcel
+import android.os.Parcelable
+
 data class BaseUrlData(
-    val commSearchUrl : String,
-    val goCommonSearchUrl : String,
-    val mobileAuthUrl : String,
-    val mobileOpenUrl : String,
-    val newsUrl : String,
-    val openApiUrl : String,
-    val quoteHost : String,
-    val quotePort : String,
-    val quoteUrl : String,
-    val tradeHost : String,
-    val tradePort : String,
-    val tradeUrl : String,
-    val uploadUrl : String,
-    val hsbyPayUrlWeb : String
-)
+    val commSearchUrl : String?,
+    val goCommonSearchUrl : String?,
+    val mobileAuthUrl : String?,
+    val mobileOpenUrl : String?,
+    val newsUrl : String?,
+    val openApiUrl : String?,
+    val quoteHost : String?,
+    val quotePort : String?,
+    val quoteUrl : String?,
+    val tradeHost : String?,
+    val tradePort : String?,
+    val tradeUrl : String?,
+    val uploadUrl : String?,
+    val hsbyPayUrlWeb : String?
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(commSearchUrl)
+        parcel.writeString(goCommonSearchUrl)
+        parcel.writeString(mobileAuthUrl)
+        parcel.writeString(mobileOpenUrl)
+        parcel.writeString(newsUrl)
+        parcel.writeString(openApiUrl)
+        parcel.writeString(quoteHost)
+        parcel.writeString(quotePort)
+        parcel.writeString(quoteUrl)
+        parcel.writeString(tradeHost)
+        parcel.writeString(tradePort)
+        parcel.writeString(tradeUrl)
+        parcel.writeString(uploadUrl)
+        parcel.writeString(hsbyPayUrlWeb)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<BaseUrlData> {
+        override fun createFromParcel(parcel: Parcel): BaseUrlData {
+            return BaseUrlData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<BaseUrlData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 182 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractHisTradeDetailData.kt

@@ -0,0 +1,182 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 历史成交单查询(合约市场)
+ */
+data class ContractHisTradeDetailData(
+    val accountid : String? = "",//账户ID[报价币种]
+    val buildtype : String? = "",//委托单据类型 1:建仓 2:平仓 3:先平后建
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    val charge : String? = "",//手续费
+    val closecharge : String? = "",//平仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+    val closeexchagechargevalue : String? = "",//平仓交易所手续费设置值
+    val closefeealgorithm : String? = "",//平仓手续费收取方式 1:比率 2:固定
+    val closememberchargevalue : String? = "",//平仓会员手续费设置值
+    val closepl : String? = "",//平仓盈亏
+    val closepl2 : String? = "",//平仓盈亏[逐笔]
+    val closeqty : String? = "",//平仓数量(先建后平操作 需要记录)
+    val creditamount : String? = "",//授信金额
+    val gcaccountid : String? = "",//账户ID[合约币种]
+    val goodscode : String? = "",//商品代码
+    val goodsid : String? = "",//商品ID
+    val goodsname : String? = "",//商品名称
+    val histradedate : String? = "",//历史交易日
+    val intclosepl : String? = "",//整型盈亏(用于交易结算试算平衡-收益权)
+    val isconfirmexercise : String? = "",//是否确认行权- 0:否 1:是
+    val ismain : String? = "",//是否主单 - 0:不是 1:是
+    val ispreexercise : String? = "",//是否预申报- 0:否 1:是
+    val isreckoned : String? = "",//是否结算 - 0:未结算 1:已结算
+    val isvaliddata : String? = "",//是否有效 - 0:无效 1:有效
+    val listingselecttype : String? = "",//关联委托单挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+    val marketid : String? = "",//市场ID
+    val marketname : String? = "",//市场名称
+    val matchaccountid : String? = "",//对手账号id
+    val memberuserid : String? = "",//会员id 个人投资者 需要填写
+    val opencharge : String? = "",//建仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+    val  openexchagechargevalue : String? = "",//建仓交易所手续费设置值
+    val openfeealgorithm : String? = "",//建仓手续费收取方式 1:比率 2:固定
+    val openmemberchargevalue : String? = "",//建仓会员手续费设置值
+    val openqty : String? = "",//开仓数量(先建后平操作 需要记录)
+    val optiontype : String? = "",//期权类型 - 1:认购(看涨) 2:认沽(看跌)
+    val orderid : String? = "",//委托单号
+    val performanceplanid : String? = "",//履约计划ID[期权]
+    val performancestatus : String? = "",//履约状态[期权] - 0:无履约 1:未履约 2:履约中 3:履约完成
+    val preexerciseprice : String? = "",//预申报价格
+    val premium : String? = "",//权利金 - [持仓单的权利金]
+    val relatedouttradeid : String? = "",//关联外部成交单ID
+    val status : String? = "",//处理状态 - 1:待处理 2:已处理 3:处理失败
+    val tradeamount : String? = "",//成交金额[账户币种,用于所有权]
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val tradeid : String? = "",//成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+    val trademode : String? = "",//交易模式
+    val tradeprice : String? = "",//成交价格
+    val tradeproperty : String? = "",//交易属性
+    val tradeqty : String? = "",//成交数量
+    val tradetime : String? = "",//成交时间
+    val tradetype : String? = ""//成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(buildtype)
+        parcel.writeString(buyorsell)
+        parcel.writeString(charge)
+        parcel.writeString(closecharge)
+        parcel.writeString(closeexchagechargevalue)
+        parcel.writeString(closefeealgorithm)
+        parcel.writeString(closememberchargevalue)
+        parcel.writeString(closepl)
+        parcel.writeString(closepl2)
+        parcel.writeString(closeqty)
+        parcel.writeString(creditamount)
+        parcel.writeString(gcaccountid)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(histradedate)
+        parcel.writeString(intclosepl)
+        parcel.writeString(isconfirmexercise)
+        parcel.writeString(ismain)
+        parcel.writeString(ispreexercise)
+        parcel.writeString(isreckoned)
+        parcel.writeString(isvaliddata)
+        parcel.writeString(listingselecttype)
+        parcel.writeString(marketid)
+        parcel.writeString(marketname)
+        parcel.writeString(matchaccountid)
+        parcel.writeString(memberuserid)
+        parcel.writeString(opencharge)
+        parcel.writeString(openexchagechargevalue)
+        parcel.writeString(openfeealgorithm)
+        parcel.writeString(openmemberchargevalue)
+        parcel.writeString(openqty)
+        parcel.writeString(optiontype)
+        parcel.writeString(orderid)
+        parcel.writeString(performanceplanid)
+        parcel.writeString(performancestatus)
+        parcel.writeString(preexerciseprice)
+        parcel.writeString(premium)
+        parcel.writeString(relatedouttradeid)
+        parcel.writeString(status)
+        parcel.writeString(tradeamount)
+        parcel.writeString(tradedate)
+        parcel.writeString(tradeid)
+        parcel.writeString(trademode)
+        parcel.writeString(tradeprice)
+        parcel.writeString(tradeproperty)
+        parcel.writeString(tradeqty)
+        parcel.writeString(tradetime)
+        parcel.writeString(tradetype)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ContractHisTradeDetailData> {
+        override fun createFromParcel(parcel: Parcel): ContractHisTradeDetailData {
+            return ContractHisTradeDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ContractHisTradeDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 236 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractHisTradeOrderDetailData.kt

@@ -0,0 +1,236 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 委托单查询请求(合约市场)
+ */
+data class ContractHisTradeOrderDetailData(
+    val accountid : String? = "",//账户ID[报价币种]
+    val buildtype : String? = "",//委托单据类型 1:建仓 2:平仓 3:先平后建
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    val cancelorderid : String? = "",//撤单单号(撤单时填写)
+    val cancelqty : String? = "",//撤单数量
+    val clientordertime : String? = "",//客户端委托时间
+    val clientticket : String? = "",//客户端流水号
+    val clienttype : String? = "",//客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端安卓 4:网页客户端 5:微信客户端 6:手机客户端苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+    val closeexchagechargevalue : String? = "",//平仓交易所手续费设置值
+    val closefeealgorithm : String? = "",//平仓手续费收取方式 1:比率 2:固定
+    val closefreezecharge : String? = "",//平仓冻结手续费(先建后平操作,需要记录)
+    val closememberchargevalue : String? = "",//平仓会员手续费设置值
+    val closeqty : String? = "",//平仓数量(先建后平操作 需要记录)
+    val closetradeqty : String? = "",//平仓成交数量(先建后平操作,需要记录)
+    val closeunfreezecharge : String? = "",//平仓解冻手续费(先建后平操作,需要记录)
+    val delistingtype : String? = "",//摘牌类型 - 1:价格最优 2:点选成交
+    val freezecharge : String? = "",//冻结手续费
+    val freezemargin : String? = "",//冻结保证金(冻结交易金额)
+    val gcaccountid : String? = "",//账户ID[合约币种]
+    val goodscode : String? = "",//商品代码
+    val goodsid : String? = "",//商品ID
+    val goodsname : String? = "",//商品名称
+    val histradedate : String? = "",//历史交易日
+    val isconfirmexercise : String? = "",//是否确认行权- 0:否 1:是
+    val ispreexercise : String? = "",//是否预申报- 0:否 1:是
+    val isvaliddata : String? = "",//是否有效 - 0:无效 1:有效
+    val listingselecttype : String? = "",//挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+    val marginalgorithm : String? = "",//保证金收取方式 1:比率 2:固定
+    val marginvalue : String? = "",//即市保证金设置值
+    val marketid : String? = "",//市场ID
+    val marketmaxsub : String? = "",//市价最大偏移范围
+    val marketname : String? = "",//市场名称
+    val memberuserid : String? = "",//所属会员UserID
+    val openexchagechargevalue : String? = "",//建仓交易所手续费设置值
+    val openfeealgorithm : String? = "",//建仓手续费收取方式 1:比率 2:固定
+    val openfreezecharge : String? = "",//开仓冻结手续费(先建后平操作,需要记录)
+    val openmemberchargevalue : String?  ="",//建仓会员手续费设置值
+    val openqty : String?  ="",//开仓数量(先建后平操作,需要记录)
+    val opentradeqty : String? = "",//开仓成交数量(先建后平操作,需要记录)
+    val openunfreezecharge : String? = "",//开仓解冻手续费(先建后平操作,需要记录)
+    val operatetype : String? = "",//操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
+    val operatorid : String? = "",//登录账号(LoginID)
+    val optiontype : String? = "",//期权类型 - 1:认购(看涨) 2:认沽(看跌)
+    val orderid : String? = "",//委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxx
+    val orderprice : String? = "",//委托价格
+    val orderqty : String? = "",//委托数量
+    val ordersrc : String? = "",//委托来源 - 1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+    val orderstatus : String? = "",//委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
+    val ordertime : String? = "",//委托时间
+    val preexerciseprice : String? = "",//预申报价格
+    val premium : String?  ="",//权利金
+    val preorderid : String? = "",//关联预埋单号(止盈止损单时填写)
+    val pricemode : String? = "",//取价方式 - 1:市价 2: 限价
+    val quoteid : String?  ="",//报价单ID
+    val relatedid : String?  ="",//关联单号(交割单)
+    val retcode : String?  ="",//错误代码
+    val sessionid : String? = "",//会话ID
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val trademode : String?  ="",//交易模式
+    val tradeproperty : String?  ="",//交易属性
+    val tradeqty : String? = "",//成交数量
+    val unfreezecharge : String? = "",//解冻手续费
+    val unfreezemargin : String? = "",//解冻保证金
+    val updatetime: String?  ="",//更新时间
+    val uuid : String? = "",//发起端唯一id
+    val validtime : String? = "",//有效期限
+    val validtype : String? = "",//有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
+    val volumetype : String? =""//当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量 1:最小量(暂时不支持) 2:全部量
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(buildtype)
+        parcel.writeString(buyorsell)
+        parcel.writeString(cancelorderid)
+        parcel.writeString(cancelqty)
+        parcel.writeString(clientordertime)
+        parcel.writeString(clientticket)
+        parcel.writeString(clienttype)
+        parcel.writeString(closeexchagechargevalue)
+        parcel.writeString(closefeealgorithm)
+        parcel.writeString(closefreezecharge)
+        parcel.writeString(closememberchargevalue)
+        parcel.writeString(closeqty)
+        parcel.writeString(closetradeqty)
+        parcel.writeString(closeunfreezecharge)
+        parcel.writeString(delistingtype)
+        parcel.writeString(freezecharge)
+        parcel.writeString(freezemargin)
+        parcel.writeString(gcaccountid)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(histradedate)
+        parcel.writeString(isconfirmexercise)
+        parcel.writeString(ispreexercise)
+        parcel.writeString(isvaliddata)
+        parcel.writeString(listingselecttype)
+        parcel.writeString(marginalgorithm)
+        parcel.writeString(marginvalue)
+        parcel.writeString(marketid)
+        parcel.writeString(marketmaxsub)
+        parcel.writeString(marketname)
+        parcel.writeString(memberuserid)
+        parcel.writeString(openexchagechargevalue)
+        parcel.writeString(openfeealgorithm)
+        parcel.writeString(openfreezecharge)
+        parcel.writeString(openmemberchargevalue)
+        parcel.writeString(openqty)
+        parcel.writeString(opentradeqty)
+        parcel.writeString(openunfreezecharge)
+        parcel.writeString(operatetype)
+        parcel.writeString(operatorid)
+        parcel.writeString(optiontype)
+        parcel.writeString(orderid)
+        parcel.writeString(orderprice)
+        parcel.writeString(orderqty)
+        parcel.writeString(ordersrc)
+        parcel.writeString(orderstatus)
+        parcel.writeString(ordertime)
+        parcel.writeString(preexerciseprice)
+        parcel.writeString(premium)
+        parcel.writeString(preorderid)
+        parcel.writeString(pricemode)
+        parcel.writeString(quoteid)
+        parcel.writeString(relatedid)
+        parcel.writeString(retcode)
+        parcel.writeString(sessionid)
+        parcel.writeString(tradedate)
+        parcel.writeString(trademode)
+        parcel.writeString(tradeproperty)
+        parcel.writeString(tradeqty)
+        parcel.writeString(unfreezecharge)
+        parcel.writeString(unfreezemargin)
+        parcel.writeString(updatetime)
+        parcel.writeString(uuid)
+        parcel.writeString(validtime)
+        parcel.writeString(validtype)
+        parcel.writeString(volumetype)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ContractHisTradeOrderDetailData> {
+        override fun createFromParcel(parcel: Parcel): ContractHisTradeOrderDetailData {
+            return ContractHisTradeOrderDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ContractHisTradeOrderDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 176 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeDetailData.kt

@@ -0,0 +1,176 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 成交单查询(合约市场)
+ */
+data class ContractTradeDetailData(
+    val accountid : String? = "",//账户ID[报价币种]
+    val buildtype : String? = "",//委托单据类型 1:建仓 2:平仓 3:先平后建
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    val charge : String? = "",//手续费
+    val closecharge : String? = "",//平仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+    val closeexchagechargevalue : String? = "",//平仓交易所手续费设置值
+    val closefeealgorithm : String? = "",//平仓手续费收取方式 1:比率 2:固定
+    val closememberchargevalue : String? = "",//平仓会员手续费设置值
+    val closepl : String? = "",//平仓盈亏
+    val closepl2 : String? = "",//平仓盈亏[逐笔]
+    val closeqty : String?  ="",//平仓数量(先建后平操作 需要记录)
+    val creditamount : String?  ="",//授信金额
+    val gcaccountid : String? = "",//账户ID[合约币种]
+    val goodscode : String? = "",//商品代码
+    val goodsid : String?  ="",//商品ID
+    val goodsname : String? = "",//商品名称
+    val intclosepl : String? = "",//整型盈亏(用于交易结算试算平衡-收益权)
+    val isconfirmexercise : String?  ="",//是否确认行权- 0:否 1:是
+    val ismain : String?  ="",//是否主单 - 0:不是 1:是
+    val ispreexercise : String? = "",//是否预申报- 0:否 1:是
+    val isreckoned : String? = "",//是否结算 - 0:未结算 1:已结算
+    val listingselecttype : String? = "",//关联委托单挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+    val marketid : String?  ="",//市场ID
+    val marketname : String? = "",//市场名称
+    val matchaccountid : String? = "",//对手账号id
+    val memberuserid : String?  ="",///会员id 个人投资者 需要填写
+    val opencharge : String? = "",//建仓手续费(支付总手续费=(交易所比率+会员比率)*成交金额)
+    val openexchagechargevalue : String? = "",//建仓交易所手续费设置值
+    val openfeealgorithm : String? = "",//建仓手续费收取方式 1:比率 2:固定
+    val openmemberchargevalue : String? = "",//建仓会员手续费设置值
+    val openqty : String? = "",//开仓数量(先建后平操作 需要记录)
+    val optiontype : String? = "",//期权类型 - 1:认购(看涨) 2:认沽(看跌)
+    val orderid : String? = "",//委托单号
+    val performanceplanid : String? = "",//履约计划ID[期权]
+    val performancestatus : String? = "",//履约状态[期权] - 0:无履约 1:未履约 2:履约中 3:履约完成
+    val preexerciseprice : String?  ="",//预申报价格
+    val premium : String? = "",//权利金 - [持仓单的权利金]
+    val relatedouttradeid : String? = "",//关联外部成交单ID
+    val status : String?  ="",//处理状态 - 1:待处理 2:已处理 3:处理失败
+    val tradeamount : String? = "",//成交金额[账户币种,用于所有权]
+    val tradedate : String?  ="",//交易日(yyyyMMdd)
+    val tradeid : String?  ="",//成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+    val trademode : String?  ="",//交易模式
+    val tradeprice : String?  ="",//成交价格
+    val tradeproperty : String? = "",//交易属性
+    val tradeqty : String?  ="",//成交数量
+    val tradetime : String? = "",//成交时间
+    val tradetype :String? = ""//成交类别 - 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(buildtype)
+        parcel.writeString(buyorsell)
+        parcel.writeString(charge)
+        parcel.writeString(closecharge)
+        parcel.writeString(closeexchagechargevalue)
+        parcel.writeString(closefeealgorithm)
+        parcel.writeString(closememberchargevalue)
+        parcel.writeString(closepl)
+        parcel.writeString(closepl2)
+        parcel.writeString(closeqty)
+        parcel.writeString(creditamount)
+        parcel.writeString(gcaccountid)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(intclosepl)
+        parcel.writeString(isconfirmexercise)
+        parcel.writeString(ismain)
+        parcel.writeString(ispreexercise)
+        parcel.writeString(isreckoned)
+        parcel.writeString(listingselecttype)
+        parcel.writeString(marketid)
+        parcel.writeString(marketname)
+        parcel.writeString(matchaccountid)
+        parcel.writeString(memberuserid)
+        parcel.writeString(opencharge)
+        parcel.writeString(openexchagechargevalue)
+        parcel.writeString(openfeealgorithm)
+        parcel.writeString(openmemberchargevalue)
+        parcel.writeString(openqty)
+        parcel.writeString(optiontype)
+        parcel.writeString(orderid)
+        parcel.writeString(performanceplanid)
+        parcel.writeString(performancestatus)
+        parcel.writeString(preexerciseprice)
+        parcel.writeString(premium)
+        parcel.writeString(relatedouttradeid)
+        parcel.writeString(status)
+        parcel.writeString(tradeamount)
+        parcel.writeString(tradedate)
+        parcel.writeString(tradeid)
+        parcel.writeString(trademode)
+        parcel.writeString(tradeprice)
+        parcel.writeString(tradeproperty)
+        parcel.writeString(tradeqty)
+        parcel.writeString(tradetime)
+        parcel.writeString(tradetype)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ContractTradeDetailData> {
+        override fun createFromParcel(parcel: Parcel): ContractTradeDetailData {
+            return ContractTradeDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ContractTradeDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 239 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeOrderDetailData.kt

@@ -0,0 +1,239 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 委托单查询请求(合约市场)
+ */
+data class ContractTradeOrderDetailData(
+    val accountid : String? = "",//账户ID[报价币种]
+    val buildtype : String? = "",//委托单据类型 1:建仓 2:平仓 3:先平后建
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    val cancelorderid : String? = "",//撤单单号(撤单时填写)
+    val cancelqty : String? = "",//撤单数量
+    val clientordertime : String? = "",//客户端委托时间
+    val clientticket : String? = "",//客户端流水号
+    val clienttype : String? = "",//客户端类型 - 0:保留为未填终端类型 1:PC管理端 2:PC交易端 3:手机客户端安卓 4:网页客户端 5:微信客户端 6:手机客户端苹果 7:网上开户客户端 8:无效终端编号 9:报价终端(中江)
+    val closeexchagechargevalue : String? = "",//平仓交易所手续费设置值
+    val closefeealgorithm : String? = "",//平仓手续费收取方式 1:比率 2:固定
+    val closefreezecharge : String? = "",//平仓冻结手续费(先建后平操作,需要记录)
+    val closememberchargevalue : String? = "",//平仓会员手续费设置值
+    val enableqty : String? = "",//可用数量 = 委托数量 - 成交数量 - 撤单数量
+    val closeqty : String? = "",//平仓数量(先建后平操作 需要记录)
+    val closetradeqty : String? = "",//平仓成交数量(先建后平操作,需要记录)
+    val closeunfreezecharge : String? = "",//平仓解冻手续费(先建后平操作,需要记录)
+    val delistingtype : String? = "",//摘牌类型 - 1:价格最优 2:点选成交
+    val freezecharge : String? = "",//冻结手续费
+    val freezemargin : String? = "",//冻结保证金(冻结交易金额)
+    val gcaccountid : String? = "",//账户ID[合约币种]
+    val goodscode : String? = "",//商品代码
+    val goodsid : String? = "",//商品ID
+    val goodsname : String? = "",//商品名称
+    val histradedate : String? = "",//历史交易日
+    val isconfirmexercise : String? = "",//是否确认行权- 0:否 1:是
+    val ispreexercise : String? = "",//是否预申报- 0:否 1:是
+    val isvaliddata : String? = "",//是否有效 - 0:无效 1:有效
+    val listingselecttype : String? = "",//挂牌点选类型 - 1:挂牌 2:摘牌 3:先摘后挂
+    val marginalgorithm : String? = "",//保证金收取方式 1:比率 2:固定
+    val marginvalue : String? = "",//即市保证金设置值
+    val marketid : String? = "",//市场ID
+    val marketmaxsub : String? = "",//市价最大偏移范围
+    val marketname : String? = "",//市场名称
+    val memberuserid : String? = "",//所属会员UserID
+    val openexchagechargevalue : String? = "",//建仓交易所手续费设置值
+    val openfeealgorithm : String? = "",//建仓手续费收取方式 1:比率 2:固定
+    val openfreezecharge : String? = "",//开仓冻结手续费(先建后平操作,需要记录)
+    val openmemberchargevalue : String?  ="",//建仓会员手续费设置值
+    val openqty : String?  ="",//开仓数量(先建后平操作,需要记录)
+    val opentradeqty : String? = "",//开仓成交数量(先建后平操作,需要记录)
+    val openunfreezecharge : String? = "",//开仓解冻手续费(先建后平操作,需要记录)
+    val operatetype : String? = "",//操作类型 - 1:正常下单 2:斩仓 3:转单 4:结算撤单 5:系统卖出(适用于先平后建的卖出) 6:行情源报价 7:(结算)到期强平 8:(结算)协议转让 9:系统对冲单 10:(结算)到期无效 11:交割协议转让 12:交割协议平仓 13:交割成交(所有权) 14:管理端强行平仓 15:管理端协议转让
+    val operatorid : String? = "",//登录账号(LoginID)
+    val optiontype : String? = "",//期权类型 - 1:认购(看涨) 2:认沽(看跌)
+    val orderid : String? = "",//委托单号(100+Unix秒时间戳(10位)+2位(MarketServiceID)+xxx
+    val orderprice : String? = "",//委托价格
+    val orderqty : String? = "",//委托数量
+    val ordersrc : String? = "",//委托来源 - 1:客户端 2:管理端 3:风控服务 4:交割服务 5:交易服务 6:交易日结 7:商品强平 8:管理端商品退市强平 9:交易接口 10:交割服务商被动(受托竞价) 11:预埋触发
+    val orderstatus : String? = "",//委托状态 - 1: 委托请求 2:待冻结 3:委托成功 4: 委托失败 5:配对成功 6: 已撤销 7:部分成交 8:已成交 9:部成部撤 10:成交失败 11:已拒绝 12:经过摘牌(先摘后挂专用-先摘后挂已摘过) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用)
+    val ordertime : String? = "",//委托时间
+    val preexerciseprice : String? = "",//预申报价格
+    val premium : String?  ="",//权利金
+    val preorderid : String? = "",//关联预埋单号(止盈止损单时填写)
+    val pricemode : String? = "",//取价方式 - 1:市价 2: 限价
+    val quoteid : String?  ="",//报价单ID
+    val relatedid : String?  ="",//关联单号(交割单)
+    val retcode : String?  ="",//错误代码
+    val sessionid : String? = "",//会话ID
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    val trademode : String?  ="",//交易模式
+    val tradeproperty : String?  ="",//交易属性
+    val tradeqty : String? = "",//成交数量
+    val unfreezecharge : String? = "",//解冻手续费
+    val unfreezemargin : String? = "",//解冻保证金
+    val updatetime: String?  ="",//更新时间
+    val uuid : String? = "",//发起端唯一id
+    val validtime : String? = "",//有效期限
+    val validtype : String? = "",//有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
+    val volumetype : String? =""//当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量 1:最小量(暂时不支持) 2:全部量
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(buildtype)
+        parcel.writeString(buyorsell)
+        parcel.writeString(cancelorderid)
+        parcel.writeString(cancelqty)
+        parcel.writeString(clientordertime)
+        parcel.writeString(clientticket)
+        parcel.writeString(clienttype)
+        parcel.writeString(closeexchagechargevalue)
+        parcel.writeString(closefeealgorithm)
+        parcel.writeString(closefreezecharge)
+        parcel.writeString(closememberchargevalue)
+        parcel.writeString(enableqty)
+        parcel.writeString(closeqty)
+        parcel.writeString(closetradeqty)
+        parcel.writeString(closeunfreezecharge)
+        parcel.writeString(delistingtype)
+        parcel.writeString(freezecharge)
+        parcel.writeString(freezemargin)
+        parcel.writeString(gcaccountid)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(histradedate)
+        parcel.writeString(isconfirmexercise)
+        parcel.writeString(ispreexercise)
+        parcel.writeString(isvaliddata)
+        parcel.writeString(listingselecttype)
+        parcel.writeString(marginalgorithm)
+        parcel.writeString(marginvalue)
+        parcel.writeString(marketid)
+        parcel.writeString(marketmaxsub)
+        parcel.writeString(marketname)
+        parcel.writeString(memberuserid)
+        parcel.writeString(openexchagechargevalue)
+        parcel.writeString(openfeealgorithm)
+        parcel.writeString(openfreezecharge)
+        parcel.writeString(openmemberchargevalue)
+        parcel.writeString(openqty)
+        parcel.writeString(opentradeqty)
+        parcel.writeString(openunfreezecharge)
+        parcel.writeString(operatetype)
+        parcel.writeString(operatorid)
+        parcel.writeString(optiontype)
+        parcel.writeString(orderid)
+        parcel.writeString(orderprice)
+        parcel.writeString(orderqty)
+        parcel.writeString(ordersrc)
+        parcel.writeString(orderstatus)
+        parcel.writeString(ordertime)
+        parcel.writeString(preexerciseprice)
+        parcel.writeString(premium)
+        parcel.writeString(preorderid)
+        parcel.writeString(pricemode)
+        parcel.writeString(quoteid)
+        parcel.writeString(relatedid)
+        parcel.writeString(retcode)
+        parcel.writeString(sessionid)
+        parcel.writeString(tradedate)
+        parcel.writeString(trademode)
+        parcel.writeString(tradeproperty)
+        parcel.writeString(tradeqty)
+        parcel.writeString(unfreezecharge)
+        parcel.writeString(unfreezemargin)
+        parcel.writeString(updatetime)
+        parcel.writeString(uuid)
+        parcel.writeString(validtime)
+        parcel.writeString(validtype)
+        parcel.writeString(volumetype)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ContractTradeOrderDetailData> {
+        override fun createFromParcel(parcel: Parcel): ContractTradeOrderDetailData {
+            return ContractTradeOrderDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ContractTradeOrderDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 116 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradePositionData.kt

@@ -0,0 +1,116 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ *
+ */
+data class ContractTradePositionData(
+    val accountid : String? = "",//资金账户
+    val agreeunit : String? = "",//合约单位
+    val averageprice : String? = "",//持仓均价
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    val closetotalqty : String? = "",//平仓总数量
+    val curholderamount : String? = "",//当前持仓总金额[商品币种]
+    val curpositionqty : String? = "",//当前持仓总数量
+    val currencyid : String? = "",//报价货币ID
+    val curtdposition : String? = "",//期末今日头寸
+    val decimalplace : String? = "",//报价小数位
+    val enableqty : String? = "",//可用量
+    val fretdposition : String? = "",//冻结今日头寸
+    val frozenqty : String? = "",//持仓冻结数量
+    val goodscode : String?  ="",//商品代码
+    val goodsid : String? = "",//商品Id
+    val goodsname : String? = "",//商品名称
+    val goodunit : String? = "",//报价单位
+    val goodunitid : String? = "",//报价单位ID
+    val holderamount : String? = "",//期初持仓总金额[商品币种]
+    val marketid : String? = "",//所属市场ID
+    val openreqqty : String? = "",//开仓申请数量(用于比较最大持仓数量)
+    val opentotalqty : String? = "",//开仓总数量
+    val otherfrozenqty : String?  ="",//持仓其他冻结数量(交割冻结)
+    val positionqty : String? = "",//期初持仓数量
+    val tnqty : String? = "",//T+N冻结总量
+    val tnusedqty : String? = "",//T+N使用量(可以使用T+N的冻结数量)
+    val trademode : String? ="",//交易模式
+    val usedmargin :String? = ""//占用保证金[商品币种]
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(agreeunit)
+        parcel.writeString(averageprice)
+        parcel.writeString(buyorsell)
+        parcel.writeString(closetotalqty)
+        parcel.writeString(curholderamount)
+        parcel.writeString(curpositionqty)
+        parcel.writeString(currencyid)
+        parcel.writeString(curtdposition)
+        parcel.writeString(decimalplace)
+        parcel.writeString(enableqty)
+        parcel.writeString(fretdposition)
+        parcel.writeString(frozenqty)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(goodunit)
+        parcel.writeString(goodunitid)
+        parcel.writeString(holderamount)
+        parcel.writeString(marketid)
+        parcel.writeString(openreqqty)
+        parcel.writeString(opentotalqty)
+        parcel.writeString(otherfrozenqty)
+        parcel.writeString(positionqty)
+        parcel.writeString(tnqty)
+        parcel.writeString(tnusedqty)
+        parcel.writeString(trademode)
+        parcel.writeString(usedmargin)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ContractTradePositionData> {
+        override fun createFromParcel(parcel: Parcel): ContractTradePositionData {
+            return ContractTradePositionData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ContractTradePositionData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/VerificationCodeData.kt

@@ -2,5 +2,6 @@ package cn.muchinfo.rma.global.data
 
 data class VerificationCodeData(
     val success : Boolean = false,
-    val msg : String = ""
+    val msg : String = "",
+    val message : String = ""
 )

+ 3 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/loginQeruy/GoodsInfo.kt

@@ -95,5 +95,7 @@ data class GoodsInfo(
     @ColumnInfo(name = "quote_gear")
     var quotegear : Int = 0, // 行情档位(1-10)
     @ColumnInfo(name = "out_goods_code")
-    var outgoodscode : String = "" // 商品代码(外部)
+    var outgoodscode : String = "", // 商品代码(外部)
+    @ColumnInfo(name = "related_goods_id")
+    var relatedgoodsid : Int = 0//关联商品id
 )

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/database/AppDatabase.java

@@ -9,6 +9,6 @@ import cn.muchinfo.rma.global.data.database.BannerEntity;
 import cn.muchinfo.rma.global.data.database.EnumDicEntity;
 import cn.muchinfo.rma.global.data.database.ErrorCodeEntity;
 
-@Database(entities = {GoodsInfo.class, BannerEntity.class, EnumDicEntity.class, ErrorCodeEntity.class}, version = 1, exportSchema = false)
+@Database(entities = {GoodsInfo.class, BannerEntity.class, EnumDicEntity.class, ErrorCodeEntity.class}, version = 2, exportSchema = false)
 public abstract class AppDatabase extends RoomDatabase implements UserDatabase {
 }

+ 15 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/database/DataBase.kt

@@ -1,8 +1,11 @@
 package cn.muchinfo.rma.global.database
 
+import androidx.annotation.NonNull
 import androidx.room.Database
 import androidx.room.Room
 import androidx.room.RoomDatabase
+import androidx.room.migration.Migration
+import androidx.sqlite.db.SupportSQLiteDatabase
 import cn.muchinfo.rma.global.dao.*
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
 import cn.muchinfo.rma.global.data.database.AddressEntity
@@ -11,9 +14,10 @@ import cn.muchinfo.rma.global.data.database.EnumDicEntity
 import cn.muchinfo.rma.global.data.database.ErrorCodeEntity
 import com.blankj.utilcode.util.Utils
 
+
 @Database(
     entities = [GoodsInfo::class, BannerEntity::class, ErrorCodeEntity::class, EnumDicEntity::class, AddressEntity::class],
-    version = 1,
+    version = 2,
     exportSchema = false
 )
 abstract class DataBase : RoomDatabase() {
@@ -38,8 +42,18 @@ abstract class DataBase : RoomDatabase() {
             DataBase::class.java,
             "db_goods_info"
         )
+            .addMigrations(object : Migration(1, 2) {
+                override fun migrate(@NonNull database: SupportSQLiteDatabase) {
+                    //没有布尔值,用INTEGER代替
+                    //使用"ALTER TABLE Word  ADD COLUMN bar_data2 INTEGER  NOT NULL DEFAULT 1"出错。
+                    //使用下面分开的形式,可以正确执行
+                    database.execSQL("ALTER TABLE goods_infos " + " ADD COLUMN related_goods_id INTEGER " + " NOT NULL DEFAULT 1")
+                }
+            })
             .allowMainThreadQueries()
             .build()
     }
 
+
+
 }

+ 54 - 41
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -10,6 +10,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.app.Constant
 
 import cn.muchinfo.rma.view.base.exposure.ExposureFragment
 import cn.muchinfo.rma.view.base.future.FutureFragment
@@ -90,7 +91,7 @@ class MainActivity : BaseActivity<MainViewModel>() {
         )
     }
 
-    private val newFragments : ArrayList<Fragment> = arrayListOf()
+    private val newFragments: ArrayList<Fragment> = arrayListOf()
 
     private val newTabText: ArrayList<String> = arrayListOf()
 
@@ -131,54 +132,63 @@ class MainActivity : BaseActivity<MainViewModel>() {
         viewModel.initiaData()
     }
 
-    fun initFragmentData(){
-//        newFragments.add(qhjHomeFragment)
-        newFragments.add(homeFragment)
+    fun initFragmentData() {
+        if (Constant.IS_QHJ) {
+            newFragments.add(qhjHomeFragment)
+        } else {
+            newFragments.add(homeFragment)
+        }
         newTabText.add("首页")
         newNormalIcon.add(R.mipmap.main_tab_1)
         newSelectIcon.add(R.mipmap.rma_select_main_tab_1)
 
-        if (GlobalDataCollection.instance?.getFirstLevelMenu("client_po") == true){
-            newFragments.add(procurementFragment)
-            newTabText.add("采购")
-            newNormalIcon.add(R.mipmap.main_tab_2)
-            newSelectIcon.add(R.mipmap.rma_select_main_tab_2)
-        }
-        if (GlobalDataCollection.instance?.getFirstLevelMenu("client_so") == true){
-            newFragments.add(saleFragment)
-            newTabText.add("销售")
-            newNormalIcon.add(R.mipmap.main_tab_3)
-            newSelectIcon.add(R.mipmap.rma_select_main_tab_3)
-        }
-        if (GlobalDataCollection.instance?.getFirstLevelMenu("client_futures") == true){
-            newFragments.add(futureFragment)
-            newTabText.add("期货")
-            newNormalIcon.add(R.mipmap.main_tab_4)
-            newSelectIcon.add(R.mipmap.rma_select_main_tab_4)
-        }
-        if (GlobalDataCollection.instance?.getFirstLevelMenu("client_exposure") == true){
-            newFragments.add(exposureFragment)
-            newTabText.add("敞口")
-            newNormalIcon.add(R.mipmap.main_tab_5)
-            newSelectIcon.add(R.mipmap.rma_select_main_tab_5)
+        if (Constant.IS_QHJ.not()) {
+            if (GlobalDataCollection.instance?.getFirstLevelMenu("client_po") == true) {
+                newFragments.add(procurementFragment)
+                newTabText.add("采购")
+                newNormalIcon.add(R.mipmap.main_tab_2)
+                newSelectIcon.add(R.mipmap.rma_select_main_tab_2)
+            }
+            if (GlobalDataCollection.instance?.getFirstLevelMenu("client_so") == true) {
+                newFragments.add(saleFragment)
+                newTabText.add("销售")
+                newNormalIcon.add(R.mipmap.main_tab_3)
+                newSelectIcon.add(R.mipmap.rma_select_main_tab_3)
+            }
+            if (GlobalDataCollection.instance?.getFirstLevelMenu("client_futures") == true) {
+                newFragments.add(futureFragment)
+                newTabText.add("期货")
+                newNormalIcon.add(R.mipmap.main_tab_4)
+                newSelectIcon.add(R.mipmap.rma_select_main_tab_4)
+            }
+            if (GlobalDataCollection.instance?.getFirstLevelMenu("client_exposure") == true) {
+                newFragments.add(exposureFragment)
+                newTabText.add("敞口")
+                newNormalIcon.add(R.mipmap.main_tab_5)
+                newSelectIcon.add(R.mipmap.rma_select_main_tab_5)
+            }
         }
 
+
         //前海金铂金宝
-//        newFragments.add(platinumTreasureFragment)
-//        newTabText.add("铂金宝")
-//        newNormalIcon.add(R.mipmap.qhj_bjb_tab_normal)
-//        newSelectIcon.add(R.mipmap.qhj_bjb_tab_select)
+        newFragments.add(platinumTreasureFragment)
+        newTabText.add("铂金宝")
+        newNormalIcon.add(R.mipmap.qhj_bjb_tab_normal)
+        newSelectIcon.add(R.mipmap.qhj_bjb_tab_select)
 
         //前海金饰品回购
 //        newTabText.add("饰品回购")
 //        newNormalIcon.add(R.mipmap.qhj_sphg_tab_normal)
 //        newSelectIcon.add(R.mipmap.qhj_sphg_tab_select)
 
-        //前海金我的页面
-//        newFragments.add(seaKingMainFragment)
-//        newTabText.add("我的")
-//        newNormalIcon.add(R.mipmap.qhj_main_tab_normal)
-//        newSelectIcon.add(R.mipmap.qhj_main_tab_select)
+        if (Constant.IS_QHJ) {
+            //前海金我的页面
+            newFragments.add(seaKingMainFragment)
+            newTabText.add("我的")
+            newNormalIcon.add(R.mipmap.qhj_main_tab_normal)
+            newSelectIcon.add(R.mipmap.qhj_main_tab_select)
+        }
+
 
     }
 
@@ -212,11 +222,14 @@ class MainActivity : BaseActivity<MainViewModel>() {
                             dialog.dismiss()
                         }
                     }.show()
-                }else{
+                } else {
                     EventBus.getDefault().post(MessageEvent(EventConstent.USERACCOUNTCHANGE))
-                    if (GlobalDataCollection.instance?.getFirstLevelMenu("client_futures") == true){
+                    if (Constant.IS_QHJ.not()){
+                         if (GlobalDataCollection.instance?.getFirstLevelMenu("client_futures") == true) {
                         futureFragment.refrashAccount()
                     }
+                    }
+
                 }
             }
             background = resources.getDrawable(R.color.white)
@@ -234,9 +247,9 @@ class MainActivity : BaseActivity<MainViewModel>() {
                     .selectTextColor(Color.parseColor("#2481DD"))   //Tab选中时字体颜色
                     .smoothScroll(true)  //点击Tab  Viewpager切换是否有动画
                     .canScroll(false)    //Viewpager能否左右滑动
-                    .setOnTabClickListener(object : EasyNavigationBar.OnTabClickListener{
+                    .setOnTabClickListener(object : EasyNavigationBar.OnTabClickListener {
                         override fun onTabSelectEvent(view: View?, position: Int): Boolean {
-                             // FIXME 后期在此处添加首页滑动到顶部处理
+                            // FIXME 后期在此处添加首页滑动到顶部处理
 //                            if (position == 0){
 //                                homeFragment.refrashAccount()
 //                            }
@@ -255,7 +268,7 @@ class MainActivity : BaseActivity<MainViewModel>() {
     }
 
     @Subscribe(threadMode = ThreadMode.MAIN)
-    fun onMessageEvent(messageEvent : MessageEvent) {
+    fun onMessageEvent(messageEvent: MessageEvent) {
 
     }
 

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt

@@ -254,7 +254,7 @@ fun Int.monthformatting() : String{
 }
 
 fun Int.dayformatting() : String{
-    return if (this < 9){
+    return if (this <= 9){
         "0" + this.toString()
     }else{
         this.toString()

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/SplashActivity.kt

@@ -17,6 +17,7 @@ import cn.muchinfo.rma.view.base.login.LoginActivity
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SPUtils
+import com.blankj.utilcode.util.ToastUtils
 import com.qmuiteam.qmui.util.QMUIStatusBarHelper
 import io.reactivex.Observable
 import io.reactivex.android.schedulers.AndroidSchedulers

+ 5 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt

@@ -10,12 +10,12 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
-      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
+//      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 //    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 
-//     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
+     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 
     /**
      * 用sp存储基础url的key
@@ -245,4 +245,7 @@ object Constant {
     const val QUERY_GOODS_TIME = "query_goods_time"
 
     const val SUCCESS_ADD_CUSTOMER = "SUCCESS_ADD_CUSTOMER"
+
+
+    const val IS_QHJ = true
 }

+ 4 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/ChartActivity.kt

@@ -16,6 +16,7 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.chart.old.timeCharts.KChartView
 import cn.muchinfo.rma.view.base.chart.old.timeCharts.TimeChartView
@@ -77,8 +78,8 @@ class ChartActivity : BaseActivity<ChartViewModel>() , View.OnClickListener{
         })
 
         viewModel.quoteDayData.observe(this, Observer {
-            findViewById<TextView>(R.id.business_value_value).text = it?.lastvolume.toString().isBlankString()//成交量
-            findViewById<TextView>(R.id.holder_amount_value).text = it?.nontotalholdervolume.toString().isBlankString()//持仓量
+            findViewById<TextView>(R.id.business_value_value).text = NumberUtils.turnoverShort(it?.totalvolume.toString())//成交量
+            findViewById<TextView>(R.id.holder_amount_value).text = NumberUtils.turnoverShort(it?.holdvolume.toString())//持仓量
             findViewById<TextView>(R.id.daily_settlement_value).text = it?.presettle.toString().isBlankString()//昨结价
             findViewById<TextView>(R.id.daily_close_value).text = it?.preclose.toString().isBlankString() //昨收
             findViewById<TextView>(R.id.sell_price_value).text = it?.ask.toString().isBlankString()//卖价
@@ -106,7 +107,7 @@ class ChartActivity : BaseActivity<ChartViewModel>() , View.OnClickListener{
                 findViewById<TextView>(R.id.now_price_value)?.textColor = this.getColor(R.color.rma_green_color)
                 findViewById<TextView>(R.id.now_price_title)?.textColor = this.getColor(R.color.rma_green_color)
             }
-            findViewById<TextView>(R.id.up_down_value).text = it?.getPrice()?.minus(it.preclose).toString()//涨额
+            findViewById<TextView>(R.id.up_down_value).text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.getPrice()?.minus(it.preclose).toString()),2)//涨额
             findViewById<TextView>(R.id.up_down_present).text = it?.getPrice()?.minus(it.preclose)?.div(it.getPrice())//涨幅
                 .toString().toPercentage()
             if (it?.getPrice()?.minus(it.preclose) ?: 0.0 > 0){

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketBaseModel.kt

@@ -184,7 +184,7 @@ class MarketBaseModel : BaseViewModel() {
                 //涨跌
                 if (quoteDayData.last != 0.0 && quoteDayData.preclose != 0.0) {
                     holder.idUpDown?.text =
-                        quoteDayData.last.minus(quoteDayData.preclose).toString()
+                        NumberUtils.roundNum(NumberUtils.doubleDistortion(quoteDayData.last.minus(quoteDayData.preclose).toString()),2)
                 } else {
                     holder.idUpDown?.text = "--"
                 }

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

@@ -395,7 +395,7 @@ class ContractDetailsActivity : BaseActivity<ContractViewModel>() {
                             }
                             viewModel.orderContract(
                                 contractInfo = SpotContractInfo(SaleUserID = selectSalesman.value?.id?.toLong() ?: 0,MerUserID = selectMerchandiser.value?.id?.toLong() ?: 0,TradeUserID = selectTradingData.value?.id?.toLong() ?: 0),
-                                OperateType = "4",
+                                OperateType = "5",
                                 Remark = remarskText.text.toString(),
                                 SpotContractID = data.spotcontractid ?: ""
                             ) {
@@ -421,9 +421,9 @@ class ContractDetailsActivity : BaseActivity<ContractViewModel>() {
                             if (check().not()){
                                 return@onThrottleFirstClick
                             }
-                            viewModel.orderOneContract(
+                            viewModel.orderContract(
                                 contractInfo = SpotContractInfo(SaleUserID = selectSalesman.value?.id?.toLong() ?: 0,MerUserID = selectMerchandiser.value?.id?.toLong() ?: 0,TradeUserID = selectTradingData.value?.id?.toLong() ?: 0),
-                                OperateType = "3",
+                                OperateType = "4",
                                 Remark = remarskText.text.toString(),
                                 SpotContractID = data.spotcontractid ?: ""
                             ) {
@@ -447,7 +447,7 @@ class ContractDetailsActivity : BaseActivity<ContractViewModel>() {
                     textView {
                         onThrottleFirstClick {
                             viewModel.orderContract(
-                                OperateType = "5",
+                                OperateType = "6",
                                 Remark = remarskText.text.toString(),
                                 SpotContractID = data.spotcontractid ?: ""
                             ) {

+ 50 - 28
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/RegisterViewModel.kt

@@ -4,17 +4,20 @@ import android.widget.Toast
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.data.VerificationCodeData
 import cn.muchinfo.rma.global.data.database.BannerEntity
+import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.view.autoWidget.tool.DesTools
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.app.Constant
+import com.alibaba.fastjson.JSONObject
 import com.blankj.utilcode.util.*
 import com.google.gson.Gson
 import com.zhy.http.okhttp.OkHttpUtils
 import com.zhy.http.okhttp.callback.StringCallback
 import mtp.polymer.com.autowidget.utils.TaskUiModel
 import okhttp3.Call
+import okhttp3.MediaType
 
 /**
  * 注册用的viewmodel
@@ -64,17 +67,30 @@ class RegisterViewModel : BaseViewModel(){
     //企业用户注册请求 isaudit 0-否,1-是 企业用户需要注册 userinfotype  1-个人,2-企业 sid 获取图形验证码时传的当前时间戳:
     fun requestEnterpriseInfo(username : String,vcode : String,logincode : String,loginpwd : String,mobilephone : String,cardfrontphotourl : String,
                               isSuccess: (isCompleted: Boolean) -> Unit){
-        OkHttpUtils.post()
+        val json = JSONObject()
+        json["vcode"] = vcode
+        json["username"] = username
+        json["logincode"] = logincode
+        json["loginpwd"] = DesTools.myServiceAddPass(loginpwd)
+        json["mobilephone"] = mobilephone
+        json["cardfrontphotourl"] = cardfrontphotourl
+        json["sid"] = timeMills.value
+        json["isaudit"] = "1"
+        json["userinfotype"] = "2"
+        json["openmode"] = "5"
+        OkHttpUtils.postString()
             .url(SPUtils.getInstance().getString(Constant.openApiUrl) + "/onlineopen/userInfo/add3")
-            .addParams("vcode",vcode)
-            .addParams("logincode",logincode)
-            .addParams("loginpwd", DesTools.myServiceAddPass(loginpwd))
-            .addParams("mobilephone",mobilephone)
-            .addParams("cardfrontphotourl",cardfrontphotourl)
-            .addParams("sid",timeMills.value)
-            .addParams("isaudit","1")
-            .addParams("userinfotype","2")
-            .addParams("openmode","5")
+            .mediaType(MediaType.parse("application/json; charset=utf-8"))
+//            .addParams("vcode",vcode)
+//            .addParams("logincode",logincode)
+//            .addParams("loginpwd", DesTools.myServiceAddPass(loginpwd))
+//            .addParams("mobilephone",mobilephone)
+//            .addParams("cardfrontphotourl",cardfrontphotourl)
+//            .addParams("sid",timeMills.value)
+//            .addParams("isaudit","1")
+//            .addParams("userinfotype","2")
+//            .addParams("openmode","5")
+            .content(json.toJSONString())
             .build()
             .execute(object : StringCallback() {
                 override fun onResponse(response: String?, id: Int) {
@@ -87,7 +103,7 @@ class RegisterViewModel : BaseViewModel(){
                         imageCode.value = allData.msg
                     } else {
                         loadingDialogStatus.value =
-                            TaskUiModel.failed(Throwable(message = allData.msg))
+                            TaskUiModel.failed(InteractiveException(errorMessage = allData.message))
                     }
                 }
 
@@ -103,14 +119,18 @@ class RegisterViewModel : BaseViewModel(){
                               isSuccess: (isCompleted: Boolean) -> Unit){
 
         if (refernum.isNullOrEmpty()){
-            OkHttpUtils.post()
+            val json = JSONObject()
+            json["vcode"] = vcode
+            json["loginpwd"] = DesTools.myServiceAddPass(loginpwd)
+            json["mobilephone"] = mobilephone
+            json["isaudit"] = "0"
+            json["userinfotype"] = "1"
+            json["openmode"] = "5"
+
+            OkHttpUtils.postString()
                 .url(SPUtils.getInstance().getString(Constant.openApiUrl) + "/onlineopen/userInfo/add3")
-                .addParams("vcode",vcode)
-                .addParams("loginpwd", DesTools.myServiceAddPass(loginpwd))
-                .addParams("mobilephone",mobilephone)
-                .addParams("isaudit","0")
-                .addParams("userinfotype","1")
-                .addParams("openmode","5")
+                .mediaType(MediaType.parse("application/json; charset=utf-8"))
+                .content(json.toJSONString())
                 .build()
                 .execute(object : StringCallback() {
                     override fun onResponse(response: String?, id: Int) {
@@ -123,7 +143,7 @@ class RegisterViewModel : BaseViewModel(){
                             imageCode.value = allData.msg
                         } else {
                             loadingDialogStatus.value =
-                                TaskUiModel.failed(Throwable(message = allData.msg))
+                                TaskUiModel.failed(InteractiveException(errorMessage = allData.message))
                         }
                     }
 
@@ -133,15 +153,17 @@ class RegisterViewModel : BaseViewModel(){
                     }
                 })
         }else{
-            OkHttpUtils.post()
+            val json = JSONObject()
+            json["vcode"] = vcode
+            json["loginpwd"] = DesTools.myServiceAddPass(loginpwd)
+            json["mobilephone"] = mobilephone
+            json["isaudit"] = "0"
+            json["userinfotype"] = "1"
+            json["openmode"] = "5"
+            OkHttpUtils.postString()
                 .url(SPUtils.getInstance().getString(Constant.openApiUrl) + "/onlineopen/userInfo/add3")
-                .addParams("vcode",vcode)
-                .addParams("loginpwd", DesTools.myServiceAddPass(loginpwd))
-                .addParams("mobilephone",mobilephone)
-                .addParams("refernum",refernum)
-                .addParams("isaudit","0")
-                .addParams("userinfotype","1")
-                .addParams("openmode","5")
+                .mediaType(MediaType.parse("application/json; charset=utf-8"))
+                .content(json.toJSONString())
                 .build()
                 .execute(object : StringCallback() {
                     override fun onResponse(response: String?, id: Int) {
@@ -154,7 +176,7 @@ class RegisterViewModel : BaseViewModel(){
                             imageCode.value = allData.msg
                         } else {
                             loadingDialogStatus.value =
-                                TaskUiModel.failed(Throwable(message = allData.msg))
+                                TaskUiModel.failed(InteractiveException(errorMessage = allData.message))
                         }
                     }
 

+ 79 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureFragment.kt

@@ -11,7 +11,11 @@ import cn.muchinfo.rma.view.base.BaseFragment
 import cn.muchinfo.rma.view.base.platinumtreasure.adapter.PlatnumTreasureAdapter
 import cn.muchinfo.rma.view.base.procurement.ContentAdapter
 import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
+import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.SizeUtils
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.UI
 
@@ -25,6 +29,15 @@ class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , Pla
     lateinit var horScrollview: CustomHorizontalScrollView
     lateinit var recyclerView: RecyclerView
 
+    lateinit var dataRecyclerview : RecyclerView
+
+    var fistShow: Int = 0
+    var lastShow: Int = 0
+
+    val thisTag by lazy {
+        this.tag
+    }
+
     //标题头部
     val topAdapter by lazy {
         TopTabAdpater(activity)
@@ -34,13 +47,40 @@ class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , Pla
         PlatnumTreasureAdapter(activity)
     }
 
+    //注册eventbus
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        EventBus.getDefault().register(this)
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        EventBus.getDefault().unregister(this)
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onQuoteMessageEvent(quoteMessageEvent: QuoteMessageEvent) {
+
+            /** 行情推送过来的goodsid **/
+            quoteMessageEvent.goodsid.forEach { goodid ->
+                //找到相应商品信息
+                val goodsInfo = viewModel.demoList.value?.find { it.goodsid == goodid }
+                viewModel.demoList.value?.indexOf(goodsInfo)?.let {
+                    if (it != -1) {//刷新相应item
+                        dataRecyclerview?.adapter?.notifyItemChanged(it)
+                    }
+                }
+            }
+
+    }
+
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,
         savedInstanceState: Bundle?
     ): View? {
         return UI {
-            viewModel.initData()
+            viewModel.initData(tag = thisTag ?: "")
             verticalLayout {
                 linearLayout {
                     background = resources.getDrawable(R.color.main_title_bg_color)
@@ -78,7 +118,7 @@ class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , Pla
                         }.lparams(wrapContent, wrapContent){
                             marginStart = autoSize(30)
                         }
-                    }.lparams(autoSize(SizeUtils.dp2px(80f)), autoSize(100))
+                    }.lparams(autoSize(SizeUtils.dp2px(100f)), autoSize(100))
                     platnumTreasureAdapter.setOnContentScrollListener(this@PlatinumTreasureFragment)
                     inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
                         horScrollview = this
@@ -127,12 +167,24 @@ class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , Pla
                         setEnableRefresh(true)
                         setEnableLoadMore(false)
                         setOnRefreshListener {
-
+                            viewModel.queryQuoteDay(
+                                tag = thisTag ?: "",
+                                first = fistShow,
+                                last = lastShow
+                            ) { isCompleted, err ->
+                                if (isCompleted) {
+                                    if (swipeToLayout.getIsRefreshing()) {
+                                        swipeToLayout.finishRefresh()
+                                    }
+                                    dataRecyclerview.adapter?.notifyItemRangeChanged(fistShow, lastShow)
+                                }
+                            }
                         }
                         setEnableScrollContentWhenLoaded(false)
                         setEnableLoadMoreWhenContentNotFull(false)
 
                         recyclerView {//待点价列表
+                            dataRecyclerview = this
                             background = resources.getDrawable(R.color.white)
                             adapter = platnumTreasureAdapter
                             addOnScrollListener(object : RecyclerView.OnScrollListener() {
@@ -151,6 +203,30 @@ class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , Pla
                                     }
                                 }
                             })
+
+                            addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                                override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
+                                    super.onScrollStateChanged(recyclerView, newState)
+                                    // DES: 找出当前可视Item位置
+                                    val linearLayoutManager = dataRecyclerview!!.layoutManager as LinearLayoutManager
+                                    if (newState == RecyclerView.SCROLL_STATE_IDLE) {// 这个判断是当recyclerview不滚动时
+                                        fistShow = linearLayoutManager.findFirstVisibleItemPosition()//获取第一个显示条目
+                                        lastShow = linearLayoutManager.findLastVisibleItemPosition()//获取最后一个显示条目
+                                        if (fistShow != -1 && lastShow != -1) {
+                                            viewModel.queryQuoteDay(
+                                                tag = thisTag ?: "",
+                                                first = fistShow,
+                                                last = lastShow
+                                            ) { isCompleted, err ->
+                                                if (isCompleted) {
+                                                    dataRecyclerview.adapter?.notifyItemRangeChanged(fistShow, lastShow)
+                                                }
+                                            }
+                                        }
+
+                                    }
+                                }
+                            })
                         }
 
 

+ 74 - 12
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureViewModel.kt

@@ -1,30 +1,92 @@
 package cn.muchinfo.rma.view.base.platinumtreasure
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.ColumnsData
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
+import cn.muchinfo.rma.global.database.AppDatabase
+import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.global.room.Builder
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.platinumtreasure.adapter.DemoData
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
 
 /**
  * 铂金宝viewmodel
  */
 class PlatinumTreasureViewModel : BaseViewModel(){
 
-    val demoList : MutableLiveData<List<DemoData>> = MutableLiveData()
+    val demoList : MutableLiveData<List<GoodsInfo>> = MutableLiveData()
 
     val titleList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
 
-    fun initData(){
-        val dataList = arrayListOf<DemoData>()
-        val data = DemoData(titleString = "黄金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
-        val data1 = DemoData(titleString = "白金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
-        val data2 = DemoData(titleString = "白银",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
-        val data3 = DemoData(titleString = "彩金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
-        dataList.add(data)
-        dataList.add(data1)
-        dataList.add(data2)
-        dataList.add(data3)
-        demoList.postValue(dataList)
+    fun initData(tag: String){
+        val list = arrayListOf<GoodsInfo>()
+        val allList = Builder.getDatabase<AppDatabase>().goodsInfoDao.all
+        allList.forEach {
+            if (it.marketid == 69201){
+                list.add(it)
+            }
+        }
+        demoList.postValue(list)
+        queryQuoteDay(tag,0,list.size){isCompleted, err ->  
+
+        }
+    }
+
+
+    /**
+     * 请求盘面信息
+     * @param first Int
+     * @param last Int
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryQuoteDay(
+        tag: String,
+        first: Int,
+        last: Int,
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val goodsCodes = getgoodsCodes(first, last)
+        val params = mutableMapOf<String, String>().apply {
+            put("goodsCodes", goodsCodes)
+        }
+        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                callback(true, null)
+            } else {
+                callback(false, error)
+            }
+        }
+
+        demoList.value?.subList(first, last)?.let { addSubscriptQuote(tag = tag, goodsInfoList = it) }
+    }
+
+    //获取本商品的盘面信息的同时,还要获取关联商品的盘面信息
+    fun getgoodsCodes(first: Int, last: Int): String {
+        var goodsCodes = ""
+        val newList = demoList.value/*?.subList(first, last)*/
+        newList?.forEach {
+            goodsCodes = goodsCodes + it.outgoodscode + "," + DataBase.getInstance().goodsInfoDao().getGoodsInfo(it.relatedgoodsid).outgoodscode + ","
+        }
+        return goodsCodes
+    }
+
+    /**
+     * 订阅行情
+     * @param tag String
+     * @param goodsInfoList List<GoodsInfo>
+     */
+    fun addSubscriptQuote(tag: String, goodsInfoList: List<GoodsInfo>) {
+        GlobalScope.launch {
+            MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
+                tag = tag, goodsCodeSet = goodsInfoList.map { it.outgoodscode }.toSet()
+            ) { isCompleted, err ->
+
+            }
+        }
     }
 
 }

+ 74 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java

@@ -25,7 +25,12 @@ import java.util.List;
 import cn.muchinfo.rma.R;
 import cn.muchinfo.rma.global.GlobalDataCollection;
 import cn.muchinfo.rma.global.data.ContractData;
+import cn.muchinfo.rma.global.data.GoodsInfoAndQuotes;
+import cn.muchinfo.rma.global.data.QuoteDayData;
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo;
+import cn.muchinfo.rma.global.database.DataBase;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils;
 import cn.muchinfo.rma.view.base.home.registration.InvoiceRegistrationActivity;
 import cn.muchinfo.rma.view.base.home.registration.MidpointsRegistrationActivity;
 import cn.muchinfo.rma.view.base.home.registration.PaymentRegistrationActivity;
@@ -42,7 +47,7 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
 
 
     private Context context;
-    private List<DemoData> datas;
+    private List<GoodsInfo> datas;
     private int index = -1;
     private int position = -1;
     private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
@@ -63,7 +68,7 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
         this.context = context;
     }
 
-    public void setDatas(List<DemoData> datas) {
+    public void setDatas(List<GoodsInfo> datas) {
         this.datas = datas;
         notifyDataSetChanged();
     }
@@ -85,18 +90,79 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
         return new ItemViewHolder(view);
     }
 
+    //回购 买一价  销售 卖一价
     @SuppressLint("SetTextI18n")
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
-        itemViewHolder.tvLeftTitle.setText(datas.get(i).getTitleString());
+        GoodsInfo data = datas.get(i);
+        itemViewHolder.tvLeftTitle.setText(datas.get(i).getGoodsname());
         //右边滑动部分
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
         linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
         itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
         itemViewHolder.rvItemRight.setHasFixedSize(true);
         QhjRightScrollAdapter qhjRightScrollAdapter = new QhjRightScrollAdapter(context);
-        qhjRightScrollAdapter.setDatas(datas.get(i).getRightData());
+        List<QHjRightData> rightData = new ArrayList<>();
+        //获取盘面信息
+        QuoteDayData quoteDayData = null;//当前商品的盘面信息(有用的只有买一卖一价即回购销售价,其他信息用关联商品的)
+        QuoteDayData relateQuoteDayData = null;//关联商品的盘面信息
+        GoodsInfo relateGoodsInfo = null;//关联商品实体
+        relateGoodsInfo = DataBase.Companion.getInstance().goodsInfoDao().getGoodsInfo(data.getRelatedgoodsid());//获取关联商品的商品详情
+        List<GoodsInfoAndQuotes> quotesList = GlobalDataCollection.Companion.getInstance().getGoodsInfoAndQuotesList();//获取盘面信息列表
+        for (int j = 0;j < quotesList.size();j++){
+            if (data.getOutgoodscode().equals(quotesList.get(j).getOutgoodscode())){
+                quoteDayData = quotesList.get(j).getQuoteDayData();//赋值当前商品的盘面信息
+            }
+            if (relateGoodsInfo != null){
+                if (relateGoodsInfo.getOutgoodscode().equals(quotesList.get(j).getOutgoodscode())){
+                    relateQuoteDayData = quotesList.get(j).getQuoteDayData();//赋值关联商品的盘面信息
+                }
+            }
+        }
+
+        if (quoteDayData != null){
+            QHjRightData bidData = new QHjRightData();
+            bidData.setValue(String.valueOf(quoteDayData.getBid()));//加入回购价买一价
+            bidData.setColorType("1");
+            rightData.add(bidData);
+
+            QHjRightData askData = new QHjRightData();
+            askData.setValue(String.valueOf(quoteDayData.getAsk()));//加入销售价卖一价
+            askData.setColorType("1");
+            rightData.add(askData);
+        }
+
+        if (relateQuoteDayData != null){
+            //涨跌幅
+            QHjRightData appliesData = new QHjRightData();
+            //涨跌
+            QHjRightData riseFallData = new QHjRightData();
+            if (relateQuoteDayData.getLast() != 0 && relateQuoteDayData.getPreclose() != 0) {
+                String textUpDown = NumberUtils.roundNum(NumberUtils.doubleDistortion(String.valueOf((quoteDayData.getPrice() - quoteDayData.getPreclose()))),2);
+                String textApplies = NumberUtils.roundNum(String.valueOf((((quoteDayData.getPrice() - quoteDayData.getPreclose()) / quoteDayData.getPrice()) * 100)),2);
+                riseFallData.setValue(textUpDown);
+                appliesData.setValue(textApplies);
+                if (Double.valueOf(textUpDown) > 0){
+                    riseFallData.setColorType("3");
+                    appliesData.setColorType("3");
+                }else if (Double.valueOf(textUpDown) < 0){
+                    riseFallData.setColorType("2");
+                    appliesData.setColorType("2");
+                }else {
+                    riseFallData.setColorType("1");
+                    appliesData.setColorType("1");
+                }
+            } else {
+                riseFallData.setValue("--");
+                riseFallData.setColorType("1");
+            }
+
+
+        }
+
+
+        qhjRightScrollAdapter.setDatas(rightData);
         itemViewHolder.rvItemRight.setAdapter(qhjRightScrollAdapter);
         //缓存当前holder
         if (!mViewHolderList.contains(itemViewHolder)) {
@@ -122,6 +188,8 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
             @Override
             public void onClick(View view) {
                 Intent intent = new Intent();
+                intent.putExtra("goodsId",String.valueOf(data.getGoodsid()));
+                intent.putExtra("outGoodsCode",data.getOutgoodscode());
                 intent.setClass(context, PlatinumTradeActivity.class);
                 ActivityUtils.startActivity(intent);
             }
@@ -131,6 +199,8 @@ public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasure
             @Override
             public void onClick(View view) {
                 Intent intent = new Intent();
+                intent.putExtra("goodsId",String.valueOf(data.getGoodsid()));
+                intent.putExtra("outGoodsCode",data.getOutgoodscode());
                 intent.setClass(context, PlatinumTradeActivity.class);
                 ActivityUtils.startActivity(intent);
             }

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QHjRightData.kt

@@ -0,0 +1,6 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.adapter
+
+data class QHjRightData(
+    var colorType : String = "",//1 黑色 2 绿色 3红色
+    var value : String = ""
+)

+ 14 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QhjRightScrollAdapter.java

@@ -17,13 +17,13 @@ public class QhjRightScrollAdapter extends RecyclerView.Adapter<QhjRightScrollAd
 
 
     private Context context;
-    private List<String> rightDatas;
+    private List<QHjRightData> rightDatas;
 
     public QhjRightScrollAdapter(Context context) {
         this.context = context;
     }
 
-    public void setDatas(List<String> rightDatas) {
+    public void setDatas(List<QHjRightData> rightDatas) {
         this.rightDatas = rightDatas;
         notifyDataSetChanged();
     }
@@ -38,7 +38,18 @@ public class QhjRightScrollAdapter extends RecyclerView.Adapter<QhjRightScrollAd
 
     @Override
     public void onBindViewHolder(@NonNull ScrollViewHolder scrollViewHolder, int i) {
-        scrollViewHolder.mTvScrollItem.setText(rightDatas.get(i));
+        QHjRightData data = rightDatas.get(i);
+        if (data.getColorType().equals("1")){//黑色
+//            scrollViewHolder.mTvScrollItem.setBackgroundColor(null);
+            scrollViewHolder.mTvScrollItem.setTextColor(context.getResources().getColor(R.color.rma_black_33));
+        }else  if (data.getColorType().equals("2")){//绿色
+            scrollViewHolder.mTvScrollItem.setBackground(context.getResources().getDrawable(R.drawable.qhj_green_bg));
+            scrollViewHolder.mTvScrollItem.setTextColor(context.getResources().getColor(R.color.rma_green_color));
+        }else {//红色
+            scrollViewHolder.mTvScrollItem.setBackground(context.getResources().getDrawable(R.drawable.qhj_red_bg));
+            scrollViewHolder.mTvScrollItem.setTextColor(context.getResources().getColor(R.color.rma_red_color));
+        }
+        scrollViewHolder.mTvScrollItem.setText(data.getValue());
     }
 
     @Override

+ 41 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt

@@ -2,14 +2,22 @@ package cn.muchinfo.rma.view.base.platinumtreasure.trade
 
 import android.view.Gravity
 import android.view.View
+import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.database.AppDatabase
+import cn.muchinfo.rma.global.isBlankString
+import cn.muchinfo.rma.global.room.Builder
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
 import cn.muchinfo.rma.view.base.app.FutureConstent
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.main.castsurely.MyCastSurelyViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
 import org.jetbrains.anko.*
 
 /**
@@ -23,9 +31,15 @@ import org.jetbrains.anko.*
 class PlatinumBuyOrSellUI(
     private val activity: PlatinumTradeActivity,
     private val viewModel: PlatinumTradeViewModel,
+    private val goodsId : String,
+    private val outGoodsCode : String,
+    private val thisTag : String,
     private val type: String
 ) {
 
+    //选择的交易类型 金额或者数量
+    val selectPayType : MutableLiveData<SelectData> = MutableLiveData()
+
     // 下拉刷新
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -47,9 +61,16 @@ class PlatinumBuyOrSellUI(
             )
         }
 
+    fun initData(goodsId: String, outGoodsCode: String = "",buyOrSell: Int = -1,isShowLoading : Boolean = true){
+        selectPayType.postValue(SelectData(id = "1",value = "数量"))
+        viewModel.goodsInfoData.postValue(Builder.getDatabase<AppDatabase>().goodsInfoDao.getGoodsInfo(goodsId.toInt()))//获取商品详情
+        viewModel.queryQuoteDay(tag = thisTag,goodsCodes = outGoodsCode,isShowLoading = isShowLoading)//请求盘面
+    }
+
     val root = _FrameLayout(activity).apply {
 
         verticalLayout {
+            initData(goodsId = goodsId,outGoodsCode = outGoodsCode,isShowLoading = false)
             background = resources.getDrawable(R.color.main_hit_bg_color)
             linearLayout {
                 background = resources.getDrawable(R.color.white)
@@ -66,7 +87,9 @@ class PlatinumBuyOrSellUI(
                 }
 
                 textView {
-                    text = "黄金"
+                    viewModel.goodsInfoData.bindOptional(context){
+                        text = it?.goodsname?.isBlankString()
+                    }
                     textColorInt = R.color.rma_black_33
                     textSizeAuto = 36
                 }.lparams(wrapContent, wrapContent) {
@@ -112,8 +135,17 @@ class PlatinumBuyOrSellUI(
 
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
+                        onThrottleFirstClick {
+                            val selectDataList = arrayListOf(SelectData(id = "1",value = "数量"),
+                                SelectData(id = "2",value = "金额"))
+                            activity.creatBottomSheetDialog("请选择方式", selectDataList) {
+                                selectPayType.postValue(this)
+                            }
+                        }
                         textView {
-                            text = "价格"
+                            selectPayType.bindOptional(context){
+                                text = it?.value
+                            }
                             textSizeAuto = 36
                             textColorInt = R.color.rma_gray_color
                         }.lparams(wrapContent, wrapContent) {
@@ -124,7 +156,7 @@ class PlatinumBuyOrSellUI(
                             imageResource = R.mipmap.qhj_trade_numberamout_select
                         }.lparams(autoSize(14), autoSize(14)) {
                             marginStart = autoSize(8)
-                            topMargin = autoSize(70)
+                            topMargin = autoSize(20)
                         }
 
                         numberEditText {
@@ -160,7 +192,9 @@ class PlatinumBuyOrSellUI(
                             emptyView()
 
                             textView {
-                                text = "3234.2"
+                                viewModel.quoteDayData.bindOptional(context){
+                                    text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.ask.toString()),2)//卖一
+                                }
                                 textSizeAuto = 41
                                 textColorInt = R.color.rma_red_color
                             }.lparams(wrapContent, wrapContent) {
@@ -181,7 +215,9 @@ class PlatinumBuyOrSellUI(
                             emptyView()
 
                             textView {
-                                text = "3234.2"
+                                viewModel.quoteDayData.bindOptional(context){
+                                    text = NumberUtils.roundNum(NumberUtils.doubleDistortion(it?.bid.toString()),2)//买一
+                                }
                                 textSizeAuto = 41
                                 textColorInt = R.color.rma_red_color
                             }.lparams(wrapContent, wrapContent) {

+ 47 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt

@@ -7,16 +7,24 @@ import android.view.ViewGroup
 import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.database.AppDatabase
+import cn.muchinfo.rma.global.room.Builder
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.tabSegment
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.LogUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.util.QMUIStatusBarHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 
@@ -26,18 +34,33 @@ import org.jetbrains.anko.support.v4.viewPager
  */
 class PlatinumTradeActivity : BaseActivity<PlatinumTradeViewModel>(){
 
+    /** 当前页面的goodsid **/
+    val goodsId by lazy {
+        intent.getStringExtra("goodsId")
+    }
+
+    val outGoodsCode by lazy {
+        intent.getStringExtra("outGoodsCode")
+    }
+
+    /** 用于订阅行情的唯一标识 */
+    val thisTag by lazy {
+        "platinumtradeorder"
+    }
+
+
     lateinit var segment: QMUITabSegment
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
     //交易买入UI
     private val platinumBuyUI by lazy {
-        PlatinumBuyOrSellUI(this,viewModel,"1")
+        PlatinumBuyOrSellUI(this,viewModel,goodsId ?: "",outGoodsCode ?: "",thisTag,"1")
     }
 
     //交易卖出UI
     private val platinumSellUI by lazy {
-        PlatinumBuyOrSellUI(this,viewModel,"2")
+        PlatinumBuyOrSellUI(this,viewModel,goodsId ?: "",outGoodsCode ?: "",thisTag,"2")
     }
 
     //撤单UI
@@ -106,9 +129,31 @@ class PlatinumTradeActivity : BaseActivity<PlatinumTradeViewModel>(){
         }
     }
 
+    //行情推送通知
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onQuoteMessageEvent(quoteMessageEvent: QuoteMessageEvent) {
+        val goodsids = quoteMessageEvent.goodsid
+        //如果推送的goodsid包含当前页面的goodsid,则进行页面刷新
+        if (goodsids.contains(goodsId?.toInt())){
+            LogUtils.eTag("dasjhdkjagfkask","行情推送" + goodsId)
+            val goodsInfo = Builder.getDatabase<AppDatabase>().goodsInfoDao.getGoodsInfo(goodsId?.toInt() ?: 0)
+            val quote = GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { goodsInfo?.outgoodscode == it.outgoodscode }?.quoteDayData
+            if (quote != null){
+                viewModel.quoteDayData.postValue(quote)
+            }
+        }
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        viewModel.removeSubscriptQuote(thisTag)
+        EventBus.getDefault().unregister(this)
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         QMUIStatusBarHelper.translucent(this)
+        EventBus.getDefault().register(this)
         verticalLayout {
             initDataView()
             linearLayout {

+ 85 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt

@@ -1,6 +1,14 @@
 package cn.muchinfo.rma.view.base.platinumtreasure.trade
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.data.QuoteDayData
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 千海金交易页面的viewmodel
@@ -8,5 +16,82 @@ import cn.muchinfo.rma.view.base.BaseViewModel
 class PlatinumTradeViewModel : BaseViewModel(){
 
 
+    /**
+     * 数据初始化状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /** 当前页面的商品信息 **/
+    val goodsInfoData: MutableLiveData<GoodsInfo> = MutableLiveData()
+
+    /**
+     * 交易页面的当前商品的盘面信息
+     */
+    val quoteDayData: MutableLiveData<QuoteDayData> = MutableLiveData()
+
+
+    /**
+     * 请求盘面信息
+     * @param first Int
+     * @param last Int
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryQuoteDay(
+        tag : String,
+        goodsCodes: String,
+        isShowLoading : Boolean
+    ) {
+        if (isShowLoading){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
+
+        val params = mutableMapOf<String, String>().apply {
+            put("goodsCodes", goodsCodes)
+        }
+        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                if (respData?.isEmpty()?.not() == true) {
+                    quoteDayData.postValue(respData[0])
+                }
+                if (isShowLoading){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功"))
+                }
+
+            } else {
+                if (isShowLoading){
+                    loadingDialogStatus.postValue(TaskUiModel.failed(InteractiveException(errorMessage = "数据请求失败")))
+                }
+            }
+        }
+        addSubscriptQuote(tag = tag,goodsCodes = setOf(goodsCodes))
+    }
+
+
+    /**
+     * 订阅行情
+     * @param tag String
+     * @param goodsInfoList List<GoodsInfo>
+     */
+    fun addSubscriptQuote(tag : String,goodsCodes: Set<String>){
+        GlobalScope.launch {
+            MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
+                tag = tag,goodsCodeSet = goodsCodes
+            ){isCompleted, err ->
+
+            }
+        }
+    }
+
+    /**
+     * 取消订阅
+     * @param tag String
+     */
+    fun removeSubscriptQuote(tag : String){
+        GlobalScope.launch {
+            MyApplication.getInstance()?.quoteManager?.removeSubscriptQuote(
+                tag = tag
+            )
+        }
+    }
 
 }

+ 3 - 3
RMA/app/src/main/res/layout/layout_item_platinum_content.xml

@@ -12,17 +12,17 @@
         android:layout_height="35dp">
 
         <LinearLayout
-            android:layout_width="100dp"
+            android:layout_width="120dp"
             android:orientation="horizontal"
             android:layout_height="match_parent">
             <LinearLayout
                 android:gravity="center_vertical"
                 android:orientation="vertical"
-                android:layout_width="70dp"
+                android:layout_width="90dp"
                 android:layout_height="match_parent">
 
                 <TextView
-                    android:layout_marginEnd="20dp"
+                    android:layout_marginLeft="5dp"
                     android:layout_gravity="center"
                     android:layout_marginStart="7dp"
                     android:id="@+id/tv_left_title"

+ 0 - 1
RMA/app/src/main/res/layout/layout_qhj_item_scroll.xml

@@ -9,7 +9,6 @@
         android:layout_width="60dp"
         android:layout_height="35dp">
         <TextView
-            android:background="@drawable/qhj_green_bg"
             android:textSize="12sp"
             android:gravity="center"
             android:id="@+id/tv_right_scroll"

+ 1 - 1
RMA/gradle.properties

@@ -6,7 +6,7 @@
 # http://www.gradle.org/docs/current/userguide/build_environment.html
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xms2560M -Xmx2560M -XX:MetaspaceSize=2560M -XX:MaxMetaspaceSize=2560M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xms2560M -Xmx2560M -XX:MetaspaceSize=2048M -XX:MaxMetaspaceSize=2560M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
 # When configured, Gradle will run in incubating parallel mode.
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects