Browse Source

风险管理4月26日提交代码-liu.bolan

Liu.bolan 4 years ago
parent
commit
806ec04b28
25 changed files with 1105 additions and 470 deletions
  1. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt
  2. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/adapter/CommodityAdapter.kt
  3. 246 32
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt
  4. 87 3
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/MiddleGoodsDetail.kt
  5. 7 7
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/UserAccountData.kt
  6. 120 83
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddHedgeGoodsActivity.kt
  7. 19 18
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddSpotGoodsActivity.kt
  8. 33 26
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/CommodityInformationViewModel.kt
  9. 7 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/BrandViewHolder.kt
  10. 115 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/DemoViewHolder.kt
  11. 163 51
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationActivity.kt
  12. 106 182
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationViewModel.kt
  13. 15 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotCategoryViewHolder.kt
  14. 14 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotFutureViewHolder.kt
  15. 17 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotHedgeViewHolder.kt
  16. 12 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeFutureContractViewHolder.kt
  17. 18 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeFutureViewHolder.kt
  18. 14 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeSpotCagetoryViewHolder.kt
  19. 16 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeSpotViewHolder.kt
  20. 84 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/NewHedgeSpeciesViewHolder.kt
  21. 2 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/AddSpotCategoryViewHolder.kt
  22. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/InsuredVarietyViewHolder.kt
  23. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/popups.kt
  24. BIN
      RMA/app/src/main/res/mipmap-xhdpi/rma_message_normal.png
  25. BIN
      RMA/app/src/main/res/mipmap-xhdpi/rma_message_select.png

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt

@@ -186,7 +186,7 @@ class CommodityManager {
         responseBack: (isSuccess: Boolean, respData: List<MiddleGoodsDetail>?, error: Error?) -> Unit
         responseBack: (isSuccess: Boolean, respData: List<MiddleGoodsDetail>?, error: Error?) -> Unit
     ){
     ){
         MyOkHttpUtils().query(
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryMiddleGoodsDetail",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryMiddleGoodsDetail",
             params = params,
             params = params,
             type = "1",
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<MiddleGoodsDetail>>>(){
             callback = object : ResponseCallback<BaseResult<List<MiddleGoodsDetail>>>(){

+ 3 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/adapter/CommodityAdapter.kt

@@ -42,6 +42,9 @@ object CommodityAdapter {
             builder.deliverygoodscode = deliverygoodscode
             builder.deliverygoodscode = deliverygoodscode
             builder.deliverygoodsname = deliverygoodsname
             builder.deliverygoodsname = deliverygoodsname
         }
         }
+        if (wrstandardid != 0L){
+            builder.deliverygoodsid = wrstandardid
+        }
 //        builder.wrstandardid = wrstandardid
 //        builder.wrstandardid = wrstandardid
         builder.type = type
         builder.type = type
         builder.unitid = unitid
         builder.unitid = unitid

+ 246 - 32
RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt

@@ -7,27 +7,36 @@ import android.os.Parcelable
  * 现货商品详情实体
  * 现货商品详情实体
  */
  */
 data class DeliveryGoodsDetailData(
 data class DeliveryGoodsDetailData(
+    var isSelectAll : Int = 0,//是否全部展开
+    var categoryIsSelect : Int = 1,//品类是否展开
+    var brandIsSelect : Int = 1,//品牌是否展开
     val data : ErmcpDeliveryGoods? = ErmcpDeliveryGoods(),
     val data : ErmcpDeliveryGoods? = ErmcpDeliveryGoods(),
     val gblist : List<Ermcp3Brand>? = arrayListOf(),//品牌列表
     val gblist : List<Ermcp3Brand>? = arrayListOf(),//品牌列表
-    val gmlist : List<ErmcpWrstandard>? = arrayListOf(),//品类列表(仓单标准)
-    val goodslist : List<ErmcpRelatedGoods>? = arrayListOf(),
-    val wrslist : List<WRSConverTDetail>? = arrayListOf()
+    val gmlist : List<Ermcp3Wrstandard>? = arrayListOf(),//品类列表(仓单标准)
+    val mgList : List<Ermcp3MiddleGoodsDetail>? = arrayListOf(),
+    var hedgeIsSelect : Int = 1//套保是否展开
 ) : Parcelable{
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
     constructor(parcel: Parcel) : this(
+        parcel.readInt(),
+        parcel.readInt(),
+        parcel.readInt(),
         parcel.readParcelable(ErmcpDeliveryGoods::class.java.classLoader),
         parcel.readParcelable(ErmcpDeliveryGoods::class.java.classLoader),
         parcel.createTypedArrayList(Ermcp3Brand),
         parcel.createTypedArrayList(Ermcp3Brand),
-        parcel.createTypedArrayList(ErmcpWrstandard),
-        parcel.createTypedArrayList(ErmcpRelatedGoods),
-        parcel.createTypedArrayList(WRSConverTDetail)
+        parcel.createTypedArrayList(Ermcp3Wrstandard),
+        parcel.createTypedArrayList(Ermcp3MiddleGoodsDetail),
+        parcel.readInt()
     ) {
     ) {
     }
     }
 
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
     override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeInt(isSelectAll)
+        parcel.writeInt(categoryIsSelect)
+        parcel.writeInt(brandIsSelect)
         parcel.writeParcelable(data, flags)
         parcel.writeParcelable(data, flags)
         parcel.writeTypedList(gblist)
         parcel.writeTypedList(gblist)
         parcel.writeTypedList(gmlist)
         parcel.writeTypedList(gmlist)
-        parcel.writeTypedList(goodslist)
-        parcel.writeTypedList(wrslist)
+        parcel.writeTypedList(mgList)
+        parcel.writeInt(hedgeIsSelect)
     }
     }
 
 
     override fun describeContents(): Int {
     override fun describeContents(): Int {
@@ -44,7 +53,6 @@ data class DeliveryGoodsDetailData(
         }
         }
     }
     }
 
 
-
 }
 }
 
 
 data class ErmcpDeliveryGoods(
 data class ErmcpDeliveryGoods(
@@ -119,7 +127,7 @@ data class ErmcpDeliveryGoods(
     }
     }
 
 
 }
 }
-
+//品牌列表
 data class Ermcp3Brand(
 data class Ermcp3Brand(
     val areauserid : String? = "",//用户id
     val areauserid : String? = "",//用户id
     val brandid : String? = "",//品牌id
     val brandid : String? = "",//品牌id
@@ -156,24 +164,25 @@ data class Ermcp3Brand(
     }
     }
 
 
 }
 }
-
-data class ErmcpWrstandard(
-    val areauserid : String? = "",//所属机构
-    val createtime : String? = "",//创建时间
-    val creatorid : String?  ="",//创建人
-    val deliverygoodsid : String? = "",//品种ID
-    val enumdicname : String? = "",//单位名称
-    val isvalid : String? = "",//是否有效 0-无效(停用) 1-有效(正常)
-    val minivalue : String?  ="",//最小变动值
-    val minivaluedp : String? = "",//最小变动值小数位
-    val realminivalue : String? = "",//实际最小变动值
-    val realminivaluedp : String? = "",//实际最小变动值小数位
-    val remark : String? = "",//备注
-    val unitid : String?  ="",//单位ID
-    val updatetime : String? = "",//更新时间
-    val wrstandardcode : String? = "",//现货商品代码
-    val wrstandardid : String? = "",//现货商品ID(SEQ_WRSTANDARD)
-    val wrstandardname : String? = ""//现货商品名称
+//品类列表(仓单标准)
+data class Ermcp3Wrstandard(
+     val areauserid : String? = "",//所属机构
+     val convertfactor : String? = "",//标仓系数
+     val createtime : String? = "",//创建时间
+     val creatorid : String? = "",//创建人
+     val deliverygoodsid : String? = "",//现货品种ID
+     val enumdicname : String? = "",//品类单位名称
+     val isvalid : String? = "",//是否有效 0-无效(停用) 1-有效(正常)
+     val minivalue : String? = "",//最小变动值
+     val minivaluedp : String? = "",//最小变动值小数位
+     val realminivalue : String? = "",//实际最小变动值
+     val realminivaluedp : String? = "",//实际最小变动值小数位
+     val remark : String? = "",//备注
+     val unitid : String? = "",//品类单位ID
+     val updatetime : String? = "",//更新时间
+     val wrstandardcode : String? = "",//品类代码
+     val wrstandardid : String? = "",//品类ID(SEQ_WRSTANDARD)
+     val wrstandardname : String? = ""//品类名称
 ) : Parcelable{
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
     constructor(parcel: Parcel) : this(
         parcel.readString(),
         parcel.readString(),
@@ -191,12 +200,14 @@ data class ErmcpWrstandard(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
         parcel.readString()
     ) {
     ) {
     }
     }
 
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
     override fun writeToParcel(parcel: Parcel, flags: Int) {
         parcel.writeString(areauserid)
         parcel.writeString(areauserid)
+        parcel.writeString(convertfactor)
         parcel.writeString(createtime)
         parcel.writeString(createtime)
         parcel.writeString(creatorid)
         parcel.writeString(creatorid)
         parcel.writeString(deliverygoodsid)
         parcel.writeString(deliverygoodsid)
@@ -218,12 +229,215 @@ data class ErmcpWrstandard(
         return 0
         return 0
     }
     }
 
 
-    companion object CREATOR : Parcelable.Creator<ErmcpWrstandard> {
-        override fun createFromParcel(parcel: Parcel): ErmcpWrstandard {
-            return ErmcpWrstandard(parcel)
+    companion object CREATOR : Parcelable.Creator<Ermcp3Wrstandard> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3Wrstandard {
+            return Ermcp3Wrstandard(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3Wrstandard?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+//套保列表
+data class Ermcp3MiddleGoodsDetail(
+    var isSelect : Int = 0,//套保内的期货品种是否展开
+    val mg : ErmcpMiddleGoodsModel? = ErmcpMiddleGoodsModel(), //
+    val gplist : List<Ermcp3GoodsGroupEx>? = arrayListOf(),
+    val convertratio : String? = ""//套保系数(折算系数)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readInt(),
+        parcel.readParcelable(ErmcpMiddleGoodsModel::class.java.classLoader),
+        parcel.createTypedArrayList(Ermcp3GoodsGroupEx),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeInt(isSelect)
+        parcel.writeParcelable(mg, flags)
+        parcel.writeTypedList(gplist)
+        parcel.writeString(convertratio)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<Ermcp3MiddleGoodsDetail> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3MiddleGoodsDetail {
+            return Ermcp3MiddleGoodsDetail(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3MiddleGoodsDetail?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}
+
+//关联商品组列表
+data class Ermcp3GoodsGroupEx(
+    var isFutureSelect : Int = 0,//期货合约是否展开
+    val convertratio : String? = "",//折算系数(品种系数)
+    val enumdicname : String? = "",//单位名称
+    val exexchangecode : String? = "",//交易所代码
+    val goodsgroupid : String? = "",//商品组id
+    val goodsgroupname : String? = "",//商品组名称
+    val middlegoodsid : String? = "",//套保商品id
+    val glist : List<Ermcp3Goods>? = arrayListOf()//合约列表
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readInt(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createTypedArrayList(Ermcp3Goods)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeInt(isFutureSelect)
+        parcel.writeString(convertratio)
+        parcel.writeString(enumdicname)
+        parcel.writeString(exexchangecode)
+        parcel.writeString(goodsgroupid)
+        parcel.writeString(goodsgroupname)
+        parcel.writeString(middlegoodsid)
+        parcel.writeTypedList(glist)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<Ermcp3GoodsGroupEx> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3GoodsGroupEx {
+            return Ermcp3GoodsGroupEx(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3GoodsGroupEx?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}
+
+//合约列表
+data class Ermcp3Goods(
+    val agreeunit : String? = "",//合约单位(合约乘数)
+    val enumdicname : String? = "",//单位名称
+    val exexchangecode : String? = "",//交易所代码
+    val goodscode : String? = "",//期货商品代码
+    val goodsid : String? = "",//期货商品id
+    val goodsname : String? = ""//期货商品名称
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(agreeunit)
+        parcel.writeString(enumdicname)
+        parcel.writeString(exexchangecode)
+        parcel.writeString(goodscode)
+        parcel.writeString(goodsid)
+        parcel.writeString(goodsname)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<Ermcp3Goods> {
+        override fun createFromParcel(parcel: Parcel): Ermcp3Goods {
+            return Ermcp3Goods(parcel)
+        }
+
+        override fun newArray(size: Int): Array<Ermcp3Goods?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+data class ErmcpMiddleGoodsModel(
+    val areauserid : String? = "",//机构用户ID
+    val createtime : String? = "",//修改时间
+    val enumdicname : String? = "",//单位名称
+    val evaluateratio : String? = "",//估价系数
+    val goodsgroupid : String? = "",//关联期货品种ID
+    val isvalid : String? = "",//状态 0-无效(停用) 1-有效(正常)
+    val middlegoodscode : String? = "",//套保品种代码
+    val middlegoodsid : String? = "",//套保品种ID(SEQ_ERMS_MIDDLEGOODS)
+    val middlegoodsname : String? = "",//套保品种名称
+    val modifytime : String? = "",//修改时间
+    val needhedgeratio : String? = "",//套保比率
+    val qtydecimalplace : String? = "",//数量小数位
+    val relatedgoodsid : String? = "",//关联交易商品ID
+    val relatedgoodstype : String? = "",//关联商品类型 - 1:期货合约 2:现货品种
+    val remark : String? = ""//备注
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(createtime)
+        parcel.writeString(enumdicname)
+        parcel.writeString(evaluateratio)
+        parcel.writeString(goodsgroupid)
+        parcel.writeString(isvalid)
+        parcel.writeString(middlegoodscode)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(modifytime)
+        parcel.writeString(needhedgeratio)
+        parcel.writeString(qtydecimalplace)
+        parcel.writeString(relatedgoodsid)
+        parcel.writeString(relatedgoodstype)
+        parcel.writeString(remark)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpMiddleGoodsModel> {
+        override fun createFromParcel(parcel: Parcel): ErmcpMiddleGoodsModel {
+            return ErmcpMiddleGoodsModel(parcel)
         }
         }
 
 
-        override fun newArray(size: Int): Array<ErmcpWrstandard?> {
+        override fun newArray(size: Int): Array<ErmcpMiddleGoodsModel?> {
             return arrayOfNulls(size)
             return arrayOfNulls(size)
         }
         }
     }
     }

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

@@ -1,6 +1,90 @@
 package cn.muchinfo.rma.global.data
 package cn.muchinfo.rma.global.data
 
 
+import android.os.Parcel
+import android.os.Parcelable
+
 data class MiddleGoodsDetail(
 data class MiddleGoodsDetail(
-    val CvList : List<AvaildGoodsGroupData> = arrayListOf(),
-    val Mg : MiddleGoodsData = MiddleGoodsData()
-)
+    var isAllSelect : Int = 0,//是否全部展开
+    var isFutureTypeSelect : Int = 1,//期货品种是否展开
+    var isSpotTypeSelect : Int = 1,//现货品种是否展开
+    val gplist : List<Ermcp3GoodsGroupEx>? = arrayListOf(),//关联商品组列表 期货
+    val mg : ErmcpMiddleGoodsModel? = ErmcpMiddleGoodsModel(),
+    val dglist : List<ErmcpDeliveryGoodsDetail>? = arrayListOf()//关联的现货品种列表 现货
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readInt(),
+        parcel.readInt(),
+        parcel.readInt(),
+        parcel.createTypedArrayList(Ermcp3GoodsGroupEx),
+        parcel.readParcelable(ErmcpMiddleGoodsModel::class.java.classLoader),
+        parcel.createTypedArrayList(ErmcpDeliveryGoodsDetail)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeInt(isAllSelect)
+        parcel.writeInt(isFutureTypeSelect)
+        parcel.writeInt(isSpotTypeSelect)
+        parcel.writeTypedList(gplist)
+        parcel.writeParcelable(mg, flags)
+        parcel.writeTypedList(dglist)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<MiddleGoodsDetail> {
+        override fun createFromParcel(parcel: Parcel): MiddleGoodsDetail {
+            return MiddleGoodsDetail(parcel)
+        }
+
+        override fun newArray(size: Int): Array<MiddleGoodsDetail?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+//关联的现货品种列表
+data class ErmcpDeliveryGoodsDetail(
+    val data : ErmcpDeliveryGoods? = ErmcpDeliveryGoods(),
+    val gblist : List<Ermcp3Brand>? = arrayListOf(),
+    var isSpotSelect : Int = 0,//品类是否展开
+    val convertratio : String? = "",//套保系数(折算系数)
+    val gmlist : List<Ermcp3Wrstandard>? = arrayListOf()
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readParcelable(ErmcpDeliveryGoods::class.java.classLoader),
+        parcel.createTypedArrayList(Ermcp3Brand),
+        parcel.readInt(),
+        parcel.readString(),
+        parcel.createTypedArrayList(Ermcp3Wrstandard)
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeParcelable(data, flags)
+        parcel.writeTypedList(gblist)
+        parcel.writeInt(isSpotSelect)
+        parcel.writeString(convertratio)
+        parcel.writeTypedList(gmlist)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ErmcpDeliveryGoodsDetail> {
+        override fun createFromParcel(parcel: Parcel): ErmcpDeliveryGoodsDetail {
+            return ErmcpDeliveryGoodsDetail(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ErmcpDeliveryGoodsDetail?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}
+
+

+ 7 - 7
RMA/app/src/main/java/cn/muchinfo/rma/global/data/UserAccountData.kt

@@ -8,26 +8,26 @@ data class UserAccountData(
     val accountstatus : Int = 0,//账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销
     val accountstatus : Int = 0,//账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销
     val auditremark : String = "",//审核备注
     val auditremark : String = "",//审核备注
     val audittime : String = "",//审核时间
     val audittime : String = "",//审核时间
-    val audituserid : Int = 0,//审核人
+    val audituserid : Long = 0,//审核人
     val broker : Int = 0,//所属经纪人ID
     val broker : Int = 0,//所属经纪人ID
     val canceltime : String = "",//销户时间
     val canceltime : String = "",//销户时间
     val canceluserid : Int = 0,//销户人
     val canceluserid : Int = 0,//销户人
     val createtime : String = "",//创建时间
     val createtime : String = "",//创建时间
-    val creatorid : Int = 0,//创建人
+    val creatorid : Long = 0,//创建人
     val hasauth : Int = 0,//是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
     val hasauth : Int = 0,//是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
     val isanonymous : Int = 0,//是否匿名下单 - 0:否 1:是
     val isanonymous : Int = 0,//是否匿名下单 - 0:否 1:是
     val maxinvestornum : Int = 0,//最大用户数(经纪会员下投资者个数)
     val maxinvestornum : Int = 0,//最大用户数(经纪会员下投资者个数)
-    val memberuserid : Int = 0,//所属会员ID
-    val modifierid : Int = 0,//修改人
+    val memberuserid : Long = 0,//所属会员ID
+    val modifierid : Long = 0,//修改人
     val modifyremark : String = "",//变更备注
     val modifyremark : String = "",//变更备注
     val modifystatus : Int = 0,//变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)
     val modifystatus : Int = 0,//变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)
     val modifytime : String = "",//修改时间
     val modifytime : String = "",//修改时间
-    val parentuserid : Int = 0,//所属机构ID
+    val parentuserid : Long = 0,//所属机构ID
     val reckonaccountid : Int = 0,//默认结算资金账号ID(机构分润使用) 作废
     val reckonaccountid : Int = 0,//默认结算资金账号ID(机构分润使用) 作废
     val refercount : Int = 0,//推荐总人数
     val refercount : Int = 0,//推荐总人数
-    val refereeuserid : Int = 0,//推荐人ID
+    val refereeuserid : Long = 0,//推荐人ID
     val refernum : String = "",//推荐码
     val refernum : String = "",//推荐码
     val subarealevelpath : String = "",//子机构层级路径(逗号分隔,首尾加逗号)
     val subarealevelpath : String = "",//子机构层级路径(逗号分隔,首尾加逗号)
-    val userid : Int = 0,//用户ID
+    val userid : Long = 0,//用户ID
     val usertype : Int = 0//账户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户
     val usertype : Int = 0//账户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户
 )
 )

+ 120 - 83
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddHedgeGoodsActivity.kt

@@ -8,9 +8,7 @@ import android.widget.EditText
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.AvaildGoodsGroupData
-import cn.muchinfo.rma.global.data.GGConvertConfigData
-import cn.muchinfo.rma.global.data.MiddleGoodsData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
@@ -38,8 +36,8 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
         intent.getStringExtra("type")
         intent.getStringExtra("type")
     }
     }
 
 
-    val data: MiddleGoodsData by lazy {
-        intent.getParcelableExtra<MiddleGoodsData>("data") as MiddleGoodsData
+    val data: MiddleGoodsDetail by lazy {
+        intent.getParcelableExtra<MiddleGoodsDetail>("data") as MiddleGoodsDetail
     }
     }
 
 
     /** 备注 **/
     /** 备注 **/
@@ -55,15 +53,16 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
     /**
     /**
      * 选择的套保品种
      * 选择的套保品种
      */
      */
-    val selectAvalidGoodsData: MutableLiveData<AvaildGoodsGroupData> = MutableLiveData()
+    val selectAvalidGoodsData: MutableLiveData<ErmcpMiddleGoodsModel> = MutableLiveData()
 
 
     val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
     val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
 
 
     //用于修改,停用,恢复,详情的初始化数据
     //用于修改,停用,恢复,详情的初始化数据
     fun init() {
     fun init() {
         if (type == "2" || type == "3" || type == "5") {
         if (type == "2" || type == "3" || type == "5") {
-            viewModel.queryMiddleGoodsDetail(data.middlegoodsid ?: "") {
-                selectAvalidGoodsData.postValue(this)
+            selectAvalidGoodsData.postValue(data.mg ?: ErmcpMiddleGoodsModel())
+            viewModel.queryMiddleGoodsDetail(data.mg?.middlegoodsid ?: "") {
+//                selectAvalidGoodsData.postValue(this)
                 viewModel.queryGGConvertConfig(this.srcgoodsgroupid ?: "")
                 viewModel.queryGGConvertConfig(this.srcgoodsgroupid ?: "")
             }
             }
         }
         }
@@ -105,22 +104,24 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             background = resources.getDrawable(R.color.white)
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             gravity = Gravity.CENTER_VERTICAL
                             onThrottleFirstClick {
                             onThrottleFirstClick {
-                                if (type == "2" || type == "3" || type == "5") {
-                                    return@onThrottleFirstClick
-                                }
-                                if (viewModel.avalidGoodsList.value.isNullOrEmpty()) {
-                                    ToastUtils.showLong("套保品种请求失败")
-                                    return@onThrottleFirstClick
-                                }
-                                creatHedgeBottomSheetDialog(
-                                    "请选择套保品种名称",
-                                    viewModel.avalidGoodsList.value ?: arrayListOf()
-                                ) {
-                                    selectAvalidGoodsData.postValue(this)
-                                    viewModel.queryGGConvertConfig(this.goodsgroupid ?: "")
-                                }
+                                // FIXME 三期内容不能选择
+//                                if (type == "2" || type == "3" || type == "5") {
+//                                    return@onThrottleFirstClick
+//                                }
+//                                if (viewModel.avalidGoodsList.value.isNullOrEmpty()) {
+//                                    ToastUtils.showLong("套保品种请求失败")
+//                                    return@onThrottleFirstClick
+//                                }
+//                                creatHedgeBottomSheetDialog(
+//                                    "请选择套保品种名称",
+//                                    viewModel.avalidGoodsList.value ?: arrayListOf()
+//                                ) {
+//                                    selectAvalidGoodsData.postValue(this)
+//                                    viewModel.queryGGConvertConfig(this.goodsgroupid ?: "")
+//                                }
                             }
                             }
                             textView {
                             textView {
+                                visibility = View.INVISIBLE
                                 text = "*"
                                 text = "*"
                                 textColorInt = R.color.rma_star_color
                                 textColorInt = R.color.rma_star_color
                                 textSizeAuto = 31
                                 textSizeAuto = 31
@@ -137,17 +138,18 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
 
 
                             textView {
                             textView {
-                                selectAvalidGoodsData.bindOptional(context) {
-                                    if (type == "2" || type == "3" || type == "5") {
-                                        text = data.middlegoodsname
-                                    }else{
-                                        text = it?.goodsgroupname
-                                    }
-
-                                }
-                                text = "请选择套保品种名称"
+                                text = data.mg?.middlegoodsname
+//                                selectAvalidGoodsData.bindOptional(context) {
+//                                    if (type == "2" || type == "3" || type == "5") {
+//                                        text = data.mg?.middlegoodsname
+//                                    }else{
+//                                        text = it?.goodsgroupname
+//                                    }
+//
+//                                }
+//                                text = "请选择套保品种名称"
                                 textSizeAuto = 31
                                 textSizeAuto = 31
-                                textColorInt = R.color.rma_hint_text_color_ccc
+                                textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
                             }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(30)
                                 marginStart = autoSize(30)
                             }
                             }
@@ -155,18 +157,20 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             emptyView()
                             emptyView()
 
 
                             imageView {
                             imageView {
-                                if (type == "2" || type == "3" || type == "5") {
-                                    visibility = View.GONE
-                                }
+                                visibility = View.GONE
+//                                if (type == "2" || type == "3" || type == "5") {
+//                                    visibility = View.GONE
+//                                }
                                 imageResource = R.mipmap.rma_more
                                 imageResource = R.mipmap.rma_more
                             }.lparams(autoSize(36), autoSize(36)) {
                             }.lparams(autoSize(36), autoSize(36)) {
                                 marginEnd = autoSize(25)
                                 marginEnd = autoSize(25)
                             }
                             }
                         }.lparams(matchParent, autoSize(132))
                         }.lparams(matchParent, autoSize(132))
 
 
-                        viewItemUI()
+//                        viewItemUI()
 
 
                         linearLayout {
                         linearLayout {
+                            visibility = View.GONE
                             background = resources.getDrawable(R.color.white)
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             gravity = Gravity.CENTER_VERTICAL
 
 
@@ -179,15 +183,16 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
 
 
                             textView {
                             textView {
-                                selectAvalidGoodsData.bindOptional(context) {
-                                    if (type == "2" || type == "3" || type == "5") {
-                                        text = data.middlegoodscode
-                                    }else{
-                                        text = it?.outergroupcode
-                                    }
-
-                                }
-                                text = "请选择套保品种自动填入"
+                                text = data.mg?.middlegoodscode
+//                                selectAvalidGoodsData.bindOptional(context) {
+//                                    if (type == "2" || type == "3" || type == "5") {
+//                                        text = data.mg?.middlegoodscode
+//                                    }else{
+//                                        text = it?.outergroupcode
+//                                    }
+//
+//                                }
+//                                text = "请选择套保品种自动填入"
                                 textSizeAuto = 31
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_hint_text_color_ccc
                                 textColorInt = R.color.rma_hint_text_color_ccc
                             }.lparams(wrapContent, wrapContent) {
                             }.lparams(wrapContent, wrapContent) {
@@ -213,12 +218,13 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
 
 
                             textView {
                             textView {
-                                viewModel.ggConvertConfigDataList.bindOptional(context) {
-                                    text = it?.get(0)?.dstunitidname
-                                }
-                                text = "请选择套保品种自动填入"
+                                text = data.mg?.enumdicname
+//                                viewModel.ggConvertConfigDataList.bindOptional(context) {
+//                                    text = it?.get(0)?.dstunitidname
+//                                }
+//                                text = "请选择套保品种自动填入"
                                 textSizeAuto = 31
                                 textSizeAuto = 31
-                                textColorInt = R.color.rma_hint_text_color_ccc
+                                textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
                             }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(140)
                                 marginStart = autoSize(140)
                             }
                             }
@@ -232,6 +238,36 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                         linearLayout {
                         linearLayout {
                             background = resources.getDrawable(R.color.white)
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             gravity = Gravity.CENTER_VERTICAL
+
+                            textView {
+                                text = "当前套保比例"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                setText(NumberUtils.doubleDistortion(data.mg?.needhedgeratio?.toDouble()?.times(100).toString()))
+//                                viewModel.ggConvertConfigDataList.bindOptional(context) {
+//                                    text = it?.get(0)?.dstunitidname
+//                                }
+//                                text = "请选择套保品种自动填入"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent) {
+                                marginStart = autoSize(30)
+                            }
+
+                            emptyView()
+
+                        }.lparams(matchParent, autoSize(132))
+
+                        viewItemUI()
+
+                        linearLayout {
+                            background = resources.getDrawable(R.color.white)
+                            gravity = Gravity.CENTER_VERTICAL
                             textView {
                             textView {
                                 text = "*"
                                 text = "*"
                                 textColorInt = R.color.rma_star_color
                                 textColorInt = R.color.rma_star_color
@@ -241,7 +277,7 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
 
 
                             textView {
                             textView {
-                                text = "套保比例"
+                                text = "修改后套保比例"
                                 textSizeAuto = 31
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_black_33
                                 textColorInt = R.color.rma_black_33
                             }.lparams(wrapContent, wrapContent) {
                             }.lparams(wrapContent, wrapContent) {
@@ -249,12 +285,12 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
 
 
                             editText {
                             editText {
-                                if ( type == "2" || type == "3" || type == "5") {
-                                    setText(NumberUtils.doubleDistortion(data.needhedgeratio?.toDouble()?.times(100).toString()))
-                                }
+//                                if ( type == "2" || type == "3" || type == "5") {
+//                                    setText(NumberUtils.doubleDistortion(data.mg?.needhedgeratio?.toDouble()?.times(100).toString()))
+//                                }
                                 hedge_ratio_edtittext = this
                                 hedge_ratio_edtittext = this
 
 
-                                hint = "请输入套保比例"
+                                hint = "请输入修改后套保比例"
                                 background = null
                                 background = null
                                 inputType = EditorInfo.TYPE_CLASS_NUMBER
                                 inputType = EditorInfo.TYPE_CLASS_NUMBER
                                 setDecimalInputType()
                                 setDecimalInputType()
@@ -262,7 +298,7 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                 textSizeAuto = 31
                                 textSizeAuto = 31
                                 textColorStr = "#333333"
                                 textColorStr = "#333333"
                             }.lparams(0, autoSize(132),1f) {
                             }.lparams(0, autoSize(132),1f) {
-                                marginStart = autoSize(80)
+                                marginStart = autoSize(30)
                             }
                             }
 
 
                             textView {
                             textView {
@@ -328,27 +364,28 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
                             val data1 = selectAvalidGoodsData.value
                             val data1 = selectAvalidGoodsData.value
                             if (type == "1") {
                             if (type == "1") {
-                                viewModel.requestErmsMiddelGoodsReq(
-                                    middlegoodsname = data1?.goodsgroupname ?: "",
-                                    middlegoodscode = data1?.outergroupcode ?: "",
-                                    goodsunitid = data1?.goodunitid?.toInt() ?: 0,
-                                    goodsgroupid = data1?.goodsgroupid?.toLong() ?: 0,
-                                    remark = remask_edittext.text.toString(),
-                                    areauserid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
-                                        ?: 0,
-                                    creatorid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
-                                        ?: 0,
-                                    needhedgeratio = hedge_ratio_edtittext.text.toString()
-                                        .toDouble().div(100)
-                                ) {
-                                    finish()
-                                }
+                                // FIXME 三期需求没有新增
+//                                viewModel.requestErmsMiddelGoodsReq(
+//                                    middlegoodsname = data1?.goodsgroupname ?: "",
+//                                    middlegoodscode = data1?.outergroupcode ?: "",
+//                                    goodsunitid = data1?.goodunitid?.toInt() ?: 0,
+//                                    goodsgroupid = data1?.goodsgroupid?.toLong() ?: 0,
+//                                    remark = remask_edittext.text.toString(),
+//                                    areauserid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
+//                                        ?: 0,
+//                                    creatorid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
+//                                        ?: 0,
+//                                    needhedgeratio = hedge_ratio_edtittext.text.toString()
+//                                        .toDouble().div(100)
+//                                ) {
+//                                    finish()
+//                                }
                             } else if (type == "2") {
                             } else if (type == "2") {
                                 viewModel.requestErmsMiddelGoodsEditReq(
                                 viewModel.requestErmsMiddelGoodsEditReq(
-                                    middlegoodsid = data.middlegoodsid?.toLong() ?: 0,
+                                    middlegoodsid = data.mg?.middlegoodsid?.toLong() ?: 0,
                                     needhedgeratio = hedge_ratio_edtittext.text.toString()
                                     needhedgeratio = hedge_ratio_edtittext.text.toString()
                                         .toDouble().div(100),
                                         .toDouble().div(100),
-                                    goodsgroupid = data.goodsgroupid?.toLong() ?: 0,
+                                    goodsgroupid = data.mg?.goodsgroupid?.toLong() ?: 0,
                                     modifierid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
                                     modifierid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
                                         ?: 0,
                                         ?: 0,
                                     areauserid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
                                     areauserid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong()
@@ -357,7 +394,7 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                 ) {
                                 ) {
                                     finish()
                                     finish()
                                 }
                                 }
-                            } else if (type == "3") {
+                            } /*else if (type == "3") {
                                 viewModel.requestErmsMiddelGoodsStopReq(
                                 viewModel.requestErmsMiddelGoodsStopReq(
                                     middlegoodsid = data.middlegoodsid?.toLong() ?: 0, isvalid = 0
                                     middlegoodsid = data.middlegoodsid?.toLong() ?: 0, isvalid = 0
                                 ) {
                                 ) {
@@ -369,7 +406,7 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                 ) {
                                 ) {
                                     finish()
                                     finish()
                                 }
                                 }
-                            }
+                            }*/
 
 
                         }
                         }
                         gravity = Gravity.CENTER
                         gravity = Gravity.CENTER
@@ -378,11 +415,11 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             text = "完成"
                             text = "完成"
                         } else if (type == "2") {
                         } else if (type == "2") {
                             text = "修改"
                             text = "修改"
-                        } else if (type == "3") {
+                        }/* else if (type == "3") {
                             text = "停用"
                             text = "停用"
                         } else if (type == "5") {
                         } else if (type == "5") {
                             text = "恢复"
                             text = "恢复"
-                        }
+                        }*/
                         textColorInt = R.color.white
                         textColorInt = R.color.white
                         textSizeAuto = 38
                         textSizeAuto = 38
                     }.lparams(matchParent, autoSize(119)) {
                     }.lparams(matchParent, autoSize(119)) {
@@ -398,12 +435,12 @@ class AddHedgeGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
 
 
 
     private fun checkUpdate(): Boolean {
     private fun checkUpdate(): Boolean {
-        if ((type == "2" || type == "3" || type == "5").not()){
-            if (selectAvalidGoodsData.value?.goodsgroupname.isNullOrEmpty()) {
-                ToastUtils.showLong("请选择套保品种")
-                return false
-            }
-        }
+//        if ((type == "2" || type == "3" || type == "5").not()){
+//            if (selectAvalidGoodsData.value?.goodsgroupname.isNullOrEmpty()) {
+//                ToastUtils.showLong("请选择套保品种")
+//                return false
+//            }
+//        }
 
 
 
 
         if (hedge_ratio_edtittext.text.toString().isNullOrEmpty()) {
         if (hedge_ratio_edtittext.text.toString().isNullOrEmpty()) {

+ 19 - 18
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddSpotGoodsActivity.kt

@@ -9,6 +9,7 @@ import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.MTPEnums
 import cn.muchinfo.rma.global.MTPEnums
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.data.ContractData
+import cn.muchinfo.rma.global.data.DeliveryGoodsDetailData
 import cn.muchinfo.rma.global.data.MiddleGoodsData
 import cn.muchinfo.rma.global.data.MiddleGoodsData
 import cn.muchinfo.rma.global.data.WrStandardData
 import cn.muchinfo.rma.global.data.WrStandardData
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
@@ -60,8 +61,8 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
     /**
     /**
      * 用作修改,停用,恢复时的数据
      * 用作修改,停用,恢复时的数据
      */
      */
-    val data: WrStandardData by lazy {
-        intent.getParcelableExtra<WrStandardData>("data") as WrStandardData
+    val data: DeliveryGoodsDetailData by lazy {
+        intent.getParcelableExtra<DeliveryGoodsDetailData>("data") as DeliveryGoodsDetailData
     }
     }
 
 
     //型号适配/////第三期修改为品类
     //型号适配/////第三期修改为品类
@@ -100,7 +101,14 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
             viewModel.queryGoodsGroup()
             viewModel.queryGoodsGroup()
         } else {
         } else {
             viewModel.queryGoodsGroup()
             viewModel.queryGoodsGroup()
-            viewModel.queryWrStandardDetails(data.deliverygoodsid ?: "")
+            viewModel.initSpotGoodsActivity(data)
+            selectUnitType.postValue(
+                SelectData(
+                    id = data.data?.goodsunitid ?: "",
+                    value = data?.data?.enumdicname ?: ""
+                )
+            )
+//            viewModel.queryWrStandardDetails(data.data?.deliverygoodsid ?: "")
         }
         }
     }
     }
 
 
@@ -153,7 +161,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             editText {
                             editText {
                                 if (type == "2" ||  type == "4" || type == "3" || type == "5"){
                                 if (type == "2" ||  type == "4" || type == "3" || type == "5"){
                                     isEnabled = false
                                     isEnabled = false
-                                    setText(data.wrstandardname)
+                                    setText(data.data?.deliverygoodsname)
                                 }else{
                                 }else{
                                     isEnabled = true
                                     isEnabled = true
                                 }
                                 }
@@ -188,7 +196,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             editText {
                             editText {
                                 if (type == "2" || type == "4" || type == "3" || type == "5"){
                                 if (type == "2" || type == "4" || type == "3" || type == "5"){
                                     isEnabled = false
                                     isEnabled = false
-                                    setText(data.wrstandardcode)
+                                    setText(data.data?.deliverygoodscode)
                                 }else{
                                 }else{
                                     isEnabled = true
                                     isEnabled = true
                                 }
                                 }
@@ -210,14 +218,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                         linearLayout {
                         linearLayout {
                             background = resources.getDrawable(R.color.white)
                             background = resources.getDrawable(R.color.white)
                             gravity = Gravity.CENTER_VERTICAL
                             gravity = Gravity.CENTER_VERTICAL
-                            viewModel.wrStandardDetails.bindOptional(context) { data ->
-                                selectUnitType.postValue(
-                                    SelectData(
-                                        id = data?.wrd?.unitid ?: "",
-                                        value = data?.wrd?.enumdicname ?: ""
-                                    )
-                                )
-                            }
+
                             onThrottleFirstClick {
                             onThrottleFirstClick {
                                 //对于修改,停用,复用的操作不能选择
                                 //对于修改,停用,复用的操作不能选择
                                 if (type == "4" || type == "3" || type == "5"){
                                 if (type == "4" || type == "3" || type == "5"){
@@ -271,7 +272,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             textView {
                             textView {
                                 selectUnitType.bindOptional(context) {
                                 selectUnitType.bindOptional(context) {
                                     if (it?.value.isNullOrEmpty()){
                                     if (it?.value.isNullOrEmpty()){
-                                        text = data.enumdicname
+                                        text = data.data?.enumdicname
                                         textColorInt = R.color.rma_black_33
                                         textColorInt = R.color.rma_black_33
                                     }else{
                                     }else{
                                         text = it?.value
                                         text = it?.value
@@ -295,7 +296,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                             }
                             }
                         }.lparams(matchParent, autoSize(132))
                         }.lparams(matchParent, autoSize(132))
 
 
-                        baseInformationView("型号品牌信息")
+                        baseInformationView("品类信息")
 
 
                         //添加型号信息
                         //添加型号信息
                         recyclerView {
                         recyclerView {
@@ -486,7 +487,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                     deliverygoodscode = spot_variety_code_edittext.text.toString(),
                                     deliverygoodscode = spot_variety_code_edittext.text.toString(),
                                     deliverygoodsname = spot_variety_name_edittext.text.toString(),
                                     deliverygoodsname = spot_variety_name_edittext.text.toString(),
                                     unitid = selectUnitType.value?.id?.toLong()!!,
                                     unitid = selectUnitType.value?.id?.toLong()!!,
-                                    wrstandardid = data.wrstandardid?.toLong() ?: 0,
+                                    wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,
                                     type = 2,
                                     type = 2,
                                     remark = remask_edittext.text.toString(),
                                     remark = remask_edittext.text.toString(),
                                     spotgoodsmodels = getSpotModelList(isAdd = false),
                                     spotgoodsmodels = getSpotModelList(isAdd = false),
@@ -496,11 +497,11 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                     finish()
                                     finish()
                                 }
                                 }
                             }else if (type == "3"){//停用
                             }else if (type == "3"){//停用
-                                viewModel.requestGoodsCancelReq(wrstandardid = data.wrstandardid?.toLong() ?: 0,isvalid = 0){
+                                viewModel.requestGoodsCancelReq(wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,isvalid = 0){
                                     finish()
                                     finish()
                                 }
                                 }
                             }else if (type == "5"){//恢复
                             }else if (type == "5"){//恢复
-                                viewModel.requestGoodsCancelReq(wrstandardid = data.wrstandardid?.toLong() ?: 0,isvalid = 1){
+                                viewModel.requestGoodsCancelReq(wrstandardid = data.data?.deliverygoodsid?.toLong() ?: 0,isvalid = 1){
                                     finish()
                                     finish()
                                 }
                                 }
                             }
                             }

+ 33 - 26
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/CommodityInformationViewModel.kt

@@ -137,14 +137,14 @@ class CommodityInformationViewModel : BaseViewModel() {
         select: (AvaildGoodsGroupData.() -> Unit)? = null
         select: (AvaildGoodsGroupData.() -> Unit)? = null
     ) {
     ) {
         val params = mutableMapOf<String, String>().apply {
         val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("middlegoodsid", middlegoodsid)
             put("middlegoodsid", middlegoodsid)
         }
         }
         MyApplication.getInstance()?.commodityManager?.queryMiddleGoodsDetail(params = params) { isSuccess, respData, error ->
         MyApplication.getInstance()?.commodityManager?.queryMiddleGoodsDetail(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
             if (isSuccess) {
-                if (respData?.get(0)?.CvList?.size ?: 0 > 0) {
-                    select?.invoke(respData?.get(0)?.CvList?.get(0) ?: AvaildGoodsGroupData())
-                }
+//                if (respData?.get(0)?.CvList?.size ?: 0 > 0) {
+//                    select?.invoke(respData?.get(0)?.CvList?.get(0) ?: AvaildGoodsGroupData())
+//                }
             }
             }
         }
         }
 
 
@@ -163,7 +163,7 @@ class CommodityInformationViewModel : BaseViewModel() {
         }
         }
         MyApplication.getInstance()?.commodityManager?.queryMiddleGoodsDetail(params = params) { isSuccess, respData, error ->
         MyApplication.getInstance()?.commodityManager?.queryMiddleGoodsDetail(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
             if (isSuccess) {
-                select?.invoke(respData?.get(0)?.CvList ?: arrayListOf())
+//                select?.invoke(respData?.get(0)?.CvList ?: arrayListOf())
             }
             }
         }
         }
 
 
@@ -608,7 +608,7 @@ class CommodityInformationViewModel : BaseViewModel() {
     fun queryWrStandardDetails(deliverygoodsid: String) {
     fun queryWrStandardDetails(deliverygoodsid: String) {
         val params = mutableMapOf<String, String>().apply {
         val params = mutableMapOf<String, String>().apply {
             put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-//            put("deliverygoodsid", deliverygoodsid)
+            put("deliverygoodsid", deliverygoodsid)
         }
         }
         MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
         MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
             if (isSuccess) {
             if (isSuccess) {
@@ -621,39 +621,46 @@ class CommodityInformationViewModel : BaseViewModel() {
     /**
     /**
      * 用来在现货品种信息的修改,恢复,停用,详情时的页面数据回填
      * 用来在现货品种信息的修改,恢复,停用,详情时的页面数据回填
      */
      */
-    fun initSpotGoodsActivity(respData: WrStandardDetail) {
-        val newbrandModelList = arrayListOf<SpotInfoData>()
-        val newspotModelList = arrayListOf<SpotInfoData>()
-        val newmiddlegoodList = arrayListOf<SpotInfoData>()
-        respData.gbList.forEach {
-            newbrandModelList.add(
+    fun initSpotGoodsActivity(respData: DeliveryGoodsDetailData) {
+        val newbrandModelList = arrayListOf<SpotInfoData>()//品牌列表
+        val newspotModelList = arrayListOf<SpotInfoData>()//品类列表
+        val newmiddlegoodList = arrayListOf<SpotInfoData>()//套保品种
+        respData.gmlist?.forEach {//品类列表
+            newspotModelList.add(
                 SpotInfoData(
                 SpotInfoData(
-                    id = respData.gbList.indexOf(it).plus(1).toString(),
-                    value = it.brandname,
-                    middleGoodsId = it.brandid
+                    id = respData.gmlist.indexOf(it).plus(1).toString(),
+                    value = it.wrstandardname ?: "",
+                    enumdicname = it.enumdicname ?: "",
+                    enumdicnameid = it.unitid ?: "",
+                    coefficientwarehouse = it.convertfactor ?: "",
+                    middleGoodsId = it.wrstandardid ?: ""
                 )
                 )
             )
             )
         }
         }
-        respData.gtList.forEach {
-            newspotModelList.add(
+        respData.gblist?.forEach {//品牌列表
+            newbrandModelList.add(
                 SpotInfoData(
                 SpotInfoData(
-                    id = respData.gtList.indexOf(it).plus(1).toString(),
-                    value = it.modelname,
-                    middleGoodsId = it.modelid
+                    id = respData.gblist.indexOf(it).plus(1).toString(),
+                    value = it.brandname ?: "",
+                    middleGoodsId = it.brandid ?: ""
                 )
                 )
             )
             )
         }
         }
-        respData.wrsList.forEach {
+        respData.mgList?.forEach {//套保品种
             newmiddlegoodList.add(
             newmiddlegoodList.add(
                 SpotInfoData(
                 SpotInfoData(
-                    id = respData.wrsList.indexOf(it).plus(1).toString(),
-                    value = it.convertratio,
-                    middleGoodsId = it.middlegoodsid,
-                    middleGoodsName = it.middlegoodsname,
-                    enumdicname = ""
+                    id = respData.mgList.indexOf(it).plus(1).toString(),
+                    value = it.convertratio ?: "",
+                    enumdicnameid = it.mg?.middlegoodscode ?: "",
+                    middleGoodsId = it.mg?.middlegoodsid ?: "",
+                    middleGoodsName = it.mg?.middlegoodsname ?: "",
+                    enumdicname = it.mg?.enumdicname ?: ""
                 )
                 )
             )
             )
         }
         }
+        spotModelcacheList.postValue(newspotModelList)
+        brandModelcacheList.postValue(newbrandModelList)
+        middlegoodCacheList.postValue(newmiddlegoodList)
         brandModelList.postValue(newbrandModelList)
         brandModelList.postValue(newbrandModelList)
         spotModelList.postValue(newspotModelList)
         spotModelList.postValue(newspotModelList)
         middlegoodList.postValue(newmiddlegoodList)
         middlegoodList.postValue(newmiddlegoodList)

+ 7 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/BrandViewHolder.kt

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 import android.view.Gravity
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Brand
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -10,15 +12,18 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
 
 
-class BrandViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<String>(activity){
+class BrandViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<Ermcp3Brand>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
         linearLayout {
         linearLayout {
             backgroundResource = R.drawable.rma_list_item_bg
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             gravity = Gravity.CENTER_VERTICAL
+            //品牌名称
             textView {
             textView {
-                text = "江铜"
+                data.bindOptional(context){
+                    text = it?.brandname
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){

+ 115 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/DemoViewHolder.kt

@@ -1,15 +1,19 @@
 package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 
 
+import android.content.Intent
 import android.view.Gravity
 import android.view.Gravity
 import android.view.View
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
-import cn.muchinfo.rma.global.data.MiddleGoodsData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.utils.VIewUtils
 import cn.muchinfo.rma.global.utils.VIewUtils
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.commodity.AddHedgeGoodsActivity
+import cn.muchinfo.rma.view.base.home.commodity.AddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.commodity.CommodityMiddleViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.CommodityMiddleViewHolder
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
@@ -17,20 +21,20 @@ import org.jetbrains.anko.*
 class DemoViewHolder(
 class DemoViewHolder(
     private val activity: AppCompatActivity,
     private val activity: AppCompatActivity,
     private val viewModel: NewCommodityInformationViewModel
     private val viewModel: NewCommodityInformationViewModel
-) : BaseViewHolder<DemoData>(activity) {
+) : BaseViewHolder<DeliveryGoodsDetailData>(activity) {
 
 
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     //品类adapter
     //品类adapter
-    private val spotCategoryAdapter: BaseAdapter<String, SpotCategoryViewHolder> =
+    private val spotCategoryAdapter: BaseAdapter<Ermcp3Wrstandard, SpotCategoryViewHolder> =
         BaseAdapter { _, _ -> SpotCategoryViewHolder(activity, viewModel) }
         BaseAdapter { _, _ -> SpotCategoryViewHolder(activity, viewModel) }
 
 
     //品牌adapter
     //品牌adapter
-    private val brandAdapter: BaseAdapter<String, BrandViewHolder> =
+    private val brandAdapter: BaseAdapter<Ermcp3Brand, BrandViewHolder> =
         BaseAdapter { _, _ -> BrandViewHolder(activity, viewModel) }
         BaseAdapter { _, _ -> BrandViewHolder(activity, viewModel) }
 
 
     //套保品种adapter
     //套保品种adapter
-    private val hedgeAdapter: BaseAdapter<HedgeDetails, SpotHedgeViewHolder> =
+    private val hedgeAdapter: BaseAdapter<Ermcp3MiddleGoodsDetail, SpotHedgeViewHolder> =
         BaseAdapter { _, _ -> SpotHedgeViewHolder(activity, viewModel, dataIndex) }
         BaseAdapter { _, _ -> SpotHedgeViewHolder(activity, viewModel, dataIndex) }
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -48,7 +52,9 @@ class DemoViewHolder(
                 }
                 }
 
 
                 textView {
                 textView {
-                    text = "铜杆(吨)"
+                    data.bindOptional(context){
+                        text = it?.data?.deliverygoodsname + "(" + it?.data?.enumdicname + ")"
+                    }
                     textSizeAuto = 36
                     textSizeAuto = 36
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -56,12 +62,110 @@ class DemoViewHolder(
                 }
                 }
 
 
                 textView {
                 textView {
-                    text = "正常"
+                    data.bindOptional(context){
+                        if (it?.data?.isvalid == "1"){
+                            text = "正常"
+                            textColorInt = R.color.rma_green_color
+                        }else {
+                            text = "停用"
+                            textColorInt = R.color.rma_blue_color
+                        }
+                    }
                     textSizeAuto = 36
                     textSizeAuto = 36
-                    textColorInt = R.color.rma_green_color
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(20)
                     marginStart = autoSize(20)
                 }
                 }
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddSpotGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    data.bindOptional(context){
+                        if (it?.data?.isvalid == "1"){
+                             visibility = View.VISIBLE
+                        }else {
+                            visibility = View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "修改"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","5")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddSpotGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    data.bindOptional(context){
+                        if (it?.data?.isvalid == "0"){
+                            visibility = View.VISIBLE
+                        }else {
+                            visibility = View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "恢复"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","3")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddSpotGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    data.bindOptional(context){
+                        if (it?.data?.isvalid == "1"){
+                            visibility = View.VISIBLE
+                        }else {
+                            visibility = View.GONE
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "停用"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","4")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddSpotGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "详情"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
             }.lparams(matchParent, autoSize(84))
             }.lparams(matchParent, autoSize(84))
 
 
             verticalLayout {
             verticalLayout {
@@ -128,7 +232,7 @@ class DemoViewHolder(
                 }.lparams(matchParent, wrapContent)
                 }.lparams(matchParent, wrapContent)
 
 
                 data.bindOptional(context) {
                 data.bindOptional(context) {
-                    spotCategoryAdapter.setNewData(it?.categoryList)
+                    spotCategoryAdapter.setNewData(it?.gmlist)
                 }
                 }
 
 
                 linearLayout {
                 linearLayout {
@@ -165,7 +269,7 @@ class DemoViewHolder(
                 }.lparams(matchParent, wrapContent)
                 }.lparams(matchParent, wrapContent)
 
 
                 data.bindOptional(context) {
                 data.bindOptional(context) {
-                    brandAdapter.setNewData(it?.brandList)
+                    brandAdapter.setNewData(it?.gblist)
                 }
                 }
 
 
                 linearLayout {
                 linearLayout {
@@ -223,7 +327,7 @@ class DemoViewHolder(
                     adapter = hedgeAdapter
                     adapter = hedgeAdapter
                 }.lparams(matchParent, wrapContent)
                 }.lparams(matchParent, wrapContent)
                 data.bindOptional(context) {
                 data.bindOptional(context) {
-                    hedgeAdapter.setNewData(it?.hedgeList)
+                    hedgeAdapter.setNewData(it?.mgList)
                 }
                 }
 
 
             }.lparams(matchParent, wrapContent)
             }.lparams(matchParent, wrapContent)

+ 163 - 51
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationActivity.kt

@@ -2,13 +2,17 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 
 
 import android.content.Intent
 import android.content.Intent
 import android.os.Bundle
 import android.os.Bundle
+import android.view.Gravity
 import android.view.View
 import android.view.View
 import android.view.ViewGroup
 import android.view.ViewGroup
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
+import androidx.lifecycle.MutableLiveData
 import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.PagerAdapter
 import androidx.viewpager.widget.ViewPager
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.DeliveryGoodsDetailData
 import cn.muchinfo.rma.global.data.MiddleGoodsData
 import cn.muchinfo.rma.global.data.MiddleGoodsData
+import cn.muchinfo.rma.global.data.MiddleGoodsDetail
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -17,17 +21,16 @@ import cn.muchinfo.rma.view.base.home.commodity.AddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.commodity.CommodityMiddleViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.CommodityMiddleViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.HedgeSpeciesData
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.HedgeSpeciesData
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.NewHedgeSpeciesViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.NewHedgeSpeciesViewHolder
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.registration.showPopups
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ActivityUtils
 import com.blankj.utilcode.util.ConvertUtils
 import com.blankj.utilcode.util.ConvertUtils
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
-import org.jetbrains.anko._FrameLayout
-import org.jetbrains.anko.matchParent
+import org.jetbrains.anko.*
 import org.jetbrains.anko.support.v4.viewPager
 import org.jetbrains.anko.support.v4.viewPager
-import org.jetbrains.anko.verticalLayout
-import org.jetbrains.anko.view
 
 
 class NewCommodityInformationActivity : BaseActivity<NewCommodityInformationViewModel>() {
 class NewCommodityInformationActivity : BaseActivity<NewCommodityInformationViewModel>() {
 
 
@@ -36,6 +39,8 @@ class NewCommodityInformationActivity : BaseActivity<NewCommodityInformationView
     var selectedTabIndex: Int = 0
     var selectedTabIndex: Int = 0
     private lateinit var viewPager: ViewPager
     private lateinit var viewPager: ViewPager
 
 
+    val selectTab: MutableLiveData<Int> = MutableLiveData<Int>().apply { value = 0 }
+
     private val tabsArray: List<String> by lazy {
     private val tabsArray: List<String> by lazy {
         arrayListOf(
         arrayListOf(
             "现货品种", "套保品种"
             "现货品种", "套保品种"
@@ -94,48 +99,153 @@ class NewCommodityInformationActivity : BaseActivity<NewCommodityInformationView
     override fun onCreate(savedInstanceState: Bundle?) {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         super.onCreate(savedInstanceState)
         verticalLayout {
         verticalLayout {
-            topBar {
-                commonLeftButton()
-                commonTitle {
-                    text = "商品信息"
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                imageView {
+                    imageResource = R.mipmap.back
+                    onThrottleFirstClick {
+                        finish()
+                    }
+                }.lparams(autoSize(48),autoSize(48)){
+                    marginStart = autoSize(36)
                 }
                 }
-                commonMenuButton(R.mipmap.add_new) {
-                    if (selectedTabIndex == 0){
+                emptyView()
+
+                textView {
+                    text = "商品信息"
+                    textColorInt = R.color.white
+                    textSize = 18f
+                }.lparams(wrapContent, wrapContent)
+                emptyView()
+
+                imageView {
+                    selectTab.bindOptional(context) {
+                        if (it == 0) {
+                            visibility = View.VISIBLE
+                        } else {
+                            visibility = View.INVISIBLE
+                        }
+                    }
+
+                    imageResource = R.mipmap.add_new
+                    onThrottleFirstClick {
                         val intent = Intent()
                         val intent = Intent()
-                        intent.putExtra("type","1")
+                        intent.putExtra("type", "1")
                         intent.setClass(context, AddSpotGoodsActivity::class.java)
                         intent.setClass(context, AddSpotGoodsActivity::class.java)
                         ActivityUtils.startActivity(intent)
                         ActivityUtils.startActivity(intent)
-                    }else if (selectedTabIndex == 1){
-                        val intent = Intent()
-                        intent.putExtra("type","1")
-                        intent.setClass(context, AddHedgeGoodsActivity::class.java)
-                        ActivityUtils.startActivity(intent)
                     }
                     }
+                }.lparams(autoSize(48),autoSize(48)){
+                    marginEnd = autoSize(36)
                 }
                 }
-            }
-
-            tabSegment {
-                segment = this
-                background = resources.getDrawable(R.color.segtabment_bg_color)
-                addOnTabSelectedListener(object :
-                    QMUITabSegment.OnTabSelectedListener {
-                    override fun onDoubleTap(index: Int) {}
-                    override fun onTabReselected(index: Int) {}
-                    override fun onTabUnselected(index: Int) {}
-                    override fun onTabSelected(index: Int) {
-                        selectedTabIndex = index
-                    }
-                })
-                setIndicator(
-                    QMUITabIndicator(
-                        QMUIDisplayHelper.dp2px(context, 2),
-                        false,
-                        true
+            }.lparams(matchParent, autoSize(120))
+
+//            topBar {
+//                commonLeftButton()
+//                commonTitle {
+//                    text = "商品信息"
+//                }
+//                commonMenuButton(R.mipmap.add_new) {
+//                    selectTab.bindOptional(context) {
+//                        if (it == 0) {
+//                            visibility = View.VISIBLE
+//                        } else {
+//                            visibility = View.GONE
+//                        }
+//                    }
+//
+//                    if (selectedTabIndex == 0) {
+//
+
+//                    } /*else if (selectedTabIndex == 1) {
+//
+//                        val intent = Intent()
+//                        intent.putExtra("type", "1")
+//                        intent.setClass(context, AddHedgeGoodsActivity::class.java)
+//                        ActivityUtils.startActivity(intent)
+//                    }*/
+//                }
+//            }
+
+            relativeLayout {
+
+                tabSegment {
+                    segment = this
+                    background = resources.getDrawable(R.color.segtabment_bg_color)
+                    addOnTabSelectedListener(object :
+                        QMUITabSegment.OnTabSelectedListener {
+                        override fun onDoubleTap(index: Int) {}
+                        override fun onTabReselected(index: Int) {}
+                        override fun onTabUnselected(index: Int) {}
+                        override fun onTabSelected(index: Int) {
+                            selectedTabIndex = index
+                            selectTab.postValue(index)
+                        }
+                    })
+                    setIndicator(
+                        QMUITabIndicator(
+                            QMUIDisplayHelper.dp2px(context, 2),
+                            false,
+                            true
+                        )
                     )
                     )
-                )
-                setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+                    setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+                }.lparams(matchParent, autoSize(80))
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        emptyView()
+                        imageView {
+                            onThrottleFirstClick {
+                                if (selectedTabIndex == 0){
+                                     onThrottleFirstClick {
+                                        showPopups(context = context,textString = "1,品类对应的是标仓系数,是非标商品转换成现货品种的系数;\n现货品种数量=现货品类数量*标仓系数。\n2,套保品种对应的是套保系数,是现货品中转换成套保品种的系数;\n" +
+                                                "套保品种数量=现货品种数量*套保系统\n3,期货品种对应的是期货品种系数,是期货品种转换成套保品种的系数。\n套保品种数量=期货品种数量*期货品种系数。",v = this,weight = 400)
+                                    }
+                                }
+                            }
+                            selectTab.bindOptional(context) {
+                                if (it == 0) {
+                                    imageResource = R.mipmap.rma_message_select
+                                } else {
+                                    imageResource = R.mipmap.rma_message_normal
+                                }
+                            }
+
+                        }.lparams(autoSize(36), autoSize(36)){
+                            marginEnd = autoSize(80)
+                        }
+                    }.lparams(autoSize(450), autoSize(80))
+                    linearLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        emptyView()
+                        imageView {
+                            onThrottleFirstClick {
+                                if (selectedTabIndex == 1){
+                                    onThrottleFirstClick {
+                                        showPopups(context = context,textString = "1,品类对应的是标仓系数,是非标商品转换成现货品种的系数;\n现货品种数量=现货品类数量*标仓系数。\n2,套保品种对应的是套保系数,是现货品中转换成套保品种的系数;\n" +
+                                                "套保品种数量=现货品种数量*套保系统\n3,期货品种对应的是期货品种系数,是期货品种转换成套保品种的系数。\n套保品种数量=期货品种数量*期货品种系数。\n" +
+                                                "4,期货合约对应的是期货合约乘数,是期货合约转换成期货品种的系数;\n期货品种数量=期货合约手数*期货合约乘数。",v = this,weight = 400)
+                                    }
+                                }
+                            }
+                            selectTab.bindOptional(context) {
+                                if (it == 1) {
+                                    imageResource = R.mipmap.rma_message_select
+                                } else {
+                                    imageResource = R.mipmap.rma_message_normal
+                                }
+                            }
+                        }.lparams(autoSize(36), autoSize(36)){
+                            marginEnd = autoSize(80)
+                        }
+                    }.lparams(autoSize(450), autoSize(80))
+                }.lparams(matchParent, autoSize(80))
+
             }.lparams(matchParent, autoSize(80))
             }.lparams(matchParent, autoSize(80))
 
 
+
             view {
             view {
                 background = resources.getDrawable(R.color.main_hit_bg_color)
                 background = resources.getDrawable(R.color.main_hit_bg_color)
             }.lparams(matchParent, autoSize(1)) {
             }.lparams(matchParent, autoSize(1)) {
@@ -169,10 +279,11 @@ class NewSpotVarietiesUI(
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
     private lateinit var statusLayout: StatusLayout
 
 
-    private val spotVarietiesNormalAdapter: BaseAdapter<DemoData, DemoViewHolder> = BaseAdapter { _, _ -> DemoViewHolder(activity, viewModel) }
+    private val spotVarietiesNormalAdapter: BaseAdapter<DeliveryGoodsDetailData, DemoViewHolder> =
+        BaseAdapter { _, _ -> DemoViewHolder(activity, viewModel) }
 
 
     init {
     init {
-        viewModel.queryWrStandardDetails("")
+        viewModel.queryDeliveryGoodsDetailList()
     }
     }
 
 
     val root = _FrameLayout(activity).apply {
     val root = _FrameLayout(activity).apply {
@@ -185,7 +296,7 @@ class NewSpotVarietiesUI(
                     setEnableRefresh(true)
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
                     setOnRefreshListener {
-
+                        viewModel.queryDeliveryGoodsDetailList()
                     }
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -198,11 +309,11 @@ class NewSpotVarietiesUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
             }).lparams(matchParent, matchParent)
 
 
-            viewModel.demoDataList.bindOptional(context){
-                if (it?.isEmpty() == true || it?.size == 0){
+            viewModel.deliveryGoodsDetailList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
                     statusLayout.showEmpty()
-                }else {
-                    if (swipeToLayout.getIsRefreshing()){
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
                         swipeToLayout.finishRefresh()
                     }
                     }
                     statusLayout.showSuccess()
                     statusLayout.showSuccess()
@@ -227,10 +338,11 @@ class NewHedgeSpeciesUI(
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
     private lateinit var statusLayout: StatusLayout
 
 
-    private val hedgeSpeciesAdapter: BaseAdapter<HedgeSpeciesData, NewHedgeSpeciesViewHolder> = BaseAdapter { _, _ -> NewHedgeSpeciesViewHolder(activity, viewModel) }
+    private val hedgeSpeciesAdapter: BaseAdapter<MiddleGoodsDetail, NewHedgeSpeciesViewHolder> =
+        BaseAdapter { _, _ -> NewHedgeSpeciesViewHolder(activity, viewModel) }
 
 
     init {
     init {
-        viewModel.queryMiddleGoodsDetails()
+        viewModel.queryMiddleGoodsDetailList()
     }
     }
 
 
     val root = _FrameLayout(activity).apply {
     val root = _FrameLayout(activity).apply {
@@ -243,7 +355,7 @@ class NewHedgeSpeciesUI(
                     setEnableRefresh(true)
                     setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
                     setOnRefreshListener {
-
+                        viewModel.queryMiddleGoodsDetailList()
                     }
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -256,11 +368,11 @@ class NewHedgeSpeciesUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
             }).lparams(matchParent, matchParent)
 
 
-            viewModel.hedgeSpeciesList.bindOptional(context){
-                if (it?.isEmpty() == true || it?.size == 0){
+            viewModel.middleGoodsDetailsList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
                     statusLayout.showEmpty()
-                }else {
-                    if (swipeToLayout.getIsRefreshing()){
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
                         swipeToLayout.finishRefresh()
                     }
                     }
                     statusLayout.showSuccess()
                     statusLayout.showSuccess()

+ 106 - 182
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationViewModel.kt

@@ -3,8 +3,7 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 import androidx.lifecycle.MutableLiveData
 import androidx.lifecycle.MutableLiveData
 import androidx.viewpager.widget.ViewPager
 import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.ContractData
-import cn.muchinfo.rma.global.data.MiddleGoodsDetails
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.BaseViewModel
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.HedgeFutureData
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge.HedgeFutureData
@@ -15,19 +14,19 @@ import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 class NewCommodityInformationViewModel : BaseViewModel() {
 class NewCommodityInformationViewModel : BaseViewModel() {
 
 
     /**
     /**
-     * 现货品种的数据
+     * 套保品种详情
      */
      */
-    val demoDataList: MutableLiveData<List<DemoData>> = MutableLiveData()
+    val middleGoodsDetails: MutableLiveData<MiddleGoodsDetails> = MutableLiveData()
 
 
     /**
     /**
-     * 套保品种的数据
+     * 套保品种列表
      */
      */
-    val hedgeSpeciesList: MutableLiveData<List<HedgeSpeciesData>> = MutableLiveData()
+    val middleGoodsDetailsList : MutableLiveData<List<MiddleGoodsDetail>> = MutableLiveData()
 
 
     /**
     /**
-     * 套保品种详情
+     * 现货品种列表
      */
      */
-    val middleGoodsDetails: MutableLiveData<MiddleGoodsDetails> = MutableLiveData()
+    val deliveryGoodsDetailList : MutableLiveData<List<DeliveryGoodsDetailData>> = MutableLiveData()
 
 
 
 
     /**
     /**
@@ -45,150 +44,35 @@ class NewCommodityInformationViewModel : BaseViewModel() {
         }
         }
     }
     }
 
 
-
-    fun getHedgeSpeciesList() {
-        val newhedgeSpeciesList = arrayListOf<HedgeSpeciesData>()
-        newhedgeSpeciesList.add(
-            HedgeSpeciesData(
-                id = "1",
-                futureTyeList = arrayListOf(
-                    HedgeFutureData(
-                        id = "1",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    ), HedgeFutureData(
-                        id = "2",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    )
-                ),
-                spotTypeList = arrayListOf(
-                    HedgeSpotData(
-                        id = "1",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    ), HedgeSpotData(
-                        id = "2",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    )
-                )
-            )
-        )
-
-        newhedgeSpeciesList.add(
-            HedgeSpeciesData(
-                id = "2",
-                futureTyeList = arrayListOf(
-                    HedgeFutureData(
-                        id = "1",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    ), HedgeFutureData(
-                        id = "2",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    )
-                ),
-                spotTypeList = arrayListOf(
-                    HedgeSpotData(
-                        id = "1",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    ), HedgeSpotData(
-                        id = "2",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    )
-                )
-            )
-        )
-
-        newhedgeSpeciesList.add(
-            HedgeSpeciesData(
-                id = "3",
-                futureTyeList = arrayListOf(
-                    HedgeFutureData(
-                        id = "1",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    ), HedgeFutureData(
-                        id = "2",
-                        futureContractList = arrayListOf("1", "2", "3")
-                    )
-                ),
-                spotTypeList = arrayListOf(
-                    HedgeSpotData(
-                        id = "1",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    ), HedgeSpotData(
-                        id = "2",
-                        spotCategoryList = arrayListOf("1", "2", "3")
-                    )
-                )
-            )
-        )
-
-        hedgeSpeciesList.postValue(newhedgeSpeciesList)
-    }
-
     /**
     /**
-     * 查询现货品种详情
+     * 查询现货品种详情数据列表
      * @param wrstandardid String
      * @param wrstandardid String
      */
      */
-    fun queryWrStandardDetails(deliverygoodsid: String) {
+    fun queryDeliveryGoodsDetailList() {
         val params = mutableMapOf<String, String>().apply {
         val params = mutableMapOf<String, String>().apply {
             put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-//            put("deliverygoodsid", deliverygoodsid)
         }
         }
         MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
         MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
             if (isSuccess) {
             if (isSuccess) {
-//                wrStandardDetails.postValue(respData?.get(0))
-//                initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
+                deliveryGoodsDetailList.postValue(respData)
             }
             }
         }
         }
     }
     }
 
 
 
 
+    /**
+     *套保品种详情的数据列表
+     */
+    fun queryMiddleGoodsDetailList() {
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.commodityManager?.queryMiddleGoodsDetail(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                middleGoodsDetailsList.postValue(respData)
+            }
+        }
 
 
-    fun setDemoDataList() {
-        val demoList = arrayListOf<DemoData>()
-        demoList.add(
-            DemoData(
-                id = "1",
-                categoryList = arrayListOf("1", "2", "3"),
-                brandList = arrayListOf("1", "2", "3"),
-                hedgeList = arrayListOf(
-                    HedgeDetails(id = "1", detailsList = arrayListOf("1", "2", "3")),
-                    HedgeDetails(id = "2", detailsList = arrayListOf("1", "2"))
-                )
-            )
-        )
-        demoList.add(
-            DemoData(
-                id = "2",
-                categoryList = arrayListOf("1", "2", "3"),
-                brandList = arrayListOf("1", "2", "3"),
-                hedgeList = arrayListOf(
-                    HedgeDetails(id = "1", detailsList = arrayListOf("1", "2", "3")),
-                    HedgeDetails(id = "2", detailsList = arrayListOf("1", "2"))
-                )
-            )
-        )
-        demoList.add(
-            DemoData(
-                id = "3",
-                categoryList = arrayListOf("1", "2", "3"),
-                brandList = arrayListOf("1", "2", "3"),
-                hedgeList = arrayListOf(
-                    HedgeDetails(id = "1", detailsList = arrayListOf("1", "2", "3")),
-                    HedgeDetails(id = "2", detailsList = arrayListOf("1", "2"))
-                )
-            )
-        )
-        demoList.add(
-            DemoData(
-                id = "4",
-                categoryList = arrayListOf("1", "2", "3"),
-                brandList = arrayListOf("1", "2", "3"),
-                hedgeList = arrayListOf(
-                    HedgeDetails(id = "1", detailsList = arrayListOf("1", "2", "3")),
-                    HedgeDetails(id = "2", detailsList = arrayListOf("1", "2"))
-                )
-            )
-        )
-        demoDataList.postValue(demoList)
     }
     }
 
 
     /**
     /**
@@ -196,9 +80,9 @@ class NewCommodityInformationViewModel : BaseViewModel() {
      * @param index Int
      * @param index Int
      */
      */
     fun setOnAllHedgeClick(index: Int){
     fun setOnAllHedgeClick(index: Int){
-        val datanewList = arrayListOf<HedgeSpeciesData>()
-        hedgeSpeciesList.value?.forEach {
-            if (index == hedgeSpeciesList.value?.indexOf(it)) {
+        val datanewList = arrayListOf<MiddleGoodsDetail>()
+        middleGoodsDetailsList.value?.forEach {
+            if (index == middleGoodsDetailsList.value?.indexOf(it)) {
                 if (it.isAllSelect == 0) {
                 if (it.isAllSelect == 0) {
                     datanewList.add(it.copy(isAllSelect = 1))
                     datanewList.add(it.copy(isAllSelect = 1))
                 } else {
                 } else {
@@ -208,18 +92,58 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                 datanewList.add(it)
                 datanewList.add(it)
             }
             }
         }
         }
-        hedgeSpeciesList.postValue(datanewList)
+        middleGoodsDetailsList.postValue(datanewList)
+    }
+
+    /**
+     * 套保品种-期货品种的展开隐藏点击事件
+     * @param index Int
+     */
+    fun setOnHedgeFutureAllClick(index: Int) {
+        val datanewlist = arrayListOf<MiddleGoodsDetail>()
+        middleGoodsDetailsList.value?.forEach {
+            if (index == middleGoodsDetailsList.value?.indexOf(it)) {
+                if (it.isFutureTypeSelect == 0) {
+                    datanewlist.add(it.copy(isFutureTypeSelect = 1))
+                } else {
+                    datanewlist.add(it.copy(isFutureTypeSelect = 0))
+                }
+            } else {
+                datanewlist.add(it)
+            }
+        }
+        middleGoodsDetailsList.postValue(datanewlist)
+    }
+
+    /**
+     * 套保品种-现货品种的展开隐藏点击事件
+     * @param index Int
+     */
+    fun setOnHedgeSpotAllClick(index: Int) {
+        val datanewlist = arrayListOf<MiddleGoodsDetail>()
+        middleGoodsDetailsList.value?.forEach {
+            if (index == middleGoodsDetailsList.value?.indexOf(it)) {
+                if (it.isSpotTypeSelect == 0) {
+                    datanewlist.add(it.copy(isSpotTypeSelect = 1))
+                } else {
+                    datanewlist.add(it.copy(isSpotTypeSelect = 0))
+                }
+            } else {
+                datanewlist.add(it)
+            }
+        }
+        middleGoodsDetailsList.postValue(datanewlist)
     }
     }
 
 
     //套保品种-期货品种的展开隐藏点击事件
     //套保品种-期货品种的展开隐藏点击事件
     fun setOnHedgeFutureClick(index: Int, sonIndex: Int) {
     fun setOnHedgeFutureClick(index: Int, sonIndex: Int) {
-        val datanewlist = arrayListOf<HedgeSpeciesData>()
-        val oldList = hedgeSpeciesList.value
-        hedgeSpeciesList.value?.forEach {
+        val datanewlist = arrayListOf<MiddleGoodsDetail>()
+        val oldList = middleGoodsDetailsList.value
+        middleGoodsDetailsList.value?.forEach {
             if (index == oldList?.indexOf(it)) {
             if (index == oldList?.indexOf(it)) {
-                val newHedgeList = arrayListOf<HedgeFutureData>()
-                oldList.get(index).futureTyeList.forEach { data ->
-                    if (sonIndex == oldList.get(index).futureTyeList.indexOf(data)) {
+                val newHedgeList = arrayListOf<Ermcp3GoodsGroupEx>()
+                oldList.get(index).gplist?.forEach { data ->
+                    if (sonIndex == oldList.get(index).gplist?.indexOf(data)) {
                         if (data.isFutureSelect == 0) {
                         if (data.isFutureSelect == 0) {
                             newHedgeList.add(data.copy(isFutureSelect = 1))
                             newHedgeList.add(data.copy(isFutureSelect = 1))
                         } else {
                         } else {
@@ -229,23 +153,23 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                         newHedgeList.add(data)
                         newHedgeList.add(data)
                     }
                     }
                 }
                 }
-                datanewlist.add(it.copy(futureTyeList = newHedgeList))
+                datanewlist.add(it.copy(gplist = newHedgeList))
             } else {
             } else {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        hedgeSpeciesList.postValue(datanewlist)
+        middleGoodsDetailsList.postValue(datanewlist)
     }
     }
 
 
     //套保品种-现货品种的item点击展开
     //套保品种-现货品种的item点击展开
     fun setOnHedgeSpotClick(index: Int, sonIndex: Int){
     fun setOnHedgeSpotClick(index: Int, sonIndex: Int){
-        val datanewlist = arrayListOf<HedgeSpeciesData>()
-        val oldList = hedgeSpeciesList.value
-        hedgeSpeciesList.value?.forEach {
+        val datanewlist = arrayListOf<MiddleGoodsDetail>()
+        val oldList = middleGoodsDetailsList.value
+        middleGoodsDetailsList.value?.forEach {
             if (index == oldList?.indexOf(it)) {
             if (index == oldList?.indexOf(it)) {
-                val newHedgeList = arrayListOf<HedgeSpotData>()
-                oldList.get(index).spotTypeList.forEach { data ->
-                    if (sonIndex == oldList.get(index).spotTypeList.indexOf(data)) {
+                val newHedgeList = arrayListOf<ErmcpDeliveryGoodsDetail>()
+                oldList.get(index).dglist?.forEach { data ->
+                    if (sonIndex == oldList.get(index).dglist?.indexOf(data)) {
                         if (data.isSpotSelect == 0) {
                         if (data.isSpotSelect == 0) {
                             newHedgeList.add(data.copy(isSpotSelect = 1))
                             newHedgeList.add(data.copy(isSpotSelect = 1))
                         } else {
                         } else {
@@ -255,12 +179,12 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                         newHedgeList.add(data)
                         newHedgeList.add(data)
                     }
                     }
                 }
                 }
-                datanewlist.add(it.copy(spotTypeList = newHedgeList))
+                datanewlist.add(it.copy(dglist = newHedgeList))
             } else {
             } else {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        hedgeSpeciesList.postValue(datanewlist)
+        middleGoodsDetailsList.postValue(datanewlist)
     }
     }
 
 
 
 
@@ -270,9 +194,9 @@ class NewCommodityInformationViewModel : BaseViewModel() {
      * @param index Int
      * @param index Int
      */
      */
     fun setOnAllClick(index: Int) {
     fun setOnAllClick(index: Int) {
-        val datanewlist = arrayListOf<DemoData>()
-        demoDataList.value?.forEach {
-            if (index == demoDataList.value?.indexOf(it)) {
+        val datanewlist = arrayListOf<DeliveryGoodsDetailData>()
+        deliveryGoodsDetailList.value?.forEach {
+            if (index == deliveryGoodsDetailList.value?.indexOf(it)) {
                 if (it.isSelectAll == 0) {
                 if (it.isSelectAll == 0) {
                     datanewlist.add(it.copy(isSelectAll = 1))
                     datanewlist.add(it.copy(isSelectAll = 1))
                 } else {
                 } else {
@@ -282,14 +206,14 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        demoDataList.postValue(datanewlist)
+        deliveryGoodsDetailList.postValue(datanewlist)
     }
     }
 
 
     //现货品种-品类的展开隐藏点击事件
     //现货品种-品类的展开隐藏点击事件
     fun setOnCategoryClick(index: Int) {
     fun setOnCategoryClick(index: Int) {
-        val datanewlist = arrayListOf<DemoData>()
-        demoDataList.value?.forEach {
-            if (index == demoDataList.value?.indexOf(it)) {
+        val datanewlist = arrayListOf<DeliveryGoodsDetailData>()
+        deliveryGoodsDetailList.value?.forEach {
+            if (index == deliveryGoodsDetailList.value?.indexOf(it)) {
                 if (it.categoryIsSelect == 0) {
                 if (it.categoryIsSelect == 0) {
                     datanewlist.add(it.copy(categoryIsSelect = 1))
                     datanewlist.add(it.copy(categoryIsSelect = 1))
                 } else {
                 } else {
@@ -299,14 +223,14 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        demoDataList.postValue(datanewlist)
+        deliveryGoodsDetailList.postValue(datanewlist)
     }
     }
 
 
     //现货品种-品牌的展开隐藏点击事件
     //现货品种-品牌的展开隐藏点击事件
     fun setOnBrandClick(index: Int) {
     fun setOnBrandClick(index: Int) {
-        val datanewlist = arrayListOf<DemoData>()
-        demoDataList.value?.forEach {
-            if (index == demoDataList.value?.indexOf(it)) {
+        val datanewlist = arrayListOf<DeliveryGoodsDetailData>()
+        deliveryGoodsDetailList.value?.forEach {
+            if (index == deliveryGoodsDetailList.value?.indexOf(it)) {
                 if (it.brandIsSelect == 0) {
                 if (it.brandIsSelect == 0) {
                     datanewlist.add(it.copy(brandIsSelect = 1))
                     datanewlist.add(it.copy(brandIsSelect = 1))
                 } else {
                 } else {
@@ -316,14 +240,14 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        demoDataList.postValue(datanewlist)
+        deliveryGoodsDetailList.postValue(datanewlist)
     }
     }
 
 
     //现货品种-套保品种的展开隐藏点击事件
     //现货品种-套保品种的展开隐藏点击事件
     fun setOnHedgeClick(index: Int) {
     fun setOnHedgeClick(index: Int) {
-        val datanewlist = arrayListOf<DemoData>()
-        demoDataList.value?.forEach {
-            if (index == demoDataList.value?.indexOf(it)) {
+        val datanewlist = arrayListOf<DeliveryGoodsDetailData>()
+        deliveryGoodsDetailList.value?.forEach {
+            if (index == deliveryGoodsDetailList.value?.indexOf(it)) {
                 if (it.hedgeIsSelect == 0) {
                 if (it.hedgeIsSelect == 0) {
                     datanewlist.add(it.copy(hedgeIsSelect = 1))
                     datanewlist.add(it.copy(hedgeIsSelect = 1))
                 } else {
                 } else {
@@ -333,18 +257,18 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        demoDataList.postValue(datanewlist)
+        deliveryGoodsDetailList.postValue(datanewlist)
     }
     }
 
 
     //现货品种-套保品种-现货品种的展开隐藏点击事件
     //现货品种-套保品种-现货品种的展开隐藏点击事件
     fun setOnFutureClick(index: Int, sonIndex: Int) {
     fun setOnFutureClick(index: Int, sonIndex: Int) {
-        val datanewlist = arrayListOf<DemoData>()
-        val oldList = demoDataList.value
-        demoDataList.value?.forEach {
+        val datanewlist = arrayListOf<DeliveryGoodsDetailData>()
+        val oldList = deliveryGoodsDetailList.value
+        deliveryGoodsDetailList.value?.forEach {
             if (index == oldList?.indexOf(it)) {
             if (index == oldList?.indexOf(it)) {
-                val newHedgeList = arrayListOf<HedgeDetails>()
-                oldList.get(index).hedgeList.forEach { data ->
-                    if (sonIndex == oldList.get(index).hedgeList.indexOf(data)) {
+                val newHedgeList = arrayListOf<Ermcp3MiddleGoodsDetail>()
+                oldList.get(index).mgList?.forEach { data ->
+                    if (sonIndex == oldList.get(index).mgList?.indexOf(data)) {
                         if (data.isSelect == 0) {
                         if (data.isSelect == 0) {
                             newHedgeList.add(data.copy(isSelect = 1))
                             newHedgeList.add(data.copy(isSelect = 1))
                         } else {
                         } else {
@@ -354,12 +278,12 @@ class NewCommodityInformationViewModel : BaseViewModel() {
                         newHedgeList.add(data)
                         newHedgeList.add(data)
                     }
                     }
                 }
                 }
-                datanewlist.add(it.copy(hedgeList = newHedgeList))
+                datanewlist.add(it.copy(mgList = newHedgeList))
             } else {
             } else {
                 datanewlist.add(it)
                 datanewlist.add(it)
             }
             }
         }
         }
-        demoDataList.postValue(datanewlist)
+        deliveryGoodsDetailList.postValue(datanewlist)
     }
     }
 
 
 }
 }

+ 15 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotCategoryViewHolder.kt

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 import android.view.Gravity
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Wrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -10,15 +12,18 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
 
 
-class SpotCategoryViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel) : BaseViewHolder<String>(activity){
+class SpotCategoryViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel) : BaseViewHolder<Ermcp3Wrstandard>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
         linearLayout {
         linearLayout {
             backgroundResource = R.drawable.rma_list_item_bg
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             gravity = Gravity.CENTER_VERTICAL
+            //品类
             textView {
             textView {
-                text = "10mm"
+                data.bindOptional(context){
+                    text = it?.wrstandardname
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){
@@ -27,14 +32,20 @@ class SpotCategoryViewHolder(private val activity : AppCompatActivity,private va
 
 
             emptyView()
             emptyView()
 
 
+            //单位
             textView {
             textView {
-                text = "吨"
+                data.bindOptional(context){
+                    text = it?.enumdicname
+                }
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
                 textSizeAuto = 31
                 textSizeAuto = 31
             }.lparams(wrapContent, wrapContent)
             }.lparams(wrapContent, wrapContent)
             emptyView()
             emptyView()
+            //标仓系数
             textView {
             textView {
-                text = "1.2"
+                data.bindOptional(context){
+                    text = it?.convertfactor
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){

+ 14 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotFutureViewHolder.kt

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity
 import android.view.Gravity
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3GoodsGroupEx
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -10,7 +12,7 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
 
 
-class SpotFutureViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<String>(activity){
+class SpotFutureViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<Ermcp3GoodsGroupEx>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -18,7 +20,9 @@ class SpotFutureViewHolder(private val activity : AppCompatActivity,private val
             backgroundResource = R.drawable.rma_list_item_bg
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             gravity = Gravity.CENTER_VERTICAL
             textView {
             textView {
-                text = "10mm"
+                data.bindOptional(context){
+                    text = it?.goodsgroupname
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){
@@ -27,14 +31,20 @@ class SpotFutureViewHolder(private val activity : AppCompatActivity,private val
 
 
             emptyView()
             emptyView()
 
 
+            //单位
             textView {
             textView {
-                text = "吨"
+                data.bindOptional(context){
+                    text = it?.enumdicname
+                }
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
                 textSizeAuto = 31
                 textSizeAuto = 31
             }.lparams(wrapContent, wrapContent)
             }.lparams(wrapContent, wrapContent)
             emptyView()
             emptyView()
+            //折算系数
             textView {
             textView {
-                text = "1.2"
+                data.bindOptional(context){
+                    text = it?.convertratio
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){

+ 17 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/SpotHedgeViewHolder.kt

@@ -4,6 +4,8 @@ import android.view.Gravity
 import android.view.View
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3GoodsGroupEx
+import cn.muchinfo.rma.global.data.Ermcp3MiddleGoodsDetail
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
@@ -11,11 +13,11 @@ import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
 
 
-class SpotHedgeViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel,private val index : Int) : BaseViewHolder<HedgeDetails>(activity){
+class SpotHedgeViewHolder(private val activity : AppCompatActivity,private val viewModel: NewCommodityInformationViewModel,private val index : Int) : BaseViewHolder<Ermcp3MiddleGoodsDetail>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     //期货品种
     //期货品种
-    private val spotFutureAdapter: BaseAdapter<String, SpotFutureViewHolder> =
+    private val spotFutureAdapter: BaseAdapter<Ermcp3GoodsGroupEx, SpotFutureViewHolder> =
         BaseAdapter { _, _ -> SpotFutureViewHolder(activity, viewModel) }
         BaseAdapter { _, _ -> SpotFutureViewHolder(activity, viewModel) }
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -23,8 +25,11 @@ class SpotHedgeViewHolder(private val activity : AppCompatActivity,private val v
             linearLayout {
             linearLayout {
                 backgroundResource = R.drawable.rma_list_item_bg
                 backgroundResource = R.drawable.rma_list_item_bg
                 gravity = Gravity.CENTER_VERTICAL
                 gravity = Gravity.CENTER_VERTICAL
+                //套保品种名称
                 textView {
                 textView {
-                    text = "沪铜"
+                    data.bindOptional(context){
+                        text = it?.mg?.middlegoodsname
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent){
                 }.lparams(wrapContent, wrapContent){
@@ -33,14 +38,20 @@ class SpotHedgeViewHolder(private val activity : AppCompatActivity,private val v
 
 
                 emptyView()
                 emptyView()
 
 
+                //单位
                 textView {
                 textView {
-                    text = "吨"
+                    data.bindOptional(context){
+                        text = it?.mg?.enumdicname
+                    }
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                     textSizeAuto = 31
                     textSizeAuto = 31
                 }.lparams(wrapContent, wrapContent)
                 }.lparams(wrapContent, wrapContent)
                 emptyView()
                 emptyView()
+                //套保系数
                 textView {
                 textView {
-                    text = "1.2"
+                    data.bindOptional(context){
+                        text = it?.mg?.evaluateratio
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent){
                 }.lparams(wrapContent, wrapContent){
@@ -104,7 +115,7 @@ class SpotHedgeViewHolder(private val activity : AppCompatActivity,private val v
             }.lparams(matchParent, wrapContent)
             }.lparams(matchParent, wrapContent)
 
 
             data.bindOptional(context){
             data.bindOptional(context){
-                spotFutureAdapter.setNewData(it?.detailsList)
+                spotFutureAdapter.setNewData(it?.gplist)
             }
             }
         }.lparams(matchParent, wrapContent)
         }.lparams(matchParent, wrapContent)
     }
     }

+ 12 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeFutureContractViewHolder.kt

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge
 import android.view.Gravity
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Goods
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -18,7 +20,7 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @property itemSize IntArray
  * @constructor
  * @constructor
  */
  */
-class HedgeFutureContractViewHolder(private val activity : AppCompatActivity, private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<String>(activity){
+class HedgeFutureContractViewHolder(private val activity : AppCompatActivity, private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<Ermcp3Goods>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -26,7 +28,9 @@ class HedgeFutureContractViewHolder(private val activity : AppCompatActivity, pr
             backgroundResource = R.drawable.rma_list_item_bg
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             gravity = Gravity.CENTER_VERTICAL
             textView {
             textView {
-                text = "10mm"
+                data.bindOptional(context){
+                    text = it?.goodsname
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){
@@ -36,13 +40,17 @@ class HedgeFutureContractViewHolder(private val activity : AppCompatActivity, pr
             emptyView()
             emptyView()
 
 
             textView {
             textView {
-                text = "吨"
+                data.bindOptional(context){
+                    text = it?.enumdicname
+                }
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
                 textSizeAuto = 31
                 textSizeAuto = 31
             }.lparams(wrapContent, wrapContent)
             }.lparams(wrapContent, wrapContent)
             emptyView()
             emptyView()
             textView {
             textView {
-                text = "1.2"
+                data.bindOptional(context){
+                    text = it?.agreeunit
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){

+ 18 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeFutureViewHolder.kt

@@ -4,6 +4,9 @@ import android.view.Gravity
 import android.view.View
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Goods
+import cn.muchinfo.rma.global.data.Ermcp3GoodsGroupEx
+import cn.muchinfo.rma.global.data.ErmcpDeliveryGoodsDetail
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
@@ -23,11 +26,11 @@ class HedgeFutureViewHolder(
     private val activity: AppCompatActivity,
     private val activity: AppCompatActivity,
     private val viewModel: NewCommodityInformationViewModel,
     private val viewModel: NewCommodityInformationViewModel,
     private val index : Int//选择item的下标
     private val index : Int//选择item的下标
-) : BaseViewHolder<HedgeFutureData>(activity) {
+) : BaseViewHolder<Ermcp3GoodsGroupEx>(activity) {
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     //期货合约
     //期货合约
-    private val hedgeFutureContractAdapter: BaseAdapter<String, HedgeFutureContractViewHolder> =
+    private val hedgeFutureContractAdapter: BaseAdapter<Ermcp3Goods, HedgeFutureContractViewHolder> =
         BaseAdapter { _, _ -> HedgeFutureContractViewHolder(activity, viewModel) }
         BaseAdapter { _, _ -> HedgeFutureContractViewHolder(activity, viewModel) }
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -35,8 +38,11 @@ class HedgeFutureViewHolder(
             linearLayout {
             linearLayout {
                 backgroundResource = R.drawable.rma_list_item_bg
                 backgroundResource = R.drawable.rma_list_item_bg
                 gravity = Gravity.CENTER_VERTICAL
                 gravity = Gravity.CENTER_VERTICAL
+                //期货商品组名称
                 textView {
                 textView {
-                    text = "沪铜"
+                    data.bindOptional(context){
+                        text = it?.goodsgroupname
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -45,14 +51,20 @@ class HedgeFutureViewHolder(
 
 
                 emptyView()
                 emptyView()
 
 
+                //单位
                 textView {
                 textView {
-                    text = "吨"
+                    data.bindOptional(context){
+                        text = it?.enumdicname
+                    }
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                     textSizeAuto = 31
                     textSizeAuto = 31
                 }.lparams(wrapContent, wrapContent)
                 }.lparams(wrapContent, wrapContent)
                 emptyView()
                 emptyView()
+                //品种系数
                 textView {
                 textView {
-                    text = "1.2"
+                    data.bindOptional(context){
+                        text = it?.convertratio
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -117,7 +129,7 @@ class HedgeFutureViewHolder(
             }.lparams(matchParent, wrapContent)
             }.lparams(matchParent, wrapContent)
 
 
             data.bindOptional(context){
             data.bindOptional(context){
-                hedgeFutureContractAdapter.setNewData(it?.futureContractList)
+                hedgeFutureContractAdapter.setNewData(it?.glist)
             }
             }
         }
         }
     }
     }

+ 14 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeSpotCagetoryViewHolder.kt

@@ -3,6 +3,9 @@ package cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge
 import android.view.Gravity
 import android.view.Gravity
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Goods
+import cn.muchinfo.rma.global.data.Ermcp3Wrstandard
+import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
@@ -18,7 +21,7 @@ import org.jetbrains.anko.*
  * @property itemSize IntArray
  * @property itemSize IntArray
  * @constructor
  * @constructor
  */
  */
-class HedgeSpotCategoryViewHolder(private val activity : AppCompatActivity, private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<String>(activity){
+class HedgeSpotCategoryViewHolder(private val activity : AppCompatActivity, private val viewModel: NewCommodityInformationViewModel): BaseViewHolder<Ermcp3Wrstandard>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -26,7 +29,9 @@ class HedgeSpotCategoryViewHolder(private val activity : AppCompatActivity, priv
             backgroundResource = R.drawable.rma_list_item_bg
             backgroundResource = R.drawable.rma_list_item_bg
             gravity = Gravity.CENTER_VERTICAL
             gravity = Gravity.CENTER_VERTICAL
             textView {
             textView {
-                text = "10mm"
+                data.bindOptional(context){
+                    text = it?.wrstandardname
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){
@@ -36,13 +41,18 @@ class HedgeSpotCategoryViewHolder(private val activity : AppCompatActivity, priv
             emptyView()
             emptyView()
 
 
             textView {
             textView {
-                text = "吨"
+                data.bindOptional(context){
+                    text = it?.enumdicname
+                }
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
                 textSizeAuto = 31
                 textSizeAuto = 31
             }.lparams(wrapContent, wrapContent)
             }.lparams(wrapContent, wrapContent)
             emptyView()
             emptyView()
+            //标仓系数
             textView {
             textView {
-                text = "1.2"
+                data.bindOptional(context){
+                    text = it?.convertfactor
+                }
                 textSizeAuto = 31
                 textSizeAuto = 31
                 textColorInt = R.color.rma_black_33
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
             }.lparams(wrapContent, wrapContent){

+ 16 - 7
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/HedgeSpotViewHolder.kt

@@ -4,6 +4,9 @@ import android.view.Gravity
 import android.view.View
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3Goods
+import cn.muchinfo.rma.global.data.Ermcp3Wrstandard
+import cn.muchinfo.rma.global.data.ErmcpDeliveryGoodsDetail
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
@@ -23,11 +26,11 @@ class HedgeSpotViewHolder(
     private val activity: AppCompatActivity,
     private val activity: AppCompatActivity,
     private val viewModel: NewCommodityInformationViewModel,
     private val viewModel: NewCommodityInformationViewModel,
     private val index : Int//选择item的下标
     private val index : Int//选择item的下标
-) : BaseViewHolder<HedgeSpotData>(activity) {
+) : BaseViewHolder<ErmcpDeliveryGoodsDetail>(activity) {
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     //期货合约
     //期货合约
-    private val hedgeSpotCategoryAdapter: BaseAdapter<String, HedgeSpotCategoryViewHolder> =
+    private val hedgeSpotCategoryAdapter: BaseAdapter<Ermcp3Wrstandard, HedgeSpotCategoryViewHolder> =
         BaseAdapter { _, _ -> HedgeSpotCategoryViewHolder(activity, viewModel) }
         BaseAdapter { _, _ -> HedgeSpotCategoryViewHolder(activity, viewModel) }
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -36,7 +39,9 @@ class HedgeSpotViewHolder(
                 backgroundResource = R.drawable.rma_list_item_bg
                 backgroundResource = R.drawable.rma_list_item_bg
                 gravity = Gravity.CENTER_VERTICAL
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                 textView {
-                    text = "沪铜"
+                    data.bindOptional(context){
+                        text = it?.data?.deliverygoodsname
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -46,13 +51,17 @@ class HedgeSpotViewHolder(
                 emptyView()
                 emptyView()
 
 
                 textView {
                 textView {
-                    text = "吨"
+                    data.bindOptional(context){
+                        text = it?.data?.enumdicname
+                    }
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                     textSizeAuto = 31
                     textSizeAuto = 31
                 }.lparams(wrapContent, wrapContent)
                 }.lparams(wrapContent, wrapContent)
                 emptyView()
                 emptyView()
                 textView {
                 textView {
-                    text = "1.2"
+                    data.bindOptional(context){
+                        text = it?.convertratio
+                    }
                     textSizeAuto = 31
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -76,7 +85,7 @@ class HedgeSpotViewHolder(
                     }.lparams(autoSize(43), autoSize(43))
                     }.lparams(autoSize(43), autoSize(43))
 
 
                     textView {
                     textView {
-                        text = "品类(2)"
+                        text = "品类"
                         textSizeAuto = 31
                         textSizeAuto = 31
                         textColorInt = R.color.rma_black_33
                         textColorInt = R.color.rma_black_33
                     }.lparams(wrapContent, wrapContent) {
                     }.lparams(wrapContent, wrapContent) {
@@ -117,7 +126,7 @@ class HedgeSpotViewHolder(
             }.lparams(matchParent, wrapContent)
             }.lparams(matchParent, wrapContent)
 
 
             data.bindOptional(context){
             data.bindOptional(context){
-                hedgeSpotCategoryAdapter.setNewData(it?.spotCategoryList)
+                hedgeSpotCategoryAdapter.setNewData(it?.gmlist)
             }
             }
         }
         }
     }
     }

+ 84 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/newhedge/NewHedgeSpeciesViewHolder.kt

@@ -1,13 +1,20 @@
 package cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge
 package cn.muchinfo.rma.view.base.home.commodity.newcommodity.newhedge
 
 
+import android.content.Intent
 import android.view.Gravity
 import android.view.Gravity
 import android.view.View
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.Ermcp3GoodsGroupEx
+import cn.muchinfo.rma.global.data.ErmcpDeliveryGoodsDetail
+import cn.muchinfo.rma.global.data.MiddleGoodsDetail
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.commodity.AddHedgeGoodsActivity
+import cn.muchinfo.rma.view.base.home.commodity.AddSpotGoodsActivity
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
 import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationViewModel
 import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 import org.jetbrains.anko.*
@@ -21,15 +28,15 @@ import org.jetbrains.anko.*
 class NewHedgeSpeciesViewHolder(
 class NewHedgeSpeciesViewHolder(
     private val activity: AppCompatActivity,
     private val activity: AppCompatActivity,
     private val viewModel: NewCommodityInformationViewModel
     private val viewModel: NewCommodityInformationViewModel
-) : BaseViewHolder<HedgeSpeciesData>(activity) {
+) : BaseViewHolder<MiddleGoodsDetail>(activity) {
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
 
     //期货品种adapter
     //期货品种adapter
-    private val hedgeFutureAdapter: BaseAdapter<HedgeFutureData, HedgeFutureViewHolder> =
+    private val hedgeFutureAdapter: BaseAdapter<Ermcp3GoodsGroupEx, HedgeFutureViewHolder> =
         BaseAdapter { _, _ -> HedgeFutureViewHolder(activity, viewModel, dataIndex) }
         BaseAdapter { _, _ -> HedgeFutureViewHolder(activity, viewModel, dataIndex) }
 
 
     //现货品种adapter
     //现货品种adapter
-    private val hedgeSpotAdapter: BaseAdapter<HedgeSpotData, HedgeSpotViewHolder> =
+    private val hedgeSpotAdapter: BaseAdapter<ErmcpDeliveryGoodsDetail, HedgeSpotViewHolder> =
         BaseAdapter { _, _ -> HedgeSpotViewHolder(activity, viewModel, dataIndex) }
         BaseAdapter { _, _ -> HedgeSpotViewHolder(activity, viewModel, dataIndex) }
 
 
     override fun _FrameLayout.createContentView() {
     override fun _FrameLayout.createContentView() {
@@ -47,7 +54,9 @@ class NewHedgeSpeciesViewHolder(
                 }
                 }
 
 
                 textView {
                 textView {
-                    text = "铜杆(吨)"
+                    data.bindOptional(context){
+                        text = it?.mg?.middlegoodsname + "(" + it?.mg?.enumdicname + ")"
+                    }
                     textSizeAuto = 36
                     textSizeAuto = 36
                     textColorInt = R.color.rma_black_33
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
@@ -55,12 +64,57 @@ class NewHedgeSpeciesViewHolder(
                 }
                 }
 
 
                 textView {
                 textView {
-                    text = "正常"
+                    data.bindOptional(context){
+                        if (it?.mg?.isvalid == "1"){
+                            text = "正常"
+                            textColorInt = R.color.rma_green_color
+                        }else{
+                            text = "停用"
+                            textColorInt = R.color.rma_blue_color
+                        }
+                    }
                     textSizeAuto = 36
                     textSizeAuto = 36
-                    textColorInt = R.color.rma_green_color
+
                 }.lparams(wrapContent, wrapContent) {
                 }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(20)
                     marginStart = autoSize(20)
                 }
                 }
+
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddHedgeGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "修改"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context, AddHedgeGoodsActivity::class.java)
+                        ActivityUtils.startActivity(intent)
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "详情"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
             }.lparams(matchParent, autoSize(84))
             }.lparams(matchParent, autoSize(84))
 
 
             verticalLayout {
             verticalLayout {
@@ -77,7 +131,7 @@ class NewHedgeSpeciesViewHolder(
                         gravity = Gravity.CENTER_VERTICAL
                         gravity = Gravity.CENTER_VERTICAL
                         imageView {
                         imageView {
                             onThrottleFirstClick {
                             onThrottleFirstClick {
-
+                                viewModel.setOnHedgeFutureAllClick(dataIndex)
                             }
                             }
                             imageResource = R.mipmap.second_list_floding
                             imageResource = R.mipmap.second_list_floding
                         }.lparams(autoSize(43), autoSize(43)) {
                         }.lparams(autoSize(43), autoSize(43)) {
@@ -115,17 +169,28 @@ class NewHedgeSpeciesViewHolder(
 
 
                 //套保品种-期货品种-期货合约
                 //套保品种-期货品种-期货合约
                 recyclerView {
                 recyclerView {
+                    data.bindOptional(context){
+                        if (it?.isFutureTypeSelect == 1){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
+                    }
                     background = resources.getDrawable(R.color.white)
                     background = resources.getDrawable(R.color.white)
                     adapter = hedgeFutureAdapter
                     adapter = hedgeFutureAdapter
                 }.lparams(matchParent, wrapContent)
                 }.lparams(matchParent, wrapContent)
 
 
+                data.bindOptional(context){
+                    hedgeFutureAdapter.setNewData(it?.gplist)
+                }
+
                 linearLayout {
                 linearLayout {
                     gravity = Gravity.CENTER_VERTICAL
                     gravity = Gravity.CENTER_VERTICAL
                     linearLayout {
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         gravity = Gravity.CENTER_VERTICAL
                         imageView {
                         imageView {
                             onThrottleFirstClick {
                             onThrottleFirstClick {
-
+                                viewModel.setOnHedgeSpotAllClick(dataIndex)
                             }
                             }
                             imageResource = R.mipmap.second_list_floding
                             imageResource = R.mipmap.second_list_floding
                         }.lparams(autoSize(43), autoSize(43)) {
                         }.lparams(autoSize(43), autoSize(43)) {
@@ -163,10 +228,21 @@ class NewHedgeSpeciesViewHolder(
 
 
                 //套保品种-现货品种
                 //套保品种-现货品种
                 recyclerView {
                 recyclerView {
+                    data.bindOptional(context){
+                        if (it?.isSpotTypeSelect == 1){
+                            visibility = View.VISIBLE
+                        }else{
+                            visibility = View.GONE
+                        }
+                    }
                     background = resources.getDrawable(R.color.white)
                     background = resources.getDrawable(R.color.white)
                     adapter = hedgeSpotAdapter
                     adapter = hedgeSpotAdapter
                 }.lparams(matchParent, wrapContent)
                 }.lparams(matchParent, wrapContent)
 
 
+                data.bindOptional(context){
+                    hedgeSpotAdapter.setNewData(it?.dglist)
+                }
+
             }.lparams(matchParent, wrapContent)
             }.lparams(matchParent, wrapContent)
         }.lparams(matchParent, wrapContent) {
         }.lparams(matchParent, wrapContent) {
             bottomMargin = autoSize(10)
             bottomMargin = autoSize(10)

+ 2 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/AddSpotCategoryViewHolder.kt

@@ -116,14 +116,7 @@ class AddSpotCategoryViewHolder(
             linearLayout {
             linearLayout {
                 background = resources.getDrawable(R.color.white)
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 gravity = Gravity.CENTER_VERTICAL
-                viewModel.wrStandardDetails.bindOptional(context) { data ->
-                    selectUnitType.postValue(
-                        SelectData(
-                            id = data?.wrd?.unitid ?: "",
-                            value = data?.wrd?.enumdicname ?: ""
-                        )
-                    )
-                }
+
                 onThrottleFirstClick {
                 onThrottleFirstClick {
                     //对于修改,停用,复用的操作不能选择
                     //对于修改,停用,复用的操作不能选择
                     if (operationType == "4" || operationType == "3" || operationType == "5") {
                     if (operationType == "4" || operationType == "3" || operationType == "5") {
@@ -154,7 +147,7 @@ class AddSpotCategoryViewHolder(
                             value = "桶"
                             value = "桶"
                         )
                         )
                     )
                     )
-                    activity.creatBottomSheetDialog("请选择客户类型", selectDataList) {
+                    activity.creatBottomSheetDialog("请选择套保", selectDataList) {
                         viewModel.changeSpotModelList(type = "4",id = dataIndex.plus(1).toString(),value = category_edittext.text.toString(),coefficientwarehouse = coefficient_of_warehouse.text.toString(),enumdicnameid = this.id,enumdicname = this.value)
                         viewModel.changeSpotModelList(type = "4",id = dataIndex.plus(1).toString(),value = category_edittext.text.toString(),coefficientwarehouse = coefficient_of_warehouse.text.toString(),enumdicnameid = this.id,enumdicname = this.value)
                     }
                     }
                 }
                 }

+ 4 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/InsuredVarietyViewHolder.kt

@@ -103,10 +103,14 @@ class InsuredVarietyViewHolder(
 
 
                 textView {
                 textView {
                     data.bindOptional(context){data ->
                     data.bindOptional(context){data ->
+                        text = data?.enumdicname
+                        textColorInt = R.color.rma_black_33
                         viewModel.middleGoodsNormalList.value?.forEach {
                         viewModel.middleGoodsNormalList.value?.forEach {
                             if (data?.middleGoodsId == it.goodsgroupid){
                             if (data?.middleGoodsId == it.goodsgroupid){
                                 text = it.goodunitid ?: ""
                                 text = it.goodunitid ?: ""
                                 textColorInt = R.color.rma_black_33
                                 textColorInt = R.color.rma_black_33
+                            }else{
+                                text = data?.enumdicname
                             }
                             }
                         }
                         }
 //                        if (it?.enumdicname.isNullOrEmpty()){
 //                        if (it?.enumdicname.isNullOrEmpty()){

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

@@ -13,7 +13,7 @@ import com.qmuiteam.qmui.widget.popup.QMUIPopup
 import com.qmuiteam.qmui.widget.popup.QMUIPopups
 import com.qmuiteam.qmui.widget.popup.QMUIPopups
 
 
 
 
-fun showPopups(context: Context, textString: String, v: View) {
+fun showPopups(context: Context, textString: String, v: View,weight : Int = 200) {
 
 
     val textView = TextView(context)
     val textView = TextView(context)
     textView.setLineSpacing(
     textView.setLineSpacing(
@@ -32,7 +32,7 @@ fun showPopups(context: Context, textString: String, v: View) {
     builder.textColor(R.attr.app_skin_common_title_text_color)
     builder.textColor(R.attr.app_skin_common_title_text_color)
     QMUISkinHelper.setSkinValue(textView, builder)
     QMUISkinHelper.setSkinValue(textView, builder)
     builder.release()
     builder.release()
-    QMUIPopups.popup(context, QMUIDisplayHelper.dp2px(context, 200))
+    QMUIPopups.popup(context, QMUIDisplayHelper.dp2px(context, weight))
         .preferredDirection(QMUIPopup.DIRECTION_TOP)
         .preferredDirection(QMUIPopup.DIRECTION_TOP)
         .view(textView)
         .view(textView)
         .edgeProtection(QMUIDisplayHelper.dp2px(context, 20))
         .edgeProtection(QMUIDisplayHelper.dp2px(context, 20))

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


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