ソースを参照

风险管理8月13日提交代码-liu.bolan-云融大宗

Liu.bolan 4 年 前
コミット
0a3541de97
41 ファイル変更2824 行追加46 行削除
  1. 10 2
      RMA/app/build.gradle
  2. 4 0
      RMA/app/src/main/AndroidManifest.xml
  3. 28 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/contractgoods/ContractGoodsManager.kt
  4. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  5. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeDetailData.kt
  6. 6 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradeOrderDetailData.kt
  7. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ContractTradePositionData.kt
  8. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ExposureRealTimeDetailsData.kt
  9. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/HnstWrPositionData.kt
  10. 144 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrDeliveryDetailData.kt
  11. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/SplashActivity.kt
  12. 9 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  13. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposurePositionDetailsViewholder.kt
  14. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureViewModel.kt
  15. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysFragment.kt
  16. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysViewModel.kt
  17. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/dialog/HnstFloatListedDialog.kt
  18. 12 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/dialog/HnstOneListedDialog.kt
  19. 766 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersActivity.kt
  20. 289 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersViewModel.kt
  21. 202 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/DeliveryDetailsActivity.kt
  22. 195 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractDeliveryContentAdapter.java
  23. 197 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractOrderContentAdapter.java
  24. 228 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  25. 187 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractTraderContentAdapter.java
  26. 286 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferActivity.kt
  27. 16 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferViewModel.kt
  28. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinancePayalanceActivity.kt
  29. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinancePayalanceViewHolder.kt
  30. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinanceRepoActivity.kt
  31. 7 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/adapter/FinanceContractContentAdapter.java
  32. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/PickUpContentAdapter.java
  33. 6 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/SpotWarehouseContentAdapter.java
  34. 12 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt
  35. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  36. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt
  37. 12 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/OneListedDialog.kt
  38. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptViewModel.kt
  39. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/ListedData.kt
  40. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/WarehouseFloatListedDialog.kt
  41. 152 0
      RMA/app/src/main/res/layout/contract_layout_item_content.xml

+ 10 - 2
RMA/app/build.gradle

@@ -19,8 +19,8 @@ android {
         applicationId "cn.muchinfo.rma"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 50018
-        versionName "5.0.18"
+        versionCode 50019
+        versionName "5.0.19"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         //指定room.schemaLocation生成的文件路径
@@ -57,6 +57,14 @@ android {
             resValue "string","app_name","云融"
             manifestPlaceholders = [app_icon : "@mipmap/ic_launcher_yrdz"]
         }
+
+        // 天津麦顿
+        app4 {
+            // 解释同app1
+            applicationId "cn.muchinfo.tjmd"
+            resValue "string","app_name","天津麦顿"
+            manifestPlaceholders = [app_icon : "@mipmap/ic_launcher_rma"]
+        }
     }
 
     buildTypes {

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

@@ -412,6 +412,10 @@
             android:screenOrientation="portrait"
             android:windowSoftInputMode="adjustPan"/>
 
+        <activity android:name=".view.base.hnstmain.contractorders.transfer.ContractTransferActivity"
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustPan"/>
+
     </application>
 
 </manifest>

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

@@ -248,6 +248,34 @@ class ContractGoodsManager {
 
 
     /**
+     * 交收单查询(合约市场)
+     * @param params Map<String, String> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrDeliveryDetail(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<WrDeliveryDetailData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrDeliveryDetail",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<WrDeliveryDetailData>>>() {
+                override fun onResponse(response: BaseResult<List<WrDeliveryDetailData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+
+    /**
      * 委托单查询请求(合约市场)
      * @param params Map<String, String> accountID/资金账户ID startDate/ 开始时间 - 闭区间,格式:yyyy-MM-dd endDate / 结束时间 - 闭区间,格式:yyyy-MM-dd
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<FutureDetailsData>?, [@kotlin.ParameterName] Error?, Unit>

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

@@ -313,6 +313,9 @@ fun String.pickupapplystatus() : String{
     }
     var str = ""
     when {
+        this == "0" ->{
+            str = "初审通过"
+        }
         this == "1" -> {
             str = "待初审"
         }

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

@@ -113,7 +113,8 @@ data class ContractTradeDetailData(
     @SerializedName("tradetime")
     val tradetime : String? = "",//成交时间
     @SerializedName("tradetype")
-    val tradetype :String? = ""//成交类别 - 27 : 融资买入成交 28 : 提货减仓成交 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+    val tradetype :String? = "",//成交类别 - 27 : 融资买入成交 28 : 提货减仓成交 1:正常委托成交 2:定向做市成交(接单) 3:交割协议平仓成交 4:交割减仓成交 5:到期强平成交 6:风控斩仓成交 7:协议平仓(管理端)成交 8:仓单转持仓成交 9: 交割协议转让成交 10:受托竞价成交(接单) 11:协议转让成交 12:系统强行平仓 13:期权违约平仓
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -168,7 +169,8 @@ data class ContractTradeDetailData(
         parcel.readString(),
         parcel.readInt(),
         parcel.readString(),
-        parcel.readString()
+        parcel.readString(),
+        parcel.createStringArrayList()
     ) {
     }
 
@@ -226,6 +228,7 @@ data class ContractTradeDetailData(
         parcel.writeInt(isClick)
         parcel.writeString(tradetime)
         parcel.writeString(tradetype)
+        parcel.writeStringList(rightData)
     }
 
     override fun describeContents(): Int {

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

@@ -149,7 +149,8 @@ data class ContractTradeOrderDetailData(
     @SerializedName("validtype")
     val validtype : String? = "",//有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效 5指定时间有效
     @SerializedName("volumetype")
-    val volumetype : String? =""//当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量 1:最小量(暂时不支持) 2:全部量
+    val volumetype : String? ="",//当时间有效类型为 “立即执行否则取消 IOC” 时,需要此项 - 0:任意量 1:最小量(暂时不支持) 2:全部量
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -222,7 +223,8 @@ data class ContractTradeOrderDetailData(
         parcel.readString(),
         parcel.readInt(),
         parcel.readString(),
-        parcel.readString()
+        parcel.readString(),
+        parcel.createStringArrayList()
     ) {
     }
 
@@ -298,6 +300,7 @@ data class ContractTradeOrderDetailData(
         parcel.writeInt(isClick)
         parcel.writeString(validtype)
         parcel.writeString(volumetype)
+        parcel.writeStringList(rightData)
     }
 
     override fun describeContents(): Int {
@@ -314,4 +317,5 @@ data class ContractTradeOrderDetailData(
         }
     }
 
+
 }

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

@@ -65,7 +65,8 @@ data class ContractTradePositionData(
     @SerializedName("isClick")
     var isClick : Int = 0,//是否点击展开
     @SerializedName("usedmargin")
-    val usedmargin :String? = ""//占用保证金[商品币种]
+    val usedmargin :String? = "",//占用保证金[商品币种]
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -96,7 +97,8 @@ data class ContractTradePositionData(
         parcel.readString(),
         parcel.readString(),
         parcel.readInt(),
-        parcel.readString()
+        parcel.readString(),
+        parcel.createStringArrayList()
     ) {
     }
 
@@ -130,6 +132,7 @@ data class ContractTradePositionData(
         parcel.writeString(trademode)
         parcel.writeInt(isClick)
         parcel.writeString(usedmargin)
+        parcel.writeStringList(rightData)
     }
 
     override fun describeContents(): Int {

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

@@ -27,6 +27,10 @@ data class ExposureRealTimeDetailsData(
     val middlegoodsId : String? = "",//套保商品id
     @SerializedName("middlegoodscode")
     val middlegoodscode : String? = "",//套保商品代码
+    @SerializedName("mgunitid")
+    val mgunitid : String? = "",//套保品种单位id
+    @SerializedName("mgunitidname")
+    val mgunitidname : String? = "",//套保品种单位名称
     @SerializedName("middlegoodsname")
     val middlegoodsname : String? = "",//套保商品名称
     @SerializedName("qty")

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

@@ -15,7 +15,7 @@ data class HnstWrPositionData(
     @SerializedName("creditcurqty")
     val creditcurqty : String? = "",//授信当前数量(预售仓单:预售当前量)
     @SerializedName("creditenableqty")
-    val creditenableqty : String? = "",//授信可用数量(预售仓单: 可用数量)
+    val creditenableqty : String? = "0",//授信可用数量(预售仓单: 可用数量)
     @SerializedName("creditfreezeqty")
     val creditfreezeqty : String? = "",//授信冻结数量(预售仓单: 当前数量)
     @SerializedName("credittotalqty")
@@ -32,6 +32,8 @@ data class HnstWrPositionData(
     val enalbeqty : String? = "",//可用数量
     @SerializedName("enumdicname")
     val enumdicname : String? = "",//单位名称
+    @SerializedName("minivalue")
+    val minivalue : String? = "",//现货商品最小变动值
     @SerializedName("freezeqty")
     val freezeqty : String? = "",//总冻结数量
     @SerializedName("modifytime")
@@ -101,6 +103,7 @@ data class HnstWrPositionData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.createStringArrayList()
     ) {
     }
@@ -118,6 +121,7 @@ data class HnstWrPositionData(
         parcel.writeString(deliverygoodsname)
         parcel.writeString(enalbeqty)
         parcel.writeString(enumdicname)
+        parcel.writeString(minivalue)
         parcel.writeString(freezeqty)
         parcel.writeString(modifytime)
         parcel.writeString(optioncompare)
@@ -153,4 +157,5 @@ data class HnstWrPositionData(
         }
     }
 
+
 }

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

@@ -0,0 +1,144 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 合约订单 - 交收
+ */
+data class WrDeliveryDetailData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//账号ID
+    @SerializedName("buyorsell")
+    val buyorsell : String? = "",//方向 - 0:买 1:卖
+    @SerializedName("deliveryamount")
+    val deliveryamount : String? = "",//货款金额(X总货款+P总货款)
+    @SerializedName("deliveryorderid")
+    val deliveryorderid:  String? = "",//申报单号
+    @SerializedName("deliverypricemove")
+    val deliverypricemove:  String? = "",//升贴水(升贴水总额)
+    @SerializedName("deliveryqty")
+    val deliveryqty : String? = "",//交收数量(点选数量)
+    @SerializedName("deliverystatus")
+    val deliverystatus : String? = "",//状态 - 1:待成交 2:已成交 3:成交失败 4:履约完成
+    @SerializedName("deliverytime")
+    val deliverytime : String? = "",//交割时间
+    @SerializedName("deliverytotalamount")
+    val deliverytotalamount:  String? = "",//交收金额
+    @SerializedName("matchaccountid")
+    val matchaccountid:  String? = "",//对手账号ID
+    @SerializedName("matchusername")
+    val matchusername:  String? = "",//对手方名称(仓单持有人)
+    @SerializedName("p1goodsremainamount")
+    val p1goodsremainamount : String? = "",//点价货款 ps:当PPRICEMODE=2时, 界面需显示"-"
+    @SerializedName("pdeliverycloseqty")
+    val pdeliverycloseqty:  String? = "",//p合约平仓数量
+    @SerializedName("pdeliveryprice")
+    val pdeliveryprice: String? = "",//点价价格 ps:当PPRICEMODE=2时, 界面需显示"-"
+    @SerializedName("pgoodscode")
+    val pgoodscode : String? = "",//商品代码
+    @SerializedName("pgoodsid")
+    val pgoodsid : String? = "",//p点选合约id
+    @SerializedName("pgoodsname")
+    val pgoodsname : String? = "",//商品名称
+    @SerializedName("ppricemode")
+    val ppricemode : String? = "",//点价价格方式 - 1:商品价 2:固定值
+    @SerializedName("tradedate")
+    val tradedate : String? = "",//交易日(yyyymmdd)
+    @SerializedName("userid")
+    val userid:  String? = "",//用户id
+    @SerializedName("username")
+    val username : String? = "",//用户名称
+    @SerializedName("wrfactortypeid")
+    val wrfactortypeid:  String? = "",//仓单要素类型ID
+    @SerializedName("xdeliverycloseqty")
+    val xdeliverycloseqty : String? = "",//合约数量
+    @SerializedName("xgoodsamount")
+    val xgoodsamount : String? = "",//合约金额 = 货款金额(DELIVERYAMOUNT) - 点价货款(P1GOODSREMAINAMOUNT)
+    @SerializedName("xgoodscode")
+    val xgoodscode: String? = "",//商品代码
+    @SerializedName("xgoodsid")
+    val xgoodsid : String? = "",//x交易合约ID
+    @SerializedName("xgoodsname")
+    val xgoodsname : String? = "",//商品名称
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(buyorsell)
+        parcel.writeString(deliveryamount)
+        parcel.writeString(deliveryorderid)
+        parcel.writeString(deliverypricemove)
+        parcel.writeString(deliveryqty)
+        parcel.writeString(deliverystatus)
+        parcel.writeString(deliverytime)
+        parcel.writeString(deliverytotalamount)
+        parcel.writeString(matchaccountid)
+        parcel.writeString(matchusername)
+        parcel.writeString(p1goodsremainamount)
+        parcel.writeString(pdeliverycloseqty)
+        parcel.writeString(pdeliveryprice)
+        parcel.writeString(pgoodscode)
+        parcel.writeString(pgoodsid)
+        parcel.writeString(pgoodsname)
+        parcel.writeString(ppricemode)
+        parcel.writeString(tradedate)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+        parcel.writeString(wrfactortypeid)
+        parcel.writeString(xdeliverycloseqty)
+        parcel.writeString(xgoodsamount)
+        parcel.writeString(xgoodscode)
+        parcel.writeString(xgoodsid)
+        parcel.writeString(xgoodsname)
+        parcel.writeStringList(rightData)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrDeliveryDetailData> {
+        override fun createFromParcel(parcel: Parcel): WrDeliveryDetailData {
+            return WrDeliveryDetailData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrDeliveryDetailData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -40,7 +40,7 @@ class SplashActivity : AppCompatActivity() {
 
             imageView {
                 scaleType = ImageView.ScaleType.CENTER_CROP
-                if (BuildConfig.APPLICATION_ID == "cn.muchinfo.rma"){//企业风管
+                if (BuildConfig.APPLICATION_ID == "cn.muchinfo.rma" || BuildConfig.APPLICATION_ID == "cn.muchinfo.tjmd"){//企业风管
                     imageResource = R.mipmap.rma_img_start
                 }else if (BuildConfig.APPLICATION_ID == "cn.muchinfo.qhj"){//千海金
                     imageResource = R.mipmap.qhj_img_start

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

@@ -6,6 +6,7 @@ object Constant {
     /**
      * 获取基础url的接口
      */
+//    const val baseurl = "http://103.40.249.123:38280/cfg?key=mtp_20" // 天津麦顿
 //        const val baseurl = "http://103.40.249.123:28280/cfg?key=mtp_20"//云融大宗
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
 //    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
@@ -275,7 +276,14 @@ object Constant {
     const val table_mobile_yrdz_rzgl_sqd = "table_mobile_yrdz_rzgl_sqd"
     /** 云融大宗-融资管理-合同 ***/
     const val table_mobile_yrdz_rzgl_ht = "table_mobile_yrdz_rzgl_ht"
-
+    /** 云融大宗-合约订单-成交 **/
+    const val table_mobile_hnst_hydd_cj = "table_mobile_hnst_hydd_cj"
+    /** 云融大宗-合约订单-交收 **/
+    const val table_mobile_hnst_hydd_js = "table_mobile_hnst_hydd_js"
+    /** 云融大宗-合约订单-委托 **/
+    const val table_mobile_hnst_hydd_wt = "table_mobile_hnst_hydd_wt"
+    /** 云融大宗-合约订单-合约汇总 **/
+    const val table_mobile_hnst_hydd_hyhz = "table_mobile_hnst_hydd_hyhz"
 
     /** 华南顺通-预售仓单_订单汇总 */
     const val table_mobile_hnst_yscd_ddhz = "table_mobile_hnst_yscd_ddhz"

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

@@ -51,7 +51,7 @@ class ExposurePositionDetailsViewholder(
                         if (type == "1"){
                             text = it?.relatedno?.isBlankString()
                         }else{
-                            text = it?.goodsname?.isBlankString() + "手"
+                            text = it?.goodsname?.isBlankString()
                         }
                     }
                     textColorInt = R.color.rma_black_33

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

@@ -120,7 +120,7 @@ class ExposureViewModel : BaseViewModel(){
         respData.forEach {
             val newRightData = arrayListOf<String>()
             newRightData.add(it.deliverygoodsname + "\n" + NumberUtils.doubleDistortion(it.qty) + it.enumdicname)
-            newRightData.add(NumberUtils.roundNum(it.changeQty,2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(it.changeQty,2) + it.mgunitidname)
             newRightData.add(NumberUtils.roundNum(it.relateNo ?: "",2))
             newRightData.add(NumberUtils.roundNum(it.convertfactor,2) + "\n" + it.convertratio)
             val newData = it.copy(rightData = newRightData)

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

@@ -163,7 +163,7 @@ class HnstcdysFragment : BaseFragment<HnstcdysViewModel>(){
                     emptyView()
 
                     textView {
-                        text = "仓单贸易"
+                        text = "仓单预售"
                         textColorInt = R.color.white
                         textSizeAuto = 43
                     }.lparams(wrapContent, wrapContent)

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

@@ -108,7 +108,7 @@ class HnstcdysViewModel : BaseViewModel(){
                 if (it.dgfactoryitemtypeid != "1"){
                     it.itemlst?.forEach { data ->
                         if (data.isSelect == 1){
-                            returnString = returnString + "," + data.dgfactoryitemid
+                            returnString = returnString + "," + data.dgfactoryitemvalue
                         }
                     }
                 }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/dialog/HnstFloatListedDialog.kt

@@ -178,7 +178,7 @@ fun AppCompatActivity.HnstFloatListedDialog(
             }.lparams(matchParent, matchParent)
 
             segment.setupWithViewPager(viewPager)
-            segment.selectTab(selectedTabIndex)
+            segment.selectTab(1)
         }.lparams(matchParent, matchParent) {
             topMargin = autoSize(120)
         }

+ 12 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/dialog/HnstOneListedDialog.kt

@@ -317,6 +317,9 @@ class OneSellListedUI(
                         gravity = Gravity.CENTER_VERTICAL
                         numberEditText {
                             text = "1"
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                                max = it?.creditenableqty?.toDouble() ?: 1.0
+                            }
                             oneNumberInputEdittext = this
                             setOnTextChangeListener { view, value ->
                                 if (value.isNullOrEmpty().not()) {
@@ -368,7 +371,11 @@ class OneSellListedUI(
                         progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                         setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                             override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-
+                                if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty().not()){
+                                    oneNumberInputEdittext.text = NumberUtils.roundNum(
+                                        viewModel.summaryWrPositionDataByDialog.value?.creditenableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
+                                    )
+                                }
                             }
 
                             override fun onStartTrackingTouch(p0: SeekBar?) {
@@ -385,7 +392,7 @@ class OneSellListedUI(
                     }
 
                     linearLayout {
-                        visibility = View.GONE
+
                         textView {
                             text = "0"
                             textSizeAuto = 29
@@ -395,7 +402,9 @@ class OneSellListedUI(
                         emptyView()
 
                         textView {
-                            text = "80吨"
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                                text = it?.creditenableqty + it?.enumdicname
+                            }
                             textSizeAuto = 29
                             textColorInt = R.color.rma_gray_color
                         }.lparams(wrapContent, wrapContent)

+ 766 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersActivity.kt

@@ -1,13 +1,779 @@
 package cn.muchinfo.rma.view.base.hnstmain.contractorders
 
+import android.os.Build
+import android.os.Bundle
+import android.view.Gravity
+import android.view.MotionEvent
+import android.view.View
+import android.view.ViewGroup
+import androidx.annotation.RequiresApi
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager.widget.PagerAdapter
+import androidx.viewpager.widget.ViewPager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter.ContractDeliveryContentAdapter
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter.ContractOrderContentAdapter
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter.ContractPositionContentAdapter
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter.ContractTraderContentAdapter
+import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
+import com.blankj.utilcode.util.ConvertUtils
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.viewPager
 
 /**
  * 合约订单页面
  */
 class ContractOrdersActivity : BaseActivity<ContractOrdersViewModel>(){
 
+    lateinit var segment: QMUITabSegment
+    var selectedTabIndex: Int = 0
+    private lateinit var viewPager: ViewPager
 
+    //合约汇总单
+    val positionUI by lazy { PositionUI(this,viewModel) }
+
+    //委托单
+    val orderUI by lazy { OrderUI(this,viewModel) }
+
+    //成交单
+    val traderUI by lazy { TraderUI(this,viewModel) }
+
+    //交收单
+    val deliveryUI by lazy { DeliveryUI(this,viewModel) }
+
+    //viewpager的适配器
+    private var newPagerAdapter : PagerAdapter? = null
+
+    //tabSegment标题
+    private val newTabsArray : ArrayList<String> = arrayListOf()
+
+    //暂存的页面组
+    private val uiList : ArrayList<_FrameLayout> = arrayListOf()
+
+    fun initMenuData(){
+
+        newTabsArray.add("订单汇总")
+        uiList.add(positionUI.root)
+
+        newTabsArray.add("委托")
+        uiList.add(orderUI.root)
+
+        newTabsArray.add("成交")
+        uiList.add(traderUI.root)
+
+        newTabsArray.add("交收")
+        uiList.add(deliveryUI.root)
+
+        newPagerAdapter = object : PagerAdapter() {
+
+            override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
+
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                return uiList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
+                }
+            }
+
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
+            }
+
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = newTabsArray.size
+
+        }
+
+    }
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
+            initMenuData()
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "商品订单"
+                }
+            }
+
+            tabSegment {
+                segment = this
+                background = resources.getDrawable(R.color.segtabment_bg_color)
+                addOnTabSelectedListener(object :
+                    QMUITabSegment.OnTabSelectedListener {
+                    override fun onDoubleTap(index: Int) {}
+                    override fun onTabReselected(index: Int) {}
+                    override fun onTabUnselected(index: Int) {}
+                    override fun onTabSelected(index: Int) {
+                        selectedTabIndex = index
+                    }
+                })
+                mode = QMUITabSegment.MODE_FIXED
+                setIndicator(QMUITabIndicator(QMUIDisplayHelper.dp2px(context, 2), false, true))
+                setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+            }.lparams(matchParent, autoSize(100))
+
+            view {
+                background = resources.getDrawable(R.color.main_hit_bg_color)
+            }.lparams(matchParent, autoSize(1)) {
+                marginStart = autoSize(32)
+                marginEnd = autoSize(32)
+            }
+
+            viewPager {
+                background = resources.getDrawable(R.color.white)
+                viewPager = this
+                adapter = newPagerAdapter
+            }.lparams(matchParent, matchParent)
+
+            segment.setupWithViewPager(viewPager)
+            segment.selectTab(selectedTabIndex)
+        }
+    }
+
+}
+
+
+/**
+ * 合约汇总单UI
+ * @property activity AppCompatActivity
+ * @property viewModel SpotWareHouseViewModel
+ * @constructor
+ */
+class PositionUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractPositionContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contractPositionContentAdapter by lazy {
+        ContractPositionContentAdapter(
+            activity,
+            viewModel
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModel.queryContractPositionTitle(Constant.table_mobile_hnst_hydd_hyhz)
+            contractPositionContentAdapter.setOnContentScrollListener(this@PositionUI)
+//            viewModel.showCancelDialog.bindOptional(context){
+//                if (it == true){
+//                    activity.createWarningDialog {
+//                        setTitle("温馨提示")
+//                        setMessage("确定撤销此挂单吗?")
+//                        addAction("取消") { dialog, _ ->
+//                            viewModel.showCancelDialog.postValue(false)
+//                            dialog.dismiss()
+//                        }
+//                        addAction("确定") { dialog, _ ->
+//                            val data1 = viewModel.selectCancelData.value
+//                            viewModel.wRTradeFinanceBuyCancelReq(
+//                                marketid = data1?.marketid?.toInt() ?: 0,
+//                                AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+//                                FinanceApplyID = data1?.financeapplyid?.toLong() ?: 0
+//                            ){
+//                                //撤单成功后再次请求申请单
+//                                viewModel.queryWrFinanceBuyApply()
+//                            }
+//
+//                            viewModel.showCancelDialog.postValue(false)
+//                            dialog.dismiss()
+//                        }
+//                    }.show()
+//                }
+            }
+            linearLayout {
+                linearLayout {
+
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.positionTitleDataList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 29
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(250), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contractPositionContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<ContractPositionContentAdapter.ItemViewHolder> =
+                            contractPositionContentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.positionTitleDataList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+                        viewModel.queryContractTradePosition()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contractPositionContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<ContractPositionContentAdapter.ItemViewHolder> =
+                                    contractPositionContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contractPositionContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.positionDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contractPositionContentAdapter.setDatas(it)
+                }
+            }
+        }
+
+}
+
+/**
+ * 委托UI
+ * @property activity AppCompatActivity
+ * @property viewModel SpotWareHouseViewModel
+ * @constructor
+ */
+class OrderUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractOrderContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contractOrderContentAdapter by lazy {
+        ContractOrderContentAdapter(
+            activity,viewModel
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModel.queryContractOrderTitle(Constant.table_mobile_hnst_hydd_wt)
+            contractOrderContentAdapter.setOnContentScrollListener(this@OrderUI)
+//            viewModel.showCancelDialog.bindOptional(context){
+//                if (it == true){
+//                    activity.createWarningDialog {
+//                        setTitle("温馨提示")
+//                        setMessage("确定撤销此挂单吗?")
+//                        addAction("取消") { dialog, _ ->
+//                            viewModel.showCancelDialog.postValue(false)
+//                            dialog.dismiss()
+//                        }
+//                        addAction("确定") { dialog, _ ->
+//                            val data1 = viewModel.selectCancelData.value
+//                            viewModel.wRTradeFinanceBuyCancelReq(
+//                                marketid = data1?.marketid?.toInt() ?: 0,
+//                                AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+//                                FinanceApplyID = data1?.financeapplyid?.toLong() ?: 0
+//                            ){
+//                                //撤单成功后再次请求申请单
+//                                viewModel.queryWrFinanceBuyApply()
+//                            }
+//
+//                            viewModel.showCancelDialog.postValue(false)
+//                            dialog.dismiss()
+//                        }
+//                    }.show()
+//                }
+//            }
+            linearLayout {
+                linearLayout {
+
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.orderTitleDataList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 29
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(250), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contractOrderContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<ContractOrderContentAdapter.ItemViewHolder> =
+                            contractOrderContentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.orderTitleDataList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+                        viewModel.queryContractTradeOrderDetail()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contractOrderContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<ContractOrderContentAdapter.ItemViewHolder> =
+                                    contractOrderContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contractOrderContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.orderDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contractOrderContentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+}
+
+
+/**
+ * 成交单UI
+ * @property activity AppCompatActivity
+ * @property viewModel SpotWareHouseViewModel
+ * @constructor
+ */
+class TraderUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractTraderContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contractTraderContentAdapter by lazy {
+        ContractTraderContentAdapter(
+            activity, viewModel
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModel.queryContractTraderTitle(Constant.table_mobile_hnst_hydd_cj)
+            contractTraderContentAdapter.setOnContentScrollListener(this@TraderUI)
+            linearLayout {
+                linearLayout {
+
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.traderTitleDataList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 29
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(250), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contractTraderContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<ContractTraderContentAdapter.ItemViewHolder> =
+                            contractTraderContentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.traderTitleDataList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+                        viewModel.queryContractTradeDetail()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contractTraderContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<ContractTraderContentAdapter.ItemViewHolder> =
+                                    contractTraderContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contractTraderContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.traderDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contractTraderContentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+}
+
+
+/**
+ * 交收单UI
+ * @property activity AppCompatActivity
+ * @property viewModel SpotWareHouseViewModel
+ * @constructor
+ */
+class DeliveryUI(private val activity : AppCompatActivity, private val viewModel: ContractOrdersViewModel)  : ContractDeliveryContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contractDeliveryContentAdapter by lazy {
+        ContractDeliveryContentAdapter(
+            activity,viewModel
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModel.queryContractDeliveryTitle(Constant.table_mobile_hnst_hydd_js)
+            contractDeliveryContentAdapter.setOnContentScrollListener(this@DeliveryUI)
+            linearLayout {
+                linearLayout {
+
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.deliveryTitleDataList.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 29
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(250), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        contractDeliveryContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<ContractDeliveryContentAdapter.ItemViewHolder> =
+                            contractDeliveryContentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.deliveryTitleDataList.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(true)
+                    setOnRefreshListener {
+                        viewModel.queryWrDeliveryDetail()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = contractDeliveryContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<ContractDeliveryContentAdapter.ItemViewHolder> =
+                                    contractDeliveryContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contractDeliveryContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.deliveryTraderDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    contractDeliveryContentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
 
 }
 

+ 289 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersViewModel.kt

@@ -1,10 +1,299 @@
 package cn.muchinfo.rma.view.base.hnstmain.contractorders
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.toArrayList
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseViewModel
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 //合约订单viewmodel
 class ContractOrdersViewModel : BaseViewModel(){
 
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
 
+    /**
+     * 订单汇总既持仓汇总头部数据
+     */
+    val positionTitleDataList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 订单汇总既持仓单的数据列表
+     */
+    val positionDataList : MutableLiveData<List<ContractTradePositionData>> = MutableLiveData()
+
+    /**
+     * 委托单头部数据
+     */
+    val orderTitleDataList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 委托单的数据列表
+     */
+    val orderDataList : MutableLiveData<List<ContractTradeOrderDetailData>> = MutableLiveData()
+
+    /**
+     * 成交单头部数据
+     */
+    val traderTitleDataList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 成交单的数据列表
+     */
+    val traderDataList : MutableLiveData<List<ContractTradeDetailData>> = MutableLiveData()
+
+    /**
+     * 交收单头部数据
+     */
+    val deliveryTitleDataList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 交收单的数据列表
+     */
+    val deliveryTraderDataList : MutableLiveData<List<WrDeliveryDetailData>> = MutableLiveData()
+
+    //-----------------成交单------------------
+    /**
+     * 查询成交单头部数据
+     */
+    fun queryContractDeliveryTitle(tableKey: String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                deliveryTitleDataList.postValue(newlist)
+                queryWrDeliveryDetail()
+            }
+        }
+    }
+
+    /**
+     * 查询成交单
+     */
+    fun queryWrDeliveryDetail(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.contractGoodsManager?.queryWrDeliveryDetail(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                deliveryTraderDataList.postValue(getqueryWrDeliveryDetail(respData ?: arrayListOf()) )
+            }
+        }
+    }
+
+    /**
+     * 成交单组装右侧数据
+     */
+    fun getqueryWrDeliveryDetail(respData: List<WrDeliveryDetailData>) : List<WrDeliveryDetailData>{
+        val newList = arrayListOf<WrDeliveryDetailData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //类型'
+            newRightData.add(if (it.buyorsell == "0"){"买入"}else{"卖出"})
+            //合约数量
+            newRightData.add(it.xdeliverycloseqty ?: "-")
+            //合约金额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.xgoodsamount),2))
+            //点选数量
+            newRightData.add(it.deliveryqty ?: "-")
+            //点选价格
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.pdeliveryprice),2))
+            //点选货款
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.deliveryamount),2))
+            //升贴水
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.deliverypricemove),2))
+            //交收金额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.deliverytotalamount),2))
+            //交收均价
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.deliverytotalamount),2))
+            //交收申请时间
+            newRightData.add(it.deliverytime ?: "-")
+            //状态
+            when (it.deliverystatus) {
+                "1" -> {//状态 - 1:待成交 2:已成交 3:成交失败 4:履约完成
+                    newRightData.add("待成交")
+                }
+                "2" -> {
+                    newRightData.add("已成交")
+                }
+                "3" -> {
+                    newRightData.add("成交失败")
+                }
+                "4" -> {
+                    newRightData.add("履约完成")
+                }
+            }
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
+    //-----------------成交单------------------
+    /**
+     * 查询成交单头部数据
+     */
+    fun queryContractTraderTitle(tableKey: String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                traderTitleDataList.postValue(newlist)
+                queryContractTradeDetail()
+            }
+        }
+    }
+
+    /**
+     * 查询成交单
+     */
+    fun queryContractTradeDetail(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.contractGoodsManager?.queryContractTradeDetail(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                traderDataList.postValue(getqueryContractTradeDetail(respData ?: arrayListOf()) )
+            }
+        }
+    }
+
+    /**
+     * 成交单组装右侧数据
+     */
+    fun getqueryContractTradeDetail(respData: List<ContractTradeDetailData>) : List<ContractTradeDetailData>{
+        val newList = arrayListOf<ContractTradeDetailData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //类型'
+            newRightData.add(if (it.buyorsell == "0"){"买入"}else{"卖出"})
+            //成交价
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.tradeprice),2))
+            //成交数量
+            newRightData.add(it.tradeqty + it.enumdicname)
+            //成交单号
+            newRightData.add(it.tradeid ?: "-")
+            //成交时间
+            newRightData.add(it.tradetime ?: "-")
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+    //-----------------委托单------------------
+    /**
+     * 查询委托单头部数据
+     */
+    fun queryContractOrderTitle(tableKey: String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                orderTitleDataList.postValue(newlist)
+                queryContractTradeOrderDetail()
+            }
+        }
+    }
+
+    /**
+     * 查询委托单
+     */
+    fun queryContractTradeOrderDetail(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.contractGoodsManager?.queryContractTradeOrderDetail(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                orderDataList.postValue(getContractTradeOrderDetail(respData ?: arrayListOf()) )
+            }
+        }
+    }
+
+    /**
+     * 委托单组装右侧数据
+     */
+    fun getContractTradeOrderDetail(respData: List<ContractTradeOrderDetailData>) : List<ContractTradeOrderDetailData>{
+        val newList = arrayListOf<ContractTradeOrderDetailData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //类型'
+            newRightData.add(if (it.buyorsell == "0"){"买入"}else{"卖出"})
+            //委托价
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.orderprice),2))
+            //委托数量
+            newRightData.add(it.orderqty + it.enumdicname)
+            //成交数量
+            newRightData.add(it.tradeqty + it.enumdicname)
+            //委托单号
+            newRightData.add(it.orderid ?: "-")
+            //委托时间
+            newRightData.add(it.ordertime ?: "-")
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
+
+    //-----------------合约汇总------------------
+    /**
+     * 查询合约汇总头部数据
+     */
+    fun queryContractPositionTitle(tableKey: String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                positionTitleDataList.postValue(newlist)
+                queryContractTradePosition()
+            }
+        }
+    }
+
+    /**
+     * 查询合约汇总
+     */
+    fun queryContractTradePosition(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.contractGoodsManager?.queryContractTradePosition(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                positionDataList.postValue(respData)
+            }
+        }
+    }
 
 }

+ 202 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/DeliveryDetailsActivity.kt

@@ -0,0 +1,202 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders
+
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrDeliveryDetailData
+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.hnstmain.finance.contractItem
+import org.jetbrains.anko.*
+
+/**
+ * 交收明细页面
+ */
+class DeliveryDetailsActivity : BaseActivity<ContractOrdersViewModel>(){
+
+    //交收实体
+    val data by lazy { intent.getParcelableExtra<WrDeliveryDetailData>("data") as WrDeliveryDetailData }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+
+            background = resources.getDrawable(R.color.segtabment_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "交收明细"
+                }
+            }
+
+            nestedScrollView{
+                verticalLayout {
+                    linearLayout {
+                        background = resources.getDrawable(R.color.rma_item_bg)
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "交收信息"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_black_33
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(matchParent, autoSize(72))
+
+                    contractItem(itemTile = "资金账号",itemContent = data.accountid ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "商品合约",itemContent = data.xgoodscode + "/" + data.xgoodsname)
+                    itemView()
+
+                    contractItem(itemTile = "价格",itemContent = data.pdeliveryprice ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "合约数量",itemContent = data.xdeliverycloseqty ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "合约数量",itemContent = data.xdeliverycloseqty ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "点价合约",itemContent = data.pgoodscode ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "点价合约",itemContent = data.pgoodscode + "/" + data.pgoodsname)
+                    itemView()
+
+                    contractItem(itemTile = "点价价格",itemContent = data.pdeliveryprice ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "点价货款",itemContent = data.p1goodsremainamount ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "点选数量",itemContent = data.deliveryqty ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "升贴水",itemContent = data.deliverypricemove ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "交收金额",itemContent = data.deliverytotalamount ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "交收均价",itemContent = NumberUtils.roundNum(data.deliverytotalamount?.toDouble()?.div(data.deliveryqty?.toDouble() ?: 1.0) ?: 0.0,2) ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "交收单号",itemContent = data.deliveryorderid ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "类型",itemContent = if (data.buyorsell == "0"){"买入"}else{"卖出"} )
+                    itemView()
+
+                    contractItem(itemTile = "交收时间",itemContent = data.deliverytime ?: "-")
+                    itemView()
+
+                    contractItem(itemTile = "交易日",itemContent = data.tradedate ?: "-")
+                    itemView()
+
+                    linearLayout {
+                        background = resources.getDrawable(R.color.rma_item_bg)
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "仓单信息"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_black_33
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(matchParent, autoSize(72))
+
+                    verticalLayout {
+                        background = resources.getDrawable(R.color.white)
+                        linearLayout {
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                textView {
+                                    text = "持有人/商品"
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.hint_text_color
+                                }.lparams(wrapContent, wrapContent){
+                                    marginStart = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),2f)
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
+                                textView {
+                                    text = "仓库"
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.hint_text_color
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),1f)
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
+                                textView {
+                                    text = "数量"
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.hint_text_color
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),1f)
+                        }.lparams(matchParent, autoSize(82))
+
+                        itemView()
+
+                        textView {
+                            text = "南**业"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_black_33
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                            topMargin = autoSize(30)
+                        }
+
+                        linearLayout {
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                textView {
+                                    text = "铜杆-12mm-江铜"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent){
+                                    marginStart = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),2f)
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
+                                textView {
+                                    text = "仓库"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),1f)
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL or Gravity.RIGHT
+                                textView {
+                                    text = "数量"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(0, autoSize(82),1f)
+                        }.lparams(matchParent, autoSize(70))
+
+                    }.lparams(matchParent, autoSize(265))
+
+                }
+
+            }.lparams(matchParent, matchParent)
+        }
+    }
+
+}

+ 195 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractDeliveryContentAdapter.java

@@ -0,0 +1,195 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData;
+import cn.muchinfo.rma.global.data.WrDeliveryDetailData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 合约订单的交收adapter
+ */
+public class ContractDeliveryContentAdapter extends RecyclerView.Adapter<ContractDeliveryContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<WrDeliveryDetailData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    private ContractOrdersViewModel viewModel;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+    public ContractDeliveryContentAdapter(Context context, ContractOrdersViewModel viewModel) {
+        this.viewModel = viewModel;
+        this.context = context;
+    }
+
+    public void setDatas(List<WrDeliveryDetailData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.contract_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        WrDeliveryDetailData data = datas.get(i);
+        //类型 暂时只有一个状态叫融资回购
+        itemViewHolder.tvLeftTitle.setText(data.getXgoodsname());
+        itemViewHolder.tv_left_bottom_title.setText(data.getXgoodscode());
+
+
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+
+
+        itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+
+        //撤单
+        itemViewHolder.invoice_register.setOnClickListener(view -> {
+
+        });
+
+
+
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView details;//详情
+        TextView invoice_register;//撤单
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            details = itemView.findViewById(R.id.details);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 197 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractOrderContentAdapter.java

@@ -0,0 +1,197 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData;
+import cn.muchinfo.rma.global.data.ContractTradePositionData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 合约订单的委托adapter
+ */
+public class ContractOrderContentAdapter extends RecyclerView.Adapter<ContractOrderContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<ContractTradeOrderDetailData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    private ContractOrdersViewModel viewModel;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+    public ContractOrderContentAdapter(Context context, ContractOrdersViewModel viewModel) {
+        this.viewModel = viewModel;
+        this.context = context;
+    }
+
+    public void setDatas(List<ContractTradeOrderDetailData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.contract_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        ContractTradeOrderDetailData data = datas.get(i);
+        //类型 暂时只有一个状态叫融资回购
+        itemViewHolder.tvLeftTitle.setText(data.getGoodsname());
+        itemViewHolder.tv_left_bottom_title.setText(data.getGoodscode());
+
+
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+
+
+        itemViewHolder.spot_details.setVisibility(View.VISIBLE);
+
+        //撤单
+        itemViewHolder.spot_details.setOnClickListener(view -> {
+
+        });
+
+
+
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView spot_details;//明细
+        TextView details;//详情
+        TextView invoice_register;//撤单
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            spot_details = itemView.findViewById(R.id.spot_details);
+            details = itemView.findViewById(R.id.details);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 228 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java

@@ -0,0 +1,228 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.blankj.utilcode.util.ActivityUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.ContractTradePositionData;
+import cn.muchinfo.rma.global.data.WrFinanceBuyApplyData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.transfer.ContractTransferActivity;
+import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementDetailsActivity;
+import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 合约订单的订单汇总adapter
+ */
+public class ContractPositionContentAdapter extends RecyclerView.Adapter<ContractPositionContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<ContractTradePositionData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    private ContractOrdersViewModel viewModel;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+    public ContractPositionContentAdapter(Context context, ContractOrdersViewModel viewModel) {
+        this.viewModel = viewModel;
+        this.context = context;
+    }
+
+    public void setDatas(List<ContractTradePositionData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.contract_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        ContractTradePositionData data = datas.get(i);
+        //类型 暂时只有一个状态叫融资回购
+        itemViewHolder.tvLeftTitle.setText(data.getGoodsname());
+        itemViewHolder.tv_left_bottom_title.setText(data.getGoodscode());
+
+
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+
+
+
+        List<String> rightData = new ArrayList<>();
+        //持有数量
+        rightData.add(data.getClosetotalqty());
+        //可用数量
+        rightData.add(data.getEnableqty());
+        //冻结数量
+        rightData.add(data.getFrozenqty());
+        //持仓均价
+        rightData.add(data.getAverageprice());
+        //现价
+        rightData.add(data.getAverageprice());
+        //持仓金额
+        rightData.add(data.getAverageprice());
+        //浮动盈亏
+        rightData.add(data.getAverageprice());
+
+        rightScrollAdapter.setDatas(rightData);
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+
+        itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
+        itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+        //转让
+        itemViewHolder.warehouse_register.setOnClickListener(view -> {
+
+        });
+
+        //交收
+        itemViewHolder.fanacel_register.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data",data);
+            intent.setClass(context, ContractTransferActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView details;//详情
+        TextView warehouse_register;//转让
+        TextView fanacel_register;//交收
+        TextView invoice_register;//撤单
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            fanacel_register = itemView.findViewById(R.id.fanacel_register);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            details = itemView.findViewById(R.id.details);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 187 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractTraderContentAdapter.java

@@ -0,0 +1,187 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.ContractTradeDetailData;
+import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 合约订单的成交adapter
+ */
+public class ContractTraderContentAdapter extends RecyclerView.Adapter<ContractTraderContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<ContractTradeDetailData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    private ContractOrdersViewModel viewModel;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+    public ContractTraderContentAdapter(Context context, ContractOrdersViewModel viewModel) {
+        this.viewModel = viewModel;
+        this.context = context;
+    }
+
+    public void setDatas(List<ContractTradeDetailData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.contract_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        ContractTradeDetailData data = datas.get(i);
+        //类型 暂时只有一个状态叫融资回购
+        itemViewHolder.tvLeftTitle.setText(data.getGoodsname());
+        itemViewHolder.tv_left_bottom_title.setText(data.getGoodscode());
+
+
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+        //成交单无展开
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+//                setPosition(i);
+            }
+        });
+
+
+
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView details;//详情
+        TextView invoice_register;//撤单
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            details = itemView.findViewById(R.id.details);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 286 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferActivity.kt

@@ -0,0 +1,286 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.transfer
+
+import android.annotation.SuppressLint
+import android.os.Build
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.widget.SeekBar
+import android.widget.TextView
+import androidx.annotation.RequiresApi
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.ContractTradePositionData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
+import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
+import org.jetbrains.anko.*
+
+/**
+ * 转让页面
+ * @property data ContractTradePositionData
+ * @property onePriceInputEdittext MangeNumberEditText2
+ * @property oneNumberInputEdittext MangeNumberEditText2
+ * @property one_delisting_amount TextView
+ */
+class ContractTransferActivity : BaseActivity<ContractTransferViewModel>(){
+
+    val data by lazy { intent.getParcelableExtra<ContractTradePositionData>("data") as ContractTradePositionData }
+
+    //挂牌价格输入
+    lateinit var onePriceInputEdittext: MangeNumberEditText2
+
+    //挂牌数量
+    lateinit var oneNumberInputEdittext: MangeNumberEditText2
+
+    //挂牌金额
+    lateinit var one_delisting_amount: TextView
+
+    @RequiresApi(Build.VERSION_CODES.O)
+    @SuppressLint("SetTextI18n")
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "转让"
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    textView {
+                        text = "合        约"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), wrapContent)
+
+                textView {
+                    text = data.goodscode + data.goodsname
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(36), autoSize(36))
+
+            }.lparams(matchParent, autoSize(143))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    textView {
+                        text = "挂牌价格"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(autoSize(250), wrapContent)
+
+                numberEditText {
+                    text = "0"
+                    onePriceInputEdittext = this
+                    setOnTextChangeListener { view, value ->
+                        if (value.isNullOrEmpty().not()) {
+                            if (oneNumberInputEdittext.text.toString().isNullOrEmpty().not()) {
+                                var marginamount = value.toString().toDouble()
+                                    .times(oneNumberInputEdittext.text.toString().toDouble())
+                                    one_delisting_amount.text = NumberUtils.roundNum(
+                                    marginamount.toString(),
+                                    2
+                                )
+                            }
+                        }
+                    }
+
+                }.lparams(0, autoSize(72), 1f) {
+                    marginEnd = autoSize(110)
+                }
+            }.lparams(matchParent, autoSize(143))
+
+            itemView()
+
+            linearLayout {
+                verticalLayout {
+                    textView {
+                        text = "挂牌数量"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                        topMargin = autoSize(36)
+                    }
+
+                }.lparams(autoSize(250), autoSize(290))
+
+                verticalLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        numberEditText {
+                            max = data.enableqty?.toDouble() ?: 1.0
+                            text = "1"
+                            oneNumberInputEdittext = this
+                            setOnTextChangeListener { view, value ->
+                                if (value.isNullOrEmpty().not()) {
+                                    if (onePriceInputEdittext.text.toString().isNullOrEmpty()
+                                            .not()
+                                    ) {
+                                        var marginamount = value.toString().toDouble()
+                                            .times(
+                                                oneNumberInputEdittext.text.toString().toDouble()
+                                            )
+                                        one_delisting_amount.text = NumberUtils.roundNum(
+                                            marginamount.toString(),
+                                            2
+                                        )
+                                    }
+                                }
+                            }
+
+                        }.lparams(0, autoSize(72), 1f) {
+                            marginEnd = autoSize(36)
+                        }
+
+                        //单位
+                        textView {
+                            visibility = View.GONE
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent) {
+                            marginEnd = autoSize(36)
+                        }
+                    }.lparams(matchParent, autoSize(143))
+
+                    inflateLayout<SeekBar>(R.layout.main_seekbar) {
+                        min = 10
+                        max = 100
+                        isIndeterminate = false
+                        splitTrack = false
+                        setPadding(0, 0, 0, 0)
+                        thumb = resources.getDrawable(R.mipmap.hnst_seekbar)
+
+                        progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
+                        setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
+                            override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
+                                oneNumberInputEdittext.text = NumberUtils.roundNum(
+                                    data.enableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
+                                )
+                            }
+
+                            override fun onStartTrackingTouch(p0: SeekBar?) {
+
+                            }
+
+                            override fun onStopTrackingTouch(p0: SeekBar?) {
+
+                            }
+                        })
+                    }.lparams(matchParent, wrapContent) {
+                        marginEnd = autoSize(110)
+                        topMargin = autoSize(20)
+                    }
+
+                    linearLayout {
+                        textView {
+                            text = "0"
+                            textSizeAuto = 29
+                            textColorInt = R.color.rma_gray_color
+                        }.lparams(wrapContent, wrapContent)
+
+                        emptyView()
+
+                        textView {
+                            text = data.enableqty
+                            textSizeAuto = 29
+                            textColorInt = R.color.rma_gray_color
+                        }.lparams(wrapContent, wrapContent)
+                    }.lparams(matchParent, wrapContent) {
+                        marginEnd = autoSize(110)
+                        topMargin = autoSize(10)
+                    }
+
+                }.lparams(matchParent, autoSize(290))
+            }.lparams(matchParent, autoSize(290))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "挂牌金额"
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(autoSize(214), wrapContent) {
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    text = "--"
+                    one_delisting_amount = this
+                    textSizeAuto = 29
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+            }.lparams(matchParent, autoSize(143))
+
+            verticalEmptyView()
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    onThrottleFirstClick {
+                        if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
+                            ToastUtils.showLong("请输入挂牌价格")
+                            return@onThrottleFirstClick
+                        }
+                        if (onePriceInputEdittext.text.toString().toDouble() == 0.0) {
+                            ToastUtils.showLong("挂牌价格不能为零")
+                            return@onThrottleFirstClick
+                        }
+
+                        if (oneNumberInputEdittext.text.toString().isNullOrEmpty()) {
+                            ToastUtils.showLong("请输入挂牌数量")
+                            return@onThrottleFirstClick
+                        }
+                        if (oneNumberInputEdittext.text.toString().toDouble() == 0.0) {
+                            ToastUtils.showLong("挂牌数量不能为零")
+                            return@onThrottleFirstClick
+                        }
+
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "挂牌"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(matchParent, autoSize(119)) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(144)) {
+                gravity = Gravity.BOTTOM
+            }
+
+        }
+    }
+
+}

+ 16 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/transfer/ContractTransferViewModel.kt

@@ -0,0 +1,16 @@
+package cn.muchinfo.rma.view.base.hnstmain.contractorders.transfer
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.view.base.BaseViewModel
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+
+//合约交收页面viewmodel
+class ContractTransferViewModel : BaseViewModel(){
+
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+
+}

+ 5 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinancePayalanceActivity.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.view.Gravity
 import android.view.View
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.WrBuybackDetailData
 import cn.muchinfo.rma.global.data.WrScfContractData
 import cn.muchinfo.rma.global.data.WrScfContractInterestData
@@ -13,6 +14,8 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 
@@ -32,12 +35,13 @@ class FinancePayalanceActivity : BaseActivity<FinanceManagementViewModel>(){
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context!!, viewModel.loadingDialogStatus)
             viewModel.queryWrScfContractInterest(data.scfcontractid ?: "")
             background = resources.getDrawable(R.color.segtabment_bg_color)
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    text = "回购仓单"
+                    text = "支付欠款"
                 }
             }
 

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinancePayalanceViewHolder.kt

@@ -19,15 +19,15 @@ class FinancePayalanceViewHolder(private val activity : AppCompatActivity,privat
     override fun _FrameLayout.createContentView() {
         verticalLayout {
             linearLayout {
-                background = resources.getDrawable(R.color.qhj_rule_bg_color)
+                background = resources.getDrawable(R.color.white)
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
                         data.bindOptional(context){
-                            text = it?.closetime
+                            text = it?.updatetime
                         }
                         textSizeAuto = 29
-                        textColorInt = R.color.rma_blue_color
+                        textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(0, autoSize(110),1.5f)
 
@@ -42,7 +42,7 @@ class FinancePayalanceViewHolder(private val activity : AppCompatActivity,privat
                             text = it?.interestamount
                         }
                         textSizeAuto = 29
-                        textColorInt = R.color.rma_blue_color
+                        textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(0, autoSize(110),1f)
 
@@ -57,7 +57,7 @@ class FinancePayalanceViewHolder(private val activity : AppCompatActivity,privat
                             text = it?.closeinterest?.isBlankString()
                         }
                         textSizeAuto = 29
-                        textColorInt = R.color.rma_blue_color
+                        textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(0, autoSize(110),1f)
 
@@ -76,7 +76,7 @@ class FinancePayalanceViewHolder(private val activity : AppCompatActivity,privat
                             }
                         }
                         textSizeAuto = 29
-                        textColorInt = R.color.rma_blue_color
+                        textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(0, autoSize(110),1f)
             }.lparams(matchParent, autoSize(110))

+ 4 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/FinanceRepoActivity.kt

@@ -7,6 +7,7 @@ import android.view.inputmethod.EditorInfo
 import android.widget.EditText
 import android.widget.TextView
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.WrBuybackDetailData
 import cn.muchinfo.rma.global.data.WrFactorTypeInfoExData
 import cn.muchinfo.rma.global.data.WrScfContractData
@@ -17,6 +18,8 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.sdk25.coroutines.textChangedListener
 
@@ -40,6 +43,7 @@ class FinanceRepoActivity : BaseActivity<FinanceManagementViewModel>() {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context!!, viewModel.loadingDialogStatus)
             viewModel.queryWrBuybackDetail(data.scfcontractid ?: "")
             background = resources.getDrawable(R.color.segtabment_bg_color)
             topBar {

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/finance/adapter/FinanceContractContentAdapter.java

@@ -119,8 +119,14 @@ public class FinanceContractContentAdapter extends RecyclerView.Adapter<FinanceC
             }
         });
 
+        if (Double.parseDouble(data.getInterestdebt()) != 0){
+            itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.fanacel_register.setVisibility(View.GONE);
+        }
+
         itemViewHolder.details.setVisibility(View.VISIBLE);
-        itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
+
         itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
 
         //回购仓单

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/PickUpContentAdapter.java

@@ -113,12 +113,12 @@ public class PickUpContentAdapter extends RecyclerView.Adapter<PickUpContentAdap
             itemViewHolder.allView.setVisibility(View.GONE);
         }
 
-        if (data.getApplystatus().equals("4") && data.getApplytype().equals("0")){
+        if (data.getApplystatus().equals("0") && data.getApplytype().equals("4")){
             itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
         }else {
             itemViewHolder.settlement_of_registration.setVisibility(View.GONE);
         }
-        if (data.getApplystatus().equals("2") && data.getApplytype().equals("1")){
+        if (data.getApplystatus().equals("1") && data.getApplytype().equals("2")){
             itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
         }else {
             itemViewHolder.midpoints_registration.setVisibility(View.GONE);

+ 6 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/SpotWarehouseContentAdapter.java

@@ -122,16 +122,18 @@ public class SpotWarehouseContentAdapter extends RecyclerView.Adapter<SpotWareho
         itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                if (type.equals("3")){//仓库汇总和订单汇总可以点击展开
+                if (type.equals("3") && (Double.valueOf(data.getEnalbeqty()) > 0)){//仓库汇总和订单汇总可以点击展开
                     setPosition(i);
                 }
             }
         });
+
+
         itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
 
-        if (type.equals("2")){//仓库汇总可以提货
-            itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
-        }
+//        if (type.equals("2")){//仓库汇总可以提货
+//            itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
+//        }
 
         //挂牌
         itemViewHolder.warehouse_register.setOnClickListener(view -> {

+ 12 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt

@@ -623,7 +623,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                         if (type == "1") {
                                             text = data.enableqty + data.enumdicname
                                         } else {
-                                            text = data1.enalbeqty + data.enumdicname
+                                            text = data1.creditenableqty + data1.enumdicname
                                         }
                                         textSizeAuto = 29
                                         textColorInt = R.color.rma_gray_color
@@ -673,7 +673,12 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 }.lparams(matchParent, autoSize(100))
 
                                 textView {
-                                    text = "最小单位" + data.minivalue + data.enumdicname
+                                    if (type == "1") {
+                                        text = "最小单位" + data.minivalue + data.enumdicname
+                                    } else {
+                                        text = "最小单位" + data1.minivalue + data1.enumdicname
+                                    }
+
                                     textSizeAuto = 29
                                     textColorInt = R.color.rma_hint_text_color_ccc
                                 }.lparams(wrapContent, wrapContent) {
@@ -786,9 +791,11 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             }.lparams(autoSize(38), autoSize(38)) {
                                 marginEnd = autoSize(36)
                             }
-                        }.lparams(matchParent, autoSize(143)) {
-                            bottomMargin = autoSize(200)
-                        }
+                        }.lparams(matchParent, autoSize(143))
+
+                        view {
+
+                        }.lparams(matchParent, autoSize(200))
                     }
                 }
 

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

@@ -119,7 +119,7 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
             }.lparams(matchParent, autoSize(507))
 
             imageView {
-                if (BuildConfig.APPLICATION_ID == "cn.muchinfo.rma"){//企业风管
+                if (BuildConfig.APPLICATION_ID == "cn.muchinfo.rma" || BuildConfig.APPLICATION_ID == "cn.muchinfo.tjmd"){//企业风管
                     imageResource = R.mipmap.rma_login_logo
                 }else if (BuildConfig.APPLICATION_ID == "cn.muchinfo.qhj"){//千海金
                     imageResource = R.mipmap.qhj_login_logo

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt

@@ -921,6 +921,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
                             numberEditText {
+                                text = "1"
                                 max = buySelldata.orderqty?.toDouble() ?: 1.0
                                 onePriceInputNumberEdittext = this
                                 setOnTextChangeListener { view, value ->
@@ -940,7 +941,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                             .toInt()
                                     }
                                 }
-                                text = "1"
+
                             }.lparams(0, autoSize(72), 1f) {
                                 marginEnd = autoSize(36)
                             }
@@ -1023,6 +1024,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
 
                     textView {
                         one_delisting_amount = this
+                        text = buySelldata.fixedprice
                         textSizeAuto = 29
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
@@ -1920,6 +1922,9 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                             gravity = Gravity.CENTER_VERTICAL
                             numberEditText {
                                 text = "1"
+                                maxpickNumber.bindOptional(context){
+                                    max = it ?: 1.0
+                                }
                                 onePriceInputNumberEdittext = this
                                 setOnTextChangeListener { view, value ->
                                     if (value.isNullOrEmpty().not()) {

+ 12 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/OneListedDialog.kt

@@ -364,6 +364,9 @@ class OneSellListedUI(
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         numberEditText {
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                                max = it?.enalbeqty?.toDouble() ?: 1.0
+                            }
                             text = "1"
                             oneNumberInputEdittext = this
                             setOnTextChangeListener { view, value ->
@@ -418,7 +421,11 @@ class OneSellListedUI(
                         progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                         setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
                             override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
-
+                                if (viewModel.summaryWrPositionDataByDialog.value?.accountid.isNullOrEmpty().not()){
+                                    oneNumberInputEdittext.text = NumberUtils.roundNum(
+                                        viewModel.summaryWrPositionDataByDialog.value?.creditenableqty?.toDouble()?.times(p1.div(100.0)).toString(), 0
+                                    )
+                                }
                             }
 
                             override fun onStartTrackingTouch(p0: SeekBar?) {
@@ -444,7 +451,9 @@ class OneSellListedUI(
                         emptyView()
 
                         textView {
-                            text = "80吨"
+                            viewModel.summaryWrPositionDataByDialog.bindOptional(context){
+                                text = it?.enalbeqty + it?.enumdicname
+                            }
                             textSizeAuto = 29
                             textColorInt = R.color.rma_gray_color
                         }.lparams(wrapContent, wrapContent)
@@ -963,7 +972,7 @@ class OneBuyListedUI(
                         textView {
                             text = "吨"
                             textSizeAuto = 31
-                            textColorInt = R.color.rma_black_33
+                            textColorInt = R.color.rma_gray_color
                         }.lparams(wrapContent, wrapContent) {
                             marginEnd = autoSize(36)
                         }

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

@@ -242,7 +242,7 @@ class WarehouseReceiptViewModel : BaseViewModel(){
                 if (it.dgfactoryitemtypeid != "1"){
                     it.itemlst?.forEach { data ->
                         if (data.isSelect == 1){
-                            returnString = returnString + "," + data.dgfactoryitemid
+                            returnString = returnString + "," + data.dgfactoryitemvalue
                         }
                     }
                 }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/ListedData.kt

@@ -36,7 +36,7 @@ data class ListedData(
             if (it.dgfactoryitemtypeid != "1"){//1专指仓库
                 it.itemlst?.forEach { data ->
                     if (data.isSelect == 1){
-                        returnString = returnString + "," + data.dgfactoryitemid
+                        returnString = returnString + "," + data.dgfactoryitemvalue
                     }
                 }
             }

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/dialog/WarehouseFloatListedDialog.kt

@@ -168,7 +168,7 @@ fun AppCompatActivity.WarehouseFloatListedDialog(
             }.lparams(matchParent, matchParent)
 
             segment.setupWithViewPager(viewPager)
-            segment.selectTab(selectedTabIndex)
+            segment.selectTab(1)
         }.lparams(matchParent, matchParent){
             topMargin = autoSize(120)
         }

+ 152 - 0
RMA/app/src/main/res/layout/contract_layout_item_content.xml

@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:id="@+id/roots_view"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:id="@+id/all_click_View"
+        android:layout_width="match_parent"
+        android:orientation="horizontal"
+        android:layout_height="55dp">
+
+        <LinearLayout
+            android:layout_width="110dp"
+            android:orientation="horizontal"
+            android:layout_height="match_parent">
+            <LinearLayout
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:layout_width="95dp"
+                android:layout_height="match_parent">
+
+                <TextView
+                    android:layout_marginStart="7dp"
+                    android:id="@+id/tv_left_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="13sp"
+                    android:textColor="#333333" />
+                <TextView
+                    android:layout_marginStart="7dp"
+                    android:id="@+id/tv_left_bottom_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="10sp"
+                    android:textColor="#333333" />
+            </LinearLayout>
+            <ImageView
+                android:id="@+id/click_icon"
+                android:layout_gravity="center_vertical"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:src="@mipmap/rma_down"/>
+
+        </LinearLayout>
+
+        <cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView
+            android:id="@+id/hor_item_scrollview"
+            android:overScrollMode="never"
+            android:scrollbars="none"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_item_right"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"
+                    android:scrollbars="none">
+
+                </androidx.recyclerview.widget.RecyclerView>
+            </RelativeLayout>
+        </cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView>
+    </LinearLayout>
+
+    <LinearLayout
+        android:visibility="gone"
+        android:id="@+id/all_view"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:gravity="end|center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/invoice_register"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="90dp"
+            android:layout_height="25dp"
+            android:text="撤单"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+<!--        挂牌-->
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/warehouse_register"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="转让"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <!--       提货-->
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/fanacel_register"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="交收"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/spot_details"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="明细"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/details"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="40dp"
+            android:layout_height="25dp"
+            android:text="详情"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <ImageView
+            android:visibility="gone"
+            android:id="@+id/load_more"
+            android:layout_marginEnd="10dp"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
+            android:src="@mipmap/rma_more_one"/>
+
+    </LinearLayout>
+
+</LinearLayout>