Kaynağa Gözat

风险管理7月7日提交代码-liu.bolan-千海金

Liu.bolan 4 yıl önce
ebeveyn
işleme
4e5f52aa22
42 değiştirilmiş dosya ile 2152 ekleme ve 161 silme
  1. 2 2
      RMA/app/build.gradle
  2. 2 0
      RMA/app/src/main/AndroidManifest.xml
  3. 40 36
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt
  4. 109 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/BrokerRewardLogData.kt
  5. 67 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeDetailData.kt
  6. 65 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/MyTeamData.kt
  7. 117 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/MyTeamOrderData.kt
  8. 41 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/LoginQueryData.kt
  9. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  10. 2 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt
  11. 221 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/AESEncryptUtils.java
  12. 169 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/BASE64Decoder.java
  13. 116 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/BASE64Encoder.java
  14. 11 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CEFormatException.java
  15. 9 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CEStreamExhausted.java
  16. 245 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CharacterDecoder.java
  17. 389 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CharacterEncoder.java
  18. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/EnUtil.java
  19. 2 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  20. 5 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/chart/ChartActivity.kt
  21. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt
  22. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/markets/MarketBaseModel.kt
  23. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  24. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddTransactionUserActivity.kt
  25. 7 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt
  26. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tradingquery/EntrustHistoryViewHolder.kt
  27. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/tradingquery/TradingHistoryViewHolder.kt
  28. 5 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  29. 44 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginViewModel.kt
  30. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/EnterpriseRegisterActivity.kt
  31. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/PersonalRegisterActivity.kt
  32. 7 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainFragment.kt
  33. 7 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/AddCastSurelyActivity.kt
  34. 10 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewModel.kt
  35. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/AddWithDrawActivity.kt
  36. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt
  37. 287 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/DealDetailsActivity.kt
  38. 122 78
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/DealViewHolder.kt
  39. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/NoPayViewHolder.kt
  40. 20 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt
  41. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/recycling/RecyclingFragment.kt
  42. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/recycling/adapter/RecyclingAdapter.java

+ 2 - 2
RMA/app/build.gradle

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

+ 2 - 0
RMA/app/src/main/AndroidManifest.xml

@@ -353,6 +353,8 @@
 
         <activity android:name=".view.base.platinumtreasure.trade.NoPayDetailsActivity"/>
 
+        <activity android:name=".view.base.platinumtreasure.trade.DealDetailsActivity"/>
+
     </application>
 
 </manifest>

+ 40 - 36
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt

@@ -171,8 +171,8 @@ open class AccountData(
     var rightsAndInterests: Double = 0.0,//权益
     var orderValue: Double = 0.0,//建仓市值
 
-    var raisedAmount : Double = 0.0,//合约市场融资额
-    var valueOfposition : Double = 0.0//合约市场总市值
+    var raisedAmount: Double = 0.0,//合约市场融资额
+    var valueOfposition: Double = 0.0//合约市场总市值
 ) {
 
     /**
@@ -181,49 +181,53 @@ open class AccountData(
      * 逐笔浮盈【实时行情更新】(MTP:开仓盈亏、平仓盈亏) 买方向 = (最新价 - 开仓均价) * 买期末头寸 * 合约单位;卖方向 = (开仓均价 - 最新价) * 卖期末头寸 * 合约单位
      */
     fun setNormalData() {
-        if (Constant.IS_QHJ){
-            /** 计算总市值 ***/
-            val contractTradePositionDataArrayList = GlobalDataCollection.instance?.contractTradePositionDataArrayList
-            contractTradePositionDataArrayList?.forEach {
-                val goodsInfoData = DataBase.getInstance().goodsInfoDao()
-                    .getGoodsInfo(it?.goodsid?.toInt() ?: 0)
-                val quoteDayData =
-                    GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { data ->
-                        data.outgoodscode == goodsInfoData.goodscode
-                    }?.quoteDayData
-                valueOfposition += quoteDayData?.bid?.times(
-                    it?.curpositionqty?.toDouble() ?: 0.0
-                ) ?: 0.0
-                /** 计算融资额 **/
-                val qhjContractDetailsDataArrayList = GlobalDataCollection.instance?.qhjContractDetailsDataArrayList
-                qhjContractDetailsDataArrayList?.forEach {
-                    raisedAmount += it?.remainamount?.toDouble() ?: 0.0
-                }
-            }
-        }else{
-            val futureHoldDatalist = GlobalDataCollection.instance?.futureHoldData
-            futureHoldDatalist?.forEach { data ->
 
-                data.calculate()
-                /** 计算持仓浮动盈亏汇总 **/
-                keep_watch_profit_and_loss = (keep_watch_profit_and_loss + data.positionpl)
-                /** 计算平仓浮动盈亏汇总 **/
-                close_watch_profit_and_loss = (close_watch_profit_and_loss + data.openpl)
-                /** 计算建仓市值 */
-                orderValue += data.opencost
+        /** 计算总市值 ***/
+        val contractTradePositionDataArrayList =
+            GlobalDataCollection.instance?.contractTradePositionDataArrayList
+        contractTradePositionDataArrayList?.forEach {
+            val goodsInfoData = DataBase.getInstance().goodsInfoDao()
+                .getGoodsInfo(it?.goodsid?.toInt() ?: 0)
+            val quoteDayData =
+                GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { data ->
+                    data.outgoodscode == goodsInfoData.goodscode
+                }?.quoteDayData
+            valueOfposition += quoteDayData?.bid?.times(
+                it?.curpositionqty?.toDouble() ?: 0.0
+            ) ?: 0.0
+            /** 计算融资额 **/
+            val qhjContractDetailsDataArrayList =
+                GlobalDataCollection.instance?.qhjContractDetailsDataArrayList
+            qhjContractDetailsDataArrayList?.forEach {
+                raisedAmount += it?.remainamount?.toDouble() ?: 0.0
             }
-            /** 计算可用金额 **/
-            canUserAmount = currentbalance.plus(keep_watch_profit_and_loss).minus(usedmargin).minus(freezecharge).minus(otherfreezemargin).minus(outamountfreeze)
-            /** 权益 **/
-            rightsAndInterests = currentbalance.plus(keep_watch_profit_and_loss)
         }
 
+        val futureHoldDatalist = GlobalDataCollection.instance?.futureHoldData
+        futureHoldDatalist?.forEach { data ->
+
+            data.calculate()
+            /** 计算持仓浮动盈亏汇总 **/
+            keep_watch_profit_and_loss = (keep_watch_profit_and_loss + data.positionpl)
+            /** 计算平仓浮动盈亏汇总 **/
+            close_watch_profit_and_loss = (close_watch_profit_and_loss + data.openpl)
+            /** 计算建仓市值 */
+            orderValue += data.opencost
+        }
+        /** 计算可用金额 **/
+        canUserAmount =
+            currentbalance.plus(keep_watch_profit_and_loss).minus(usedmargin).minus(freezecharge)
+                .minus(otherfreezemargin).minus(outamountfreeze)
+        /** 权益 **/
+        rightsAndInterests = currentbalance.plus(keep_watch_profit_and_loss)
+
+
     }
 
     /**
      * 每次计算资金信息前需要把平仓盯市盈亏,持仓盯市盈亏,可用资金,权益,建仓市值清0
      */
-    fun clearData(){
+    fun clearData() {
         close_watch_profit_and_loss = 0.0
         keep_watch_profit_and_loss = 0.0
         canUserAmount = 0.0

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

@@ -0,0 +1,109 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 查询奖励流水(我的奖励)
+ */
+data class BrokerRewardLogData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//资金账号ID
+    @SerializedName("createtime")
+    val createtime : String? = "",//创建时间(时间)
+    @SerializedName("handlestatus")
+    val handlestatus : String? = "",//处理状态
+    @SerializedName("logid")
+    val logid : String? = "",//奖励流水ID(912+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
+    @SerializedName("marketid")
+    val marketid : String? = "",//市场ID
+    @SerializedName("mmaccountid")
+    val mmaccountid : String? = "",//做市商资金账号ID
+    @SerializedName("mmuserid")
+    val mmuserid : String? = "",//做市商用户ID
+    @SerializedName("rewardamount")
+    val rewardamount : String? = "",//奖励金额
+    @SerializedName("rewardmodel")
+    val rewardmodel : String? = "",//消费奖励方式 - 1:比率 2:固定
+    @SerializedName("rewardtype")
+    val rewardtype : String? = "",//奖励类型 - 1:推广 2:消费1级 3:消费2级
+    @SerializedName("rewardvalue")
+    val rewardvalue : String? = "",//配置奖励值
+    @SerializedName("srcamount")
+    val srcamount : String? = "",//成交金额 [消费奖励] (金额)
+    @SerializedName("srcgoodsid")
+    val srcgoodsid : String? = "",//来源商品ID [消费奖励]
+    @SerializedName("srctime")
+    val srctime : String? = "",//来源时间 (成交时间) [消费奖励]
+    @SerializedName("srctradeid")
+    val srctradeid : String? = "",//来源成交单ID [消费奖励] - 排除提货成交
+    @SerializedName("srcuserid")
+    val srcuserid : String? = "",//来源用户ID(推广账户)
+    @SerializedName("srcusername")
+    val srcusername : String? = "",//推广账户名称
+    @SerializedName("tradedate")
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    @SerializedName("userid")
+    val userid : String? = ""//经纪人用户ID
+) : 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()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(createtime)
+        parcel.writeString(handlestatus)
+        parcel.writeString(logid)
+        parcel.writeString(marketid)
+        parcel.writeString(mmaccountid)
+        parcel.writeString(mmuserid)
+        parcel.writeString(rewardamount)
+        parcel.writeString(rewardmodel)
+        parcel.writeString(rewardtype)
+        parcel.writeString(rewardvalue)
+        parcel.writeString(srcamount)
+        parcel.writeString(srcgoodsid)
+        parcel.writeString(srctime)
+        parcel.writeString(srctradeid)
+        parcel.writeString(srcuserid)
+        parcel.writeString(srcusername)
+        parcel.writeString(tradedate)
+        parcel.writeString(userid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<BrokerRewardLogData> {
+        override fun createFromParcel(parcel: Parcel): BrokerRewardLogData {
+            return BrokerRewardLogData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<BrokerRewardLogData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

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

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

@@ -0,0 +1,65 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 我的团队
+ */
+data class MyTeamData(
+    @SerializedName("accountname")
+    val accountname : String? = "",//用户名称
+    @SerializedName("accountstatus")
+    val accountstatus : String? = "",//账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)
+    @SerializedName("createtime")
+    val createtime : String? = "",//创建时间
+    @SerializedName("mobile")
+    val mobile : String? = "",//手机号码
+    @SerializedName("refereeuserid")
+    val refereeuserid : String? = "",//推荐人id
+    @SerializedName("refernum")
+    val refernum : String? = "",//推荐码
+    @SerializedName("userid")
+    val userid : String? = "",//用户id
+    @SerializedName("userinfotype")
+    val userinfotype : String? = ""//用户类型 1-个人 2-企业
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        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(accountname)
+        parcel.writeString(accountstatus)
+        parcel.writeString(createtime)
+        parcel.writeString(mobile)
+        parcel.writeString(refereeuserid)
+        parcel.writeString(refernum)
+        parcel.writeString(userid)
+        parcel.writeString(userinfotype)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<MyTeamData> {
+        override fun createFromParcel(parcel: Parcel): MyTeamData {
+            return MyTeamData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<MyTeamData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,117 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 查询团队订单(我的团队/团队订单)
+ */
+data class MyTeamOrderData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//账户ID[报价币种]
+    @SerializedName("accountname")
+    val accountname : String? = "",//账户名称
+    @SerializedName("agreeunit")
+    val agreeunit : String? = "",//合约乘数
+    @SerializedName("buyorsell")
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    @SerializedName("decimalplace")
+    val decimalplace : String? = "",//报价小数位
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//单位名称
+    @SerializedName("goodscode")
+    val goodscode : String? = "",//商品代码(内部)
+    @SerializedName("goodsid")
+    val goodsid : String? = "",//商品ID
+    @SerializedName("goodsname")
+    val goodsname : String? = "",//商品名称
+    @SerializedName("goodunitid")
+    val goodunitid : String? = "",//报价单位ID
+    @SerializedName("marketid")
+    val marketid : String? = "",//市场ID
+    @SerializedName("marketname")
+    val marketname : String? = "",//市场名称
+    @SerializedName("qtydecimalplace")
+    val qtydecimalplace : String? = "",//成交量小数位
+    @SerializedName("refereeuserid")
+    val refereeuserid : String? = "",//推荐人ID
+    @SerializedName("tradeamount")
+    val tradeamount : String? = "",//成交金额[账户币种,用于所有权]
+    @SerializedName("tradedate")
+    val tradedate : String? = "",//交易日(yyyyMMdd)
+    @SerializedName("trademode")
+    val trademode : String? = "",//交易模式 - 10:做市 13:竞价 15:通道交易 16:挂牌点选 17:仓单贸易 18:期权 19:竞拍-降价式 20:竞拍-竞价式 21:竞拍-大宗式 22:受托竞价
+    @SerializedName("tradeprice")
+    val tradeprice : String? = "",//成交价格
+    @SerializedName("tradeqty")
+    val tradeqty : String? = "",//成交数量
+    @SerializedName("tradetime")
+    val tradetime : String? = "",//成交时间
+    @SerializedName("userid")
+    val userid : String? = ""//用户ID
+) : 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()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(accountname)
+        parcel.writeString(agreeunit)
+        parcel.writeString(buyorsell)
+        parcel.writeString(decimalplace)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+        parcel.writeString(goodunitid)
+        parcel.writeString(marketid)
+        parcel.writeString(marketname)
+        parcel.writeString(qtydecimalplace)
+        parcel.writeString(refereeuserid)
+        parcel.writeString(tradeamount)
+        parcel.writeString(tradedate)
+        parcel.writeString(trademode)
+        parcel.writeString(tradeprice)
+        parcel.writeString(tradeqty)
+        parcel.writeString(tradetime)
+        parcel.writeString(userid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<MyTeamOrderData> {
+        override fun createFromParcel(parcel: Parcel): MyTeamOrderData {
+            return MyTeamOrderData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<MyTeamOrderData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 41 - 2
RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/LoginQueryData.kt

@@ -30,5 +30,44 @@ data class LoginQueryData(
     val externalExchanges: List<ExternalExchanges>? = arrayListOf(), // 外部交易所
     @SerializedName("systemParams")
     @Expose
-    val systemParams: List<SystemParams>? = arrayListOf() // 系统参数
-) 
+    val systemParams: List<SystemParams>? = arrayListOf(), // 系统参数
+    @SerializedName("areaRoles")
+    val areaRoles : List<AreaRolesData>? = arrayListOf()//所属角色信息
+)
+
+data class AreaRolesData(
+    @SerializedName("createtime")
+    val createtime : String = "",
+    @SerializedName("creatorid")
+    val creatorid : String = "",
+    @SerializedName("fromuserid")
+    val fromuserid : String = "",
+    @SerializedName("isreturnscore")
+    val isreturnscore : String = "",
+    @SerializedName("modifierid")
+    val modifierid : String = "",
+    @SerializedName("modifytime")
+    val modifytime : String = "",
+    @SerializedName("orgtype")
+    val orgtype : String = "",
+    @SerializedName("outuserid")
+    val outuserid : String = "",
+    @SerializedName("parentuserid")
+    val parentuserid : String = "",
+    @SerializedName("roletype")
+    val roletype : String = "",
+    @SerializedName("rootuserid")
+    val rootuserid : String = "",
+    @SerializedName("shoppassword")
+    val shoppassword : String = "",
+    @SerializedName("sublevelpath")
+    val sublevelpath : String = "",
+    @SerializedName("suborgtype")
+    val suborgtype : String = "",
+    @SerializedName("tradeaccountid")
+    val tradeaccountid : String = "",
+    @SerializedName("transurl")
+    val transurl : String = "",
+    @SerializedName("userid")
+    val userid : String = ""
+)

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

@@ -26,6 +26,7 @@ import cn.muchinfo.rma.view.eventbus.EventConstent
 import cn.muchinfo.rma.view.eventbus.MessageEvent
 import com.blankj.utilcode.util.AppUtils
 import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.SPUtils
 import com.blankj.utilcode.util.ToastUtils
 import com.facebook.drawee.backends.pipeline.Fresco
 import com.next.easynavigation.view.EasyNavigationBar
@@ -207,7 +208,7 @@ class MainActivity : BaseActivity<MainViewModel>() {
                     }.show()
                 } else {
                     EventBus.getDefault().post(MessageEvent(EventConstent.USERACCOUNTCHANGE))
-                    if (Constant.IS_QHJ.not()){
+                    if ((SPUtils.getInstance().getString(Constant.oem) == "qhj").not()){
                          if (GlobalDataCollection.instance?.getFirstLevelMenu("client_futures") == true) {
                         futureFragment.refrashAccount()
                     }

+ 2 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt

@@ -172,11 +172,10 @@ class MainViewModel : BaseViewModel() {
         MyApplication.getInstance()?.initializeManager?.getUserAccount(params = params) { isSuccess, respData, error ->
             isInitiaDataSuccess.postValue(isSuccess)
             if (isSuccess) {
-                if (Constant.IS_QHJ){
+                if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
                     queryContractTradePosition()
-                }else{
-                    queryErmcpTradePosition()//第三步请求持仓头寸
                 }
+                queryErmcpTradePosition()//第三步请求持仓头寸
                 GlobalDataCollection.instance?.userAccountData = respData
             } else {
                 loadingDialogStatus.postValue(TaskUiModel.idel())

+ 221 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/AESEncryptUtils.java

@@ -0,0 +1,221 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+import android.annotation.SuppressLint;
+import android.text.TextUtils;
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+
+import javax.crypto.*;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * 编码工具类
+ * 1.将byte[]转为各种进制的字符串
+ * 2.base 64 encode
+ * 3.base 64 decode
+ * 4.获取byte[]的md5值
+ * 5.获取字符串md5值
+ * 6.结合base64实现md5加密
+ * 7.AES加密
+ * 8.AES加密为base 64 code
+ * 9.AES解密
+ * 10.将base 64 code AES解密
+ *
+ * @author uikoo9
+ * @version 0.0.7.20140601
+ */
+public class AESEncryptUtils {
+    /**
+     * 将byte[]转为各种进制的字符串
+     *
+     * @param bytes byte[]
+     * @param radix 可以转换进制的范围,从Character.MIN_RADIX到Character.MAX_RADIX,超出范围后变为10进制
+     * @return 转换后的字符串
+     */
+    public static String binary(byte[] bytes, int radix) {
+        return new BigInteger(1, bytes).toString(radix);// 这里的1代表正数
+    }
+
+    /**
+     * base 64 encode
+     *
+     * @param bytes 待编码的byte[]
+     * @return 编码后的base 64 code
+     */
+    public static String base64Encode(byte[] bytes) {
+        return new BASE64Encoder().encode(bytes);
+    }
+
+    /**
+     * base 64 decode
+     *
+     * @param base64Code 待解码的base 64 code
+     * @return 解码后的byte[]
+     * @throws Exception
+     */
+    public static byte[] base64Decode(String base64Code) throws Exception {
+        return TextUtils.isEmpty(base64Code) ? null : new BASE64Decoder().decodeBuffer(base64Code);
+    }
+
+    /**
+     * 获取byte[]的md5值
+     *
+     * @param bytes byte[]
+     * @return md5
+     * @throws Exception
+     */
+    public static byte[] md5(byte[] bytes) throws Exception {
+        MessageDigest md = MessageDigest.getInstance("MD5");
+        md.update(bytes);
+
+        return md.digest();
+    }
+
+    /**
+     * 获取字符串md5值
+     *
+     * @param msg
+     * @return md5
+     * @throws Exception
+     */
+    public static byte[] md5(String msg) throws Exception {
+        return TextUtils.isEmpty(msg) ? null : md5(msg.getBytes());
+    }
+
+    /**
+     * 结合base64实现md5加密
+     *
+     * @param msg 待加密字符串
+     * @return 获取md5后转为base64
+     * @throws Exception
+     */
+    public static String md5Encrypt(String msg) throws Exception {
+        return TextUtils.isEmpty(msg) ? null : base64Encode(md5(msg));
+    }
+
+    /**
+     * AES加密
+     *
+     * @param content    待加密的内容
+     * @param encryptKey 加密密钥
+     * @return 加密后的byte[]
+     * @throws Exception
+     */
+    public static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception {
+//        KeyGenerator kgen = KeyGenerator.getInstance("AES");
+//        kgen.init(128, new SecureRandom(encryptKey.getBytes()));
+        KeyGenerator kgen = KeyGenerator.getInstance("AES");
+        SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
+        random.setSeed(encryptKey.getBytes());
+        kgen.init(128, random);
+        Cipher cipher = Cipher.getInstance("AES");
+        cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(kgen.generateKey().getEncoded(), "AES"));
+
+        return cipher.doFinal(content.getBytes("utf-8"));
+    }
+
+    /**
+     * AES加密为base 64 code
+     *
+     * @param content    待加密的内容
+     * @param encryptKey 加密密钥
+     * @return 加密后的base 64 code
+     * @throws Exception
+     */
+    public static String aesEncrypt(String content, String encryptKey) throws Exception {
+        return base64Encode(aesEncryptToBytes(content, encryptKey));
+    }
+
+    /**
+     * AES解密
+     *
+     * @param encryptBytes 待解密的byte[]
+     * @param decryptKey   解密密钥
+     * @return 解密后的String
+     * @throws Exception
+     */
+    public static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws
+            Exception {
+//        KeyGenerator kgen = KeyGenerator.getInstance("AES");
+//        kgen.init(128, new SecureRandom(decryptKey.getBytes()));
+        KeyGenerator kgen = KeyGenerator.getInstance("AES");
+        SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
+        random.setSeed(decryptKey.getBytes());
+        kgen.init(128, random);
+        Cipher cipher = Cipher.getInstance("AES");
+        cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(kgen.generateKey().getEncoded(), "AES"));
+        byte[] decryptBytes = cipher.doFinal(encryptBytes);
+
+        return new String(decryptBytes);
+    }
+
+    /**
+     * 将base 64 code AES解密
+     *
+     * @param encryptStr 待解密的base 64 code
+     * @param decryptKey 解密密钥
+     * @return 解密后的string
+     */
+    public static String aesDecrypt(String encryptStr, String decryptKey) throws Exception {
+        return TextUtils.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr),
+                decryptKey);
+    }
+
+    private static final String IV_STRING = "1234561234567890";
+
+    /**
+     * @param content
+     * @param key
+     * @return
+     * @throws Exception
+     *
+     * 加密
+     */
+    public static String encryptAES(String content, String key)
+            throws Exception {
+        byte[] byteContent = content.getBytes("UTF-8");
+        // 注意,为了能与 iOS 统一
+        // 这里的 key 不可以使用 KeyGenerator、SecureRandom、SecretKey 生成
+        byte[] enCodeFormat = key.getBytes();
+        SecretKeySpec secretKeySpec = new SecretKeySpec(enCodeFormat, "AES");
+        byte[] initParam = IV_STRING.getBytes();
+        IvParameterSpec ivParameterSpec = new IvParameterSpec(initParam);
+        // 指定加密的算法、工作模式和填充方式
+        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+        cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
+        byte[] encryptedBytes = cipher.doFinal(byteContent);
+        // 同样对加密后数据进行 base64 编码
+        return base64Encode(encryptedBytes);
+    }
+
+    /**
+     * @param content
+     * @param key
+     * @return
+     * @throws Exception
+     *
+     * 解密
+     */
+    public static String decryptAES(String content, String key)
+            throws Exception {
+        // base64 解码
+        byte[] encryptedBytes = base64Decode(content);
+        byte[] enCodeFormat = key.getBytes();
+        // AES加密
+        @SuppressLint("GetInstance") Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding", "BC");
+        SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+        cipher.init(Cipher.ENCRYPT_MODE, keySpec);
+
+        byte[] encryptData = cipher.doFinal(encryptedBytes);
+//        SecretKeySpec secretKey = new SecretKeySpec(enCodeFormat, "AES");
+//        byte[] initParam = IV_STRING.getBytes();
+//        IvParameterSpec ivParameterSpec = new IvParameterSpec(initParam);
+//        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
+//        cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
+//        byte[] result = cipher.doFinal(encryptedBytes);
+        return new String(encryptData, "UTF-8");
+    }
+
+}

+ 169 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/BASE64Decoder.java

@@ -0,0 +1,169 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+/*
+  2    * Copyright (c) 1995, 2000, Oracle and/or its affiliates. All rights reserved.
+  3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+  4    *
+  5    * This code is free software; you can redistribute it and/or modify it
+  6    * under the terms of the GNU General Public License version 2 only, as
+  7    * published by the Free Software Foundation.  Oracle designates this
+  8    * particular file as subject to the "Classpath" exception as provided
+  9    * by Oracle in the LICENSE file that accompanied this code.
+ 10    *
+ 11    * This code is distributed in the hope that it will be useful, but WITHOUT
+ 12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ 13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ 14    * version 2 for more details (a copy is included in the LICENSE file that
+ 15    * accompanied this code).
+ 16    *
+ 17    * You should have received a copy of the GNU General Public License version
+ 18    * 2 along with this work; if not, write to the Free Software Foundation,
+ 19    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ 20    *
+ 21    * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ 22    * or visit www.oracle.com if you need additional information or have any
+ 23    * questions.
+ 24    */
+
+import java.io.OutputStream;
+import java.io.PushbackInputStream;
+import java.io.PrintStream;
+
+/**
+ * 32    * This class implements a BASE64 Character decoder as specified in RFC1521.
+ * 33    *
+ * 34    * This RFC is part of the MIME specification which is published by the
+ * 35    * Internet Engineering Task Force (IETF). Unlike some other encoding
+ * 36    * schemes there is nothing in this encoding that tells the decoder
+ * 37    * where a buffer starts or stops, so to use it you will need to isolate
+ * 38    * your encoded data into a single chunk and then feed them this decoder.
+ * 39    * The simplest way to do that is to read all of the encoded data into a
+ * 40    * string and then use:
+ * 41    * <pre>
+ * 42    *      byte    mydata[];
+ * 43    *      BASE64Decoder base64 = new BASE64Decoder();
+ * 44    *
+ * 45    *      mydata = base64.decodeBuffer(bufferString);
+ * 46    * </pre>
+ * 47    * This will decode the String in <i>bufferString</i> and give you an array
+ * 48    * of bytes in the array <i>myData</i>.
+ * 49    *
+ * 50    * On errors, this class throws a CEFormatException with the following detail
+ * 51    * strings:
+ * 52    * <pre>
+ * 53    *    "BASE64Decoder: Not enough bytes for an atom."
+ * 54    * </pre>
+ * 55    *
+ * 56    * @author      Chuck McManis
+ * 57    * @see         CharacterEncoder
+ * 58    * @see         BASE64Decoder
+ * 59
+ */
+
+public class BASE64Decoder extends CharacterDecoder {
+
+    /**
+     * This class has 4 bytes per atom
+     */
+    protected int bytesPerAtom() {
+        return (4);
+    }
+
+    /**
+     * Any multiple of 4 will do, 72 might be common
+     */
+    protected int bytesPerLine() {
+        return (72);
+    }
+
+    /**
+     * 74        * This character array provides the character to value map
+     * 75        * based on RFC1521.
+     * 76
+     */
+    private final static char pem_array[] = {
+            //       0   1   2   3   4   5   6   7
+            'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0
+            'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 1
+            'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 2
+            'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', // 3
+            'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 4
+            'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 5
+            'w', 'x', 'y', 'z', '0', '1', '2', '3', // 6
+            '4', '5', '6', '7', '8', '9', '+', '/'  // 7
+    };
+
+    private final static byte pem_convert_array[] = new byte[256];
+
+    static {
+        for (int i = 0; i < 255; i++) {
+            pem_convert_array[i] = -1;
+        }
+        for (int i = 0; i < pem_array.length; i++) {
+            pem_convert_array[pem_array[i]] = (byte) i;
+        }
+    }
+
+    byte decode_buffer[] = new byte[4];
+
+    /**
+     * 103        * Decode one BASE64 atom into 1, 2, or 3 bytes of data.
+     * 104
+     */
+    protected void decodeAtom(PushbackInputStream inStream, OutputStream outStream, int rem)
+            throws java.io.IOException {
+        int i;
+        byte a = -1, b = -1, c = -1, d = -1;
+
+        if (rem < 2) {
+            throw new CEFormatException("BASE64Decoder: Not enough bytes for an atom.");
+        }
+        do {
+            i = inStream.read();
+            if (i == -1) {
+                throw new CEStreamExhausted();
+            }
+        } while (i == '\n' || i == '\r');
+        decode_buffer[0] = (byte) i;
+
+        i = readFully(inStream, decode_buffer, 1, rem - 1);
+        if (i == -1) {
+            throw new CEStreamExhausted();
+        }
+
+        if (rem > 3 && decode_buffer[3] == '=') {
+            rem = 3;
+        }
+        if (rem > 2 && decode_buffer[2] == '=') {
+            rem = 2;
+        }
+        switch (rem) {
+            case 4:
+                d = pem_convert_array[decode_buffer[3] & 0xff];
+                // NOBREAK
+            case 3:
+                c = pem_convert_array[decode_buffer[2] & 0xff];
+                // NOBREAK
+            case 2:
+                b = pem_convert_array[decode_buffer[1] & 0xff];
+                a = pem_convert_array[decode_buffer[0] & 0xff];
+                break;
+        }
+
+        switch (rem) {
+            case 2:
+                outStream.write((byte) (((a << 2) & 0xfc) | ((b >>> 4) & 3)));
+                break;
+            case 3:
+                outStream.write((byte) (((a << 2) & 0xfc) | ((b >>> 4) & 3)));
+                outStream.write((byte) (((b << 4) & 0xf0) | ((c >>> 2) & 0xf)));
+                break;
+            case 4:
+                outStream.write((byte) (((a << 2) & 0xfc) | ((b >>> 4) & 3)));
+                outStream.write((byte) (((b << 4) & 0xf0) | ((c >>> 2) & 0xf)));
+                outStream.write((byte) (((c << 6) & 0xc0) | (d & 0x3f)));
+                break;
+        }
+        return;
+    }
+}

+ 116 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/BASE64Encoder.java

@@ -0,0 +1,116 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+/*
+   2    * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved.
+   3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+   4    *
+   5    * This code is free software; you can redistribute it and/or modify it
+   6    * under the terms of the GNU General Public License version 2 only, as
+   7    * published by the Free Software Foundation.  Oracle designates this
+   8    * particular file as subject to the "Classpath" exception as provided
+   9    * by Oracle in the LICENSE file that accompanied this code.
+  10    *
+  11    * This code is distributed in the hope that it will be useful, but WITHOUT
+  12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+  14    * version 2 for more details (a copy is included in the LICENSE file that
+  15    * accompanied this code).
+  16    *
+  17    * You should have received a copy of the GNU General Public License version
+  18    * 2 along with this work; if not, write to the Free Software Foundation,
+  19    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+  20    *
+  21    * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+  22    * or visit www.oracle.com if you need additional information or have any
+  23    * questions.
+  24    */
+
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.IOException;
+
+/**
+ * This class implements a BASE64 Character encoder as specified in RFC1521.
+ * This RFC is part of the MIME specification as published by the Internet
+ * Engineering Task Force (IETF). Unlike some other encoding schemes there is
+ * nothing in this encoding that indicates where a buffer starts or ends.
+ *
+ * This means that the encoded text will simply start with the first line of
+ * encoded text and end with the last line of encoded text.
+ *
+ * @author Chuck McManis
+ * @see CharacterEncoder
+ * @see BASE64Decoder
+ */
+public class BASE64Encoder extends CharacterEncoder
+{
+
+    /** this class encodes three bytes per atom. */
+    protected int bytesPerAtom()
+    {
+        return (3);
+    }
+
+    /**
+     * this class encodes 57 bytes per line. This results in a maximum of 57/3 *
+     * 4 or 76 characters per output line. Not counting the line termination.
+     */
+    protected int bytesPerLine()
+    {
+        return (57);
+    }
+
+    /** This array maps the characters to their 6 bit values */
+    private final static char pem_array[] =
+            {
+                    // 0 1 2 3 4 5 6 7
+                    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 0
+                    'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 1
+                    'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 2
+                    'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', // 3
+                    'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', // 4
+                    'o', 'p', 'q', 'r', 's', 't', 'u', 'v', // 5
+                    'w', 'x', 'y', 'z', '0', '1', '2', '3', // 6
+                    '4', '5', '6', '7', '8', '9', '+', '/' // 7
+            };
+
+    /**
+     * encodeAtom - Take three bytes of input and encode it as 4 printable
+     * characters. Note that if the length in len is less than three is encodes
+     * either one or two '=' signs to indicate padding characters.
+     */
+    protected void encodeAtom(OutputStream outStream, byte data[], int offset,
+                              int len) throws IOException
+    {
+        byte a, b, c;
+        if (len == 1)
+        {
+            a = data[offset];
+            b = 0;
+            c = 0;
+            outStream.write(pem_array[(a >>> 2) & 0x3F]);
+            outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+            outStream.write('=');
+            outStream.write('=');
+        } else if (len == 2)
+        {
+            a = data[offset];
+            b = data[offset + 1];
+            c = 0;
+            outStream.write(pem_array[(a >>> 2) & 0x3F]);
+            outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+            outStream.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
+            outStream.write('=');
+        } else
+        {
+            a = data[offset];
+            b = data[offset + 1];
+            c = data[offset + 2];
+            outStream.write(pem_array[(a >>> 2) & 0x3F]);
+            outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]);
+            outStream.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]);
+            outStream.write(pem_array[c & 0x3F]);
+        }
+    }
+}

+ 11 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CEFormatException.java

@@ -0,0 +1,11 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+import java.io.IOException;
+
+public class CEFormatException extends IOException
+{
+    public CEFormatException(String s)
+    {
+        super(s);
+    }
+}

+ 9 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CEStreamExhausted.java

@@ -0,0 +1,9 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+
+import java.io.IOException;
+
+public class CEStreamExhausted extends IOException
+{
+
+}

+ 245 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CharacterDecoder.java

@@ -0,0 +1,245 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+/*
+    2    * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved.
+    3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+    4    *
+    5    * This code is free software; you can redistribute it and/or modify it
+    6    * under the terms of the GNU General Public License version 2 only, as
+    7    * published by the Free Software Foundation.  Oracle designates this
+    8    * particular file as subject to the "Classpath" exception as provided
+    9    * by Oracle in the LICENSE file that accompanied this code.
+   10    *
+   11    * This code is distributed in the hope that it will be useful, but WITHOUT
+   12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   14    * version 2 for more details (a copy is included in the LICENSE file that
+   15    * accompanied this code).
+   16    *
+   17    * You should have received a copy of the GNU General Public License version
+   18    * 2 along with this work; if not, write to the Free Software Foundation,
+   19    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+   20    *
+   21    * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+   22    * or visit www.oracle.com if you need additional information or have any
+   23    * questions.
+   24    */
+
+
+import java.io.OutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.PushbackInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/**
+ * 37 * This class defines the decoding half of character encoders. 38 * A
+ * character decoder is an algorithim for transforming 8 bit 39 * binary data
+ * that has been encoded into text by a character 40 * encoder, back into
+ * original binary form. 41 * 42 * The character encoders, in general, have been
+ * structured 43 * around a central theme that binary data can be encoded into
+ * 44 * text that has the form: 45 * 46 *
+ *
+ * <pre>
+ *    47    *      [Buffer Prefix]
+ *    48    *      [Line Prefix][encoded data atoms][Line Suffix]
+ *    49    *      [Buffer Suffix]
+ *    50    *
+ * </pre>
+ *
+ * 51 * 52 * Of course in the simplest encoding schemes, the buffer has no 53 *
+ * distinct prefix of suffix, however all have some fixed relationship 54 *
+ * between the text in an 'atom' and the binary data itself. 55 * 56 * In the
+ * CharacterEncoder and CharacterDecoder classes, one complete 57 * chunk of
+ * data is referred to as a <i>buffer</i>. Encoded buffers 58 * are all text,
+ * and decoded buffers (sometimes just referred to as 59 * buffers) are binary
+ * octets. 60 * 61 * To create a custom decoder, you must, at a minimum, overide
+ * three 62 * abstract methods in this class. 63 *
+ * <DL>
+ * 64 *
+ * <DD>bytesPerAtom which tells the decoder how many bytes to 65 * expect from
+ * decodeAtom 66 *
+ * <DD>decodeAtom which decodes the bytes sent to it as text. 67 *
+ * <DD>bytesPerLine which tells the encoder the maximum number of 68 * bytes per
+ * line. 69 *
+ * </DL>
+ * 70 * 71 * In general, the character decoders return error in the form of a 72
+ * * CEFormatException. The syntax of the detail string is 73 *
+ *
+ * <pre>
+ *    74    *      DecoderClassName: Error message.
+ *    75    *
+ * </pre>
+ *
+ * 76 * 77 * Several useful decoders have already been written and are 78 *
+ * referenced in the See Also list below. 79 * 80 * @author Chuck McManis 81 * @see
+ * CEFormatException 82 * @see CharacterEncoder 83 * @see UCDecoder 84 * @see
+ * UUDecoder 85 * @see BASE64Decoder 86
+ */
+
+public abstract class CharacterDecoder
+{
+
+    /** Return the number of bytes per atom of decoding */
+    abstract protected int bytesPerAtom();
+
+    /** Return the maximum number of bytes that can be encoded per line */
+    abstract protected int bytesPerLine();
+
+    /** decode the beginning of the buffer, by default this is a NOP. */
+    protected void decodeBufferPrefix(PushbackInputStream aStream,
+                                      OutputStream bStream) throws IOException
+    {
+    }
+
+    /** decode the buffer suffix, again by default it is a NOP. */
+    protected void decodeBufferSuffix(PushbackInputStream aStream,
+                                      OutputStream bStream) throws IOException
+    {
+    }
+
+    /**
+     * 103 * This method should return, if it knows, the number of bytes 104 *
+     * that will be decoded. Many formats such as uuencoding provide 105 * this
+     * information. By default we return the maximum bytes that 106 * could have
+     * been encoded on the line. 107
+     */
+    protected int decodeLinePrefix(PushbackInputStream aStream,
+                                   OutputStream bStream) throws IOException
+    {
+        return (bytesPerLine());
+    }
+
+    /**
+     * 113 * This method post processes the line, if there are error detection
+     * 114 * or correction codes in a line, they are generally processed by 115
+     * * this method. The simplest version of this method looks for the 116 *
+     * (newline) character. 117
+     */
+    protected void decodeLineSuffix(PushbackInputStream aStream,
+                                    OutputStream bStream) throws IOException
+    {
+    }
+
+    /**
+     * 121 * This method does an actual decode. It takes the decoded bytes and
+     * 122 * writes them to the OutputStream. The integer <i>l</i> tells the 123
+     * * method how many bytes are required. This is always <= bytesPerAtom().
+     * 124
+     */
+    protected void decodeAtom(PushbackInputStream aStream,
+                              OutputStream bStream, int l) throws IOException
+    {
+        throw new CEStreamExhausted();
+    }
+
+    /**
+     * 130 * This method works around the bizarre semantics of
+     * BufferedInputStream's 131 * read method. 132
+     */
+    protected int readFully(InputStream in, byte buffer[], int offset, int len)
+            throws IOException
+    {
+        for (int i = 0; i < len; i++)
+        {
+            int q = in.read();
+            if (q == -1)
+                return ((i == 0) ? -1 : i);
+            buffer[i + offset] = (byte) q;
+        }
+        return len;
+    }
+
+    /**
+     * 145 * Decode the text from the InputStream and write the decoded 146 *
+     * octets to the OutputStream. This method runs until the stream 147 * is
+     * exhausted. 148 * @exception CEFormatException An error has occured while
+     * decoding 149 * @exception CEStreamExhausted The input stream is
+     * unexpectedly out of data 150
+     */
+    public void decodeBuffer(InputStream aStream, OutputStream bStream)
+            throws IOException
+    {
+        int i;
+        int totalBytes = 0;
+
+        PushbackInputStream ps = new PushbackInputStream(aStream);
+        decodeBufferPrefix(ps, bStream);
+        while (true)
+        {
+            int length;
+
+            try
+            {
+                length = decodeLinePrefix(ps, bStream);
+                for (i = 0; (i + bytesPerAtom()) < length; i += bytesPerAtom())
+                {
+                    decodeAtom(ps, bStream, bytesPerAtom());
+                    totalBytes += bytesPerAtom();
+                }
+                if ((i + bytesPerAtom()) == length)
+                {
+                    decodeAtom(ps, bStream, bytesPerAtom());
+                    totalBytes += bytesPerAtom();
+                } else
+                {
+                    decodeAtom(ps, bStream, length - i);
+                    totalBytes += (length - i);
+                }
+                decodeLineSuffix(ps, bStream);
+            } catch (CEStreamExhausted e)
+            {
+                break;
+            }
+        }
+        decodeBufferSuffix(ps, bStream);
+    }
+
+    /**
+     * 182 * Alternate decode interface that takes a String containing the
+     * encoded 183 * buffer and returns a byte array containing the data. 184 * @exception
+     * CEFormatException An error has occured while decoding 185
+     */
+    public byte decodeBuffer(String inputString)[] throws IOException
+    {
+        byte inputBuffer[] = new byte[inputString.length()];
+        ByteArrayInputStream inStream;
+        ByteArrayOutputStream outStream;
+
+        inputString.getBytes(0, inputString.length(), inputBuffer, 0);
+        inStream = new ByteArrayInputStream(inputBuffer);
+        outStream = new ByteArrayOutputStream();
+        decodeBuffer(inStream, outStream);
+        return (outStream.toByteArray());
+    }
+
+    /**
+     * 199 * Decode the contents of the inputstream into a buffer. 200
+     */
+    public byte decodeBuffer(InputStream in)[] throws IOException
+    {
+        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+        decodeBuffer(in, outStream);
+        return (outStream.toByteArray());
+    }
+
+    /**
+     * 208 * Decode the contents of the String into a ByteBuffer. 209
+     */
+    public ByteBuffer decodeBufferToByteBuffer(String inputString)
+            throws IOException
+    {
+        return ByteBuffer.wrap(decodeBuffer(inputString));
+    }
+
+    /**
+     * 216 * Decode the contents of the inputStream into a ByteBuffer. 217
+     */
+    public ByteBuffer decodeBufferToByteBuffer(InputStream in)
+            throws IOException
+    {
+        return ByteBuffer.wrap(decodeBuffer(in));
+    }
+}

+ 389 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/CharacterEncoder.java

@@ -0,0 +1,389 @@
+package cn.muchinfo.rma.view.autoWidget.utils;
+
+/*
+    2    * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved.
+    3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+    4    *
+    5    * This code is free software; you can redistribute it and/or modify it
+    6    * under the terms of the GNU General Public License version 2 only, as
+    7    * published by the Free Software Foundation.  Oracle designates this
+    8    * particular file as subject to the "Classpath" exception as provided
+    9    * by Oracle in the LICENSE file that accompanied this code.
+   10    *
+   11    * This code is distributed in the hope that it will be useful, but WITHOUT
+   12    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+   13    * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+   14    * version 2 for more details (a copy is included in the LICENSE file that
+   15    * accompanied this code).
+   16    *
+   17    * You should have received a copy of the GNU General Public License version
+   18    * 2 along with this work; if not, write to the Free Software Foundation,
+   19    * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+   20    *
+   21    * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+   22    * or visit www.oracle.com if you need additional information or have any
+   23    * questions.
+   24    */
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.OutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/**
+ * 38 * This class defines the encoding half of character encoders. 39 * A
+ * character encoder is an algorithim for transforming 8 bit binary 40 * data
+ * into text (generally 7 bit ASCII or 8 bit ISO-Latin-1 text) 41 * for
+ * transmition over text channels such as e-mail and network news. 42 * 43 * The
+ * character encoders have been structured around a central theme 44 * that, in
+ * general, the encoded text has the form: 45 * 46 *
+ *
+ * <pre>
+ *    47    *      [Buffer Prefix]
+ *    48    *      [Line Prefix][encoded data atoms][Line Suffix]
+ *    49    *      [Buffer Suffix]
+ *    50    *
+ * </pre>
+ *
+ * 51 * 52 * In the CharacterEncoder and CharacterDecoder classes, one complete
+ * 53 * chunk of data is referred to as a <i>buffer</i>. Encoded buffers 54 *
+ * are all text, and decoded buffers (sometimes just referred to as 55 *
+ * buffers) are binary octets. 56 * 57 * To create a custom encoder, you must,
+ * at a minimum, overide three 58 * abstract methods in this class. 59 *
+ * <DL>
+ * 60 *
+ * <DD>bytesPerAtom which tells the encoder how many bytes to 61 * send to
+ * encodeAtom 62 *
+ * <DD>encodeAtom which encodes the bytes sent to it as text. 63 *
+ * <DD>bytesPerLine which tells the encoder the maximum number of 64 * bytes per
+ * line. 65 *
+ * </DL>
+ * 66 * 67 * Several useful encoders have already been written and are 68 *
+ * referenced in the See Also list below. 69 * 70 * @author Chuck McManis 71 * @see
+ * CharacterDecoder; 72 * @see UCEncoder 73 * @see UUEncoder 74 * @see
+ * BASE64Encoder 75
+ */
+public abstract class CharacterEncoder
+{
+    /** Stream that understands "printing" */
+    protected PrintStream pStream;
+
+    /** Return the number of bytes per atom of encoding */
+    abstract protected int bytesPerAtom();
+
+    /** Return the number of bytes that can be encoded per line */
+    abstract protected int bytesPerLine();
+
+    /**
+     * 88 * Encode the prefix for the entire buffer. By default is simply 89 *
+     * opens the PrintStream for use by the other functions. 90
+     */
+    protected void encodeBufferPrefix(OutputStream aStream) throws IOException
+    {
+        pStream = new PrintStream(aStream);
+    }
+
+    /**
+     * 96 * Encode the suffix for the entire buffer. 97
+     */
+    protected void encodeBufferSuffix(OutputStream aStream) throws IOException
+    {
+    }
+
+    /**
+     * 102 * Encode the prefix that starts every output line. 103
+     */
+    protected void encodeLinePrefix(OutputStream aStream, int aLength)
+            throws IOException
+    {
+    }
+
+    /**
+     * 109 * Encode the suffix that ends every output line. By default 110 *
+     * this method just prints a <newline> into the output stream. 111
+     */
+    protected void encodeLineSuffix(OutputStream aStream) throws IOException
+    {
+        pStream.println();
+    }
+
+    /** Encode one "atom" of information into characters. */
+    abstract protected void encodeAtom(OutputStream aStream, byte someBytes[],
+                                       int anOffset, int aLength) throws IOException;
+
+    /**
+     * 121 * This method works around the bizarre semantics of
+     * BufferedInputStream's 122 * read method. 123
+     */
+    protected int readFully(InputStream in, byte buffer[])
+            throws IOException
+    {
+        for (int i = 0; i < buffer.length; i++)
+        {
+            int q = in.read();
+            if (q == -1)
+                return i;
+            buffer[i] = (byte) q;
+        }
+        return buffer.length;
+    }
+
+    /**
+     * 136 * Encode bytes from the input stream, and write them as text
+     * characters 137 * to the output stream. This method will run until it
+     * exhausts the 138 * input stream, but does not print the line suffix for a
+     * final 139 * line that is shorter than bytesPerLine(). 140
+     */
+    public void encode(InputStream inStream, OutputStream outStream)
+            throws IOException
+    {
+        int j;
+        int numBytes;
+        byte tmpbuffer[] = new byte[bytesPerLine()];
+
+        encodeBufferPrefix(outStream);
+
+        while (true)
+        {
+            numBytes = readFully(inStream, tmpbuffer);
+            if (numBytes == 0)
+            {
+                break;
+            }
+            encodeLinePrefix(outStream, numBytes);
+            for (j = 0; j < numBytes; j += bytesPerAtom())
+            {
+
+                if ((j + bytesPerAtom()) <= numBytes)
+                {
+                    encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
+                } else
+                {
+                    encodeAtom(outStream, tmpbuffer, j, (numBytes) - j);
+                }
+            }
+            if (numBytes < bytesPerLine())
+            {
+                break;
+            } else
+            {
+                encodeLineSuffix(outStream);
+            }
+        }
+        encodeBufferSuffix(outStream);
+    }
+
+    /**
+     * 173 * Encode the buffer in <i>aBuffer</i> and write the encoded 174 *
+     * result to the OutputStream <i>aStream</i>. 175
+     */
+    public void encode(byte aBuffer[], OutputStream aStream) throws IOException
+    {
+        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+        encode(inStream, aStream);
+    }
+
+    /**
+     * 183 * A 'streamless' version of encode that simply takes a buffer of 184
+     * * bytes and returns a string containing the encoded buffer. 185
+     */
+    public String encode(byte aBuffer[])
+    {
+        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+        String retVal = null;
+        try
+        {
+            encode(inStream, outStream);
+            // explicit ascii->unicode conversion
+            retVal = outStream.toString("8859_1");
+        } catch (Exception IOException)
+        {
+            // This should never happen.
+            throw new Error("CharacterEncoder.encode internal error");
+        }
+        return (retVal);
+    }
+
+    /**
+     * 202 * Return a byte array from the remaining bytes in this ByteBuffer.
+     * 203 *
+     * <P>
+     * 204 * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+     * 205 *
+     * <P>
+     * 206 * To avoid an extra copy, the implementation will attempt to return
+     * the 207 * byte array backing the ByteBuffer. If this is not possible, a
+     * 208 * new byte array will be created. 209
+     */
+    private byte[] getBytes(ByteBuffer bb)
+    {
+        /*
+         * This should never return a BufferOverflowException, as we're 213 *
+         * careful to allocate just the right amount. 214
+         */
+        byte[] buf = null;
+
+        /*
+         * 218 * If it has a usable backing byte buffer, use it. Use only 219 *
+         * if the array exactly represents the current ByteBuffer. 220
+         */
+        if (bb.hasArray())
+        {
+            byte[] tmp = bb.array();
+            if ((tmp.length == bb.capacity()) && (tmp.length == bb.remaining()))
+            {
+                buf = tmp;
+                bb.position(bb.limit());
+            }
+        }
+
+        if (buf == null)
+        {
+            /*
+             * 232 * This class doesn't have a concept of encode(buf, len, off),
+             * 233 * so if we have a partial buffer, we must reallocate 234 *
+             * space. 235
+             */
+            buf = new byte[bb.remaining()];
+
+            /*
+             * 239 * position() automatically updated 240
+             */
+            bb.get(buf);
+        }
+
+        return buf;
+    }
+
+    /**
+     * 248 * Encode the <i>aBuffer</i> ByteBuffer and write the encoded 249 *
+     * result to the OutputStream <i>aStream</i>. 250 *
+     * <P>
+     * 251 * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+     * 252
+     */
+    public void encode(ByteBuffer aBuffer, OutputStream aStream)
+            throws IOException
+    {
+        byte[] buf = getBytes(aBuffer);
+        encode(buf, aStream);
+    }
+
+    /**
+     * 260 * A 'streamless' version of encode that simply takes a ByteBuffer 261
+     * * and returns a string containing the encoded buffer. 262 *
+     * <P>
+     * 263 * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+     * 264
+     */
+    public String encode(ByteBuffer aBuffer)
+    {
+        byte[] buf = getBytes(aBuffer);
+        return encode(buf);
+    }
+
+    /**
+     * 271 * Encode bytes from the input stream, and write them as text
+     * characters 272 * to the output stream. This method will run until it
+     * exhausts the 273 * input stream. It differs from encode in that it will
+     * add the 274 * line at the end of a final line that is shorter than
+     * bytesPerLine(). 275
+     */
+    public void encodeBuffer(InputStream inStream, OutputStream outStream)
+            throws IOException
+    {
+        int j;
+        int numBytes;
+        byte tmpbuffer[] = new byte[bytesPerLine()];
+
+        encodeBufferPrefix(outStream);
+
+        while (true)
+        {
+            numBytes = readFully(inStream, tmpbuffer);
+            if (numBytes == 0)
+            {
+                break;
+            }
+            encodeLinePrefix(outStream, numBytes);
+            for (j = 0; j < numBytes; j += bytesPerAtom())
+            {
+                if ((j + bytesPerAtom()) <= numBytes)
+                {
+                    encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
+                } else
+                {
+                    encodeAtom(outStream, tmpbuffer, j, (numBytes) - j);
+                }
+            }
+            encodeLineSuffix(outStream);
+            if (numBytes < bytesPerLine())
+            {
+                break;
+            }
+        }
+        encodeBufferSuffix(outStream);
+    }
+
+    /**
+     * 306 * Encode the buffer in <i>aBuffer</i> and write the encoded 307 *
+     * result to the OutputStream <i>aStream</i>. 308
+     */
+    public void encodeBuffer(byte aBuffer[], OutputStream aStream)
+            throws IOException
+    {
+        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+        encodeBuffer(inStream, aStream);
+    }
+
+    /**
+     * 316 * A 'streamless' version of encode that simply takes a buffer of 317
+     * * bytes and returns a string containing the encoded buffer. 318
+     */
+    public String encodeBuffer(byte aBuffer[])
+    {
+        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+        ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer);
+        try
+        {
+            encodeBuffer(inStream, outStream);
+        } catch (Exception IOException)
+        {
+            // This should never happen.
+            throw new Error("CharacterEncoder.encodeBuffer internal error");
+        }
+        return (outStream.toString());
+    }
+
+    /**
+     * 332 * Encode the <i>aBuffer</i> ByteBuffer and write the encoded 333 *
+     * result to the OutputStream <i>aStream</i>. 334 *
+     * <P>
+     * 335 * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+     * 336
+     */
+    public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream)
+            throws IOException
+    {
+        byte[] buf = getBytes(aBuffer);
+        encodeBuffer(buf, aStream);
+    }
+
+    /**
+     * 344 * A 'streamless' version of encode that simply takes a ByteBuffer 345
+     * * and returns a string containing the encoded buffer. 346 *
+     * <P>
+     * 347 * The ByteBuffer's position will be advanced to ByteBuffer's limit.
+     * 348
+     */
+    public String encodeBuffer(ByteBuffer aBuffer)
+    {
+        byte[] buf = getBytes(aBuffer);
+        return encodeBuffer(buf);
+    }
+
+}

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/utils/EnUtil.java

@@ -2,15 +2,20 @@ package cn.muchinfo.rma.view.autoWidget.utils;
 
 
 
+import com.blankj.utilcode.util.LogUtils;
+
+import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 
 import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.DESKeySpec;
+import javax.crypto.spec.SecretKeySpec;
 
 
 public class EnUtil {
@@ -18,6 +23,7 @@ public class EnUtil {
 
     private final static String DES = "DES";
 
+
     /**
      * 二次加密 先sha-1加密再用MD5加密
      *

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

@@ -10,16 +10,15 @@ object Constant {
 //    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 //    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.125:8080/cfg?key=test_125"//李倩千海金 18611112222
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩千海金 18611112222
-//      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.107:8080/cfg?key=test_107"// 瑶姐 千海金 13760119855
 //    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  黄老板千海金
 //    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
 //    const val baseurl = "http://192.168.21.71:8280/cfg?key=mtp_20"
 

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

@@ -24,6 +24,7 @@ import cn.muchinfo.rma.view.base.chart.old.timeCharts.TimeChartView
 import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
 import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.SPUtils
 import org.greenrobot.eventbus.EventBus
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
@@ -71,9 +72,10 @@ class ChartActivity : BaseActivity<ChartViewModel>() , View.OnClickListener{
         progressBar = findViewById(R.id.progress_view)
 
         findViewById<RelativeLayout>(R.id.trade_rly).setOnClickListener(this)
-        if (Constant.IS_QHJ){
-            findViewById<RelativeLayout>(R.id.trade_rly).visibility = View.GONE
-        }
+
+//        if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
+//            findViewById<RelativeLayout>(R.id.trade_rly).visibility = View.GONE
+//        }
 
         viewModel.goodsInfo.observe(this, Observer {
             findViewById<TextView>(R.id.goods_name_tv).text = it?.goodsname

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/holds/HoldViewModel.kt

@@ -200,7 +200,7 @@ class HoldViewModel : BaseViewModel() {
                 itemData?.positionaverageprice.toString()//持仓均价【头寸变化更新】= 持仓成本 / 期末头寸 / 合约单位
             holder.idMargin?.text = itemData?.usedmargin.toString()//占用保证金
 
-            if (refreshByQuote) {//行情下发的推送则自己算一遍
+            if (true) {//行情下发的推送则自己算一遍
                 /**
                  * 获取基本信息(主要计算持仓浮动盈亏和平仓浮动盈亏)
                  * 盯市浮盈【实时行情更新】(MTP:浮动盈亏、持仓盈亏) 买方向 = (最新价 - 持仓均价) * 买期末头寸 * 合约单位;卖方向 = (持仓均价 - 最新价) * 卖期末头寸 * 合约单位
@@ -300,7 +300,7 @@ class HoldViewModel : BaseViewModel() {
                 val intent = Intent()
                 intent.putExtra("outGoodsCode", list?.get(position)?.outgoodscode)
                 intent.putExtra("goodsCode", list?.get(position)?.goodscode)
-                intent.putExtra("goodsId", list?.get(position)?.goodsid)
+                intent.putExtra("goodsId", list?.get(position)?.goodsid.toString())
 //                intent.putExtra("goodsGroupId", list?.get(position)?.goodsgroupid)
                 intent.putExtra("marketId", list?.get(position)?.marketid)
                 intent.setClass(context!!, ChartActivity::class.java)

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

@@ -268,7 +268,7 @@ class MarketBaseModel : BaseViewModel() {
                 val intent = Intent()
                 intent.putExtra("outGoodsCode", list?.get(position)?.outgoodscode)
                 intent.putExtra("goodsCode", list?.get(position)?.goodscode)
-                intent.putExtra("goodsId", list?.get(position)?.goodsid)
+                intent.putExtra("goodsId", list?.get(position)?.goodsid.toString())
                 intent.putExtra("goodsGroupId", list?.get(position)?.goodsgroupid)
                 intent.putExtra("marketId", list?.get(position)?.marketid)
                 intent.setClass(context!!, ChartActivity::class.java)

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

@@ -1088,7 +1088,7 @@ class NewFirstTabUI(private val baseFragment: Fragment, private val viewModel: H
                             textView {
                                 viewModel.homeMenuTabList.bindOptional(context) {
                                     if (it?.size ?: 0 > 4){
-                                        text = it?.get(0)?.title
+                                        text = it?.get(4)?.title
                                     }
                                 }
                                 textColorInt = R.color.black

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddTransactionUserActivity.kt

@@ -66,7 +66,7 @@ class AddTransactionUserActivity : BaseActivity<FutureAccountViewModel>() {
                     marginStart = autoSize(37)
                 }
                 textView {
-                    text = "用户名"
+                    text = "用户名"
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
@@ -78,7 +78,7 @@ class AddTransactionUserActivity : BaseActivity<FutureAccountViewModel>() {
                         setText(data.rolename)
                     }
                     user_name = this
-                    hint = "请输入用户名"
+                    hint = "请输入用户名"
                     background = null
                     inputType = EditorInfo.TYPE_CLASS_TEXT
 //                    setDecimalInputType()

+ 7 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt

@@ -133,10 +133,17 @@ class RoleSetViewModel : BaseViewModel(){
      * 查询账户管理角色详情(账户管理/角色设置/角色详情)
      */
     fun queryAccMgrRoleMenu(roleid : String = ""){
+        var mainRoleid = ""
+        val areaRoledids = GlobalDataCollection.instance?.loginQueryData?.areaRoles
+        areaRoledids?.forEach {
+            mainRoleid = mainRoleid + it.roletype + ","
+        }
         val params = mutableMapOf<String, String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             if (roleid.isNotEmpty()){
                 put("roleid",roleid)
+            }else{
+                put("roleid",mainRoleid)
             }
         }
         MyApplication.getInstance()?.accountManager?.queryAccMgrRoleMenu(params = params){isSuccess, respData, error ->

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

@@ -177,7 +177,7 @@ class EntrustHistoryViewHolder(
                         val intent = Intent()
 //                        intent.putExtra("outGoodsCode", data.value?.outgoodscode)
                         intent.putExtra("goodsCode", data.value?.goodscode)
-                        intent.putExtra("goodsId", data.value?.goodsid)
+                        intent.putExtra("goodsId", data.value?.goodsid.toString())
 //                intent.putExtra("goodsGroupId", list?.get(position)?.goodsgroupid)
                         intent.putExtra("marketId", data.value?.marketid)
                         intent.setClass(context!!, ChartActivity::class.java)

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

@@ -150,7 +150,7 @@ class TradingHistoryViewHolder(
                         val intent = Intent()
 //                        intent.putExtra("outGoodsCode", data.value?.outgoodscode)
                         intent.putExtra("goodsCode", data.value?.goodscode)
-                        intent.putExtra("goodsId", data.value?.goodsid)
+                        intent.putExtra("goodsId", data.value?.goodsid.toString())
 //                intent.putExtra("goodsGroupId", list?.get(position)?.goodsgroupid)
                         intent.putExtra("marketId", data.value?.marketid)
                         intent.setClass(context!!, ChartActivity::class.java)

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

@@ -76,7 +76,6 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
     }
 
     fun initData() {
-        isReadAgreement.postValue(SPUtils.getInstance().getBoolean(Constant.READ_AGREEMENT, false))
         val accountMap: Map<String, String> =
             NumberUtils.getHashMapData(Constant.MTP_LOGIN_ACCOUNT) //获取实盘账号
 
@@ -109,7 +108,7 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
     private fun buildView() {
         // 沉浸式状态栏
         QMUIStatusBarHelper.translucent(this)
-
+        isReadAgreement.postValue(true)
         dialog.bindTaskStatus(context = this, taskUiModelData = viewModel.loadingDialogStatus)
         viewModel.queryUserNodeCfgAndStatus()
         verticalLayout {
@@ -335,6 +334,7 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
 
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL
+                visibility = View.GONE
                 viewModel.userNodeCfgAndStatus.bindOptional(context){
                     if (it?.size == 0){
                         visibility = View.GONE
@@ -344,8 +344,6 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
                 }
                 onThrottleFirstClick {
                     isReadAgreement.postValue(isReadAgreement.value?.not())
-                    SPUtils.getInstance()
-                        .put(Constant.READ_AGREEMENT, isReadAgreement.value?.not() ?: false)
                 }
 
                 imageView {
@@ -458,6 +456,8 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
                         )
                     return@launch
                 }
+
+                viewModel.queryGoodsEx()
                 //请求账户基本信息
                 viewModel.loginQuery { isCompleted, err ->
                     if (!isCompleted) {
@@ -555,7 +555,7 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
 
 
     private fun goHomePage() {
-//            polPreference.setAccountAndPass(mtp_login_pass.getText().toString().trim(), DefaultPreference.MTP_LOGIN_ACCOUNT);// 保存实盘账号
+        viewModel.QHJCustomerSignStatusOperateReq(nodetype = 2,agreementids = viewModel.getAgreementIds(viewModel.userNodeCfgAndStatus.value ?: arrayListOf()))
         val accountMa: MutableMap<String, String> =
             HashMap()
         if (p_tips.isChecked()) {

+ 44 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginViewModel.kt

@@ -1,10 +1,12 @@
 package cn.muchinfo.rma.view.base.login
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.UserNodeCfgAndStatusData
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
+import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.app.Constant
 import com.blankj.utilcode.util.SPUtils
@@ -100,6 +102,48 @@ class LoginViewModel : BaseViewModel() {
         }
     }
 
+    /**
+     * 签署协议操作请求(请求发出去就好了)
+     * @param nodetype Int
+     * @param goodsid Long
+     * @param agreementids List<Long>
+     */
+    fun QHJCustomerSignStatusOperateReq(
+        nodetype : Int,
+        goodsid : Long = 0,
+        agreementids : List<Long>
+    ){
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.QHJCustomerSignStatusOperateReq(nodetype = nodetype,goodsid = goodsid,agreementids = agreementids){isCompleted, err ->
+
+            }
+        }
+    }
+
+    /**
+     * 组装签署相关协议的id列表
+     * @return List<Long>
+     */
+    fun getAgreementIds(dataList : List<UserNodeCfgAndStatusData>) : List<Long>{
+        val returnResult = arrayListOf<Long>()
+        dataList.forEach {
+            returnResult.add(it.agreementid?.toLong() ?: 0)
+        }
+        return returnResult
+    }
+
+    /**
+     * 查询请求商品扩展信息
+     */
+    fun queryGoodsEx(){
+        val params = mutableMapOf<String, String>()
+        MyApplication.getInstance()?.moneyManager?.queryGoodsEx(params){isSuccess, respData, error ->
+            if (isSuccess){
+                GlobalDataCollection.instance?.goodsExInfoDataArrayList = respData?.toArrayList()
+            }
+        }
+    }
+
     //nodetype 环节类型 - 1:注册 2:登录 3:购买 4:融资购买 5:定投 6:卖出
     fun queryUserNodeCfgAndStatus(){
         val params = mutableMapOf<String,String>().apply {

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

@@ -364,6 +364,7 @@ class EnterpriseRegisterActivity : BaseActivity<RegisterViewModel>() {
 
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL
+                visibility = View.GONE
                 viewModel.userNodeCfgAndStatus.bindOptional(context){
                     if (it?.size == 0){
                         visibility = View.GONE

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

@@ -232,6 +232,7 @@ class PersonalRegisterActivity : BaseActivity<RegisterViewModel>(){
 
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL or Gravity.CENTER_HORIZONTAL
+                visibility = View.GONE
                 viewModel.userNodeCfgAndStatus.bindOptional(context){
                     if (it?.size == 0){
                         visibility = View.GONE

+ 7 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainFragment.kt

@@ -14,6 +14,7 @@ import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.AESEncryptUtils
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 
 import cn.muchinfo.rma.view.base.BaseFragment
@@ -314,6 +315,8 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                             linearLayout {
                                 linearLayout {
                                     onThrottleFirstClick {
+//                                        LogUtils.eTag("daskhdakjhskdjhajsk",
+//                                            AESEncryptUtils.decryptAES(GlobalDataCollection.instance?.loginQueryData?.userInfo?.cardnum,"0d299ce2d4105282f7471074cb0f9f9d"))
                                         if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
                                             ToastUtils.showLong("请先添加提现账户信息")
                                             return@onThrottleFirstClick
@@ -339,10 +342,10 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
 
                                     onThrottleFirstClick {
 
-                                        if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
-                                            ToastUtils.showLong("请先添加提现账户信息")
-                                            return@onThrottleFirstClick
-                                        }
+//                                        if (GlobalDataCollection.instance?.bankAccountSignData?.accountcode.isNullOrEmpty()){
+//                                            ToastUtils.showLong("请先添加提现账户信息")
+//                                            return@onThrottleFirstClick
+//                                        }
                                         val intent = Intent()
                                         intent.putExtra("selectindex",0)
                                         intent.setClass(context, WithdrawalActivity::class.java)

+ 7 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/AddCastSurelyActivity.kt

@@ -379,8 +379,8 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                 textView {
                     selectTime.bindOptional(context){
                         text = if (it?.id == "1"){
-                            "每周一次,每周"
-                        }else {"每月一次,每月"} + it?.value + "日扣款"
+                            "每周一次,每周"+ it.value + "扣款"
+                        }else {"每月一次,每月" + it?.value + "日扣款"}
                     }
                     text = "请选择定投频率"
                     textSizeAuto = 34
@@ -416,12 +416,12 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                 imageView {
                     viewModel.isReadAgreement.bindOptional(context) {
                         imageResource = if (it == true) {
-                            R.mipmap.ic_check_select
+                            R.mipmap.qhj_trade_select
                         } else {
-                            R.mipmap.ic_check_normal
+                            R.mipmap.qhj_trade_normal
                         }
                     }
-                    imageResource = R.mipmap.ic_check_normal
+                    imageResource = R.mipmap.qhj_trade_normal
                 }.lparams(autoSize(35), autoSize(35))
 
                 textView {
@@ -499,9 +499,9 @@ class AddCastSurelyActivity : BaseActivity<MyCastSurelyViewModel>() {
                             }
                         }
 
-                        if (viewModel.isReadAgreement.value != true){
+                        if (viewModel.isReadAgreement.value != false){
                             viewModel.QHJCustomerSignStatusOperateReq(
-                                nodetype = 3,
+                                nodetype = 5,
                                 goodsid = viewModel.goodsInfoData.value?.goodsid?.toLong() ?: 0,
                                 agreementids = viewModel.getAgreementIds(
                                     viewModel.userNodeCfgAndStatus.value ?: arrayListOf()

+ 10 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewModel.kt

@@ -135,6 +135,16 @@ class MyCastSurelyViewModel : BaseViewModel(){
                 if (data.goodsid == it?.goodsid.toString()){
                     if (data.canregularlybuy == "0"){
                         selectGoodsInfoList.remove(it)
+                    }else{
+                        if (GlobalDataCollection.instance?.loginQueryData?.userInfo?.userinfotype == 1){
+                            if (data.visibilityforpersonal == "0"){
+                                selectGoodsInfoList.remove(it)
+                            }
+                        }else if (GlobalDataCollection.instance?.loginQueryData?.userInfo?.userinfotype == 2){
+                            if (data.visibilityforenterprise == "0"){
+                                selectGoodsInfoList.remove(it)
+                            }
+                        }
                     }
                 }
             }

+ 2 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/AddWithDrawActivity.kt

@@ -13,6 +13,7 @@ import cn.muchinfo.rma.global.data.BankInfoData
 import cn.muchinfo.rma.global.data.transit.SignReq
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.AESEncryptUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
@@ -294,7 +295,7 @@ class AddWithDrawActivity : BaseActivity<WithDrawManagementViewModel>(){
         req.openBankName = branch_name.text.toString()
         req.extOperatorID = TimeUtils.getNowMills()
         req.certType = GlobalDataCollection.instance?.loginQueryData?.userInfo?.cardtypeid?.toString()
-        req.certID = GlobalDataCollection.instance?.loginQueryData?.userInfo?.cardnum
+        req.certID =  GlobalDataCollection.instance?.loginQueryData?.userInfo?.cardnum
         req.cusBankID = viewModel.cusBankSignBankDataList.value?.cusbankid
         req.currency = viewModel.cusBankSignBankDataList.value?.currency
         req.tradeDate = viewModel.cusBankSignBankDataList.value?.tradedate

+ 3 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt

@@ -572,8 +572,8 @@ class MoneyInOnlineUI(private val activity: WithdrawalActivity,private val viewM
                 gravity = Gravity.CENTER_VERTICAL
 
                 onThrottleFirstClick {
-                    val selectDataList = arrayListOf(SelectData(id = "9",value = "支付宝"),
-                        SelectData(id = "10",value = "微信"))
+                    val selectDataList = arrayListOf(SelectData(id = "9",value = "支付宝")/*,
+                        SelectData(id = "10",value = "微信")*/)
 
                     activity.creatBottomSheetNoTitleDialog(selectDataList
                     ) {
@@ -938,7 +938,7 @@ class MoneyInOutlineUI(private val activity: WithdrawalActivity,private val view
                             return@onThrottleFirstClick
                         }
                         if (viewModel.userCollectConfigData.value?.accountcode.isNullOrEmpty()){
-                            ToastUtils.showLong("签约信息获取失败,请稍后再试!")
+                            ToastUtils.showLong("请先添加提现账户信息")
                             return@onThrottleFirstClick
                         }
                         val singingInfo = viewModel.userCollectConfigData.value

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

@@ -0,0 +1,287 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.ContractTradeDetailData
+import cn.muchinfo.rma.global.toPercentage
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.main.PayViewModel
+import com.blankj.utilcode.util.ToastUtils
+import org.jetbrains.anko.*
+
+/**
+ * 千海金成交单详情
+ */
+class DealDetailsActivity : BaseActivity<PayViewModel>(){
+
+    val data by lazy { intent.getParcelableExtra<ContractTradeDetailData>("data") as ContractTradeDetailData }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            topBar {
+                // 返回
+                commonLeftButton()
+                commonTitle {
+                    text = "待付详情"
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "商品名称"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = data.goodsname
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "交易类型"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    if (data.tradetype == "27"){
+                        text = "融资买入"
+                    }else {
+                        if (data.buyorsell == "0"){
+                            text = "买入"
+                        }else{
+                            text = "卖出"
+                        }
+                    }
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "成交数量"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = data.tradeqty
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "成交价格"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.tradeprice,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "成交金额"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.tradeamount,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "成交金额"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.tradeamount,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "手续费"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.charge,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "订单总额"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.totalamount,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                if (data.tradetype == "27"){
+                    visibility = View.VISIBLE
+                }else{
+                    visibility = View.GONE
+                }
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "首付比例"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = data.advanceratio?.toPercentage()
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                if (data.buyorsell == "1"){
+                    visibility = View.GONE
+                }else{
+                    visibility = View.VISIBLE
+                }
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "付款金额"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = NumberUtils.roundNum(data.payamount,2)
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    gravity = Gravity.LEFT
+                    text = "成交时间"
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(autoSize(220), wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = data.tradetime
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+            }.lparams(matchParent, autoSize(75))
+
+            itemView()
+
+        }
+    }
+
+}

+ 122 - 78
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/DealViewHolder.kt

@@ -1,7 +1,9 @@
 package cn.muchinfo.rma.view.base.platinumtreasure.trade
 
+import android.content.Intent
 import android.os.Build
 import android.view.Gravity
+import android.view.View
 import android.widget.TextView
 import androidx.annotation.RequiresApi
 import androidx.appcompat.app.AppCompatActivity
@@ -11,9 +13,15 @@ import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.global.toShowTime
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+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.PayActivity
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.TimeUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
@@ -31,102 +39,138 @@ class DealViewHolder(
 
     @RequiresApi(Build.VERSION_CODES.O)
     override fun _FrameLayout.createContentView() {
-        linearLayout {
-            verticalLayout {
-                gravity = Gravity.LEFT
-                //商品
-                textView {
-                    data.bindOptional(context) {
-                        text = it?.goodsname
+        verticalLayout {
+            onThrottleFirstClick {
+                viewModel.setOnDealItemClick(data.value?.tradeid ?: "")
+            }
+            linearLayout {
+                verticalLayout {
+                    gravity = Gravity.LEFT
+                    //商品
+                    textView {
+                        data.bindOptional(context) {
+                            text = it?.goodsname
+                        }
+                        textSizeAuto = 31
+                        setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
+                        maxLines = 2
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+                        topMargin = autoSize(25)
+                        marginStart = autoSize(35)
                     }
-                    textSizeAuto = 31
-                    setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
-                    maxLines = 2
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
-                    topMargin = autoSize(25)
-                    marginStart = autoSize(35)
-                }
 
-                //时间
-                textView {
-                    data.bindOptional(context) {
-                        text = it?.tradetime?.toShowTime()
+                    //时间
+                    textView {
+                        data.bindOptional(context) {
+                            text = it?.tradetime?.toShowTime()
+                        }
+                        textSizeAuto = 21
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(35)
                     }
-                    textSizeAuto = 21
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
-                    marginStart = autoSize(35)
-                }
-            }.lparams(0, autoSize(149), 3f)
+                }.lparams(0, autoSize(149), 3f)
 
-            verticalLayout {
-                gravity = Gravity.RIGHT
-                //价格
-                textView {
-                    data.bindOptional(context) {
-                        text = NumberUtils.roundNum(it?.tradeprice, 2)
+                verticalLayout {
+                    gravity = Gravity.RIGHT
+                    //价格
+                    textView {
+                        data.bindOptional(context) {
+                            text = NumberUtils.roundNum(it?.tradeprice, 2)
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+                        topMargin = autoSize(25)
                     }
-                    textSizeAuto = 31
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
-                    topMargin = autoSize(25)
-                }
 
-                //数量
-                textView {
-                    data.bindOptional(context) {
-                        text = NumberUtils.doubleDistortion(it?.tradeqty?.toDouble().toString()) + it?.enumdicname
+                    //数量
+                    textView {
+                        data.bindOptional(context) {
+                            text = NumberUtils.doubleDistortion(it?.tradeqty?.toDouble().toString()) + it?.enumdicname
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+
                     }
-                    textSizeAuto = 31
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
+                }.lparams(0, autoSize(149), 2f)
 
-                }
-            }.lparams(0, autoSize(149), 2f)
 
+                verticalLayout {
+                    gravity = Gravity.RIGHT
+                    //金额
+                    textView {
+                        data.bindOptional(context) {
+                            if (it?.buyorsell == "0") {
+                                textColorInt = R.color.rma_red_color
+                            } else {
+                                textColorInt = R.color.rma_green_color
+                            }
+                            text = NumberUtils.roundNum(it?.tradeamount, 2)
+                        }
+                        textSizeAuto = 31
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+                        topMargin = autoSize(50)
+                    }
+                }.lparams(0, autoSize(149), 2f)
 
-            verticalLayout {
-                gravity = Gravity.RIGHT
-                //金额
-                textView {
-                    data.bindOptional(context) {
-                        if (it?.buyorsell == "0") {
-                            textColorInt = R.color.rma_red_color
-                        } else {
-                            textColorInt = R.color.rma_green_color
+                verticalLayout {
+                    gravity = Gravity.RIGHT
+                    //类型
+                    textView {
+                        data.bindOptional(context) {
+                            if (it?.buyorsell == "0") {
+                                text =  "买入"
+                                textColorInt = R.color.rma_red_color
+                            } else {
+                                text =  "卖出"
+                                textColorInt = R.color.rma_green_color
+                            }
                         }
-                        text = NumberUtils.roundNum(it?.tradeamount, 2)
+                        textColorInt = R.color.rma_black_33
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        topMargin = autoSize(50)
+                        marginEnd = autoSize(30)
+                    }
+                }.lparams(0, autoSize(149), 2f)
+            }.lparams(matchParent, autoSize(149))
+            itemView()
+
+            // 控制区
+            linearLayout {
+                data.bindOptional(context){
+                    if (it?.isClick == 1){
+                        visibility = View.VISIBLE
+                    }else{
+                        visibility = View.GONE
                     }
-                    textSizeAuto = 31
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
-                    topMargin = autoSize(50)
                 }
-            }.lparams(0, autoSize(149), 2f)
+                gravity = Gravity.CENTER_VERTICAL
 
+                emptyView()
 
-            verticalLayout {
-                gravity = Gravity.RIGHT
-                //类型
                 textView {
-                    data.bindOptional(context) {
-                        if (it?.buyorsell == "0") {
-                            text =  "买入"
-                            textColorInt = R.color.rma_red_color
-                        } else {
-                            text =  "卖出"
-                            textColorInt = R.color.rma_green_color
-                        }
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,DealDetailsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
                     }
-                    textColorInt = R.color.rma_black_33
-                    textSizeAuto = 31
-                }.lparams(wrapContent, wrapContent) {
-                    topMargin = autoSize(50)
-                    marginEnd = autoSize(30)
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "详情"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(36)
                 }
-            }.lparams(0, autoSize(149), 2f)
-        }.lparams(matchParent, autoSize(149))
+            }.lparams(matchParent, autoSize(72))
+        }.lparams(matchParent, wrapContent)
+
     }
 
 

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/NoPayViewHolder.kt

@@ -206,7 +206,12 @@ class NoPayViewHolder(private val activity : AppCompatActivity,private val viewM
                 }
 
                 textView {
-                    visibility = View.GONE
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,NoPayDetailsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
                     text = "详情"

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

@@ -411,6 +411,26 @@ class PlatinumTradeViewModel : BaseViewModel() {
         payOrderDataList.postValue(newDataList)
     }
 
+    /**
+     * 成交单viewhodler内的item点击事件
+     * @param deliverygoodsid String
+     */
+    fun setOnDealItemClick(tradeid : String){
+        val oldList = contractTradeDetailDataList.value
+        val newDataList = arrayListOf<ContractTradeDetailData>()
+        oldList?.forEach {
+            if (tradeid == it.tradeid){
+                if (it.isClick == 0){
+                    newDataList.add(it.copy(isClick = 1))
+                }else{
+                    newDataList.add(it.copy(isClick = 0))
+                }
+            }else{
+                newDataList.add(it.copy(isClick = 0))
+            }
+        }
+        contractTradeDetailDataList.postValue(newDataList)
+    }
 
     /**
      * 待支付viewhodler内的item点击事件

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

@@ -97,7 +97,7 @@ class RecyclingFragment : BaseFragment<RecyclingViewModel>() , RecyclingAdapter.
                     verticalLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         textView {
-                            text = "铂金宝"
+                            text = "饰品回收"
                             textColorInt = R.color.white
                             textSizeAuto = 36
                         }.lparams(wrapContent, wrapContent) {

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/recycling/adapter/RecyclingAdapter.java

@@ -189,7 +189,7 @@ public class RecyclingAdapter extends RecyclerView.Adapter<RecyclingAdapter.Item
             itemViewHolder.allView.setVisibility(View.GONE);
         }
 
-        itemViewHolder.all_click_View.setOnClickListener(view -> setPosition(i));
+//        itemViewHolder.all_click_View.setOnClickListener(view -> setPosition(i));
 
 //        //买入点击
 //        itemViewHolder.platnum_buy.setOnClickListener(new View.OnClickListener() {