Forráskód Böngészése

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

Liu.bolan 4 éve
szülő
commit
0ec6cde7f1
25 módosított fájl, 1948 hozzáadás és 527 törlés
  1. 4 0
      RMA/app/src/main/AndroidManifest.xml
  2. 4 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/delivery/DeliveryAdapter.kt
  3. 38 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/delivery/DeliveryManager.kt
  4. 8 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryRelationData.kt
  5. 1 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/PerformancePlanData.kt
  6. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/QuoteDayData.kt
  7. 141 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrDeliveryAvalidHoldLBData.kt
  8. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  9. 116 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/HnstMainFragment.kt
  10. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/ContractOrdersViewModel.kt
  11. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractOrderContentAdapter.java
  12. 26 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractPositionContentAdapter.java
  13. 214 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryActivity.kt
  14. 53 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewHolder.kt
  15. 228 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewModel.kt
  16. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendActivity.kt
  17. 12 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendViewModel.kt
  18. 16 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/AreCancelContentAdapter.java
  19. 359 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledActivity.kt
  20. 32 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledViewModel.kt
  21. 634 472
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt
  22. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/PurchaseOrderViewModel.kt
  23. 7 0
      RMA/app/src/main/res/drawable/qhj_main_withdraw_blue_bg.xml
  24. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_friend_icon.png
  25. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_performance_icon.png

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

@@ -431,6 +431,10 @@
         <activity android:name=".view.base.yrdzpurchase.delisting.PurchaseDelistingActivity"/>
 
         <activity android:name=".view.base.yrdzpurchase.dealdetails.YrdzDealDetailsActivity"/>
+
+        <activity android:name=".view.base.hnstmain.spotwarehouse.arecancelled.AreCancelledActivity"/>
+
+        <activity android:name=".view.base.hnstmain.friend.MainFriendActivity"/>
     </application>
 
 </manifest>

+ 4 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/delivery/DeliveryAdapter.kt

@@ -21,6 +21,7 @@ object DeliveryAdapter {
      * 交割申报请求报文装箱
      */
     fun getDeliveryOrderReqInfo(
+        goodsID : Int = 0,
         marketid : Int = 0,//市场
         AccountID : Long = 0,//交易账号
         XGoodsID : Int = 0,//主商品ID(交割合约)
@@ -44,10 +45,11 @@ object DeliveryAdapter {
                 FunCode.DeliveryOrderReq,
                 loginInfo.userID,
                 AccountID,
-                0,
+                goodsID,
                 marketid
             )
         )
+        builder.accountID = AccountID
         builder.clientSerialNo = UUID.randomUUID().toString().replace("-", "")
         builder.clientOrderTime = TimeUtils.getNowString()
         builder.clientType = 3
@@ -76,7 +78,7 @@ object DeliveryAdapter {
         if (DeliveryQty != 0L){
             builder.deliveryQty = DeliveryQty
         }
-        builder.operateType = OperateType
+//        builder.operateType = OperateType
         builder.orderSrc = OrderSrc
         if (TakeMode != 0){
             builder.takeMode = TakeMode

+ 38 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/delivery/DeliveryManager.kt

@@ -1,22 +1,59 @@
 package cn.muchinfo.rma.business.delivery
 
 import cn.muchinfo.rma.business.contract.adapter.ContractAdapter
+import cn.muchinfo.rma.global.data.ContractData
+import cn.muchinfo.rma.global.data.WrDeliveryAvalidHoldLBData
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.netcore.socket.Callback
 import cn.muchinfo.rma.protobuf.funcode.FunCode
 import cn.muchinfo.rma.protobuf.protoclasses.DeliveryMI1
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.SPUtils
+import okhttp3.Call
+import java.lang.Exception
 
 /**
  * 交割相关manager
  */
 class DeliveryManager {
 
+
+    /**
+     * 查询合约交收可点选仓单
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrDeliveryAvalidHoldLB(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<WrDeliveryAvalidHoldLBData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrDeliveryAvalidHoldLB",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<WrDeliveryAvalidHoldLBData>>>() {
+                override fun onResponse(response: BaseResult<List<WrDeliveryAvalidHoldLBData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
     /**
      * 交割申报请求
      */
     fun deliveryOrderReq(
+        goodsID : Int = 0,
         marketid : Int = 0,//市场
         AccountID : Long = 0,//交易账号
         XGoodsID : Int = 0,//主商品ID(交割合约)
@@ -39,7 +76,7 @@ class DeliveryManager {
             return
         }
         val reqPacket = DeliveryAdapter.getDeliveryOrderReqInfo(
-            marketid, AccountID, XGoodsID, PGoodsID, P2GoodsID, DeliveryGoodsID, XQty, PQty, P2Qty, DeliveryQty, OperateType, OrderSrc, TakeMode, DeliveryOrderDetail, ReceiverAddress
+            goodsID,marketid, AccountID, XGoodsID, PGoodsID, P2GoodsID, DeliveryGoodsID, XQty, PQty, P2Qty, DeliveryQty, OperateType, OrderSrc, TakeMode, DeliveryOrderDetail, ReceiverAddress
         )
         tradeSocketManager.send(
             reqPacket,

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

@@ -34,6 +34,10 @@ data class DeliveryRelationData(
     val goodsname:  String? = "",//商品名称
     @SerializedName("marketid")
     val marketid : String? = "",//市场ID
+    @SerializedName("pgoodscode")
+    val pgoodscode : String? = "",//p合约代码
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//品类单位名称
     @SerializedName("mindeliveryqty")
     val mindeliveryqty : String? = "",//最小交割系数(K)
     @SerializedName("p2deliveryprice")
@@ -93,6 +97,8 @@ data class DeliveryRelationData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -111,6 +117,8 @@ data class DeliveryRelationData(
         parcel.writeString(goodsid)
         parcel.writeString(goodsname)
         parcel.writeString(marketid)
+        parcel.writeString(pgoodscode)
+        parcel.writeString(enumdicname)
         parcel.writeString(mindeliveryqty)
         parcel.writeString(p2deliveryprice)
         parcel.writeString(p2deliveryratio)

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

@@ -168,8 +168,7 @@ data class PerformancePlanData(
         parcel.readString(),
         parcel.readString(),
         parcel.createStringArrayList()
-    ) {
-    }
+    )
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(amount)

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

@@ -147,6 +147,27 @@ data class QuoteDayData(
     }
 
     /**
+     * 获取相关商品的交割价
+     */
+    fun getDeliveryPrice() : Double{
+        var deliveryPrice = 0.0
+        deliveryPrice = if (last != 0.0){
+            last
+        }else{
+            if (ask != 0.0){
+                ask
+            }else{
+                if (bid != 0.0){
+                    bid
+                }else{
+                    presettle
+                }
+            }
+        }
+        return deliveryPrice
+    }
+
+    /**
      * 现价与上一口价的差额 大于0则是涨,小于0是跌
      * @return Double
      */

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

@@ -0,0 +1,141 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 合约交收可点选仓单
+ */
+data class WrDeliveryAvalidHoldLBData(
+    @SerializedName("accountid")
+    val accountid : String? = "",//资金账号
+    @SerializedName("avalidqty")
+    val avalidqty : String? = "",//数量(可点选数量)
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid:  String? = "",//品种id
+    @SerializedName("goodsid")
+    val goodsid : String? = "",//x合约商品id
+    @SerializedName("ladingbillid")
+    val ladingbillid : String? = "",//提单id
+    @SerializedName("pgoodscode")
+    val pgoodscode: String? = "",//p商品代码(点价合约)
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//单位名称
+    @SerializedName("pgoodsid")
+    val pgoodsid: String? = "",//p商品id(点价合约)
+    @SerializedName("pgoodsname")
+    val pgoodsname : String? = "",//p商品名称(点价合约)
+    @SerializedName("pricemove")
+    val pricemove: String? = "",//升贴水
+    @SerializedName("qty")
+    val qty : String? = "",//用户仓单数量
+    @SerializedName("subnum")
+    val subnum: String? = "",//提单子id
+    @SerializedName("uqty")
+    val uqty: String? = "",//用户持有数量
+    @SerializedName("userid")
+    val userid: String? = "",//用户id
+    @SerializedName("username")
+    val username : String? = "",//仓单持有人
+    @SerializedName("warehousecode")
+    val warehousecode: String? = "",//仓库代码
+    @SerializedName("warehouseid")
+    val warehouseid: String? = "",//仓库id
+    @SerializedName("warehousename")
+    val warehousename: String? = "",//仓库名称
+    @SerializedName("wrfactortypeid")
+    val wrfactortypeid : String? = "",//仓单要素id
+    @SerializedName("wrfactortypename2")
+    val wrfactortypename2: String? = "",//仓单要素名称(不含仓库)
+    @SerializedName("wrstandardcode")
+    val wrstandardcode: String? = "",//品代码
+    @SerializedName("wrstandardid")
+    val wrstandardid :String? = "",//品类d
+    @SerializedName("wrstandardname")
+    val wrstandardname: String? = "",//品类名称
+    @SerializedName("xgoodscode")
+    val xgoodscode :String? = "",//x合约代码
+    @SerializedName("wrtypename")
+    val wrtypename : String? = "",
+    @SerializedName("xgoodsname")
+    val xgoodsname :String? ="",//x合约名称
+    val isClick : Int = 0//是否点击 1是点击状态
+) : 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.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(avalidqty)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(goodsid)
+        parcel.writeString(ladingbillid)
+        parcel.writeString(pgoodscode)
+        parcel.writeString(enumdicname)
+        parcel.writeString(pgoodsid)
+        parcel.writeString(pgoodsname)
+        parcel.writeString(pricemove)
+        parcel.writeString(qty)
+        parcel.writeString(subnum)
+        parcel.writeString(uqty)
+        parcel.writeString(userid)
+        parcel.writeString(username)
+        parcel.writeString(warehousecode)
+        parcel.writeString(warehouseid)
+        parcel.writeString(warehousename)
+        parcel.writeString(wrfactortypeid)
+        parcel.writeString(wrfactortypename2)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+        parcel.writeString(xgoodscode)
+        parcel.writeString(wrtypename)
+        parcel.writeString(xgoodsname)
+        parcel.writeInt(isClick)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrDeliveryAvalidHoldLBData> {
+        override fun createFromParcel(parcel: Parcel): WrDeliveryAvalidHoldLBData {
+            return WrDeliveryAvalidHoldLBData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrDeliveryAvalidHoldLBData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

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

@@ -13,7 +13,7 @@ object Constant {
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // 企业风管 123123
 //        const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"//李倩千海金 18611112222
-//    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩千海金 18611112222
+    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩千海金 18611112222
 //     const val baseurl = "http://192.168.31.101:8080/cfg?key=test_101"//李倩千海金 18611112222
 
 //     const val baseurl = "http://192.168.31.107:8080/cfg?key=test_107"//李倩千海金 18611112222
@@ -22,14 +22,14 @@ object Constant {
 
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
-    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
+//    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 
 //     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
 //    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
 //    const val baseurl = "http://192.168.21.71:8280/cfg?key=mtp_20"
 
 //    const val baseurl = "http://192.168.31.118:8080/cfg?key=test_118"//黄老板 华南顺通 调试
-//        const val baseurl = "http://192.168.31.136:8080/cfg?key=test_136"//黄老板 华南顺通
+//        const val baseurl = "http://192.168.31.136:8080/cfg?key=test_136"//黄老板 华南顺通   
 
 
     /**

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

@@ -1,4 +1,3 @@
-
 package cn.muchinfo.rma.view.base.hnstmain
 
 import android.Manifest
@@ -29,6 +28,7 @@ import cn.muchinfo.rma.view.base.hnstmain.bookingwarehouse.BookingWarehouseActiv
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersActivity
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.delivery.DeliveryActivity
 import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementActivity
+import cn.muchinfo.rma.view.base.hnstmain.friend.MainFriendActivity
 import cn.muchinfo.rma.view.base.hnstmain.performance.PerformanceInformationActivity
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.SpotWareHouseActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
@@ -133,7 +133,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
 
                             view {
 
-                            }.lparams(org.jetbrains.anko.matchParent, 0, 1f)
+                            }.lparams(matchParent, 0, 1f)
 
                             linearLayout {
                                 backgroundResource = R.drawable.qhj_main_top_white_bg
@@ -162,17 +162,20 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                             marginStart = autoSize(32)
                                         }
                                         textView {
-                                            visibility = View.GONE
                                             text =
-                                                GlobalDataCollection.instance?.loginRsp?.loginCode
+                                                GlobalDataCollection.instance?.loginRsp?.userID?.toString()
                                             textSizeAuto = 31
                                             textColorInt = R.color.rma_hint_text_color_ccc
                                         }.lparams(wrapContent, wrapContent) {
-                                            topMargin = autoSize(5)
                                             marginStart = autoSize(32)
                                         }
                                     }.lparams(0, autoSize(100), 1f)
 
+
+
+
+
+
                                 }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(100))
                             }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(213)) {
                                 marginStart = autoSize(36)
@@ -185,7 +188,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                             verticalLayout {
                                 onThrottleFirstClick {
                                     val intent = Intent()
-                                    intent.setClass(context,RydzAccountActivity::class.java)
+                                    intent.setClass(context, RydzAccountActivity::class.java)
                                     ActivityUtils.startActivity(intent)
                                 }
                                 gravity = Gravity.LEFT
@@ -259,7 +262,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                     /**
                                      * 合约市值
                                      */
-                                    text = "--"
+                                    text = "0"
                                     textSizeAuto = 34
                                     textColorStr = "#FF1414"
                                 }.lparams(wrapContent, wrapContent) {
@@ -300,7 +303,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                     intent.setClass(context, WithdrawalActivity::class.java)
                                     ActivityUtils.startActivity(intent)
                                 }
-                                backgroundResource = R.drawable.qhj_main_blue_bg
+                                backgroundResource = R.drawable.qhj_main_withdraw_blue_bg
                                 gravity = Gravity.CENTER
                                 textView {
                                     gravity = Gravity.CENTER_HORIZONTAL
@@ -385,7 +388,7 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                 }
 
                                 textView {
-                                    text = "合约订单"
+                                    text = "商品订单"
                                     textSizeAuto = 31
                                     textColorInt = R.color.rma_black_33
                                 }.lparams(wrapContent, wrapContent) {
@@ -471,8 +474,10 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                 marginEnd = autoSize(49)
                             }
                         }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(140))
+
                         itemView()
-                         linearLayout {
+
+                        linearLayout {
                             onThrottleFirstClick {
                                 val intent = Intent()
                                 intent.setClass(context, FinanceManagementActivity::class.java)
@@ -518,6 +523,54 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                 marginEnd = autoSize(49)
                             }
                         }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(140))
+
+                        itemView()
+
+                        linearLayout {
+                            onThrottleFirstClick {
+
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            imageView {
+                                imageResource = R.mipmap.yrdz_performance_icon
+                            }.lparams(autoSize(50), autoSize(50)) {
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                text = "履约模版管理"
+                                textSizeAuto = 36
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(29)
+                            }
+
+                            emptyView()
+
+                            textView {
+                                visibility = View.GONE
+                                text = "99"
+                                textColorInt = R.color.p_global_write_color
+                                textSizeAuto = 15
+                                setPadding(
+                                    autoSize(10),
+                                    autoSize(6),
+                                    autoSize(10),
+                                    autoSize(6)
+                                )
+                                backgroundDrawable =
+                                    createRoundRectDrawable("#FFA127", 45)
+                            }.lparams(wrapContent, wrapContent) {
+                                marginEnd = autoSize(20)
+                            }
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(40), autoSize(40)) {
+                                marginEnd = autoSize(49)
+                            }
+                        }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(140))
+
                         itemView()
                         linearLayout {
                             onThrottleFirstClick {
@@ -525,7 +578,10 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                                 if (GlobalDataCollection.instance?.bankAccountSignData?.bankid.isNullOrEmpty()) {
                                     intent.putExtra("data", BankAccountSignData())
                                 } else {
-                                    intent.putExtra("data", GlobalDataCollection.instance?.bankAccountSignData)
+                                    intent.putExtra(
+                                        "data",
+                                        GlobalDataCollection.instance?.bankAccountSignData
+                                    )
                                 }
                                 intent.setClass(context, WithDrawManagementActivity::class.java)
                                 ActivityUtils.startActivity(intent)
@@ -574,6 +630,55 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
                         itemView()
 
                         linearLayout {
+                            onThrottleFirstClick {
+                                val intent = Intent()
+                                intent.setClass(context,MainFriendActivity::class.java)
+                                ActivityUtils.startActivity(intent)
+                            }
+                            gravity = Gravity.CENTER_VERTICAL
+                            imageView {
+                                imageResource = R.mipmap.yrdz_performance_icon
+                            }.lparams(autoSize(50), autoSize(50)) {
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                text = "我的朋友"
+                                textSizeAuto = 36
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(29)
+                            }
+
+                            emptyView()
+
+                            textView {
+                                visibility = View.GONE
+                                text = "99"
+                                textColorInt = R.color.p_global_write_color
+                                textSizeAuto = 15
+                                setPadding(
+                                    autoSize(10),
+                                    autoSize(6),
+                                    autoSize(10),
+                                    autoSize(6)
+                                )
+                                backgroundDrawable =
+                                    createRoundRectDrawable("#FFA127", 45)
+                            }.lparams(wrapContent, wrapContent) {
+                                marginEnd = autoSize(20)
+                            }
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(40), autoSize(40)) {
+                                marginEnd = autoSize(49)
+                            }
+                        }.lparams(com.qmuiteam.qmui.kotlin.matchParent, autoSize(140))
+
+                        itemView()
+
+                        linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
                                 val intent = Intent()

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

@@ -3,6 +3,7 @@ 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.global.toShowTime
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
@@ -252,7 +253,7 @@ class ContractOrdersViewModel : BaseViewModel(){
             //委托单号
             newRightData.add(it.orderid ?: "-")
             //委托时间
-            newRightData.add(it.ordertime ?: "-")
+            newRightData.add(it.ordertime?.toShowTime() ?: "-")
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }

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

@@ -115,7 +115,7 @@ public class ContractOrderContentAdapter extends RecyclerView.Adapter<ContractOr
         });
 
 
-        itemViewHolder.spot_details.setVisibility(View.VISIBLE);
+        itemViewHolder.spot_details.setVisibility(View.GONE);
 
         //撤单
         itemViewHolder.spot_details.setOnClickListener(view -> {

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

@@ -22,7 +22,9 @@ import java.util.ArrayList;
 import java.util.List;
 
 import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.GlobalDataCollection;
 import cn.muchinfo.rma.global.data.ContractTradePositionData;
+import cn.muchinfo.rma.global.data.DeliveryRelationData;
 import cn.muchinfo.rma.global.data.WrFinanceBuyApplyData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
@@ -43,6 +45,7 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
     private int position = -1;
     private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
     public int offestX = 0;
+    private String type = "";
     private OnContentScrollListener onContentScrollListener;
     private ContractOrdersViewModel viewModel;
 
@@ -99,10 +102,9 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
         RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
 
 
-
         List<String> rightData = new ArrayList<>();
         //持有数量
-        rightData.add(data.getClosetotalqty());
+        rightData.add(data.getCurpositionqty());
         //可用数量
         rightData.add(data.getEnableqty());
         //冻结数量
@@ -139,25 +141,42 @@ public class ContractPositionContentAdapter extends RecyclerView.Adapter<Contrac
             }
         });
 
-        itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
 
-        if (Double.parseDouble(data.getEnableqty()) > 0){
+
+        if (Double.parseDouble(data.getEnableqty()) > 0) {
+            itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
             itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
-        }else {
+        } else {
+            itemViewHolder.fanacel_register.setVisibility(View.GONE);
             itemViewHolder.warehouse_register.setVisibility(View.GONE);
         }
         //转让
         itemViewHolder.warehouse_register.setOnClickListener(view -> {
             Intent intent = new Intent();
-            intent.putExtra("data",data);
+            intent.putExtra("data", data);
             intent.setClass(context, ContractTransferActivity.class);
             ActivityUtils.startActivity(intent);
         });
 
+        List<DeliveryRelationData> dataList = GlobalDataCollection.Companion.getInstance().getDeliveryRelationDataArrayList();
+
+        for (int j = 0; j < dataList.size(); j++) {
+            if (data.getGoodsid().equals(dataList.get(j).getGoodsid())){
+                if (dataList.get(j).getDeliverytype().equals("1") || dataList.get(j).getDeliverytype().equals("3")){//云融大宗的挂牌转让
+                    type = "1";
+                    itemViewHolder.fanacel_register.setVisibility(View.GONE);
+                }else {//云融大宗的基差点价
+                    itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
+                    type = "2";
+                }
+            }
+        }
+
         //交收
         itemViewHolder.fanacel_register.setOnClickListener(view -> {
             Intent intent = new Intent();
-            intent.putExtra("data",data);
+            intent.putExtra("type",type);
+            intent.putExtra("data", data);
             intent.setClass(context, DeliveryActivity.class);
             ActivityUtils.startActivity(intent);
         });

+ 214 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryActivity.kt

@@ -5,13 +5,25 @@ 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.ContractTradePositionData
+import cn.muchinfo.rma.global.data.WrDeliveryAvalidHoldLBData
+import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.protobuf.protoclasses.DeliveryMI1
 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.home.contract.emptyView
+import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
+import com.blankj.utilcode.util.LogUtils
+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.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
 import org.jetbrains.anko.*
 
 class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
@@ -23,7 +35,15 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
     //合约汇总实体
     val data by lazy { intent.getParcelableExtra<ContractTradePositionData>("data") as ContractTradePositionData }
 
-    private val deliveryAdapter: BaseAdapter<String, DeliveryViewHolder> =
+    // 1 云融大宗的挂牌转让  2 云融大宗的基差点价
+    val type by lazy { intent.getStringExtra("type") }
+
+    /** 用于订阅行情的唯一标识 */
+    val thisTag by lazy {
+        "DeliveryActivity"
+    }
+
+    private val deliveryAdapter: BaseAdapter<WrDeliveryAvalidHoldLBData, DeliveryViewHolder> =
         BaseAdapter { _, _ ->
             DeliveryViewHolder(
                 this,
@@ -31,13 +51,51 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
             )
         }
 
+    /**
+     * 对页面相关数据进行初始化
+     */
+    fun initializeData(){
+        viewModel.getDeliveryList(goodsid = data.goodsid ?: "")
+        viewModel.setDeliveryRelationData(goodsid = data.goodsid ?: "")
+        viewModel.setGoodsInfo(goodsid = data.goodsid ?: "0")
+
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        if (type == "2"){
+            viewModel.removeSubscriptQuote(thisTag)
+        }
+    }
+
+    //行情推送通知
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onQuoteMessageEvent(quoteMessageEvent: QuoteMessageEvent) {
+        val goodsids = quoteMessageEvent.goodsid
+        //如果推送的goodsid包含当前页面的goodsid,则进行页面刷新
+        if (goodsids.contains(data.goodsid?.toInt())) {
+            LogUtils.eTag("BusinessHallActivity", "行情推送" + data.goodsid)
+            val quote =
+                GlobalDataCollection.instance?.goodsInfoAndQuotesList?.find { viewModel.deliveryRelationLiveData.value?.pgoodscode == it.outgoodscode }?.quoteDayData
+            if (quote != null) {
+                //赋值盘面信息
+                viewModel.quoteDayData.postValue(quote)
+            }
+        }
+    }
 
     @SuppressLint("SetTextI18n")
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.segtabment_bg_color)
-            viewModel.getDeliveryList()
+            initializeData()
+            viewModel.deliveryRelationLiveData.bindOptional(context){
+                if (type == "2"){
+                    viewModel.queryQuoteDay(tag = thisTag,goodsCodes = it?.pgoodscode ?: "",isShowLoading = false)
+                }
+            }
             topBar {
                 commonLeftButton()
                 commonTitle {
@@ -81,7 +139,20 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                         emptyView()
 
                         textView {
-                            text = "可交收数量" + data.enableqty + data.agreeunit
+                            /**
+                             * 仓单数量 = 合约手数*u*k*(r2/r1) u=合约单位 k=最小交割系数 r2=兑换系数(仓单标准)(R2) r1=兑换系数(交易合约)(R1)
+                             */
+                            viewModel.deliveryRelationLiveData.bindOptional(context){
+                                text = "可交收数量" + data.enableqty?.toDouble()?.times(viewModel.goodsInfo.value?.agreeunit ?: 1)?.times(it?.mindeliveryqty?.toDouble() ?: 1.0)?.times(it?.rratio2?.toDouble() ?: 1.0)?.div(it?.rratio1?.toDouble() ?: 1.0)?.toInt()
+                            }
+                            textSizeAuto = 32
+                            textColorInt = R.color.buy_hall_color
+                        }.lparams(wrapContent, wrapContent)
+
+                        textView {
+                            viewModel.deliveryRelationLiveData.bindOptional(context){
+                                text = it?.enumdicname
+                            }
                             textSizeAuto = 32
                             textColorInt = R.color.buy_hall_color
                         }.lparams(wrapContent, wrapContent){
@@ -177,7 +248,14 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                             marginStart = autoSize(36)
                         }
                         textView {
-                            text = "40吨"
+                            viewModel.deliveryQty.bindOptional(context){
+                                if (it == 0.0){
+                                    text = "--" + viewModel.deliveryRelationLiveData.value?.enumdicname
+                                }else{
+                                    text = it?.toString() + viewModel.deliveryRelationLiveData.value?.enumdicname
+                                }
+                            }
+                            text = "--"
                             textSizeAuto = 29
                             textColorInt = R.color.rma_black_33
                         }.lparams(wrapContent, wrapContent)
@@ -189,7 +267,18 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                         }
 
                         textView {
-                            text = "8"
+                            /**
+                             * 合约数量 = 点选数量/u/k/r2*r1  u=合约单位 k=最小交割系数 r2=兑换系数(仓单标准)(R2) r1=兑换系数(交易合约)(R1)
+                             */
+                            viewModel.deliveryQty.bindOptional(context){
+                                if (it == 0.0){
+                                    text = "--"
+                                }else{
+                                    val deliveryRelationData = viewModel.deliveryRelationLiveData.value
+                                    text = it?.div(viewModel.goodsInfo.value?.agreeunit?.toDouble() ?: 1.0)?.div(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0)?.div(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)?.times(deliveryRelationData?.rratio1?.toDouble() ?: 1.0)?.toInt()?.toString()
+                                }
+                            }
+                            text = "--"
                             textSizeAuto = 29
                             textColorInt = R.color.rma_black_33
                         }.lparams(wrapContent, wrapContent)
@@ -203,7 +292,14 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                         }.lparams(wrapContent, wrapContent)
 
                         textView {
-                            text = "1100"
+                            viewModel.deliveryQty.bindOptional(context){
+                                if (it == 0.0) {
+                                    text = "--"
+                                }else{
+                                    text = NumberUtils.roundNum(it?.times(viewModel.deliveryData.value?.pricemove?.toDouble() ?: 1.0)?.toString(),2)
+                                }
+                            }
+                            text = "--"
                             textSizeAuto = 29
                             textColorInt = R.color.yrdz_red_color
                         }.lparams(wrapContent, wrapContent){
@@ -214,11 +310,37 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                     itemView()
 
                     linearLayout {
-                        visibility = View.GONE
+                        if (type == "1"){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
                         gravity = Gravity.CENTER_VERTICAL
                         textView {
                             onThrottleFirstClick {
-
+                                if (check().not()){
+                                    return@onThrottleFirstClick
+                                }
+                                val deliveryRelationData = viewModel.deliveryRelationLiveData.value
+                                //x合约手数
+                                val xNumberBand =  viewModel.deliveryQty.value?.div(viewModel.goodsInfo.value?.agreeunit?.toDouble() ?: 1.0)?.div(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0)?.div(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)?.times(deliveryRelationData?.rratio1?.toDouble() ?: 1.0)
+                                //p合约手数 = x合约手数*p合约系数/x合约系数
+                                val pNumberBand = xNumberBand?.times(deliveryRelationData?.pdeliveryratio?.toDouble() ?: 1.0)?.div(deliveryRelationData?.xdeliveryratio?.toDouble() ?: 1.0)
+
+                                viewModel.deliveryOrderReq(
+                                    goodsID = data.goodsid?.toInt() ?: 0,
+                                    marketid = data.marketid?.toInt() ?: 0,
+                                    AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+                                    XGoodsID = data.goodsid?.toInt() ?: 0,
+                                    DeliveryGoodsID = viewModel.deliveryData.value?.deliverygoodsid?.toInt() ?: 0,
+                                    XQty = xNumberBand?.toLong() ?: 0,
+                                    OperateType = 0,
+                                    DeliveryQty = viewModel.deliveryQty.value?.toLong() ?: 0,
+                                    DeliveryOrderDetail = getDeliveryOrderDetail()
+                                ){
+                                    finish()
+                                    ToastUtils.showLong("请求成功")
+                                }
                             }
                             text = "交收"
                             gravity = Gravity.CENTER
@@ -232,6 +354,11 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                     }.lparams(matchParent, autoSize(144))
 
                     linearLayout {
+                        if (type == "2"){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
                         gravity = Gravity.CENTER_VERTICAL
                         verticalLayout {
                             linearLayout {
@@ -252,7 +379,9 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                             }
 
                             textView {
-                                text = "1312.00"
+                                viewModel.quoteDayData.bindOptional(context){
+                                    text = NumberUtils.roundNum(it?.getDeliveryPrice()?.toString(),2)
+                                }
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_red_color
                             }.lparams(wrapContent, wrapContent){
@@ -274,7 +403,21 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                             }
 
                             textView {
-                                text = "71000"
+                                viewModel.deliveryQty.bindOptional(context){
+                                    if (it == 0.0){
+                                        text = "--"
+                                    }else{
+                                        val deliveryRelationData = viewModel.deliveryRelationLiveData.value
+                                        //x合约手数
+                                        val xNumberBand =  it?.div(viewModel.goodsInfo.value?.agreeunit?.toDouble() ?: 1.0)?.div(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0)?.div(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)?.times(deliveryRelationData?.rratio1?.toDouble() ?: 1.0)
+                                        //p合约手数 = x合约手数*p合约系数/x合约系数
+                                        val pNumberBand = xNumberBand?.times(deliveryRelationData?.pdeliveryratio?.toDouble() ?: 1.0)?.div(deliveryRelationData?.xdeliveryratio?.toDouble() ?: 1.0)
+                                        //总升贴水
+                                        val allPricemove = it?.times(viewModel.deliveryData.value?.pricemove?.toDouble() ?: 1.0)
+                                        //预估货款 = p合约手数*p交割价 + 总升贴水
+                                        text = NumberUtils.roundNum((pNumberBand?.times(viewModel.quoteDayData.value?.getDeliveryPrice() ?: 1.0))?.plus(allPricemove ?: 0.0)?.toString(),2)
+                                    }
+                                }
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent){
@@ -287,7 +430,32 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                             gravity = Gravity.CENTER_VERTICAL
                             textView {
                                 onThrottleFirstClick {
-
+                                    if (check().not()){
+                                        return@onThrottleFirstClick
+                                    }
+
+                                    val deliveryRelationData = viewModel.deliveryRelationLiveData.value
+                                    //x合约手数
+                                    val xNumberBand =  viewModel.deliveryQty.value?.div(viewModel.goodsInfo.value?.agreeunit?.toDouble() ?: 1.0)?.div(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0)?.div(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)?.times(deliveryRelationData?.rratio1?.toDouble() ?: 1.0)
+                                    //p合约手数 = x合约手数*p合约系数/x合约系数
+                                    val pNumberBand = xNumberBand?.times(deliveryRelationData?.pdeliveryratio?.toDouble() ?: 1.0)?.div(deliveryRelationData?.xdeliveryratio?.toDouble() ?: 1.0)
+
+                                    viewModel.deliveryOrderReq(
+                                        goodsID = data.goodsid?.toInt() ?: 0,
+                                        marketid = data.marketid?.toInt() ?: 0,
+                                        AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+                                        XGoodsID = data.goodsid?.toInt() ?: 0,
+                                        PGoodsID = viewModel.deliveryRelationLiveData.value?.pgoodsid?.toInt() ?: 0,
+                                        DeliveryGoodsID = viewModel.deliveryData.value?.deliverygoodsid?.toInt() ?: 0,
+                                        XQty = xNumberBand?.toLong() ?: 0,
+                                        PQty = pNumberBand?.toLong() ?: 0,
+                                        OperateType = 0,
+                                        DeliveryQty = viewModel.deliveryQty.value?.toLong() ?: 0,
+                                        DeliveryOrderDetail = getDeliveryOrderDetail()
+                                    ){
+                                        finish()
+                                        ToastUtils.showLong("请求成功")
+                                    }
                                 }
                                 text = "交收"
                                 gravity = Gravity.CENTER
@@ -310,4 +478,39 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
         }
     }
 
+    /**
+     * 数据提交前的校验
+     * @return Boolean
+     */
+    fun check() : Boolean{
+        if (viewModel.deliveryData.value?.goodsid.isNullOrEmpty()){
+            ToastUtils.showLong("请选择交收仓单")
+            return false
+        }
+        val deliveryRelationData = viewModel.deliveryRelationLiveData.value
+        //x合约手数
+        val xNumberBand =  viewModel.deliveryQty.value?.div(viewModel.goodsInfo.value?.agreeunit?.toDouble() ?: 1.0)?.div(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0)?.div(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)?.times(deliveryRelationData?.rratio1?.toDouble() ?: 1.0)
+
+        if (xNumberBand ?: 0.0 > data.enableqty?.toDouble() ?: 0.0){
+            ToastUtils.showLong("可用数量不足")
+            return false
+        }
+
+        return true
+    }
+
+    /**
+     * 组合交割申报单明细
+     */
+    fun getDeliveryOrderDetail() : DeliveryMI1.DeliveryOrderDetail{
+        val deliveryOrderDetail = DeliveryMI1.DeliveryOrderDetail.newBuilder()
+        val selectDeliveryData = viewModel.deliveryData.value
+        deliveryOrderDetail.setAccountID(selectDeliveryData?.accountid?.toLong() ?: 0)
+        deliveryOrderDetail.setQty(viewModel.deliveryQty.value?.toLong() ?: 0)
+        deliveryOrderDetail.setLadingBillID(selectDeliveryData?.ladingbillid?.toLong() ?: 0)
+        deliveryOrderDetail.setWRFactorTypeID(selectDeliveryData?.wrfactortypeid?.toLong() ?: 0)
+        deliveryOrderDetail.setSubNum(selectDeliveryData?.subnum?.toLong() ?: 0)
+        return deliveryOrderDetail.build()
+    }
+
 }

+ 53 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewHolder.kt

@@ -1,8 +1,13 @@
 package cn.muchinfo.rma.view.base.hnstmain.contractorders.delivery
 
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.WrDeliveryAvalidHoldLBData
+import cn.muchinfo.rma.global.database.DataBase
+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.base.future.trade.itemView
@@ -10,23 +15,34 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
-class DeliveryViewHolder(private val activity : AppCompatActivity,private val viewModel: DeliveryViewModel) : BaseViewHolder<String>(activity){
+class DeliveryViewHolder(private val activity : AppCompatActivity,private val viewModel: DeliveryViewModel) : BaseViewHolder<WrDeliveryAvalidHoldLBData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
             backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
             linearLayout {
+                onThrottleFirstClick {
+                    viewModel.setOnItemOnClick(data.value?.accountid ?: "")
+                }
                 gravity = Gravity.CENTER_VERTICAL
                 imageView {
+                    data.bindOptional(context){
+                        if (it?.isClick == 0){
+                            imageResource = R.mipmap.yrdz_delivery_normal_icon
+                        }else if (it?.isClick == 1){
+                            imageResource = R.mipmap.yrdz_delivery_select_icon
+                        }
+                    }
                     imageResource = R.mipmap.yrdz_delivery_normal_icon
-                    imageResource = R.mipmap.yrdz_delivery_select_icon
                 }.lparams(autoSize(43), autoSize(43)){
                     marginStart = autoSize(23)
                 }
 
                 textView {
-                    text = "南**业"
+                    data.bindOptional(context){
+                        text = it?.username
+                    }
                     textSizeAuto = 34
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent){
@@ -39,8 +55,10 @@ class DeliveryViewHolder(private val activity : AppCompatActivity,private val vi
             linearLayout {
                 verticalLayout {
                     textView {
-                        text = "铜杆-12mm-江铜"
-                        textSizeAuto = 32
+                        data.bindOptional(context){
+                            text = it?.wrtypename
+                        }
+                        textSizeAuto = 28
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent){
                         topMargin = autoSize(25)
@@ -48,7 +66,9 @@ class DeliveryViewHolder(private val activity : AppCompatActivity,private val vi
                     }
 
                     textView {
-                        text = "蛇口仓库"
+                        data.bindOptional(context){
+                            text = it?.warehousename
+                        }
                         textSizeAuto = 32
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent){
@@ -60,15 +80,21 @@ class DeliveryViewHolder(private val activity : AppCompatActivity,private val vi
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        text = "1"
+                        data.bindOptional(context){
+                            text = it?.pricemove
+                        }
                         textSizeAuto = 34
                         textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(25)
+                    }
 
                     emptyView()
 
                     textView {
-                        text = "5吨"
+                        data.bindOptional(context){
+                            text = it?.avalidqty + it?.enumdicname
+                        }
                         textSizeAuto = 34
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent){
@@ -78,11 +104,27 @@ class DeliveryViewHolder(private val activity : AppCompatActivity,private val vi
 
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL
+                    data.bindOptional(context){
+                        if (it?.isClick == 0){
+                            visibility = View.INVISIBLE
+                        }else{
+                            visibility = View.VISIBLE
+                        }
+                    }
                     numberEditText {
-                        text = "0"
+
+                        data.bindOptional(context){data1 ->
+                            val deliveryRelationData = GlobalDataCollection.instance?.deliveryRelationDataArrayList?.find { data1?.goodsid == it.goodsid }
+                            val goodsInfo = DataBase.getInstance().goodsInfoDao().getGoodsInfo(data1?.goodsid?.toInt() ?: 0)
+                            val multiple = goodsInfo.agreeunit.times(deliveryRelationData?.mindeliveryqty?.toDouble() ?: 1.0).times(deliveryRelationData?.rratio2?.toDouble() ?: 1.0)
+                            setChangeValue(multiple)
+                            text = multiple.toString()
+                        }
                         setOnTextChangeListener { view, value ->
                             if (value.isNullOrEmpty().not()) {
-
+                                if (data.value?.isClick == 1){
+                                    viewModel.deliveryQty.postValue(value?.toString()?.toDouble())
+                                }
                             }
                         }
                         setTextColor(R.color.buy_hall_color)

+ 228 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryViewModel.kt

@@ -1,7 +1,18 @@
 package cn.muchinfo.rma.view.base.hnstmain.contractorders.delivery
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
+import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.protobuf.protoclasses.DeliveryMI1
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import com.blankj.utilcode.util.LogUtils
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 交收viewmodel
@@ -9,17 +20,231 @@ import cn.muchinfo.rma.view.base.BaseViewModel
 class DeliveryViewModel : BaseViewModel(){
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      * 交收页面
      */
-    val deliveryDataList : MutableLiveData<List<String>> = MutableLiveData()
+    val deliveryDataList : MutableLiveData<List<WrDeliveryAvalidHoldLBData>> = MutableLiveData()
+
+    /**
+     * 当前点选的数量
+     */
+    val deliveryQty : MutableLiveData<Double> = MutableLiveData()
+
+    /**
+     * 当前选择的点选仓单
+     */
+    val deliveryData : MutableLiveData<WrDeliveryAvalidHoldLBData> = MutableLiveData()
+
+    /**
+     * 相关的交割商品关联信息
+     */
+    val deliveryRelationLiveData : MutableLiveData<DeliveryRelationData> = MutableLiveData()
+
+    /**
+     * 当前页面的仓单单位
+     */
+    val enumdicnameLiveData : MutableLiveData<String> = MutableLiveData()
+
+    /**
+     * 当前页面用到的商品信息
+     */
+    val goodsInfo : MutableLiveData<GoodsInfo> = MutableLiveData()
+
+    /**
+     *  当前页面P商品的盘面信息
+     */
+    val quoteDayData: MutableLiveData<QuoteDayData> = MutableLiveData()
+
+    /**
+     * 初始化商品信息
+     * @param goodsid String
+     */
+    fun setGoodsInfo(goodsid: String){
+        goodsInfo.postValue(DataBase.getInstance().goodsInfoDao().getGoodsInfo(goodsid.toInt()))
+    }
+
+    /**
+     * 根据相应持仓单找到相应的交割关联信息
+     * @param goodsid String
+     */
+    fun setDeliveryRelationData(goodsid: String){
+        val deliveryRelationData = GlobalDataCollection.instance?.deliveryRelationDataArrayList?.find { goodsid == it.goodsid }
+        if (deliveryRelationData?.goodsid.isNullOrEmpty()){
+            deliveryRelationLiveData.postValue(DeliveryRelationData())
+        }else{
+            deliveryRelationLiveData.postValue(deliveryRelationData)
+        }
+    }
 
     /**
      * 获取可交收列表
      */
-    fun getDeliveryList(){
-        deliveryDataList.postValue(arrayListOf("1","2","3","4","5"))
+    fun getDeliveryList(goodsid : String){
+        val params = mutableMapOf<String,String>().apply {
+            put("accountid",GlobalDataCollection.instance?.accountId?.toString() ?: "")
+            put("goodsid",goodsid)
+        }
+        MyApplication.getInstance()?.deliveryManager?.queryWrDeliveryAvalidHoldLB(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                deliveryDataList.postValue(respData)
+            }
+        }
+    }
+
+
+    /**
+     * item的点击事件
+     */
+    fun setOnItemOnClick(accountid : String){
+        val newWrStandardFactoryItemDataList = arrayListOf<WrDeliveryAvalidHoldLBData>()
+        deliveryDataList.value?.forEach {
+            if (it.accountid == accountid){
+                if (it.isClick == 0){
+                    newWrStandardFactoryItemDataList.add(it.copy(isClick = 1))
+                    deliveryData.postValue(it.copy(isClick = 1))
+                }else{
+                    newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))
+                    deliveryData.postValue(WrDeliveryAvalidHoldLBData())
+                }
+            }else{
+                newWrStandardFactoryItemDataList.add(it.copy(isClick = 0))
+            }
+        }
+        deliveryDataList.postValue(newWrStandardFactoryItemDataList)
+    }
+
+
+    /**
+     * 请求盘面信息
+     * @param first Int
+     * @param last Int
+     * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryQuoteDay(
+        tag: String,
+        goodsCodes: String,
+        isShowLoading: Boolean
+    ) {
+        if (isShowLoading) {
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
+
+        val params = mutableMapOf<String, String>().apply {
+            put("goodsCodes", goodsCodes)
+        }
+        MyApplication.getInstance()?.futureManager?.queryQuoteDay(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                if (respData?.isEmpty()?.not() == true) {
+                    quoteDayData.postValue(respData[0])
+                }
+                if (isShowLoading) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功"))
+                }
+
+            } else {
+                if (isShowLoading) {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = "数据请求失败"
+                            )
+                        )
+                    )
+                }
+            }
+        }
+        addSubscriptQuote(tag = tag, goodsCodes = setOf(goodsCodes))
+    }
+
+
+    /**
+     * 订阅行情
+     * @param tag String
+     * @param goodsInfoList List<GoodsInfo>
+     */
+    fun addSubscriptQuote(tag: String, goodsCodes: Set<String>) {
+        GlobalScope.launch {
+            MyApplication.getInstance()?.quoteManager?.addSubscriptQuote(
+                tag = tag, goodsCodeSet = goodsCodes
+            ) { isCompleted, err ->
+                LogUtils.eTag("订阅行情", goodsCodes)
+            }
+        }
     }
 
+    /**
+     * 取消订阅
+     * @param tag String
+     */
+    fun removeSubscriptQuote(tag: String) {
+        GlobalScope.launch {
+            MyApplication.getInstance()?.quoteManager?.removeSubscriptQuote(
+                tag = tag
+            )
+        }
+    }
+
+    /**
+     * 交割申报请求
+     */
+    fun deliveryOrderReq(
+        goodsID : Int = 0,
+        marketid : Int = 0,//市场
+        AccountID : Long = 0,//交易账号
+        XGoodsID : Int = 0,//主商品ID(交割合约)
+        PGoodsID : Int = 0,//辅助商品ID(辅助合约)
+        P2GoodsID : Int = 0,//辅助商品ID(辅助合约2)
+        DeliveryGoodsID : Int = 0,//交割商品ID
+        XQty : Long = 0,//交割合约数量
+        PQty : Long = 0,//辅助合约数量
+        P2Qty : Long = 0,//辅助合约2数量
+        DeliveryQty : Long = 0,//交割商品仓单数量
+        OperateType : Int,//操作类型:
+        OrderSrc : Int = 0,////单据来源
+        TakeMode : Int = 0,// 提货方式
+        DeliveryOrderDetail : DeliveryMI1.DeliveryOrderDetail,//关联仓单头寸
+        ReceiverAddress : String = "",//提货地址
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.deliveryManager?.deliveryOrderReq(
+                goodsID = goodsID,
+                marketid = marketid,
+                XGoodsID = XGoodsID,
+                PGoodsID = PGoodsID,
+                AccountID = AccountID,
+                P2GoodsID = P2GoodsID,
+                XQty = XQty,
+                PQty = PQty,
+                DeliveryGoodsID = DeliveryGoodsID,
+                P2Qty = P2Qty,
+                DeliveryQty = DeliveryQty,
+                OperateType = OperateType,
+                OrderSrc = OrderSrc,
+                TakeMode = TakeMode,
+                DeliveryOrderDetail = DeliveryOrderDetail,
+                ReceiverAddress = ReceiverAddress
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
 
 
 }

+ 27 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendActivity.kt

@@ -0,0 +1,27 @@
+package cn.muchinfo.rma.view.base.hnstmain.friend
+
+import android.os.Bundle
+import cn.muchinfo.rma.view.autoWidget.commonLeftButton
+import cn.muchinfo.rma.view.autoWidget.commonTitle
+import cn.muchinfo.rma.view.autoWidget.topBar
+import cn.muchinfo.rma.view.base.BaseActivity
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 我的朋友页面
+ */
+class MainFriendActivity : BaseActivity<MainFriendViewModel>(){
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "我的朋友"
+                }
+            }
+        }
+    }
+
+}

+ 12 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendViewModel.kt

@@ -0,0 +1,12 @@
+package cn.muchinfo.rma.view.base.hnstmain.friend
+
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 我的朋友viewmodel
+ */
+class MainFriendViewModel : BaseViewModel(){
+
+
+
+}

+ 16 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/AreCancelContentAdapter.java

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.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;
@@ -15,6 +16,7 @@ import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
+import com.blankj.utilcode.util.ActivityUtils;
 import com.blankj.utilcode.util.ToastUtils;
 
 import java.util.ArrayList;
@@ -25,6 +27,7 @@ import cn.muchinfo.rma.global.data.HnstWrPositionData;
 import cn.muchinfo.rma.global.data.WrOrderDetailData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
 import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.SpotWareHouseViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.arecancelled.AreCancelledActivity;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
 /**
@@ -116,8 +119,20 @@ public class AreCancelContentAdapter extends RecyclerView.Adapter<AreCancelConte
                 }
             }
         });
+        itemViewHolder.details.setVisibility(View.VISIBLE);
+        if (data.getWrtradeorderstatus().equals("3") || data.getWrtradeorderstatus().equals("10")){
+            itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+        }else {
+            itemViewHolder.invoice_register.setVisibility(View.GONE);
+        }
 
-        itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+        //详情
+        itemViewHolder.details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data",data);
+            intent.setClass(context, AreCancelledActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
 
         //撤单
         itemViewHolder.invoice_register.setOnClickListener(view -> {

+ 359 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledActivity.kt

@@ -0,0 +1,359 @@
+package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.arecancelled
+
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrOrderDetailData
+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.future.trade.itemView
+import cn.muchinfo.rma.view.base.warehousereceipt.BusinessItemView
+import cn.muchinfo.rma.view.base.warehousereceipt.RulesItem
+import org.jetbrains.anko.*
+
+/**
+ * 挂单详情页面
+ */
+class AreCancelledActivity : BaseActivity<AreCancelledViewModel>(){
+
+    //传入的挂单数据
+    val data by lazy { intent.getParcelableExtra<WrOrderDetailData>("data") as WrOrderDetailData }
+
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        viewModel.queryWrGoodsInfo(data = data)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "挂单详情"
+                }
+            }
+
+            scrollView {
+                verticalLayout {
+                    verticalLayout {
+                        background = resources.getDrawable(R.color.white)
+                        viewModel.wrGoodsInfoData.bindOptional(context) {
+                            it?.lstitem?.forEach {
+                                BusinessItemView()
+
+                                linearLayout {
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+                                    linearLayout {
+                                        background = resources.getDrawable(R.color.qhj_rule_bg_color)
+                                        gravity = Gravity.CENTER
+                                        textView {
+                                            text = it.name
+                                            textSizeAuto = 31
+                                            textColorInt = R.color.rma_blue_color
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(autoSize(240), autoSize(96))
+
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+
+                                    linearLayout {
+                                        gravity = Gravity.CENTER
+                                        textView {
+                                            text = it.value
+                                            textSizeAuto = 31
+                                            textColorInt = R.color.rma_black_33
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(0, autoSize(96), 1f)
+
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+                                }.lparams(matchParent, autoSize(96)) {
+                                    marginStart = autoSize(12)
+                                    marginEnd = autoSize(12)
+                                }
+                            }
+                        }
+                    }
+
+                    BusinessItemView()
+
+
+                    textView {
+                        text = "履约规则:"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                        topMargin = autoSize(64)
+                    }
+
+                    horizontalScrollView {
+                        isHorizontalScrollBarEnabled = false
+                        background = resources.getDrawable(R.color.white)
+                        linearLayout {
+                            viewModel.wrGoodsInfoData.bindOptional(context){
+                                it?.lststep?.forEach {
+                                    RulesItem(name = it.stepinfo ?: "",value = it.stepdate ?: "")
+                                }
+                            }
+                        }
+
+                    }.lparams(matchParent, autoSize(175))
+
+                    verticalLayout {
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "交易账户"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌方式"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌价格"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = data.fixedprice
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "现货仓单"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌数量"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = data.orderqty
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌数量"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = data.orderqty
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "起牌数量"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "履约保证金"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌有效期"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "指定朋友"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "挂牌金额"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "履约保证金"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_zhushi_text_color
+                            }.lparams(autoSize(250), wrapContent){
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                text = "--"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, autoSize(132))
+                    }.lparams(matchParent, wrapContent){
+                        topMargin = autoSize(20)
+                    }
+                }
+
+            }.lparams(matchParent, matchParent)
+
+
+        }
+    }
+
+}

+ 32 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/arecancelled/AreCancelledViewModel.kt

@@ -0,0 +1,32 @@
+package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.arecancelled
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.global.data.WrGoodsInfoData
+import cn.muchinfo.rma.global.data.WrOrderDetailData
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 挂单详情viewmodel
+ */
+class AreCancelledViewModel : BaseViewModel(){
+
+    //仓单商品信息
+    val wrGoodsInfoData : MutableLiveData<WrGoodsInfoData> = MutableLiveData()
+
+    //查询仓单买大厅数据详情
+    fun queryWrGoodsInfo(data: WrOrderDetailData){
+        val params = mutableMapOf<String,String>().apply {
+            put("haswr",data.haswr ?: "")
+            put("wrfactortypeid",data.wrfactortypeid ?: "")
+        }
+        MyApplication.getInstance()?.warehouseManager?.queryWrGoodsInfo(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                wrGoodsInfoData.postValue(respData?.get(0))
+            }
+        }
+    }
+
+
+}

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

@@ -89,7 +89,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
     }
 
     //买大厅
-    private val buyHallUI by lazy { BuyHallUI(this, viewModel, type ?: "", pricetype ?: "", orderQuoteData) }
+    private val buyHallUI by lazy {
+        BuyHallUI(
+            this,
+            viewModel,
+            type ?: "",
+            pricetype ?: "",
+            orderQuoteData
+        )
+    }
 
     //viewpager的适配器
     private var newPagerAdapter: PagerAdapter? = null
@@ -137,8 +145,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
 
     //通用的消息更新通知
     @Subscribe(threadMode = ThreadMode.MAIN)
-    fun onMessageEvent(messageEvent : MessageEvent) {
-       if (messageEvent.messageType == EventConstent.FID_MoneyChangedNtf){//资金账号变化通知
+    fun onMessageEvent(messageEvent: MessageEvent) {
+        if (messageEvent.messageType == EventConstent.FID_MoneyChangedNtf) {//资金账号变化通知
             viewModel.getTaAccounts()
         }
     }
@@ -166,8 +174,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
     }
 
     //判断是否打开挂牌dialog,是的话就打开
-    fun openDialogByListed(){
-        if (isOpenListedDialog == "1"){
+    fun openDialogByListed() {
+        if (isOpenListedDialog == "1") {
             if (pricetype == "1") {//一口价
                 this@BusinessHallActivity.OneListedDialog(
                     this@BusinessHallActivity,
@@ -194,9 +202,16 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         verticalLayout {
             createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             initMenuData()
-            viewModel.queryWrAverageTradePrice(type = type ?: "",wrfactortypeid = orderQuoteData.wrfactortypeid ?: "")
+            viewModel.queryWrAverageTradePrice(
+                type = type ?: "",
+                wrfactortypeid = orderQuoteData.wrfactortypeid ?: ""
+            )
             viewModel.orderQuoteData.postValue(orderQuoteData)
-            viewModel.queryQuoteDay(tag = thisTag,goodsCodes = orderQuoteData.goodscode ?: "",isShowLoading = false)
+            viewModel.queryQuoteDay(
+                tag = thisTag,
+                goodsCodes = orderQuoteData.goodscode ?: "",
+                isShowLoading = false
+            )
             viewModel.resetAccountData()
             viewModel.querydetailsWarehouseWrPosition(orderQuoteData)
             background = resources.getDrawable(R.color.white)
@@ -272,8 +287,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                     onThrottleFirstClick {
                         val intent = Intent()
                         intent.putExtra("data", orderQuoteData)
-                        intent.putExtra("type",type)
-                        intent.putExtra("goodsId",orderQuoteData.goodsid)
+                        intent.putExtra("type", type)
+                        intent.putExtra("goodsId", orderQuoteData.goodsid)
                         intent.setClass(context, BusinessHallDetailsActivity::class.java)
                         ActivityUtils.startActivity(intent)
                     }
@@ -324,7 +339,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = NumberUtils.roundNum(it?.sellprice, 2)
                             }
                             textSizeAuto = 29
@@ -345,7 +360,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = NumberUtils.roundNum(it?.buyprice, 2)
                             }
                             textSizeAuto = 29
@@ -370,7 +385,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = it?.sellqty
                             }
                             textSizeAuto = 29
@@ -393,7 +408,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = it?.buyqty
                             }
                             textSizeAuto = 29
@@ -466,7 +481,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = NumberUtils.roundNum(it?.sellpricemove, 2)
                             }
                             textSizeAuto = 29
@@ -487,7 +502,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = NumberUtils.roundNum(it?.buypricemove, 2)
                             }
                             textSizeAuto = 29
@@ -533,7 +548,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = it?.sellqty
                             }
                             textSizeAuto = 29
@@ -556,7 +571,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         emptyView()
 
                         textView {
-                            viewModel.orderQuoteData.bindOptional(context){
+                            viewModel.orderQuoteData.bindOptional(context) {
                                 text = it?.buyqty
                             }
                             textSizeAuto = 29
@@ -676,7 +691,8 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                             creatFinancingDialog(
                                 type = type ?: "",
                                 pricetype = pricetype ?: "",
-                                buyOrSelldata = viewModel.selectData.value ?: OrderQuoteDetailData(),
+                                buyOrSelldata = viewModel.selectData.value
+                                    ?: OrderQuoteDetailData(),
                                 data = viewModel.orderQuoteData.value ?: OrderQuoteData()
                             )
                         }
@@ -706,13 +722,14 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         .markerRadius(2f)
                         .markerSymbol(AAChartSymbolType.Circle)
                         .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
-                        .colorsTheme(arrayOf("#FF9A2A","#F39730"))
+                        .colorsTheme(arrayOf("#FF9A2A", "#F39730"))
                         .scrollablePlotArea(
                             AAScrollablePlotArea()
                                 .minWidth(300)
-                                .scrollPositionX(1f))
+                                .scrollPositionX(1f)
+                        )
 
-                    viewModel.wrAverageTradePriceDataList.bindOptional(context){
+                    viewModel.wrAverageTradePriceDataList.bindOptional(context) {
                         val list = it
                         val totalexposureelement = AASeriesElement()
                             .lineWidth(2f)
@@ -762,7 +779,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         lateinit var one_seekbar: SeekBar
 
         /** 最大可摘数量 **/
-        val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
+        val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
 
         var marginValue = 0.0//履约保证金比例
 
@@ -860,7 +877,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                     textView {
                         text = "请选择现货仓单"
                         selectSpotDetailsData.bindOptional(context) {
-                            maxpickNumber.postValue(Math.min(it?.enableqty?.toDouble()?:0.0,buySelldata?.orderqty?.toDouble() ?: 0.0))
+                            maxpickNumber.postValue(
+                                Math.min(
+                                    it?.enableqty?.toDouble() ?: 0.0,
+                                    buySelldata?.orderqty?.toDouble() ?: 0.0
+                                )
+                            )
                             text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
                         }
                         textSizeAuto = 34
@@ -952,7 +974,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         }
 
                         textView {
-                            text =  "(" + data.minivalue +data.enumdicname +"起)"
+                            text = "(" + data.minivalue + data.enumdicname + "起)"
                             textSizeAuto = 29
                             textColorInt = R.color.rma_hint_text_color_ccc
                         }.lparams(wrapContent, wrapContent) {
@@ -1039,7 +1061,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                             emptyView()
 
                             textView {
-                                maxpickNumber.bindOptional(context){
+                                maxpickNumber.bindOptional(context) {
                                     text = it.toString() + data.enumdicname
                                 }
                                 textSizeAuto = 29
@@ -1128,7 +1150,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 1
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 } else {//卖单所以是摘买
@@ -1148,7 +1178,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 1
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 }
@@ -1171,7 +1209,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 0
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 } else {//卖单所以是摘买
@@ -1191,7 +1237,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 0
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 }
@@ -1255,19 +1309,19 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         lateinit var float_delisting_amount: TextView
 
         /** 最大可摘数量 **/
-        val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
+        val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
 
         /*** 一口价摘牌金额 **/
         lateinit var one_seekbar: SeekBar
 
         //估算总额
-        lateinit var float_total_amount : TextView
+        lateinit var float_total_amount: TextView
 
         //估算总价
-        lateinit var float_total_price : TextView
+        lateinit var float_total_price: TextView
 
         //浮动价挂牌金额
-        val listed_price : MutableLiveData<Double> = MutableLiveData()
+        val listed_price: MutableLiveData<Double> = MutableLiveData()
 
         var marginValue = 0.0//履约保证金比例
 
@@ -1299,9 +1353,11 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
             backgroundColor = Color.parseColor("#5f000000")
             viewModel.quoteDayData.postValue(viewModel.quoteDayData.value)//重新对行情盘面进行赋值以触发计算估算总价
             verticalLayout {
-                viewModel.quoteDayData.bindOptional(context){
+                viewModel.quoteDayData.bindOptional(context) {
                     //行情下发计算挂牌金额 = (基差价格+期货合约价)
-                    listed_price.postValue(buySelldata.pricemove.toString().toDouble().plus(it?.getPrice() ?: 0.0))
+                    listed_price.postValue(
+                        buySelldata.pricemove.toString().toDouble().plus(it?.getPrice() ?: 0.0)
+                    )
                 }
                 backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
                 linearLayout {
@@ -1371,7 +1427,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                     textView {
                         text = "请选择现货仓单"
                         selectSpotDetailsData.bindOptional(context) {
-                            maxpickNumber.postValue(Math.min(it?.enableqty?.toDouble() ?: 0.0,buySelldata.orderqty?.toDouble() ?: 0.0))
+                            maxpickNumber.postValue(
+                                Math.min(
+                                    it?.enableqty?.toDouble() ?: 0.0,
+                                    buySelldata.orderqty?.toDouble() ?: 0.0
+                                )
+                            )
                             text = it?.ladingbillid + "(" + it?.enableqty + it?.enumdicname + ")"
                         }
                         textSizeAuto = 34
@@ -1463,7 +1524,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                         }
 
                         textView {
-                            text =  "(" + data.minivalue +data.enumdicname +"起)"
+                            text = "(" + data.minivalue + data.enumdicname + "起)"
                             textSizeAuto = 29
                             textColorInt = R.color.rma_hint_text_color_ccc
                         }.lparams(wrapContent, wrapContent) {
@@ -1478,7 +1539,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                             numberEditText {
                                 text = "1"
                                 listednumberEdittext = this
-                                maxpickNumber.bindOptional(context){
+                                maxpickNumber.bindOptional(context) {
                                     max = it ?: 1.0
                                 }
                                 setOnTextChangeListener { view, value ->
@@ -1537,7 +1598,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                             emptyView()
 
                             textView {
-                                maxpickNumber.bindOptional(context){
+                                maxpickNumber.bindOptional(context) {
                                     text = it.toString() + data.enumdicname
                                 }
                                 textSizeAuto = 29
@@ -1568,11 +1629,13 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                     textView {
                         text = "--"
                         listed_price.bindOptional(context) {
-                            if (it != 0.0 && marginValue != 0.0){
-                                val maxNumberByMoney = viewModel.usedAccountData.value?.canUserAmount?.div(it ?: 1.0)?.div(marginValue)
-                                if (maxNumberByMoney ?: 0.0 > buySelldata.orderqty?.toDouble() ?: 0.0){
+                            if (it != 0.0 && marginValue != 0.0) {
+                                val maxNumberByMoney =
+                                    viewModel.usedAccountData.value?.canUserAmount?.div(it ?: 1.0)
+                                        ?.div(marginValue)
+                                if (maxNumberByMoney ?: 0.0 > buySelldata.orderqty?.toDouble() ?: 0.0) {
                                     maxpickNumber.postValue(buySelldata.orderqty?.toDouble())
-                                }else{
+                                } else {
                                     maxpickNumber.postValue(maxNumberByMoney?.toDouble())
                                 }
                             }
@@ -1624,7 +1687,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
 
                 textView {
                     viewModel.usedAccountData.bindOptional(context) {
-                        text = "可用资金  " +  NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
+                        text = "可用资金  " + NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
                     }
                     textSizeAuto = 29
                     textColorInt = R.color.rma_black_33
@@ -1673,7 +1736,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 1
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 } else {//卖单所以是摘买
@@ -1692,7 +1763,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 1
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 }
@@ -1714,7 +1793,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 0
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 } else {//卖单所以是摘买
@@ -1733,7 +1820,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
                                         DeliveryMonth = data.deliverymonth ?: "",
                                         HasWr = 0
                                     ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
+                                        viewModel.queryOneOrderQuote(
+                                            wrpricetype = pricetype,
+                                            haswr = if (type == "1") {
+                                                "1"
+                                            } else {
+                                                "0"
+                                            },
+                                            wrfactortypeid = data.wrfactortypeid ?: ""
+                                        )
                                         dialog.dismiss()
                                     }
                                 }
@@ -1789,6 +1884,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         val dialog1 by lazy {
             SelectFincningDialog(this@BusinessHallActivity, viewModel, data)
         }
+
         /** 摘牌数量 **/
         lateinit var onePriceInputNumberEdittext: MangeNumberEditText2
 
@@ -1802,7 +1898,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         lateinit var performance_bond_amount: TextView
 
         /** 最大可摘数量 **/
-        val maxpickNumber : MutableLiveData<Double> = MutableLiveData()
+        val maxpickNumber: MutableLiveData<Double> = MutableLiveData()
 
         lateinit var one_seekbar: SeekBar
 
@@ -1812,468 +1908,534 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
             maxpickNumber.postValue(buyOrSelldata.orderqty?.toDouble())
             verticalLayout {
                 backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
-                linearLayout {
-                    gravity = Gravity.CENTER_VERTICAL
-                    onThrottleFirstClick {
-                        creatAccountDataSheetDialog(
-                            "请选择资金账号",
-                            GlobalDataCollection.instance?.accountDataList ?: arrayListOf()
-                        ) {
-                            selectAccountData.postValue(this)
-                            viewModel.resetAccountDataBySelect(this)
-                        }
-                    }
-                    linearLayout {
-                        textView {
-                            text = "交易账户"
-                            textSizeAuto = 34
-                            textColorInt = R.color.rma_hint_text_color_ccc
-                        }.lparams(wrapContent, wrapContent) {
-                            marginStart = autoSize(36)
-                        }
-                    }.lparams(autoSize(250), wrapContent)
 
-                    textView {
-                        selectAccountData.bindOptional(context) {
-                            text = it?.accountid.toString() + "   " + it?.accountname
-                        }
-                        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(172))
-
-                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)
-
-                    textView {
-                        text = buyOrSelldata.username
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
-
-                itemView()
-
-                linearLayout {
-                    visibility = if (type == "1") {
-                        View.VISIBLE
-                    } else {
-                        View.GONE
-                    }
-                    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 = buyOrSelldata.fixedprice
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
+                frameLayout {
+                    scrollView {
+                        verticalLayout {
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                onThrottleFirstClick {
+                                    creatAccountDataSheetDialog(
+                                        "请选择资金账号",
+                                        GlobalDataCollection.instance?.accountDataList
+                                            ?: arrayListOf()
+                                    ) {
+                                        selectAccountData.postValue(this)
+                                        viewModel.resetAccountDataBySelect(this)
+                                    }
+                                }
+                                linearLayout {
+                                    textView {
+                                        text = "交易账户"
+                                        textSizeAuto = 34
+                                        textColorInt = R.color.rma_hint_text_color_ccc
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(36)
+                                    }
+                                }.lparams(autoSize(250), wrapContent)
 
-                linearLayout {
-                    visibility = if (pricetype == "2") {
-                        View.VISIBLE
-                    } else {
-                        View.GONE
-                    }
-                    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 {
+                                    selectAccountData.bindOptional(context) {
+                                        text = it?.accountid.toString() + "   " + it?.accountname
+                                    }
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
 
-                    textView {
-                        text = buyOrSelldata.pricemove
-                        textSizeAuto = 34
-                        textColorInt = R.color.buy_hall_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
+                                emptyView()
 
-                itemView()
+                                imageView {
+                                    imageResource = R.mipmap.rma_more
+                                }.lparams(autoSize(36), autoSize(36))
 
-                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)
+                            }.lparams(matchParent, autoSize(172))
 
-                    textView {
-                        text = buyOrSelldata.orderqty
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
+                            itemView()
 
-                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)
 
-                linearLayout {
-                    verticalLayout {
-                        textView {
-                            text = "摘牌数量"
-                            textSizeAuto = 34
-                            textColorInt = R.color.rma_hint_text_color_ccc
-                        }.lparams(wrapContent, wrapContent) {
-                            marginStart = autoSize(36)
-                            topMargin = autoSize(36)
-                        }
+                                textView {
+                                    text = buyOrSelldata.username
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.lparams(matchParent, autoSize(143))
 
-                        textView {
-                            text =  "(" + data.minivalue +data.enumdicname +"起)"
-                            textSizeAuto = 29
-                            textColorInt = R.color.rma_hint_text_color_ccc
-                        }.lparams(wrapContent, wrapContent) {
-                            marginStart = autoSize(36)
-                            topMargin = autoSize(20)
-                        }
-                    }.lparams(autoSize(250), autoSize(290))
+                            itemView()
 
-                    verticalLayout {
-                        linearLayout {
-                            gravity = Gravity.CENTER_VERTICAL
-                            numberEditText {
-                                text = "1"
-                                maxpickNumber.bindOptional(context){
-                                    max = it ?: 1.0
+                            linearLayout {
+                                visibility = if (type == "1") {
+                                    View.VISIBLE
+                                } else {
+                                    View.GONE
                                 }
-                                onePriceInputNumberEdittext = this
-                                setOnTextChangeListener { view, value ->
-                                    if (value.isNullOrEmpty().not()) {
-                                        float_delisting_amount.text = NumberUtils.roundNum(
-                                            buyOrSelldata.fixedprice?.toDouble()
-                                                ?.times(value.toString().toDouble()) ?: 0.0, 2
-                                        )
-                                        one_seekbar.progress = value.toDouble()
-                                            .div(maxpickNumber.value ?: 0.0)
-                                            .times(100).toInt()
+                                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 = buyOrSelldata.fixedprice
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.lparams(matchParent, autoSize(143))
+
+                            linearLayout {
+                                visibility = if (pricetype == "2") {
+                                    View.VISIBLE
+                                } else {
+                                    View.GONE
                                 }
+                                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 = buyOrSelldata.pricemove
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.buy_hall_color
+                                }.lparams(wrapContent, wrapContent)
+                            }.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)
+
+                                textView {
+                                    text = buyOrSelldata.orderqty
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.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(0, autoSize(72), 1f)
+                                    textView {
+                                        text = "(" + data.minivalue + data.enumdicname + "起)"
+                                        textSizeAuto = 29
+                                        textColorInt = R.color.rma_hint_text_color_ccc
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(36)
+                                        topMargin = autoSize(20)
+                                    }
+                                }.lparams(autoSize(250), autoSize(290))
+
+                                verticalLayout {
+                                    linearLayout {
+                                        gravity = Gravity.CENTER_VERTICAL
+                                        numberEditText {
+                                            text = "1"
+                                            maxpickNumber.bindOptional(context) {
+                                                max = it ?: 1.0
+                                            }
+                                            onePriceInputNumberEdittext = this
+                                            setOnTextChangeListener { view, value ->
+                                                if (value.isNullOrEmpty().not()) {
+                                                    float_delisting_amount.text =
+                                                        NumberUtils.roundNum(
+                                                            buyOrSelldata.fixedprice?.toDouble()
+                                                                ?.times(value.toString().toDouble())
+                                                                ?: 0.0, 2
+                                                        )
+                                                    one_seekbar.progress = value.toDouble()
+                                                        .div(maxpickNumber.value ?: 0.0)
+                                                        .times(100).toInt()
+                                                }
+                                            }
+
+                                        }.lparams(0, autoSize(72), 1f)
+
+                                        textView {
+                                            text = data.enumdicname
+                                            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
+                                        one_seekbar = this
+                                        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
+                                            ) {
+                                                onePriceInputNumberEdittext.text =
+                                                    NumberUtils.roundNum(
+                                                        maxpickNumber.value?.times(p1.div(100.0))
+                                                            ?: 0.0, 0
+                                                    )
+                                            }
+
+                                            override fun onStartTrackingTouch(p0: SeekBar?) {
+
+                                            }
+
+                                            override fun onStopTrackingTouch(p0: SeekBar?) {
+
+                                            }
+                                        })
+                                    }.lparams(matchParent, autoSize(46)) {
+                                        marginEnd = autoSize(110)
+                                        topMargin = autoSize(20)
+                                    }
 
-                            textView {
-                                text = data.enumdicname
-                                textSizeAuto = 34
-                                textColorInt = R.color.rma_hint_text_color_ccc
-                            }.lparams(wrapContent, wrapContent) {
-                                marginEnd = autoSize(36)
-                            }
-                        }.lparams(matchParent, autoSize(143))
+                                    linearLayout {
+                                        textView {
+                                            text = "0"
+                                            textSizeAuto = 29
+                                            textColorInt = R.color.rma_gray_color
+                                        }.lparams(wrapContent, wrapContent)
+
+                                        emptyView()
+
+                                        textView {
+                                            maxpickNumber.bindOptional(context) {
+                                                text = it?.toString() + data.enumdicname
+                                            }
+                                            textSizeAuto = 29
+                                            textColorInt = R.color.rma_gray_color
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(matchParent, wrapContent) {
+                                        marginEnd = autoSize(110)
+                                        topMargin = autoSize(10)
+                                    }
 
-                        inflateLayout<SeekBar>(R.layout.main_seekbar) {
-                            min = 10
-                            max = 100
-                            one_seekbar = this
-                            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) {
-                                    onePriceInputNumberEdittext.text = NumberUtils.roundNum(
-                                        maxpickNumber.value?.times(p1.div(100.0))
-                                            ?: 0.0, 0
-                                    )
-                                }
+                                }.lparams(matchParent, autoSize(290))
+                            }.lparams(matchParent, autoSize(290))
 
-                                override fun onStartTrackingTouch(p0: SeekBar?) {
+                            itemView()
 
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                onThrottleFirstClick {
+                                    dialog1.show()
+                                }
+                                textView {
+                                    text = "融资方案"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_hint_text_color_ccc
+                                }.lparams(autoSize(214), wrapContent) {
+                                    marginStart = autoSize(36)
                                 }
 
-                                override fun onStopTrackingTouch(p0: SeekBar?) {
-
+                                textView {
+                                    viewModel.slectfinancingData.bindOptional(context) {
+                                        if (dialog1.isVisible) {
+                                            dialog1.dismiss()
+                                        }
+                                        var cost = ""//费用
+                                        if (it?.interestratemode == "1") {
+                                            cost = it.interestrate?.toPercentage() ?: ""
+                                        } else if (it?.interestratemode == "2") {
+                                            cost = it.interestrate?.toWanPercentage() ?: ""
+                                        } else if (it?.interestratemode == "3") {//固定值
+                                            cost = NumberUtils.roundNum(it.interestrate, 2)
+                                        }
+                                        text =
+                                            it?.username + "-" + it?.productname + "-" + it?.financingdays + "天-" + it?.marginratio?.toPercentage() + "-" + cost + "-" + if (it?.interestsettlemode == "1") {
+                                                "日结"
+                                            } else {
+                                                "月结"
+                                            } + "-" + it?.interestminlen
+                                    }
+                                    text = "请选择融资方案"
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.lparams(matchParent, autoSize(143))
+
+                            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)
                                 }
-                            })
-                        }.lparams(matchParent, autoSize(46)) {
-                            marginEnd = autoSize(110)
-                            topMargin = autoSize(20)
-                        }
 
-                        linearLayout {
-                            textView {
-                                text = "0"
-                                textSizeAuto = 29
-                                textColorInt = R.color.rma_gray_color
-                            }.lparams(wrapContent, wrapContent)
+                                textView {
+                                    text = NumberUtils.roundNum(
+                                        buyOrSelldata.fixedprice?.toDouble()
+                                            ?.times("1".toDouble()) ?: 0.0, 2
+                                    )
+                                    float_delisting_amount = this
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.lparams(matchParent, autoSize(143))
+
+                            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)
+                                }
 
-                            emptyView()
+                                textView {
+                                    viewModel.slectfinancingData.bindOptional(context) {
+                                        if (float_delisting_amount.text.toString()
+                                                .isNullOrEmpty()
+                                        ) {
+                                            text = "--"
+                                        } else {
+                                            text = NumberUtils.roundNum(
+                                                float_delisting_amount.text.toString().toDouble()
+                                                    .times(it?.marginratio?.toDouble() ?: 0.0), 2
+                                            )
+                                        }
+                                    }
+                                    text = "--"
+                                    performance_bond_amount = this
+                                    textSizeAuto = 29
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent)
+                            }.lparams(matchParent, autoSize(143))
 
                             textView {
-                                maxpickNumber.bindOptional(context){
-                                    text = it?.toString() + data.enumdicname
+                                viewModel.usedAccountData.bindOptional(context) {
+                                    text = "可用资金  " + NumberUtils.roundNum(
+                                        it?.canUserAmount.toString(),
+                                        2
+                                    )
                                 }
                                 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
-                    onThrottleFirstClick {
-                        dialog1.show()
-                    }
-                    textView {
-                        text = "融资方案"
-                        textSizeAuto = 34
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                    }.lparams(autoSize(214), wrapContent) {
-                        marginStart = autoSize(36)
-                    }
-
-                    textView {
-                        viewModel.slectfinancingData.bindOptional(context){
-                            if (dialog1.isVisible){
-                                dialog1.dismiss()
-                            }
-                            var cost = ""//费用
-                            if (it?.interestratemode == "1"){
-                                cost = it.interestrate?.toPercentage() ?: ""
-                            }else if (it?.interestratemode == "2"){
-                                cost = it.interestrate?.toWanPercentage() ?: ""
-                            }else if (it?.interestratemode == "3"){//固定值
-                                cost = NumberUtils.roundNum(it.interestrate,2)
-                            }
-                            text = it?.username + "-" + it?.productname + "-" + it?.financingdays + "天-" + it?.marginratio?.toPercentage() + "-" + cost + "-" + if (it?.interestsettlemode == "1") {
-                                "日结"
-                            } else {
-                                 "月结"
-                            } + "-" + it?.interestminlen
-                        }
-                        text = "请选择融资方案"
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
-
-                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 = NumberUtils.roundNum(
-                            buyOrSelldata.fixedprice?.toDouble()
-                                ?.times("1".toDouble()) ?: 0.0, 2
-                        )
-                        float_delisting_amount = this
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
-
-                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 {
-                        viewModel.slectfinancingData.bindOptional(context){
-                            if (float_delisting_amount.text.toString().isNullOrEmpty()){
-                                text = "--"
-                            }else{
-                                text = NumberUtils.roundNum(float_delisting_amount.text.toString().toDouble().times(it?.marginratio?.toDouble() ?: 0.0),2)
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                topMargin = autoSize(20)
+                                marginStart = autoSize(250)
+                                bottomMargin = autoSize(200)
                             }
                         }
-                        text = "--"
-                        performance_bond_amount = this
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(matchParent, autoSize(143))
-
-                textView {
-                    viewModel.usedAccountData.bindOptional(context) {
-                        text = "可用资金  " +  NumberUtils.roundNum(it?.canUserAmount.toString(), 2)
                     }
-                    textSizeAuto = 29
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent) {
-                    topMargin = autoSize(20)
-                    marginStart = autoSize(250)
-                }
 
-                verticalEmptyView()
 
-                linearLayout {
-                    background = resources.getDrawable(R.color.white)
-                    gravity = Gravity.CENTER_VERTICAL
-                    textView {
-                        onThrottleFirstClick {
-                            if (type == "1"){//仓单贸易
-                                if (pricetype == "1"){//一口价
-                                    viewModel.HdWRDealOrderReq(
-                                        pricetype = pricetype,
-                                        type = type,
-                                        data = data,
-                                        RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
-                                            ?: 0,
-                                        WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
-                                        OrderQty = onePriceInputNumberEdittext.text.toString()
-                                            .toLong(),
-                                        BuyOrSell = 0,
-                                        LadingBillId = 0,
-                                        SubNum = 0,
-                                        WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
-                                        DeliveryMonth = data.deliverymonth ?: "",
-                                        HasWr = 1,
-                                        IsFinancing = 1,
-                                        ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
-                                    ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
-                                        dialog.dismiss()
+                    linearLayout {
+                        background = resources.getDrawable(R.color.white)
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            onThrottleFirstClick {
+                                if (type == "1") {//仓单贸易
+                                    if (pricetype == "1") {//一口价
+                                        viewModel.HdWRDealOrderReq(
+                                            pricetype = pricetype,
+                                            type = type,
+                                            data = data,
+                                            RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
+                                                ?: 0,
+                                            WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
+                                            OrderQty = onePriceInputNumberEdittext.text.toString()
+                                                .toLong(),
+                                            BuyOrSell = 0,
+                                            LadingBillId = 0,
+                                            SubNum = 0,
+                                            WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                            DeliveryMonth = data.deliverymonth ?: "",
+                                            HasWr = 1,
+                                            IsFinancing = 1,
+                                            ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
+                                                ?: 0
+                                        ) {
+                                            viewModel.queryOneOrderQuote(
+                                                wrpricetype = pricetype,
+                                                haswr = if (type == "1") {
+                                                    "1"
+                                                } else {
+                                                    "0"
+                                                },
+                                                wrfactortypeid = data.wrfactortypeid ?: ""
+                                            )
+                                            dialog.dismiss()
+                                        }
+                                    } else {//浮动价
+                                        viewModel.HdWRDealOrderReq(
+                                            pricetype = pricetype,
+                                            type = type,
+                                            data = data,
+                                            RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
+                                                ?: 0,
+                                            WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
+                                            OrderQty = onePriceInputNumberEdittext.text.toString()
+                                                .toLong(),
+                                            BuyOrSell = 0,
+                                            LadingBillId = 0,
+                                            SubNum = 0,
+                                            WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                            DeliveryMonth = data.deliverymonth ?: "",
+                                            HasWr = 1,
+                                            IsFinancing = 1,
+                                            ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
+                                                ?: 0
+                                        ) {
+                                            viewModel.queryOneOrderQuote(
+                                                wrpricetype = pricetype,
+                                                haswr = if (type == "1") {
+                                                    "1"
+                                                } else {
+                                                    "0"
+                                                },
+                                                wrfactortypeid = data.wrfactortypeid ?: ""
+                                            )
+                                            dialog.dismiss()
+                                        }
                                     }
-                                }else{//浮动价
-                                    viewModel.HdWRDealOrderReq(
-                                        pricetype = pricetype,
-                                        type = type,
-                                        data = data,
-                                        RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
-                                            ?: 0,
-                                        WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
-                                        OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
-                                        BuyOrSell = 0,
-                                        LadingBillId = 0,
-                                        SubNum = 0,
-                                        WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
-                                        DeliveryMonth = data.deliverymonth ?: "",
-                                        HasWr = 1,
-                                        IsFinancing = 1,
-                                        ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
-                                    ) {
-                                        viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
-                                        dialog.dismiss()
+                                } else {//仓单预售
+                                    if (pricetype == "1") {//一口价
+                                        viewModel.HdWRDealOrderReq(
+                                            pricetype = pricetype,
+                                            type = type,
+                                            data = data,
+                                            RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
+                                                ?: 0,
+                                            WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
+                                            OrderQty = onePriceInputNumberEdittext.text.toString()
+                                                .toLong(),
+                                            BuyOrSell = 0,
+                                            LadingBillId = 0,
+                                            SubNum = 0,
+                                            WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                            DeliveryMonth = data.deliverymonth ?: "",
+                                            HasWr = 0,
+                                            IsFinancing = 1,
+                                            ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
+                                                ?: 0
+                                        ) {
+                                            viewModel.queryOneOrderQuote(
+                                                wrpricetype = pricetype,
+                                                haswr = if (type == "1") {
+                                                    "1"
+                                                } else {
+                                                    "0"
+                                                },
+                                                wrfactortypeid = data.wrfactortypeid ?: ""
+                                            )
+                                            dialog.dismiss()
+                                        }
+                                    } else {//浮动价
+                                        viewModel.HdWRDealOrderReq(
+                                            pricetype = pricetype,
+                                            type = type,
+                                            data = data,
+                                            RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
+                                                ?: 0,
+                                            WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
+                                            OrderQty = onePriceInputNumberEdittext.text.toString()
+                                                .toLong(),
+                                            BuyOrSell = 0,
+                                            LadingBillId = 0,
+                                            SubNum = 0,
+                                            WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                            DeliveryMonth = data.deliverymonth ?: "",
+                                            HasWr = 0,
+                                            IsFinancing = 1,
+                                            ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong()
+                                                ?: 0
+                                        ) {
+                                            viewModel.queryOneOrderQuote(
+                                                wrpricetype = pricetype,
+                                                haswr = if (type == "1") {
+                                                    "1"
+                                                } else {
+                                                    "0"
+                                                },
+                                                wrfactortypeid = data.wrfactortypeid ?: ""
+                                            )
+                                            dialog.dismiss()
+                                        }
                                     }
                                 }
-                            }else{//仓单预售
-                                 if (pricetype == "1"){//一口价
-                                     viewModel.HdWRDealOrderReq(
-                                         pricetype = pricetype,
-                                         type = type,
-                                         data = data,
-                                         RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
-                                             ?: 0,
-                                         WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
-                                         OrderQty = onePriceInputNumberEdittext.text.toString()
-                                             .toLong(),
-                                         BuyOrSell = 0,
-                                         LadingBillId = 0,
-                                         SubNum = 0,
-                                         WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
-                                         DeliveryMonth = data.deliverymonth ?: "",
-                                         HasWr = 0,
-                                         IsFinancing = 1,
-                                         ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
-                                     ) {
-                                         viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
-                                         dialog.dismiss()
-                                     }
-                                }else{//浮动价
-                                     viewModel.HdWRDealOrderReq(
-                                         pricetype = pricetype,
-                                         type = type,
-                                         data = data,
-                                         RelatedWRTradeOrderID = buyOrSelldata.wrtradeorderid?.toLong()
-                                             ?: 0,
-                                         WRTransferUserID = buyOrSelldata.userid?.toInt() ?: 0,
-                                         OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
-                                         BuyOrSell = 0,
-                                         LadingBillId = 0,
-                                         SubNum = 0,
-                                         WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
-                                         DeliveryMonth = data.deliverymonth ?: "",
-                                         HasWr = 0,
-                                         IsFinancing = 1,
-                                         ProductDetailID = viewModel.slectfinancingData.value?.productdetailid?.toLong() ?: 0
-                                     ) {
-                                         viewModel.queryOneOrderQuote(wrpricetype = pricetype,haswr = if (type == "1"){"1" }else{"0"},wrfactortypeid = data.wrfactortypeid ?: "")
-                                         dialog.dismiss()
-                                     }
-                                }
                             }
+                            gravity = Gravity.CENTER
+                            backgroundResource = R.drawable.qhj_main_blue_bg
+                            text = "买入"
+                            textSizeAuto = 38
+                            textColorInt = R.color.white
+                        }.lparams(autoSize(419), autoSize(119)) {
+                            marginStart = autoSize(24)
                         }
-                        gravity = Gravity.CENTER
-                        backgroundResource = R.drawable.qhj_main_blue_bg
-                        text = "买入"
-                        textSizeAuto = 38
-                        textColorInt = R.color.white
-                    }.lparams(autoSize(419), autoSize(119)) {
-                        marginStart = autoSize(24)
-                    }
 
-                    textView {
-                        onThrottleFirstClick {
-                            dialog.dismiss()
-                        }
-                        gravity = Gravity.CENTER
-                        backgroundResource = R.drawable.hnxt_cancel_bg
-                        text = "取消"
-                        textColorInt = R.color.white
-                        textSizeAuto = 38
-                    }.lparams(autoSize(419), autoSize(119)) {
-                        marginStart = autoSize(13)
+                        textView {
+                            onThrottleFirstClick {
+                                dialog.dismiss()
+                            }
+                            gravity = Gravity.CENTER
+                            backgroundResource = R.drawable.hnxt_cancel_bg
+                            text = "取消"
+                            textColorInt = R.color.white
+                            textSizeAuto = 38
+                        }.lparams(autoSize(419), autoSize(119)) {
+                            marginStart = autoSize(13)
+                        }
+                    }.lparams(matchParent, autoSize(144)) {
+                        gravity = Gravity.BOTTOM
                     }
-                }.lparams(matchParent, autoSize(144)) {
-                    gravity = Gravity.BOTTOM
-                }
+
+                }.lparams(matchParent, matchParent)
+
 
             }.lparams(matchParent, matchParent) {
                 topMargin = autoSize(120)

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

@@ -30,7 +30,7 @@ class PurchaseOrderViewModel : BaseViewModel(){
             if (data.trademode == 16 && data.goodsstatus == 3){
                 val deliveryRelationData = deliveryRelationList?.find { it?.goodsid == data.goodsid.toString() }
                 if (deliveryRelationData?.goodsid.isNullOrEmpty().not()){
-                    if (deliveryRelationData?.deliverytype == "1" || deliveryRelationData?.deliverytype == "3"){////交割模式 - 1:X交割 2:X+P交割 3:X+C交割 4:X+P+C交割  1,3为云融大宗的挂牌转让 2,4为云融大宗的基差点价
+                    if (deliveryRelationData?.deliverytype != "2" || deliveryRelationData.deliverytype != "4"){////交割模式 - 1:X交割 2:X+P交割 3:X+C交割 4:X+P+C交割  1,3为云融大宗的挂牌转让 2,4为云融大宗的基差点价
                         list.add(data)
                     }
                 }

+ 7 - 0
RMA/app/src/main/res/drawable/qhj_main_withdraw_blue_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/rma_blue_color"/>
+    <corners android:radius="45dp"
+       />
+</shape>

BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_friend_icon.png


BIN
RMA/app/src/main/res/mipmap-xhdpi/yrdz_performance_icon.png