Pārlūkot izejas kodu

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

Liu.bolan 4 gadi atpakaļ
vecāks
revīzija
5b837f7c72
27 mainītis faili ar 1104 papildinājumiem un 636 dzēšanām
  1. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt
  2. 6 5
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/adapter/CommodityAdapter.kt
  3. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/contract/ContractManager.kt
  4. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/business/contract/adapter/ContractAdapter.kt
  5. 28 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt
  6. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/HedgeManager.kt
  7. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/HedgePlanInfo.kt
  8. 27 22
      RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/adapter/HedgeAdapter.kt
  9. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsDetailData.kt
  10. 31 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/GoodsGroupData.kt
  11. 464 464
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java
  12. 4 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt
  13. 30 25
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/AddSpotGoodsActivity.kt
  14. 184 73
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/CommodityInformationViewModel.kt
  15. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/HedgeSpeciesUI.kt
  16. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationActivity.kt
  17. 19 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/newcommodity/NewCommodityInformationViewModel.kt
  18. 258 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/AddSpotCategoryViewHolder.kt
  19. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/InsuredVarietyViewHolder.kt
  20. 4 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/viewholder/SpotInfoData.kt
  21. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/AddHedgePlanActivity.kt
  22. 12 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanViewModel.kt
  23. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/InvoiceRegistrationActivity.kt
  24. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/MidpointsRegistrationActivity.kt
  25. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/PaymentRegistrationActivity.kt
  26. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/RegistrationViewModel.kt
  27. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/registration/SettlementRegistrationActivity.kt

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

@@ -326,8 +326,8 @@ class CommodityManager {
         unitid: Long = 0,
         type: Int = 0,
         remark: String = "",
-        spotgoodsmodels: List<ManageServiceMI2.SpotGoodsModelEx> = arrayListOf(),
-        spotgoodsbrands: List<ManageServiceMI2.SpotGoodsBrandEx> = arrayListOf(),
+        spotgoodsmodels: List<ManageServiceMI2.GLDWRStandardEx> = arrayListOf(),//品类
+        spotgoodsbrands: List<ManageServiceMI2.GLDDGFactoryItemEx> = arrayListOf(),
         wrsconvertdetails: List<ManageServiceMI2.WRSConvertDetailEx> = arrayListOf(),
         callback: (isCompleted: Boolean, err: Error?) -> Unit
     ) {

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

@@ -33,8 +33,8 @@ object CommodityAdapter {
         unitid: Long = 0,
         type: Int = 0,
         remark: String = "",
-        spotgoodsmodels: List<ManageServiceMI2.SpotGoodsModelEx> = arrayListOf(),
-        spotgoodsbrands: List<ManageServiceMI2.SpotGoodsBrandEx> = arrayListOf(),
+        spotgoodsmodels: List<ManageServiceMI2.GLDWRStandardEx> = arrayListOf(),//品类
+        spotgoodsbrands: List<ManageServiceMI2.GLDDGFactoryItemEx> = arrayListOf(),
         wrsconvertdetails: List<ManageServiceMI2.WRSConvertDetailEx> = arrayListOf()
     ): Packet50 {
         val builder = ManageServiceMI2.DeliveryGoodsApplyReq.newBuilder()
@@ -42,7 +42,7 @@ object CommodityAdapter {
             builder.deliverygoodscode = deliverygoodscode
             builder.deliverygoodsname = deliverygoodsname
         }
-        builder.wrstandardid = wrstandardid
+//        builder.wrstandardid = wrstandardid
         builder.type = type
         builder.unitid = unitid
         val loginInfo = GlobalDataCollection.instance?.loginRsp!!
@@ -56,11 +56,12 @@ object CommodityAdapter {
                 18
             )
         )
+        builder.version = "3.2"
         builder.loginid = loginInfo.loginID
         builder.userid = loginInfo.userID.toLong()
         builder.remark = remark
-        builder.addAllSpotgoodsbrands(spotgoodsbrands)
-        builder.addAllSpotgoodsmodels(spotgoodsmodels)
+        builder.addAllGldwrstandards(spotgoodsmodels)//品类
+        builder.addAllGlddgfactoryItems(spotgoodsbrands)//品牌
         builder.addAllWrsconvertdetails(wrsconvertdetails)
 
         val arrayOutputStream = ByteArrayOutputStream();

+ 3 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/contract/ContractManager.kt

@@ -9,6 +9,7 @@ import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.netcore.socket.Callback
 import cn.muchinfo.rma.protobuf.funcode.FunCode
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.guard
 import cn.muchinfo.rma.view.base.app.BaseResult
@@ -100,7 +101,7 @@ class ContractManager {
      * @param callback Function2<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] Error?, Unit>
      */
     fun orderPerationContract(
-        info: ErmcpMI1.ContractOperateApplyInfo = ErmcpMI1.ContractOperateApplyInfo.newBuilder().build(),
+        info: ManageServiceMI2.ContractOperateApplyInfo = ManageServiceMI2.ContractOperateApplyInfo.newBuilder().build(),
         operateType: Int = 0,
         remark: String = "",
         operateApplyID: Long = 0,
@@ -120,7 +121,7 @@ class ContractManager {
 
         tradeSocketManager.send(
             reqPacket,
-            FunCode.ContractOperateApplyRsp,
+            FunCode.ErmcpContractOperateApplyRsp,
             object : Callback<Packet50> {
                 override fun onSuccess(rsp: Packet50?) {
                     val rst = ContractAdapter.analysisPerationContractRsq(rsp!!)

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/business/contract/adapter/ContractAdapter.kt

@@ -202,16 +202,16 @@ object ContractAdapter {
      * @return Packet50
      */
     fun getPerationContractReqInfo(
-        info: ErmcpMI1.ContractOperateApplyInfo,
+        info: ManageServiceMI2.ContractOperateApplyInfo,
         operateType: Int = 0,
         remark: String = "",
         operateApplyID: Long = 0
     ): Packet50 {
-        val builder = ErmcpMI1.ContractOperateApplyReq.newBuilder()
+        val builder = ManageServiceMI2.ErmcpContractOperateApplyReq.newBuilder()
         val loginInfo = GlobalDataCollection.instance?.loginRsp!!
         builder.setHeader(
             MessageHeadModel.getHead(
-                FunCode.ContractOperateApplyReq,
+                FunCode.ErmcpContractOperateApplyReq,
                 loginInfo.userID,
                 GlobalDataCollection.instance?.accountId ?: 0,
                 0,
@@ -227,7 +227,7 @@ object ContractAdapter {
         builder.info = info
         val arrayOutputStream = ByteArrayOutputStream()
         builder.build().writeTo(arrayOutputStream)
-        return Packet50(FunCode.ContractOperateApplyReq, arrayOutputStream.toByteArray())
+        return Packet50(FunCode.ErmcpContractOperateApplyReq, arrayOutputStream.toByteArray())
     }
 
 
@@ -236,10 +236,10 @@ object ContractAdapter {
      * @param packet50 Packet50
      * @return Triple<Boolean, Error?, ErmcpMI1.ContractOperateApplyRsp?>
      */
-    fun analysisPerationContractRsq(packet50: Packet50) : Triple<Boolean, Error?, ErmcpMI1.ContractOperateApplyRsp?> {
+    fun analysisPerationContractRsq(packet50: Packet50) : Triple<Boolean, Error?, ManageServiceMI2.ErmcpContractOperateApplyRsp?> {
 
         return try {
-            val loginRsp = ErmcpMI1.ContractOperateApplyRsp.parseFrom(packet50.content)
+            val loginRsp = ManageServiceMI2.ErmcpContractOperateApplyRsp.parseFrom(packet50.content)
             if (loginRsp.retCode == 0) {
                 // 操作成功
                 Triple(true, null, loginRsp)

+ 28 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/future/FutureManager.kt

@@ -115,6 +115,34 @@ class FutureManager {
         )
     }
 
+
+    /**
+     * 查询期货商品组
+     * @param params Map<String, String> goodsCodes 商品代码列表,格式:CU2102,CU2103,AL2107
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] MiddleGoodsDetail?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryGoodsGroup(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<GoodsGroupData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryGoodsGroup",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<GoodsGroupData>>>() {
+                override fun onResponse(response: BaseResult<List<GoodsGroupData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
     /**
      * 把查询到的盘面信息依据outgoodscode插入暂存的商品盘面信息内
      * @param quoteList List<QuoteDayData>

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/HedgeManager.kt

@@ -79,7 +79,7 @@ class HedgeManager {
 
         tradeSocketManager.send(
             reqPacket,
-            FunCode.HedgePlanOperateRsp,
+            FunCode.ErmcpHedgePlanRsp,
             object : Callback<Packet50> {
                 override fun onSuccess(rsp: Packet50?) {
                     val rst = HedgeAdapter.analysisHedgeRsq(rsp!!)

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/HedgePlanInfo.kt

@@ -15,8 +15,8 @@ optional string PlanTime = 10; // string 计划时间
 data class HedgePlanInfo(
     var HedgePlanNo : String = "",
     var ContractType : Int = 0,
-    var AreaUserID : Int = 0,
-    var DeliveryGoodsID : Int = 0,
+    var AreaUserID : Long = 0,
+    var DeliveryGoodsID : Long = 0,
     var WrStandardID : Int = 0,
     var ProductType : Int = 0,
     var SpotGoodsDesc : String = "",

+ 27 - 22
RMA/app/src/main/java/cn/muchinfo/rma/business/hedge/adapter/HedgeAdapter.kt

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.business.hedge.adapter
 
+import android.icu.text.SimpleDateFormat
 import cn.muchinfo.rma.business.global.MessageHeadModel
 import cn.muchinfo.rma.business.hedge.HedgePlanInfo
 import cn.muchinfo.rma.global.ErrorMessageUtils
@@ -7,6 +8,8 @@ import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.netcore.packet.Packet50
 import cn.muchinfo.rma.protobuf.funcode.FunCode
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
+import com.blankj.utilcode.util.TimeUtils
 import java.io.ByteArrayOutputStream
 import java.lang.Exception
 import java.util.*
@@ -30,46 +33,48 @@ object HedgeAdapter {
         operateType : Int = 0,
         remark : String = ""
     ): Packet50 {
-        val builder = ErmcpMI1.HedgePlanOperateReq.newBuilder()
-        val hedgePlanInfoOrBuilder = ErmcpMI1.HedgePlanInfo.newBuilder()
+        val builder = ManageServiceMI2.ErmcpHedgePlanReq.newBuilder()
+//        val hedgePlanInfoOrBuilder = ErmcpMI1.HedgePlanInfo.newBuilder()
         hedgePlanData.let {
-            hedgePlanInfoOrBuilder.areaUserID = hedgePlanData.AreaUserID
-            hedgePlanInfoOrBuilder.contractType = hedgePlanData.ContractType
-            hedgePlanInfoOrBuilder.hedgePlanNo = hedgePlanData.HedgePlanNo
-            hedgePlanInfoOrBuilder.deliveryGoodsID = hedgePlanData.DeliveryGoodsID
-            hedgePlanInfoOrBuilder.wrStandardID = hedgePlanData.WrStandardID
-            hedgePlanInfoOrBuilder.productType = hedgePlanData.ProductType
-            hedgePlanInfoOrBuilder.spotGoodsDesc = hedgePlanData.SpotGoodsDesc
-            hedgePlanInfoOrBuilder.convertFactor = hedgePlanData.ConvertFactor
-            hedgePlanInfoOrBuilder.planTime = hedgePlanData.PlanTime
-            hedgePlanInfoOrBuilder.planQty = hedgePlanData.PlanQty
+            builder.hedgePlanNo = hedgePlanData.HedgePlanNo
+            builder.areaUserID = hedgePlanData.AreaUserID
+            builder.contractType = hedgePlanData.ContractType
+            builder.deliveryGoodsID = hedgePlanData.DeliveryGoodsID
+            builder.productType = hedgePlanData.ProductType
+            builder.spotGoodsDesc = hedgePlanData.SpotGoodsDesc
+            builder.convertFactor = hedgePlanData.ConvertFactor
+            builder.planTime = hedgePlanData.PlanTime
+            builder.planQty = hedgePlanData.PlanQty
         }
+
         val loginInfo = GlobalDataCollection.instance?.loginRsp
         // FIXME: - 250000000005
         builder.setHeader(
             MessageHeadModel.getHead(
-                FunCode.SpotContractOperateReq,
+                FunCode.ErmcpHedgePlanReq,
                 loginInfo?.userID ?: 0,
                 GlobalDataCollection.instance?.accountId ?: 0,
                 0,
                 18
             )
         )
+        builder.tradeDate = TimeUtils.getNowString(java.text.SimpleDateFormat("yyyyMMdd"))
+//        builder.setClientTicket(UUID.randomUUID().toString().replace("-", ""))
+//        if (operateType == 1 || operateType == 2){
+//            builder.info = hedgePlanInfoOrBuilder.build()
+//        }
 
-        builder.setClientTicket(UUID.randomUUID().toString().replace("-", ""))
-        if (operateType == 1 || operateType == 2){
-            builder.info = hedgePlanInfoOrBuilder.build()
-        }
-        builder.userID = loginInfo?.loginID ?: 0
         builder.remark = remark
         builder.operateType = operateType
-        builder.operateSrc = 2
+        builder.applySrc = 2
+        builder.applyId = loginInfo?.loginID ?: 0
+//        builder.operateSrc = 2
         if(hedgePlanID != 0L){
             builder.hedgePlanID = hedgePlanID
         }
         val arrayOutputStream = ByteArrayOutputStream();
         builder.build().writeTo(arrayOutputStream)
-        return Packet50(FunCode.HedgePlanOperateReq, arrayOutputStream.toByteArray())
+        return Packet50(FunCode.ErmcpHedgePlanReq, arrayOutputStream.toByteArray())
     }
 
 
@@ -78,9 +83,9 @@ object HedgeAdapter {
      * @param packet50 Packet50
      * @return Triple<Boolean, Error?, ErmcpMI1.SpotContractOperateRsp?>
      */
-    fun analysisHedgeRsq(packet50: Packet50): Triple<Boolean, Error?, ErmcpMI1.HedgePlanOperateRsp?> {
+    fun analysisHedgeRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.ErmcpHedgePlanRsp?> {
         return try {
-            val loginRsp = ErmcpMI1.HedgePlanOperateRsp.parseFrom(packet50.content)
+            val loginRsp = ManageServiceMI2.ErmcpHedgePlanRsp.parseFrom(packet50.content)
             if (loginRsp.retCode == 0) {
                 // 操作成功
                 Triple(true, null, loginRsp)

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

@@ -8,8 +8,8 @@ import android.os.Parcelable
  */
 data class DeliveryGoodsDetailData(
     val data : ErmcpDeliveryGoods? = ErmcpDeliveryGoods(),
-    val gblist : List<Ermcp3Brand>? = arrayListOf(),
-    val gmlist : List<ErmcpWrstandard>? = arrayListOf(),
+    val gblist : List<Ermcp3Brand>? = arrayListOf(),//品牌列表
+    val gmlist : List<ErmcpWrstandard>? = arrayListOf(),//品类列表(仓单标准)
     val goodslist : List<ErmcpRelatedGoods>? = arrayListOf(),
     val wrslist : List<WRSConverTDetail>? = arrayListOf()
 ) : Parcelable{

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

@@ -0,0 +1,31 @@
+package cn.muchinfo.rma.global.data
+
+/**
+ * 查询期货商品组
+ */
+data class GoodsGroupData(
+    val agreeunit: String? = "",//合约单位
+    val areauserid: String? = "",//所属机构id(套保品是有areauserid的,当要排除已配置商品组时需要areauserid过滤)
+    val canshort: String? = "",//是否允许做空[通道交易] - 0:不能做空 1:可以做空
+    val closepricemode: String? = "",//强平价格方式 - 1:市价 2:最新价 3:涨跌停(未实现)
+    val createtime: String? = "",//创建时间
+    val creatorid: String? = "",//创建人
+    val currencyid: String? = "",//报价货币ID
+    val decimalplace: String? = "",//报价小数位
+    val excludecfg: String? = "",//排除套保品已配置期货分类下的商品组(但显示已配置商品组) 1-排除
+    val exexchangeid: String? = "",//外部交易所ID[通道交易]
+    val goodsgroupid: String? = "",//商品组ID(自增ID)
+    val goodsgroupname: String? = "",//商品组名称
+    val goodsgroupstatus: String? = "",//商品组状态 - 1:正常 2:注销
+    val goodunitid: String? = "",//报价单位ID
+    val groupcategroyid: String? = "",//品种分类ID
+    val innerdealmode: String? = "",//内部成交方式[通道交易] - 1:净头寸 2:开平 3:平今
+    val marketid: String? = "",//所属市场ID
+    val modifierid: String? = "",//修改人
+    val modifytime: String? = "",//修改时间
+    val outerdealmode: String? = "",//外部成交方式[通道交易]- 1:净头寸 2:开平 3:平今
+    val outergroupcode: String? = "",//外部商品组代码[通道交易]
+    val quoteminunit: String? = "",//行情最小变动单位 [整数,报价小数位一起使用]
+    val quotesourcegroupid: String? = "",//所属行情源分组ID[参考行情市场用\通道交易]
+    val syncgoodsqty: String? = ""//同步合约数[通道交易-投资管理用] - 0表示不限
+)

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 464 - 464
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java


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

@@ -16,6 +16,7 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.AccountData
 import cn.muchinfo.rma.global.data.AvaildGoodsGroupData
+import cn.muchinfo.rma.global.data.GoodsGroupData
 import cn.muchinfo.rma.global.data.MiddleGoodsData
 import cn.muchinfo.rma.global.isBlankString
 
@@ -175,8 +176,8 @@ fun AppCompatActivity.creatHedgeBottomSheetDialog(
  */
 fun AppCompatActivity.creatGoodsHedgeBottomSheetDialog(
     titleStr: String,
-    selectList: List<MiddleGoodsData>,
-    select: (MiddleGoodsData.() -> Unit)? = null
+    selectList: List<GoodsGroupData>,
+    select: (GoodsGroupData.() -> Unit)? = null
 ) {
     val builder: QMUIBottomSheet.BottomListSheetBuilder =
         QMUIBottomSheet.BottomListSheetBuilder(this)
@@ -184,7 +185,7 @@ fun AppCompatActivity.creatGoodsHedgeBottomSheetDialog(
         .setTitle(titleStr)
         .setAddCancelBtn(true)
     selectList.forEach {
-        builder.addItem(it.middlegoodsname)
+        builder.addItem(it.goodsgroupname)
     }
     builder.setOnSheetItemClickListener { dialog, itemView, position, tag ->
         select?.invoke(selectList.get(position))

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

@@ -15,6 +15,8 @@ import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.home.commodity.newcommodity.SpotCategoryViewHolder
+import cn.muchinfo.rma.view.base.home.commodity.viewholder.AddSpotCategoryViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.viewholder.InsuredVarietyViewHolder
 import cn.muchinfo.rma.view.base.home.commodity.viewholder.SpotInfoData
 import cn.muchinfo.rma.view.base.home.commodity.viewholder.SpotModelViewHolder
@@ -39,10 +41,10 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
     /** 备注 **/
     lateinit var remask_edittext: EditText
 
-    /** 现货品种名称 **/
+    /** 商品名称 **/
     lateinit var spot_variety_name_edittext: EditText
 
-    /** 现货品种代码 **/
+    /** 商品代码 **/
     lateinit var spot_variety_code_edittext: EditText
 
     /** 现货品种代码 **/
@@ -62,9 +64,9 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
         intent.getParcelableExtra<WrStandardData>("data") as WrStandardData
     }
 
-    //型号适配
-    private val spotModelAdapter: BaseAdapter<SpotInfoData, SpotModelViewHolder> =
-        BaseAdapter { _, _ -> SpotModelViewHolder(this, viewModel, "1",operationType = type ?: "") }
+    //型号适配/////第三期修改为品类
+    private val spotModelAdapter: BaseAdapter<SpotInfoData, AddSpotCategoryViewHolder> =
+        BaseAdapter { _, _ -> AddSpotCategoryViewHolder(this, viewModel,operationType = type ?: "") }
 
     //品牌适配
     private val brandModelAdapter: BaseAdapter<SpotInfoData, SpotModelViewHolder> =
@@ -95,10 +97,10 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
             viewModel.brandModelList.postValue(beandModelList)
             val middleModelList = arrayListOf(SpotInfoData(id = "1"))
             viewModel.middlegoodList.postValue(middleModelList)
-            viewModel.queryMiddleGoodsList("1")
+            viewModel.queryGoodsGroup()
         } else {
-            viewModel.queryMiddleGoodsList("1")
-            viewModel.queryWrStandardDetails(data.wrstandardid ?: "")
+            viewModel.queryGoodsGroup()
+            viewModel.queryWrStandardDetails(data.deliverygoodsid ?: "")
         }
     }
 
@@ -319,7 +321,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
                                     value = ""
                                 )
                             }
-                            background = resources.getDrawable(R.color.white)
+                            background = resources.getDrawable(R.color.main_hit_bg_color)
                             gravity = Gravity.CENTER_VERTICAL
                             emptyView()
                             imageView {
@@ -328,7 +330,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
 
                             textView {
 
-                                text = "添加型号"
+                                text = "添加品类"
                                 textColorInt = R.color.rma_blue_color
                                 textSizeAuto = 31
                             }.lparams(wrapContent, wrapContent) {
@@ -530,21 +532,23 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
     }
 
     /**
-     * 型号列表
+     * 型号列表//三期修改为品类
+     * isAdd 是否是新增
      * @return List<ManageServiceMI2.SpotGoodsModelEx>
      */
-    private fun getSpotModelList(isAdd : Boolean = true): List<ManageServiceMI2.SpotGoodsModelEx> {
-        val spotgoodsmodels = arrayListOf<ManageServiceMI2.SpotGoodsModelEx>()
+    private fun getSpotModelList(isAdd : Boolean = true): List<ManageServiceMI2.GLDWRStandardEx> {
+        val spotgoodsmodels = arrayListOf<ManageServiceMI2.GLDWRStandardEx>()
         viewModel.spotModelcacheList.value?.forEach {
-            val spotGoodsData = ManageServiceMI2.SpotGoodsModelEx.newBuilder()
-            spotGoodsData.modelname = it.value
+            val spotGoodsData = ManageServiceMI2.GLDWRStandardEx.newBuilder()
+            spotGoodsData.wrstandardname = it.value
             if (isAdd){
-//                spotGoodsData.modelid = 0
+//                spotGoodsData.wrstandardid = it
             }else{
-                spotGoodsData.modelid = it.middleGoodsId.toLong()
+                spotGoodsData.wrstandardid = it.middleGoodsId.toLong()//修改时才加
             }
-            spotGoodsData.convertfactor = 1.0
-            LogUtils.eTag("asdhahsdkjahdjka",spotGoodsData.modelid)
+            spotGoodsData.unitid = it.enumdicnameid.toLong()
+            spotGoodsData.convertfactor = it.coefficientwarehouse.toDouble()
+//            LogUtils.eTag("asdhahsdkjahdjka",spotGoodsData.modelid)
             spotgoodsmodels.add(spotGoodsData.build())
         }
         return spotgoodsmodels
@@ -554,15 +558,15 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
      * 品牌列表
      * @return List<ManageServiceMI2.SpotGoodsModelEx>
      */
-    private fun getBrandModelList(isAdd : Boolean = true): List<ManageServiceMI2.SpotGoodsBrandEx> {
-        val brandgoodsmodels = arrayListOf<ManageServiceMI2.SpotGoodsBrandEx>()
+    private fun getBrandModelList(isAdd : Boolean = true): List<ManageServiceMI2.GLDDGFactoryItemEx> {
+        val brandgoodsmodels = arrayListOf<ManageServiceMI2.GLDDGFactoryItemEx>()
         viewModel.brandModelcacheList.value?.forEach {
-            val spotGoodsData = ManageServiceMI2.SpotGoodsBrandEx.newBuilder()
-            spotGoodsData.brandname = it.value
+            val spotGoodsData = ManageServiceMI2.GLDDGFactoryItemEx.newBuilder()
+            spotGoodsData.dgfactoryitemvalue = it.value
             if (isAdd.not()){
-                spotGoodsData.brandid = it.middleGoodsId.toLong()
+                spotGoodsData.dgfactoryitemid = it.middleGoodsId.toLong()
             }
-            LogUtils.eTag("asdhahsdkjahdjka",spotGoodsData.brandid)
+            LogUtils.eTag("asdhahsdkjahdjka",spotGoodsData.dgfactoryitemid)
             brandgoodsmodels.add(spotGoodsData.build())
         }
         return brandgoodsmodels
@@ -577,6 +581,7 @@ class AddSpotGoodsActivity : BaseActivity<CommodityInformationViewModel>() {
         viewModel.middlegoodCacheList.value?.forEach {
             val spotGoodsData = ManageServiceMI2.WRSConvertDetailEx.newBuilder()
             spotGoodsData.middlegoodsid = it.middleGoodsId.toLong()
+            spotGoodsData.unitid = it.enumdicnameid.toLong()
             spotGoodsData.convertratio = it.value.toDouble()
             middlegoodsmodels.add(spotGoodsData.build())
         }

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

@@ -40,7 +40,7 @@ class CommodityInformationViewModel : BaseViewModel() {
     /**
      * 套保品种正常列表
      */
-    val middleGoodsNormalList: MutableLiveData<List<MiddleGoodsData>> = MutableLiveData()
+    val middleGoodsNormalList: MutableLiveData<List<GoodsGroupData>> = MutableLiveData()
 
     /**
      * 现货品种详情
@@ -64,12 +64,12 @@ class CommodityInformationViewModel : BaseViewModel() {
     val brandModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
 
     /**
-     * 新增现货品种时的型号列表数据
+     * 新增现货品种时的型号列表数据(三期为品类)
      */
     val spotModelList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
 
     /**
-     * 暂存的型号列表数据
+     * 暂存的型号列表数据(三期为品类)
      */
     val spotModelcacheList: MutableLiveData<List<SpotInfoData>> = MutableLiveData()
 
@@ -102,19 +102,17 @@ class CommodityInformationViewModel : BaseViewModel() {
     /**
      * 变更记录列表
      */
-    val changeLogDataList : MutableLiveData<List<ChangeLogData>> = MutableLiveData()
+    val changeLogDataList: MutableLiveData<List<ChangeLogData>> = MutableLiveData()
 
     /**
      * 期货品种信息列表展示
      */
-    val showGgConvertConfigDataList : MutableLiveData<List<GGConvertConfigData>> = MutableLiveData()
+    val showGgConvertConfigDataList: MutableLiveData<List<GGConvertConfigData>> = MutableLiveData()
 
     /**
      * 变更记录列表
      */
-    val middleChangeLogDataList : MutableLiveData<List<MiddleGoodsChangeLogData>> = MutableLiveData()
-
-
+    val middleChangeLogDataList: MutableLiveData<List<MiddleGoodsChangeLogData>> = MutableLiveData()
 
 
     /**
@@ -178,7 +176,7 @@ class CommodityInformationViewModel : BaseViewModel() {
     fun queryGGConvertConfig(goodsgroupid: String = "") {
 
         val params = mutableMapOf<String, String>().apply {
-            if (goodsgroupid.isNotEmpty()){
+            if (goodsgroupid.isNotEmpty()) {
                 put("goodsgroupid", goodsgroupid)
             }
         }
@@ -197,18 +195,34 @@ class CommodityInformationViewModel : BaseViewModel() {
     }
 
     /**
+     * 查询期货商品组(原套保品种)
+     * @param wrstandardid String
+     */
+    fun queryGoodsGroup() {
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+//            put("deliverygoodsid", deliverygoodsid)
+        }
+        MyApplication.getInstance()?.futureManager?.queryGoodsGroup(params = params) { isSuccess, respData, _ ->
+            if (isSuccess) {
+                middleGoodsNormalList.postValue(respData)
+            }
+        }
+    }
+
+    /**
      * 获取剩下可选择的套保品种
      * @return List<MiddleGoodsData>
      */
-    fun getRemainingMiddleGoodsList() : List<MiddleGoodsData>{
+    fun getRemainingMiddleGoodsList(): List<GoodsGroupData> {
         val allSelectDataList = middleGoodsNormalList.value//所有可选择套保品种
         val middlegoodList = middlegoodList.value//列表数据已显示的套保品种
-        val newSelectDataList = arrayListOf<MiddleGoodsData>()//剩下的可选择套保品种
+        val newSelectDataList = arrayListOf<GoodsGroupData>()//剩下的可选择套保品种
         allSelectDataList?.forEach { data ->
 
         }
-        middlegoodList?.forEach {data ->
-            allSelectDataList?.remove { it.middlegoodsid == data.middleGoodsId }
+        middlegoodList?.forEach { data ->
+            allSelectDataList?.remove { it.goodsgroupid == data.middleGoodsId }
         }
 
         return allSelectDataList ?: arrayListOf()
@@ -219,34 +233,36 @@ class CommodityInformationViewModel : BaseViewModel() {
      * type 1为添加,2为删除 ,3为更换资料
      */
     fun changeMiddleGoodsList(
-        type: String,
-        id: String,
-        middlegoodsId: String = "",
+        type: String,//类型
+        id: String,//列表的下标id
+        middlegoodsId: String = "",//套保id
         ano: String = "",
         enumdicname: String = "",
+        enumdicnameid: String = "",
         middleGoodsName: String = ""
     ) {
         val oldDataCacheList = middlegoodCacheList.value?.toArrayList()
         val oldDataList = middlegoodList.value?.toArrayList()
         val newDataList = arrayListOf<SpotInfoData>()
-        if (type == "1") {
+        if (type == "1") {//增加一个套保品种
             oldDataCacheList?.forEach {
                 newDataList.add(it)
             }
             newDataList.add(SpotInfoData(id = id, value = ano, middleGoodsId = middlegoodsId))
             middlegoodList.postValue(newDataList)
-        } else if (type == "2") {
+        } else if (type == "2") {//删除相应的套保品种
             oldDataCacheList?.forEach {
                 if (id != it.id) {
                     newDataList.add(it.copy(id = oldDataCacheList.indexOf(it).plus(1).toString()))
                 }
             }
             middlegoodList.postValue(newDataList)
-        } else if (type == "3") {
+        } else if (type == "3") {//更换资料
             oldDataList?.forEach {
                 var newMiddlegoodsId = ""
                 var newEnumdicname = ""
                 var newMiddleGoodsName = ""
+                var newEnumdicnameid = ""
                 var newData: SpotInfoData
                 if (it.id == id) {
                     newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
@@ -264,11 +280,17 @@ class CommodityInformationViewModel : BaseViewModel() {
                     } else {
                         enumdicname
                     }
+                    newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
+                        it.enumdicname
+                    } else {
+                        enumdicnameid
+                    }
                     newData = it.copy(
                         id = id,
                         value = ano,
                         middleGoodsId = newMiddlegoodsId,
                         enumdicname = newEnumdicname,
+                        enumdicnameid = newEnumdicnameid,
                         middleGoodsName = newMiddleGoodsName
                     )
                     newDataList.add(newData)
@@ -277,13 +299,19 @@ class CommodityInformationViewModel : BaseViewModel() {
                 }
             }
             middlegoodCacheList.postValue(newDataList)
-        }else if (type == "4") {//用于选择套保品种
+        } else if (type == "4") {//用于选择套保品种
             oldDataList?.forEach {
                 var newMiddlegoodsId = ""
                 var newEnumdicname = ""
                 var newMiddleGoodsName = ""
+                var newEnumdicnameid = ""
                 var newData: SpotInfoData
                 if (it.id == id) {
+                    newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
+                        it.enumdicname
+                    } else {
+                        enumdicnameid
+                    }
                     newMiddlegoodsId = if (middlegoodsId.isNullOrEmpty()) {
                         it.middleGoodsId
                     } else {
@@ -302,6 +330,7 @@ class CommodityInformationViewModel : BaseViewModel() {
                     newData = it.copy(
                         id = id,
                         value = ano,
+                        enumdicnameid = newEnumdicnameid,
                         middleGoodsId = newMiddlegoodsId,
                         enumdicname = newEnumdicname,
                         middleGoodsName = newMiddleGoodsName
@@ -318,34 +347,116 @@ class CommodityInformationViewModel : BaseViewModel() {
     }
 
     /**
-     * 现货品种型号列表数据刷新
+     * 品类列表
      * type 1为添加,2为删除 ,3为更换资料
      */
-    fun changeSpotModelList(type: String, id: String, value: String) {
+    fun changeSpotModelList(
+        type: String,//类型
+        id: String,//列表下标id
+        value: String = "",//品类名称
+        enumdicname: String = "",//单位名称
+        enumdicnameid: String = "",//单位id
+        coefficientwarehouse: String = ""//标仓系数
+    ) {
         val oldDatacacheList = spotModelcacheList.value?.toArrayList()
         val oldDataList = spotModelList.value?.toArrayList()
         val newDataList = arrayListOf<SpotInfoData>()
-        if (type == "1") {
+        if (type == "1") {//新增
             oldDatacacheList?.forEach {
                 newDataList.add(it)
             }
             newDataList.add(SpotInfoData(id = id))
             spotModelList.postValue(newDataList)
-        } else if (type == "2") {
+        } else if (type == "2") {//删除
             oldDatacacheList?.forEach {
                 if (id != it.id) {
                     newDataList.add(it.copy(id = oldDatacacheList.indexOf(it).plus(1).toString()))
                 }
             }
             spotModelList.postValue(newDataList)
-        } else if (type == "3") {
+        } else if (type == "3") {//更换资料
             oldDataList?.forEach {
+                var newValue = ""
+                var newEnumdicnameid = ""
+                var newEnumdicname = ""
+                var newCoefficientwarehouse = ""
+                var newData: SpotInfoData
                 if (it.id == id) {
-                    newDataList.add(it.copy(value = value))
+                    newValue = if (value.isNullOrEmpty()) {
+                        it.value
+                    } else {
+                        value
+                    }
+                    newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
+                        it.enumdicnameid
+                    } else {
+                        enumdicnameid
+                    }
+                    newEnumdicname = if (newEnumdicname.isNullOrEmpty()) {
+                        it.enumdicname
+                    } else {
+                        enumdicname
+                    }
+                    newCoefficientwarehouse = if (coefficientwarehouse.isNullOrEmpty()) {
+                        it.coefficientwarehouse
+                    } else {
+                        coefficientwarehouse
+                    }
+                    newData = it.copy(
+                        id = id,
+                        value = newValue,
+                        enumdicname = newEnumdicname,
+                        coefficientwarehouse = newCoefficientwarehouse,
+                        enumdicnameid = newEnumdicnameid
+                    )
+                    newDataList.add(newData)
                 } else {
                     newDataList.add(it)
                 }
             }
+//            spotModelList.postValue(newDataList)
+            spotModelcacheList.postValue(newDataList)
+        }else if (type == "4") {//更换资料
+            oldDataList?.forEach {
+                var newValue = ""
+                var newEnumdicnameid = ""
+                var newEnumdicname = ""
+                var newCoefficientwarehouse = ""
+                var newData: SpotInfoData
+                if (it.id == id) {
+                    newValue = if (value.isNullOrEmpty()) {
+                        it.value
+                    } else {
+                        value
+                    }
+                    newEnumdicnameid = if (enumdicnameid.isNullOrEmpty()) {
+                        it.enumdicnameid
+                    } else {
+                        enumdicnameid
+                    }
+                    newEnumdicname = if (enumdicname.isNullOrEmpty()) {
+                        it.enumdicname
+                    } else {
+                        enumdicname
+                    }
+                    newCoefficientwarehouse = if (coefficientwarehouse.isNullOrEmpty()) {
+                        it.coefficientwarehouse
+                    } else {
+                        coefficientwarehouse
+                    }
+                    newData = it.copy(
+                        id = id,
+                        value = newValue,
+                        enumdicname = newEnumdicname,
+                        coefficientwarehouse = newCoefficientwarehouse,
+                        enumdicnameid = newEnumdicnameid
+                    )
+                    newDataList.add(newData)
+                } else {
+                    newDataList.add(it)
+                }
+            }
+            spotModelList.postValue(newDataList)
             spotModelcacheList.postValue(newDataList)
         }
 
@@ -432,36 +543,36 @@ class CommodityInformationViewModel : BaseViewModel() {
      */
     fun resetMiddleGoodsDataList(index: Int, status: String) {
         val datanewlist = arrayListOf<MiddleGoodsData>()
-        when (status) {
-            "0" -> {
-                middleGoodsDisableList.value?.forEach {
-                    if (index == middleGoodsDisableList.value?.indexOf(it)) {
-                        if (it.indexSelect == 0) {
-                            datanewlist.add(it.copy(indexSelect = 1))
-                        } else {
-                            datanewlist.add(it.copy(indexSelect = 0))
-                        }
-                    } else {
-                        datanewlist.add(it)
-                    }
-                }
-                middleGoodsDisableList.postValue(datanewlist)
-            }
-            "1" -> {
-                middleGoodsNormalList.value?.forEach {
-                    if (index == middleGoodsNormalList.value?.indexOf(it)) {
-                        if (it.indexSelect == 0) {
-                            datanewlist.add(it.copy(indexSelect = 1))
-                        } else {
-                            datanewlist.add(it.copy(indexSelect = 0))
-                        }
-                    } else {
-                        datanewlist.add(it)
-                    }
-                }
-                middleGoodsNormalList.postValue(datanewlist)
-            }
-        }
+//        when (status) {
+//            "0" -> {
+//                middleGoodsDisableList.value?.forEach {
+//                    if (index == middleGoodsDisableList.value?.indexOf(it)) {
+//                        if (it.indexSelect == 0) {
+//                            datanewlist.add(it.copy(indexSelect = 1))
+//                        } else {
+//                            datanewlist.add(it.copy(indexSelect = 0))
+//                        }
+//                    } else {
+//                        datanewlist.add(it)
+//                    }
+//                }
+//                middleGoodsDisableList.postValue(datanewlist)
+//            }
+//            "1" -> {
+//                middleGoodsNormalList.value?.forEach {
+//                    if (index == middleGoodsNormalList.value?.indexOf(it)) {
+//                        if (it.indexSelect == 0) {
+//                            datanewlist.add(it.copy(indexSelect = 1))
+//                        } else {
+//                            datanewlist.add(it.copy(indexSelect = 0))
+//                        }
+//                    } else {
+//                        datanewlist.add(it)
+//                    }
+//                }
+//                middleGoodsNormalList.postValue(datanewlist)
+//            }
+//        }
     }
 
     /**
@@ -494,15 +605,15 @@ class CommodityInformationViewModel : BaseViewModel() {
      * 查询现货品种详情
      * @param wrstandardid String
      */
-    fun queryWrStandardDetails(wrstandardid: String) {
+    fun queryWrStandardDetails(deliverygoodsid: String) {
         val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("wrstandardid", wrstandardid)
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+//            put("deliverygoodsid", deliverygoodsid)
         }
-        MyApplication.getInstance()?.commodityManager?.queryWrStandardDetail(params = params) { isSuccess, respData, _ ->
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
             if (isSuccess) {
-                wrStandardDetails.postValue(respData?.get(0))
-                initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
+//                wrStandardDetails.postValue(respData?.get(0))
+//                initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
             }
         }
     }
@@ -566,7 +677,7 @@ class CommodityInformationViewModel : BaseViewModel() {
                 if (status == "0") {
                     middleGoodsDisableList.postValue(newList)
                 } else if (status == "1") {
-                    middleGoodsNormalList.postValue(newList)
+//                    middleGoodsNormalList.postValue(newList)
                 }
             }
         }
@@ -757,7 +868,7 @@ class CommodityInformationViewModel : BaseViewModel() {
      * @param unitid Long 单位ID(修改时有值)
      * @param type Int 类型 1 新增 2 修改
      * @param remark String 备注
-     * @param spotgoodsmodels List<SpotGoodsModelEx> SpotGoodsModelEx 现货商品型号数据
+     * @param spotgoodsmodels List<SpotGoodsModelEx> SpotGoodsModelEx 现货商品型号数据/品类
      * @param spotgoodsbrands List<SpotGoodsBrandEx> SpotGoodsBrandEx 现货商品品牌数据
      * @param wrsconvertdetails List<WRSConvertDetailEx> WRSConvertDetailEx 现货商品折算配置明细数据
      */
@@ -768,8 +879,8 @@ class CommodityInformationViewModel : BaseViewModel() {
         unitid: Long = 0,
         type: Int = 0,
         remark: String = "",
-        spotgoodsmodels: List<ManageServiceMI2.SpotGoodsModelEx> = arrayListOf(),
-        spotgoodsbrands: List<ManageServiceMI2.SpotGoodsBrandEx> = arrayListOf(),
+        spotgoodsmodels: List<ManageServiceMI2.GLDWRStandardEx> = arrayListOf(),
+        spotgoodsbrands: List<ManageServiceMI2.GLDDGFactoryItemEx> = arrayListOf(),
         wrsconvertdetails: List<ManageServiceMI2.WRSConvertDetailEx> = arrayListOf(),
         isSuccess: (isCompleted: Boolean) -> Unit
     ) {
@@ -818,7 +929,7 @@ class CommodityInformationViewModel : BaseViewModel() {
             MyApplication.getInstance()?.commodityManager?.requestGoodsCancelReq(
                 wrstandardid = wrstandardid,
                 isvalid = isvalid
-            ){ isCompleted, err ->
+            ) { isCompleted, err ->
                 if (isCompleted) {
                     loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
                     isSuccess(true)
@@ -839,13 +950,13 @@ class CommodityInformationViewModel : BaseViewModel() {
      * 查询变更记录
      * @param RelatedId String
      */
-    fun queryChangeLog(RelatedId : String){
+    fun queryChangeLog(RelatedId: String) {
         val params = mutableMapOf<String, String>().apply {
             put("RelatedId", RelatedId)
         }
 
-        MyApplication.getInstance()?.commonManager?.queryChangeLog(params = params){isSuccess, respData, error ->
-            if (isSuccess){
+        MyApplication.getInstance()?.commonManager?.queryChangeLog(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
                 changeLogDataList.postValue(respData)
             }
         }
@@ -855,15 +966,15 @@ class CommodityInformationViewModel : BaseViewModel() {
      * 查询套保变更记录
      * @param RelatedId String
      */
-    fun queryMiddleGoodsChangeLog(middlegoodsid : String){
+    fun queryMiddleGoodsChangeLog(middlegoodsid: String) {
 
         val params = mutableMapOf<String, String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("middlegoodsid", middlegoodsid)
         }
 
-        MyApplication.getInstance()?.commonManager?.queryMiddleGoodsChangeLog(params = params){isSuccess, respData, error ->
-            if (isSuccess){
+        MyApplication.getInstance()?.commonManager?.queryMiddleGoodsChangeLog(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
                 respData?.toArrayList()?.sortWith(Comparator { t1, t2 ->
                     (TimeUtils.string2Millis(t2.updatetime) - TimeUtils.string2Millis(t1.updatetime)).toInt()
                 })

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/commodity/HedgeSpeciesUI.kt

@@ -200,7 +200,7 @@ class HedgeSpeciesNormalUI(
                         swipeToLayout.finishRefresh()
                     }
                     statusLayout.showSuccess()
-                    spotVarietiesNormalAdapter.setNewData(it)
+//                    spotVarietiesNormalAdapter.setNewData(it)
                 }
             }
         }

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

@@ -172,7 +172,7 @@ class NewSpotVarietiesUI(
     private val spotVarietiesNormalAdapter: BaseAdapter<DemoData, DemoViewHolder> = BaseAdapter { _, _ -> DemoViewHolder(activity, viewModel) }
 
     init {
-        viewModel.setDemoDataList()
+        viewModel.queryWrStandardDetails("")
     }
 
     val root = _FrameLayout(activity).apply {

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

@@ -123,6 +123,25 @@ class NewCommodityInformationViewModel : BaseViewModel() {
         hedgeSpeciesList.postValue(newhedgeSpeciesList)
     }
 
+    /**
+     * 查询现货品种详情
+     * @param wrstandardid String
+     */
+    fun queryWrStandardDetails(deliverygoodsid: String) {
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+//            put("deliverygoodsid", deliverygoodsid)
+        }
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoodsDetail(params = params) { isSuccess, respData, _ ->
+            if (isSuccess) {
+//                wrStandardDetails.postValue(respData?.get(0))
+//                initSpotGoodsActivity(respData?.get(0) ?: WrStandardDetail())
+            }
+        }
+    }
+
+
+
     fun setDemoDataList() {
         val demoList = arrayListOf<DemoData>()
         demoList.add(

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

@@ -0,0 +1,258 @@
+package cn.muchinfo.rma.view.base.home.commodity.viewholder
+
+import android.view.Gravity
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import androidx.appcompat.app.AppCompatActivity
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.commodity.CommodityInformationViewModel
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.contract.viewItemUI
+import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import org.jetbrains.anko.*
+import org.jetbrains.anko.sdk25.coroutines.textChangedListener
+
+/**
+ * 品类的viewholder
+ * @property activity AppCompatActivity
+ * @property viewModel CommodityInformationViewModel
+ * @property operationType String
+ * * operationType 1 是新增,2是修改,3是停用,4详情 5恢复
+ * @property itemSize IntArray
+ * @constructor
+ */
+class AddSpotCategoryViewHolder(
+    private val activity: AppCompatActivity,
+    private val viewModel: CommodityInformationViewModel,
+    private val operationType: String = ""
+) : BaseViewHolder<SpotInfoData>(activity) {
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+
+    /** 选择的单位 **/
+    val selectUnitType: MutableLiveData<SelectData> = MutableLiveData()
+
+    //输入的品类信息
+    lateinit var category_edittext : EditText
+
+    //输入的标仓系数
+    lateinit var coefficient_of_warehouse : EditText
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    data.bindOptional(context) {
+                        text = "品类" + dataIndex.plus(1)
+                    }
+
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    category_edittext = this
+                    isEnabled =
+                        !(operationType == "4" || operationType == "3" || operationType == "5")
+                    hint = "请输入品类"
+                    textChangedListener {
+                        afterTextChanged {
+                            if (it.toString().isNotEmpty()) {//修改品类
+                                viewModel.changeSpotModelList(id = dataIndex.plus(1).toString(),type = "3",value = it.toString())
+                            }
+                        }
+                    }
+                    data.bindOptional(context) {
+                        setText(it?.value)
+                    }
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(autoSize(300), autoSize(132)) {
+                    marginStart = autoSize(40)
+                }
+
+                emptyView()
+
+                imageView {
+                    isEnabled =
+                        !(operationType == "4" || operationType == "3" || operationType == "5")
+                    onThrottleFirstClick {
+                        if (viewModel.spotModelList.value?.size.toString() == "1"){
+                            ToastUtils.showLong("最少输入一个品类")
+                            return@onThrottleFirstClick
+                        }
+                        viewModel.changeSpotModelList("2",dataIndex.plus(1).toString(),value = "")
+                    }
+                    imageResource = R.mipmap.rma_delete
+                }.lparams(autoSize(30), autoSize(30)) {
+                    marginEnd = autoSize(31)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            viewItemUI()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                viewModel.wrStandardDetails.bindOptional(context) { data ->
+                    selectUnitType.postValue(
+                        SelectData(
+                            id = data?.wrd?.unitid ?: "",
+                            value = data?.wrd?.enumdicname ?: ""
+                        )
+                    )
+                }
+                onThrottleFirstClick {
+                    //对于修改,停用,复用的操作不能选择
+                    if (operationType == "4" || operationType == "3" || operationType == "5") {
+                        return@onThrottleFirstClick
+                    }
+                    val selectDataList = arrayListOf(
+                        SelectData(
+                            id = "1",
+                            value = "吨"
+                        ),
+                        SelectData(
+                            id = "2",
+                            value = "千克"
+                        ), SelectData(
+                            id = "3",
+                            value = "克"
+                        ),
+                        SelectData(
+                            id = "4",
+                            value = "股"
+                        ),
+                        SelectData(
+                            id = "6",
+                            value = "张"
+                        ),
+                        SelectData(
+                            id = "7",
+                            value = "桶"
+                        )
+                    )
+                    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)
+                    }
+                }
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    text = "单位"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.enumdicname
+                        textColorInt = R.color.rma_black_33
+                    }
+//                    selectUnitType.bindOptional(context) {
+//                        text = it?.value
+//                        textColorInt = R.color.rma_black_33
+//                    }
+                    text = "请选择单位"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(80)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(36), autoSize(36)) {
+                    marginEnd = autoSize(25)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            viewItemUI()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    data.bindOptional(context) {
+                        text = "标仓系数" + dataIndex.plus(1)
+                    }
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    coefficient_of_warehouse = this
+                    isEnabled =
+                        !(operationType == "4" || operationType == "3" || operationType == "5")
+                    data.bindOptional(context) {
+                        setText(it?.coefficientwarehouse)
+                        LogUtils.eTag("hkjahdjkahjksdha",dataIndex.toString() + "------" +it?.coefficientwarehouse)
+                        textColorInt = R.color.rma_black_33
+                    }
+                    hint = "请输入标仓系数"
+                    textChangedListener {
+                        afterTextChanged {
+                            if (it.toString().isNotEmpty()) {
+                                viewModel.changeSpotModelList(
+                                    "3",
+                                    dataIndex.plus(1).toString(),
+                                    coefficientwarehouse = it.toString()
+                                )
+                            }
+                        }
+                    }
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(autoSize(300), autoSize(132)) {
+                    marginStart = autoSize(60)
+                }
+            }.lparams(matchParent, wrapContent)
+        }
+    }
+
+}

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

@@ -45,7 +45,7 @@ class InsuredVarietyViewHolder(
                     }
 
                     activity.creatGoodsHedgeBottomSheetDialog("请选择套保品种", viewModel.getRemainingMiddleGoodsList()) {
-                        viewModel.changeMiddleGoodsList(type = "4",id = dataIndex.plus(1).toString(),ano = "",middlegoodsId = this.middlegoodsid ?: "",enumdicname = this.enumdicname ?: "",middleGoodsName = this.middlegoodsname ?: "")
+                        viewModel.changeMiddleGoodsList(type = "4",id = dataIndex.plus(1).toString(),ano = "",middlegoodsId = this.goodsgroupid ?: "",enumdicnameid = this.goodunitid ?: "",enumdicname = this.goodunitid ?: "" ?: "",middleGoodsName = this.goodsgroupname ?: "")
                     }
                 }
                 textView {
@@ -104,8 +104,8 @@ class InsuredVarietyViewHolder(
                 textView {
                     data.bindOptional(context){data ->
                         viewModel.middleGoodsNormalList.value?.forEach {
-                            if (data?.middleGoodsId == it.middlegoodsid){
-                                text = it.enumdicname
+                            if (data?.middleGoodsId == it.goodsgroupid){
+                                text = it.goodunitid ?: ""
                                 textColorInt = R.color.rma_black_33
                             }
                         }

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

@@ -5,8 +5,10 @@ package cn.muchinfo.rma.view.base.home.commodity.viewholder
  */
 data class SpotInfoData(
     var id : String = "",//用来区分的id
-    var value: String = "",//输入的型号或者品牌 是套保品牌是此字段代表套保系数
+    var value: String = "",//输入的型号(三期为品类)或者品牌 是套保品牌是此字段代表套保系数
+    var coefficientwarehouse : String = "",//用于输入品类时的标仓系数
     var middleGoodsId : String = "",//存储套保品种时用来存储套保品种id,其他情况此字段不使用
-    var enumdicname : String = "",//单位
+    var enumdicname : String = "",//单位名称
+    var enumdicnameid : String = "",//单位id
     var middleGoodsName : String = ""//套保品种名称
 )

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

@@ -483,9 +483,9 @@ class AddHedgePlanActivity : BaseActivity<HedgePlanViewModel>() {
             hedgePlanInfo.HedgePlanNo = planNameEdittext.text.toString()
         }
 
-        hedgePlanInfo.DeliveryGoodsID = selectWrStandardData.value?.deliverygoodsid?.toInt()!!
+        hedgePlanInfo.DeliveryGoodsID = selectWrStandardData.value?.deliverygoodsid?.toLong() ?: 0
         hedgePlanInfo.WrStandardID = selectWrStandardData.value?.id?.toInt()!!
-        hedgePlanInfo.AreaUserID = GlobalDataCollection.instance?.loginRsp?.userID ?: 0
+        hedgePlanInfo.AreaUserID = GlobalDataCollection.instance?.loginRsp?.userID?.toLong() ?: 0
         hedgePlanInfo.ProductType = 1//写死为1产品类型
         hedgePlanInfo.SpotGoodsDesc = "咳咳咳"
 

+ 12 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/hedge/HedgePlanViewModel.kt

@@ -3,6 +3,7 @@ package cn.muchinfo.rma.view.base.home.hedge
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.business.hedge.HedgePlanInfo
 import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.DeliveryGoodsData
 import cn.muchinfo.rma.global.data.HedgePlanData
 import cn.muchinfo.rma.global.data.WrStandardData
 import cn.muchinfo.rma.netManage.base.InteractiveException
@@ -41,7 +42,7 @@ class HedgePlanViewModel : BaseViewModel() {
     /**
      * 现货品种列表
      */
-    val wrStandardDataList: MutableLiveData<List<WrStandardData>> = MutableLiveData()
+    val wrStandardDataList: MutableLiveData<List<DeliveryGoodsData>> = MutableLiveData()
 
 
     /**
@@ -106,13 +107,13 @@ class HedgePlanViewModel : BaseViewModel() {
      */
     fun queryHedegList(type: String) {
         val params = mutableMapOf<String, String>().apply {
-            put("userId", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             if (type == "0"){
-                put("HedgePlanStatus", "0,6")
+                put("hedgeplanstatus", "0,6")
             } else if (type == "1"){
-                put("HedgePlanStatus", "1,4")
+                put("hedgeplanstatus", "1,4")
             }else{
-                put("HedgePlanStatus", type)
+                put("hedgeplanstatus", type)
             }
 
         }
@@ -151,10 +152,10 @@ class HedgePlanViewModel : BaseViewModel() {
      */
     fun queryWrStandardList() {
         val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("status", "1")
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+//            put("excludecfg  ", "1")
         }
-        MyApplication.getInstance()?.commodityManager?.queryWrStandard(params) { isSuccess, respData, error ->
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoods(params) { isSuccess, respData, error ->
             if (isSuccess) {
                 wrStandardDataList.postValue(respData)
             }
@@ -166,13 +167,13 @@ class HedgePlanViewModel : BaseViewModel() {
      * @param dataList List<UserInfoData>
      * @return ArrayList<SelectData>
      */
-    fun selectSpotVarietiesList(dataList: List<WrStandardData>): ArrayList<SelectData> {
+    fun selectSpotVarietiesList(dataList: List<DeliveryGoodsData>): ArrayList<SelectData> {
         val newSpotVarietiesList = arrayListOf<SelectData>()
         dataList.forEach {
             newSpotVarietiesList.add(
                 SelectData(
-                    id = it.wrstandardid ?: "",
-                    value = it.wrstandardname ?: "",
+                    id = it.deliverygoodsid ?: "",
+                    value = it.deliverygoodsname ?: "",
                     deliverygoodsid = it.deliverygoodsid ?: "",
                     areauserid = it.areauserid ?: "",
                     enumdicname = it.enumdicname ?: ""

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

@@ -15,6 +15,7 @@ import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.netManage.utils.UpLoadUtils
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.photopicter.PhotoUtils
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -620,10 +621,10 @@ class InvoiceRegistrationActivity : BaseActivity<RegistrationViewModel>() {
      * 获取合同操作info
      * @return ErmcpMI1.ContractOperateApplyInfo
      */
-    private fun getPerationContractInfo(): ErmcpMI1.ContractOperateApplyInfo {
+    private fun getPerationContractInfo(): ManageServiceMI2.ContractOperateApplyInfo {
         val json = JSONObject()
         json.put("InvoiceAmount",amount_edittext.text.toString().toDouble())
-        val contractInfobuilder = ErmcpMI1.ContractOperateApplyInfo.newBuilder()
+        val contractInfobuilder = ManageServiceMI2.ContractOperateApplyInfo.newBuilder()
 
         contractInfobuilder.relatedID = data.spotcontractid?.toLong() ?: 0// 现货合同ID
         contractInfobuilder.operateApplyType = 4//款项

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

@@ -12,6 +12,7 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.ViewEnumUtils
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -592,11 +593,11 @@ class MidpointsRegistrationActivity : BaseActivity<RegistrationViewModel>() {
      * @param qty String 数量   价格和数量都要用double类型,否则会报错
      * @return ErmcpMI1.ContractOperateApplyInfo
      */
-    private fun getPerationContractInfo(price : String,qty : String) : ErmcpMI1.ContractOperateApplyInfo {
+    private fun getPerationContractInfo(price : String,qty : String) : ManageServiceMI2.ContractOperateApplyInfo {
         val json = JSONObject()
         json.put("PricedPrice",price.toDouble())
         json.put("PricedQty",qty.toDouble())
-        val contractInfobuilder = ErmcpMI1.ContractOperateApplyInfo.newBuilder()
+        val contractInfobuilder = ManageServiceMI2.ContractOperateApplyInfo.newBuilder()
         contractInfobuilder.relatedID = data.spotcontractid?.toLong() ?: 0
         contractInfobuilder.operateApplyType = 1
         contractInfobuilder.detailJson = ByteString.copyFrom(json.toString().toByteArray())

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

@@ -12,6 +12,7 @@ import cn.muchinfo.rma.global.ViewEnumUtils
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -672,14 +673,14 @@ class PaymentRegistrationActivity : BaseActivity<RegistrationViewModel>() {
      * 获取合同操作info
      * @return ErmcpMI1.ContractOperateApplyInfo
      */
-    private fun getPerationContractInfo(): ErmcpMI1.ContractOperateApplyInfo {
+    private fun getPerationContractInfo(): ManageServiceMI2.ContractOperateApplyInfo {
         val json = JSONObject()
         if (pay_checkbox.isChecked){
             json.put("PayAmount",registration_amount_edittext.text.toString().toDouble())
         }else if (refund_checkbox.isChecked){
             json.put("DeductAmount",registration_amount_edittext.text.toString().toDouble())
         }
-        val contractInfobuilder = ErmcpMI1.ContractOperateApplyInfo.newBuilder()
+        val contractInfobuilder = ManageServiceMI2.ContractOperateApplyInfo.newBuilder()
 
         contractInfobuilder.relatedID = data.spotcontractid?.toLong() ?: 0// 现货合同ID
         contractInfobuilder.operateApplyType = 3//款项

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

@@ -8,6 +8,7 @@ import cn.muchinfo.rma.global.data.WarehouseInfoData
 import cn.muchinfo.rma.global.data.WrStandardDetail
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
 import com.blankj.utilcode.util.ToastUtils
@@ -49,7 +50,7 @@ class RegistrationViewModel : BaseViewModel(){
      * @param isSuccess Function1<[@kotlin.ParameterName] Boolean, Unit>
      */
     fun orderPerationContract(
-        info: ErmcpMI1.ContractOperateApplyInfo,
+        info: ManageServiceMI2.ContractOperateApplyInfo,
         operateType: Int = 0,
         remark: String = "",
         isSuccess: (isCompleted: Boolean) -> Unit

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

@@ -12,6 +12,7 @@ import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.ViewEnumUtils
 import cn.muchinfo.rma.global.data.ContractData
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -912,7 +913,7 @@ class SettlementRegistrationActivity : BaseActivity<RegistrationViewModel>() {
      * 获取合同操作info
      * @return ErmcpMI1.ContractOperateApplyInfo
      */
-    private fun getPerationContractInfo(): ErmcpMI1.ContractOperateApplyInfo {
+    private fun getPerationContractInfo(): ManageServiceMI2.ContractOperateApplyInfo {
         val json = JSONObject()
         if (determine_edittext.text.toString().isNotEmpty()) {
             json.put("ReckonRealQty", determine_edittext.text.toString().toDouble())
@@ -935,7 +936,7 @@ class SettlementRegistrationActivity : BaseActivity<RegistrationViewModel>() {
             }
 
         }
-        val contractInfobuilder = ErmcpMI1.ContractOperateApplyInfo.newBuilder()
+        val contractInfobuilder = ManageServiceMI2.ContractOperateApplyInfo.newBuilder()
 
         contractInfobuilder.relatedID = data.spotcontractid?.toLong() ?: 0// 现货合同ID
         contractInfobuilder.operateApplyType = 2//交收

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels