Browse Source

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

Liu.bolan 4 years ago
parent
commit
517130ed88
32 changed files with 2231 additions and 48 deletions
  1. 53 3
      RMA/app/src/main/java/cn/muchinfo/rma/business/quote/QuoteManager.kt
  2. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FinancialManageData.kt
  3. 116 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FtDeliveryGoodsData.kt
  4. 87 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FtDeliveryGoodsDataListData.kt
  5. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt
  6. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposurePositionDetailsViewholder.kt
  7. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/BaseFutureModel.kt
  8. 388 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/CdysWarehouseScreeningDialog.kt
  9. 51 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysFragment.kt
  10. 263 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/HnstcdysViewModel.kt
  11. 44 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysSelectViewHolder.kt
  12. 49 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrStandardFactoryItemSonViewHolder.kt
  13. 63 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrStandardFactoryItemViewHolder.kt
  14. 64 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrstandardnameViewHolder.kt
  15. 44 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrstandnameSoneViewHolder.kt
  16. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/financial/FinancialViewModel.kt
  17. 11 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/financial/PaymentReviewActivity.kt
  18. 25 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/BusinessHallActivity.kt
  19. 68 13
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptFragment.kt
  20. 262 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseReceiptViewModel.kt
  21. 307 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/WarehouseScreeningDialog.kt
  22. 42 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseSelectViewHolder.kt
  23. 63 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseWrstandardnameViewHolder.kt
  24. 43 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseWrstandnameSoneViewHolder.kt
  25. 48 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemSonViewHolder.kt
  26. 61 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemViewHolder.kt
  27. 8 0
      RMA/app/src/main/res/drawable/rma_item_normal_bg.xml
  28. 8 0
      RMA/app/src/main/res/drawable/rma_item_select_bg.xml
  29. 10 0
      RMA/app/src/main/res/drawable/rydz_main_blue_bg.xml
  30. 10 0
      RMA/app/src/main/res/drawable/rydz_main_red_bg.xml
  31. 8 0
      RMA/app/src/main/res/drawable/yrdz_item_normal_bg.xml
  32. BIN
      RMA/app/src/main/res/mipmap-xhdpi/yrdz_screening_icon.png

+ 53 - 3
RMA/app/src/main/java/cn/muchinfo/rma/business/quote/QuoteManager.kt

@@ -3,9 +3,7 @@ package cn.muchinfo.rma.business.quote
 import cn.muchinfo.rma.business.account.adapter.AccountAdapter
 import cn.muchinfo.rma.business.quote.adapter.QuoteAdapter
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.AccountInOutApplyData
-import cn.muchinfo.rma.global.data.OrderQuoteData
-import cn.muchinfo.rma.global.data.OrderQuoteDetailData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.netManage.base.ResponseCallback
 import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
 import cn.muchinfo.rma.netcore.packet.Packet40
@@ -222,4 +220,56 @@ class QuoteManager {
             }
         )
     }
+
+    /**
+     * 仓单贸易 查询买卖大厅
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryFtDeliveryGoods(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<FtDeliveryGoodsData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryFtDeliveryGoods",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<FtDeliveryGoodsData>>>() {
+                override fun onResponse(response: BaseResult<List<FtDeliveryGoodsData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+    /**
+     * 查询品类要素定义项
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<ContractData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryWrStandardFactoryItem(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<FtDeliveryGoodsDataListData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/WrTrade2/QueryWrStandardFactoryItem",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<FtDeliveryGoodsDataListData>>>() {
+                override fun onResponse(response: BaseResult<List<FtDeliveryGoodsDataListData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
 }

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

@@ -64,6 +64,8 @@ data class FinancialManageData(
     val operateapplytype : String? = "",
     @SerializedName("pricemove")
     val pricemove : String? = "",
+    @SerializedName("attachurl")
+    val attachurl : String? = "",
     @SerializedName("pricetype")
     val pricetype : String? = "",
     @SerializedName("relatedid")
@@ -111,6 +113,7 @@ data class FinancialManageData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readInt(),
         parcel.readString(),
         parcel.readString(),
@@ -137,6 +140,7 @@ data class FinancialManageData(
         parcel.writeString(operateapplyid)
         parcel.writeString(operateapplytype)
         parcel.writeString(pricemove)
+        parcel.writeString(attachurl)
         parcel.writeString(pricetype)
         parcel.writeString(relatedid)
         parcel.writeString(sellusername)

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

@@ -0,0 +1,116 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 品种品类筛选框列表
+ * @property deliverygoodscode String?
+ * @property deliverygoodsid String?
+ * @property deliverygoodsname String?
+ * @property wdlst List<WrFtWrstandard>?
+ * @property isSelectIndex Int
+ * @constructor
+ */
+data class FtDeliveryGoodsData(
+    @SerializedName("deliverygoodscode")
+    val deliverygoodscode : String? = "",//品种代码
+    @SerializedName("deliverygoodsid")
+    val deliverygoodsid : String? = "",//品种ID
+    @SerializedName("deliverygoodsname")
+    val deliverygoodsname : String? = "",//品种名称
+    @SerializedName("wdlst")
+    var wdlst : List<WrFtWrstandard>? = arrayListOf(),//商品列表
+    val isSelectIndex : Int = 0//0是不展开 1 是展开
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(WrFtWrstandard),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeTypedList(wdlst)
+        parcel.writeInt(isSelectIndex)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<FtDeliveryGoodsData> {
+        override fun createFromParcel(parcel: Parcel): FtDeliveryGoodsData {
+            return FtDeliveryGoodsData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<FtDeliveryGoodsData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+/**
+ * 商品列表
+ * @property enumdicname String?
+ * @property minivalue String?
+ * @property wrstandardcode String?
+ * @property wrstandardid String?
+ * @property wrstandardname String?
+ * @property isSelect Int
+ * @constructor
+ */
+data class WrFtWrstandard(
+    @SerializedName("enumdicname")
+    val enumdicname : String? = "",//单位名称
+    @SerializedName("minivalue")
+    val minivalue : String? = "",//最小变动值
+    @SerializedName("wrstandardcode")
+    val wrstandardcode: String? = "",//现货商品代码
+    @SerializedName("wrstandardid")
+    val wrstandardid: String? = "",//现货商品ID
+    @SerializedName("wrstandardname")
+    val wrstandardname: String? = "",//商品名称
+    val isSelect : Int = 0//0是选择, 1是没选择
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(enumdicname)
+        parcel.writeString(minivalue)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+        parcel.writeInt(isSelect)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrFtWrstandard> {
+        override fun createFromParcel(parcel: Parcel): WrFtWrstandard {
+            return WrFtWrstandard(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrFtWrstandard?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -0,0 +1,87 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+import com.google.gson.annotations.SerializedName
+
+data class FtDeliveryGoodsDataListData(
+    @SerializedName("dgfactoryitemtypeid")
+    val dgfactoryitemtypeid : String? = "",
+    @SerializedName("itemtypename")
+    val itemtypename : String? = "",
+    @SerializedName("wrstandardid")
+    val wrstandardid: String? = "",
+    @SerializedName("itemlst")
+    val itemlst : List<WrStandardFactoryItem>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(WrStandardFactoryItem)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(dgfactoryitemtypeid)
+        parcel.writeString(itemtypename)
+        parcel.writeString(wrstandardid)
+        parcel.writeTypedList(itemlst)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<FtDeliveryGoodsDataListData> {
+        override fun createFromParcel(parcel: Parcel): FtDeliveryGoodsDataListData {
+            return FtDeliveryGoodsDataListData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<FtDeliveryGoodsDataListData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+
+data class WrStandardFactoryItem(
+    @SerializedName("dgfactoryitemid")
+    val dgfactoryitemid : String? = "",//选择项id
+    @SerializedName("dgfactoryitemvalue")
+    val dgfactoryitemvalue : String? = "",//要素项值
+    @SerializedName("warehouseid")
+    val warehouseid : String? = "",//仓库id
+    val isSelect : Int = 0//0是没选择,1是选择
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(dgfactoryitemid)
+        parcel.writeString(dgfactoryitemvalue)
+        parcel.writeString(warehouseid)
+        parcel.writeInt(isSelect)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<WrStandardFactoryItem> {
+        override fun createFromParcel(parcel: Parcel): WrStandardFactoryItem {
+            return WrStandardFactoryItem(parcel)
+        }
+
+        override fun newArray(size: Int): Array<WrStandardFactoryItem?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -553,6 +553,7 @@ fun Dialog.autoDismissAfterShow(
 data class SelectData(
     var id: String,//现货商品id
     var value: String,
+    var goodsgroupid : String = "",//商品组id
     var deliverygoodsid: String = "",//现货合同中的现货品种id
     var areauserid: String = "",//现货areauserid
     var enumdicname: String = "",//现货商品的单位名称

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

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

+ 27 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/BaseFutureModel.kt

@@ -10,6 +10,7 @@ import androidx.fragment.app.FragmentActivity
 import androidx.fragment.app.FragmentManager
 import androidx.fragment.app.FragmentPagerAdapter
 import androidx.viewpager.widget.ViewPager
+import cn.muchinfo.rma.R
 import cn.muchinfo.rma.view.base.BaseViewModel
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabBuilder
@@ -46,4 +47,30 @@ class BaseFutureModel: BaseViewModel() {
 
         return builder
     }
+
+    /**
+     * 解耦+统一布局样式
+     */
+    fun qmuiBlueBgTabSegmentConfig(idTab: QMUITabSegment?,
+                             textSize: Int,
+                             context: Context?): QMUITabBuilder? {
+
+        idTab?.setIndicator(QMUITabIndicator(QMUIDisplayHelper.dp2px(context, 2), false, true))
+        val space: Int = QMUIDisplayHelper.dp2px(context, 10)
+
+        idTab?.setItemSpaceInScrollMode(space)
+        idTab?.setPadding(space, 0, space, 0)
+        idTab?.mode = QMUITabSegment.MODE_FIXED//这里可以根据tab的数量设置不同的mode
+        idTab?.right = space
+
+        val size: Int = QMUIDisplayHelper.sp2px(context, textSize)
+        val builder = idTab?.tabBuilder()
+        builder?.skinChangeWithTintColor(false)?.
+        setSelectedDrawable(context?.resources?.getDrawable(R.color.white))?.
+        setSelectedDrawable(context?.resources?.getDrawable(R.color.white))?.
+        setTextSize(size, size)?.
+        setDynamicChangeIconColor(false)
+
+        return builder
+    }
 }

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

@@ -0,0 +1,388 @@
+package cn.muchinfo.rma.view.base.hnstcdys
+
+import android.graphics.Color
+import android.view.Gravity
+import android.view.View
+import android.widget.TextView
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsData
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsDataListData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.hnstcdys.viewholder.CdysSelectViewHolder
+import cn.muchinfo.rma.view.base.hnstcdys.viewholder.CdysWrStandardFactoryItemViewHolder
+import cn.muchinfo.rma.view.base.hnstcdys.viewholder.CdysWrstandardnameViewHolder
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseSelectViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseWrstandardnameViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseWrstandnameSoneViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WrStandardFactoryItemViewHolder
+import com.blankj.utilcode.util.TimeUtils
+import com.blankj.utilcode.util.ToastUtils
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.CustomDialogFragment
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createCustomDialog
+import mtp.polymer.com.autowidget.dialog.showDataSelectDialog
+import org.jetbrains.anko.*
+import java.text.SimpleDateFormat
+
+//仓单贸易左侧菜单栏
+fun AppCompatActivity.CdysScreeningDialog(
+    viewModel: HnstcdysViewModel,
+    activity: AppCompatActivity,
+    type: String//1 是一口价 2是浮动价
+): CustomDialogFragment {
+
+    /** 查询时间textview **/
+    lateinit var tradedatetextview: TextView
+
+    //品种
+    val spotCategoryAdapter: BaseAdapter<FtDeliveryGoodsData, CdysWrstandardnameViewHolder> =
+        BaseAdapter { _, _ -> CdysWrstandardnameViewHolder(activity, viewModel) }
+
+    //要素
+    val elementsAdapter: BaseAdapter<FtDeliveryGoodsDataListData, CdysWrStandardFactoryItemViewHolder> =
+        BaseAdapter { _, _ -> CdysWrStandardFactoryItemViewHolder(activity, viewModel) }
+
+    lateinit var warehouseRecycview: RecyclerView
+
+    return createCustomDialog(cancelable = false) { dialog ->
+        backgroundColor = Color.parseColor("#5f000000")
+
+        verticalLayout {
+            viewModel.resetFtDeliveryGoodsDataList()
+            viewModel.setGoodsGroupAndGoodsInfoList()
+            background = resources.getDrawable(R.color.white)
+            viewModel.selectWrFtWrstandardData.bindOptional(context) {
+                viewModel.queryWrStandardFactoryItem(it?.wrstandardid ?: "")
+            }
+
+            frameLayout {
+                nestedScrollView {
+                    linearLayout {
+                        recyclerView {
+                            background = resources.getDrawable(R.color.white)
+                            adapter = spotCategoryAdapter
+                        }.lparams(autoSize(310), matchParent) {
+                            bottomMargin = autoSize(150)
+                        }
+
+                        viewModel.ftDeliveryGoodsDataList.bindOptional(context) {
+                            spotCategoryAdapter.setNewData(it)
+                        }
+
+                        view {
+                            background = resources.getDrawable(R.color.rma_hint_line_color_eee)
+                        }.lparams(autoSize(1), matchParent)
+
+                        verticalLayout {
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                textView {
+                                    text = "仓库"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(34)
+                                }
+                            }.lparams(matchParent, autoSize(80))
+
+                            recyclerView {
+                                warehouseRecycview = this
+                                background = resources.getDrawable(R.color.white)
+                            }.lparams(matchParent, wrapContent)
+
+                            viewModel.WrStandardFactoryItemDataList.bindOptional(context) { data ->
+                                //仓库
+                                val ftDeliveryGoodsDataListData =
+                                    data?.find { it.dgfactoryitemtypeid == "1" }
+                                if (ftDeliveryGoodsDataListData?.dgfactoryitemtypeid.isNullOrEmpty()
+                                        .not()
+                                ) {
+                                    val watehouseAdapter: BaseAdapter<WrStandardFactoryItem, CdysSelectViewHolder> =
+                                        BaseAdapter { _, _ ->
+                                            CdysSelectViewHolder(
+                                                activity,
+                                                viewModel,
+                                                ftDeliveryGoodsDataListData?.dgfactoryitemtypeid
+                                                    ?: ""
+                                            )
+                                        }
+                                    warehouseRecycview.adapter = watehouseAdapter
+                                    watehouseAdapter.setNewData(ftDeliveryGoodsDataListData?.itemlst)
+                                }
+                            }
+
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                textView {
+                                    text = "交收月"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(34)
+                                }
+                            }.lparams(matchParent, autoSize(80))
+
+                             linearLayout {
+                                 onThrottleFirstClick {
+                                     activity.showDataSelectDialog(type = "2") {
+                                         tradedatetextview.text = this
+                                     }
+                                 }
+                                 backgroundResource = R.drawable.rma_time_click_bg
+                                 gravity = Gravity.CENTER_VERTICAL
+                                 textView {
+                                     tradedatetextview = this
+                                     text = TimeUtils.millis2String(
+                                         TimeUtils.getNowMills().minus(86400000),
+                                         SimpleDateFormat("yyyy-MM")
+                                     )
+                                     textColorInt = R.color.rma_hint_text_color_ccc
+                                     textSizeAuto = 31
+                                 }.lparams(wrapContent, wrapContent) {
+                                     marginStart = autoSize(18)
+                                 }
+
+                                 emptyView()
+
+                                 imageView {
+                                     imageResource = R.mipmap.rma_search_by_time
+                                 }.lparams(autoSize(38), autoSize(38)){
+                                     marginEnd = autoSize(10)
+                                 }
+                                }.lparams(autoSize(420), autoSize(72)) {
+                                    topMargin = autoSize(20)
+                                    bottomMargin = autoSize(20)
+                                    marginStart = autoSize(36)
+                                }
+
+                            verticalLayout {
+                                if (type == "1") {
+                                    visibility = View.GONE
+                                } else {
+                                    visibility = View.VISIBLE
+                                }
+                                linearLayout {
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        text = "期货合约"
+                                        textSizeAuto = 34
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(34)
+                                    }
+                                }.lparams(matchParent, autoSize(80))
+
+                                linearLayout {
+                                    onThrottleFirstClick {
+                                        activity.creatBottomSheetDialog(
+                                            "请选择品种",
+                                            viewModel.goodsGroupList.value ?: arrayListOf()
+                                        ) {
+                                            viewModel.selectGoodsGroupData.postValue(this)
+                                            viewModel.setGoodsInfoList(this.goodsgroupid)
+                                        }
+                                    }
+                                    backgroundResource = R.drawable.yrdz_item_normal_bg
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        viewModel.selectGoodsGroupData.bindOptional(context) {
+                                            text = it?.value
+                                        }
+                                        text = "请选择品种"
+                                        textSizeAuto = 32
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(30)
+                                    }
+
+                                    emptyView()
+
+                                    imageView {
+                                        imageResource = R.mipmap.rma_down
+                                    }.lparams(autoSize(30), autoSize(20)) {
+                                        marginEnd = autoSize(30)
+                                    }
+                                }.lparams(autoSize(420), autoSize(72)) {
+                                    marginStart = autoSize(36)
+                                }
+
+                                linearLayout {
+                                    onThrottleFirstClick {
+                                        if (viewModel.selectGoodsGroupData.value?.id.isNullOrEmpty()) {
+                                            ToastUtils.showLong("请先选择商品组")
+                                            return@onThrottleFirstClick
+                                        }
+                                        activity.creatBottomSheetDialog(
+                                            "请选择合约",
+                                            viewModel.goodsInfoList.value ?: arrayListOf()
+                                        ) {
+                                            viewModel.selectGoodsInfoData.postValue(this)
+                                        }
+                                    }
+                                    backgroundResource = R.drawable.yrdz_item_normal_bg
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        viewModel.selectGoodsInfoData.bindOptional(context) {
+                                            text = it?.value
+                                        }
+                                        text = "请选择合约"
+                                        textSizeAuto = 32
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(30)
+                                    }
+
+                                    emptyView()
+
+                                    imageView {
+                                        imageResource = R.mipmap.rma_down
+                                    }.lparams(autoSize(30), autoSize(20)) {
+                                        marginEnd = autoSize(30)
+                                    }
+                                }.lparams(autoSize(420), autoSize(72)) {
+                                    topMargin = autoSize(24)
+                                    marginStart = autoSize(36)
+                                }
+                            }.lparams(matchParent, wrapContent)
+
+
+                            recyclerView {
+                                background = resources.getDrawable(R.color.white)
+                                adapter = elementsAdapter
+                            }.lparams(matchParent, wrapContent)
+
+                            viewModel.WrStandardFactoryItemDataList.bindOptional(context) { data ->
+                                val elementsDataList = arrayListOf<FtDeliveryGoodsDataListData>()
+
+                                data?.forEach {
+                                    if (it.dgfactoryitemtypeid != "1") {
+                                        elementsDataList.add(it)
+                                    }
+                                }
+                                elementsAdapter.setNewData(elementsDataList)
+
+                            }
+
+                        }.lparams(matchParent, matchParent)
+                    }
+                }
+
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        onThrottleFirstClick {
+                            dialog.dismiss()
+                            viewModel.selectWrFtWrstandardData.postValue(WrFtWrstandard())
+                        }
+                        backgroundResource = R.drawable.rma_item_click_bg
+                        gravity = Gravity.CENTER
+                        text = "重置"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_blue_color
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            if (viewModel.selectWrFtWrstandardData.value?.wrstandardid.isNullOrEmpty()) {
+                                ToastUtils.showLong("请选择相应商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (type == "1") {
+                                viewModel.queryOneOrderQuote(
+                                    wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid
+                                        ?: "",
+                                    warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),
+                                    dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"),
+                                    deliverymonth = tradedatetextview.text.toString()
+                                )
+                            } else {
+                                viewModel.queryFloatOrderQuote(
+                                    wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid
+                                        ?: "",
+                                    warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),
+                                    dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"),
+                                    deliverymonth = tradedatetextview.text.toString()
+                                )
+                            }
+                            dialog.dismiss()
+                        }
+                        backgroundResource = R.drawable.rydz_main_blue_bg
+                        gravity = Gravity.CENTER
+                        text = "筛选"
+                        textSizeAuto = 34
+                        textColorInt = R.color.white
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            if (viewModel.selectWrFtWrstandardData.value?.wrstandardid.isNullOrEmpty()) {
+                                ToastUtils.showLong("请选择相应商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.getSelectWarehouseOrFactoryid("1").isNullOrEmpty()) {
+                                ToastUtils.showLong("请选择仓库")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.selectGoodsInfoData.value?.id.isNullOrEmpty()) {
+                                ToastUtils.showLong("请选择期货商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.getSelectWarehouseOrFactoryid("2")
+                                    .split(",").size < viewModel.WrStandardFactoryItemDataList.value?.size?.minus(
+                                    1
+                                ) ?: 0
+                            ) {
+                                ToastUtils.showLong("请选择必要要素")
+                                return@onThrottleFirstClick
+                            }
+                            if (type == "1") {
+                                viewModel.queryOneOrderQuoteByListed(
+                                    wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid
+                                        ?: "",
+                                    warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),
+                                    dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"),
+                                    deliverymonth = tradedatetextview.text.toString()
+                                )
+                            } else {
+                                viewModel.queryFloatOrderQuoteByListed(
+                                    wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid
+                                        ?: "",
+                                    warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),
+                                    dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"),
+                                    deliverymonth = tradedatetextview.text.toString()
+                                )
+                            }
+                            dialog.dismiss()
+                        }
+                        backgroundResource = R.drawable.rydz_main_red_bg
+                        gravity = Gravity.CENTER
+                        text = "挂牌"
+                        textSizeAuto = 34
+                        textColorInt = R.color.white
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                        marginEnd = autoSize(23)
+                    }
+                }.lparams(matchParent, autoSize(120)) {
+                    gravity = Gravity.BOTTOM
+                }
+            }.lparams(matchParent, matchParent)
+        }.lparams(matchParent, matchParent) {
+            topMargin = autoSize(120)
+            marginEnd = autoSize(84)
+        }
+    }
+}

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.hnstcdys
 
+import android.content.Intent
 import android.os.Bundle
 import android.view.*
 import androidx.fragment.app.Fragment
@@ -9,11 +10,15 @@ import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
+import cn.muchinfo.rma.view.base.warehousereceipt.BusinessHallActivity
 import cn.muchinfo.rma.view.base.warehousereceipt.floata.FloatPriceAdapter
 import cn.muchinfo.rma.view.base.warehousereceipt.one.OnePriceAdapter
+import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
 import com.blankj.utilcode.util.SizeUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
@@ -102,14 +107,53 @@ class HnstcdysFragment : BaseFragment<HnstcdysViewModel>(){
             }.subscribe()
         return UI {
             verticalLayout {
+                viewModel.queryFtDeliveryGoods()
+                viewModel.orderQuoteDataByListed.bindOptional(context){
+                    if (it?.deliverygoodsid.isNullOrEmpty().not()){
+                        val intent = Intent()
+                        intent.putExtra("data", it)
+                        intent.putExtra("type", "2")
+                        intent.putExtra("isOpenListedDialog","1")
+                        intent.putExtra("pricetype", selectedTabIndex.plus(1).toString())
+                        intent.setClass(context, BusinessHallActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                }
                 linearLayout {
-                    background = resources.getDrawable(R.color.white)
+                    background = resources.getDrawable(R.color.main_title_bg_color)
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        imageView {
+                            onThrottleFirstClick {
+                                if (selectedTabIndex == 0){
+                                    getAppCompatActivity().CdysScreeningDialog(viewModel,getAppCompatActivity(),"1").show()
+                                }else{
+                                    getAppCompatActivity().CdysScreeningDialog(viewModel,getAppCompatActivity(),"2").show()
+                                }
+                            }
+                            imageResource = R.mipmap.yrdz_screening_icon
+                        }.lparams(autoSize(48), autoSize(48)){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(200), autoSize(120))
+
+                    emptyView()
 
+                    textView {
+                        text = "仓单贸易"
+                        textColorInt = R.color.white
+                        textSizeAuto = 43
+                    }.lparams(wrapContent, wrapContent)
+
+                    emptyView()
                     view {
 
-                    }.lparams(autoSize(200), autoSize(100))
+                    }.lparams(autoSize(200), autoSize(120))
+                }.lparams(matchParent, autoSize(120))
 
-                    tabSegment {
+                tabSegment {
+                        // 设置
                         segment = this
                         background = resources.getDrawable(R.color.white)
                         addOnTabSelectedListener(object :
@@ -121,6 +165,8 @@ class HnstcdysFragment : BaseFragment<HnstcdysViewModel>(){
                                 selectedTabIndex = index
                             }
                         })
+
+
                         setIndicator(
                             QMUITabIndicator(
                                 QMUIDisplayHelper.dp2px(context, 2),
@@ -128,13 +174,9 @@ class HnstcdysFragment : BaseFragment<HnstcdysViewModel>(){
                                 true
                             )
                         )
-                        setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
-                    }.lparams(0, autoSize(100),1f)
 
-                    view {
-
-                    }.lparams(autoSize(200), autoSize(100))
-                }.lparams(matchParent, autoSize(100))
+                        setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+                }.lparams(matchParent, autoSize(80))
 
                 view {
                     background = resources.getDrawable(R.color.main_hit_bg_color)

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

@@ -1,9 +1,12 @@
 package cn.muchinfo.rma.view.base.hnstcdys
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.global.database.DataBase
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import mtp.polymer.com.autowidget.dialog.SelectData
 
 /**
  * 华南顺通 仓单预售viewmodel
@@ -17,14 +20,223 @@ class HnstcdysViewModel : BaseViewModel(){
     val floatProceDataList : MutableLiveData<List<OrderQuoteData>> = MutableLiveData()
 
 
+
+
+    //品种品类筛选框列表
+    val ftDeliveryGoodsDataList : MutableLiveData<List<FtDeliveryGoodsData>> = MutableLiveData()
+
+    //选择的商品
+    val selectWrFtWrstandardData : MutableLiveData<WrFtWrstandard> = MutableLiveData()
+
+    //要素定义项
+    val WrStandardFactoryItemDataList : MutableLiveData<List<FtDeliveryGoodsDataListData>> = MutableLiveData()
+
+    //选择的商品组列表
+    val goodsGroupList : MutableLiveData<List<SelectData>> = MutableLiveData()
+    //选择的商品组实体
+    val selectGoodsGroupData : MutableLiveData<SelectData> = MutableLiveData()
+
+    //选择的商品列表
+    val goodsInfoList : MutableLiveData<List<SelectData>> = MutableLiveData()
+    //选择的期货合约实体
+    val selectGoodsInfoData : MutableLiveData<SelectData> = MutableLiveData()
+
+    //获取选择的仓库ID和选择的要素类型
+    //type 为1是仓库 type 为2是其他要素
+    fun getSelectWarehouseOrFactoryid(type : String) : String{
+        var returnString = ""
+        WrStandardFactoryItemDataList.value?.forEach {
+            if (type == it.dgfactoryitemtypeid){
+                it.itemlst?.forEach { data ->
+                    if (data.isSelect == 1){
+                        returnString = data.warehouseid ?: ""
+                    }
+                }
+            }else {
+                it.itemlst?.forEach { data ->
+                    if (data.isSelect == 1){
+                        returnString = returnString + "," + data.dgfactoryitemid
+                    }
+                }
+            }
+        }
+        return returnString
+    }
+
+    //根据选择的商品组组织商品选择列表
+    fun setGoodsInfoList(goodsgroupid : String){
+        val newGoodsInfoList = arrayListOf<SelectData>()
+        val goodsInfoList1 = DataBase.getInstance().goodsInfoDao().all
+        goodsInfoList1?.forEach {
+            if (it?.goodsgroupid.toString() == goodsgroupid){
+                newGoodsInfoList.add(SelectData(id = it?.goodsid.toString(),value = it?.goodsname.toString()))
+            }
+        }
+        goodsInfoList.postValue(newGoodsInfoList)
+    }
+
+    //针对期货合约的 设置商品组选择的列表
+    fun setGoodsGroupAndGoodsInfoList(){
+        val newgoodsGroupList = arrayListOf<SelectData>()
+        val marketData = GlobalDataCollection.instance?.loginQueryData?.market?.find { it.trademode == 99 }//找出trademode 为99的市场
+        GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.forEach {
+            if (it.marketid == marketData?.marketid){
+                newgoodsGroupList.add(SelectData(id = it.marketid.toString(),value = it.goodsgroupname,goodsgroupid = it.goodsgroupid.toString()))
+            }
+        }
+        goodsGroupList.postValue(newgoodsGroupList)
+    }
+
+    //重置品种品类筛选框列表
+    fun resetFtDeliveryGoodsDataList(){
+        ftDeliveryGoodsDataList.postValue(ftDeliveryGoodsDataList.value)
+    }
+
+    /**
+     * 针对仓库,要素等的item点击
+     */
+    fun setOnRightItemClick(
+        dgfactoryitemid : String
+    ){
+        val newWrStandardFactoryItemDataList = arrayListOf<FtDeliveryGoodsDataListData>()
+        WrStandardFactoryItemDataList.value?.forEach {
+            val sonItemList = arrayListOf<WrStandardFactoryItem>()
+            it.itemlst?.forEach { data ->
+                if (dgfactoryitemid == data.dgfactoryitemid){
+                    sonItemList.add(data.copy(isSelect = 1))
+                }else{
+                    sonItemList.add(data.copy(isSelect = 0))
+                }
+            }
+            newWrStandardFactoryItemDataList.add(it.copy(itemlst = sonItemList))
+        }
+        WrStandardFactoryItemDataList.postValue(newWrStandardFactoryItemDataList)
+    }
+
+    /**
+     * 对左侧商品列表进行选择后的刷新
+     */
+    fun setOnItemClick(deliverygoodsid : String,wrstandardid : String){
+        val newftDeliveryGoodsDataList = arrayListOf<FtDeliveryGoodsData>()
+        ftDeliveryGoodsDataList.value?.forEach {
+            val sonItemList = arrayListOf<WrFtWrstandard>()
+            if (it.deliverygoodsid == deliverygoodsid){
+                it.wdlst?.forEach { data ->
+                    if (wrstandardid == data.wrstandardid){
+                        sonItemList.add(data.copy(isSelect = 1))
+                    }else{
+                        sonItemList.add(data.copy(isSelect = 0))
+                    }
+                }
+                newftDeliveryGoodsDataList.add(it.copy(wdlst = sonItemList))
+            }else{
+                it.wdlst?.forEach { data ->
+                    sonItemList.add(data.copy(isSelect = 0))
+                }
+                newftDeliveryGoodsDataList.add(it.copy(wdlst = sonItemList))
+            }
+        }
+        ftDeliveryGoodsDataList.postValue(newftDeliveryGoodsDataList)
+    }
+
+    /**
+     * 查询品种品类筛选框列表
+     */
+    fun queryWrStandardFactoryItem(wrstandardid : String){
+        val params = mutableMapOf<String,String>().apply {
+            put("wrstandardid",wrstandardid)
+        }
+        MyApplication.getInstance()?.quoteManager?.queryWrStandardFactoryItem(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                WrStandardFactoryItemDataList.postValue(respData)
+            }
+        }
+    }
+
+
+    /**
+     * 查询品种品类筛选框列表
+     */
+    fun queryFtDeliveryGoods(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.quoteManager?.queryFtDeliveryGoods(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                ftDeliveryGoodsDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 对做完筛选或者挂牌操作后针对已选择的项进行重置
+     */
+    fun resetSelectContent(){
+        selectWrFtWrstandardData.postValue(WrFtWrstandard())
+        WrStandardFactoryItemDataList.postValue(arrayListOf())
+        selectGoodsGroupData.postValue(SelectData(id = "",value = ""))
+        selectGoodsInfoData.postValue(SelectData(id = "",value = ""))
+    }
+
+    //左侧菜单所有的挂牌信息
+    val orderQuoteDataByListed : MutableLiveData<OrderQuoteData> = MutableLiveData()
+
+    /**
+     * 查询一口价报价牌
+     */
+    fun queryOneOrderQuoteByListed(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = "",deliverymonth : String = ""){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","1")
+            put("haswr","0")
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+            if (deliverymonth.isNotEmpty()){
+                put("deliverymonth",deliverymonth)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData.isNullOrEmpty().not()){
+                    orderQuoteDataByListed.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
     /**
      * 查询一口价报价牌
      */
-    fun queryOneOrderQuote(){
+    fun queryOneOrderQuote(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = "",deliverymonth : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("marketid","17201")
             put("wrpricetype","1")
             put("haswr","0")
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+            if (deliverymonth.isNotEmpty()){
+                put("deliverymonth",deliverymonth)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
         }
         MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
             if (isSuccess){
@@ -36,11 +248,59 @@ class HnstcdysViewModel : BaseViewModel(){
     /**
      * 查询浮动价报价牌
      */
-    fun queryFloatOrderQuote(){
+    fun queryFloatOrderQuoteByListed(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = "",deliverymonth : String = ""){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
+            put("haswr","0")//0:仓单预售 1:仓单贸易
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+            if (deliverymonth.isNotEmpty()){
+                put("deliverymonth",deliverymonth)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
+        }
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData.isNullOrEmpty().not()){
+                    orderQuoteDataByListed.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
+    /**
+     * 查询浮动价报价牌
+     */
+    fun queryFloatOrderQuote(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = "",deliverymonth : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("marketid","17201")
             put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
             put("haswr","0")//0:仓单预售 1:仓单贸易
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+            if (deliverymonth.isNotEmpty()){
+                put("deliverymonth",deliverymonth)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
         }
         MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){ isSuccess, respData, error ->
             if (isSuccess){

+ 44 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysSelectViewHolder.kt

@@ -0,0 +1,44 @@
+package cn.muchinfo.rma.view.base.hnstcdys.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysViewModel
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//筛选右侧viewholder
+class CdysSelectViewHolder(private val activity : AppCompatActivity, private val viewModel: HnstcdysViewModel, private val dgfactoryitemtypeid : String) : BaseViewHolder<WrStandardFactoryItem>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "")
+            }
+            gravity = Gravity.CENTER
+            textView {
+                gravity = Gravity.CENTER
+                data.bindOptional(context){
+                    if (it?.isSelect == 0){
+                        backgroundResource = R.drawable.rma_item_normal_bg
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                        backgroundResource = R.drawable.rma_item_select_bg
+                    }
+                    text = it?.dgfactoryitemvalue
+                }
+                textSizeAuto = 32
+            }.lparams(autoSize(420), autoSize(72))
+        }.lparams(matchParent, autoSize(94))
+    }
+
+}

+ 49 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrStandardFactoryItemSonViewHolder.kt

@@ -0,0 +1,49 @@
+package cn.muchinfo.rma.view.base.hnstcdys.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysViewModel
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//要素子item
+class CdysWrStandardFactoryItemSonViewHolder(private val activity : AppCompatActivity, private val viewModel: HnstcdysViewModel) : BaseViewHolder<WrStandardFactoryItem>(activity){
+
+    override val itemSize: IntArray = intArrayOf(autoSize(160), autoSize(72))
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "")
+            }
+            gravity = Gravity.CENTER
+            data.bindOptional(context){
+                if (it?.isSelect == 0){
+                    backgroundResource = R.drawable.rma_item_normal_bg
+                }else{
+                    backgroundResource = R.drawable.rma_item_select_bg
+                }
+            }
+            textView {
+                data.bindOptional(context){
+                    text = it?.dgfactoryitemvalue
+                    if (it?.isSelect == 0){
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                    }
+                }
+                textSizeAuto = 32
+            }.lparams(wrapContent, wrapContent)
+        }.lparams(autoSize(160), autoSize(72))
+    }
+
+}

+ 63 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrStandardFactoryItemViewHolder.kt

@@ -0,0 +1,63 @@
+package cn.muchinfo.rma.view.base.hnstcdys.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.StaggeredGridLayoutManager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsDataListData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.recyclerView
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysViewModel
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WrStandardFactoryItemSonViewHolder
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//要素item
+class CdysWrStandardFactoryItemViewHolder(private val activity : AppCompatActivity, private val viewModel: HnstcdysViewModel) : BaseViewHolder<FtDeliveryGoodsDataListData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    //要素子item
+    private val spotCategoryAdapter: BaseAdapter<WrStandardFactoryItem, CdysWrStandardFactoryItemSonViewHolder> =
+        BaseAdapter { _, _ -> CdysWrStandardFactoryItemSonViewHolder(activity, viewModel) }
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+
+                    data.bindOptional(context){
+                        text = it?.itemtypename
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+            }.lparams(matchParent, autoSize(80))
+
+            recyclerView {
+                val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
+                layoutManager = staggeredGridLayoutManager
+                background = resources.getDrawable(R.color.white)
+                adapter = spotCategoryAdapter
+            }.lparams(matchParent, wrapContent)
+
+            data.bindOptional(context){
+                spotCategoryAdapter.setNewData(it?.itemlst)
+            }
+
+        }.lparams(matchParent, wrapContent)
+    }
+
+
+}

+ 64 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrstandardnameViewHolder.kt

@@ -0,0 +1,64 @@
+package cn.muchinfo.rma.view.base.hnstcdys.viewholder
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Wrstandard
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.recyclerView
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysViewModel
+import cn.muchinfo.rma.view.base.home.commodity.newcommodity.SpotCategoryViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//左侧商品选择
+class CdysWrstandardnameViewHolder(private val activity : AppCompatActivity, private val viewModel: HnstcdysViewModel) : BaseViewHolder<FtDeliveryGoodsData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    //商品adapter
+   lateinit var recyclview : RecyclerView
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    imageResource = R.mipmap.rma_down
+                }.lparams(autoSize(22), autoSize(22)){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.deliverygoodsname
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(20)
+                }
+
+            }.lparams(matchParent, autoSize(80))
+            recyclerView {
+                recyclview = this
+                background = resources.getDrawable(R.color.white)
+            }.lparams(matchParent, wrapContent)
+            data.bindOptional(context){
+                val spotCategoryAdapter: BaseAdapter<WrFtWrstandard, CdysWrstandnameSoneViewHolder> =
+                    BaseAdapter { _, _ -> CdysWrstandnameSoneViewHolder(activity, viewModel,it?.deliverygoodsid ?: "") }
+                recyclview.adapter = spotCategoryAdapter
+                spotCategoryAdapter.setNewData(it?.wdlst)
+            }
+        }.lparams(matchParent, wrapContent)
+    }
+
+}

+ 44 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/hnstcdys/viewholder/CdysWrstandnameSoneViewHolder.kt

@@ -0,0 +1,44 @@
+package cn.muchinfo.rma.view.base.hnstcdys.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.hnstcdys.HnstcdysViewModel
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class CdysWrstandnameSoneViewHolder(private val activity: AppCompatActivity, private val viewModel: HnstcdysViewModel, private val deliverygoodsid : String) : BaseViewHolder<WrFtWrstandard>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnItemClick(deliverygoodsid = deliverygoodsid,wrstandardid = data.value?.wrstandardid ?: "")
+                viewModel.selectWrFtWrstandardData.postValue(data.value)
+            }
+            gravity = Gravity.CENTER_VERTICAL
+            textView {
+                data.bindOptional(context){
+                    if (it?.isSelect == 0){
+                        textColorInt = R.color.rma_zhushi_text_color
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                    }
+                    text = it?.wrstandardname
+                }
+                textSizeAuto = 32
+
+            }.lparams(wrapContent, wrapContent){
+                marginStart = autoSize(120)
+            }
+        }.lparams(matchParent, autoSize(70))
+    }
+
+}

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/financial/FinancialViewModel.kt

@@ -78,7 +78,7 @@ class FinancialViewModel : BaseViewModel(){
         MyApplication.getInstance()?.financialManager?.queryBusinessKx(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 respData?.toArrayList()?.sortWith(Comparator { t1, t2 ->
-                    (TimeUtils.string2Millis(t1.applystatus) - TimeUtils.string2Millis(t2.applystatus)).toInt()
+                    (t1.applystatus?.toLong()?.minus(t2.applystatus?.toLong() ?: 0))?.toInt() ?: 0
                 })
                 paymentList.postValue(respData)
             }
@@ -96,7 +96,7 @@ class FinancialViewModel : BaseViewModel(){
         MyApplication.getInstance()?.financialManager?.queryBusinessFp(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 respData?.toArrayList()?.sortWith(Comparator { t1, t2 ->
-                    (TimeUtils.string2Millis(t1.applystatus) - TimeUtils.string2Millis(t2.applystatus)).toInt()
+                    (t1.applystatus?.toLong()?.minus(t2.applystatus?.toLong() ?: 0))?.toInt() ?: 0
                 })
                 invoiceList.postValue(respData)
             }

+ 11 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/financial/PaymentReviewActivity.kt

@@ -2,6 +2,7 @@
 
 package cn.muchinfo.rma.view.base.home.financial
 
+import android.content.Intent
 import android.os.Bundle
 import android.view.Gravity
 import android.view.View
@@ -17,6 +18,8 @@ import cn.muchinfo.rma.view.autoWidget.calendar.CalendarDialog
 import cn.muchinfo.rma.view.autoWidget.photopicter.PhotoUtils
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.main.promotioncode.ShowImageByUrlActivity
+import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ToastUtils
 import mtp.polymer.com.autowidget.dialog.createLoadingDialog
 import mtp.polymer.com.autowidget.utils.bindTaskStatus
@@ -359,11 +362,14 @@ class PaymentReviewActivity : BaseActivity<FinancialViewModel>() {
                                         emptyView()
                                         textView {
                                             onThrottleFirstClick {
-                                                ToastUtils.showLong("没附件,看个啥子?")
-//                                                val path = data.value.guard {
-//                                                    return@onThrottleFirstClick
-//                                                }
-//                                                PhotoUtils().showImageViewer(this@InvoiceRegistrationActivity, 1, arrayListOf(path))
+                                                if (data.attachurl.isNullOrEmpty()){
+                                                    ToastUtils.showLong("无附件查看,请修改相应信息")
+                                                    return@onThrottleFirstClick
+                                                }
+                                                val intent = Intent()
+                                                intent.putExtra("url",data.attachurl)
+                                                intent.setClass(context, ShowImageByUrlActivity::class.java)
+                                                ActivityUtils.startActivity(intent)
                                             }
                                             text = "查看附件"
                                             textSizeAuto = 29

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

@@ -65,6 +65,9 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
     //1是一口价 2是浮动价
     val pricetype by lazy { intent.getStringExtra("pricetype") }
 
+    //进入页面后是否打开挂牌dialog 1 打开 2 不打开
+    val isOpenListedDialog by lazy { intent.getStringExtra("isOpenListedDialog") }
+
     val orderQuoteData by lazy { intent.getParcelableExtra<OrderQuoteData>("data") as OrderQuoteData }
 
     /** 用于订阅行情的唯一标识 */
@@ -160,6 +163,27 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
         EventBus.getDefault().unregister(this)
     }
 
+    //判断是否打开挂牌dialog,是的话就打开
+    fun openDialogByListed(){
+        if (isOpenListedDialog == "1"){
+            if (pricetype == "1") {//一口价
+                this@BusinessHallActivity.OneListedDialog(
+                    this@BusinessHallActivity,
+                    type ?: "1",
+                    viewModel,
+                    viewModel.orderQuoteData.value ?: OrderQuoteData()
+                ).show()
+            } else {
+                this@BusinessHallActivity.FloatListedDialog(
+                    this@BusinessHallActivity,
+                    type ?: "1",
+                    viewModel,
+                    viewModel.orderQuoteData.value ?: OrderQuoteData()
+                ).show()
+            }
+        }
+    }
+
     @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -174,6 +198,7 @@ class BusinessHallActivity : BaseActivity<BusinessHallViewModel>() {
             viewModel.querydetailsWarehouseWrPosition(orderQuoteData)
             background = resources.getDrawable(R.color.white)
             viewModel.getFinancingSelectData(orderQuoteData)
+            openDialogByListed()
             //头部标题
             linearLayout {
                 background = resources.getDrawable(R.color.main_title_bg_color)

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

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.warehousereceipt
 
+import android.content.Intent
 import android.os.Bundle
 import android.view.*
 import androidx.fragment.app.Fragment
@@ -8,19 +9,21 @@ import androidx.recyclerview.widget.RecyclerView
 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.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseFragment
-import cn.muchinfo.rma.view.base.platinumtreasure.adapter.PlatnumTreasureAdapter
+import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
 import cn.muchinfo.rma.view.base.warehousereceipt.floata.FloatPriceAdapter
 import cn.muchinfo.rma.view.base.warehousereceipt.one.OnePriceAdapter
 import cn.muchinfo.rma.view.eventbus.QuoteMessageEvent
+import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
 import com.blankj.utilcode.util.LogUtils
 import com.blankj.utilcode.util.SizeUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabBuilder
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import io.reactivex.Flowable
@@ -138,16 +141,57 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
         // 销毁 mdDisposable.dispose();   这个是销毁
 
         return UI {
+            viewModel.queryFtDeliveryGoods()
+
+
 
             verticalLayout {
+                viewModel.orderQuoteDataByListed.bindOptional(context){
+                    if (it?.deliverygoodsid.isNullOrEmpty().not()){
+                        val intent = Intent()
+                        intent.putExtra("data", it)
+                        intent.putExtra("type", "1")
+                        intent.putExtra("isOpenListedDialog","1")
+                        intent.putExtra("pricetype", selectedTabIndex.plus(1).toString())
+                        intent.setClass(context, BusinessHallActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                }
                 linearLayout {
-                    background = resources.getDrawable(R.color.white)
+                    background = resources.getDrawable(R.color.main_title_bg_color)
+                    gravity = Gravity.CENTER_VERTICAL
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        imageView {
+                            onThrottleFirstClick {
+                                if (selectedTabIndex == 0){
+                                    getAppCompatActivity().WarehouseScreeningDialog(viewModel,getAppCompatActivity(),"1").show()
+                                }else{
+                                    getAppCompatActivity().WarehouseScreeningDialog(viewModel,getAppCompatActivity(),"2").show()
+                                }
+                            }
+                            imageResource = R.mipmap.yrdz_screening_icon
+                        }.lparams(autoSize(48), autoSize(48)){
+                            marginStart = autoSize(36)
+                        }
+                    }.lparams(autoSize(200), autoSize(120))
+
+                    emptyView()
 
+                    textView {
+                        text = "仓单贸易"
+                        textColorInt = R.color.white
+                        textSizeAuto = 43
+                    }.lparams(wrapContent, wrapContent)
+
+                    emptyView()
                     view {
 
-                    }.lparams(autoSize(200), autoSize(100))
+                    }.lparams(autoSize(200), autoSize(120))
+                }.lparams(matchParent, autoSize(120))
 
-                    tabSegment {
+                tabSegment {
+                        // 设置
                         segment = this
                         background = resources.getDrawable(R.color.white)
                         addOnTabSelectedListener(object :
@@ -159,6 +203,8 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
                                 selectedTabIndex = index
                             }
                         })
+
+
                         setIndicator(
                             QMUITabIndicator(
                                 QMUIDisplayHelper.dp2px(context, 2),
@@ -166,13 +212,9 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
                                 true
                             )
                         )
-                        setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
-                    }.lparams(0, autoSize(100),1f)
 
-                    view {
-
-                    }.lparams(autoSize(200), autoSize(100))
-                }.lparams(matchParent, autoSize(100))
+                        setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+                }.lparams(matchParent, autoSize(80))
 
                 view {
                     background = resources.getDrawable(R.color.main_hit_bg_color)
@@ -185,9 +227,22 @@ class WarehouseReceiptFragment : BaseFragment<WarehouseReceiptViewModel>(){
                     viewPager = this
                     adapter = newPagerAdapter
                 }.lparams(matchParent, matchParent)
-
+                segment.reset()
+                val tabBuilder: QMUITabBuilder = segment.tabBuilder()
+                    .setGravity(Gravity.CENTER)
+                val component1 = tabBuilder
+                    .setText("价")
+                    .setColorAttr(R.color.white, R.color.white)
+                    .build(context)
+                val component2 = tabBuilder
+                    .setText("浮动价")
+                    .setColorAttr(R.color.white, R.color.white)
+                    .build(context)
+                segment.addTab(component1)
+                segment.addTab(component2)
                 segment.setupWithViewPager(viewPager)
                 segment.selectTab(0)
+
             }
         }.view
 
@@ -389,7 +444,7 @@ class FloatingPriceUI(private val fragment : Fragment,private val viewModel: War
 
     val root = _FrameLayout(fragment.context!!).apply {
         verticalLayout {
-            viewModel.queryFloatOrderQuote(tag = thisTag)
+            viewModel.queryFloatOrderQuote()
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL

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

@@ -1,13 +1,17 @@
 package cn.muchinfo.rma.view.base.warehousereceipt
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.data.OrderQuoteData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsGroups
 import cn.muchinfo.rma.global.data.account.loginQeruy.GoodsInfo
 import cn.muchinfo.rma.global.database.DataBase
 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.dialog.SelectData
 
 /**
  * 仓单贸易页面viewmodel
@@ -20,15 +24,225 @@ class WarehouseReceiptViewModel : BaseViewModel(){
     //浮动价报价牌数据
     val floatProceDataList : MutableLiveData<List<OrderQuoteData>> = MutableLiveData()
 
+
+    //品种品类筛选框列表
+    val ftDeliveryGoodsDataList : MutableLiveData<List<FtDeliveryGoodsData>> = MutableLiveData()
+
+    //选择的商品
+    val selectWrFtWrstandardData : MutableLiveData<WrFtWrstandard> = MutableLiveData()
+
+    //要素定义项
+    val WrStandardFactoryItemDataList : MutableLiveData<List<FtDeliveryGoodsDataListData>> = MutableLiveData()
+
+    //选择的商品组列表
+    val goodsGroupList : MutableLiveData<List<SelectData>> = MutableLiveData()
+    //选择的商品组实体
+    val selectGoodsGroupData : MutableLiveData<SelectData> = MutableLiveData()
+
+    //选择的商品列表
+    val goodsInfoList : MutableLiveData<List<SelectData>> = MutableLiveData()
+    //选择的期货合约实体
+    val selectGoodsInfoData : MutableLiveData<SelectData> = MutableLiveData()
+
+    //获取选择的仓库ID和选择的要素类型
+    //type 为1是仓库 type 为2是其他要素
+    fun getSelectWarehouseOrFactoryid(type : String) : String{
+        var returnString = ""
+        WrStandardFactoryItemDataList.value?.forEach {
+            if (type == it.dgfactoryitemtypeid){
+                it.itemlst?.forEach { data ->
+                    if (data.isSelect == 1){
+                        returnString = data.warehouseid ?: ""
+                    }
+                }
+            }else {
+                it.itemlst?.forEach { data ->
+                    if (data.isSelect == 1){
+                        returnString = returnString + "," + data.dgfactoryitemid
+                    }
+                }
+            }
+        }
+        return returnString
+    }
+
+    //根据选择的商品组组织商品选择列表
+    fun setGoodsInfoList(goodsgroupid : String){
+        val newGoodsInfoList = arrayListOf<SelectData>()
+        val goodsInfoList1 = DataBase.getInstance().goodsInfoDao().all
+        goodsInfoList1?.forEach {
+            if (it?.goodsgroupid.toString() == goodsgroupid){
+                newGoodsInfoList.add(SelectData(id = it?.goodsid.toString(),value = it?.goodsname.toString()))
+            }
+        }
+        goodsInfoList.postValue(newGoodsInfoList)
+    }
+
+    //针对期货合约的 设置商品组选择的列表
+    fun setGoodsGroupAndGoodsInfoList(){
+        val newgoodsGroupList = arrayListOf<SelectData>()
+        val marketData = GlobalDataCollection.instance?.loginQueryData?.market?.find { it.trademode == 99 }//找出trademode 为99的市场
+        GlobalDataCollection.instance?.loginQueryData?.goodsgroups?.forEach {
+            if (it.marketid == marketData?.marketid){
+                newgoodsGroupList.add(SelectData(id = it.marketid.toString(),value = it.goodsgroupname,goodsgroupid = it.goodsgroupid.toString()))
+            }
+        }
+        goodsGroupList.postValue(newgoodsGroupList)
+    }
+
+    //重置品种品类筛选框列表
+    fun resetFtDeliveryGoodsDataList(){
+        ftDeliveryGoodsDataList.postValue(ftDeliveryGoodsDataList.value)
+    }
+
+    /**
+     * 针对仓库,要素等的item点击
+     */
+    fun setOnRightItemClick(
+        dgfactoryitemid : String
+    ){
+        val newWrStandardFactoryItemDataList = arrayListOf<FtDeliveryGoodsDataListData>()
+        WrStandardFactoryItemDataList.value?.forEach {
+            val sonItemList = arrayListOf<WrStandardFactoryItem>()
+            it.itemlst?.forEach { data ->
+                if (dgfactoryitemid == data.dgfactoryitemid){
+                    sonItemList.add(data.copy(isSelect = 1))
+                }else{
+                    sonItemList.add(data.copy(isSelect = 0))
+                }
+            }
+            newWrStandardFactoryItemDataList.add(it.copy(itemlst = sonItemList))
+        }
+        WrStandardFactoryItemDataList.postValue(newWrStandardFactoryItemDataList)
+    }
+
+    /**
+     * 对左侧商品列表进行选择后的刷新
+     */
+    fun setOnItemClick(deliverygoodsid : String,wrstandardid : String){
+        val newftDeliveryGoodsDataList = arrayListOf<FtDeliveryGoodsData>()
+        ftDeliveryGoodsDataList.value?.forEach {
+            val sonItemList = arrayListOf<WrFtWrstandard>()
+            if (it.deliverygoodsid == deliverygoodsid){
+                it.wdlst?.forEach { data ->
+                    if (wrstandardid == data.wrstandardid){
+                        sonItemList.add(data.copy(isSelect = 1))
+                    }else{
+                        sonItemList.add(data.copy(isSelect = 0))
+                    }
+                }
+                newftDeliveryGoodsDataList.add(it.copy(wdlst = sonItemList))
+            }else{
+                it.wdlst?.forEach { data ->
+                    sonItemList.add(data.copy(isSelect = 0))
+                }
+                newftDeliveryGoodsDataList.add(it.copy(wdlst = sonItemList))
+            }
+        }
+        ftDeliveryGoodsDataList.postValue(newftDeliveryGoodsDataList)
+    }
+
+    /**
+     * 查询品种品类筛选框列表
+     */
+    fun queryWrStandardFactoryItem(wrstandardid : String){
+        val params = mutableMapOf<String,String>().apply {
+            put("wrstandardid",wrstandardid)
+        }
+        MyApplication.getInstance()?.quoteManager?.queryWrStandardFactoryItem(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                WrStandardFactoryItemDataList.postValue(respData)
+            }
+        }
+    }
+
+
+    /**
+     * 查询品种品类筛选框列表
+     */
+    fun queryFtDeliveryGoods(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.quoteManager?.queryFtDeliveryGoods(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                ftDeliveryGoodsDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 对做完筛选或者挂牌操作后针对已选择的项进行重置
+     */
+    fun resetSelectContent(){
+        selectWrFtWrstandardData.postValue(WrFtWrstandard())
+        WrStandardFactoryItemDataList.postValue(arrayListOf())
+        selectGoodsGroupData.postValue(SelectData(id = "",value = ""))
+        selectGoodsInfoData.postValue(SelectData(id = "",value = ""))
+    }
+
+    //左侧菜单所有的挂牌信息
+    val orderQuoteDataByListed : MutableLiveData<OrderQuoteData> = MutableLiveData()
+
+    /**
+     * 查询一口价报价牌用余挂牌时的筛选
+     * wrstandardid 品类id
+     * warehouseid 仓库id(筛选条件)
+     * dgitemname 商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm
+     */
+    fun queryOneOrderQuoteByListed(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = ""){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","1")
+            put("haswr","1")
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
+        }
+
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                 if (respData.isNullOrEmpty().not()){
+                     orderQuoteDataByListed.postValue(respData?.get(0))
+                 }
+            }
+        }
+    }
+
     /**
      * 查询一口价报价牌
+     * wrstandardid 品类id
+     * warehouseid 仓库id(筛选条件)
+     * dgitemname 商品要素项名称模糊匹配, 逗号隔开, 如 产地1,品牌1,规格12mm
      */
-    fun queryOneOrderQuote(){
+    fun queryOneOrderQuote(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("marketid","17201")
             put("wrpricetype","1")
             put("haswr","1")
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
         }
+
         MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 onePrcieDataList.postValue(respData)
@@ -39,25 +253,61 @@ class WarehouseReceiptViewModel : BaseViewModel(){
     /**
      * 查询浮动价报价牌
      */
-    fun queryFloatOrderQuote(tag : String){
+    fun queryFloatOrderQuoteByListed(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = ""){
+        val params = mutableMapOf<String,String>().apply {
+            put("marketid","17201")
+            put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
+            put("haswr","1")//0:仓单预售 1:仓单贸易
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
+        }
+
+        MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData.isNullOrEmpty().not()){
+                    orderQuoteDataByListed.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 查询浮动价报价牌
+     */
+    fun queryFloatOrderQuote(wrstandardid : String = "",warehouseid : String = "",dgitemname : String = ""){
         val params = mutableMapOf<String,String>().apply {
             put("marketid","17201")
             put("wrpricetype","2")//价格方式 - 1:固定价 2-浮动价
             put("haswr","1")//0:仓单预售 1:仓单贸易
+            if (wrstandardid.isNotEmpty()){
+                put("wrstandardid",wrstandardid)
+            }
+            if (warehouseid.isNotEmpty()){
+                put("warehouseid",warehouseid)
+            }
+            if (dgitemname.isNotEmpty()){
+                put("dgitemname",dgitemname)
+            }
+        }
+        if (wrstandardid.isNotEmpty()){
+            resetSelectContent()
         }
+
         MyApplication.getInstance()?.quoteManager?.queryOrderQuote(params = params){isSuccess, respData, error ->
             if (isSuccess){
                 floatProceDataList.postValue(respData)
                 //说是不订阅行情,靠轮询10秒查
-//                if (respData?.size ?: 0 > 10){
-//                    queryQuoteDay(tag,0,10,respData ?: arrayListOf()){isCompleted, err ->
-//
-//                    }
-//                }else{
-//                    queryQuoteDay(tag,0,respData?.size ?: 0,respData ?: arrayListOf()){isCompleted, err ->
-//
-//                    }
-//                }
             }
         }
     }

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

@@ -0,0 +1,307 @@
+package cn.muchinfo.rma.view.base.warehousereceipt
+
+import android.graphics.Color
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsData
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsDataListData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseSelectViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseWrstandardnameViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WarehouseWrstandnameSoneViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.viewholder.WrStandardFactoryItemViewHolder
+import com.blankj.utilcode.util.ToastUtils
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.CustomDialogFragment
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createCustomDialog
+import org.jetbrains.anko.*
+
+//仓单贸易左侧菜单栏
+fun AppCompatActivity.WarehouseScreeningDialog(
+    viewModel: WarehouseReceiptViewModel,
+    activity: AppCompatActivity,
+    type: String//1 是一口价 2是浮动价
+): CustomDialogFragment {
+
+    //品种
+    val spotCategoryAdapter: BaseAdapter<FtDeliveryGoodsData, WarehouseWrstandardnameViewHolder> =
+        BaseAdapter { _, _ -> WarehouseWrstandardnameViewHolder(activity, viewModel) }
+
+    //要素
+    val elementsAdapter: BaseAdapter<FtDeliveryGoodsDataListData, WrStandardFactoryItemViewHolder> =
+        BaseAdapter { _, _ -> WrStandardFactoryItemViewHolder(activity, viewModel) }
+
+    lateinit var warehouseRecycview: RecyclerView
+
+    return createCustomDialog(cancelable = false) { dialog ->
+        backgroundColor = Color.parseColor("#5f000000")
+
+        verticalLayout {
+            viewModel.resetFtDeliveryGoodsDataList()
+            viewModel.setGoodsGroupAndGoodsInfoList()
+            background = resources.getDrawable(R.color.white)
+            viewModel.selectWrFtWrstandardData.bindOptional(context) {
+                viewModel.queryWrStandardFactoryItem(it?.wrstandardid ?: "")
+            }
+
+            frameLayout {
+                nestedScrollView {
+                    linearLayout {
+                        recyclerView {
+                            background = resources.getDrawable(R.color.white)
+                            adapter = spotCategoryAdapter
+                        }.lparams(autoSize(310), matchParent) {
+                            bottomMargin = autoSize(150)
+                        }
+
+                        viewModel.ftDeliveryGoodsDataList.bindOptional(context) {
+                            spotCategoryAdapter.setNewData(it)
+                        }
+
+                        view {
+                            background = resources.getDrawable(R.color.rma_hint_line_color_eee)
+                        }.lparams(autoSize(1), matchParent)
+
+                        verticalLayout {
+                            linearLayout {
+                                gravity = Gravity.CENTER_VERTICAL
+                                textView {
+                                    text = "仓库"
+                                    textSizeAuto = 34
+                                    textColorInt = R.color.rma_black_33
+                                }.lparams(wrapContent, wrapContent) {
+                                    marginStart = autoSize(34)
+                                }
+                            }.lparams(matchParent, autoSize(80))
+
+                            recyclerView {
+                                warehouseRecycview = this
+                                background = resources.getDrawable(R.color.white)
+                            }.lparams(matchParent, wrapContent)
+
+                            viewModel.WrStandardFactoryItemDataList.bindOptional(context) { data ->
+                                //仓库
+                                val ftDeliveryGoodsDataListData =
+                                    data?.find { it.dgfactoryitemtypeid == "1" }
+                                if (ftDeliveryGoodsDataListData?.dgfactoryitemtypeid.isNullOrEmpty()
+                                        .not()
+                                ) {
+                                    val watehouseAdapter: BaseAdapter<WrStandardFactoryItem, WarehouseSelectViewHolder> =
+                                        BaseAdapter { _, _ ->
+                                            WarehouseSelectViewHolder(
+                                                activity,
+                                                viewModel,
+                                                ftDeliveryGoodsDataListData?.dgfactoryitemtypeid
+                                                    ?: ""
+                                            )
+                                        }
+                                    warehouseRecycview.adapter = watehouseAdapter
+                                    watehouseAdapter.setNewData(ftDeliveryGoodsDataListData?.itemlst)
+                                }
+                            }
+
+                            verticalLayout {
+                                if (type == "1"){
+                                    visibility = View.GONE
+                                }else{
+                                    visibility = View.VISIBLE
+                                }
+                                linearLayout {
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        text = "期货合约"
+                                        textSizeAuto = 34
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(34)
+                                    }
+                                }.lparams(matchParent, autoSize(80))
+
+                                linearLayout {
+                                    onThrottleFirstClick {
+                                        activity.creatBottomSheetDialog(
+                                            "请选择品种",
+                                            viewModel.goodsGroupList.value ?: arrayListOf()
+                                        ) {
+                                            viewModel.selectGoodsGroupData.postValue(this)
+                                            viewModel.setGoodsInfoList(this.goodsgroupid)
+                                        }
+                                    }
+                                    backgroundResource = R.drawable.yrdz_item_normal_bg
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        viewModel.selectGoodsGroupData.bindOptional(context) {
+                                            text = it?.value
+                                        }
+                                        text = "请选择品种"
+                                        textSizeAuto = 32
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(30)
+                                    }
+
+                                    emptyView()
+
+                                    imageView {
+                                        imageResource = R.mipmap.rma_down
+                                    }.lparams(autoSize(30), autoSize(20)) {
+                                        marginEnd = autoSize(30)
+                                    }
+                                }.lparams(autoSize(420), autoSize(72)) {
+                                    marginStart = autoSize(36)
+                                }
+
+                                linearLayout {
+                                    onThrottleFirstClick {
+                                        if (viewModel.selectGoodsGroupData.value?.id.isNullOrEmpty()){
+                                            ToastUtils.showLong("请先选择商品组")
+                                            return@onThrottleFirstClick
+                                        }
+                                        activity.creatBottomSheetDialog(
+                                            "请选择合约",
+                                            viewModel.goodsInfoList.value ?: arrayListOf()
+                                        ) {
+                                            viewModel.selectGoodsInfoData.postValue(this)
+                                        }
+                                    }
+                                    backgroundResource = R.drawable.yrdz_item_normal_bg
+                                    gravity = Gravity.CENTER_VERTICAL
+                                    textView {
+                                        viewModel.selectGoodsInfoData.bindOptional(context) {
+                                            text = it?.value
+                                        }
+                                        text = "请选择合约"
+                                        textSizeAuto = 32
+                                        textColorInt = R.color.rma_black_33
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(30)
+                                    }
+
+                                    emptyView()
+
+                                    imageView {
+                                        imageResource = R.mipmap.rma_down
+                                    }.lparams(autoSize(30), autoSize(20)) {
+                                        marginEnd = autoSize(30)
+                                    }
+                                }.lparams(autoSize(420), autoSize(72)) {
+                                    topMargin = autoSize(24)
+                                    marginStart = autoSize(36)
+                                }
+                            }.lparams(matchParent, wrapContent)
+
+
+                            recyclerView {
+                                background = resources.getDrawable(R.color.white)
+                                adapter = elementsAdapter
+                            }.lparams(matchParent, wrapContent)
+
+                            viewModel.WrStandardFactoryItemDataList.bindOptional(context) { data ->
+                                val elementsDataList = arrayListOf<FtDeliveryGoodsDataListData>()
+
+                                data?.forEach {
+                                    if (it.dgfactoryitemtypeid != "1") {
+                                        elementsDataList.add(it)
+                                    }
+                                }
+                                elementsAdapter.setNewData(elementsDataList)
+
+                            }
+
+                        }.lparams(matchParent, matchParent)
+                    }
+                }
+
+                linearLayout {
+                    background = resources.getDrawable(R.color.white)
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        onThrottleFirstClick {
+                            dialog.dismiss()
+                            viewModel.selectWrFtWrstandardData.postValue(WrFtWrstandard())
+                        }
+                        backgroundResource = R.drawable.rma_item_click_bg
+                        gravity = Gravity.CENTER
+                        text = "重置"
+                        textSizeAuto = 34
+                        textColorInt = R.color.rma_blue_color
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            if (viewModel.selectWrFtWrstandardData.value?.wrstandardid.isNullOrEmpty()){
+                                ToastUtils.showLong("请选择相应商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (type == "1"){
+                                viewModel.queryOneOrderQuote(wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid ?: "",warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"))
+                            }else{
+                                viewModel.queryFloatOrderQuote(wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid ?: "",warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"))
+
+                            }
+                             dialog.dismiss()
+                        }
+                        backgroundResource = R.drawable.rydz_main_blue_bg
+                        gravity = Gravity.CENTER
+                        text = "筛选"
+                        textSizeAuto = 34
+                        textColorInt = R.color.white
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                    }
+
+                    textView {
+                        onThrottleFirstClick {
+                            if (viewModel.selectWrFtWrstandardData.value?.wrstandardid.isNullOrEmpty()){
+                                ToastUtils.showLong("请选择相应商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.getSelectWarehouseOrFactoryid("1").isNullOrEmpty()){
+                                ToastUtils.showLong("请选择仓库")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.selectGoodsInfoData.value?.id.isNullOrEmpty()){
+                                ToastUtils.showLong("请选择期货商品")
+                                return@onThrottleFirstClick
+                            }
+                            if (viewModel.getSelectWarehouseOrFactoryid("2").split(",").size < viewModel.WrStandardFactoryItemDataList.value?.size?.minus(1) ?: 0){
+                                ToastUtils.showLong("请选择必要要素")
+                                return@onThrottleFirstClick
+                            }
+                            if (type == "1"){
+                                viewModel.queryFloatOrderQuoteByListed(wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid ?: "",warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"))
+                            }else{
+                                viewModel.queryFloatOrderQuoteByListed(wrstandardid = viewModel.selectWrFtWrstandardData.value?.wrstandardid ?: "",warehouseid = viewModel.getSelectWarehouseOrFactoryid("1"),dgitemname = viewModel.getSelectWarehouseOrFactoryid("2"))
+                            }
+                            dialog.dismiss()
+                        }
+                        backgroundResource = R.drawable.rydz_main_red_bg
+                        gravity = Gravity.CENTER
+                        text = "挂牌"
+                        textSizeAuto = 34
+                        textColorInt = R.color.white
+                    }.lparams(0, autoSize(84), 1f) {
+                        marginStart = autoSize(23)
+                        marginEnd = autoSize(23)
+                    }
+                }.lparams(matchParent, autoSize(120)) {
+                    gravity = Gravity.BOTTOM
+                }
+            }.lparams(matchParent, matchParent)
+        }.lparams(matchParent, matchParent) {
+            topMargin = autoSize(120)
+            marginEnd = autoSize(84)
+        }
+    }
+}

+ 42 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseSelectViewHolder.kt

@@ -0,0 +1,42 @@
+package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class WarehouseSelectViewHolder(private val activity : AppCompatActivity,private val viewModel: WarehouseReceiptViewModel,private val dgfactoryitemtypeid : String) : BaseViewHolder<WrStandardFactoryItem>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "")
+            }
+            gravity = Gravity.CENTER
+            textView {
+                gravity = Gravity.CENTER
+                data.bindOptional(context){
+                    if (it?.isSelect == 0){
+                        backgroundResource = R.drawable.rma_item_normal_bg
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                        backgroundResource = R.drawable.rma_item_select_bg
+                    }
+                    text = it?.dgfactoryitemvalue
+                }
+                textSizeAuto = 32
+            }.lparams(autoSize(420), autoSize(72))
+        }.lparams(matchParent, autoSize(94))
+    }
+
+}

+ 63 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseWrstandardnameViewHolder.kt

@@ -0,0 +1,63 @@
+package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Wrstandard
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.recyclerView
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.commodity.newcommodity.SpotCategoryViewHolder
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//左侧商品选择
+class WarehouseWrstandardnameViewHolder(private val activity : AppCompatActivity,private val viewModel: WarehouseReceiptViewModel) : BaseViewHolder<FtDeliveryGoodsData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    //商品adapter
+   lateinit var recyclview : RecyclerView
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    imageResource = R.mipmap.rma_down
+                }.lparams(autoSize(22), autoSize(22)){
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.deliverygoodsname
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(20)
+                }
+
+            }.lparams(matchParent, autoSize(80))
+            recyclerView {
+                recyclview = this
+                background = resources.getDrawable(R.color.white)
+            }.lparams(matchParent, wrapContent)
+            data.bindOptional(context){
+                val spotCategoryAdapter: BaseAdapter<WrFtWrstandard, WarehouseWrstandnameSoneViewHolder> =
+                    BaseAdapter { _, _ -> WarehouseWrstandnameSoneViewHolder(activity, viewModel,it?.deliverygoodsid ?: "") }
+                recyclview.adapter = spotCategoryAdapter
+                spotCategoryAdapter.setNewData(it?.wdlst)
+            }
+        }.lparams(matchParent, wrapContent)
+    }
+
+}

+ 43 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WarehouseWrstandnameSoneViewHolder.kt

@@ -0,0 +1,43 @@
+package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class WarehouseWrstandnameSoneViewHolder(private val activity: AppCompatActivity,private val viewModel: WarehouseReceiptViewModel,private val deliverygoodsid : String) : BaseViewHolder<WrFtWrstandard>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnItemClick(deliverygoodsid = deliverygoodsid,wrstandardid = data.value?.wrstandardid ?: "")
+                viewModel.selectWrFtWrstandardData.postValue(data.value)
+            }
+            gravity = Gravity.CENTER_VERTICAL
+            textView {
+                data.bindOptional(context){
+                    if (it?.isSelect == 0){
+                        textColorInt = R.color.rma_zhushi_text_color
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                    }
+                    text = it?.wrstandardname
+                }
+                textSizeAuto = 32
+
+            }.lparams(wrapContent, wrapContent){
+                marginStart = autoSize(120)
+            }
+        }.lparams(matchParent, autoSize(70))
+    }
+
+}

+ 48 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemSonViewHolder.kt

@@ -0,0 +1,48 @@
+package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//要素子item
+class WrStandardFactoryItemSonViewHolder(private val activity : AppCompatActivity,private val viewModel: WarehouseReceiptViewModel) : BaseViewHolder<WrStandardFactoryItem>(activity){
+
+    override val itemSize: IntArray = intArrayOf(autoSize(160), autoSize(72))
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnRightItemClick(dgfactoryitemid = data.value?.dgfactoryitemid ?: "")
+            }
+            gravity = Gravity.CENTER
+            data.bindOptional(context){
+                if (it?.isSelect == 0){
+                    backgroundResource = R.drawable.rma_item_normal_bg
+                }else{
+                    backgroundResource = R.drawable.rma_item_select_bg
+                }
+            }
+            textView {
+                data.bindOptional(context){
+                    text = it?.dgfactoryitemvalue
+                    if (it?.isSelect == 0){
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                    }
+                }
+                textSizeAuto = 32
+            }.lparams(wrapContent, wrapContent)
+        }.lparams(autoSize(160), autoSize(72))
+    }
+
+}

+ 61 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/warehousereceipt/viewholder/WrStandardFactoryItemViewHolder.kt

@@ -0,0 +1,61 @@
+package cn.muchinfo.rma.view.base.warehousereceipt.viewholder
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.StaggeredGridLayoutManager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.FtDeliveryGoodsDataListData
+import cn.muchinfo.rma.global.data.WrFtWrstandard
+import cn.muchinfo.rma.global.data.WrStandardFactoryItem
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.recyclerView
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.warehousereceipt.WarehouseReceiptViewModel
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+//要素item
+class WrStandardFactoryItemViewHolder(private val activity : AppCompatActivity,private val viewModel: WarehouseReceiptViewModel) : BaseViewHolder<FtDeliveryGoodsDataListData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    //要素子item
+    private val spotCategoryAdapter: BaseAdapter<WrStandardFactoryItem, WrStandardFactoryItemSonViewHolder> =
+        BaseAdapter { _, _ -> WrStandardFactoryItemSonViewHolder(activity, viewModel) }
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+
+                    data.bindOptional(context){
+                        text = it?.itemtypename
+                    }
+                    textSizeAuto = 34
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(36)
+                }
+
+            }.lparams(matchParent, autoSize(80))
+
+            recyclerView {
+                val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
+                layoutManager = staggeredGridLayoutManager
+                background = resources.getDrawable(R.color.white)
+                adapter = spotCategoryAdapter
+            }.lparams(matchParent, wrapContent)
+
+            data.bindOptional(context){
+                spotCategoryAdapter.setNewData(it?.itemlst)
+            }
+
+        }.lparams(matchParent, wrapContent)
+    }
+
+
+}

+ 8 - 0
RMA/app/src/main/res/drawable/rma_item_normal_bg.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <stroke
+        android:color="#368FDF"
+        android:width="0dp" />
+    <solid android:color="#F4F4F4"/>
+    <corners android:radius="3dp"/>
+</shape>

+ 8 - 0
RMA/app/src/main/res/drawable/rma_item_select_bg.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <stroke
+        android:color="#368FDF"
+        android:width="0.5dp" />
+    <solid android:color="#E1F0FF"/>
+    <corners android:radius="3dp"/>
+</shape>

+ 10 - 0
RMA/app/src/main/res/drawable/rydz_main_blue_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <gradient
+        android:angle="0"
+        android:endColor="#3792EC"
+        android:startColor="#47B6EA"
+        android:type="linear" />
+    <corners android:radius="5dp" />
+</shape>

+ 10 - 0
RMA/app/src/main/res/drawable/rydz_main_red_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <gradient
+        android:angle="0"
+        android:endColor="#F15D40"
+        android:startColor="#FF9F6B"
+        android:type="linear" />
+    <corners android:radius="5dp" />
+</shape>

+ 8 - 0
RMA/app/src/main/res/drawable/yrdz_item_normal_bg.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <stroke
+        android:color="#CCCCCC"
+        android:width="0.5dp" />
+    <solid android:color="#FFFFFF"/>
+    <corners android:radius="3dp"/>
+</shape>

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