瀏覽代碼

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

Liu.bolan 4 年之前
父節點
當前提交
9233dc8f3d
共有 26 個文件被更改,包括 2333 次插入285 次删除
  1. 8 2
      RMA/app/src/main/AndroidManifest.xml
  2. 1 2
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  3. 14 9
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  4. 25 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/commodity/CommodityManager.kt
  5. 6 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccMgrBizGroupSetData.kt
  6. 81 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/DeliveryGoodsData.kt
  7. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/loginQeruy/LoginAccount.kt
  8. 181 181
      RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java
  9. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  10. 4 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeFragment.kt
  11. 396 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureAccountActivity.kt
  12. 240 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureSonAccountActivity.kt
  13. 12 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/FutureAccountViewModel.kt
  14. 178 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/FutureCreditActivity.kt
  15. 48 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureAccountRoleViewHolder.kt
  16. 252 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureRoleActivity.kt
  17. 65 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureRoleItemViewHolder.kt
  18. 7 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureAccountViewholder.kt
  19. 161 15
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetActivity.kt
  20. 85 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetViewHolder.kt
  21. 259 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetViewModel.kt
  22. 0 35
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddSpotMarketPriceActivity.kt
  23. 295 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/AddSpotMarketPriceActivity.kt
  24. 9 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceActivity.kt
  25. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt
  26. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewModel.kt

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

@@ -228,9 +228,9 @@
 
         <activity android:name=".view.base.home.rolemanagement.AddRoleSetActivity"/>
 
-        <activity android:name=".view.base.home.contract.SpotMarketPriceActivity"/>
+        <activity android:name=".view.base.home.spotmarket.SpotMarketPriceActivity"/>
 
-        <activity android:name=".view.base.home.contract.AddSpotMarketPriceActivity"/>
+        <activity android:name=".view.base.home.spotmarket.AddSpotMarketPriceActivity"/>
 
         <activity android:name=".view.base.home.commodity.newcommodity.NewCommodityInformationActivity"/>
 
@@ -247,6 +247,12 @@
         <activity android:name=".view.base.home.accountmanager.futureset.FutureSetActivity"/>
 
         <activity android:name=".view.base.home.accountmanager.futureset.AddFutureRoleActivity"/>
+
+        <activity android:name=".view.base.home.accountmanager.futureaccount.AddFutureAccountActivity"/>
+
+        <activity android:name=".view.base.home.accountmanager.futureaccount.AddFutureSonAccountActivity"/>
+
+        <activity android:name=".view.base.home.accountmanager.futureaccount.FutureCreditActivity"/>
     </application>
 
 </manifest>

+ 1 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt

@@ -630,7 +630,6 @@ class AccountManager {
         SpotGoods : List<ManageServiceMI2.ErmcpBizGroupSpotGoods>,
         TAAccount : List<ManageServiceMI2.ErmcpBizGroupTAAccount>,
         OptType : Int = 0,
-        AreaUserID : Long = 0,
         callback: (isCompleted: Boolean, err: Error?) -> Unit
     ){
         val tradeSocketManager = MyApplication.getInstance()?.tradeSocketManager.guard {
@@ -639,7 +638,7 @@ class AccountManager {
         }
 
         val reqPacket = AccountAdapter.getErmcpBizGroupReqInfo(
-            BizGroupID, BizType, Remark, ApplySrc, SpotGoods, TAAccount, OptType, AreaUserID
+            BizGroupID, BizType, Remark, ApplySrc, SpotGoods, TAAccount, OptType
         )
 
         tradeSocketManager.send(

+ 14 - 9
RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt

@@ -10,6 +10,7 @@ import cn.muchinfo.rma.protobuf.funcode.FunCode
 import cn.muchinfo.rma.protobuf.protoclasses.ErmcpMI1
 import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.protobuf.protoclasses.SystemMI1
+import com.blankj.utilcode.util.LogUtils
 import com.google.protobuf.ByteString
 import java.io.ByteArrayOutputStream
 import java.lang.Exception
@@ -176,6 +177,7 @@ class AccountAdapter {
             builder.setLoginID(loginInfo.loginID)
             builder.setToken(GlobalDataCollection.instance?.loginRsp?.token)
             builder.setHeader(MessageHeadModel.getHead(FunCode.LOGOUTREQ, 0, 0, 0, 0))
+            LogUtils.eTag("65539userid",MessageHeadModel.getHead(FunCode.LOGOUTREQ, 0, 0, 0, 0))
             val arrayOutputStream = ByteArrayOutputStream();
             builder.build().writeTo(arrayOutputStream)
 
@@ -343,8 +345,7 @@ class AccountAdapter {
             ApplySrc : Int = 2,
             SpotGoods : List<ManageServiceMI2.ErmcpBizGroupSpotGoods>,
             TAAccount : List<ManageServiceMI2.ErmcpBizGroupTAAccount>,
-            OptType : Int = 0,
-            AreaUserID : Long = 0
+            OptType : Int = 0
         ) : Packet50{
             val builder = ManageServiceMI2.ErmcpBizGroupReq.newBuilder()
             val loginInfo = GlobalDataCollection.instance?.loginRsp!!
@@ -362,13 +363,15 @@ class AccountAdapter {
                 builder.bizGroupID = BizGroupID
             }
             builder.bizType = BizType
-            builder.remark = Remark
+            if (Remark.isNotEmpty()){
+                builder.remark = Remark
+            }
             builder.applySrc = ApplySrc
             builder.applyId = loginInfo.loginID
             builder.addAllSpotGoods(SpotGoods)
             builder.addAllTAAccount(TAAccount)
             builder.optType = OptType
-            builder.areaUserID = AreaUserID
+            builder.areaUserID = loginInfo.userID.toLong()
 
             val arrayOutputStream = ByteArrayOutputStream()
             builder.build().writeTo(arrayOutputStream)
@@ -382,13 +385,15 @@ class AccountAdapter {
          */
         fun analysisErmcpBizGroupRsq(packet50: Packet50): Triple<Boolean, Error?, ManageServiceMI2.ErmcpBizGroupRsp?> {
             return try {
-                val loginRsp = ManageServiceMI2.ErmcpBizGroupRsp.parseFrom(packet50.content)
-                if (loginRsp.retCode == 0) {
+                val resultRsp = ManageServiceMI2.ErmcpBizGroupRsp.parseFrom(packet50.content)
+                if (resultRsp.retCode == 0) {
                     // 操作成功
-                    Triple(true, null, loginRsp)
-                } else {
+                    Triple(true, null, resultRsp)
+                } else if (resultRsp.retCode == -1){
+                    Triple(false,  Error(resultRsp.retDesc), null)
+                } else{
                     // 操作失败
-                    Triple(false, Error(ErrorMessageUtils.getErrorString(loginRsp.retCode)), null)
+                    Triple(false, Error(ErrorMessageUtils.getErrorString(resultRsp.retCode)), null)
                 }
             } catch (e: Exception) {
                 // 操作失败

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

@@ -49,6 +49,31 @@ class CommodityManager {
     }
 
     /**
+     * /Ermcp3/QueryDeliveryGoods 查询现货商品
+     */
+    fun queryDeliveryGoods(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<DeliveryGoodsData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryDeliveryGoods",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<DeliveryGoodsData>>>() {
+                override fun onResponse(response: BaseResult<List<DeliveryGoodsData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
      * 查询现货商品详情(菜单:现货品种/现货品种详情)
      * @param params Map<String, String>
      * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] WrStandardDetail?, [@kotlin.ParameterName] Error?, Unit>

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

@@ -16,14 +16,16 @@ data class AccMgrBizGroupSetData(
     val biztype : String? = "",//业务类型 1-套保 2-套利
     var wrName : String? = "",//合并起来的现货名称
     val acclist : List<Acclist>? = arrayListOf(),
-    val wrlist : List<Wrlist>? = arrayListOf()
+    val wrlist : List<Wrlist>? = arrayListOf(),
+    var indexSelect : Int = 0
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
         parcel.createTypedArrayList(Acclist),
-        parcel.createTypedArrayList(Wrlist)
+        parcel.createTypedArrayList(Wrlist),
+        parcel.readInt()
     ) {
     }
 
@@ -33,6 +35,7 @@ data class AccMgrBizGroupSetData(
         parcel.writeString(wrName)
         parcel.writeTypedList(acclist)
         parcel.writeTypedList(wrlist)
+        parcel.writeInt(indexSelect)
     }
 
     override fun describeContents(): Int {
@@ -49,6 +52,7 @@ data class AccMgrBizGroupSetData(
         }
     }
 
+
 }
 
 /**

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

@@ -0,0 +1,81 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * /Ermcp3/QueryDeliveryGoods查询现货商品
+ */
+data class DeliveryGoodsData(
+    val agreeunit : String? = "",//合约单位[散货时默认为1, 整装时默认为标准数量]
+    val areauserid :String? = "",//所属机构
+    val auditflag : String? = "",//交割是否需要审核 - 0:不需要 1:需要审核 默认为0
+    val categoryid : String? = "",//类别ID(SEQ_WRCATEGORY)
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsid : String? = "",//现货品种ID(SEQ_DELIVERYGOODS)
+    val deliverygoodsname : String? = "",//现货品种名称
+    val deliverygoodstype : String? = "",//现货品种类型: 1-整装不拆分 2-散装记录明细 3:整装拆分 4:散装不记录明细
+    val dgstatus : String? = "",//品种状态 - 作废 - 0:未激活 1:正常
+    val enumdicname : String? = "",//现货品种单位名称
+    val goodsunitid : String? = "",//现货品种单位ID
+    val isvalid : String? = "",//是否有效 - 0:无效 1:有效
+    val qtydecimalplace : String? = "",//成交量小数位
+    val standardqty : String? = "",//标准数量(库位数量) [标准品特有]
+    val standardqtyrange : String? = "",//标准数量偏差范围 [标准品特有]
+    var indexSelect : Int = 0
+) : 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(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(agreeunit)
+        parcel.writeString(areauserid)
+        parcel.writeString(auditflag)
+        parcel.writeString(categoryid)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(deliverygoodstype)
+        parcel.writeString(dgstatus)
+        parcel.writeString(enumdicname)
+        parcel.writeString(goodsunitid)
+        parcel.writeString(isvalid)
+        parcel.writeString(qtydecimalplace)
+        parcel.writeString(standardqty)
+        parcel.writeString(standardqtyrange)
+        parcel.writeInt(indexSelect)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<DeliveryGoodsData> {
+        override fun createFromParcel(parcel: Parcel): DeliveryGoodsData {
+            return DeliveryGoodsData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<DeliveryGoodsData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/global/data/account/loginQeruy/LoginAccount.kt

@@ -15,7 +15,7 @@ data class LoginAccount(
     var loginport: Int = 0, // 最新登录端口
     var loginstatus: Int = 0, // 登录账号状态 1:正常 2:冻结 3:无效
     var loginusertype: Int = 0, // 登录账号类型 - 1:投资者 2:机构交易员
-    var modifierid: Int = 0, // 修改人
+    var modifierid: Long = 0, // 修改人
     var modifytime: String = "", // 修改时间
     var pwdwrongcount: Int = 0, // 密码错误次数
     var taaccountrighttype: Int = 0, // 资金账号权限类型 - 1:不选默认为所有权限 2:不选默认为无权限

+ 181 - 181
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java

@@ -43246,22 +43246,22 @@ public final class ManageServiceMI2 {
 
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return Whether the wRStandardID field is set.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return Whether the deliveryGoodsID field is set.
      */
-    boolean hasWRStandardID();
+    boolean hasDeliveryGoodsID();
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return The wRStandardID.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return The deliveryGoodsID.
      */
-    long getWRStandardID();
+    long getDeliveryGoodsID();
   }
   /**
    * <pre>
@@ -43320,7 +43320,7 @@ public final class ManageServiceMI2 {
             }
             case 16: {
               bitField0_ |= 0x00000002;
-              wRStandardID_ = input.readUInt64();
+              deliveryGoodsID_ = input.readUInt64();
               break;
             }
             default: {
@@ -43383,31 +43383,31 @@ public final class ManageServiceMI2 {
       return bizType_;
     }
 
-    public static final int WRSTANDARDID_FIELD_NUMBER = 2;
-    private long wRStandardID_;
+    public static final int DELIVERYGOODSID_FIELD_NUMBER = 2;
+    private long deliveryGoodsID_;
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return Whether the wRStandardID field is set.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return Whether the deliveryGoodsID field is set.
      */
     @java.lang.Override
-    public boolean hasWRStandardID() {
+    public boolean hasDeliveryGoodsID() {
       return ((bitField0_ & 0x00000002) != 0);
     }
     /**
      * <pre>
-     * uint64 �ֻ���ƷID
+     * uint64 Ʒ��ID
      * </pre>
      *
-     * <code>optional uint64 WRStandardID = 2;</code>
-     * @return The wRStandardID.
+     * <code>optional uint64 DeliveryGoodsID = 2;</code>
+     * @return The deliveryGoodsID.
      */
     @java.lang.Override
-    public long getWRStandardID() {
-      return wRStandardID_;
+    public long getDeliveryGoodsID() {
+      return deliveryGoodsID_;
     }
 
     private byte memoizedIsInitialized = -1;
@@ -43428,7 +43428,7 @@ public final class ManageServiceMI2 {
         output.writeInt32(1, bizType_);
       }
       if (((bitField0_ & 0x00000002) != 0)) {
-        output.writeUInt64(2, wRStandardID_);
+        output.writeUInt64(2, deliveryGoodsID_);
       }
       unknownFields.writeTo(output);
     }
@@ -43445,7 +43445,7 @@ public final class ManageServiceMI2 {
       }
       if (((bitField0_ & 0x00000002) != 0)) {
         size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(2, wRStandardID_);
+          .computeUInt64Size(2, deliveryGoodsID_);
       }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
@@ -43467,10 +43467,10 @@ public final class ManageServiceMI2 {
         if (getBizType()
             != other.getBizType()) return false;
       }
-      if (hasWRStandardID() != other.hasWRStandardID()) return false;
-      if (hasWRStandardID()) {
-        if (getWRStandardID()
-            != other.getWRStandardID()) return false;
+      if (hasDeliveryGoodsID() != other.hasDeliveryGoodsID()) return false;
+      if (hasDeliveryGoodsID()) {
+        if (getDeliveryGoodsID()
+            != other.getDeliveryGoodsID()) return false;
       }
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
@@ -43487,10 +43487,10 @@ public final class ManageServiceMI2 {
         hash = (37 * hash) + BIZTYPE_FIELD_NUMBER;
         hash = (53 * hash) + getBizType();
       }
-      if (hasWRStandardID()) {
-        hash = (37 * hash) + WRSTANDARDID_FIELD_NUMBER;
+      if (hasDeliveryGoodsID()) {
+        hash = (37 * hash) + DELIVERYGOODSID_FIELD_NUMBER;
         hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
-            getWRStandardID());
+            getDeliveryGoodsID());
       }
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
@@ -43631,7 +43631,7 @@ public final class ManageServiceMI2 {
         super.clear();
         bizType_ = 0;
         bitField0_ = (bitField0_ & ~0x00000001);
-        wRStandardID_ = 0L;
+        deliveryGoodsID_ = 0L;
         bitField0_ = (bitField0_ & ~0x00000002);
         return this;
       }
@@ -43666,7 +43666,7 @@ public final class ManageServiceMI2 {
           to_bitField0_ |= 0x00000001;
         }
         if (((from_bitField0_ & 0x00000002) != 0)) {
-          result.wRStandardID_ = wRStandardID_;
+          result.deliveryGoodsID_ = deliveryGoodsID_;
           to_bitField0_ |= 0x00000002;
         }
         result.bitField0_ = to_bitField0_;
@@ -43721,8 +43721,8 @@ public final class ManageServiceMI2 {
         if (other.hasBizType()) {
           setBizType(other.getBizType());
         }
-        if (other.hasWRStandardID()) {
-          setWRStandardID(other.getWRStandardID());
+        if (other.hasDeliveryGoodsID()) {
+          setDeliveryGoodsID(other.getDeliveryGoodsID());
         }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
@@ -43809,57 +43809,57 @@ public final class ManageServiceMI2 {
         return this;
       }
 
-      private long wRStandardID_ ;
+      private long deliveryGoodsID_ ;
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @return Whether the wRStandardID field is set.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @return Whether the deliveryGoodsID field is set.
        */
       @java.lang.Override
-      public boolean hasWRStandardID() {
+      public boolean hasDeliveryGoodsID() {
         return ((bitField0_ & 0x00000002) != 0);
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @return The wRStandardID.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @return The deliveryGoodsID.
        */
       @java.lang.Override
-      public long getWRStandardID() {
-        return wRStandardID_;
+      public long getDeliveryGoodsID() {
+        return deliveryGoodsID_;
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
-       * @param value The wRStandardID to set.
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
+       * @param value The deliveryGoodsID to set.
        * @return This builder for chaining.
        */
-      public Builder setWRStandardID(long value) {
+      public Builder setDeliveryGoodsID(long value) {
         bitField0_ |= 0x00000002;
-        wRStandardID_ = value;
+        deliveryGoodsID_ = value;
         onChanged();
         return this;
       }
       /**
        * <pre>
-       * uint64 �ֻ���ƷID
+       * uint64 Ʒ��ID
        * </pre>
        *
-       * <code>optional uint64 WRStandardID = 2;</code>
+       * <code>optional uint64 DeliveryGoodsID = 2;</code>
        * @return This builder for chaining.
        */
-      public Builder clearWRStandardID() {
+      public Builder clearDeliveryGoodsID() {
         bitField0_ = (bitField0_ & ~0x00000002);
-        wRStandardID_ = 0L;
+        deliveryGoodsID_ = 0L;
         onChanged();
         return this;
       }
@@ -89972,141 +89972,141 @@ public final class ManageServiceMI2 {
       "otalExposure\030\021 \001(\001\022\027\n\017TotalHedgeRatio\030\022 " +
       "\001(\001\022\031\n\021TotalNeedHedgeQty\030\023 \001(\001\022\032\n\022NeedHe" +
       "dgeExposoure\030\024 \001(\001\022\026\n\016NeedHedgeRatio\030\025 \001" +
-      "(\001\022\022\n\nUpdateTime\030\026 \001(\t\"?\n\026ErmcpBizGroupS" +
-      "potGoods\022\017\n\007BizType\030\001 \001(\005\022\024\n\014WRStandardI" +
-      "D\030\002 \001(\004\"+\n\026ErmcpBizGroupTAAccount\022\021\n\tAcc" +
-      "ountID\030\001 \001(\004\"&\n\016MemberFuncMenu\022\024\n\014resour" +
-      "cecode\030\001 \001(\t\"#\n\016LoginTaaccount\022\021\n\taccoun" +
-      "tid\030\001 \001(\004\"\246\004\n\025HedgeOutMainConfigReq\022\034\n\006H" +
-      "eader\030\001 \001(\0132\014.MessageHead\022\020\n\010marketid\030\002 " +
-      "\001(\004\022\030\n\020hedgeaccountcode\030\003 \001(\t\022\023\n\013connect" +
-      "flag\030\004 \001(\005\022\027\n\017hedgeaccountpwd\030\005 \001(\t\022\r\n\005a" +
-      "ppid\030\006 \001(\t\022\020\n\010authcode\030\007 \001(\t\022\023\n\013limitnum" +
-      "ber\030\010 \001(\004\022\016\n\006status\030\t \001(\005\022\023\n\013accountname" +
-      "\030\n \001(\t\022\021\n\taccountid\030\013 \001(\004\022\025\n\rtaaccountty" +
-      "pe\030\014 \001(\005\022\022\n\ncurrencyid\030\r \001(\005\022\024\n\014outthres" +
-      "hold\030\016 \001(\001\022\016\n\006ismain\030\017 \001(\005\022\027\n\017parentacco" +
-      "untid\030\020 \001(\004\022\025\n\rrelateduserid\030\021 \001(\004\022\025\n\rfr" +
-      "omaccountid\030\022 \001(\004\022\030\n\020trademargintmpid\030\023 " +
-      "\001(\004\022\025\n\rtradefeetmpid\030\024 \001(\004\022\025\n\rmaxsubacco" +
-      "uts\030\025 \001(\004\022\014\n\004fcid\030\026 \001(\004\022\021\n\tcreatorid\030\027 \001" +
-      "(\004\022\022\n\nmodifierid\030\030 \001(\004\022\022\n\nareauserid\030\031 \001" +
-      "(\004\"j\n\025HedgeOutMainConfigRsp\022\034\n\006Header\030\001 " +
-      "\001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007Re" +
-      "tDesc\030\003 \001(\t\022\021\n\taccountid\030\004 \001(\004\"\247\002\n\020Ermcp" +
-      "BizGroupReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHea" +
-      "d\022\022\n\nBizGroupID\030\002 \001(\004\022\017\n\007BizType\030\003 \001(\005\022\016" +
-      "\n\006Remark\030\004 \001(\t\022\020\n\010ApplySrc\030\005 \001(\005\022\017\n\007Appl" +
-      "yId\030\006 \001(\004\022;\n\tSpotGoods\030\007 \003(\0132(.ManageSer" +
-      "viceMI2.ErmcpBizGroupSpotGoods\022;\n\tTAAcco" +
-      "unt\030\010 \003(\0132(.ManageServiceMI2.ErmcpBizGro" +
-      "upTAAccount\022\017\n\007OptType\030\t \001(\005\022\022\n\nAreaUser" +
-      "ID\030\n \001(\004\"f\n\020ErmcpBizGroupRsp\022\034\n\006Header\030\001" +
-      " \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007R" +
-      "etDesc\030\003 \001(\t\022\022\n\nBizGroupID\030\004 \001(\004\"\345\001\n\025Man" +
-      "agerRoleOperateReq\022\034\n\006Header\030\001 \001(\0132\014.Mes" +
-      "sageHead\022\016\n\006autoid\030\002 \001(\004\022\023\n\013operatetype\030" +
-      "\003 \001(\r\022\022\n\nareauserid\030\004 \001(\004\022\022\n\nmodifierid\030" +
-      "\005 \001(\004\022\024\n\014modifyremark\030\006 \001(\t\022\020\n\010rolename\030" +
-      "\007 \001(\t\0229\n\017memberfuncmenus\030\010 \003(\0132 .ManageS" +
-      "erviceMI2.MemberFuncMenu\"g\n\025ManagerRoleO" +
+      "(\001\022\022\n\nUpdateTime\030\026 \001(\t\"B\n\026ErmcpBizGroupS" +
+      "potGoods\022\017\n\007BizType\030\001 \001(\005\022\027\n\017DeliveryGoo" +
+      "dsID\030\002 \001(\004\"+\n\026ErmcpBizGroupTAAccount\022\021\n\t" +
+      "AccountID\030\001 \001(\004\"&\n\016MemberFuncMenu\022\024\n\014res" +
+      "ourcecode\030\001 \001(\t\"#\n\016LoginTaaccount\022\021\n\tacc" +
+      "ountid\030\001 \001(\004\"\246\004\n\025HedgeOutMainConfigReq\022\034" +
+      "\n\006Header\030\001 \001(\0132\014.MessageHead\022\020\n\010marketid" +
+      "\030\002 \001(\004\022\030\n\020hedgeaccountcode\030\003 \001(\t\022\023\n\013conn" +
+      "ectflag\030\004 \001(\005\022\027\n\017hedgeaccountpwd\030\005 \001(\t\022\r" +
+      "\n\005appid\030\006 \001(\t\022\020\n\010authcode\030\007 \001(\t\022\023\n\013limit" +
+      "number\030\010 \001(\004\022\016\n\006status\030\t \001(\005\022\023\n\013accountn" +
+      "ame\030\n \001(\t\022\021\n\taccountid\030\013 \001(\004\022\025\n\rtaaccoun" +
+      "ttype\030\014 \001(\005\022\022\n\ncurrencyid\030\r \001(\005\022\024\n\014outth" +
+      "reshold\030\016 \001(\001\022\016\n\006ismain\030\017 \001(\005\022\027\n\017parenta" +
+      "ccountid\030\020 \001(\004\022\025\n\rrelateduserid\030\021 \001(\004\022\025\n" +
+      "\rfromaccountid\030\022 \001(\004\022\030\n\020trademargintmpid" +
+      "\030\023 \001(\004\022\025\n\rtradefeetmpid\030\024 \001(\004\022\025\n\rmaxsuba" +
+      "ccouts\030\025 \001(\004\022\014\n\004fcid\030\026 \001(\004\022\021\n\tcreatorid\030" +
+      "\027 \001(\004\022\022\n\nmodifierid\030\030 \001(\004\022\022\n\nareauserid\030" +
+      "\031 \001(\004\"j\n\025HedgeOutMainConfigRsp\022\034\n\006Header" +
+      "\030\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n" +
+      "\007RetDesc\030\003 \001(\t\022\021\n\taccountid\030\004 \001(\004\"\247\002\n\020Er" +
+      "mcpBizGroupReq\022\034\n\006Header\030\001 \001(\0132\014.Message" +
+      "Head\022\022\n\nBizGroupID\030\002 \001(\004\022\017\n\007BizType\030\003 \001(" +
+      "\005\022\016\n\006Remark\030\004 \001(\t\022\020\n\010ApplySrc\030\005 \001(\005\022\017\n\007A" +
+      "pplyId\030\006 \001(\004\022;\n\tSpotGoods\030\007 \003(\0132(.Manage" +
+      "ServiceMI2.ErmcpBizGroupSpotGoods\022;\n\tTAA" +
+      "ccount\030\010 \003(\0132(.ManageServiceMI2.ErmcpBiz" +
+      "GroupTAAccount\022\017\n\007OptType\030\t \001(\005\022\022\n\nAreaU" +
+      "serID\030\n \001(\004\"f\n\020ErmcpBizGroupRsp\022\034\n\006Heade" +
+      "r\030\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017" +
+      "\n\007RetDesc\030\003 \001(\t\022\022\n\nBizGroupID\030\004 \001(\004\"\345\001\n\025" +
+      "ManagerRoleOperateReq\022\034\n\006Header\030\001 \001(\0132\014." +
+      "MessageHead\022\016\n\006autoid\030\002 \001(\004\022\023\n\013operatety" +
+      "pe\030\003 \001(\r\022\022\n\nareauserid\030\004 \001(\004\022\022\n\nmodifier" +
+      "id\030\005 \001(\004\022\024\n\014modifyremark\030\006 \001(\t\022\020\n\010rolena" +
+      "me\030\007 \001(\t\0229\n\017memberfuncmenus\030\010 \003(\0132 .Mana" +
+      "geServiceMI2.MemberFuncMenu\"g\n\025ManagerRo" +
+      "leOperateRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHe" +
+      "ad\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\016\n\006" +
+      "autoid\030\004 \001(\004\"\203\001\n\023TaaccountOperateReq\022\034\n\006" +
+      "Header\030\001 \001(\0132\014.MessageHead\022\021\n\taccountid\030" +
+      "\002 \001(\004\022\023\n\013tradestatus\030\003 \001(\r\022\022\n\nmodifierid" +
+      "\030\004 \001(\004\022\022\n\nareauserid\030\005 \001(\004\"h\n\023TaaccountO" +
       "perateRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022" +
-      "\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\016\n\006aut" +
-      "oid\030\004 \001(\004\"\203\001\n\023TaaccountOperateReq\022\034\n\006Hea" +
-      "der\030\001 \001(\0132\014.MessageHead\022\021\n\taccountid\030\002 \001" +
-      "(\004\022\023\n\013tradestatus\030\003 \001(\r\022\022\n\nmodifierid\030\004 " +
-      "\001(\004\022\022\n\nareauserid\030\005 \001(\004\"h\n\023TaaccountOper" +
-      "ateRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007" +
-      "RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\021\n\taccoun" +
-      "tid\030\004 \001(\004\"\207\001\n\033TaaccountTransfersxmoneyRe" +
-      "q\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\021\n\taccou" +
-      "ntid\030\002 \001(\004\022\017\n\007sxmoney\030\003 \001(\001\022\022\n\nmodifieri" +
-      "d\030\004 \001(\004\022\022\n\nareauserid\030\005 \001(\004\"p\n\033Taaccount" +
-      "TransfersxmoneyRsp\022\034\n\006Header\030\001 \001(\0132\014.Mes" +
-      "sageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001" +
-      "(\t\022\021\n\taccountid\030\004 \001(\004\"\252\002\n\026LoginaccountOp" +
-      "erateReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\023" +
-      "\n\013operatetype\030\002 \001(\r\022\016\n\006userid\030\003 \001(\004\022\017\n\007l" +
-      "oginid\030\004 \001(\004\022\022\n\nareauserid\030\005 \001(\004\022\021\n\tlogi" +
-      "ncode\030\006 \001(\t\022\023\n\013accountname\030\007 \001(\t\022\020\n\010pass" +
-      "word\030\010 \001(\t\022\016\n\006mobile\030\t \001(\t\022\017\n\007roleids\030\n " +
-      "\003(\004\0229\n\017logintaaccounts\030\013 \003(\0132 .ManageSer" +
-      "viceMI2.LoginTaaccount\022\022\n\nmodifierid\030\014 \001" +
-      "(\004\"y\n\026LoginaccountOperateRsp\022\034\n\006Header\030\001" +
+      "\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\021\n\tacc" +
+      "ountid\030\004 \001(\004\"\207\001\n\033TaaccountTransfersxmone" +
+      "yReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\021\n\tac" +
+      "countid\030\002 \001(\004\022\017\n\007sxmoney\030\003 \001(\001\022\022\n\nmodifi" +
+      "erid\030\004 \001(\004\022\022\n\nareauserid\030\005 \001(\004\"p\n\033Taacco" +
+      "untTransfersxmoneyRsp\022\034\n\006Header\030\001 \001(\0132\014." +
+      "MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030" +
+      "\003 \001(\t\022\021\n\taccountid\030\004 \001(\004\"\252\002\n\026Loginaccoun" +
+      "tOperateReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHea" +
+      "d\022\023\n\013operatetype\030\002 \001(\r\022\016\n\006userid\030\003 \001(\004\022\017" +
+      "\n\007loginid\030\004 \001(\004\022\022\n\nareauserid\030\005 \001(\004\022\021\n\tl" +
+      "ogincode\030\006 \001(\t\022\023\n\013accountname\030\007 \001(\t\022\020\n\010p" +
+      "assword\030\010 \001(\t\022\016\n\006mobile\030\t \001(\t\022\017\n\007roleids" +
+      "\030\n \003(\004\0229\n\017logintaaccounts\030\013 \003(\0132 .Manage" +
+      "ServiceMI2.LoginTaaccount\022\022\n\nmodifierid\030" +
+      "\014 \001(\004\"y\n\026LoginaccountOperateRsp\022\034\n\006Heade" +
+      "r\030\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017" +
+      "\n\007RetDesc\030\003 \001(\t\022\016\n\006userid\030\004 \001(\004\022\017\n\007login" +
+      "id\030\005 \001(\004\"\373\001\n\026ErmcpSpotGoodsPriceReq\022\034\n\006H" +
+      "eader\030\001 \001(\0132\014.MessageHead\022\024\n\014WRStandardI" +
+      "D\030\002 \001(\004\022\030\n\020SpotGoodsModelID\030\003 \001(\004\022\030\n\020Spo" +
+      "tGoodsBrandID\030\004 \001(\004\022\022\n\nCurrencyID\030\005 \001(\004\022" +
+      "\026\n\016SpotGoodsPrice\030\006 \001(\001\022\021\n\tTradeDate\030\007 \001" +
+      "(\t\022\022\n\nOperateSrc\030\010 \001(\005\022\021\n\tOperateID\030\t \001(" +
+      "\004\022\023\n\013OperateType\030\n \001(\005\"X\n\026ErmcpSpotGoods" +
+      "PriceRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017" +
+      "\n\007RetCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\"\365\002\n\021Erm" +
+      "cpHedgePlanReq\022\034\n\006Header\030\001 \001(\0132\014.Message" +
+      "Head\022\023\n\013HedgePlanID\030\002 \001(\004\022\023\n\013HedgePlanNo" +
+      "\030\003 \001(\t\022\024\n\014ContractType\030\004 \001(\005\022\022\n\nAreaUser" +
+      "ID\030\005 \001(\004\022\027\n\017DeliveryGoodsID\030\006 \001(\004\022\024\n\014WrS" +
+      "tandardID\030\007 \001(\004\022\023\n\013ProductType\030\010 \001(\005\022\025\n\r" +
+      "SpotGoodsDesc\030\t \001(\t\022\017\n\007PlanQty\030\n \001(\001\022\025\n\r" +
+      "ConvertFactor\030\013 \001(\001\022\020\n\010PlanTime\030\014 \001(\t\022\021\n" +
+      "\tTradeDate\030\r \001(\t\022\020\n\010ApplySrc\030\016 \001(\005\022\017\n\007Ap" +
+      "plyId\030\017 \001(\004\022\016\n\006Remark\030\020 \001(\t\022\023\n\013OperateTy" +
+      "pe\030\021 \001(\005\"S\n\021ErmcpHedgePlanRsp\022\034\n\006Header\030" +
+      "\001 \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007" +
+      "RetDesc\030\003 \001(\t\"\355\005\n\020SpotContractInfo\022\022\n\nCo" +
+      "ntractNo\030\001 \001(\t\022\024\n\014ContractType\030\002 \001(\005\022\016\n\006" +
+      "UserID\030\003 \001(\r\022\021\n\tBuyUserID\030\004 \001(\r\022\022\n\nSellU" +
+      "serID\030\005 \001(\r\022\020\n\010SignDate\030\006 \001(\t\022\032\n\022Contrac" +
+      "tAttachment\030\007 \001(\014\022\026\n\016ContractMargin\030\010 \001(" +
+      "\001\022\027\n\017DeliveryGoodsID\030\t \001(\r\022\024\n\014WrStandard" +
+      "ID\030\n \001(\r\022\017\n\007BrandID\030\013 \001(\t\022\023\n\013ProductType" +
+      "\030\014 \001(\r\022\025\n\rConvertFactor\030\r \001(\001\022\025\n\rSpotGoo" +
+      "dsDesc\030\016 \001(\t\022\021\n\tPriceType\030\017 \001(\r\022\013\n\003Qty\030\020" +
+      " \001(\001\022\r\n\005Price\030\021 \001(\001\022\016\n\006Amount\030\022 \001(\001\022\031\n\021D" +
+      "eliveryStartDate\030\023 \001(\t\022\027\n\017DeliveryEndDat" +
+      "e\030\024 \001(\t\022\017\n\007GoodsID\030\025 \001(\r\022\021\n\tPriceMove\030\026 " +
+      "\001(\001\022\021\n\tStartDate\030\027 \001(\t\022\017\n\007EndDate\030\030 \001(\t\022" +
+      "\021\n\tPointDesc\030\031 \001(\t\022\024\n\014DeliveryDesc\030\032 \001(\t" +
+      "\022\021\n\tMerUserID\030\033 \001(\r\022\023\n\013TradeUserID\030\034 \001(\r" +
+      "\022\021\n\tPricedQty\030\035 \001(\001\022\024\n\014PricedAmount\030\036 \001(" +
+      "\001\022\030\n\020SpotGoodsModelID\030\037 \001(\r\022\030\n\020SpotGoods" +
+      "BrandID\030  \001(\r\022\016\n\006Remark\030! \001(\t\022\022\n\nSaleUse" +
+      "rID\030\" \001(\r\022\021\n\tAccountID\030# \001(\004\022\017\n\007BizType\030" +
+      "$ \001(\r\"\344\001\n\033ErmcpSpotContractOperateReq\022\034\n" +
+      "\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016SpotContr" +
+      "actID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022\n\nOper" +
+      "ateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Remark\030\006" +
+      " \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0220\n\004Info\030\010 \001(\013" +
+      "2\".ManageServiceMI2.SpotContractInfo\"\264\001\n" +
+      "\033ErmcpSpotContractOperateRsp\022\034\n\006Header\030\001" +
       " \001(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007R" +
-      "etDesc\030\003 \001(\t\022\016\n\006userid\030\004 \001(\004\022\017\n\007loginid\030" +
-      "\005 \001(\004\"\373\001\n\026ErmcpSpotGoodsPriceReq\022\034\n\006Head" +
-      "er\030\001 \001(\0132\014.MessageHead\022\024\n\014WRStandardID\030\002" +
-      " \001(\004\022\030\n\020SpotGoodsModelID\030\003 \001(\004\022\030\n\020SpotGo" +
-      "odsBrandID\030\004 \001(\004\022\022\n\nCurrencyID\030\005 \001(\004\022\026\n\016" +
-      "SpotGoodsPrice\030\006 \001(\001\022\021\n\tTradeDate\030\007 \001(\t\022" +
-      "\022\n\nOperateSrc\030\010 \001(\005\022\021\n\tOperateID\030\t \001(\004\022\023" +
-      "\n\013OperateType\030\n \001(\005\"X\n\026ErmcpSpotGoodsPri" +
-      "ceRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007R" +
-      "etCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\"\365\002\n\021ErmcpH" +
-      "edgePlanReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHea" +
-      "d\022\023\n\013HedgePlanID\030\002 \001(\004\022\023\n\013HedgePlanNo\030\003 " +
-      "\001(\t\022\024\n\014ContractType\030\004 \001(\005\022\022\n\nAreaUserID\030" +
-      "\005 \001(\004\022\027\n\017DeliveryGoodsID\030\006 \001(\004\022\024\n\014WrStan" +
-      "dardID\030\007 \001(\004\022\023\n\013ProductType\030\010 \001(\005\022\025\n\rSpo" +
-      "tGoodsDesc\030\t \001(\t\022\017\n\007PlanQty\030\n \001(\001\022\025\n\rCon" +
-      "vertFactor\030\013 \001(\001\022\020\n\010PlanTime\030\014 \001(\t\022\021\n\tTr" +
-      "adeDate\030\r \001(\t\022\020\n\010ApplySrc\030\016 \001(\005\022\017\n\007Apply" +
-      "Id\030\017 \001(\004\022\016\n\006Remark\030\020 \001(\t\022\023\n\013OperateType\030" +
-      "\021 \001(\005\"S\n\021ErmcpHedgePlanRsp\022\034\n\006Header\030\001 \001" +
-      "(\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007Ret" +
-      "Desc\030\003 \001(\t\"\355\005\n\020SpotContractInfo\022\022\n\nContr" +
-      "actNo\030\001 \001(\t\022\024\n\014ContractType\030\002 \001(\005\022\016\n\006Use" +
-      "rID\030\003 \001(\r\022\021\n\tBuyUserID\030\004 \001(\r\022\022\n\nSellUser" +
-      "ID\030\005 \001(\r\022\020\n\010SignDate\030\006 \001(\t\022\032\n\022ContractAt" +
-      "tachment\030\007 \001(\014\022\026\n\016ContractMargin\030\010 \001(\001\022\027" +
-      "\n\017DeliveryGoodsID\030\t \001(\r\022\024\n\014WrStandardID\030" +
-      "\n \001(\r\022\017\n\007BrandID\030\013 \001(\t\022\023\n\013ProductType\030\014 " +
-      "\001(\r\022\025\n\rConvertFactor\030\r \001(\001\022\025\n\rSpotGoodsD" +
-      "esc\030\016 \001(\t\022\021\n\tPriceType\030\017 \001(\r\022\013\n\003Qty\030\020 \001(" +
-      "\001\022\r\n\005Price\030\021 \001(\001\022\016\n\006Amount\030\022 \001(\001\022\031\n\021Deli" +
-      "veryStartDate\030\023 \001(\t\022\027\n\017DeliveryEndDate\030\024" +
-      " \001(\t\022\017\n\007GoodsID\030\025 \001(\r\022\021\n\tPriceMove\030\026 \001(\001" +
-      "\022\021\n\tStartDate\030\027 \001(\t\022\017\n\007EndDate\030\030 \001(\t\022\021\n\t" +
-      "PointDesc\030\031 \001(\t\022\024\n\014DeliveryDesc\030\032 \001(\t\022\021\n" +
-      "\tMerUserID\030\033 \001(\r\022\023\n\013TradeUserID\030\034 \001(\r\022\021\n" +
-      "\tPricedQty\030\035 \001(\001\022\024\n\014PricedAmount\030\036 \001(\001\022\030" +
-      "\n\020SpotGoodsModelID\030\037 \001(\r\022\030\n\020SpotGoodsBra" +
-      "ndID\030  \001(\r\022\016\n\006Remark\030! \001(\t\022\022\n\nSaleUserID" +
-      "\030\" \001(\r\022\021\n\tAccountID\030# \001(\004\022\017\n\007BizType\030$ \001" +
-      "(\r\"\344\001\n\033ErmcpSpotContractOperateReq\022\034\n\006He" +
-      "ader\030\001 \001(\0132\014.MessageHead\022\026\n\016SpotContract" +
-      "ID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022\n\nOperate" +
-      "Src\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Remark\030\006 \001(" +
-      "\t\022\024\n\014ClientTicket\030\007 \001(\t\0220\n\004Info\030\010 \001(\0132\"." +
-      "ManageServiceMI2.SpotContractInfo\"\264\001\n\033Er" +
-      "mcpSpotContractOperateRsp\022\034\n\006Header\030\001 \001(" +
-      "\0132\014.MessageHead\022\017\n\007RetCode\030\002 \001(\005\022\017\n\007RetD" +
-      "esc\030\003 \001(\t\022\026\n\016SpotContractID\030\004 \001(\004\022\023\n\013Ope" +
-      "rateType\030\005 \001(\r\022\022\n\nOperateSrc\030\006 \001(\r\022\024\n\014Cl" +
-      "ientTicket\030\007 \001(\t\"n\n\030ContractOperateApply" +
-      "Info\022\030\n\020OperateApplyType\030\001 \001(\r\022\021\n\tRelate" +
-      "dID\030\002 \001(\004\022\022\n\nDetailJson\030\003 \001(\014\022\021\n\tAttachU" +
-      "rl\030\004 \001(\014\"\355\001\n\034ErmcpContractOperateApplyRe" +
-      "q\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016Opera" +
-      "teApplyID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022\022\n\n" +
-      "OperateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006Rema" +
-      "rk\030\006 \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0228\n\004Info\030\010" +
-      " \001(\0132*.ManageServiceMI2.ContractOperateA" +
-      "pplyInfo\"\265\001\n\034ErmcpContractOperateApplyRs" +
-      "p\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007RetCo" +
-      "de\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\026\n\016OperateAppl" +
-      "yID\030\004 \001(\004\022\023\n\013OperateType\030\005 \001(\r\022\022\n\nOperat" +
-      "eSrc\030\006 \001(\r\022\024\n\014ClientTicket\030\007 \001(\tB?\n%cn.m" +
-      "uchinfo.rma.protobuf.protoclassesZ\026com.m" +
-      "uchinfo.mtp.proto"
+      "etDesc\030\003 \001(\t\022\026\n\016SpotContractID\030\004 \001(\004\022\023\n\013" +
+      "OperateType\030\005 \001(\r\022\022\n\nOperateSrc\030\006 \001(\r\022\024\n" +
+      "\014ClientTicket\030\007 \001(\t\"n\n\030ContractOperateAp" +
+      "plyInfo\022\030\n\020OperateApplyType\030\001 \001(\r\022\021\n\tRel" +
+      "atedID\030\002 \001(\004\022\022\n\nDetailJson\030\003 \001(\014\022\021\n\tAtta" +
+      "chUrl\030\004 \001(\014\"\355\001\n\034ErmcpContractOperateAppl" +
+      "yReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\026\n\016Op" +
+      "erateApplyID\030\002 \001(\004\022\023\n\013OperateType\030\003 \001(\r\022" +
+      "\022\n\nOperateSrc\030\004 \001(\r\022\016\n\006UserID\030\005 \001(\004\022\016\n\006R" +
+      "emark\030\006 \001(\t\022\024\n\014ClientTicket\030\007 \001(\t\0228\n\004Inf" +
+      "o\030\010 \001(\0132*.ManageServiceMI2.ContractOpera" +
+      "teApplyInfo\"\265\001\n\034ErmcpContractOperateAppl" +
+      "yRsp\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007Re" +
+      "tCode\030\002 \001(\005\022\017\n\007RetDesc\030\003 \001(\t\022\026\n\016OperateA" +
+      "pplyID\030\004 \001(\004\022\023\n\013OperateType\030\005 \001(\r\022\022\n\nOpe" +
+      "rateSrc\030\006 \001(\r\022\024\n\014ClientTicket\030\007 \001(\tB?\n%c" +
+      "n.muchinfo.rma.protobuf.protoclassesZ\026co" +
+      "m.muchinfo.mtp.proto"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
         new com.google.protobuf.Descriptors.FileDescriptor[] {
           cn.muchinfo.rma.protobuf.protoclasses.Common.getDescriptor(),
           cn.muchinfo.rma.protobuf.protoclasses.PublicMI1.getDescriptor(),
-                cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI1.getDescriptor(),
+          cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI1.getDescriptor(),
         });
     internal_static_ManageServiceMI2_Erms2WRRContractRisk_descriptor =
       getDescriptor().getMessageTypes().get(0);
@@ -90275,7 +90275,7 @@ public final class ManageServiceMI2 {
     internal_static_ManageServiceMI2_ErmcpBizGroupSpotGoods_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_ManageServiceMI2_ErmcpBizGroupSpotGoods_descriptor,
-        new java.lang.String[] { "BizType", "WRStandardID", });
+        new java.lang.String[] { "BizType", "DeliveryGoodsID", });
     internal_static_ManageServiceMI2_ErmcpBizGroupTAAccount_descriptor =
       getDescriptor().getMessageTypes().get(28);
     internal_static_ManageServiceMI2_ErmcpBizGroupTAAccount_fieldAccessorTable = new
@@ -90428,7 +90428,7 @@ public final class ManageServiceMI2 {
         new java.lang.String[] { "Header", "RetCode", "RetDesc", "OperateApplyID", "OperateType", "OperateSrc", "ClientTicket", });
     cn.muchinfo.rma.protobuf.protoclasses.Common.getDescriptor();
     cn.muchinfo.rma.protobuf.protoclasses.PublicMI1.getDescriptor();
-      cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI1.getDescriptor();
+    cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI1.getDescriptor();
   }
 
   // @@protoc_insertion_point(outer_class_scope)

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

@@ -11,8 +11,8 @@ object Constant {
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
 //      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
-    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // shenzhen01  123123
-//    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
+//    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // shenzhen01  123123
+    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
 
     /**
      * 用sp存储基础url的key

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

@@ -36,6 +36,7 @@ import cn.muchinfo.rma.view.base.home.inventory.inventoryaudit.InventoryAuditAct
 import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.InventoryManagerActivity
 import cn.muchinfo.rma.view.base.home.reportquery.ReportQueryActivity
 import cn.muchinfo.rma.view.base.home.set.SettingActivity
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceActivity
 import cn.muchinfo.rma.view.base.home.tradingquery.TradingQueryActivity
 import cn.muchinfo.rma.view.base.home.warehouse.WarehouseInformationActivity
 import cn.muchinfo.rma.view.eventbus.EventConstent
@@ -1138,12 +1139,13 @@ class SecondTabUI(private val baseFragment: Fragment, private val viewModel: Hom
                 }
 
                 linearLayout {
-                    visibility = View.GONE
                     relativeLayout {
 
                         verticalLayout {
                             onThrottleFirstClick {
-
+                                val intent = Intent()
+                                intent.setClass(context,SpotMarketPriceActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             imageView {
                                 imageResource = R.mipmap.spot_market_price

+ 396 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureAccountActivity.kt

@@ -0,0 +1,396 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureaccount
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.dialog.SelectData
+import org.jetbrains.anko.*
+
+/**
+ * 新增期货主账户
+ */
+class AddFutureAccountActivity : BaseActivity<FutureAccountViewModel>(){
+
+    /**
+     * 页面操作类型 1 新增 2 修改
+     */
+    private val type by lazy { intent.getStringExtra("type") }
+
+    /**
+     * 选择的期货公司
+     */
+    private val selectFuturesCompany : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 输入的账户名称
+     */
+    private lateinit var account_name : EditText
+
+    /**
+     * 输入的期货登录账号
+     */
+    private lateinit var login_account : EditText
+
+    /**
+     * 输入的appid
+     */
+    private lateinit var APPID_input : EditText
+
+    /**
+     * 输入的交易密码
+     */
+    private lateinit var password: EditText
+
+    /**
+     * 输入的授权码
+     */
+    private lateinit var authorization_code : EditText
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    if (type == "1"){
+                        text = "新增期货账户"
+                    }else{
+                        text = "修改期货账户"
+                    }
+                }
+            }
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = "2",
+//                            value = "套利"
+//                        ),
+//                        SelectData(
+//                            id = "1",
+//                            value = "套保"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择业务类型", selectDataList) {
+////                        selectBusinessType.postValue(this)
+//                    }
+                }
+                textView {
+                    text = "期货公司"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+//                    selectBusinessType.bindOptional(context){
+//                        text = it?.value
+//                    }
+                    text = "请选择期货公司"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(110)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(43), autoSize(43))
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "账户名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    account_name = this
+                    hint = "请输入账户名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "期货登录账户"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    login_account = this
+                    hint = "请输入期货登录账户"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(40)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "APPID"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    APPID_input = this
+                    hint = "请输入APPID"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(120)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "交易密码"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    password = this
+                    hint = "请输入交易密码"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "授权码"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    authorization_code = this
+                    hint = "请输入授权码"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(100)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+
+            view {
+
+            }.lparams(autoSize(1),0,1f)
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    visibility = if (type == "1"){
+                        View.GONE
+                    }else{
+                        View.VISIBLE
+                    }
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_save_info_bg
+                    text = "删除"
+                    textSizeAuto = 38
+                    textColorInt = R.color.rma_star_color
+                }.lparams(autoSize(419), autoSize(119)) {
+                    marginStart = autoSize(24)
+                }
+
+                textView {
+                    visibility = if (type == "1"){
+                        View.GONE
+                    }else{
+                        View.VISIBLE
+                    }
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_submit_bg
+                    text = "完成"
+                    textColorInt = R.color.white
+                    textSizeAuto = 38
+                }.lparams(autoSize(419), autoSize(119)) {
+                    marginStart = autoSize(13)
+                }
+
+                textView {
+                    visibility = if (type == "1"){
+                        View.VISIBLE
+                    }else{
+                        View.GONE
+                    }
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_save_info_bg
+                    text = "完成"
+                    textSizeAuto = 38
+                    textColorInt = R.color.rma_star_color
+                }.lparams(matchParent, autoSize(119)) {
+                    marginStart = autoSize(60)
+                    marginEnd = autoSize(60)
+                }
+            }.lparams(matchParent, autoSize(144))
+
+        }
+    }
+
+    /**
+     * 提交数据前的校验
+     */
+    fun check() : Boolean{
+        if (selectFuturesCompany.value?.id.isNullOrEmpty()){
+            ToastUtils.showLong("请选择期货公司")
+            return false
+        }
+        if (account_name.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入账户名称")
+            return false
+        }
+        if (login_account.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入期货登录账号")
+            return false
+        }
+        if (APPID_input.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入APPID")
+            return false
+        }
+        if (password.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入交易密码")
+            return false
+        }
+        if (authorization_code.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入授权码")
+            return false
+        }
+        return true
+    }
+
+}

+ 240 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureSonAccountActivity.kt

@@ -0,0 +1,240 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureaccount
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+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.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.dialog.SelectData
+import org.jetbrains.anko.*
+
+/**
+ * 新增期货子账户
+ */
+class AddFutureSonAccountActivity : BaseActivity<FutureAccountViewModel>(){
+
+    /**
+     * 页面操作类型 1 新增 2 修改 3 详情
+     */
+    private val type by lazy { intent.getStringExtra("type") }
+
+    /**
+     * 输入的账户名称
+     */
+    private lateinit var account_name : EditText
+
+    /**
+     * 选择的期货保证金
+     */
+    private val select_futures_margin : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 选择的期货手续费
+     */
+    private val select_forward_commission : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 页面数据初始化
+     */
+    fun init(){
+        select_futures_margin.postValue(SelectData(id = "1",value = "默认保证金"))
+        select_forward_commission.postValue(SelectData(id = "1",value = "默认手续费"))
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = if (type == "1"){
+                        "新增期货子账户"
+                    }else if (type == "2"){
+                        "修改期货子账户"
+                    }else{
+                        "期货子账户详情"
+                    }
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "所属期货账户"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    text = "王小二/18643549988"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(65)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "账户名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    account_name = this
+                    hint = "请输入账户名称"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_TEXT
+//                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = "2",
+//                            value = "套利"
+//                        ),
+//                        SelectData(
+//                            id = "1",
+//                            value = "套保"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择业务类型", selectDataList) {
+////                        selectBusinessType.postValue(this)
+//                    }
+                }
+                textView {
+                    text = "期货保证金"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    select_futures_margin.bindOptional(context){
+                        text = it?.value
+                    }
+                    text = "默认保证金"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(110)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(43), autoSize(43))
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = "2",
+//                            value = "套利"
+//                        ),
+//                        SelectData(
+//                            id = "1",
+//                            value = "套保"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择业务类型", selectDataList) {
+////                        selectBusinessType.postValue(this)
+//                    }
+                }
+                textView {
+                    text = "期货手续费"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_hint_text_color_ccc
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    select_forward_commission.bindOptional(context){
+                        text = it?.value
+                    }
+                    text = "默认手续费"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(110)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.rma_more
+                }.lparams(autoSize(43), autoSize(43))
+            }.lparams(matchParent, autoSize(132))
+
+            view {
+
+            }.lparams(autoSize(1),0,1f)
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_save_info_bg
+                    text = "完成"
+                    textSizeAuto = 38
+                    textColorInt = R.color.rma_star_color
+                }.lparams(matchParent, autoSize(119)) {
+                    marginStart = autoSize(60)
+                    marginEnd = autoSize(60)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+}

+ 12 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/FutureAccountViewModel.kt

@@ -0,0 +1,12 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureaccount
+
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 用于新增期货主账户/子账户/授信的操作的viewmodel
+ */
+class FutureAccountViewModel : BaseViewModel(){
+
+
+
+}

+ 178 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/FutureCreditActivity.kt

@@ -0,0 +1,178 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureaccount
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import org.jetbrains.anko.*
+
+class FutureCreditActivity : BaseActivity<FutureAccountViewModel>(){
+
+    /**
+     * 输入的授信金额
+     */
+    lateinit var credit_amount : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "授信"
+                }
+            }
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "账户名称"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    text = "王小二"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(100)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "资金账号"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    text = "32131231231"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(100)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "授信总额"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    text = "10000"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(100)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "子账户当前余额"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_gray_color
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(60)
+                }
+
+                textView {
+                    text = "10000"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(30)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+                textView {
+                    text = "授信金额"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    credit_amount = this
+                    hint = "请输入授信金额,正数为增加,负数为减少"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_NUMBER or EditorInfo.TYPE_NUMBER_FLAG_SIGNED
+                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(100)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            view {
+
+            }.lparams(autoSize(1),0,1f)
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_save_info_bg
+                    text = "完成"
+                    textSizeAuto = 38
+                    textColorInt = R.color.rma_star_color
+                }.lparams(matchParent, autoSize(119)) {
+                    marginStart = autoSize(60)
+                    marginEnd = autoSize(60)
+                }
+            }.lparams(matchParent, autoSize(144))
+
+        }
+    }
+
+}

+ 48 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureAccountRoleViewHolder.kt

@@ -0,0 +1,48 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureset
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccMgrTaaccountSonData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+class AddFutureAccountRoleViewHolder(private val activity : AppCompatActivity, private val viewModel: FutureSetViewModel) : BaseViewHolder<AccMgrTaaccountSonData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnClickLoginRoleChange(data.value?.accountid ?: "")
+            }
+            gravity = Gravity.CENTER_VERTICAL
+            imageView {
+                data.bindOptional(context){
+                    if (it?.isSelect == 0){
+                        imageResource = R.mipmap.rma_normal_click
+                    }else{
+                        imageResource = R.mipmap.rma_select_click
+                    }
+                }
+//                imageResource = R.mipmap.rma_select_click
+            }.lparams(autoSize(38), autoSize(38)){
+                marginStart = autoSize(65)
+            }
+            textView {
+                data.bindOptional(context){
+                    text = it?.accountname + "/" + it?.accountid
+                }
+                textSizeAuto = 31
+                textColorInt = R.color.rma_blue_color
+            }.lparams(wrapContent, wrapContent){
+                marginStart = autoSize(16)
+            }
+        }.lparams(matchParent, autoSize(110))
+    }
+
+}

+ 252 - 12
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureRoleActivity.kt

@@ -2,10 +2,23 @@ package cn.muchinfo.rma.view.base.home.accountmanager.futureset
 
 import android.os.Bundle
 import android.view.Gravity
-import android.view.View
+import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.MTPEnums
+import cn.muchinfo.rma.global.data.*
+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.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleViewHolder
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.SelectData
+import mtp.polymer.com.autowidget.dialog.creatBottomSheetDialog
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -13,30 +26,188 @@ import org.jetbrains.anko.*
  */
 class AddFutureRoleActivity : BaseActivity<FutureSetViewModel>(){
 
+    /**
+     * 页面类型 1 新增 2 修改
+     */
+    private val type by lazy { intent.getStringExtra("type") }
+
+    /**
+     * 1 套利 2套保
+     */
+    private val bussinessType by lazy { intent.getStringExtra("bussinessType") }
+
+    /**
+     * 修改操作时用到的数据回填
+     */
+    private val data by lazy { intent.getParcelableExtra<AccMgrBizGroupSetData>("data") as AccMgrBizGroupSetData }
+
+    /**
+     * 选择的业务类型
+     */
+    val selectBusinessType : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 页面数据初始化
+     */
+    fun init(){
+        if (type == "1"){
+            if (bussinessType == "1"){
+                selectBusinessType.postValue(SelectData(id = "2",value = "套利"))
+            }else{
+                selectBusinessType.postValue(SelectData(id = "1",value = "套保"))
+            }
+            viewModel.queryAccMgrTaaccount(type ?: "1")
+            viewModel.queryDeliveryGoods(type ?: "1")
+        }else{
+            if (data.biztype == "1"){//套保
+                selectBusinessType.postValue(SelectData(id = "1",value = "套保"))
+            }else{//套利
+                selectBusinessType.postValue(SelectData(id = "2",value = "套利"))
+            }
+            viewModel.queryAccMgrTaaccount(type ?: "1",data ?: AccMgrBizGroupSetData())
+            viewModel.queryDeliveryGoods(type ?: "1", data)
+        }
+
+    }
+
+    /***
+     * 现货品种的
+     */
+    private val addFutureRoleAdapter: BaseAdapter<DeliveryGoodsData, AddFutureRoleItemViewHolder> =
+        BaseAdapter { _, _ -> AddFutureRoleItemViewHolder(this, viewModel) }
+
+    /***
+     * 期货账户
+     */
+    private val addFutureAccountRoleAdapter: BaseAdapter<AccMgrTaaccountSonData, AddFutureAccountRoleViewHolder> =
+        BaseAdapter { _, _ -> AddFutureAccountRoleViewHolder(this, viewModel) }
+
+
+    val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.main_hit_bg_color)
+            init()
             //页面标题
             topBar {
                 commonLeftButton()
                 commonTitle {
                     text = "新增"
                 }
-                // 新增角色设置
-                commonMenuButton(R.mipmap.add_new) {
-//                    val intent = Intent()
-//                    intent.putExtra("type","1")
-//                    intent.putExtra("data", AccMgrRoleData())
-//                    intent.setClass(context, AddRoleSetActivity::class.java)
-//                    ActivityUtils.startActivity(intent)
-                }
             }
 
             frameLayout {
-
                 nestedScrollView{
                     verticalLayout {
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            onThrottleFirstClick {
+                                val selectDataList = arrayListOf(
+                                    SelectData(
+                                        id = "2",
+                                        value = "套利"
+                                    ),
+                                    SelectData(
+                                        id = "1",
+                                        value = "套保"
+                                    )
+                                )
+                                creatBottomSheetDialog("请选择业务类型", selectDataList) {
+                                    selectBusinessType.postValue(this)
+                                }
+                            }
+                            textView {
+                                text = "业务类型"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                selectBusinessType.bindOptional(context){
+                                    text = it?.value
+                                }
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(110)
+                            }
+
+                            emptyView()
+
+                            imageView {
+                                imageResource = R.mipmap.rma_more
+                            }.lparams(autoSize(43), autoSize(43))
+                        }.lparams(matchParent, autoSize(132))
+
+                        itemView()
+
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "现货品种"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                text = "请选择现货品种"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_yellow_text_color
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(110)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                        /**
+                         * 现货品种的列表
+                         */
+                        recyclerView {
+                            background = resources.getDrawable(R.color.add_role_bg_color)
+                            adapter = addFutureRoleAdapter
+                        }.lparams(matchParent, wrapContent)
+
+                        viewModel.wrStandardnormalList.bindOptional(context){
+                            addFutureRoleAdapter.setNewData(it)
+                        }
+
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "期货账户"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_hint_text_color_ccc
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(60)
+                            }
+
+                            textView {
+                                text = "请选择期货账户"
+                                textSizeAuto = 31
+                                textColorInt = R.color.rma_yellow_text_color
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(110)
+                            }
+                        }.lparams(matchParent, autoSize(132))
+
+                        /**
+                         * 期货账户的列表
+                         */
+                        recyclerView {
+                            background = resources.getDrawable(R.color.add_role_bg_color)
+                            adapter = addFutureAccountRoleAdapter
+                        }.lparams(matchParent, wrapContent)
+
+                        viewModel.futureDataList.bindOptional(context){
+                            addFutureAccountRoleAdapter.setNewData(it)
+                        }
 
                     }
                 }
@@ -44,10 +215,31 @@ class AddFutureRoleActivity : BaseActivity<FutureSetViewModel>(){
                 linearLayout {
                     background = resources.getDrawable(R.color.white)
                     gravity = Gravity.CENTER_VERTICAL
-
-
                     textView {
                         onThrottleFirstClick {
+                            if (check().not()){
+                                return@onThrottleFirstClick
+                            }
+                            if (type == "1"){
+                                viewModel.ErmcpBizGroupReq(
+                                    BizType = selectBusinessType.value?.id?.toInt() ?: 0,
+                                    OptType = 1,
+                                    SpotGoods = getSelectWrStandard(),
+                                    TAAccount = getSelectFutureAccount()
+                                ){
+                                    finish()
+                                }
+                            }else{
+                                viewModel.ErmcpBizGroupReq(
+                                    BizGroupID = data.bizgroupid?.toLong() ?: 0,
+                                    BizType = selectBusinessType.value?.id?.toInt() ?: 0,
+                                    OptType = 2,
+                                    SpotGoods = getSelectWrStandard(),
+                                    TAAccount = getSelectFutureAccount()
+                                ){
+                                    finish()
+                                }
+                            }
 
                         }
                         gravity = Gravity.CENTER
@@ -67,4 +259,52 @@ class AddFutureRoleActivity : BaseActivity<FutureSetViewModel>(){
         }
     }
 
+    /**
+     * 选择的新增期货账户的现货商品
+     */
+    fun getSelectWrStandard() : List<ManageServiceMI2.ErmcpBizGroupSpotGoods>{
+        val resultDataList = arrayListOf<ManageServiceMI2.ErmcpBizGroupSpotGoods>()
+        viewModel.wrStandardnormalList.value?.forEach {
+            if (it.indexSelect == 1){
+                val newData = ManageServiceMI2.ErmcpBizGroupSpotGoods.newBuilder()
+                newData.setDeliveryGoodsID(it.deliverygoodsid?.toLong() ?: 0)
+                newData.setBizType(selectBusinessType.value?.id?.toInt() ?: 0)
+                resultDataList.add(newData.build())
+            }
+        }
+        return resultDataList
+    }
+
+    /**
+     * 选择的新增期货账户的期货分组账户
+     */
+    fun getSelectFutureAccount() : List<ManageServiceMI2.ErmcpBizGroupTAAccount>{
+        val resultDataList = arrayListOf<ManageServiceMI2.ErmcpBizGroupTAAccount>()
+        viewModel.futureDataList.value?.forEach {
+            if (it.isSelect == 1){
+                val newData = ManageServiceMI2.ErmcpBizGroupTAAccount.newBuilder()
+                newData.setAccountID(it.accountid?.toLong() ?: 0)
+                resultDataList.add(newData.build())
+            }
+        }
+        return resultDataList
+    }
+
+    /**
+     * 提交数据前的校验
+     */
+    fun check() : Boolean{
+        if (getSelectWrStandard().isNullOrEmpty()){
+            ToastUtils.showLong("请选择现货品种")
+            return false
+        }
+
+        if (getSelectFutureAccount().isNullOrEmpty()){
+            ToastUtils.showLong("请选择期货账户")
+            return false
+        }
+
+        return true
+    }
+
 }

+ 65 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/AddFutureRoleItemViewHolder.kt

@@ -0,0 +1,65 @@
+package cn.muchinfo.rma.view.base.home.accountmanager.futureset
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.DeliveryGoodsData
+import cn.muchinfo.rma.global.data.RoleSonMenuData
+import cn.muchinfo.rma.global.data.WrStandardData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import com.blankj.utilcode.util.ToastUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+/**
+ * 新增期货账户的期货选择的item选择的viewholder
+ * @property activity AppCompatActivity
+ * @property viewModel RoleSetViewModel
+ * @property index Int
+ * @property itemSize IntArray
+ * @constructor
+ */
+class AddFutureRoleItemViewHolder(private val activity : AppCompatActivity, private val viewModel: FutureSetViewModel) : BaseViewHolder<DeliveryGoodsData>(activity){
+    override val itemSize: IntArray = intArrayOf(autoSize(300), wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnCloneClick(data.value?.deliverygoodsid ?: "")
+            }
+            gravity = Gravity.CENTER_VERTICAL
+            imageView {
+
+                data.bindOptional(context){
+                    if (it?.indexSelect == 0){
+                        imageResource = R.mipmap.rma_normal_click
+                    }else{
+                        imageResource = R.mipmap.rma_select_click
+                    }
+                }
+            }.lparams(autoSize(38), autoSize(38)){
+                marginStart =  autoSize(60)
+            }
+
+            textView {
+                data.bindOptional(context){
+                    text = it?.deliverygoodsname
+                    if (it?.indexSelect == 0){
+                        textColorInt = R.color.rma_black_33
+                    }else{
+                        textColorInt = R.color.rma_blue_color
+                    }
+                }
+                textSizeAuto = 31
+
+            }.lparams(wrapContent, wrapContent){
+                marginStart = autoSize(20)
+            }
+        }.lparams(autoSize(300), autoSize(92))
+    }
+
+}

+ 7 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureAccountViewholder.kt

@@ -24,14 +24,18 @@ class FutureAccountViewHolder(private val activity : AppCompatActivity,private v
             gravity = Gravity.CENTER_VERTICAL
             textView {
                 data.bindOptional(context){
-                    text = it?.accountname + "/" + it?.accountid
+                    val textString = it?.accountname + "/" + it?.accountid
+                    text = textString
+                    if (textString.length > 22){
+                        textSizeAuto = 22
+                    }
                 }
                 textSizeAuto = 29
                 textColorInt = R.color.rma_black_33
             }.lparams(wrapContent, wrapContent){
-                marginStart = autoSize(50)
+                marginStart = autoSize(32)
             }
-        }.lparams(autoSize(360), autoSize(50))
+        }.lparams(autoSize(360), autoSize(90))
     }
 
 }

+ 161 - 15
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetActivity.kt

@@ -3,6 +3,8 @@ package cn.muchinfo.rma.view.base.home.accountmanager.futureset
 import android.content.Intent
 import android.os.Bundle
 import android.view.Gravity
+import android.view.View
+import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.AccMgrBizGroupSetData
 import cn.muchinfo.rma.global.data.AccMgrRoleData
@@ -14,6 +16,8 @@ import cn.muchinfo.rma.view.base.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleSetActivity
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 
 /**
@@ -25,18 +29,37 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
      * 套利
      */
     private val addRoleArbitrageAdapter: BaseAdapter<AccMgrBizGroupSetData, FutureSetViewHolder> =
-        BaseAdapter { _, _ -> FutureSetViewHolder(this, viewModel) }
+        BaseAdapter { _, _ -> FutureSetViewHolder(this, viewModel,"1") }
 
     /**
      * 套保
      * @param savedInstanceState Bundle?
      */
     private val addRoleHedgeAdapter: BaseAdapter<AccMgrBizGroupSetData, FutureSetViewHolder> =
-        BaseAdapter { _, _ -> FutureSetViewHolder(this, viewModel) }
+        BaseAdapter { _, _ -> FutureSetViewHolder(this, viewModel,"2") }
+
+    /**
+     * 套利是否展开 0展开 1 闭合
+     */
+    val isClickedArbitrage : MutableLiveData<Int> = MutableLiveData<Int>().apply { value = 0 }
+
+    /**
+     * 套保是否展开 0 展开 1 闭合
+     */
+    val isClickedHedge : MutableLiveData<Int> = MutableLiveData<Int>().apply { value = 0 }
+
+    val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryAccMgrBizGroupSet()
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
             viewModel.queryAccMgrBizGroupSet()
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {
@@ -46,11 +69,11 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
                 }
                 // 新增角色设置
                 commonMenuButton(R.mipmap.add_new) {
-//                    val intent = Intent()
-//                    intent.putExtra("type","1")
-//                    intent.putExtra("data", AccMgrRoleData())
-//                    intent.setClass(context, AddRoleSetActivity::class.java)
-//                    ActivityUtils.startActivity(intent)
+                    val intent = Intent()
+                    intent.putExtra("type","1")
+                    intent.putExtra("bussinessType","1")//套利
+                    intent.setClass(context,AddFutureRoleActivity::class.java)
+                    ActivityUtils.startActivity(intent)
                 }
             }
 
@@ -60,7 +83,11 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
                         gravity = Gravity.CENTER_VERTICAL
                         imageView {
                             onThrottleFirstClick {
-
+                                if (isClickedArbitrage.value == 0){
+                                    isClickedArbitrage.postValue(1)
+                                }else{
+                                    isClickedArbitrage.postValue(0)
+                                }
                             }
                             imageResource = R.mipmap.second_list_floding
                         }.lparams(autoSize(43), autoSize(43))
@@ -77,7 +104,11 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
 
                         imageView {
                             onThrottleFirstClick {
-
+                                val intent = Intent()
+                                intent.putExtra("type","1")
+                                intent.putExtra("bussinessType","1")//套利
+                                intent.setClass(context,AddFutureRoleActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             imageResource = R.mipmap.rma_account_add
                         }.lparams(autoSize(43), autoSize(43)) {
@@ -87,18 +118,76 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
                         marginStart = autoSize(102)
                     }
                     recyclerView {
-                        background = resources.getDrawable(R.color.add_role_bg_color)
+                        isClickedArbitrage.bindOptional(context){
+                            if (it == 0){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                        }
+                        background = resources.getDrawable(R.color.white)
+
                         adapter = addRoleArbitrageAdapter
-                    }.lparams(matchParent, wrapContent)
+                    }.lparams(matchParent, wrapContent){
+                        marginStart = autoSize(100)
+                        marginEnd = autoSize(80)
+                    }
+
                     viewModel.futureArbitrageSetDataList.bindOptional(context){
                         addRoleArbitrageAdapter.setNewData(it)
                     }
 
+                    verticalLayout {
+                        isClickedArbitrage.bindOptional(context){
+                            if (it == 0){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                        }
+                        backgroundResource = R.drawable.rma_list_item_bg
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "全部品种"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_blue_color
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(32)
+                            }
+                        }.lparams(matchParent, autoSize(95))
+
+                        view {
+                            background = resources.getDrawable(R.color.rma_blue_color)
+                        }.lparams(matchParent, autoSize(1)){
+                            marginStart = autoSize(32)
+                            marginEnd = autoSize(32)
+                        }
+
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "全部账户"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(32)
+                            }
+                        }.lparams(matchParent, autoSize(95))
+                    }.lparams(matchParent, autoSize(192)){
+                        marginStart = autoSize(100)
+                        marginEnd = autoSize(80)
+                    }
+
                     linearLayout {
                         gravity = Gravity.CENTER_VERTICAL
                         imageView {
                             onThrottleFirstClick {
-
+                                if (isClickedHedge.value == 0){
+                                    isClickedHedge.postValue(1)
+                                }else{
+                                    isClickedHedge.postValue(0)
+                                }
                             }
                             imageResource = R.mipmap.second_list_floding
                         }.lparams(autoSize(43), autoSize(43))
@@ -115,7 +204,11 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
 
                         imageView {
                             onThrottleFirstClick {
-
+                                val intent = Intent()
+                                intent.putExtra("type","1")
+                                intent.putExtra("bussinessType","2")//套保
+                                intent.setClass(context,AddFutureRoleActivity::class.java)
+                                ActivityUtils.startActivity(intent)
                             }
                             imageResource = R.mipmap.rma_account_add
                         }.lparams(autoSize(43), autoSize(43)) {
@@ -126,12 +219,65 @@ class FutureSetActivity : BaseActivity<FutureSetViewModel>() {
                     }
 
                     recyclerView {
-                        background = resources.getDrawable(R.color.add_role_bg_color)
+                        isClickedHedge.bindOptional(context){
+                            if (it == 0){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                        }
+                        background = resources.getDrawable(R.color.white)
                         adapter = addRoleHedgeAdapter
-                    }.lparams(matchParent, wrapContent)
+                    }.lparams(matchParent, wrapContent){
+                        marginStart = autoSize(100)
+                        marginEnd = autoSize(80)
+                    }
+
                     viewModel.futureHedgeSetDataList.bindOptional(context){
                         addRoleHedgeAdapter.setNewData(it)
                     }
+
+                    verticalLayout {
+                        isClickedHedge.bindOptional(context){
+                            if (it == 0){
+                                visibility = View.VISIBLE
+                            }else{
+                                visibility = View.GONE
+                            }
+                        }
+                        backgroundResource = R.drawable.rma_list_item_bg
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "全部品种"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_blue_color
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(32)
+                            }
+                        }.lparams(matchParent, autoSize(95))
+
+                        view {
+                            background = resources.getDrawable(R.color.rma_blue_color)
+                        }.lparams(matchParent, autoSize(1)){
+                            marginStart = autoSize(32)
+                            marginEnd = autoSize(32)
+                        }
+
+                        linearLayout {
+                            gravity = Gravity.CENTER_VERTICAL
+                            textView {
+                                text = "全部账户"
+                                textSizeAuto = 29
+                                textColorInt = R.color.rma_black_33
+                            }.lparams(wrapContent, wrapContent){
+                                marginStart = autoSize(32)
+                            }
+                        }.lparams(matchParent, autoSize(95))
+                    }.lparams(matchParent, autoSize(192)){
+                        marginStart = autoSize(100)
+                        marginEnd = autoSize(80)
+                    }
                 }
             }
         }

+ 85 - 9
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetViewHolder.kt

@@ -1,6 +1,8 @@
 package cn.muchinfo.rma.view.base.home.accountmanager.futureset
 
+import android.content.Intent
 import android.view.Gravity
+import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import androidx.recyclerview.widget.StaggeredGridLayoutManager
 import cn.muchinfo.rma.R
@@ -8,11 +10,11 @@ import cn.muchinfo.rma.global.data.AccMgrBizGroupSetData
 import cn.muchinfo.rma.global.data.AccMgrRoleMenuData
 import cn.muchinfo.rma.global.data.Acclist
 import cn.muchinfo.rma.lifecycle.bindOptional
-import cn.muchinfo.rma.view.autoWidget.autoSize
-import cn.muchinfo.rma.view.autoWidget.recyclerView
-import cn.muchinfo.rma.view.autoWidget.textColorInt
-import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleSetActivity
 import cn.muchinfo.rma.view.base.home.rolemanagement.AddRoleViewHolder
+import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
@@ -22,9 +24,10 @@ import org.jetbrains.anko.*
  * @property activity AppCompatActivity
  * @property viewModel FutureSetViewModel
  * @property itemSize IntArray
+ * type 1 套利 2套保
  * @constructor
  */
-class FutureSetViewHolder(private val activity : AppCompatActivity,private val viewModel: FutureSetViewModel) : BaseViewHolder<AccMgrBizGroupSetData>(activity){
+class FutureSetViewHolder(private val activity : AppCompatActivity,private val viewModel: FutureSetViewModel,private val type :String) : BaseViewHolder<AccMgrBizGroupSetData>(activity){
     override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
 
     private val addRoleAdapter: BaseAdapter<Acclist, FutureAccountViewHolder> =
@@ -32,6 +35,14 @@ class FutureSetViewHolder(private val activity : AppCompatActivity,private val v
 
     override fun _FrameLayout.createContentView() {
         verticalLayout {
+            backgroundResource = R.drawable.rma_list_item_bg
+            onThrottleFirstClick {
+                if (type == "1"){
+                    viewModel.setOnClickArbitrageItem(data.value?.wrName ?: "")
+                }else{
+                    viewModel.setOnClickHedgeItem(data.value?.wrName ?: "")
+                }
+            }
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
@@ -40,11 +51,23 @@ class FutureSetViewHolder(private val activity : AppCompatActivity,private val v
                     }
                     textSizeAuto = 29
                     textColorInt = R.color.rma_blue_color
-                }.lparams(wrapContent, wrapContent)
-            }.lparams(matchParent, autoSize(92))
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(32)
+                }
+            }.lparams(matchParent, wrapContent){
+                topMargin = autoSize(32)
+                bottomMargin = autoSize(22)
+            }
+
+            view {
+                background = resources.getDrawable(R.color.rma_blue_color)
+            }.lparams(matchParent, autoSize(1)){
+                marginStart = autoSize(32)
+                marginEnd = autoSize(32)
+            }
 
             recyclerView {
-                val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
+                val staggeredGridLayoutManager = StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
                 layoutManager = staggeredGridLayoutManager
                 adapter = addRoleAdapter
             }.lparams(matchParent, wrapContent)
@@ -52,7 +75,60 @@ class FutureSetViewHolder(private val activity : AppCompatActivity,private val v
             data.bindOptional(context){
                 addRoleAdapter.setNewData(it?.acclist)
             }
-        }.lparams(matchParent, wrapContent)
+
+            // 控制区
+            linearLayout {
+                data.bindOptional(context) {
+                    if (it?.indexSelect == 0) {
+                        visibility = View.GONE
+                    } else if (it?.indexSelect == 1) {
+                        visibility = View.VISIBLE
+                    }
+                }
+                gravity = Gravity.CENTER_VERTICAL
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+                        val intent = Intent()
+                        intent.putExtra("type","2")
+                        intent.putExtra("bussinessType","1")//套利
+                        intent.putExtra("data",data.value)
+                        intent.setClass(context,AddFutureRoleActivity::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 {
+                        viewModel.ErmcpBizGroupReq(
+                            BizGroupID = data.value?.bizgroupid?.toLong() ?: 0,
+                            BizType = data.value?.biztype?.toInt() ?: 0,
+                            OptType = 3
+                        ){
+                            viewModel.queryAccMgrBizGroupSet()
+                        }
+                    }
+                    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(36)
+                }
+            }.lparams(matchParent, autoSize(72))
+
+        }.lparams(matchParent, wrapContent){
+            bottomMargin = autoSize(12)
+        }
     }
 
 }

+ 259 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureset/FutureSetViewModel.kt

@@ -2,9 +2,16 @@ package cn.muchinfo.rma.view.base.home.accountmanager.futureset
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.AccMgrBizGroupSetData
+import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.netManage.base.InteractiveException
+import cn.muchinfo.rma.protobuf.protoclasses.ManageServiceMI2
 import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.autoWidget.toArrayList
 import cn.muchinfo.rma.view.base.BaseViewModel
+import com.blankj.utilcode.util.TimeUtils
+import kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 账户管理下的期货设置的viewmodel
@@ -12,6 +19,11 @@ import cn.muchinfo.rma.view.base.BaseViewModel
 class FutureSetViewModel : BaseViewModel(){
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      * 期货账户设置的列表数据(套利)
      */
     val futureArbitrageSetDataList : MutableLiveData<List<AccMgrBizGroupSetData>> = MutableLiveData()
@@ -22,6 +34,17 @@ class FutureSetViewModel : BaseViewModel(){
     val futureHedgeSetDataList : MutableLiveData<List<AccMgrBizGroupSetData>> = MutableLiveData()
 
     /**
+     * 现货品种正常列表
+     */
+    val wrStandardnormalList: MutableLiveData<List<DeliveryGoodsData>> = MutableLiveData()
+
+
+    /**
+     * 新增登录账号时,可选择的期货账户列表
+     */
+    val futureDataList : MutableLiveData<List<AccMgrTaaccountSonData>> = MutableLiveData()
+
+    /**
      * 查询业务类型分组(账户管理/账户设置)
      */
     fun queryAccMgrBizGroupSet(){
@@ -36,6 +59,46 @@ class FutureSetViewModel : BaseViewModel(){
     }
 
     /**
+     * 期货账户设置套利的item点击展开事件
+     * @param wrName String
+     */
+    fun setOnClickArbitrageItem(wrName : String){
+        val newDataList = arrayListOf<AccMgrBizGroupSetData>()
+        futureArbitrageSetDataList.value?.forEach {
+            if (wrName == it.wrName){
+                if (it.indexSelect == 0){
+                    newDataList.add(it.copy(indexSelect = 1))
+                }else{
+                    newDataList.add(it.copy(indexSelect = 0))
+                }
+            }else{
+                newDataList.add(it)
+            }
+        }
+        futureArbitrageSetDataList.postValue(newDataList)
+    }
+
+    /**
+     * 期货账户设置套保的item点击展开事件
+     * @param wrName String
+     */
+    fun setOnClickHedgeItem(wrName : String){
+        val newDataList = arrayListOf<AccMgrBizGroupSetData>()
+        futureHedgeSetDataList.value?.forEach {
+            if (wrName == it.wrName){
+                if (it.indexSelect == 0){
+                    newDataList.add(it.copy(indexSelect = 1))
+                }else{
+                    newDataList.add(it.copy(indexSelect = 0))
+                }
+            }else{
+                newDataList.add(it)
+            }
+        }
+        futureHedgeSetDataList.postValue(newDataList)
+    }
+
+    /**
      * 对
      * @param oldList List<AccMgrBizGroupSetData>
      */
@@ -46,13 +109,21 @@ class FutureSetViewModel : BaseViewModel(){
             if (it.biztype == "1"){//1-套保 2-套利
                 var wrName = ""
                 it.wrlist?.forEach {data ->
-                    wrName = wrName + "," + data.deliverygoodsname
+                    if (wrName.isNullOrEmpty()){
+                        wrName = data.deliverygoodsname ?: ""
+                    }else{
+                        wrName = wrName + "," + data.deliverygoodsname
+                    }
                 }
                 futureHedgeSetDataNewList.add(it.copy(wrName = wrName))
-            }else if (it.biztype == "2"){
+            }else {
                 var wrName = ""
                 it.wrlist?.forEach {data ->
-                    wrName = wrName + "," + data.deliverygoodsname
+                    if (wrName.isNullOrEmpty()){
+                        wrName = data.deliverygoodsname ?: ""
+                    }else{
+                        wrName = wrName + "," + data.deliverygoodsname
+                    }
                 }
                 futureArbitrageSetDataNewList.add(it.copy(wrName = wrName))
             }
@@ -61,4 +132,188 @@ class FutureSetViewModel : BaseViewModel(){
         futureArbitrageSetDataList.postValue(futureArbitrageSetDataNewList)
     }
 
+    /**
+     * 查询现货品种
+     * @param type String  0-新增 1-修改
+     */
+    fun queryDeliveryGoods(type : String,data : AccMgrBizGroupSetData = AccMgrBizGroupSetData()) {
+        val params = mutableMapOf<String, String>().apply {
+            put("areauserid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            if (type == "1"){
+                put("excludecfg", "1")
+            }
+        }
+        MyApplication.getInstance()?.commodityManager?.queryDeliveryGoods(params = params) { isSuccess, respData, _ ->
+            if (isSuccess) {
+//                val newList = respData?.toArrayList()
+//                newList?.sortWith(Comparator { t1, t2 ->
+//                    (TimeUtils.string2Millis(t1.createtime) - TimeUtils.string2Millis(t2.createtime)).toInt()
+//                })
+                if (type == "1"){
+                    wrStandardnormalList.postValue(respData)
+                }else{
+                    wrStandDataBackfill(data,respData ?: arrayListOf())
+                }
+            }
+        }
+    }
+
+    /**
+     * 新增期货设置账户时修改操作的现货商品的数据回填
+     */
+    fun wrStandDataBackfill(data : AccMgrBizGroupSetData,oldList : List<DeliveryGoodsData>){
+        val newWrStandList = arrayListOf<DeliveryGoodsData>()
+        oldList.forEach {result ->
+
+            val haveSelectData = data.wrlist?.find { it.deliverygoodsid == result.deliverygoodsid }
+            if (haveSelectData?.deliverygoodsid?.isNotEmpty() == true){
+                newWrStandList.add(result.copy(indexSelect = 1))
+            }else{
+                newWrStandList.add(result)
+            }
+        }
+        wrStandardnormalList.postValue(newWrStandList)
+    }
+
+
+    /**
+     * item内单个选项点击
+     */
+    fun setOnCloneClick(deliverygoodsid: String){
+        val newMenuDataList = arrayListOf<DeliveryGoodsData>()
+        val oldMenuDataList = wrStandardnormalList.value
+        oldMenuDataList?.forEach {
+            if (deliverygoodsid == it.deliverygoodsid){
+                if (it.indexSelect == 0){
+                    newMenuDataList.add(it.copy(indexSelect = 1))
+                }else{
+                    newMenuDataList.add(it.copy(indexSelect = 0))
+                }
+            }else{
+                newMenuDataList.add(it)
+            }
+        }
+        wrStandardnormalList.postValue(newMenuDataList)
+    }
+
+    /**
+     * 查询账户管理/期货账户
+     * type 1 新增 2 修改
+     */
+    fun queryAccMgrTaaccount(type : String,data : AccMgrBizGroupSetData = AccMgrBizGroupSetData()){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.accountManager?.queryAccMgrTaaccount(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+               resetAccMgrTaaccount(type ,respData ?: arrayListOf(),data)
+            }
+        }
+    }
+
+    /**
+     * 新增期货设置账户时修改操作的期货账户的数据回填
+     */
+    fun futureAccountDataBackfill(data : AccMgrBizGroupSetData,oldList : List<AccMgrTaaccountSonData>){
+        val newWrStandList = arrayListOf<AccMgrTaaccountSonData>()
+        oldList.forEach {result ->
+            val haveSelectData = data.acclist?.find { it.accountid == result.accountid }
+            if (haveSelectData?.accountid?.isNotEmpty() == true){
+                newWrStandList.add(result.copy(isSelect = 1))
+            }else{
+                newWrStandList.add(result)
+            }
+        }
+        futureDataList.postValue(newWrStandList)
+    }
+
+
+    /**
+     * 对期货账户的主列表和子列表进行合并
+     */
+    fun resetAccMgrTaaccount(type : String,oldList : List<AccMgrTaaccountData>,data : AccMgrBizGroupSetData = AccMgrBizGroupSetData()){
+        val newDataList = arrayListOf<AccMgrTaaccountSonData>()
+        oldList.forEach {
+            newDataList.add(it.mainAcc ?: AccMgrTaaccountSonData())
+            it.subacclist?.forEach {
+                newDataList.add(it)
+            }
+        }
+        if (type == "1"){
+            futureDataList.postValue(newDataList)
+        }else{
+            futureAccountDataBackfill(data = data,oldList = newDataList)
+        }
+
+    }
+
+    /**
+     * 新增登录账户中选择期货账户的数据变更
+     */
+    fun setOnClickLoginRoleChange(accountId : String){
+        val oldList = futureDataList.value
+        val newDataList = arrayListOf<AccMgrTaaccountSonData>()
+        oldList?.forEach {
+            if (accountId == it.accountid){
+                if (it.isSelect == 0){
+                    newDataList.add(it.copy(isSelect = 1))
+                }else{
+                    newDataList.add(it.copy(isSelect = 0))
+                }
+            }else{
+                newDataList.add(it)
+            }
+        }
+        futureDataList.postValue(newDataList)
+    }
+
+    /**
+     * 期货账户设置请求报文装箱
+    optional uint64 BizGroupID = 2; // uint64 分组ID(修改/删除必填)
+    optional int32 BizType = 3; // int32 业务类型 - 1:套保 2:套利
+    optional string Remark = 4; // string 新增/修改备注
+    optional int32 ApplySrc = 5; // int32 新增/修改来源 - 1:管理端 2:终端
+    optional uint64 ApplyId = 6; // uint64 新增/修改人
+    repeated ManageServiceMI2.ErmcpBizGroupSpotGoods SpotGoods = 7; // ErmcpBizGroupSpotGoods 期货账户分组商品
+    repeated ManageServiceMI2.ErmcpBizGroupTAAccount TAAccount = 8; // ErmcpBizGroupTAAccount 期货账户分组账户
+    optional int32 OptType = 9; // int32 操作类型 - 1:新增 2:修改 3:删除
+    optional uint64 AreaUserID = 10; // uint64 所属机构
+     */
+    fun ErmcpBizGroupReq(
+        BizGroupID : Long = 0,
+        BizType : Int,
+        Remark : String = "",
+        ApplySrc : Int = 2,
+        SpotGoods : List<ManageServiceMI2.ErmcpBizGroupSpotGoods> = arrayListOf(),
+        TAAccount : List<ManageServiceMI2.ErmcpBizGroupTAAccount> = arrayListOf(),
+        OptType : Int = 0,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.ErmcpBizGroupReq(
+                BizGroupID = BizGroupID,
+                BizType = BizType,
+                Remark = Remark,
+                ApplySrc = ApplySrc,
+                SpotGoods = SpotGoods,
+                TAAccount = TAAccount,
+                OptType = OptType
+            ){ isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+
 }

+ 0 - 35
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddSpotMarketPriceActivity.kt

@@ -1,35 +0,0 @@
-package cn.muchinfo.rma.view.base.home.contract
-
-import android.os.Bundle
-import cn.muchinfo.rma.R
-import cn.muchinfo.rma.view.autoWidget.commonLeftButton
-
-import cn.muchinfo.rma.view.autoWidget.commonTitle
-import cn.muchinfo.rma.view.autoWidget.topBar
-import cn.muchinfo.rma.view.base.BaseActivity
-
-import org.jetbrains.anko.verticalLayout
-
-/**
- * 市价
- */
-class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
-
-    override fun onCreate(savedInstanceState: Bundle?) {
-        super.onCreate(savedInstanceState)
-        verticalLayout {
-            background = resources.getDrawable(R.color.main_hit_bg_color)
-            //页面标题
-            topBar {
-                commonLeftButton()
-                commonTitle {
-                    text = "市价录入"
-                }
-            }
-
-
-
-        }
-    }
-
-}

+ 295 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/AddSpotMarketPriceActivity.kt

@@ -0,0 +1,295 @@
+package cn.muchinfo.rma.view.base.home.spotmarket
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.inputmethod.EditorInfo
+import android.widget.EditText
+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.BaseActivity
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceViewModel
+import mtp.polymer.com.autowidget.dialog.SelectData
+import org.jetbrains.anko.*
+
+/**
+ * 市价的录入和修改
+ */
+class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
+
+    /**
+     * type 1 录入 2 修改
+     */
+    val type by lazy { intent.getStringExtra("type") }
+
+    /**
+     * 选择的现货品种
+     */
+    val selectDeliveryGoods : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 选择的品类
+     */
+    val selectCategory : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 选择的品牌
+     */
+    val selectBrand : MutableLiveData<SelectData> = MutableLiveData()
+
+    /**
+     * 输入的现货价格
+     */
+    lateinit var spot_price : EditText
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    if (type == "1"){
+                        text = "市价录入"
+                    }else{
+                        text = "修改市价"
+                    }
+                }
+            }
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
+//                            value = "采购合同"
+//                        ),
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
+//                            value = "销售合同"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
+//                        contractType.postValue(this)
+//                    }
+                }
+                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 {
+                    selectDeliveryGoods.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))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
+//                            value = "采购合同"
+//                        ),
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
+//                            value = "销售合同"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
+//                        contractType.postValue(this)
+//                    }
+                }
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    text = "品        类"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                textView {
+                    selectCategory.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))
+
+            itemView()
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+                onThrottleFirstClick {
+//                    val selectDataList = arrayListOf(
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_BUY.toString(),
+//                            value = "采购合同"
+//                        ),
+//                        SelectData(
+//                            id = MTPEnums.CONTRACT_TYPE_SELL.toString(),
+//                            value = "销售合同"
+//                        )
+//                    )
+//                    creatBottomSheetDialog("请选择合同类型", selectDataList) {
+//                        contractType.postValue(this)
+//                    }
+                }
+                textView {
+                    visibility = View.INVISIBLE
+                    text = "*"
+                    textColorInt = R.color.rma_star_color
+                    textSizeAuto = 31
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(37)
+                }
+
+                textView {
+                    text = "品        牌"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                textView {
+                    selectBrand.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))
+
+            itemView()
+
+            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 {
+                    text = "现货价格"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(10)
+                }
+
+                editText {
+                    spot_price = this
+                    hint = "请输入合同编号"
+                    background = null
+                    inputType = EditorInfo.TYPE_CLASS_NUMBER
+                    setDecimalInputType()
+                    hintColorStr = "#CCCCCC"
+                    textSizeAuto = 31
+                    textColorStr = "#333333"
+                }.lparams(matchParent, autoSize(132)) {
+                    marginStart = autoSize(80)
+                }
+            }.lparams(matchParent, autoSize(132))
+
+            view {  }.lparams(autoSize(1),0,1f)
+
+            linearLayout {
+                background = resources.getDrawable(R.color.white)
+                gravity = Gravity.CENTER_VERTICAL
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundResource = R.mipmap.rma_save_info_bg
+                    text = "完成"
+                    textSizeAuto = 38
+                    textColorInt = R.color.rma_star_color
+                }.lparams(matchParent, autoSize(119)) {
+                    marginStart = autoSize(60)
+                    marginEnd = autoSize(60)
+                }
+            }.lparams(matchParent, autoSize(144))
+        }
+    }
+
+}

+ 9 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceActivity.kt → RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceActivity.kt

@@ -1,4 +1,4 @@
-package cn.muchinfo.rma.view.base.home.contract
+package cn.muchinfo.rma.view.base.home.spotmarket
 
 import android.content.Intent
 import android.os.Bundle
@@ -26,7 +26,12 @@ class SpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
     private lateinit var statusLayout: StatusLayout
 
     private val spotMarketPriceAdapter: BaseAdapter<String, SpotMarketPriceViewHolder> =
-        BaseAdapter { _, _ -> SpotMarketPriceViewHolder(this, viewModel) }
+        BaseAdapter { _, _ ->
+            SpotMarketPriceViewHolder(
+                this,
+                viewModel
+            )
+        }
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -41,7 +46,8 @@ class SpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
                 // 新增角色设置
                 commonMenuButton(R.mipmap.add_new) {
                     val intent = Intent()
-                    intent.setClass(context,AddSpotMarketPriceActivity::class.java)
+                    intent.setClass(context,
+                        AddSpotMarketPriceActivity::class.java)
                     ActivityUtils.startActivity(intent)
                 }
             }

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceViewHolder.kt → RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt

@@ -1,7 +1,6 @@
-package cn.muchinfo.rma.view.base.home.contract
+package cn.muchinfo.rma.view.base.home.spotmarket
 
 import android.view.Gravity
-import android.view.View
 import androidx.appcompat.app.AppCompatActivity
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.lifecycle.bindOptional
@@ -9,6 +8,7 @@ import cn.muchinfo.rma.view.autoWidget.autoSize
 import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
 import cn.muchinfo.rma.view.autoWidget.textColorInt
 import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.contract.emptyView
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceViewModel.kt → RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewModel.kt

@@ -1,4 +1,4 @@
-package cn.muchinfo.rma.view.base.home.contract
+package cn.muchinfo.rma.view.base.home.spotmarket
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.view.base.BaseViewModel