소스 검색

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

Liu.bolan 4 년 전
부모
커밋
46c3e9bd3c
27개의 변경된 파일2323개의 추가작업 그리고 547개의 파일을 삭제
  1. 4 0
      RMA/app/src/main/AndroidManifest.xml
  2. 324 60
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/WarehouseManager.kt
  3. 283 6
      RMA/app/src/main/java/cn/muchinfo/rma/business/warehouse/adapter/WarehouseAdapter.kt
  4. 5 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/OrderQuoteData.kt
  5. 126 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/WrGoodsInfoData.kt
  6. 8 0
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/funcode/FunCode.java
  7. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt
  8. 3 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysFragment.kt
  9. 34 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysViewModel.kt
  10. 10 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/SpotWareHouseActivity.kt
  11. 1 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/DetailsWarehouseContentAdapter.java
  12. 0 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/adapter/SpotWarehouseContentAdapter.java
  13. 195 71
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedActivity.kt
  14. 171 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstmain/spotwarehouse/listed/ListedViewModel.kt
  15. 13 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessBuyHallViewHolder.kt
  16. 383 26
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt
  17. 98 333
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallDetailsActivity.kt
  18. 164 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallViewModel.kt
  19. 12 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessSellHallViewHolder.kt
  20. 5 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/OneListedDialog.kt
  21. 243 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/SelectFincningDialog.kt
  22. 8 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptFragment.kt
  23. 20 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptViewModel.kt
  24. 58 31
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/one/OnePriceAdapter.java
  25. 127 0
      RMA/app/src/main/res/layout/layout_item_hnst_content.xml
  26. 1 0
      RMA/app/src/main/res/layout/layout_item_platinum_content.xml
  27. BIN
      RMA/app/src/main/res/mipmap-xhdpi/hnst_cercler_bg.png

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

@@ -382,6 +382,10 @@
 
         <activity android:name=".view.base.hnstmain.performance.PerformationPayActivity"/>
 
+        <activity android:name=".view.base.hnstmain.spotwarehouse.listed.ListedActivity"
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustPan"/>
+
     </application>
 
 </manifest>

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

@@ -7,6 +7,7 @@ import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.netcore.socket.Callback
 import cn.muchinfo.rma.protobuf.funcode.FunCode
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI1
 import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
@@ -18,6 +19,32 @@ import java.lang.Exception
 
 class WarehouseManager {
 
+    /**
+     * 查询仓单商品信息
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BusinessData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrGoodsInfo(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<WrGoodsInfoData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrGoodsInfo",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<WrGoodsInfoData>>>() {
+                override fun onResponse(response: BaseResult<List<WrGoodsInfoData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
 
     /**
      * 查询履约信息
@@ -86,7 +113,10 @@ class WarehouseManager {
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<WrSpecialMatchOrderData>>>() {
-                override fun onResponse(response: BaseResult<List<WrSpecialMatchOrderData>>?, id: Int) {
+                override fun onResponse(
+                    response: BaseResult<List<WrSpecialMatchOrderData>>?,
+                    id: Int
+                ) {
                     responseBack(true, response?.data, null)
                 }
 
@@ -113,7 +143,10 @@ class WarehouseManager {
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<WrSpecialMatchOrderData>>>() {
-                override fun onResponse(response: BaseResult<List<WrSpecialMatchOrderData>>?, id: Int) {
+                override fun onResponse(
+                    response: BaseResult<List<WrSpecialMatchOrderData>>?,
+                    id: Int
+                ) {
                     responseBack(true, response?.data, null)
                 }
 
@@ -179,7 +212,6 @@ class WarehouseManager {
     }
 
 
-
     /**
      * 查询仓库信息
      * @param params Map<String, String>
@@ -373,6 +405,138 @@ class WarehouseManager {
     }
 
     /**
+     * 持仓单摘牌请求
+     */
+    fun HdWRDealOrderReq(
+        RelatedWRTradeOrderID: Long = 0,//关联委托单号(摘牌委托关联挂牌委托单ID)
+        WRTransferUserID: Int = 0,//仓单受让用户
+        OrderQty: Long = 0,//委托数量
+        BuyOrSell: Int = 0,//买卖方向
+        ApplyID: Long = 0,//申请ID
+        LadingBillId: Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
+        SubNum: Long = 0,//提单子单号(wrholdlb的SubNum字段),卖的时候填写
+        WRFactorTypeId: Long = 0,//仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
+        DeliveryMonth: String = "",//交收月
+        HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+        val reqPacket = WarehouseAdapter.getHdWRDealOrderReqInfo(
+            RelatedWRTradeOrderID, WRTransferUserID, OrderQty, BuyOrSell, ApplyID, LadingBillId, SubNum, WRFactorTypeId, DeliveryMonth, HasWr
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_HdWRDealOrderRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisHdWRDealOrderRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+    /**
+     * 持仓单挂单委托请求
+     */
+    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集合(指定对手时填写)
+//        DeliveryMonth : String = "",//交收月
+        HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        WRStandardID: Int = 0,//现货品种ID
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            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,
+            HasWr,
+            WRStandardID
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.HdWROrderRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisHdWROrderRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
+
+    /**
      * 仓单贸易挂牌委托请求
      * @param marketId Int
      * @param goodsId Int
@@ -405,43 +569,71 @@ class WarehouseManager {
      * @param ApplyID Long
      */
     fun requeryWRListingOrderReq(
-        marketId : Int,//市场id
-        goodsId : Int,//商品id
-        AccountID : Long = 0,//资金账号
-        OrderQty : Long = 0,//委托数量
-        IsSpecified : Int = 0,//是否指定对手
-        MatchUserIDs : List<Int> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
-        DeliveryGoodsID : Int = 0,//交割商品商品ID
-        BrandID : Int = 0,//品牌ID
-        QualityID : Int = 0,//品质ID
-        SpecID : Int = 0,//规格ID
-        WarehouseID : Int = 0,//仓库ID
-        DeliveryMonthID : Int = 0,//月份ID
-        WRPriceType : Int = 0,//价格方式
-        FixedPrice : Double = 0.0,//固定价格
-        WRTradeGoods : WarehouseTradeMI1.WRGoodsInfo.Builder = WarehouseTradeMI1.WRGoodsInfo.newBuilder(),//仓单贸易商品配置集合(浮动价时填写)
-        PriceFactor : Double = 0.0,//价格系数(浮动价时填写)    -   [挂牌]
-        PriceMove : Double = 0.0,//升贴水(浮动价时填写)
-        TimevalidType : Int = 0,//时间有效类型
-        ValidTime : String = "",//有效期限
-        FirstRatio : Double = 0.0,//首付比例
-        PerformanceTemplateID : Long = 0,//履约计划模板ID
-        OrderSrc : Int = 0,//委托来源
-        BuyOrSell : Int = 0,//买卖方向
-        PriceDisplayMode : Int = 0,//浮动价显示方式
-        CanBargain : Int = 0,//挂牌是否可议价0:不可1:可-摘牌是否议价
-        Attachment1 : String = "",//附件1
-        Attachment2 : String = "",//附件2
-        Remark : String = "",//备注
-        ApplyID : Long = 0,//申请ID
+        marketId: Int,//市场id
+        goodsId: Int,//商品id
+        AccountID: Long = 0,//资金账号
+        OrderQty: Long = 0,//委托数量
+        IsSpecified: Int = 0,//是否指定对手
+        MatchUserIDs: List<Int> = arrayListOf(),//仓单贸易对手用户ID集合(指定对手时填写)
+        DeliveryGoodsID: Int = 0,//交割商品商品ID
+        BrandID: Int = 0,//品牌ID
+        QualityID: Int = 0,//品质ID
+        SpecID: Int = 0,//规格ID
+        WarehouseID: Int = 0,//仓库ID
+        DeliveryMonthID: Int = 0,//月份ID
+        WRPriceType: Int = 0,//价格方式
+        FixedPrice: Double = 0.0,//固定价格
+        WRTradeGoods: WarehouseTradeMI1.WRGoodsInfo.Builder = WarehouseTradeMI1.WRGoodsInfo.newBuilder(),//仓单贸易商品配置集合(浮动价时填写)
+        PriceFactor: Double = 0.0,//价格系数(浮动价时填写)    -   [挂牌]
+        PriceMove: Double = 0.0,//升贴水(浮动价时填写)
+        TimevalidType: Int = 0,//时间有效类型
+        ValidTime: String = "",//有效期限
+        FirstRatio: Double = 0.0,//首付比例
+        PerformanceTemplateID: Long = 0,//履约计划模板ID
+        OrderSrc: Int = 0,//委托来源
+        BuyOrSell: Int = 0,//买卖方向
+        PriceDisplayMode: Int = 0,//浮动价显示方式
+        CanBargain: Int = 0,//挂牌是否可议价0:不可1:可-摘牌是否议价
+        Attachment1: String = "",//附件1
+        Attachment2: String = "",//附件2
+        Remark: String = "",//备注
+        ApplyID: Long = 0,//申请ID
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
         }
         val reqPacket = WarehouseAdapter.getWRListingOrderReqInfo(
-            marketId, goodsId, AccountID, OrderQty, IsSpecified, MatchUserIDs, DeliveryGoodsID, BrandID, QualityID, SpecID, WarehouseID, DeliveryMonthID, WRPriceType, FixedPrice, WRTradeGoods, PriceFactor, PriceMove, TimevalidType, ValidTime, FirstRatio, PerformanceTemplateID, OrderSrc, BuyOrSell, PriceDisplayMode, CanBargain, Attachment1, Attachment2, Remark, ApplyID
+            marketId,
+            goodsId,
+            AccountID,
+            OrderQty,
+            IsSpecified,
+            MatchUserIDs,
+            DeliveryGoodsID,
+            BrandID,
+            QualityID,
+            SpecID,
+            WarehouseID,
+            DeliveryMonthID,
+            WRPriceType,
+            FixedPrice,
+            WRTradeGoods,
+            PriceFactor,
+            PriceMove,
+            TimevalidType,
+            ValidTime,
+            FirstRatio,
+            PerformanceTemplateID,
+            OrderSrc,
+            BuyOrSell,
+            PriceDisplayMode,
+            CanBargain,
+            Attachment1,
+            Attachment2,
+            Remark,
+            ApplyID
         )
 
         tradeSocketManager.send(
@@ -474,15 +666,15 @@ class WarehouseManager {
      * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
      */
     fun requeryWRListingCancelOrder(
-        marketId : Int,//市场id
-        goodsId : Int,//商品id
-        AccountID : Long = 0,//资金账号
-        OldWRTradeOrderID : Long = 0,//目标仓单贸易委托单ID
-        OrderSrc : Int = 0,//委托来源
-        BuyOrSell : Int = 0,//买卖方向
-        WRID : Long = 0,//仓单ID,卖的时候填写
+        marketId: Int,//市场id
+        goodsId: Int,//商品id
+        AccountID: Long = 0,//资金账号
+        OldWRTradeOrderID: Long = 0,//目标仓单贸易委托单ID
+        OrderSrc: Int = 0,//委托来源
+        BuyOrSell: Int = 0,//买卖方向
+        WRID: Long = 0,//仓单ID,卖的时候填写
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
@@ -523,23 +715,31 @@ class WarehouseManager {
      * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
      */
     fun requeryWRDelistingOrder(
-        marketId : Int,//市场id
-        goodsId : Int,//商品id
-        AccountID : Long = 0,//资金账号
-        RelatedWRTradeOrderID : Long = 0,//关联委托单号(摘牌委托关联挂牌委托单ID)
-        WRTransferUserID : Int = 0,//仓单受让用户
-        OrderQty : Long = 0,//委托数量
-        OrderSrc : Int = 0,//委托来源
-        BuyOrSell : Int = 0,//买卖方向
-        ApplyID : Long = 0,//申请ID
+        marketId: Int,//市场id
+        goodsId: Int,//商品id
+        AccountID: Long = 0,//资金账号
+        RelatedWRTradeOrderID: Long = 0,//关联委托单号(摘牌委托关联挂牌委托单ID)
+        WRTransferUserID: Int = 0,//仓单受让用户
+        OrderQty: Long = 0,//委托数量
+        OrderSrc: Int = 0,//委托来源
+        BuyOrSell: Int = 0,//买卖方向
+        ApplyID: Long = 0,//申请ID
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
         }
         val reqPacket = WarehouseAdapter.getWRDelistingOrderReqInfo(
-            marketId, goodsId, AccountID, RelatedWRTradeOrderID, WRTransferUserID, OrderQty, OrderSrc, BuyOrSell, ApplyID
+            marketId,
+            goodsId,
+            AccountID,
+            RelatedWRTradeOrderID,
+            WRTransferUserID,
+            OrderQty,
+            OrderSrc,
+            BuyOrSell,
+            ApplyID
         )
 
         tradeSocketManager.send(
@@ -634,10 +834,10 @@ class WarehouseManager {
     optional string ClientTicket = 6; // string 客户端流水号
      */
     fun getAreaInOutApplyAuditPassReq(
-        InOutApplyID : Long,
-        Remark : String = "",
+        InOutApplyID: Long,
+        Remark: String = "",
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
@@ -784,15 +984,16 @@ class WarehouseManager {
      * @return Packet50
      */
     fun warehouseStateChangeReq(
-        warehouseid : Long,
-        warehousestatus : Int,
+        warehouseid: Long,
+        warehousestatus: Int,
         callback: (isCompleted: Boolean, err: Error?) -> Unit
-    ){
+    ) {
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
             callback(false, Error("交易链路未初始化"))
             return
         }
-        val reqPacket = WarehouseAdapter.getWarehouseStateChangeReqInfo(warehouseid, warehousestatus)
+        val reqPacket =
+            WarehouseAdapter.getWarehouseStateChangeReqInfo(warehouseid, warehousestatus)
 
         tradeSocketManager.send(
             reqPacket,
@@ -812,5 +1013,68 @@ class WarehouseManager {
         )
     }
 
+    /**
+     * 仓库出库请求
+     */
+    fun wROutApplyReq(
+        WRStandardID: Long = 0,//仓单标准ID
+        WarehouseID: Long = 0,//仓库ID
+        UserID: Long = 0,//申请人ID
+        AccountID: Long = 0,//申请人账户ID
+        Mobile: String = "",//申请人手机号
+        AppointmentDate: String = "",//预约出库时间(格式:20200101)
+        AppointmentModel: Int = 0,//预约方式:1-物流,2-自送,3-自提
+        ProvinceID: Long = 0,//省
+        DistrictID: Long = 0,//区
+        CityID: Long = 0,//市
+        Address: String = "",//详细地址
+        ContactName: String = "",//收货人提货人
+        ContactNum: String = "",//收货人提货人手机
+        AppointmentRemark: String = "",//预约备注
+        CreatorID: Long = 0,//创建人ID
+        WROutInDetails: ManageServiceMI1.WROutInDetail,//仓单出库提单明细数据
+        callback: (isCompleted: Boolean, err: Error?) -> Unit
+    ) {
+        val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
+            callback(false, Error("交易链路未初始化"))
+            return
+        }
+        val reqPacket = WarehouseAdapter.getWROutApplyReqInfo(
+            WRStandardID,
+            WarehouseID,
+            UserID,
+            AccountID,
+            Mobile,
+            AppointmentDate,
+            AppointmentModel,
+            ProvinceID,
+            DistrictID,
+            CityID,
+            Address,
+            ContactName,
+            ContactNum,
+            AppointmentRemark,
+            CreatorID,
+            WROutInDetails
+        )
+
+        tradeSocketManager.send(
+            reqPacket,
+            FunCode.FID_WROutApplyRsp,
+            object : Callback<Packet50> {
+                override fun onSuccess(rsp: Packet50?) {
+                    val rst = WarehouseAdapter.analysisWROutApplyRsp(rsp!!)
+                    callback(rst.first, rst.second)
+                }
+
+                override fun onFail(err: Error?) {
+                    // 发送数据失败
+                    callback(false, err)
+                }
+
+            }
+        )
+    }
+
 
 }

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

@@ -5,9 +5,7 @@ import cn.muchinfo.rma.global.ErrorMessageUtils
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.protobuf.funcode.FunCode
-import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
-import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
-import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
+import cn.muchinfo.rma.protobuf.protoclasses.*
 import com.blankj.utilcode.util.TimeUtils
 import com.google.common.math.IntMath
 import java.io.ByteArrayOutputStream
@@ -20,11 +18,290 @@ object WarehouseAdapter {
      * 仓单出库申请
      */
     fun getWROutApplyReqInfo(
-        WRStandardID : Long = 0,
-        WarehouseID : Long = 0
+        WRStandardID : Long = 0,//仓单标准ID
+        WarehouseID : Long = 0,//仓库ID
+        UserID : Long = 0,//申请人ID
+        AccountID : Long = 0,//申请人账户ID
+        Mobile : String = "",//申请人手机号
+        AppointmentDate : String = "",//预约出库时间(格式:20200101)
+        AppointmentModel : Int = 0,//预约方式:1-物流,2-自送,3-自提
+        ProvinceID : Long = 0,//省
+        DistrictID : Long = 0,//区
+        CityID : Long = 0,//市
+        Address : String = "",//详细地址
+        ContactName : String = "",//收货人提货人
+        ContactNum : String = "",//收货人提货人手机
+        AppointmentRemark : String = "",//预约备注
+        CreatorID : Long = 0,//创建人ID
+        WROutInDetails : ManageServiceMI1.WROutInDetail//仓单出库提单明细数据
+    ) : Packet50{
+        val builder = ManageServiceMI1.WROutApplyReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FID_WROutApplyReq,
+                loginInfo.userID,
+                AccountID,
+                0,
+                0
+            )
+        )
+        builder.userID = UserID
+        if (WRStandardID != 0L){
+            builder.wrStandardID
+        }
+        if (WarehouseID != 0L){
+            builder.warehouseID = WarehouseID
+        }
+        builder.mobile = Mobile
+        builder.appointmentDate = AppointmentDate
+        builder.appointmentModel = AppointmentModel
+        builder.provinceID = ProvinceID
+        builder.districtID = DistrictID
+        builder.cityID = CityID
+        builder.address = Address
+        builder.contactName = ContactName
+        builder.contactNum = ContactNum
+        builder.appointmentRemark = AppointmentRemark
+        builder.creatorID = CreatorID
+        builder.addWROutInDetails(WROutInDetails)
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FID_WROutApplyReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 仓单出库申请响应报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisWROutApplyRsp(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI1.WROutApplyRsp?> {
+
+        return try {
+            val resultRsp = ManageServiceMI1.WROutApplyRsp.parseFrom(packet50.content)
+            if (resultRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, resultRsp)
+            } else {
+                if (resultRsp.retCode == -1){
+                    // 操作失败
+                    Triple(false, Error(resultRsp.retDesc), null)
+                }else{
+                    // 操作失败
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
+                }
+
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
+
+    /**
+     * 持仓单摘牌请求
+     */
+    fun getHdWRDealOrderReqInfo(
+        RelatedWRTradeOrderID : Long = 0,//关联委托单号(摘牌委托关联挂牌委托单ID)
+        WRTransferUserID : Int = 0,//仓单受让用户
+        OrderQty : Long = 0,//委托数量
+        BuyOrSell : Int = 0,//买卖方向
+        ApplyID : Long = 0,//申请ID
+        LadingBillId : Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
+        SubNum : Long = 0,//提单子单号(wrholdlb的SubNum字段),卖的时候填写
+        WRFactorTypeId : Long = 0,//仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
+        DeliveryMonth : String = "",//交收月
+        HasWr : Int = 0//是否有仓单-0:没有仓单 1:有仓单
+    ) : Packet50{
+        val builder = WarehouseTradeMI1.HdWRDealOrderReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.FID_HdWRDealOrderReq,
+                loginInfo.userID,
+                GlobalDataCollection.instance?.accountId ?: 0,
+                0,
+                17201
+            )
+        )
+        builder.tradeDate = cn.muchinfo.rma.global.utils.TimeUtils.getNowTime("yyyyMMdd")
+        builder.userID = loginInfo.userID
+        builder.accountID = GlobalDataCollection.instance?.accountId ?: 0
+        builder.relatedWRTradeOrderID = RelatedWRTradeOrderID
+        builder.wrTransferUserID = WRTransferUserID
+        builder.orderSrc = 1
+        builder.clientSerialNo = UUID.randomUUID().toString().replace("-", "")//撤单时传的唯一标识
+        builder.clientOrderTime = TimeUtils.getNowString()
+        builder.clientType = 3 // 客户端类型: 1客户端  3 手机端 android
+        builder.operatorID = loginInfo.loginID // TODO
+
+        builder.orderQty = OrderQty
+        builder.buyOrSell = BuyOrSell
+        builder.applyID = ApplyID
+        if (BuyOrSell == 1){
+            builder.ladingBillId = LadingBillId
+            builder.subNum = SubNum
+        }
+        builder.wrFactorTypeId = WRFactorTypeId
+        builder.deliveryMonth = DeliveryMonth
+        builder.hasWr = HasWr
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.FID_HdWRDealOrderReq, arrayOutputStream.toByteArray())
+    }
+
+    /**
+     * 仓单贸易挂牌委托响应报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisHdWRDealOrderRsp(packet50: Packet50) : Triple<Boolean, Error?, WarehouseTradeMI1.HdWRDealOrderRsp?> {
+
+        return try {
+            val resultRsp = WarehouseTradeMI1.HdWRDealOrderRsp.parseFrom(packet50.content)
+            if (resultRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, resultRsp)
+            } else {
+                if (resultRsp.retCode == -1){
+                    // 操作失败
+                    Triple(false, Error(resultRsp.retDesc), null)
+                }else{
+                    // 操作失败
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
+                }
 
-    ){
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
+    }
 
+    /**
+     * 持仓单挂牌请求
+     */
+    fun getHdWROrderReqInfo(
+        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集合(指定对手时填写)
+//        DeliveryMonth : String = "",//交收月
+        HasWr : Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        WRStandardID : Int = 0//现货品种ID
+//        FactoryItems : WarehouseTradeMI1.DGFactoryItems//要素类型明细集合(没有仓单要素ID填写)
+    ) : Packet50{
+        val builder = WarehouseTradeMI1.HdWROrderReq.newBuilder()
+        val loginInfo = GlobalDataCollection.instance?.loginRsp!!
+        // TODO 这里的funcode需要更新相应的操作
+        builder.setHeader(
+            MessageHeadModel.getHead(
+                FunCode.HdWROrderReq,
+                loginInfo.userID,
+                AccountID,
+                0,
+                17201
+            )
+        )
+        if (BuyOrSell == 1){//卖
+            builder.ladingBillId = LadingBillId
+            builder.subNum = SubNum
+            builder.wrFactorTypeId = WRFactorTypeId
+        }
+        builder.buyOrSell = BuyOrSell
+        builder.tradeDate = TradeDate
+        builder.userID = UserID
+        builder.accountID = AccountID
+        builder.isSpecified = IsSpecified
+        if (IsSpecified == 1){
+            builder.addAllMatchAccIDs(MatchAccIDs)
+        }
+        builder.orderQty = OrderQty
+        builder.deliveryGoodsID = DeliveryGoodsID
+        builder.wrPriceType = WRPriceType
+        if (WRPriceType == 2){//浮动价
+            builder.priceFactor = PriceFactor
+            builder.priceMove = PriceMove
+            builder.addWRTradeGoods(WRTradeGoods)
+        }else{
+            builder.fixedPrice = FixedPrice
+        }
+
+        builder.timevalidType = TimevalidType
+        builder.orderSrc = 1
+        builder.clientSerialNo = UUID.randomUUID().toString().replace("-", "")//撤单时传的唯一标识
+        builder.clientOrderTime = TimeUtils.getNowString()
+        builder.clientType = 3 // 客户端类型: 1客户端  3 手机端 android
+        builder.operatorID = loginInfo.loginID // TODO
+        builder.firstRatio = FirstRatio
+        builder.performanceTemplateID = PerformanceTemplateID
+        builder.priceDisplayMode = PriceDisplayMode
+        builder.canBargain = CanBargain
+        builder.attachment1 = Attachment1
+        builder.attachment2 = Attachment2
+        builder.remark = Remark
+        builder.applyID = ApplyID
+        builder.canPart = CanPart
+        builder.wrStandardID = WRStandardID
+        builder.hasWr = HasWr
+
+        val arrayOutputStream = ByteArrayOutputStream()
+        builder.build().writeTo(arrayOutputStream)
+        return Packet50(FunCode.HdWROrderReq, arrayOutputStream.toByteArray())
+    }
+
+
+    /**
+     * 仓单贸易挂牌委托响应报文解析
+     * @param packet50 Packet50
+     * @return Triple<Boolean, Error?, ManageServiceMI2.ERMCPAreaInOutStockApplyRsp?>
+     */
+    fun analysisHdWROrderRsp(packet50: Packet50) : Triple<Boolean, Error?, WarehouseTradeMI1.HdWROrderRsp?> {
+
+        return try {
+            val resultRsp = WarehouseTradeMI1.HdWROrderRsp.parseFrom(packet50.content)
+            if (resultRsp.retCode == 0) {
+                // 操作成功
+                Triple(true, null, resultRsp)
+            } else {
+                if (resultRsp.retCode == -1){
+                    // 操作失败
+                    Triple(false, Error(resultRsp.retDesc), null)
+                }else{
+                    // 操作失败
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
+                }
+
+            }
+        } catch (e: Exception) {
+            // 操作失败
+            Triple(false, Error("装箱失败"), null)
+        }
     }
 
     /**

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

@@ -33,6 +33,8 @@ data class OrderQuoteData(
     val buyprice : String? = "",//买价
     @SerializedName("buypricemove")
     val buypricemove : String? = "",//买升贴水(基差)
+    @SerializedName("deliverymonth")
+    val deliverymonth : String? = "",//交收月
     @SerializedName("buyqty")
     val buyqty : String? = "",//买量
     @SerializedName("deliverygoodscode")
@@ -90,6 +92,7 @@ data class OrderQuoteData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -97,6 +100,7 @@ data class OrderQuoteData(
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(buyprice)
         parcel.writeString(buypricemove)
+        parcel.writeString(deliverymonth)
         parcel.writeString(buyqty)
         parcel.writeString(deliverygoodscode)
         parcel.writeString(deliverygoodsid)
@@ -131,4 +135,5 @@ data class OrderQuoteData(
         }
     }
 
+
 }

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

@@ -0,0 +1,126 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 仓单商品信息
+ * @property haswr String?
+ * @property lstitem List<lstitem>
+ * @property lststep List<lststep>
+ * @property marketid String?
+ * @constructor
+ */
+data class WrGoodsInfoData(
+    @SerializedName("haswr")
+    val haswr : String? = "",//0:仓单预售 1:仓单贸易
+    @SerializedName("lstitem")
+    val lstitem : List<lstitem> = arrayListOf(),
+    @SerializedName("lststep")
+    val lststep : List<lststep> = arrayListOf(),
+    @SerializedName("marketid")
+    val marketid : String? = ""//市场id
+)
+
+data class lstitem(
+    @SerializedName("name")
+    val name : String? = "",
+    @SerializedName("value")
+    val value : String? = ""
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(name)
+        parcel.writeString(value)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<lstitem> {
+        override fun createFromParcel(parcel: Parcel): lstitem {
+            return lstitem(parcel)
+        }
+
+        override fun newArray(size: Int): Array<lstitem?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class lststep(
+    @SerializedName("autoid")
+    val autoid : String? = "",//AutoID
+    @SerializedName("isauto")
+    val isauto : String? = "",//是否自动 - 0:不自动 1:自动
+    @SerializedName("remark")
+    val remark : String? = "",//备注
+    @SerializedName("stepdate")
+    val stepdate : String? = "",//天数信息(T+N)
+    @SerializedName("stepdays")
+    val stepdays : String? = "",//距离上一步天数
+    @SerializedName("stepindex")
+    val stepindex : String? = "",//步骤序号
+    @SerializedName("stepinfo")
+    val stepinfo : String? = "",//步骤信息(步骤名称+步骤值)
+    @SerializedName("steptypeid")
+    val steptypeid : String? = "",//履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
+    @SerializedName("steptypename")
+    val steptypename : String? = "",//步骤名称
+    @SerializedName("stepvalue")
+    val stepvalue : String? = "",//步骤值
+    @SerializedName("templateid")
+    val templateid : String? = ""//履约计划模板ID
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(autoid)
+        parcel.writeString(isauto)
+        parcel.writeString(remark)
+        parcel.writeString(stepdate)
+        parcel.writeString(stepdays)
+        parcel.writeString(stepindex)
+        parcel.writeString(stepinfo)
+        parcel.writeString(steptypeid)
+        parcel.writeString(steptypename)
+        parcel.writeString(stepvalue)
+        parcel.writeString(templateid)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<lststep> {
+        override fun createFromParcel(parcel: Parcel): lststep {
+            return lststep(parcel)
+        }
+
+        override fun newArray(size: Int): Array<lststep?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

+ 8 - 0
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/funcode/FunCode.java

@@ -312,6 +312,14 @@ public class FunCode {
     public static final int FID_WROutApplyReq = 1900657;
     //仓单出库申请响应
     public static final int FID_WROutApplyRsp = 1900658;
+    //持仓单挂牌请求
+    public static final int HdWROrderReq = 1441807;
+    //持仓单挂牌应答
+    public static final int  HdWROrderRsp = 1441808;
+    //持仓单摘牌请求
+    public static final int FID_HdWRDealOrderReq = 1441809;
+    //持仓单摘牌应答
+    public static final int  FID_HdWRDealOrderRsp = 1441810;
 
     //履约手动确认请求
     public static final int PerformanceManualConfirmReq = 1310723;

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

@@ -243,6 +243,33 @@ fun AppCompatActivity.creatGoodsInfoBottomSheetDialog(
     builder.build().show()
 }
 
+/**
+ * 专门用于千海金商品下拉选择的dialog
+ * @receiver AppCompatActivity
+ * @param titleStr 头部内容
+ * @param selectList List<AccountData> 选择的实体列表
+ * @param select [@kotlin.ExtensionFunctionType] Function1<AvaildGoodsGroupData, Unit>?
+ */
+fun AppCompatActivity.creatAccountDataSheetDialog(
+    titleStr: String,
+    selectList: List<AccountData>,
+    select: (AccountData.() -> Unit)? = null
+) {
+    val builder: QMUIBottomSheet.BottomListSheetBuilder =
+        QMUIBottomSheet.BottomListSheetBuilder(this)
+    builder.setGravityCenter(true)
+        .setTitle(titleStr)
+        .setAddCancelBtn(true)
+    selectList.forEach {
+        builder.addItem(it.accountid.toString())
+    }
+    builder.setOnSheetItemClickListener { dialog, itemView, position, tag ->
+        select?.invoke(selectList.get(position))
+        dialog.dismiss()
+    }
+    builder.build().show()
+}
+
 
 /**
  * 专门用新增现货商品时的套保品种选择

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

@@ -172,6 +172,7 @@ class YSOnePriceUI(private val fragment : Fragment, private val viewModel: Hnstc
 
     val root = _FrameLayout(fragment.context!!).apply {
         verticalLayout {
+            viewModel.queryOneOrderQuote()
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
@@ -278,7 +279,7 @@ class YSOnePriceUI(private val fragment : Fragment, private val viewModel: Hnstc
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.floatProceDataList.bindOptional(context) {
+            viewModel.onePrcieDataList.bindOptional(context) {
 //                if (it?.size ?: 0 > 10){
 //                    lastShow = 10
 //                }else{
@@ -332,6 +333,7 @@ class YSFloatingPriceUI(private val fragment : Fragment, private val viewModel:
 
     val root = _FrameLayout(fragment.context!!).apply {
         verticalLayout {
+            viewModel.queryFloatOrderQuote()
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL

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

@@ -2,6 +2,7 @@ package cn.muchinfo.rma.view.base.hnstcdys
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
 
 /**
@@ -15,4 +16,37 @@ class HnstcdysViewModel : BaseViewModel(){
     //浮动价报价牌数据
     val floatProceDataList : MutableLiveData<List<OrderQuoteData>> = MutableLiveData()
 
+
+    /**
+     * 查询一口价报价牌
+     */
+    fun queryOneOrderQuote(){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","1")
+            put("haswr","0")
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                onePrcieDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 查询浮动价报价牌
+     */
+    fun queryFloatOrderQuote(){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
+            put("haswr","0")//0:仓单预售 1:仓单贸易
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                floatProceDataList.postValue(respData)
+            }
+        }
+    }
+
 }

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

@@ -120,6 +120,16 @@ class SpotWareHouseActivity : BaseActivity<SpotWareHouseViewModel>(){
 
     }
 
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryspotSummaryWrPosition()
+        viewModel.querySpecifyDealPosition()
+        viewModel.querydealPosition()
+        viewModel.queryAreCancelWrPosition()
+        viewModel.querywarehouseSummaryWrPosition()
+        viewModel.querydetailsWarehouseWrPosition()
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {

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

@@ -112,10 +112,7 @@ public class DetailsWarehouseContentAdapter extends RecyclerView.Adapter<Details
         itemViewHolder.all_click_View.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                if (type.equals("3") || type.equals("2")){//仓库汇总和订单汇总可以点击展开
-//                    itemViewHolder.horItemScrollview.resetClick();
-                    setPosition(i);
-                }
+                setPosition(i);
             }
         });
         itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);

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

@@ -159,7 +159,6 @@ public class SpotWarehouseContentAdapter extends RecyclerView.Adapter<SpotWareho
             public void onGlobalLayout() {
                 if (!itemViewHolder.isLayoutFinish()) {
                     itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
-                    itemViewHolder.horItemScrollview.resetClick();
                     itemViewHolder.setLayoutFinish(true);
                 }
             }

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed
 
+import android.graphics.Color
 import android.os.Build
 import android.os.Bundle
 import android.view.Gravity
@@ -11,23 +12,30 @@ import android.widget.TextView
 import androidx.annotation.RequiresApi
 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.account.loginQeruy.GoodsInfo
 import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.global.utils.TimeUtils
 import cn.muchinfo.rma.global.utils.VIewUtils
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.autoWidget.PickerView.builder.OptionsPickerBuilder
+import cn.muchinfo.rma.view.autoWidget.PickerView.listener.OnOptionsSelectListener
+import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.autoWidget.view.MangeNumberEditText2
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.viewItemUI
+import cn.muchinfo.rma.view.base.main.castsurely.JsonBean
+
 import com.blankj.utilcode.util.ToastUtils
-import mtp.polymer.com.autowidget.dialog.SelectData
-import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
-import mtp.polymer.com.autowidget.dialog.creatGoodsInfoBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.*
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -39,6 +47,17 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
         intent.getParcelableExtra<HoldLBData>("data") as HoldLBData
     }
 
+    private var options1Items: List<JsonBean> = java.util.ArrayList<JsonBean>()
+    private var options2Items = java.util.ArrayList<java.util.ArrayList<String>>()
+
+    var opt1tx: JsonBean? = null
+    var opt2tx: JsonBean.CityBean? = null
+
+    /**
+     * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
+     */
+    var tradedate: String = ""
+
     //基差输入
     lateinit var basisInputEdittext: MangeNumberEditText2
 
@@ -51,6 +70,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     //摘牌金额
     lateinit var one_delisting_amount: TextView
 
+    //摘牌金额
+    lateinit var month_text: TextView
+
     //挂牌价格输入
     lateinit var onePriceInputEdittext : MangeNumberEditText2
 
@@ -62,19 +84,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
     /**
      * 选择的行情商品
      */
-    var selectGoodsInfo: MutableLiveData<GoodsInfo> = MutableLiveData()
+    var selectGoodsInfo: MutableLiveData<SelectData> = MutableLiveData()
 
 
     fun initData(){
         listedType.postValue(SelectData(id = "1",value = "一口价"))
+        viewModel.initSelectGoodsInfo()
     }
 
     @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             initData()
-            background = resources.getDrawable(R.color.segtabment_bg_color)
+            background = resources.getDrawable(R.color.white)
             topBar {
                 commonLeftButton()
                 commonTitle {
@@ -104,11 +128,8 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
 
-                            emptyView()
 
-                            imageView {
-                                imageResource = R.mipmap.rma_more
-                            }.lparams(autoSize(36), autoSize(36))
+
 
                         }.lparams(matchParent, autoSize(132))
 
@@ -133,12 +154,6 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
 
-                            emptyView()
-
-                            imageView {
-                                imageResource = R.mipmap.rma_more
-                            }.lparams(autoSize(36), autoSize(36))
-
                         }.lparams(matchParent, autoSize(132))
 
                         itemView()
@@ -162,12 +177,6 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
 
-                            emptyView()
-
-                            imageView {
-                                imageResource = R.mipmap.rma_more
-                            }.lparams(autoSize(36), autoSize(36))
-
                         }.lparams(matchParent, autoSize(132))
 
                         viewItemUI()
@@ -190,21 +199,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     listedType.postValue(this)
                                 }
                             }
-                            textView {
-                                visibility = View.INVISIBLE
-                                text = "*"
-                                textColorInt = R.color.rma_star_color
-                                textSizeAuto = 31
-                            }.lparams(wrapContent, wrapContent) {
-                                marginStart = autoSize(37)
-                            }
+
 
                             textView {
                                 text = "挂牌方式"
-                                textSizeAuto = 31
-                                textColorInt = R.color.rma_black_33
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_hint_text_color_ccc
                             }.lparams(wrapContent, wrapContent) {
-                                marginStart = autoSize(10)
+                                marginStart = autoSize(36)
                             }
 
                             textView {
@@ -240,37 +242,47 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
-                                val selectGoodsInfoList = arrayListOf<GoodsInfo>()
-                                val goodsInfoList = DataBase.getInstance().goodsInfoDao().all
-                                goodsInfoList.forEach {
-                                    if (it.marketid == 17201) {
-                                        selectGoodsInfoList.add(it)
-                                    }
-                                }
-                                creatGoodsInfoBottomSheetDialog("请选择商品", selectGoodsInfoList) {
-                                    selectGoodsInfo.postValue(this)
-                                }
-                            }
-                            textView {
-                                visibility = View.INVISIBLE
-                                text = "*"
-                                textColorInt = R.color.rma_star_color
-                                textSizeAuto = 31
-                            }.lparams(wrapContent, wrapContent) {
-                                marginStart = autoSize(37)
+                                val pvOptions = OptionsPickerBuilder(
+                                    context,
+                                    OnOptionsSelectListener { options1, options2, options3, v ->
+                                        opt2tx =
+                                            if (options2Items.size > 0 && options2Items.get(options1).size > 0)
+                                                options1Items.get(options1).cityList.get(options2)
+                                            else
+                                                JsonBean.CityBean()
+                                        selectGoodsInfo.postValue(
+                                            SelectData(
+                                                id = opt2tx?.autoId ?: "",
+                                                value = opt2tx?.name ?: ""
+                                            )
+                                        )
+                                    })
+                                    .setTitleText("定投策略选择")
+                                    .setDividerColor(Color.BLACK)
+                                    .setTextColorCenter(Color.BLACK) //设置选中项文字颜色
+                                    .setContentTextSize(20)
+                                    .build<Any>()
+
+                                options1Items = viewModel.firstSelectData.value!!
+                                options2Items =
+                                    viewModel.secondSelectData.value!! as ArrayList<ArrayList<String>>
+                                pvOptions.setPicker(
+                                    viewModel.firstSelectData.value,
+                                    viewModel.secondSelectData.value
+                                )
+                                pvOptions.show()
                             }
-
                             textView {
-                                text = "行情商品"
-                                textSizeAuto = 31
-                                textColorInt = R.color.rma_black_33
+                                text = "挂牌方式"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_hint_text_color_ccc
                             }.lparams(wrapContent, wrapContent) {
-                                marginStart = autoSize(10)
+                                marginStart = autoSize(36)
                             }
 
                             textView {
                                 selectGoodsInfo.bindOptional(context) {
-                                    text = it?.goodsname
+                                    text = it?.value
                                     textColorInt = R.color.rma_black_33
                                 }
                                 text = "请选择交易所/商品/合约"
@@ -312,8 +324,9 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                             numberEditText {
                                 onePriceInputEdittext = this
+                                text = "0"
                                 setOnTextChangeListener { view, value ->
-
+                                    one_delisting_amount.text = NumberUtils.roundNum(value.toDouble().times(listednumberEdittext.text.toShort().toDouble()),2)
                                 }
 
                             }.lparams(0, autoSize(72), 1f) {
@@ -344,6 +357,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
 
                             numberEditText {
                                 basisInputEdittext = this
+                                text = "1"
                                 setOnTextChangeListener { view, value ->
 
                                 }
@@ -373,11 +387,14 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     gravity = Gravity.CENTER_VERTICAL
                                     numberEditText {
                                         listednumberEdittext = this
+                                        text = "1"
                                         setOnTextChangeListener { view, value ->
-
+                                            one_delisting_amount.text = NumberUtils.roundNum(value.toDouble().times(onePriceInputEdittext.text.toShort().toDouble()),2)
                                         }
 
-                                    }.lparams(0, autoSize(72), 1f)
+                                    }.lparams(0, autoSize(72), 1f){
+                                        marginEnd = autoSize(36)
+                                    }
 
                                     textView {
                                         text = "吨"
@@ -403,7 +420,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                             p1: Int,
                                             p2: Boolean
                                         ) {
-
+                                            listednumberEdittext.text = NumberUtils.roundNum(data.enableqty?.toDouble()?.times(p1.div(100.0))?.toString(),0)
                                         }
 
                                         override fun onStartTrackingTouch(p0: SeekBar?) {
@@ -429,7 +446,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                     emptyView()
 
                                     textView {
-                                        text = "80吨"
+                                        text = data.enableqty + "吨"
                                         textSizeAuto = 29
                                         textColorInt = R.color.rma_gray_color
                                     }.lparams(wrapContent, wrapContent)
@@ -458,7 +475,6 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             verticalLayout {
                                 linearLayout {
                                     editText {
-                                        isEnabled = false
                                         startInputNumber = this
                                         hint = "请输入起摘数量"
                                         background = null
@@ -467,22 +483,24 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                                         hintColorStr = "#CCCCCC"
                                         textSizeAuto = 31
                                         textColorStr = "#333333"
-                                    }.lparams(0, autoSize(132), 1f) {
-                                        marginStart = autoSize(80)
-                                    }
+                                    }.lparams(0, autoSize(132), 1f)
 
                                     textView {
                                         text = "吨"
                                         textSizeAuto = 31
                                         textColorInt = R.color.rma_black_33
-                                    }.lparams(wrapContent, wrapContent)
+                                    }.lparams(wrapContent, wrapContent){
+                                        marginEnd = autoSize(36)
+                                    }
                                 }.lparams(matchParent, autoSize(100))
 
                                 textView {
                                     text = "最小单位1吨"
                                     textSizeAuto = 29
                                     textColorInt = R.color.rma_hint_text_color_ccc
-                                }.lparams(wrapContent, wrapContent)
+                                }.lparams(wrapContent, wrapContent){
+                                    marginEnd = autoSize(36)
+                                }
                             }.lparams(matchParent, autoSize(167))
 
                         }.lparams(matchParent, autoSize(167))
@@ -507,13 +525,54 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                             }
 
                             textView {
+                                text = "0"
                                 one_delisting_amount = this
-                                textSizeAuto = 29
+                                textSizeAuto = 34
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent)
                         }.lparams(matchParent, autoSize(143)) {
                             bottomMargin = autoSize(200)
                         }
+
+                        linearLayout {
+                            onThrottleFirstClick {
+                                showDataSelectDialog(type = "2") {
+                                    month_text.text = this
+                                }
+                            }
+                            listedType.bindOptional(context) {
+                                if (it?.id == "2") {
+                                    visibility = View.VISIBLE
+                                } else {
+                                    visibility = View.GONE
+                                }
+                            }
+                            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")
+                                month_text = 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)) {
+                            bottomMargin = autoSize(200)
+                        }
                     }
                 }
 
@@ -522,7 +581,62 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
                         onThrottleFirstClick {
-
+                            if (listedType.value?.id == "1"){//一口价
+                                viewModel.requeryWRListingOrderReq(
+                                    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 = WarehouseTradeMI1.WRGoodsInfo.newBuilder().build(),
+                                    TimevalidType = 4,
+                                    FirstRatio = 0.0,
+                                    PerformanceTemplateID = 0,
+                                    BuyOrSell = 1,
+                                    PriceDisplayMode = 1,
+                                    CanBargain = 0,
+                                    ApplyID = 0,
+                                    CanPart = 1,
+                                    HasWr = 1,
+                                    WRStandardID = data.wrstandardid?.toInt() ?: 0
+                                ){
+                                    finish()
+                                }
+                            }else{//浮动价
+                                viewModel.requeryWRListingOrderReq(
+                                    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 = 2,
+                                    WRTradeGoods = getWRTradeGoods(),
+                                    PriceFactor = 1.0,
+                                    PriceMove = basisInputEdittext.text.toString().toDouble(),
+                                    TimevalidType = 4,
+                                    FirstRatio = 0.0,
+                                    PerformanceTemplateID = 0,
+                                    BuyOrSell = 1,
+                                    PriceDisplayMode = 1,
+                                    CanBargain = 0,
+                                    ApplyID = 0,
+                                    CanPart = 1,
+                                    HasWr = 1,
+                                    WRStandardID = data.wrstandardid?.toInt() ?: 0
+                                ){
+                                    finish()
+                                }
+                            }
                         }
                         gravity = Gravity.CENTER
                         backgroundResource = R.mipmap.rma_save_info_bg
@@ -537,11 +651,21 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 }.lparams(matchParent, autoSize(144)) {
                     gravity = Gravity.BOTTOM
                 }
-            }
+            }.lparams(matchParent, matchParent)
 
         }
     }
 
+    fun getWRTradeGoods() : WarehouseTradeMI1.WRGoodsInfo{
+        val wRTradeGoods = WarehouseTradeMI1.WRGoodsInfo.newBuilder()
+        wRTradeGoods.setGoodsID(selectGoodsInfo.value?.id?.toInt() ?: 0)
+        wRTradeGoods.setGoodsCode(selectGoodsInfo.value?.value ?: "")
+        wRTradeGoods.setPriceFactor(1.0)
+        wRTradeGoods.setPriceMove(1.0)
+        wRTradeGoods.setWeightRatio(1.0)
+        return wRTradeGoods.build()
+    }
+
     /**
      * 提交数据前的校验
      */
@@ -572,7 +696,7 @@ class ListedActivity : BaseActivity<ListedViewModel>() {
                 return false
             }
         }else{//浮动价校验
-            if (selectGoodsInfo.value?.goodsname.isNullOrEmpty()){
+            if (selectGoodsInfo.value?.value.isNullOrEmpty()){
                 ToastUtils.showLong("请选择行情商品")
                 return false
             }

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

@@ -1,11 +1,182 @@
 package cn.muchinfo.rma.view.base.hnstmain.spotwarehouse.listed
 
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.GoodsGroupData
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsGroups
+import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.protobuf.protoclasses.WarehouseTradeMI1
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.main.castsurely.JsonBean
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 现货仓单-挂单
  */
 class ListedViewModel : BaseViewModel(){
 
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+
+    val firstSelectData : MutableLiveData<List<JsonBean>> = MutableLiveData()//商品组
+
+    val secondSelectData : MutableLiveData<List<List<String>>> = MutableLiveData()//商品
+
+    //初始化选择商品的数据
+    fun initSelectGoodsInfo(){
+        val selectGoodsGroupsList = arrayListOf<JsonBean>()//最终组装的商品选择列表
+        val selectGoodsName = arrayListOf<List<String>>()//每个商品组对应的商品名称
+        val marketData = GlobalDataCollection.instance?.loginQueryData?.market?.find { it.trademode == 99 }//找出trademode 为99的市场
+        val goodsGroupList = arrayListOf<GoodsGroups>()
+        GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.forEach {
+            if (it.marketid == marketData?.marketid){
+                goodsGroupList.add(it)
+            }
+        }
+
+        val goodsInfoList = DataBase.getInstance().goodsInfoDao().all
+        goodsGroupList.forEach {data ->
+            val jsonBean = JsonBean()//每个商品组的组合
+            val goodsList  = arrayListOf<JsonBean.CityBean>()//商品组对应的商品列表
+            val selectGoodsCode = arrayListOf<String>()
+            jsonBean.autoId = data.goodsgroupid.toString()
+            jsonBean.name = data.goodsgroupname
+            goodsInfoList?.forEach {
+                if (it?.goodsgroupid == data.goodsgroupid){
+                    val jsonSonBean = JsonBean.CityBean()
+                    jsonSonBean.autoId = it.goodsid.toString()
+                    jsonSonBean.name = it.goodscode
+                    goodsList.add(jsonSonBean)
+                    selectGoodsCode.add(it.goodscode)
+                }
+            }
+            selectGoodsName.add(selectGoodsCode)
+            jsonBean.cityList = goodsList
+            selectGoodsGroupsList.add(jsonBean)
+        }
+
+        firstSelectData.postValue(selectGoodsGroupsList)
+        secondSelectData.postValue(selectGoodsName)
+    }
+
+    /**
+     *
+     * @param LadingBillId Long
+     * @param TradeDate String
+     * @param SubNum Long
+     * @param WRFactorTypeId Long
+     * @param UserID Int
+     * @param AccountID Long
+     * @param IsSpecified Int
+     * @param MatchAccIDs List<Long>
+     * @param OrderQty Long
+     * @param DeliveryGoodsID Int
+     * @param WRPriceType Int
+     * @param FixedPrice Double
+     * @param WRTradeGoods WRGoodsInfo
+     * @param PriceFactor Double
+     * @param PriceMove Double
+     * @param TimevalidType Int
+     * @param FirstRatio Double
+     * @param PerformanceTemplateID Long
+     * @param BuyOrSell Int
+     * @param PriceDisplayMode Int
+     * @param CanBargain Int
+     * @param Attachment1 String
+     * @param Attachment2 String
+     * @param Remark String
+     * @param ApplyID Long
+     * @param CanPart Int
+     * @param HasWr Int
+     * @param WRStandardID Int
+     * @param isSuccess Function1<[@kotlin.ParameterName] Boolean, Unit>
+     */
+    fun requeryWRListingOrderReq(
+        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集合(指定对手时填写)
+//        DeliveryMonth : String = "",//交收月
+        HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        WRStandardID: Int = 0,//现货品种ID
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.warehouseManager?.HdWROrderReq(
+                LadingBillId = LadingBillId,
+                TradeDate = TradeDate,
+                AccountID = AccountID,
+                OrderQty = OrderQty,
+                IsSpecified = IsSpecified,
+                SubNum = SubNum,
+                DeliveryGoodsID = DeliveryGoodsID,
+                WRFactorTypeId = WRFactorTypeId,
+                UserID = UserID,
+                MatchAccIDs = MatchAccIDs,
+                WRPriceType = WRPriceType,
+                FixedPrice = FixedPrice,
+                WRTradeGoods = WRTradeGoods,
+                PriceFactor = PriceFactor,
+                PriceMove = PriceMove,
+                TimevalidType = TimevalidType,
+                FirstRatio = FirstRatio,
+                PerformanceTemplateID = PerformanceTemplateID,
+                BuyOrSell = BuyOrSell,
+                CanPart = CanPart,
+                HasWr = HasWr,
+                WRStandardID = WRStandardID,
+                PriceDisplayMode = PriceDisplayMode,
+                CanBargain = CanBargain,
+                Attachment1 = Attachment1,
+                Attachment2 = Attachment2,
+                Remark = Remark,
+                ApplyID = ApplyID
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
 
 }

+ 13 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessBuyHallViewHolder.kt

@@ -22,11 +22,15 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @constructor
  */
-class BusinessBuyHallViewHolder(private val activity : AppCompatActivity, private val viewModel: BusinessHallViewModel) : BaseViewHolder<OrderQuoteDetailData>(activity){
+class BusinessBuyHallViewHolder(private val activity : AppCompatActivity, private val viewModel: BusinessHallViewModel,private val pricetype : String) : BaseViewHolder<OrderQuoteDetailData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
+            onThrottleFirstClick {
+                viewModel.setOnBuyItemClick(data.value?.wrtradeorderid ?: "")
+            }
+
             linearLayout {
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
@@ -81,7 +85,14 @@ class BusinessBuyHallViewHolder(private val activity : AppCompatActivity, privat
 
                 textView {
                     onThrottleFirstClick {
-
+                        onThrottleFirstClick {
+                            viewModel.selectData.postValue(data.value)
+                            if (pricetype == "1"){//一口价
+                                viewModel.showOnePriceDialog.postValue(true)
+                            }else{//浮动价
+                                viewModel.showFloatPriceDialog.postValue(true)
+                            }
+                        }
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER

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

@@ -16,6 +16,7 @@ import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.AccountData
 import cn.muchinfo.rma.global.data.OrderQuoteData
 import cn.muchinfo.rma.global.data.OrderQuoteDetailData
 import cn.muchinfo.rma.global.data.SpotGoodsPriceData
@@ -31,12 +32,16 @@ import cn.muchinfo.rma.view.base.home.contract.verticalEmptyView
 import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewHolder
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.ToastUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.creatAccountDataSheetDialog
+import mtp.polymer.com.autowidget.dialog.creatGoodsInfoBottomSheetDialog
 import mtp.polymer.com.autowidget.dialog.createCustomDialog
 import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 
@@ -49,19 +54,20 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
 
+    //1 仓单贸易 2 仓单预售
+    val type by lazy { intent.getStringExtra("type") }
+
+    //1是一口价 2是浮动价
+    val pricetype by lazy { intent.getStringExtra("pricetype") }
+
     val data by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
 
     //卖大厅
-    private val sellHallUI by lazy { SellHallUI(this,viewModel) }
+    private val sellHallUI by lazy { SellHallUI(this,viewModel,type ?: "",pricetype ?: "",data) }
 
     //买大厅
-    private val buyHallUI by lazy { BuyHallUI(this,viewModel) }
+    private val buyHallUI by lazy { BuyHallUI(this,viewModel,type ?: "",pricetype ?: "",data) }
 
-    /** 一口价摘牌输入框 **/
-    lateinit var onePriceInputEdittext: MangeNumberEditText2
-
-    /*** 一口价摘牌金额 **/
-    lateinit var one_delisting_amount : TextView
 
     /** 浮动价摘牌输入框 **/
     lateinit var floatPriceInputEdittext: MangeNumberEditText2
@@ -113,9 +119,11 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
 
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            createLoadingDialog(hintStr = "").bindTaskStatus(context, viewModel.loadingDialogStatus)
             initMenuData()
             background = resources.getDrawable(R.color.white)
             //头部标题
@@ -325,13 +333,321 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
             segment.setupWithViewPager(viewPager)
             segment.selectTab(selectedTabIndex)
             selectIndex.postValue(selectedTabIndex)
+
+            viewModel.showOnePriceDialog.bindOptional(context){
+                if (it == true){
+                    creatOneSellOrBuyDialog(type = type ?: "",pricetype = pricetype ?: "",data = data,buySelldata = viewModel.selectData.value ?: OrderQuoteDetailData())
+                }
+            }
         }
 
     }
 
     //一口价 摘牌
     @RequiresApi(Build.VERSION_CODES.O)
-    fun creatOneSellOrBuyDialog(data : OrderQuoteDetailData){
+    fun creatOneSellOrBuyDialog(type: String,pricetype: String,buySelldata : OrderQuoteDetailData,data: OrderQuoteData){
+
+        val selectAccountData : MutableLiveData<AccountData> = MutableLiveData()
+
+        /** 摘牌数量 **/
+        lateinit var onePriceInputNumberEdittext: MangeNumberEditText2
+
+
+        /*** 一口价摘牌金额 **/
+        lateinit var one_delisting_amount : TextView
+
+        createCustomDialog(cancelable = false) { dialog ->
+
+            backgroundColor = Color.parseColor("#5f000000")
+            selectAccountData.postValue(GlobalDataCollection.instance?.accountData)
+            verticalLayout {
+                backgroundDrawable = createRoundRectDrawable("#ffffff", 24)
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    onThrottleFirstClick {
+                        creatAccountDataSheetDialog("请选择资金账号", GlobalDataCollection.instance?.accountDataList ?: arrayListOf()) {
+                            selectAccountData.postValue(this)
+                        }
+                    }
+                    linearLayout {
+                        textView {
+                            text = "交易账户"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
+
+                    textView {
+                        selectAccountData.bindOptional(context){
+                            text = it?.accountid.toString() + "   " + it?.accountname
+                        }
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_more
+                    }.lparams(autoSize(36), autoSize(36))
+
+                }.lparams(matchParent, autoSize(172))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        textView {
+                            text = "挂牌方"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
+
+                    textView {
+                        text = buySelldata.username
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(matchParent, autoSize(143))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        textView {
+                            text = "挂牌价格"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
+
+                    textView {
+                        text = buySelldata.fixedprice
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(matchParent, autoSize(143))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        textView {
+                            text = "挂牌数量"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
+
+                    textView {
+                        text = buySelldata.orderqty
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(matchParent, autoSize(143))
+
+                itemView()
+
+                linearLayout {
+                    verticalLayout {
+                        textView {
+                            text = "摘牌数量"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                            topMargin = autoSize(36)
+                        }
+
+                        textView {
+                            text = "(10吨起)"
+                            textSizeAuto = 29
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                            topMargin = autoSize(20)
+                        }
+                    }.lparams(autoSize(250), autoSize(290))
+
+                    verticalLayout {
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            numberEditText {
+                                onePriceInputNumberEdittext = this
+                                setOnTextChangeListener { view, value ->
+                                    one_delisting_amount.text = value?.toDouble()?.times(buySelldata.fixedprice?.toDouble() ?: 0.0).toString()
+                                }
+
+                            }.lparams(0, autoSize(72),1f){
+                                marginEnd = autoSize(36)
+                            }
+
+                            textView {
+                                text = "吨"
+                                textSizeAuto = 34
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent){
+                                marginEnd = autoSize(36)
+                            }
+                        }.lparams(matchParent, autoSize(143))
+
+
+                        inflateLayout<SeekBar>(R.layout.main_seekbar)  {
+                            min = 10
+                            max = 100
+                            isIndeterminate = false
+                            splitTrack = false
+                            setPadding(0,0,0,0)
+                            thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
+                            progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
+                            setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
+                                override fun onProgressChanged(p0: SeekBar?, p1: Int, p2: Boolean) {
+                                    onePriceInputNumberEdittext.text = NumberUtils.roundNum(buySelldata.orderqty?.toDouble()?.times(p1.div(100.0)).toString(),0)
+                                }
+
+                                override fun onStartTrackingTouch(p0: SeekBar?) {
+
+                                }
+
+                                override fun onStopTrackingTouch(p0: SeekBar?) {
+
+                                }
+                            })
+                        }.lparams(matchParent, autoSize(46)){
+                            marginEnd = autoSize(110)
+                            topMargin = autoSize(20)
+                        }
+
+                        linearLayout {
+                            textView {
+                                text = "0"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_gray_color
+                            }.lparams(wrapContent, wrapContent)
+
+                            emptyView()
+
+                            textView {
+                                text = buySelldata.orderqty + "吨"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_gray_color
+                            }.lparams(wrapContent, wrapContent)
+                        }.lparams(matchParent, wrapContent){
+                            marginEnd = autoSize(110)
+                            topMargin = autoSize(10)
+                        }
+
+                    }.lparams(matchParent, autoSize(290))
+                }.lparams(matchParent, autoSize(290))
+
+                itemView()
+
+                linearLayout {
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        text = "摘牌金额"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(autoSize(214), wrapContent){
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        one_delisting_amount = this
+                        textSizeAuto = 29
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(matchParent, autoSize(143))
+
+                verticalEmptyView()
+
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        onThrottleFirstClick {
+                            if (onePriceInputNumberEdittext.text.toString().isNullOrEmpty() || onePriceInputNumberEdittext.text.toString().toDouble() == 0.0){
+                                return@onThrottleFirstClick
+                                ToastUtils.showLong("请输入摘牌数量")
+                            }
+
+                            if (buySelldata.buyorsell == "0"){//买单所以是摘卖
+                                viewModel.HdWRDealOrderReq(
+                                    RelatedWRTradeOrderID = buySelldata.wrtradeorderid?.toLong() ?: 0,
+                                    WRTransferUserID = buySelldata.userid?.toInt() ?: 0,
+                                    OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
+                                    BuyOrSell = 1,
+                                    LadingBillId = 0,
+                                    SubNum = 0,
+                                    WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                    DeliveryMonth = data.deliverymonth ?: "",
+                                    HasWr = 1
+                                ){
+                                    dialog.dismiss()
+                                }
+                            }else{//卖单所以是摘买
+                                viewModel.HdWRDealOrderReq(
+                                    RelatedWRTradeOrderID = buySelldata.wrtradeorderid?.toLong() ?: 0,
+                                    WRTransferUserID = buySelldata.userid?.toInt() ?: 0,
+                                    OrderQty = onePriceInputNumberEdittext.text.toString().toLong(),
+                                    BuyOrSell = 0,
+                                    LadingBillId = 0,
+                                    SubNum = 0,
+                                    WRFactorTypeId = data.wrfactortypeid?.toLong() ?: 0,
+                                    DeliveryMonth = data.deliverymonth ?: "",
+                                    HasWr = 1
+                                ){
+                                    dialog.dismiss()
+                                }
+                            }
+
+                        }
+                        gravity = Gravity.CENTER
+                        backgroundResource = R.drawable.qhj_main_blue_bg
+                        text = "卖出"
+                        textSizeAuto = 38
+                        textColorInt = R.color.white
+                    }.lparams(autoSize(419), autoSize(119)) {
+                        marginStart = autoSize(24)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            dialog.dismiss()
+                        }
+                        gravity = Gravity.CENTER
+                        backgroundResource = R.drawable.hnxt_cancel_bg
+                        text = "取消"
+                        textColorInt = R.color.white
+                        textSizeAuto = 38
+                    }.lparams(autoSize(419), autoSize(119)) {
+                        marginStart = autoSize(13)
+                    }
+                }.lparams(matchParent, autoSize(144)) {
+                    gravity = Gravity.BOTTOM
+                }
+
+            }.lparams(matchParent, matchParent){
+                topMargin = autoSize(120)
+            }
+        }.show()
+    }
+
+    //浮动价 摘牌
+    @RequiresApi(Build.VERSION_CODES.O)
+    fun creatFloatSellOrBuyDialog(type: String,pricetype: String,data : OrderQuoteDetailData){
 
         createCustomDialog(cancelable = false) { dialog ->
 
@@ -393,7 +709,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                     gravity = Gravity.CENTER_VERTICAL
                     linearLayout {
                         textView {
-                            text = "挂牌价格"
+                            text = "基差"
                             textSizeAuto = 34
                             textColorInt = R.color.rma_hint_text_color_ccc
                         }.lparams(wrapContent, wrapContent){
@@ -402,9 +718,9 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                     }.lparams(autoSize(250), wrapContent)
 
                     textView {
-                        text = data.fixedprice
+                        text = "10"
                         textSizeAuto = 34
-                        textColorInt = R.color.rma_black_33
+                        textColorInt = R.color.buy_hall_color
                     }.lparams(wrapContent, wrapContent)
                 }.lparams(matchParent, autoSize(143))
 
@@ -456,7 +772,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
                             numberEditText {
-                                onePriceInputEdittext = this
+                                floatPriceInputEdittext = this
                                 setOnTextChangeListener { view, value ->
 
                                 }
@@ -472,9 +788,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                             }
                         }.lparams(matchParent, autoSize(143))
 
-                        seekBar {
+                        inflateLayout<SeekBar>(R.layout.main_seekbar)  {
                             min = 10
                             max = 100
+                            isIndeterminate = false
+                            splitTrack = false
+                            setPadding(0,0,0,0)
                             thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
                             progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                             setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
@@ -530,7 +849,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                     }
 
                     textView {
-                        one_delisting_amount = this
+                        float_delisting_amount = this
                         textSizeAuto = 29
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent)
@@ -570,13 +889,15 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                     gravity = Gravity.BOTTOM
                 }
 
-            }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, matchParent){
+                topMargin = autoSize(120)
+            }
         }.show()
     }
 
-    //浮动价 摘牌
+    //融资摘牌 type 1 一口价 2 浮动价
     @RequiresApi(Build.VERSION_CODES.O)
-    fun creatFloatSellOrBuyDialog(data : OrderQuoteDetailData){
+    fun creatFinancingDialog(data : OrderQuoteDetailData,type : String){
 
         createCustomDialog(cancelable = false) { dialog ->
 
@@ -635,6 +956,35 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                 itemView()
 
                 linearLayout {
+                    visibility = if (type == "1"){
+                        View.VISIBLE
+                    }else{
+                        View.GONE
+                    }
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        textView {
+                            text = "挂牌价格"
+                            textSizeAuto = 34
+                            textColorInt = R.color.rma_hint_text_color_ccc
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(250), wrapContent)
+
+                    textView {
+                        text = data.fixedprice
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent)
+                }.lparams(matchParent, autoSize(143))
+
+                linearLayout {
+                    visibility = if (type == "2"){
+                        View.VISIBLE
+                    }else{
+                        View.GONE
+                    }
                     gravity = Gravity.CENTER_VERTICAL
                     linearLayout {
                         textView {
@@ -717,9 +1067,12 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
                             }
                         }.lparams(matchParent, autoSize(143))
 
-                        seekBar {
+                        inflateLayout<SeekBar>(R.layout.main_seekbar)  {
                             min = 10
                             max = 100
+                            isIndeterminate = false
+                            splitTrack = false
+                            setPadding(0,0,0,0)
                             thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
                             progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                             setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
@@ -827,7 +1180,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>(){
  * @property viewModel BusinessHallViewModel
  * @constructor
  */
-class SellHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
+class SellHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel,private val type : String,private val pricetype : String,private val data: OrderQuoteData){
 
     // 下拉刷新
     private lateinit var swipeToLayout: SwipeToLoadLayout
@@ -837,12 +1190,14 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
         BaseAdapter { _, _ ->
             BusinessSellHallViewHolder(
                 activity,
-                viewModel
+                viewModel,
+                pricetype
             )
         }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {
+            viewModel.querySellDataList(type, pricetype, data)
             linearLayout {
                 background = resources.getDrawable(R.color.hnst_sell_hall_top_bg_color)
                 linearLayout {
@@ -881,14 +1236,14 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 setRetryAction {
-
+                    viewModel.querySellDataList(type, pricetype, data)
                 }
                 swipeToLoadLayout {
                     swipeToLayout = this
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-
+                        viewModel.querySellDataList(type, pricetype, data)
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -926,7 +1281,7 @@ class SellHallUI(private val activity : AppCompatActivity,private val viewModel:
  * @property viewModel BusinessHallViewModel
  * @constructor
  */
-class BuyHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel){
+class BuyHallUI(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel,private val type : String,private val pricetype : String,private val data: OrderQuoteData){
 
     // 下拉刷新
     private lateinit var swipeToLayout: SwipeToLoadLayout
@@ -936,12 +1291,14 @@ class BuyHallUI(private val activity : AppCompatActivity,private val viewModel:
         BaseAdapter { _, _ ->
             BusinessBuyHallViewHolder(
                 activity,
-                viewModel
+                viewModel,
+                pricetype
             )
         }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {
+            viewModel.queryBuyDataList(type, pricetype, data)
             linearLayout {
                 background = resources.getDrawable(R.color.hnst_buy_hall_top_bg_color)
                 linearLayout {
@@ -980,14 +1337,14 @@ class BuyHallUI(private val activity : AppCompatActivity,private val viewModel:
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 setRetryAction {
-
+                    viewModel.queryBuyDataList(type, pricetype, data)
                 }
                 swipeToLoadLayout {
                     swipeToLayout = this
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-
+                        viewModel.queryBuyDataList(type, pricetype, data)
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)

+ 98 - 333
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallDetailsActivity.kt

@@ -4,6 +4,7 @@ import android.os.Bundle
 import android.view.Gravity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
@@ -13,13 +14,14 @@ import org.jetbrains.anko.*
 /**
  *  华南信通 - 商品详情
  */
-class BusinessHallDetailsActivity : BaseActivity<BusinessHallViewModel>(){
+class BusinessHallDetailsActivity : BaseActivity<BusinessHallViewModel>() {
 
     val data by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            viewModel.queryWrGoodsInfo(data)
             background = resources.getDrawable(R.color.white)
             //头部标题
             topBar {
@@ -29,344 +31,107 @@ class BusinessHallDetailsActivity : BaseActivity<BusinessHallViewModel>(){
                 }
             }
 
-            BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "品种"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.deliverygoodsname
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-            BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "品类"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.deliverygoodsname // TODO 品类缺失
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-             BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "品牌"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.wrstandardname
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-            BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "仓库"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.warehousecode
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-            BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "产地"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.warehousecode//TODO 缺少产地
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-             BusinessItemView()
-
-            linearLayout {
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "含铜量"
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(240), autoSize(96))
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = data.warehousecode
-                        textSizeAuto = 31
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(0, autoSize(96),1f)
-
-                view {
-                    background = resources.getDrawable(R.color.hnst_line_color)
-                }.lparams(autoSize(1), autoSize(96))
-            }.lparams(matchParent, autoSize(96)){
-                marginStart = autoSize(12)
-                marginEnd = autoSize(12)
-            }
-
-            BusinessItemView()
-
-
-            textView {
-                text = "履约规则:"
-                textSizeAuto = 34
-                textColorInt = R.color.rma_black_33
-            }.lparams(wrapContent, wrapContent){
-                marginStart = autoSize(36)
-                topMargin = autoSize(64)
-            }
-
-            relativeLayout {
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    backgroundResource = R.mipmap.hnst_detail_bg_one
-                    textView {
-                        text = "买方30%货款"
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(233), autoSize(72)){
-                    marginStart = autoSize(36)
-                }
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    backgroundResource = R.mipmap.hnst_detail_bg_two
-                    textView {
-                        text = "卖方发货"
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(194), autoSize(72)){
-                    marginStart = autoSize(258)
-                }
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    backgroundResource = R.mipmap.hnst_detail_bg_three
-                    textView {
-                        text = "买方70%货款"
-                        textSizeAuto = 29
-                        textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(256), autoSize(72)){
-                    marginStart = autoSize(442)
-                }
-
-                linearLayout {
-                    gravity = Gravity.CENTER
-                    backgroundResource = R.mipmap.hnst_detail_bg_three
-                    textView {
-                        text = "卖方开票"
-                        textSizeAuto = 29
+            scrollView {
+                verticalLayout {
+                    verticalLayout {
+                        viewModel.wrGoodsInfoData.bindOptional(context) {
+                            it?.lstitem?.forEach {
+                                BusinessItemView()
+
+                                linearLayout {
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+                                    linearLayout {
+                                        background = resources.getDrawable(R.color.qhj_rule_bg_color)
+                                        gravity = Gravity.CENTER
+                                        textView {
+                                            text = it.name
+                                            textSizeAuto = 31
+                                            textColorInt = R.color.rma_blue_color
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(autoSize(240), autoSize(96))
+
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+
+                                    linearLayout {
+                                        gravity = Gravity.CENTER
+                                        textView {
+                                            text = it.value
+                                            textSizeAuto = 31
+                                            textColorInt = R.color.rma_black_33
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(0, autoSize(96), 1f)
+
+                                    view {
+                                        background = resources.getDrawable(R.color.hnst_line_color)
+                                    }.lparams(autoSize(1), autoSize(96))
+                                }.lparams(matchParent, autoSize(96)) {
+                                    marginStart = autoSize(12)
+                                    marginEnd = autoSize(12)
+                                }
+                            }
+                        }
+                    }
+
+                    BusinessItemView()
+
+
+                    textView {
+                        text = "履约规则:"
+                        textSizeAuto = 34
                         textColorInt = R.color.rma_black_33
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(179), autoSize(72)){
-                    marginStart = autoSize(685)
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(36)
+                        topMargin = autoSize(64)
+                    }
+
+                    verticalLayout {
+                        viewModel.wrGoodsInfoData.bindOptional(context){
+                            it?.lststep?.forEach {
+                                linearLayout {
+                                    verticalLayout {
+                                        linearLayout {
+                                            backgroundResource = R.mipmap.hnst_cercler_bg
+                                            gravity = Gravity.CENTER
+                                            textView {
+                                                text = viewModel.wrGoodsInfoData.value?.lststep?.indexOf(it)?.plus(1).toString()
+                                                textSizeAuto = 31
+                                                textColorInt = R.color.white
+                                            }.lparams(wrapContent, wrapContent)
+                                        }.lparams(autoSize(60), autoSize(60)){
+                                            marginStart = autoSize(36)
+                                        }
+
+
+                                    }.lparams(autoSize(157), autoSize(150))
+
+                                    verticalLayout {
+                                        textView {
+                                            text = it.steptypename
+                                            textSizeAuto = 34
+                                            textColorInt = R.color.rma_black_33
+                                        }.lparams(wrapContent, wrapContent)
+
+                                        textView {
+                                            text = it.stepdate
+                                            textSizeAuto = 29
+                                            textColorInt = R.color.rma_hint_text_color_ccc
+                                        }.lparams(wrapContent, wrapContent)
+                                    }.lparams(matchParent, autoSize(150))
+                                }.lparams(matchParent, autoSize(150))
+                            }
+                        }
+                    }
                 }
-            }.lparams(matchParent, autoSize(72)){
-                topMargin = autoSize(40)
-            }
-
-            linearLayout {
-                gravity = Gravity.CENTER_VERTICAL
-                emptyView()
-
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "T+30"
-                        textSizeAuto = 27
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(93), autoSize(52))
 
-                emptyView()
+            }.lparams(matchParent, matchParent)
 
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "T+3"
-                        textSizeAuto = 27
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(93), autoSize(52))
-
-                emptyView()
 
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "T+3"
-                        textSizeAuto = 27
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(93), autoSize(52))
 
-                emptyView()
-
-                linearLayout {
-                    background = resources.getDrawable(R.color.qhj_rule_bg_color)
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "T+3"
-                        textSizeAuto = 27
-                        textColorInt = R.color.rma_blue_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(93), autoSize(52))
 
-                emptyView()
-            }.lparams(matchParent, autoSize(60))
         }
     }
 
@@ -375,7 +140,7 @@ class BusinessHallDetailsActivity : BaseActivity<BusinessHallViewModel>(){
 fun _LinearLayout.BusinessItemView() {
     view {
         background = resources.getDrawable(R.color.hnst_line_color)
-    }.lparams(matchParent, autoSize(1)){
+    }.lparams(matchParent, autoSize(1)) {
         marginStart = autoSize(12)
         marginEnd = autoSize(12)
     }

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

@@ -1,14 +1,27 @@
 package cn.muchinfo.rma.view.base.warehousereceipt
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.data.OrderQuoteData
 import cn.muchinfo.rma.global.data.OrderQuoteDetailData
+import cn.muchinfo.rma.global.data.SpotGoodsPriceData
+import cn.muchinfo.rma.global.data.WrGoodsInfoData
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 买卖大厅viewmodel
  */
 class BusinessHallViewModel : BaseViewModel(){
 
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
     //用于控制挂牌弹窗的消失 当值设置为true时,控制dialog隐藏
     val controlDialogDisappear : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
 
@@ -18,4 +31,155 @@ class BusinessHallViewModel : BaseViewModel(){
     //买大厅数据
     val businessBuyHallDataList : MutableLiveData<List<OrderQuoteDetailData>> = MutableLiveData()
 
+    //融资选择方案列表
+    val financingSelectDataList : MutableLiveData<List<String>> = MutableLiveData()
+
+    //弹出一口价摘牌dialog
+    val showOnePriceDialog : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
+    //一口价浮动价摘牌时选择的买卖大厅实体
+    val selectData : MutableLiveData<OrderQuoteDetailData> = MutableLiveData()
+
+    //弹出浮动价摘牌dialog
+    val showFloatPriceDialog : MutableLiveData<Boolean> = MutableLiveData<Boolean>().apply { value = false }
+
+    //仓单商品信息
+    val wrGoodsInfoData : MutableLiveData<WrGoodsInfoData> = MutableLiveData()
+
+    //查询融资选择方案
+    fun getFinancingSelectData(){
+        financingSelectDataList.postValue(arrayListOf("1","2","3","4","5"))
+    }
+
+    //查询买大厅数据
+    fun queryWrGoodsInfo(data: OrderQuoteData){
+        val params = mutableMapOf<String,String>().apply {
+            put("haswr","1")
+            put("wrfactortypeid",data.wrfactortypeid ?: "")
+        }
+        MyApplication.getInstance()?.warehouseManager?.queryWrGoodsInfo(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                wrGoodsInfoData.postValue(respData?.get(0))
+            }
+        }
+    }
+
+    /**
+     * 卖大厅item点击
+     * @param deliverygoodsid String
+     */
+    fun setOnSellItemClick(wrtradeorderid : String){
+        val oldList = businessSellHallDataList.value
+        val newDataList = arrayListOf<OrderQuoteDetailData>()
+        oldList?.forEach {
+            if (wrtradeorderid == it.wrtradeorderid){
+                if (it.isClick == 0){
+                    newDataList.add(it.copy(isClick = 1))
+                }else{
+                    newDataList.add(it.copy(isClick = 0))
+                }
+            }else{
+                newDataList.add(it.copy(isClick = 0))
+            }
+        }
+        businessSellHallDataList.postValue(newDataList)
+    }
+
+    /**
+     * 买大厅item点击
+     * @param deliverygoodsid String
+     */
+    fun setOnBuyItemClick(wrtradeorderid : String){
+        val oldList = businessBuyHallDataList.value
+        val newDataList = arrayListOf<OrderQuoteDetailData>()
+        oldList?.forEach {
+            if (wrtradeorderid == it.wrtradeorderid){
+                if (it.isClick == 0){
+                    newDataList.add(it.copy(isClick = 1))
+                }else{
+                    newDataList.add(it.copy(isClick = 0))
+                }
+            }else{
+                newDataList.add(it.copy(isClick = 0))
+            }
+        }
+        businessBuyHallDataList.postValue(newDataList)
+    }
+
+    //查询卖大厅数据
+    fun querySellDataList( type : String, pricetype : String, data: OrderQuoteData){
+        val params = mutableMapOf<String,String>().apply {
+            put("wrpricetype",pricetype)
+            put("haswr","1")
+            put("wrfactortypeid",data.wrfactortypeid ?: "")
+            put("goodsid",data.goodsid ?: "")
+            put("buyorsell","1")
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuoteDetail(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                businessSellHallDataList.postValue(respData)
+            }
+        }
+    }
+
+    //查询买大厅数据
+    fun queryBuyDataList( type : String, pricetype : String, data: OrderQuoteData){
+        val params = mutableMapOf<String,String>().apply {
+            put("wrpricetype",pricetype)
+            put("haswr","1")
+            put("wrfactortypeid",data.wrfactortypeid ?: "")
+            put("goodsid",data.goodsid ?: "")
+            put("buyorsell","0")
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuoteDetail(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                businessBuyHallDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 持仓单摘牌请求
+     */
+    fun HdWRDealOrderReq(
+        RelatedWRTradeOrderID: Long = 0,//关联委托单号(摘牌委托关联挂牌委托单ID)
+        WRTransferUserID: Int = 0,//仓单受让用户
+        OrderQty: Long = 0,//委托数量
+        BuyOrSell: Int = 0,//买卖方向
+        ApplyID: Long = 0,//申请ID
+        LadingBillId: Long = 0,//提单id(wrholdlb的LadingBillId字段),卖的时候填写
+        SubNum: Long = 0,//提单子单号(wrholdlb的SubNum字段),卖的时候填写
+        WRFactorTypeId: Long = 0,//仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
+        DeliveryMonth: String = "",//交收月
+        HasWr: Int = 0,//是否有仓单-0:没有仓单 1:有仓单
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.warehouseManager?.HdWRDealOrderReq(
+                LadingBillId = LadingBillId,
+                RelatedWRTradeOrderID = RelatedWRTradeOrderID,
+                WRTransferUserID = WRTransferUserID,
+                OrderQty = OrderQty,
+                DeliveryMonth = DeliveryMonth,
+                SubNum = SubNum,
+                WRFactorTypeId = WRFactorTypeId,
+                BuyOrSell = BuyOrSell,
+                HasWr = HasWr,
+                ApplyID = ApplyID
+            ) { isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
 }

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

@@ -28,12 +28,17 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @constructor
  */
-class BusinessSellHallViewHolder(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel) : BaseViewHolder<OrderQuoteDetailData>(activity){
+class BusinessSellHallViewHolder(private val activity : AppCompatActivity,private val viewModel: BusinessHallViewModel,private val pricetype : String) : BaseViewHolder<OrderQuoteDetailData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     override fun _FrameLayout.createContentView() {
          verticalLayout {
+             onThrottleFirstClick {
+                 viewModel.setOnSellItemClick(data.value?.wrtradeorderid ?: "")
+             }
+
              linearLayout {
+
                  linearLayout {
                      gravity = Gravity.CENTER_VERTICAL or Gravity.LEFT
                      textView {
@@ -87,6 +92,12 @@ class BusinessSellHallViewHolder(private val activity : AppCompatActivity,privat
 
                  textView {
                      onThrottleFirstClick {
+                         viewModel.selectData.postValue(data.value)
+                         if (pricetype == "1"){//一口价
+                             viewModel.showOnePriceDialog.postValue(true)
+                         }else{//浮动价
+                             viewModel.showFloatPriceDialog.postValue(true)
+                         }
 
                      }
                      backgroundResource = R.drawable.rma_item_click_bg

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

@@ -148,7 +148,7 @@ fun AppCompatActivity.OneListedDialog(
             }.lparams(matchParent, matchParent)
 
             segment.setupWithViewPager(viewPager)
-            segment.selectTab(selectedTabIndex)
+            segment.selectTab(1)
         }.lparams(matchParent, matchParent){
             topMargin = autoSize(120)
         }
@@ -518,9 +518,12 @@ class OneBuyListedUI(
                         }
                     }.lparams(matchParent, autoSize(143))
 
-                    seekBar {
+                    inflateLayout<SeekBar>(R.layout.main_seekbar)  {
                         min = 10
                         max = 100
+                        isIndeterminate = false
+                        splitTrack = false
+                        setPadding(0,0,0,0)
                         thumb = resources.getDrawable(R.mipmap.hnxt_seekbar)
                         progressDrawable = resources.getDrawable(R.drawable.seekbar_bg)
                         setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{

+ 243 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/SelectFincningDialog.kt

@@ -0,0 +1,243 @@
+package cn.muchinfo.rma.view.base.warehousereceipt
+
+import android.graphics.Color
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.global.data.OrderQuoteDetailData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.autowidget.dialog.CustomDialogFragment
+import mtp.polymer.com.autowidget.dialog.createCustomDialog
+import org.jetbrains.anko.*
+
+fun AppCompatActivity.SelectFincningDialog(
+    activity: AppCompatActivity,
+    viewModel: BusinessHallViewModel,
+    data : OrderQuoteData
+): CustomDialogFragment {
+
+    // 下拉刷新
+    lateinit var swipeToLayout: SwipeToLoadLayout
+    lateinit var statusLayout: StatusLayout
+
+    val selectFincningAdapter: BaseAdapter<String, SelectFincningViewHolder> =
+        BaseAdapter { _, _ ->
+            SelectFincningViewHolder(
+                activity,
+                viewModel
+            )
+        }
+
+    return createCustomDialog(cancelable = false) { dialog ->
+        backgroundColor = Color.parseColor("#5f000000")
+        verticalLayout {
+            viewModel.getFinancingSelectData()
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    imageResource = R.mipmap.orange_del
+                }.lparams(autoSize(46), autoSize(46)){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+
+                textView {
+                    text = "选择融资方案"
+                    textSizeAuto = 39
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent)
+
+                emptyView()
+
+                view {
+
+                }.lparams(autoSize(46), autoSize(46)){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(100))
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = selectFincningAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.financingSelectDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    selectFincningAdapter.setNewData(it)
+                }
+            }
+        }.lparams(matchParent, matchParent){
+            topMargin = autoSize(120)
+        }
+    }
+}
+
+class SelectFincningViewHolder(private val activity: AppCompatActivity,private val viewModel: BusinessHallViewModel) : BaseViewHolder<String>(activity){
+
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "铜供应链金融"
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+                emptyView()
+
+                textView {
+                    text = "放款快"
+                    textSizeAuto = 32
+                    textColorInt = R.color.rma_green_color
+                }.lparams(wrapContent, wrapContent){
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(100))
+
+            linearLayout {
+                verticalLayout {
+                    gravity = Gravity.LEFT
+                    textView {
+                        text = "铜杆帮你采"
+                        textSizeAuto = 32
+                        textColorInt = R.color.buy_hall_color
+                    }.lparams(wrapContent, wrapContent){
+                        topMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        text = "名称"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(140),2f)
+
+                verticalLayout {
+                    gravity = Gravity.CENTER_HORIZONTAL
+                    textView {
+                        text = "90天"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        topMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        text = "天数"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(140),1f)
+
+                verticalLayout {
+                    gravity = Gravity.CENTER_HORIZONTAL
+                    textView {
+                        text = "30%"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        topMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        text = "保证金"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(140),1f)
+
+                verticalLayout {
+                    gravity = Gravity.CENTER_HORIZONTAL
+                    textView {
+                        text = "10%"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        topMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        text = "利息"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(140),1f)
+
+                verticalLayout {
+                    gravity = Gravity.RIGHT
+                    textView {
+                        text = "日结"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        topMargin = autoSize(20)
+                        marginStart = autoSize(36)
+                    }
+
+                    textView {
+                        text = "1天起息"
+                        textSizeAuto = 32
+                        textColorInt = R.color.rma_black_33
+                    }.lparams(wrapContent, wrapContent){
+                        marginStart = autoSize(36)
+                    }
+                }.lparams(0, autoSize(140),2f)
+            }.lparams(matchParent, autoSize(140))
+
+            itemView()
+
+        }.lparams(matchParent, wrapContent)
+    }
+
+}

+ 8 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptFragment.kt

@@ -89,7 +89,7 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
         savedInstanceState: Bundle?
     ): View? {
         initMenuData()
-        viewModel.queryOrderQuote()
+
         return UI {
 
             verticalLayout {
@@ -140,7 +140,7 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
                 }.lparams(matchParent, matchParent)
 
                 segment.setupWithViewPager(viewPager)
-                segment.selectTab(1)
+                segment.selectTab(0)
             }
         }.view
 
@@ -170,12 +170,13 @@ class OnePriceUI(private val fragment : Fragment,private val viewModel: Warehous
     }
 
     val onePriceAdapter by lazy {
-        OnePriceAdapter(fragment.context,"1")
+        OnePriceAdapter(fragment.context,"1" )
     }
 
     val root = _FrameLayout(fragment.context!!).apply {
         verticalLayout {
             linearLayout {
+                viewModel.queryOneOrderQuote()
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
                     textView {//待点价头部左侧数据
@@ -221,7 +222,7 @@ class OnePriceUI(private val fragment : Fragment,private val viewModel: Warehous
 //                                }
 //                                topAdapter.setDatas(titleStringList)
 //                            }
-                        topAdapter.setDatas(arrayListOf("卖价","卖量","买价","买量","仓库"))
+                        topAdapter.setDatas(arrayListOf("卖价","卖量","买价","买量","仓库","交收月"))
                     }
                 }.lparams(matchParent, matchParent)
             }.lparams(matchParent, autoSize(100))
@@ -229,7 +230,7 @@ class OnePriceUI(private val fragment : Fragment,private val viewModel: Warehous
             statusLayout(contentBlock = {
                 statusLayout = this
                 setRetryAction {
-
+                    viewModel.queryOneOrderQuote()
                 }
 
                 swipeToLoadLayout {
@@ -237,7 +238,7 @@ class OnePriceUI(private val fragment : Fragment,private val viewModel: Warehous
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-
+                        viewModel.queryOneOrderQuote()
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -323,7 +324,6 @@ class FloatingPriceUI(private val fragment : Fragment,private val viewModel: War
 
     lateinit var dataRecyclerview : RecyclerView
 
-
     //标题头部
     val topAdapter by lazy {
         TopTabAdpater(fragment.context)
@@ -335,6 +335,7 @@ class FloatingPriceUI(private val fragment : Fragment,private val viewModel: War
 
     val root = _FrameLayout(fragment.context!!).apply {
         verticalLayout {
+            viewModel.queryFloatOrderQuote()
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL

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

@@ -17,8 +17,10 @@ class WarehouseReceiptViewModel : BaseViewModel(){
     //浮动价报价牌数据
     val floatProceDataList : MutableLiveData<List<OrderQuoteData>> = MutableLiveData()
 
-
-    fun queryOrderQuote(){
+    /**
+     * 查询一口价报价牌
+     */
+    fun queryOneOrderQuote(){
         val params = mutableMapOf<String,String>().apply {
             put("marketid","17201")
             put("wrpricetype","1")
@@ -31,4 +33,20 @@ class WarehouseReceiptViewModel : BaseViewModel(){
         }
     }
 
+    /**
+     * 查询浮动价报价牌
+     */
+    fun queryFloatOrderQuote(){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
+            put("haswr","1")//0:仓单预售 1:仓单贸易
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                floatProceDataList.postValue(respData)
+            }
+        }
+    }
+
 }

+ 58 - 31
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/one/OnePriceAdapter.java

@@ -37,6 +37,7 @@ import cn.muchinfo.rma.view.base.platinumtreasure.PlatinumTrasureDetailsActivity
 import cn.muchinfo.rma.view.base.platinumtreasure.adapter.QHjRightData;
 import cn.muchinfo.rma.view.base.platinumtreasure.adapter.QhjRightScrollAdapter;
 import cn.muchinfo.rma.view.base.platinumtreasure.trade.PlatinumTradeActivity;
+import cn.muchinfo.rma.view.base.warehousereceipt.BusinessHallActivity;
 
 /**
  * 用于千海金铂金宝页面额adapter
@@ -45,6 +46,7 @@ public class OnePriceAdapter extends RecyclerView.Adapter<OnePriceAdapter.ItemVi
 
     private Context context;
     private String type;//1是仓单贸易 2是仓单预售
+
     private List<OrderQuoteData> datas;
     private int index = -1;
     private int position = -1;
@@ -84,7 +86,7 @@ public class OnePriceAdapter extends RecyclerView.Adapter<OnePriceAdapter.ItemVi
     @NonNull
     @Override
     public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
-        View view = LayoutInflater.from(context).inflate(R.layout.layout_item_platinum_content, viewGroup, false);
+        View view = LayoutInflater.from(context).inflate(R.layout.layout_item_hnst_content, viewGroup, false);
         return new ItemViewHolder(view);
     }
 
@@ -119,12 +121,53 @@ public class OnePriceAdapter extends RecyclerView.Adapter<OnePriceAdapter.ItemVi
         }else {
             itemViewHolder.platnum_sell.setVisibility(View.VISIBLE);
         }
+
+        //卖价
+        QHjRightData sellPriceData = new QHjRightData();
+        sellPriceData.setValue(data.getSellprice());
+        sellPriceData.setColorType("1");
+
+        //卖量
+        QHjRightData sellNumData = new QHjRightData();
+        sellNumData.setValue(data.getSellqty());
+        sellNumData.setColorType("1");
+
+        //买价
+        QHjRightData buyPriceData = new QHjRightData();
+        buyPriceData.setValue(data.getBuyprice());
+        buyPriceData.setColorType("1");
+
+        //买量
+        QHjRightData buyNumData = new QHjRightData();
+        buyNumData.setValue(data.getBuyqty());
+        buyNumData.setColorType("1");
+
+        //仓库
+        QHjRightData warehousenameData = new QHjRightData();
+        warehousenameData.setValue(data.getWarehousename());
+        warehousenameData.setColorType("1");
+
+        //仓库
+        QHjRightData mouthData = new QHjRightData();
+        mouthData.setValue(data.getDeliverymonth());
+        mouthData.setColorType("1");
+
+
+        rightData.add(sellPriceData);
+        rightData.add(sellNumData);
+        rightData.add(buyPriceData);
+        rightData.add(buyNumData);
+        rightData.add(warehousenameData);
+        rightData.add(mouthData);
+
         qhjRightScrollAdapter.setDatas(rightData);
         itemViewHolder.rvItemRight.setAdapter(qhjRightScrollAdapter);
         //缓存当前holder
         if (!mViewHolderList.contains(itemViewHolder)) {
             mViewHolderList.add(itemViewHolder);
         }
+
+        itemViewHolder.platnum_buy.setVisibility(View.VISIBLE);
         if (i == this.position) {
             itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.qhj_click_bg));
             itemViewHolder.allView.setVisibility(View.VISIBLE);
@@ -133,42 +176,26 @@ public class OnePriceAdapter extends RecyclerView.Adapter<OnePriceAdapter.ItemVi
             itemViewHolder.allView.setVisibility(View.GONE);
         }
 
-//        itemViewHolder.all_click_View.setOnClickListener(view -> setPosition(i));//没有点击展开
-        itemViewHolder.horItemScrollview.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                setPosition(i);
-            }
-        });
-        //买入点击
+        itemViewHolder.all_click_View.setOnClickListener(view -> setPosition(i));//没有点击展开
+//        itemViewHolder.horItemScrollview.setOnClickListener(new View.OnClickListener() {
+//            @Override
+//            public void onClick(View view) {
+//                setPosition(i);
+//            }
+//        });
+        //点击进入买卖大厅
         itemViewHolder.platnum_buy.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-
+                Intent intent = new Intent();
+                intent.putExtra("data",data);
+                intent.putExtra("type",type);
+                intent.putExtra("pricetype","1");
+                intent.setClass(context, BusinessHallActivity.class);
+                ActivityUtils.startActivity(intent);
             }
         });
-        //卖出点击
-        itemViewHolder.platnum_sell.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-
-            }
-        });
-        //图表点击
-        itemViewHolder.platnum_chart.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
 
-            }
-        });
-
-        //详情点击
-        itemViewHolder.platnum_details.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-
-            }
-        });
 
         itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
             @Override

+ 127 - 0
RMA/app/src/main/res/layout/layout_item_hnst_content.xml

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:id="@+id/roots_view"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:id="@+id/all_click_View"
+        android:layout_width="match_parent"
+        android:orientation="horizontal"
+        android:layout_height="35dp">
+
+        <LinearLayout
+            android:layout_width="120dp"
+            android:orientation="horizontal"
+            android:layout_height="match_parent">
+            <LinearLayout
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:layout_width="90dp"
+                android:layout_height="match_parent">
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:layout_gravity="center"
+                    android:layout_marginStart="7dp"
+                    android:id="@+id/tv_left_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="13sp"
+                    android:textColor="#333333" />
+
+            </LinearLayout>
+            <ImageView
+                android:id="@+id/click_icon"
+                android:layout_gravity="center_vertical"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:src="@mipmap/rma_down"/>
+
+        </LinearLayout>
+
+        <cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView
+            android:id="@+id/hor_item_scrollview"
+            android:overScrollMode="never"
+            android:scrollbars="none"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <RelativeLayout
+                android:id="@+id/item_onclick"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_item_right"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"
+                    android:scrollbars="none">
+
+                </androidx.recyclerview.widget.RecyclerView>
+            </RelativeLayout>
+        </cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView>
+    </LinearLayout>
+
+    <LinearLayout
+        android:visibility="gone"
+        android:id="@+id/all_view"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:gravity="end|center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/platnum_buy"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="买卖大厅"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/platnum_sell"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="卖出"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/platnum_chart"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="图表"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/platnum_details"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="详情"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+
+    </LinearLayout>
+
+</LinearLayout>

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

@@ -72,6 +72,7 @@
         android:layout_height="40dp"
         android:gravity="end|center_vertical"
         android:orientation="horizontal">
+
         <TextView
             android:id="@+id/platnum_buy"
             android:layout_marginEnd="10dp"

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