Bladeren bron

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

Liu.bolan 4 jaren geleden
bovenliggende
commit
b16fdd4565
33 gewijzigde bestanden met toevoegingen van 2501 en 248 verwijderingen
  1. 2 0
      RMA/app/src/main/AndroidManifest.xml
  2. 33 60
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt
  3. 16 4
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt
  4. 39 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/StringUtils.kt
  5. 98 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrTradeBargainApplyData.kt
  6. 601 76
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/WarehouseTradeMI1.java
  7. 8 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  8. 10 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysViewModel.kt
  9. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/bookingwarehouse/BookingWarehouseActivity.kt
  10. 14 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/adapter/ContractDeliveryContentAdapter.java
  11. 5 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/contractorders/delivery/DeliveryActivity.kt
  12. 0 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/FriendViewHolder.kt
  13. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/MainFriendViewModel.kt
  14. 62 40
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendActivty.kt
  15. 31 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendListData.kt
  16. 67 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendViewHolder.kt
  17. 0 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceViewHolder.kt
  18. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewHolder.kt
  19. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewModel.kt
  20. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/SelectPerformanceTemplateActivity.kt
  21. 171 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseActivity.kt
  22. 91 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseViewModel.kt
  23. 222 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/TradeBarginContentAdapter.java
  24. 147 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainActivity.kt
  25. 230 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainContentAdapter.java
  26. 63 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainViewModel.kt
  27. 480 13
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt
  28. 14 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedViewModel.kt
  29. 14 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallViewModel.kt
  30. 10 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptViewModel.kt
  31. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/yrdzpurchase/delisting/PurchaseDelistingActivity.kt
  32. 6 0
      RMA/app/src/main/res/drawable/yrdz_check_select_backgrond.xml
  33. 25 0
      RMA/app/src/main/res/layout/spot_warehouse_layout_item_content.xml

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

@@ -443,6 +443,8 @@
         <activity android:name=".view.base.hnstmain.performancetemplate.AddPerformanceTempateActivity"/>
 
         <activity android:name=".view.base.hnstmain.performancetemplate.SelectPerformanceTemplateActivity"/>
+
+        <activity android:name=".view.base.hnstmain.contractorders.DeliveryDetailsActivity"/>
     </application>
 
 </manifest>

+ 33 - 60
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt

@@ -560,38 +560,41 @@ class WarehouseManager {
      * 持仓单挂单委托请求
      */
     fun HdWROrderReq(
-        LadingBillId: Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
-        TradeDate: String = "",//交易日
-        SubNum: Long = 0,// 提单子单号(wrholdlb的SubNum字段),卖的时候填写
-        WRFactorTypeId: Long = 0,//仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
-        UserID: Int = 0,//用户ID
-        AccountID: Long = 0,//资金账号
-        IsSpecified: Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs: List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
-        OrderQty: Long = 0,//委托数量(可挂部分数据量)
-        DeliveryGoodsID: Int = 0,//交割商品商品ID
-        WRPriceType: Int = 0,//价格方式
-        FixedPrice: Double = 0.0,//固定价格
-        WRTradeGoods: WarehouseTradeMI1.WRGoodsInfo,//仓单贸易商品配置集合(浮动价时填写)
-        PriceFactor: Double = 0.0,//价格系数(浮动价时填写)    -   [挂牌]
-        PriceMove: Double = 0.0,//升贴水(浮动价时填写)
-        TimevalidType: Int = 0,//时间有效类型
-        FirstRatio: Double = 0.0,//首付比例
-        PerformanceTemplateID: Long = 0,//履约计划模板ID
-        BuyOrSell: Int = 0,// 买卖方向
-        PriceDisplayMode: Int = 0,//浮动价显示方式
-        CanBargain: Int = 0,//挂牌是否可议价0:不可1:可-摘牌是否议价
-        Attachment1: String = "",//附件1
-        Attachment2: String = "",//附件2
-        Remark: String = "",//备注
-        ApplyID: Long = 0,//申请ID
-        CanPart: Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        LadingBillId : Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
+        TradeDate : String = "",//交易日
+        SubNum : Long = 0,// 提单子单号(wrholdlb的SubNum字段),卖的时候填写
+        WRFactorTypeId : Long = 0,//仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
+        UserID : Int = 0,//用户ID
+        AccountID : Long = 0,//资金账号
+        IsSpecified : Int = 0,//是否指定对手 0 不指定 1 指定
+        OrderQty : Long = 0,//委托数量(可挂部分数据量)
+        DeliveryGoodsID : Int = 0,//交割商品商品ID
+        WRPriceType : Int = 0,//价格方式
+        FixedPrice : Double = 0.0,//固定价格
+        WRTradeGoods : WarehouseTradeMI1.WRGoodsInfo,//仓单贸易商品配置集合(浮动价时填写)
+        PriceFactor : Double = 0.0,//价格系数(浮动价时填写)    -   [挂牌]
+        PriceMove : Double = 0.0,//升贴水(浮动价时填写)
+        TimevalidType : Int = 0,//时间有效类型
+        FirstRatio : Double = 0.0,//首付比例
+        PerformanceTemplateID : Long = 0,//履约计划模板ID
+        BuyOrSell : Int = 0,// 买卖方向
+        PriceDisplayMode : Int = 0,//浮动价显示方式
+        CanBargain : Int = 0,//挂牌是否可议价0:不可1:可-摘牌是否议价
+        Attachment1 : String = "",//附件1
+        Attachment2 : String = "",//附件2
+        Remark : String = "",//备注
+        ApplyID : Long = 0,//申请ID
+        CanPart : Int = 0,//是否允许部份摘牌0:不允许;1:允许
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         DeliveryMonth : String = "",//交收月
-        HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
-        WRStandardID: Int = 0,//现货品种ID
+        HasWr : Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        WRStandardID : Int = 0,//现货品种ID
         DelistMinQty : Long = 0,//起摘数量
         FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0,//是否全好友可见 0:否 1:是
         callback: (isCompleted: Boolean, err: Error?) -> Unit
     ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
@@ -599,37 +602,7 @@ class WarehouseManager {
             return
         }
         val reqPacket = WarehouseAdapter.getHdWROrderReqInfo(
-            LadingBillId,
-            TradeDate,
-            SubNum,
-            WRFactorTypeId,
-            UserID,
-            AccountID,
-            IsSpecified,
-            MatchAccIDs,
-            OrderQty,
-            DeliveryGoodsID,
-            WRPriceType,
-            FixedPrice,
-            WRTradeGoods,
-            PriceFactor,
-            PriceMove,
-            TimevalidType,
-            FirstRatio,
-            PerformanceTemplateID,
-            BuyOrSell,
-            PriceDisplayMode,
-            CanBargain,
-            Attachment1,
-            Attachment2,
-            Remark,
-            ApplyID,
-            CanPart,
-            DeliveryMonth,
-            HasWr,
-            WRStandardID,
-            DelistMinQty,
-            FactoryItems
+            LadingBillId, TradeDate, SubNum, WRFactorTypeId, UserID, AccountID, IsSpecified, OrderQty, DeliveryGoodsID, WRPriceType, FixedPrice, WRTradeGoods, PriceFactor, PriceMove, TimevalidType, FirstRatio, PerformanceTemplateID, BuyOrSell, PriceDisplayMode, CanBargain, Attachment1, Attachment2, Remark, ApplyID, CanPart, MatchAccIDsString, DeliveryMonth, HasWr, WRStandardID, DelistMinQty, FactoryItems, MarginFlag, MarginAlgorithm, MarginValue, AllFriendsFlag
         )
 
         tradeSocketManager.send(

+ 16 - 4
RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt

@@ -302,7 +302,6 @@ object WarehouseAdapter {
         UserID : Int = 0,//用户ID
         AccountID : Long = 0,//资金账号
         IsSpecified : Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs : List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         OrderQty : Long = 0,//委托数量(可挂部分数据量)
         DeliveryGoodsID : Int = 0,//交割商品商品ID
         WRPriceType : Int = 0,//价格方式
@@ -321,12 +320,16 @@ object WarehouseAdapter {
         Remark : String = "",//备注
         ApplyID : Long = 0,//申请ID
         CanPart : Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         DeliveryMonth : String = "",//交收月
         HasWr : Int = 0,//是否有仓单-0:没有仓单 1:有仓单
         WRStandardID : Int = 0,//现货品种ID
         DelistMinQty : Long = 0,//起摘数量
-        FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>//要素类型明细集合(没有仓单要素ID填写)
+        FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0//是否全好友可见 0:否 1:是
     ) : Packet50{
         val builder = WarehouseTradeMI1.HdWROrderReq.newBuilder()
         val loginInfo = GlobalDataCollection.instance?.loginRsp!!
@@ -340,6 +343,12 @@ object WarehouseAdapter {
                 17201
             )
         )
+        builder.marginFlag = MarginFlag
+        if (MarginFlag == 1){
+            builder.marginAlgorithm = MarginAlgorithm
+            builder.marginValue = MarginValue
+        }
+
         if (BuyOrSell == 1){//卖
             builder.ladingBillId = LadingBillId
             builder.subNum = SubNum
@@ -354,7 +363,10 @@ object WarehouseAdapter {
         builder.accountID = AccountID
         builder.isSpecified = IsSpecified
         if (IsSpecified == 1){
-            builder.addAllMatchAccIDs(MatchAccIDs)
+            builder.allFriendsFlag = AllFriendsFlag
+            if (AllFriendsFlag != 0){
+                builder.addAllMatchAccIDsString(MatchAccIDsString)
+            }
         }
         builder.orderQty = OrderQty
         builder.deliveryGoodsID = DeliveryGoodsID

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

@@ -28,6 +28,7 @@ fun String.isBlankString() : String{
     return this
 }
 
+
 fun String.colorType() : Int{
     if (this.isNullOrEmpty()){
         return R.color.rma_black_33
@@ -44,6 +45,44 @@ fun String.colorType() : Int{
 }
 
 /**
+ * 议价单申请状态 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+ * @receiver String
+ * @return String
+ */
+fun String.bargainapplystatus() : String{
+    if (this.isNullOrEmpty()){
+        return "--"
+    }
+    var str = ""
+    when {
+        this == "1" -> {
+            str = "待确认"
+        }
+        this == "2" -> {
+            str = "已确认"
+        }
+        this == "3" -> {
+            str = "已拒绝"
+        }
+        this == "4" -> {
+            str = "已撤销"
+        }
+        this == "5" -> {
+            str = "系统撤销"
+        }
+        this == "6" -> {
+            str = "处理失败"
+        }
+        this == "7" -> {
+            str = "确认中"
+        }
+    }
+
+    return str
+}
+
+
+/**
  * 金额数量不存在时显示0
  * @receiver String
  * @return String

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

@@ -22,6 +22,52 @@ data class WrTradeBargainApplyData(
     val applytime : String? = "",//申请时间
     @SerializedName("buyorsell")
     val buyorsell : String? = "",//买卖 - 0:买 1:卖
+    @SerializedName("deliverygoodscode")
+    val deliverygoodscode : String? = "",//品种代码
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//品种ID
+    @SerializedName("deliverygoodsname")
+    val deliverygoodsname : String? = "",//品种名称
+    @SerializedName("deliverymonth")
+    val deliverymonth : String? = "",//交收月
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//单位名称
+    @SerializedName("fixedprice")
+    val fixedprice : String? = "",//挂牌价格
+    @SerializedName("marginvalue")
+    val marginvalue : String? = "",//履约保证金比例
+    @SerializedName("matchaccountid")
+    val matchaccountid : String? = "",//挂牌方资金账号
+    @SerializedName("matchuserid")
+    val matchuserid : String? = "",//挂牌方用户id
+    @SerializedName("matchusername")
+    val matchusername : String? = "",//挂牌方用户名称(已脱敏)
+    @SerializedName("minivalue")
+    val minivalue : String? = "",//现货商品最小变动值
+    @SerializedName("optioncompare")
+    val optioncompare : String? = "",//选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+    @SerializedName("orderqty")
+    val orderqty : String? = "",//挂牌数量
+    @SerializedName("templatename")
+    val templatename : String? = "",//履约方式(履约模板名称)
+    @SerializedName("validtime")
+    val validtime : String? = "",//有效期限
+    @SerializedName("warehouseid")
+    val warehouseid : String? = "",//仓库ID
+    @SerializedName("warehousename")
+    val warehousename : String? = "",//仓库名称
+    @SerializedName("wrfactortypeid")
+    val wrfactortypeid : String? = "",//仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+    @SerializedName("wrfactortypename")
+    val wrfactortypename : String? = "",//仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+    @SerializedName("wrstandardcode")
+    val wrstandardcode : String? = "",//现货商品代码
+    @SerializedName("wrstandardid")
+    val wrstandardid : String? = "",//现货商品ID
+    @SerializedName("wrstandardname")
+    val wrstandardname : String? = "",//商品名称
+    @SerializedName("wrtypename")
+    val wrtypename : String? = "",//商品
     @SerializedName("confirmremark")
     val confirmremark:  String? = "",//确认备注
     @SerializedName("confirmtime")
@@ -45,7 +91,8 @@ data class WrTradeBargainApplyData(
     @SerializedName("wrbargainid")
     val wrbargainid : String? = "",//议价申请单ID(327+Unix秒时间戳(10位)+xxxxxx)
     @SerializedName("wrtradeorderid")
-    val wrtradeorderid : String? = ""//关联委托单ID
+    val wrtradeorderid : String? = "",//关联委托单ID
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -66,7 +113,31 @@ data class WrTradeBargainApplyData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
-        parcel.readString()
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList()
     ) {
     }
 
@@ -78,6 +149,29 @@ data class WrTradeBargainApplyData(
         parcel.writeString(applystatus)
         parcel.writeString(applytime)
         parcel.writeString(buyorsell)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(deliverymonth)
+        parcel.writeString(enumdicname)
+        parcel.writeString(fixedprice)
+        parcel.writeString(marginvalue)
+        parcel.writeString(matchaccountid)
+        parcel.writeString(matchuserid)
+        parcel.writeString(matchusername)
+        parcel.writeString(minivalue)
+        parcel.writeString(optioncompare)
+        parcel.writeString(orderqty)
+        parcel.writeString(templatename)
+        parcel.writeString(validtime)
+        parcel.writeString(warehouseid)
+        parcel.writeString(warehousename)
+        parcel.writeString(wrfactortypeid)
+        parcel.writeString(wrfactortypename)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+        parcel.writeString(wrtypename)
         parcel.writeString(confirmremark)
         parcel.writeString(confirmtime)
         parcel.writeString(confirmuserid)
@@ -90,6 +184,7 @@ data class WrTradeBargainApplyData(
         parcel.writeString(username)
         parcel.writeString(wrbargainid)
         parcel.writeString(wrtradeorderid)
+        parcel.writeStringList(rightData)
     }
 
     override fun describeContents(): Int {
@@ -106,4 +201,5 @@ data class WrTradeBargainApplyData(
         }
     }
 
+
 }

File diff suppressed because it is too large
+ 601 - 76
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/WarehouseTradeMI1.java


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

@@ -22,13 +22,13 @@ 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.118:8080/cfg?key=test_118"//黄老板 华南顺通 调试
 //    const val baseurl = "http://192.168.31.136:8080/cfg?key=test_136"//黄老板 华南顺通
 
 
@@ -302,6 +302,12 @@ object Constant {
 
     /** 云融大宗-现货仓单_挂单_议价单 **/
     const val table_mobile_hnst_xhcd_yjd = "table_mobile_hnst_xhcd_yjd"
+    /** 云融大宗-预售仓单_议价单 **/
+    const val table_mobile_hnst_yscd_yjd = "table_mobile_hnst_yscd_yjd"
+    /** 云融大宗-预售仓单_议价单-别人对我 **/
+    const val table_mobile_hnst_yscd_yjd_me = "table_mobile_hnst_yscd_yjd_me"
+    /** 云融大宗-预售仓单_议价单-我对别人 ***/
+    const val table_mobile_hnst_yscd_yjd_he = "table_mobile_hnst_yscd_yjd_he"
 
     /**--------------------------------------------------------------------------------------**/
 

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

@@ -157,7 +157,6 @@ class HnstcdysViewModel : BaseViewModel(){
         UserID: Int = 0,//用户ID
         AccountID: Long = 0,//资金账号
         IsSpecified: Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs: List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         OrderQty: Long = 0,//委托数量(可挂部分数据量)
         DeliveryGoodsID: Int = 0,//交割商品商品ID
         WRPriceType: Int = 0,//价格方式
@@ -176,17 +175,25 @@ class HnstcdysViewModel : BaseViewModel(){
         Remark: String = "",//备注
         ApplyID: Long = 0,//申请ID
         CanPart: Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         DeliveryMonth : String = "",//交收月
         HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
         DelistMinQty : Long = 0,//起摘数量
         WRStandardID: Int = 0,//现货品种ID
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0,//是否全好友可见 0:否 1:是
         FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()
         GlobalScope.launch {
             MyApplication.getInstance()?.warehouseManager?.HdWROrderReq(
+                MarginFlag = MarginFlag,
+                MarginAlgorithm = MarginAlgorithm,
+                MarginValue = MarginValue,
+                AllFriendsFlag = AllFriendsFlag,
                 LadingBillId = LadingBillId,
                 TradeDate = TradeDate,
                 AccountID = AccountID,
@@ -197,7 +204,7 @@ class HnstcdysViewModel : BaseViewModel(){
                 DeliveryGoodsID = DeliveryGoodsID,
                 WRFactorTypeId = WRFactorTypeId,
                 UserID = UserID,
-                MatchAccIDs = MatchAccIDs,
+                MatchAccIDsString = MatchAccIDsString,
                 WRPriceType = WRPriceType,
                 FixedPrice = FixedPrice,
                 WRTradeGoods = WRTradeGoods,

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

@@ -76,8 +76,8 @@ class BookingWarehouseActivity : BaseActivity<BookingWarehouseViewModel>(){
         newTabsArray.add("成交")
         uiList.add(bookingDealUI.root)
 
-        newTabsArray.add("指定成交")
-        uiList.add(bookingSpecifyDealUI.root)
+//        newTabsArray.add("指定成交")
+//        uiList.add(bookingSpecifyDealUI.root)
 
         newPagerAdapter = object : PagerAdapter() {
 
@@ -642,7 +642,7 @@ class BookingSpecifyDealUI(private val activity : AppCompatActivity,private val
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
-            viewModel.specifyDealTitle(Constant.table_mobile_hnst_yscd_zdcj)
+//            viewModel.specifyDealTitle(Constant.table_mobile_hnst_yscd_zdcj)
 //            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
             specifyDealcontentAdapter.setOnContentScrollListener(this@BookingSpecifyDealUI)
             linearLayout {

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

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.hnstmain.contractorders.adapter;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
+import android.content.Intent;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -15,6 +16,8 @@ import androidx.annotation.NonNull;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
+import com.blankj.utilcode.util.ActivityUtils;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -23,6 +26,8 @@ import cn.muchinfo.rma.global.data.ContractTradeOrderDetailData;
 import cn.muchinfo.rma.global.data.WrDeliveryDetailData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
 import cn.muchinfo.rma.view.base.hnstmain.contractorders.ContractOrdersViewModel;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.DeliveryDetailsActivity;
+import cn.muchinfo.rma.view.base.hnstmain.contractorders.transfer.ContractTransferActivity;
 import cn.muchinfo.rma.view.base.hnstmain.finance.FinanceManagementViewModel;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
@@ -115,15 +120,16 @@ public class ContractDeliveryContentAdapter extends RecyclerView.Adapter<Contrac
         });
 
 
-        itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
-
-        //撤单
-        itemViewHolder.invoice_register.setOnClickListener(view -> {
+        itemViewHolder.spot_details.setVisibility(View.VISIBLE);
 
+        //明细
+        itemViewHolder.spot_details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data", data);
+            intent.setClass(context, DeliveryDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
         });
 
-
-
         itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
             @Override
             public void onEvent(MotionEvent event) {
@@ -160,6 +166,7 @@ public class ContractDeliveryContentAdapter extends RecyclerView.Adapter<Contrac
         LinearLayout roots_view;//根部布局
         TextView details;//详情
         TextView invoice_register;//撤单
+        TextView spot_details;
         ImageView load_more;//更多
         LinearLayout allView;//隐藏的底部操作空间
         LinearLayout all_click_View;//item左侧点击控件
@@ -179,6 +186,7 @@ public class ContractDeliveryContentAdapter extends RecyclerView.Adapter<Contrac
 
         public ItemViewHolder(@NonNull View itemView) {
             super(itemView);
+            spot_details = itemView.findViewById(R.id.spot_details);
             details = itemView.findViewById(R.id.details);
             load_more = itemView.findViewById(R.id.load_more);
             tvLeftTitle = itemView.findViewById(R.id.tv_left_title);

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

@@ -416,7 +416,11 @@ class DeliveryActivity : BaseActivity<DeliveryViewModel>(){
                                         //总升贴水
                                         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)
+                                        if (deliveryRelationData?.ppricemode == "1"){
+                                            text = NumberUtils.roundNum((pNumberBand?.times(viewModel.quoteDayData.value?.getDeliveryPrice() ?: 1.0))?.plus(allPricemove ?: 0.0)?.toString(),2)
+                                        }else{
+                                            text = NumberUtils.roundNum((pNumberBand?.times(deliveryRelationData?.pdeliveryprice?.toDouble() ?: 0.0))?.plus(allPricemove ?: 0.0)?.toString(),2)
+                                        }
                                     }
                                 }
                                 textSizeAuto = 34

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

@@ -33,8 +33,6 @@ class FriendViewHolder(private val activity : AppCompatActivity,private val view
                     if (data.value?.isfriend == "1"){//只有是我的好友时才可以点击
                         viewModel.setOnItemClick(userid = data.value?.userid ?: "")
                     }
-                }else{//选择朋友时的点击
-
                 }
 
             }

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

@@ -30,6 +30,16 @@ class MainFriendViewModel : BaseViewModel(){
      */
     val showSelectFriendDataList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
 
+    fun getSlectFriendData() : SelectFriendListData{
+        val selectFriendData = arrayListOf<WrUserFriendData>()
+        showSelectFriendDataList.value?.forEach {
+            if (it.isClick == 1){
+                selectFriendData.add(it)
+            }
+        }
+        return SelectFriendListData(selectFriendList = selectFriendData)
+    }
+
 
     /**
      * 通过输入内容进行列表的筛选
@@ -67,6 +77,23 @@ class MainFriendViewModel : BaseViewModel(){
     }
 
     /**
+     * 我的朋友选择的item的点击事件
+     */
+    fun setSelectOnItemClick(userid : String){
+        val newFriendDataList = arrayListOf<WrUserFriendData>()
+        friendDataList.value?.forEach {
+            if (it.userid == userid){
+                if (it.isClick == 1){
+                    newFriendDataList.add(it.copy(isClick = 0))
+                }else{
+                    newFriendDataList.add(it.copy(isClick = 1))
+                }
+            }
+        }
+        friendDataList.postValue(newFriendDataList)
+    }
+
+    /**
      * 我的朋友的item的点击事件
      */
     fun setOnItemClick(userid : String){

+ 62 - 40
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/friend/SelectFriendActivty.kt

@@ -26,12 +26,11 @@ class SelectFriendActivty : BaseActivity<MainFriendViewModel>(){
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
 
-    private val friendAdapter: BaseAdapter<WrUserFriendData, FriendViewHolder> =
+    private val friendAdapter: BaseAdapter<WrUserFriendData, SelectFriendViewHolder> =
         BaseAdapter { _, _ ->
-            FriendViewHolder(
+            SelectFriendViewHolder(
                 this,
-                viewModel,
-                "2"
+                viewModel
             )
         }
 
@@ -85,48 +84,71 @@ class SelectFriendActivty : BaseActivity<MainFriendViewModel>(){
                 topMargin = autoSize(36)
             }
 
+            frameLayout {
+                verticalLayout {
+                    statusLayout(contentBlock = {
+                        statusLayout = this
+                        setRetryAction {
 
-            statusLayout(contentBlock = {
-                statusLayout = this
-                setRetryAction {
+                        }
+                        swipeToLoadLayout {
+                            swipeToLayout = this
+                            setEnableRefresh(true)
+                            setEnableLoadMore(false)
+                            setOnRefreshListener {
+                                viewModel.queryWrUserFriend(friendUserid = input_userid.text.toString())
+                            }
+                            setEnableScrollContentWhenLoaded(false)
+                            setEnableLoadMoreWhenContentNotFull(false)
+                            // 未提交列表
+                            recyclerView {
+                                background = resources.getDrawable(R.color.white)
+                                adapter = friendAdapter
+                            }.lparams(matchParent, matchParent)
+                        }
+                    }, emptyBlock = {
+                        emptyView(hint = resources.getString(R.string.now_no_data))
+                    }).lparams(matchParent, matchParent)
 
-                }
-                swipeToLoadLayout {
-                    swipeToLayout = this
-                    setEnableRefresh(true)
-                    setEnableLoadMore(false)
-                    setOnRefreshListener {
-                        viewModel.queryWrUserFriend(friendUserid = input_userid.text.toString())
+                    viewModel.showSelectFriendDataList.bindOptional(context) {
+                        if (it?.isEmpty() == true || it?.size == 0) {
+                            statusLayout.showEmpty()
+                        } else {
+                            if (swipeToLayout.getIsRefreshing()) {
+                                swipeToLayout.finishRefresh()
+                            }
+                            statusLayout.showSuccess()
+                            friendAdapter.setNewData(it)
+                        }
                     }
-                    setEnableScrollContentWhenLoaded(false)
-                    setEnableLoadMoreWhenContentNotFull(false)
-                    // 未提交列表
-                    recyclerView {
-                        background = resources.getDrawable(R.color.white)
-                        adapter = friendAdapter
-                    }.lparams(matchParent, matchParent)
                 }
-            }, emptyBlock = {
-                emptyView(hint = resources.getString(R.string.now_no_data))
-            }).lparams(matchParent, matchParent)
-
-            viewModel.showSelectFriendDataList.bindOptional(context) {
-                if (it?.isEmpty() == true || it?.size == 0) {
-                    statusLayout.showEmpty()
-                } else {
-                    if (swipeToLayout.getIsRefreshing()) {
-                        swipeToLayout.finishRefresh()
+
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        onThrottleFirstClick {
+                            val intent = Intent()
+                            intent.putExtra("datalist",viewModel.getSlectFriendData())
+                            setResult(1001, intent)
+                            finish()
+                        }
+                        gravity = Gravity.CENTER
+                        backgroundResource = R.mipmap.rma_submit_bg
+                        text = "提交"
+                        textSizeAuto = 38
+                        textColorInt = R.color.white
+                    }.lparams(0, autoSize(119), 1f) {
+                        marginStart = autoSize(59)
+                        marginEnd = autoSize(59)
                     }
-                    statusLayout.showSuccess()
-                    friendAdapter.setNewData(it)
+
+                }.lparams(matchParent, autoSize(144)) {
+                    gravity = Gravity.BOTTOM
                 }
-            }
-            friendAdapter.setOnItemClickListener { adapter, view, position ->
-                val intent = Intent()
-                intent.putExtra("maildata",viewModel.showSelectFriendDataList.value?.get(position))
-                setResult(1001, intent)
-                finish()
-            }
+            }.lparams(matchParent, matchParent)
+
+
         }
     }
 

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

@@ -0,0 +1,31 @@
+package cn.muchinfo.rma.view.base.hnstmain.friend
+
+import android.os.Parcel
+import android.os.Parcelable
+import cn.muchinfo.rma.global.data.WrUserFriendData
+
+data class SelectFriendListData(
+    var selectFriendList : List<WrUserFriendData>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(parcel.createTypedArrayList(WrUserFriendData)) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeTypedList(selectFriendList)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<SelectFriendListData> {
+        override fun createFromParcel(parcel: Parcel): SelectFriendListData {
+            return SelectFriendListData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<SelectFriendListData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,67 @@
+package cn.muchinfo.rma.view.base.hnstmain.friend
+
+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.WrUserFriendData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class SelectFriendViewHolder(private val activity : AppCompatActivity, private val viewModel: MainFriendViewModel) : BaseViewHolder<WrUserFriendData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            onThrottleFirstClick {
+               viewModel.setSelectOnItemClick(userid = data.value?.userid ?: "")
+            }
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+
+                imageView {
+                    data.bindOptional(context){
+                        if (it?.isClick == 1){
+                            imageResource = R.mipmap.yrdz_delivery_select_icon
+                        }else{
+                            imageResource = R.mipmap.yrdz_delivery_normal_icon
+                        }
+                    }
+                }.lparams(autoSize(43), autoSize(43))
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.frienduserid
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_blue_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.friendname
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+            }.lparams(matchParent, autoSize(144))
+
+            itemView()
+        }
+    }
+
+}

+ 0 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/AddPerformanceViewHolder.kt

@@ -37,9 +37,6 @@ class AddPerformanceViewHolder(private val activity : AppCompatActivity,private
                         }
                     }
                     textView {
-                        data.bindOptional(context){
-                            text = it?.steptypename
-                        }
                         stepname = this
                         text = "请选择步骤"
                         textSizeAuto = 29

+ 6 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewHolder.kt

@@ -36,7 +36,12 @@ class PerformanceTemplateViewHolder(private val activity : AppCompatActivity,pri
     override fun _FrameLayout.createContentView() {
         verticalLayout {
            onThrottleFirstClick {
-               viewModel.setOnItemClick(autoid = data.value?.autoid ?: "")
+               if (type == "1"){
+                   viewModel.setOnItemClick(autoid = data.value?.autoid ?: "")
+               }else{
+                   viewModel.selectPerformaceData.postValue(data.value)
+               }
+
            }
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/performancetemplate/PerformanceTemplateViewModel.kt

@@ -36,6 +36,8 @@ class PerformanceTemplateViewModel : BaseViewModel(){
      */
     val wrPerformanceStepTypeDataList : MutableLiveData<List<WrPerformanceStepTypeData>> = MutableLiveData()
 
+    val selectPerformaceData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
+
     /**
      * 新增修改时的viewholder数据
      */

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

@@ -75,12 +75,13 @@ class SelectPerformanceTemplateActivity : BaseActivity<PerformanceTemplateViewMo
                     performanceTemplateAdapter.setNewData(it)
                 }
             }
-            performanceTemplateAdapter.setOnItemClickListener { adapter, view, position ->
+            viewModel.selectPerformaceData.bindOptional(context){
                 val intent = Intent()
-                intent.putExtra("data",viewModel.permancePlanTmpDataList.value?.get(position))
+                intent.putExtra("data",it)
                 setResult(1005, intent)
                 finish()
             }
+
         }
     }
 

+ 171 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseActivity.kt

@@ -62,6 +62,9 @@ class SpotWareHouseActivity : BaseActivity<SpotWareHouseViewModel>(){
     //挂单UI
     private val areCancelledUI by lazy { AreCancelledUI(this,viewModel) }
 
+    //议价
+    private val bargainUI by lazy { BargainUI(this,viewModel) }
+
     //成交UI
     private val dealUI by lazy { DealUI(this,viewModel) }
 
@@ -94,11 +97,14 @@ class SpotWareHouseActivity : BaseActivity<SpotWareHouseViewModel>(){
         newTabsArray.add("挂单")
         uiList.add(areCancelledUI.root)
 
+        newTabsArray.add("议价")
+        uiList.add(bargainUI.root)
+
         newTabsArray.add("成交")
         uiList.add(dealUI.root)
 
-        newTabsArray.add("指定成交")
-        uiList.add(specifyDealUI.root)
+//        newTabsArray.add("指定成交")
+//        uiList.add(specifyDealUI.root)
 
         newTabsArray.add("提货")
         uiList.add(pickUpUI.root)
@@ -793,6 +799,165 @@ class AreCancelledUI(private val activity : AppCompatActivity,private val viewMo
 }
 
 
+/**
+ * 议价UI
+ * @property activity AppCompatActivity
+ * @property viewModel SpotWareHouseViewModel
+ * @constructor
+ */
+class BargainUI(private val activity : AppCompatActivity,private val viewModel: SpotWareHouseViewModel)  : TradeBarginContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val tradeBarginContentAdapter by lazy {
+        TradeBarginContentAdapter(
+            activity,viewModel
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    @RequiresApi(Build.VERSION_CODES.N)
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+            viewModel.showCancelBargainDialog.bindOptional(context){
+                if (it == true){
+                    activity.createWarningDialog {
+                        setTitle("温馨提示")
+                        setMessage("确定撤销此议价单吗?")
+                        addAction("取消") { dialog, _ ->
+                            viewModel.showCancelDialog.postValue(false)
+                            dialog.dismiss()
+                        }
+                        addAction("确定") { dialog, _ ->
+                            val data1 = viewModel.selectCancelBargainData.value
+
+                            viewModel.showCancelBargainDialog.postValue(false)
+                            dialog.dismiss()
+                        }
+                    }.show()
+                }
+            }
+            viewModel.specifyBargainTitle(Constant.table_mobile_hnst_xhcd_yjd)
+//            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
+            tradeBarginContentAdapter.setOnContentScrollListener(this@BargainUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.bargainTitle.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(250), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                        tradeBarginContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<TradeBarginContentAdapter.ItemViewHolder> =
+                            tradeBarginContentAdapter.viewHolderCacheList
+
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.bargainTitle.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryAreCancelWrPosition()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    recyclerView {//待点价列表
+                        background = resources.getDrawable(R.color.white)
+                        adapter = tradeBarginContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<TradeBarginContentAdapter.ItemViewHolder> =
+                                    tradeBarginContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            tradeBarginContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.bargainContentDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                    }
+                    statusLayout.showSuccess()
+                    tradeBarginContentAdapter.setDatas(it)
+                }
+            }
+        }
+    }
+
+}
+
+
 
 /**
  * 成交UI
@@ -967,7 +1132,7 @@ class SpecifyDealUI(private val activity : AppCompatActivity,private val viewMod
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
-            viewModel.specifyDealTitle(Constant.table_mobile_hnst_xhcd_zdcj)
+//            viewModel.specifyDealTitle(Constant.table_mobile_hnst_xhcd_zdcj)
 //            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
             specifyDealcontentAdapter.setOnContentScrollListener(this@SpecifyDealUI)
             linearLayout {
@@ -1261,3 +1426,6 @@ class PickUpUI(private val activity : AppCompatActivity,private val viewModel: S
     }
 
 }
+
+
+class BargainingUI()

+ 91 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseViewModel.kt

@@ -1,11 +1,8 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.*
 import cn.muchinfo.rma.global.data.*
-import cn.muchinfo.rma.global.isBlankString
-import cn.muchinfo.rma.global.pickupapplystatus
-import cn.muchinfo.rma.global.wrtradeorderstatus
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
@@ -96,6 +93,23 @@ class SpotWareHouseViewModel : BaseViewModel(){
     val selectCancelData : MutableLiveData<WrOrderDetailData> = MutableLiveData()
 
     /**
+     * 是否弹出撤单弹窗
+     */
+    val showCancelBargainDialog : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
+    //点击撤单时选择的撤单实体
+    val selectCancelBargainData : MutableLiveData<WrTradeBargainApplyData> = MutableLiveData()
+
+    /**
+     * 议价头部数据
+     */
+    val bargainTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 议价内容数据
+     */
+    val bargainContentDataList: MutableLiveData<List<WrTradeBargainApplyData>> = MutableLiveData()
+
+    /**
      * 提货单的头部数据
      */
     val pickUpTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
@@ -120,6 +134,79 @@ class SpotWareHouseViewModel : BaseViewModel(){
     val selectPickUpgoodsData : MutableLiveData<WrOutInApplyData> = MutableLiveData()
 
 
+    //-----------------议价------------------
+    /**
+     * 查询现货仓单-议价头部数据
+     */
+    fun specifyBargainTitle(tableKey: String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                bargainTitle.postValue(newlist)
+                querySpecifyBargainPosition()
+            }
+        }
+    }
+
+    /**
+     * 查询议价单
+     */
+    fun querySpecifyBargainPosition(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.warehouseManager?.queryWrTradeBargainApply(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                bargainContentDataList.postValue(getquerySpecifyBargainPositionRightData(respData ?: arrayListOf()))
+            }
+        }
+    }
+
+    /**
+     * 议价单组装右侧数据
+     */
+    fun getquerySpecifyBargainPositionRightData(respData: List<WrTradeBargainApplyData>) : List<WrTradeBargainApplyData>{
+        val newList = arrayListOf<WrTradeBargainApplyData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //挂牌方
+            newRightData.add(it.matchusername ?: "-")
+            //仓库
+            newRightData.add(it.warehousename ?: "-")
+            //挂牌类型
+            newRightData.add("-")
+            //挂牌价格
+            newRightData.add(it.fixedprice ?: "-")
+            //挂牌数量
+            newRightData.add(it.orderqty ?: "-")
+            //挂牌有效期
+            newRightData.add(it.validtime ?: "-")
+            //履约保证金
+            newRightData.add(it.marginvalue?.toPercentage() ?: "-")
+            //履约方式
+            newRightData.add(it.templatename ?: "-")
+            //最新议价价格
+            newRightData.add("-")
+            //最新议价数量
+            newRightData.add("-")
+            //最新议价时间
+            newRightData.add("-")
+            //最新议价状态
+            newRightData.add("-")
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
     //-----------------提货------------------
     /**
      * 查询现货仓单-提货头部数据

+ 222 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/TradeBarginContentAdapter.java

@@ -0,0 +1,222 @@
+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;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.blankj.utilcode.util.ActivityUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.WrOrderDetailData;
+import cn.muchinfo.rma.global.data.WrTradeBargainApplyData;
+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.hnstmain.spotwarehouse.bargain.BargainActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 现货仓单-议价adapter
+ */
+public class TradeBarginContentAdapter extends RecyclerView.Adapter<TradeBarginContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<WrTradeBargainApplyData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    private SpotWareHouseViewModel viewModel;
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    //1是现货汇总,2是库存汇总
+    private String type;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public TradeBarginContentAdapter(Context context, SpotWareHouseViewModel viewModel) {
+        this.viewModel = viewModel;
+        this.context = context;
+    }
+
+    public void setDatas(List<WrTradeBargainApplyData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.spot_warehouse_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        WrTradeBargainApplyData data = datas.get(i);
+        itemViewHolder.tvLeftTitle.setText(data.getDeliverygoodsname());
+        itemViewHolder.tv_left_bottom_title.setText(data.getWrtypename());
+//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+                    setPosition(i);
+
+            }
+        });
+
+        itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+        itemViewHolder.bargain.setVisibility(View.VISIBLE);
+
+        itemViewHolder.bargain.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("data",data);
+            intent.setClass(context, BargainActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
+
+        //撤单
+        itemViewHolder.invoice_register.setOnClickListener(view -> {
+//            viewModel.getShowCancelDialog().postValue(true);
+//            viewModel.getSelectCancelData().postValue(data);
+        });
+
+        itemViewHolder.load_more.setOnClickListener(view -> {
+
+        });
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView details;//详情
+        TextView invoice_register;//撤单
+        TextView midpoints_registration;
+        TextView settlement_of_registration;
+        TextView payment_registration;
+        TextView bargain;//议价单
+        TextView warehouse_register;//挂牌
+        TextView fanacel_register;//提货
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            details = itemView.findViewById(R.id.details);
+            bargain = itemView.findViewById(R.id.bargain);
+            midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
+            settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
+            payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            fanacel_register = itemView.findViewById(R.id.fanacel_register);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 147 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainActivity.kt

@@ -1,22 +1,53 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.bargain
 
 import android.os.Bundle
+import android.view.Gravity
+import android.view.MotionEvent
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.WrOrderDetailData
-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.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
-import org.jetbrains.anko.verticalLayout
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.adapter.PickUpContentAdapter
+import cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.adapter.SpecifyDealContentAdapter
+import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
+import org.jetbrains.anko.*
 
 /**
  * 议价单页面
  */
-class BargainActivity : BaseActivity<BargainViewModel>(){
+class BargainActivity : BaseActivity<BargainViewModel>() ,BargainContentAdapter.OnContentScrollListener {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
 
 
     //传入的挂单数据
     val data by lazy { intent.getParcelableExtra<WrOrderDetailData>("data") as WrOrderDetailData }
 
+    //1是别人对我议价单  2是我对别人的议价单
+    val type by lazy { intent.getStringExtra("type") }
+
+    val topAdapter by lazy {
+        TopTabAdpater(this)
+    }
+
+    val bargainContentAdapter by lazy {
+        BargainContentAdapter(
+            this,viewModel,type
+        )
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
@@ -27,6 +58,117 @@ class BargainActivity : BaseActivity<BargainViewModel>(){
                 }
             }
 
+            verticalLayout {
+                if (type == "1"){
+                    viewModel.specifyDealTitle(Constant.table_mobile_hnst_yscd_yjd_me,data.wrtradeorderid ?: "",type ?: "")
+                }else{
+                    viewModel.specifyDealTitle(Constant.table_mobile_hnst_yscd_yjd_he,data.wrtradeorderid ?: "",type ?: "")
+                }
+
+//            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
+                bargainContentAdapter.setOnContentScrollListener(this@BargainActivity)
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                        textView {//待点价头部左侧数据
+                            viewModel.wrTradeBargainApplyTitleList.bindOptional(context) {
+                                text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                            }
+                            textColorStr = "#AAAAAA"
+                            textSizeAuto = 24
+                        }.lparams(wrapContent, wrapContent) {
+                            marginStart = autoSize(30)
+                        }
+                    }.lparams(autoSize(250), autoSize(100))
+
+                    inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                        horScrollview = this
+                        setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
+                            bargainContentAdapter.offestX = scrollX
+                            val viewHolderCacheList: List<BargainContentAdapter.ItemViewHolder> =
+                                bargainContentAdapter.viewHolderCacheList
+
+                            if (null != viewHolderCacheList) {
+                                val size = viewHolderCacheList.size
+                                for (i in 0 until size) {
+                                    viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                        scrollX,
+                                        0
+                                    )
+                                }
+                            }
+                        }
+                        relativeLayout {
+                            recyclerView {//待点价头部右侧数据
+                                val linearLayoutManager = LinearLayoutManager(context)
+                                linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                                layoutManager = linearLayoutManager
+                                background = resources.getDrawable(R.color.white)
+                                adapter = topAdapter
+                            }
+                            viewModel.wrTradeBargainApplyTitleList.bindOptional(context) {
+                                val titleStringList = arrayListOf<String>()
+                                it?.subList(1, it.size)?.forEach { data ->
+                                    titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                                }
+                                topAdapter.setDatas(titleStringList)
+                            }
+                        }
+                    }.lparams(matchParent, matchParent)
+                }.lparams(matchParent, autoSize(100))
+
+                statusLayout(contentBlock = {
+                    statusLayout = this
+                    swipeToLoadLayout {
+                        swipeToLayout = this
+                        setEnableRefresh(false)
+                        setEnableLoadMore(true)
+                        setOnRefreshListener {
+
+                        }
+                        setEnableScrollContentWhenLoaded(false)
+                        setEnableLoadMoreWhenContentNotFull(false)
+
+                        recyclerView {//待点价列表
+                            background = resources.getDrawable(R.color.white)
+                            adapter = bargainContentAdapter
+                            addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                                override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                    super.onScrolled(recyclerView, dx, dy)
+                                    val viewHolderCacheList: List<BargainContentAdapter.ItemViewHolder> =
+                                        bargainContentAdapter.viewHolderCacheList
+                                    if (null != viewHolderCacheList) {
+                                        val size = viewHolderCacheList.size
+                                        for (i in 0 until size) {
+                                            viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                                bargainContentAdapter.getOffestX(),
+                                                0
+                                            )
+                                        }
+                                    }
+                                }
+                            })
+                        }
+
+
+                    }
+                }, emptyBlock = {
+                    emptyView(hint = resources.getString(R.string.now_no_data))
+                }).lparams(matchParent, matchParent)
+
+                viewModel.wrTradeBargainApplyDataList.bindOptional(context) {
+                    if (it?.isEmpty() == true || it?.size == 0) {
+                        statusLayout.showEmpty()
+                    } else {
+                        if (swipeToLayout.getIsRefreshing()) {
+                            swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                        }
+                        statusLayout.showSuccess()
+                        bargainContentAdapter.setDatas(it)
+                    }
+                }
+            }
 
         }
     }

+ 230 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainContentAdapter.java

@@ -0,0 +1,230 @@
+package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.bargain;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.blankj.utilcode.util.ActivityUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.WrOrderDetailData;
+import cn.muchinfo.rma.global.data.WrTradeBargainApplyData;
+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;
+
+/**
+ * 现货仓单-挂单adapter
+ */
+public class BargainContentAdapter extends RecyclerView.Adapter<BargainContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<WrTradeBargainApplyData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    private BargainViewModel viewModel;
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    //1别人对我的议价单,2我对别人的议价单
+    private String type;
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public BargainContentAdapter(Context context, BargainViewModel viewModel,String type) {
+        this.viewModel = viewModel;
+        this.type = type;
+        this.context = context;
+    }
+
+    public void setDatas(List<WrTradeBargainApplyData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.spot_warehouse_layout_item_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        WrTradeBargainApplyData data = datas.get(i);
+        if (type.equals("1")){
+            itemViewHolder.tvLeftTitle.setText(data.getUsername());
+            itemViewHolder.tv_left_bottom_title.setText(data.getUserid());
+        }else {
+            itemViewHolder.tvLeftTitle.setText(data.getApplyqty());
+            itemViewHolder.tv_left_bottom_title.setVisibility(View.GONE);
+        }
+
+//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+        itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+
+        if (type.equals("1")){//别人对我的议价单 可确认可拒绝
+            itemViewHolder.refused.setVisibility(View.VISIBLE);
+            itemViewHolder.confirm.setVisibility(View.VISIBLE);
+        }else {//我对别人的议价单
+            itemViewHolder.midpoints_registration.setVisibility(View.GONE);
+        }
+
+        //我对别人的议价单撤销
+        itemViewHolder.midpoints_registration.setOnClickListener(view -> {
+
+        });
+
+        //确认
+        itemViewHolder.confirm.setOnClickListener(view -> {
+
+        });
+        //拒绝
+        itemViewHolder.refused.setOnClickListener(view -> {
+
+        });
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView details;//详情
+        TextView invoice_register;//撤单
+        TextView refused;//议价单拒绝按钮
+        TextView confirm;//议价单确认按钮
+        TextView midpoints_registration;
+        TextView settlement_of_registration;
+        TextView payment_registration;
+        TextView bargain;//议价单
+        TextView warehouse_register;//挂牌
+        TextView fanacel_register;//提货
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            refused = itemView.findViewById(R.id.refused);
+            confirm = itemView.findViewById(R.id.confirm);
+            details = itemView.findViewById(R.id.details);
+            bargain = itemView.findViewById(R.id.bargain);
+            midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
+            settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
+            payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            fanacel_register = itemView.findViewById(R.id.fanacel_register);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 63 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/bargain/BargainViewModel.kt

@@ -1,8 +1,14 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.bargain
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.bargainapplystatus
 import cn.muchinfo.rma.global.data.ColumnsData
+import cn.muchinfo.rma.global.data.WrSpecialMatchOrderData
 import cn.muchinfo.rma.global.data.WrTradeBargainApplyData
+import cn.muchinfo.rma.global.isBlankString
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseViewModel
 
 /**
@@ -20,4 +26,61 @@ class BargainViewModel : BaseViewModel(){
      */
     val wrTradeBargainApplyDataList : MutableLiveData<List<WrTradeBargainApplyData>> = MutableLiveData()
 
+
+    /**
+     * 查询现货仓单-指定成交头部数据
+     */
+    fun specifyDealTitle(tableKey: String,wrtradeorderid : String,type : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                wrTradeBargainApplyTitleList.postValue(newlist)
+                queryWrTradeBargainApply(wrtradeorderid, type)
+            }
+        }
+    }
+
+
+    fun queryWrTradeBargainApply(wrtradeorderid : String,type : String){
+        val params = mutableMapOf<String,String>().apply {
+            put("wrtradeorderid",wrtradeorderid)
+        }
+        MyApplication.getInstance()?.warehouseManager?.queryWrTradeBargainApply(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                wrTradeBargainApplyDataList.postValue(getqueryWrTradeBargainApplyRightData(respData ?: arrayListOf(),type))
+            }
+        }
+    }
+    /**
+     * 指定成交组装右侧数据
+     */
+    fun getqueryWrTradeBargainApplyRightData(respData: List<WrTradeBargainApplyData>,type : String) : List<WrTradeBargainApplyData>{
+        val newList = arrayListOf<WrTradeBargainApplyData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            if (type == "1"){
+                //数量
+                newRightData.add(it.applyqty?.isBlankString() ?: "-")
+            }
+            //价格
+            newRightData.add(it.applyprice?.isBlankString() ?: "-")
+            //时间
+            newRightData.add(it.applytime?.isBlankString() ?: "-")
+            //状态
+            newRightData.add(it.applytime?.bargainapplystatus() ?: "-")
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+
+
 }

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

@@ -1,12 +1,14 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed
 
 import android.annotation.SuppressLint
+import android.content.Intent
 import android.graphics.Color
 import android.os.Build
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
 import android.view.inputmethod.EditorInfo
+import android.widget.CheckBox
 import android.widget.EditText
 import android.widget.SeekBar
 import android.widget.TextView
@@ -15,8 +17,7 @@ import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.MTPEnums
-import cn.muchinfo.rma.global.data.HnstWrPositionData
-import cn.muchinfo.rma.global.data.HoldLBData
+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.global.utils.TimeUtils
@@ -31,8 +32,12 @@ import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
 import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText3
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.hnstmain.friend.SelectFriendActivty
+import cn.muchinfo.rma.view.base.hnstmain.friend.SelectFriendListData
+import cn.muchinfo.rma.view.base.hnstmain.performancetemplate.SelectPerformanceTemplateActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.viewItemUI
+import cn.muchinfo.rma.view.base.main.addressmanagement.AddressSelectActivity
 import cn.muchinfo.rma.view.base.main.castsurely.JsonBean
 import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
 import com.blankj.utilcode.util.LogUtils
@@ -105,6 +110,16 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     //挂牌价格输入
     lateinit var onePriceInputEdittext: MangeNumberEditText2
 
+    //------------贸易圈时多余的内容-----------
+    //履约保证金
+    lateinit var performance_bond : EditText
+    //挂牌有效期
+    lateinit var validity_of_listing: TextView
+    //选择的履约模版数据
+    val selectPerformanceStepData : MutableLiveData<PermancePlanTmpData> = MutableLiveData()
+    //选择的朋友列表
+    val selectFriendList : MutableLiveData<List<WrUserFriendData>> = MutableLiveData()
+
     /**
      * 本页面选择的挂牌方式
      */
@@ -126,6 +141,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     //浮动价挂牌金额
     val listed_price: MutableLiveData<Double> = MutableLiveData()
 
+    /**
+     * 是否可议价的选择
+     */
+    lateinit var can_be_negotiation : CheckBox
+
+    /**
+     * 是否整单
+     */
+    lateinit var whole_list : CheckBox
+
+    /**
+     * 朋友是否不限
+     */
+    lateinit var no_friend : CheckBox
+
     //初始化设置履约保证金比例
     fun setMarginValue() {
         if (type == "1") {//现货仓单
@@ -164,6 +194,18 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
         EventBus.getDefault().unregister(this)
     }
 
+
+    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+        super.onActivityResult(requestCode, resultCode, data)
+        if (requestCode == 1004 && resultCode == 1005){
+            val permancePlanTmpData = data?.getParcelableExtra<PermancePlanTmpData>("data") as PermancePlanTmpData
+            selectPerformanceStepData.postValue(permancePlanTmpData)
+        }else if (requestCode == 1000 && resultCode == 1001){
+            val selectFriendDataList = data?.getParcelableExtra<SelectFriendListData>("datalist") as SelectFriendListData
+            selectFriendList.postValue(selectFriendDataList.selectFriendList)
+        }
+    }
+
     @SuppressLint("SetTextI18n")
     @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -290,6 +332,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     SelectData(
                                         id = "2",
                                         value = "浮动价"
+                                    ),
+                                    SelectData(
+                                        id = "3",
+                                        value = "贸易圈"
                                     )
                                 )
                                 creatBottomSheetDialog("请选择挂牌方式", selectDataList) {
@@ -330,10 +376,10 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                         linearLayout {
                             listedType.bindOptional(context) {
-                                if (it?.id == "1") {
-                                    visibility = View.GONE
-                                } else {
+                                if (it?.id == "2") {
                                     visibility = View.VISIBLE
+                                } else {
+                                    visibility = View.GONE
                                 }
                             }
                             background = resources.getDrawable(R.color.white)
@@ -370,7 +416,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 pvOptions.show()
                             }
                             textView {
-                                text = "挂牌方式"
+                                text = "行情商品"
                                 textSizeAuto = 34
                                 textColorInt = R.color.rma_hint_text_color_ccc
                             }.lparams(wrapContent, wrapContent) {
@@ -408,7 +454,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                         linearLayout {
                             listedType.bindOptional(context) {
-                                if (it?.id == "1") {
+                                if (it?.id == "1" || it?.id == "3") {
                                     visibility = View.VISIBLE
                                 } else {
                                     visibility = View.GONE
@@ -440,16 +486,37 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             }.lparams(0, autoSize(72), 1f) {
                                 marginEnd = autoSize(110)
                             }
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                checkBox {
+                                    can_be_negotiation = this
+                                    buttonDrawable = null
+                                    background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+
+                                }.lparams(autoSize(41), autoSize(41)){
+                                    marginStart = autoSize(36)
+                                    marginEnd = autoSize(36)
+                                }
+
+                                textView {
+                                    text = "可议价"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_zhushi_text_color
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(wrapContent, autoSize(143))
                         }.lparams(matchParent, autoSize(143))
 
                         itemView()
 
                         linearLayout {
                             listedType.bindOptional(context) {
-                                if (it?.id == "1") {
-                                    visibility = View.GONE
-                                } else {
+                                if (it?.id == "2") {
                                     visibility = View.VISIBLE
+                                } else {
+                                    visibility = View.GONE
                                 }
                             }
                             gravity = Gravity.CENTER_VERTICAL
@@ -572,6 +639,27 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     }.lparams(wrapContent, wrapContent) {
                                         marginEnd = autoSize(36)
                                     }
+
+                                    linearLayout {
+                                        gravity = Gravity.CENTER_VERTICAL
+                                        checkBox {
+                                            whole_list = this
+                                            buttonDrawable = null
+                                            background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+
+                                        }.lparams(autoSize(41), autoSize(41)){
+                                            marginStart = autoSize(36)
+                                            marginEnd = autoSize(36)
+                                        }
+
+                                        textView {
+                                            text = "整单"
+                                            textSizeAuto = 34
+                                            textColorInt = R.color.rma_zhushi_text_color
+                                        }.lparams(wrapContent, wrapContent){
+                                            marginEnd = autoSize(36)
+                                        }
+                                    }.lparams(wrapContent, autoSize(143))
                                 }.lparams(matchParent, autoSize(143))
 
                                 inflateLayout<SeekBar>(R.layout.main_seekbar) {
@@ -697,6 +785,213 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                         itemView()
 
                         linearLayout {
+                            listedType.bindOptional(context){
+                                if (it?.id == "3"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = 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)
+
+                            verticalLayout {
+                                linearLayout {
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    editText {
+                                        performance_bond = this
+                                        hint = "请输入履约保证金"
+                                        background = null
+                                        inputType = EditorInfo.TYPE_CLASS_NUMBER
+                                        setDecimalInputType()
+                                        hintColorStr = "#CCCCCC"
+                                        textSizeAuto = 31
+                                        textColorStr = "#333333"
+                                    }.lparams(0, autoSize(143), 1f)
+
+                                    textView {
+                                        text = "%"
+                                        textSizeAuto = 31
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginEnd = autoSize(36)
+                                    }
+                                }.lparams(matchParent, autoSize(143))
+                            }.lparams(matchParent, autoSize(143))
+
+                        }.lparams(matchParent, autoSize(143))
+
+                        itemView()
+
+                        linearLayout {
+                            listedType.bindOptional(context){
+                                if (it?.id == "3"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = View.GONE
+                                }
+                            }
+                            onThrottleFirstClick {
+                                showDataSelectDialog(type = "1") {
+                                    validity_of_listing.text = this
+                                }
+                            }
+                            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 = TimeUtils.getNowTime("yyyy-MM-dd")
+                                validity_of_listing = this
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent)
+
+                            emptyView()
+
+                            imageView {
+                                imageResource = R.mipmap.rma_search_by_time
+                            }.lparams(autoSize(38), autoSize(38)) {
+                                marginEnd = autoSize(36)
+                            }
+                        }.lparams(matchParent, autoSize(143))
+
+                        viewItemUI()
+
+                        linearLayout {
+                            listedType.bindOptional(context){
+                                if (it?.id == "3"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = View.GONE
+                                }
+                            }
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            onThrottleFirstClick {
+                                val intent = Intent()
+                                intent.setClass(context, SelectPerformanceTemplateActivity::class.java)
+                                startActivityForResult(intent,1004)
+                            }
+
+                            textView {
+                                text = "履约方式"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                selectPerformanceStepData.bindOptional(context) {
+                                    text = it?.templatename
+                                    textColorInt = R.color.rma_black_33
+                                }
+                                text = "请选择履约模版"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+
+                            emptyView()
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(36), autoSize(36)) {
+                                marginEnd = autoSize(25)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            listedType.bindOptional(context){
+                                if (it?.id == "3"){
+                                    visibility = View.VISIBLE
+                                }else{
+                                    visibility = View.GONE
+                                }
+                            }
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
+                            onThrottleFirstClick {
+                                if (no_friend.isChecked.not()){
+                                    val intent = Intent()
+                                    intent.setClass(context, SelectFriendActivty::class.java)
+                                    startActivityForResult(intent,1000)
+                                }else{
+                                    ToastUtils.showLong("勾选不限后不能选择朋友")
+                                }
+
+                            }
+
+                            textView {
+                                text = "指定朋友"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(36)
+                            }
+
+                            textView {
+                                selectFriendList.bindOptional(context) {
+                                    text = "已选" + it?.size + "人"
+                                    textColorInt = R.color.rma_black_33
+                                }
+                                text = "请选择朋友"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(80)
+                            }
+
+                            emptyView()
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(36), autoSize(36)) {
+                                marginEnd = autoSize(25)
+                            }
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                checkBox {
+                                    no_friend = this
+                                    buttonDrawable = null
+                                    background = resources.getDrawable(R.drawable.yrdz_check_select_backgrond)
+
+                                }.lparams(autoSize(41), autoSize(41)){
+                                    marginStart = autoSize(36)
+                                    marginEnd = autoSize(36)
+                                }
+
+                                textView {
+                                    text = "不限"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_zhushi_text_color
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
+                            }.lparams(wrapContent, autoSize(132))
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
                             if (type == "2") {
                                 visibility = View.VISIBLE
                             } else {
@@ -849,7 +1144,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
-                                } else {//浮动价
+                                } else if(listedType.value?.id == "2") {//浮动价
                                     viewModel.requeryWRListingOrderReq(
                                         FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
                                         LadingBillId = data.ladingbillid?.toLong() ?: 0,
@@ -880,6 +1175,61 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
+                                }else{
+                                    var canBargain = 0
+                                    if (can_be_negotiation.isChecked){
+                                        canBargain = 1
+                                    }else{
+                                        canBargain = 0
+                                    }
+                                    var canPart = 0
+                                    if (whole_list.isChecked){
+                                        canPart = 1
+                                    }else{
+                                        canPart = 0
+                                    }
+                                    var allFriendsFlag = 0
+                                    if (no_friend.isChecked){
+                                        allFriendsFlag = 1
+                                    }else{
+                                        allFriendsFlag = 0
+                                    }
+
+                                     viewModel.requeryWRListingOrderReq(
+                                         MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
+                                         MarginAlgorithm = 0,//指定保证金方式 1:比率 2:固定
+                                         MarginValue = performance_bond.text.toString().toDouble(),//指定保证金设置值
+                                         AllFriendsFlag = allFriendsFlag,
+                                         MatchAccIDsString = getSelectFriendList(),
+                                        FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
+                                        LadingBillId = data.ladingbillid?.toLong() ?: 0,
+                                        TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
+                                        SubNum = data.subnum?.toLong() ?: 0,
+                                        WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                        UserID = GlobalDataCollection.instance?.loginRsp?.userID
+                                            ?: 0,
+                                        AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+                                        IsSpecified = 0,
+                                        OrderQty = listednumberEdittext.text.toString().toLong(),
+                                        DeliveryGoodsID = data.deliverygoodsid?.toInt() ?: 0,
+                                        WRPriceType = 1,
+                                         FixedPrice = onePriceInputEdittext.text.toString()
+                                             .toDouble(),
+                                        WRTradeGoods = getWRTradeGoods(),
+                                        TimevalidType = 4,
+                                        FirstRatio = 0.0,
+                                        PerformanceTemplateID = 0,
+                                        BuyOrSell = 1,
+                                        PriceDisplayMode = 1,
+                                        CanBargain = canBargain,
+                                        ApplyID = 0,
+                                        CanPart = canPart,
+                                        HasWr = 1,
+                                        DelistMinQty = startInputNumber.text.toString().toLong(),
+                                        WRStandardID = data.wrstandardid?.toInt() ?: 0
+                                    ) {
+                                        finish()
+                                    }
                                 }
                             } else {//预售仓单挂单
                                 if (listedType.value?.id == "1") {//一口价
@@ -915,7 +1265,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
-                                } else {//浮动价
+                                } else if (listedType.value?.id == "1") {//浮动价
                                     viewModel.requeryWRListingOrderReq(
                                         FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
                                         LadingBillId = 0,
@@ -947,6 +1297,61 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     ) {
                                         finish()
                                     }
+                                }else{
+                                     var canBargain = 0
+                                    if (can_be_negotiation.isChecked){
+                                        canBargain = 1
+                                    }else{
+                                        canBargain = 0
+                                    }
+                                    var canPart = 0
+                                    if (whole_list.isChecked){
+                                        canPart = 1
+                                    }else{
+                                        canPart = 0
+                                    }
+                                    var allFriendsFlag = 0
+                                    if (no_friend.isChecked){
+                                        allFriendsFlag = 1
+                                    }else{
+                                        allFriendsFlag = 0
+                                    }
+                                    viewModel.requeryWRListingOrderReq(
+                                        MarginFlag = 1,//挂牌是否指定保证金 0:否 1:是
+                                        MarginAlgorithm = 0,//指定保证金方式 1:比率 2:固定
+                                        MarginValue = performance_bond.text.toString().toDouble(),//指定保证金设置值
+                                        AllFriendsFlag = allFriendsFlag,
+                                        MatchAccIDsString = getSelectFriendList(),
+                                        FactoryItems = arrayListOf<WarehouseTradeMI1.DGFactoryItems>(),
+                                        LadingBillId = 0,
+                                        TradeDate = TimeUtils.getNowTime("yyyyMMdd"),
+                                        SubNum = 0,
+                                        WRFactorTypeId = data1.wrfactortypeid?.toLong() ?: 0,
+                                        UserID = GlobalDataCollection.instance?.loginRsp?.userID
+                                            ?: 0,
+                                        AccountID = GlobalDataCollection.instance?.accountId ?: 0,
+                                        IsSpecified = 0,
+                                        OrderQty = listednumberEdittext.text.toString().toLong(),
+                                        DeliveryGoodsID = data1.deliverygoodsid?.toInt() ?: 0,
+                                        WRPriceType = 1,
+                                        WRTradeGoods = getWRTradeGoods(),
+                                        FixedPrice = onePriceInputEdittext.text.toString()
+                                            .toDouble(),
+                                        TimevalidType = 4,
+                                        FirstRatio = 0.0,
+                                        PerformanceTemplateID = 0,
+                                        DeliveryMonth = month_text.text.toString(),
+                                        BuyOrSell = 1,
+                                        PriceDisplayMode = 1,
+                                        CanBargain = canBargain,
+                                        ApplyID = 0,
+                                        CanPart = canPart,
+                                        HasWr = 0,
+                                        DelistMinQty = startInputNumber.text.toString().toLong(),
+                                        WRStandardID = data1.wrstandardid?.toInt() ?: 0
+                                    ) {
+                                        finish()
+                                    }
                                 }
                             }
 
@@ -969,6 +1374,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
         }
     }
 
+    fun getSelectFriendList() : List<String>{
+        val returnList = arrayListOf<String>()
+        selectFriendList.value?.forEach {
+            returnList.add(it.frienduserid?.toString() ?: "")
+        }
+        return returnList
+    }
+
     fun getWRTradeGoods(): WarehouseTradeMI1.WRGoodsInfo {
         val wRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder()
         wRTradeGoods.setGoodsID(selectGoodsInfo.value?.id?.toInt() ?: 0)
@@ -1021,7 +1434,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                     return false
                 }
             }
-        } else {//浮动价校验
+        } else if (listedType.value?.id == "2") {//浮动价校验
             if (selectGoodsInfo.value?.value.isNullOrEmpty()) {
                 ToastUtils.showLong("请选择行情商品")
                 return false
@@ -1064,6 +1477,60 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                     return false
                 }
             }
+        }else{
+            if (onePriceInputEdittext.text.toString().isNullOrEmpty()) {
+                ToastUtils.showLong("请输入挂牌价格")
+                return false
+            }
+            if (onePriceInputEdittext.text.toString() == "0" || onePriceInputEdittext.text.toString() == "0.0" || onePriceInputEdittext.text.toString() == "0.00") {
+                ToastUtils.showLong("挂牌价格不能为0")
+                return false
+            }
+            if (listednumberEdittext.text.toString().isNullOrEmpty()) {
+                ToastUtils.showLong("请输入挂牌数量")
+                return false
+            }
+            if (listednumberEdittext.text.toString() == "0" || listednumberEdittext.text.toString() == "0.0" || listednumberEdittext.text.toString() == "0.00") {
+                ToastUtils.showLong("挂牌数量不能为0")
+                return false
+            }
+            if (startInputNumber.text.toString().isNullOrEmpty()) {
+                ToastUtils.showLong("请输入起摘数量")
+                return false
+            }
+            if (type == "2"){
+                if (startInputNumber.text.toString().toLong() < data1.minivalue?.toLong() ?: 0) {
+                    ToastUtils.showLong("起摘数量不能小于" + data1.minivalue)
+                    return false
+                }
+            }else{
+                if (startInputNumber.text.toString().toLong() < data.minivalue?.toLong() ?: 0) {
+                    ToastUtils.showLong("起摘数量不能小于" + data.minivalue)
+                    return false
+                }
+            }
+
+            if (performance_bond.text.toString().isNullOrEmpty()){
+                ToastUtils.showLong("请输入履约保证金比例")
+                return false
+            }
+            if (performance_bond.text.toString() == "0" || performance_bond.text.toString() == "0.0" || performance_bond.text.toString() == "0.00") {
+                ToastUtils.showLong("履约保证金比例不能为0")
+                return false
+            }
+
+            if (selectPerformanceStepData.value?.autoid.isNullOrEmpty()){
+                ToastUtils.showLong("请选择履约模版")
+                return false
+            }
+
+            if (no_friend.isChecked.not()){
+                if (selectFriendList.value.isNullOrEmpty()){
+                    ToastUtils.showLong("请选择朋友")
+                    return false
+                }
+            }
+
         }
 
         return true

+ 14 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedViewModel.kt

@@ -201,7 +201,6 @@ class ListedViewModel : BaseViewModel(){
         UserID: Int = 0,//用户ID
         AccountID: Long = 0,//资金账号
         IsSpecified: Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs: List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         OrderQty: Long = 0,//委托数量(可挂部分数据量)
         DeliveryGoodsID: Int = 0,//交割商品商品ID
         WRPriceType: Int = 0,//价格方式
@@ -220,34 +219,42 @@ class ListedViewModel : BaseViewModel(){
         Remark: String = "",//备注
         ApplyID: Long = 0,//申请ID
         CanPart: Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         DeliveryMonth : String = "",//交收月
         HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
         DelistMinQty : Long = 0,//起摘数量
         WRStandardID: Int = 0,//现货品种ID
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0,//是否全好友可见 0:否 1:是
         FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()
         GlobalScope.launch {
             MyApplication.getInstance()?.warehouseManager?.HdWROrderReq(
-                FactoryItems = FactoryItems,
+                MarginFlag = MarginFlag,
+                MarginAlgorithm = MarginAlgorithm,
+                MarginValue = MarginValue,
+                AllFriendsFlag = AllFriendsFlag,
                 LadingBillId = LadingBillId,
                 TradeDate = TradeDate,
                 AccountID = AccountID,
-                DeliveryMonth = DeliveryMonth,
                 OrderQty = OrderQty,
                 IsSpecified = IsSpecified,
                 SubNum = SubNum,
+                DeliveryMonth = DeliveryMonth,
                 DeliveryGoodsID = DeliveryGoodsID,
                 WRFactorTypeId = WRFactorTypeId,
                 UserID = UserID,
-                MatchAccIDs = MatchAccIDs,
+                MatchAccIDsString = MatchAccIDsString,
                 WRPriceType = WRPriceType,
                 FixedPrice = FixedPrice,
                 WRTradeGoods = WRTradeGoods,
                 PriceFactor = PriceFactor,
                 PriceMove = PriceMove,
+                DelistMinQty = DelistMinQty,
                 TimevalidType = TimevalidType,
                 FirstRatio = FirstRatio,
                 PerformanceTemplateID = PerformanceTemplateID,
@@ -259,9 +266,9 @@ class ListedViewModel : BaseViewModel(){
                 CanBargain = CanBargain,
                 Attachment1 = Attachment1,
                 Attachment2 = Attachment2,
-                DelistMinQty = DelistMinQty,
                 Remark = Remark,
-                ApplyID = ApplyID
+                ApplyID = ApplyID,
+                FactoryItems = FactoryItems
             ) { isCompleted, err ->
                 if (isCompleted) {
                     loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))

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

@@ -418,7 +418,6 @@ class BusinessHallViewModel : BaseViewModel(){
         UserID: Int = 0,//用户ID
         AccountID: Long = 0,//资金账号
         IsSpecified: Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs: List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         OrderQty: Long = 0,//委托数量(可挂部分数据量)
         DeliveryGoodsID: Int = 0,//交割商品商品ID
         WRPriceType: Int = 0,//价格方式
@@ -437,28 +436,36 @@ class BusinessHallViewModel : BaseViewModel(){
         Remark: String = "",//备注
         ApplyID: Long = 0,//申请ID
         CanPart: Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
-//        DeliveryMonth : String = "",//交收月
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        DeliveryMonth : String = "",//交收月
         HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
         DelistMinQty : Long = 0,//起摘数量
         WRStandardID: Int = 0,//现货品种ID
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0,//是否全好友可见 0:否 1:是
         FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()
         GlobalScope.launch {
             MyApplication.getInstance()?.warehouseManager?.HdWROrderReq(
-                FactoryItems = FactoryItems,
+                MarginFlag = MarginFlag,
+                MarginAlgorithm = MarginAlgorithm,
+                MarginValue = MarginValue,
+                AllFriendsFlag = AllFriendsFlag,
                 LadingBillId = LadingBillId,
                 TradeDate = TradeDate,
                 AccountID = AccountID,
                 OrderQty = OrderQty,
                 IsSpecified = IsSpecified,
                 SubNum = SubNum,
+                DeliveryMonth = DeliveryMonth,
                 DeliveryGoodsID = DeliveryGoodsID,
                 WRFactorTypeId = WRFactorTypeId,
                 UserID = UserID,
-                MatchAccIDs = MatchAccIDs,
+                MatchAccIDsString = MatchAccIDsString,
                 WRPriceType = WRPriceType,
                 FixedPrice = FixedPrice,
                 WRTradeGoods = WRTradeGoods,
@@ -477,7 +484,8 @@ class BusinessHallViewModel : BaseViewModel(){
                 Attachment1 = Attachment1,
                 Attachment2 = Attachment2,
                 Remark = Remark,
-                ApplyID = ApplyID
+                ApplyID = ApplyID,
+                FactoryItems = FactoryItems
             ) { isCompleted, err ->
                 if (isCompleted) {
                     loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))

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

@@ -130,7 +130,6 @@ class WarehouseReceiptViewModel : BaseViewModel(){
         UserID: Int = 0,//用户ID
         AccountID: Long = 0,//资金账号
         IsSpecified: Int = 0,//是否指定对手 0 不指定 1 指定
-        MatchAccIDs: List<Long> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         OrderQty: Long = 0,//委托数量(可挂部分数据量)
         DeliveryGoodsID: Int = 0,//交割商品商品ID
         WRPriceType: Int = 0,//价格方式
@@ -149,17 +148,25 @@ class WarehouseReceiptViewModel : BaseViewModel(){
         Remark: String = "",//备注
         ApplyID: Long = 0,//申请ID
         CanPart: Int = 0,//是否允许部份摘牌0:不允许;1:允许
-//        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        MatchAccIDsString : List<String> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
         DeliveryMonth : String = "",//交收月
         HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
         DelistMinQty : Long = 0,//起摘数量
         WRStandardID: Int = 0,//现货品种ID
+        MarginFlag : Int = 0,//挂牌是否指定保证金 0:否 1:是
+        MarginAlgorithm : Int = 0,//指定保证金方式 1:比率 2:固定
+        MarginValue : Double = 0.0,//指定保证金设置值
+        AllFriendsFlag : Int = 0,//是否全好友可见 0:否 1:是
         FactoryItems : List<WarehouseTradeMI1.DGFactoryItems>,//要素类型明细集合(没有仓单要素ID填写)
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()
         GlobalScope.launch {
             MyApplication.getInstance()?.warehouseManager?.HdWROrderReq(
+                MarginFlag = MarginFlag,
+                MarginAlgorithm = MarginAlgorithm,
+                MarginValue = MarginValue,
+                AllFriendsFlag = AllFriendsFlag,
                 LadingBillId = LadingBillId,
                 TradeDate = TradeDate,
                 AccountID = AccountID,
@@ -170,7 +177,7 @@ class WarehouseReceiptViewModel : BaseViewModel(){
                 DeliveryGoodsID = DeliveryGoodsID,
                 WRFactorTypeId = WRFactorTypeId,
                 UserID = UserID,
-                MatchAccIDs = MatchAccIDs,
+                MatchAccIDsString = MatchAccIDsString,
                 WRPriceType = WRPriceType,
                 FixedPrice = FixedPrice,
                 WRTradeGoods = WRTradeGoods,
@@ -207,7 +214,6 @@ class WarehouseReceiptViewModel : BaseViewModel(){
             }
         }
     }
-
     /**
      * 查询现货明细
      */

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

@@ -346,7 +346,7 @@ class PurchaseDelistingActivity : BaseActivity<PurchaseDelistingViewModel>(){
                             isListed = false,
                             orderPrice = data.orderprice ?: "1",
                             qty = onePriceInputNumberEdittext.text.toString(),
-                            type = "1",
+                            type = type ?: "",
                             accountId = selectAccountData.value?.accountid ?: 0
                         ){
                             finish()

+ 6 - 0
RMA/app/src/main/res/drawable/yrdz_check_select_backgrond.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@mipmap/yrdz_delivery_select_icon" android:state_checked="true" />
+    <item android:drawable="@mipmap/yrdz_delivery_normal_icon"  android:state_checked="false"/>
+    <item android:drawable="@mipmap/yrdz_delivery_normal_icon"  />
+</selector>

+ 25 - 0
RMA/app/src/main/res/layout/spot_warehouse_layout_item_content.xml

@@ -76,6 +76,31 @@
         android:gravity="end|center_vertical"
         android:orientation="horizontal">
 
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/confirm"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="90dp"
+            android:layout_height="25dp"
+            android:text="确认"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/refused"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="90dp"
+            android:layout_height="25dp"
+            android:text="拒绝"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
         <TextView
             android:visibility="gone"
             android:id="@+id/bargain"

Some files were not shown because too many files changed in this diff