Sfoglia il codice sorgente

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

Liu.bolan 4 anni fa
parent
commit
1025725a4c

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

@@ -425,15 +425,15 @@ class AccountManager {
      */
     fun queryAccMgrRoleMenu(
         params: Map<String, String>,
-        responseBack: (isSuccess: Boolean, respData: List<AccMgrRoleData>?, error: Error?) -> Unit
+        responseBack: (isSuccess: Boolean, respData: List<AccMgrRoleMenuData>?, error: Error?) -> Unit
     ) {
         MyOkHttpUtils().query(
             URL = SPUtils.getInstance()
                 .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAccMgrRoleMenu",
             params = params,
             type = "1",
-            callback = object : ResponseCallback<BaseResult<List<AccMgrRoleData>>>() {
-                override fun onResponse(response: BaseResult<List<AccMgrRoleData>>?, id: Int) {
+            callback = object : ResponseCallback<BaseResult<List<AccMgrRoleMenuData>>>() {
+                override fun onResponse(response: BaseResult<List<AccMgrRoleMenuData>>?, id: Int) {
                     responseBack(true, response?.data, null)
                 }
 

+ 4 - 2
RMA/app/src/main/java/cn/muchinfo/rma/business/future/adapter/FutureAdapter.kt

@@ -55,7 +55,8 @@ object FutureAdapter {
                 loginInfo.userID,
                 GlobalDataCollection.instance?.accountId ?: 0,
                 data.goodsID,
-                data.marketID
+                data.marketID,
+                loginInfo.clientID
             )
         )
 
@@ -108,7 +109,8 @@ object FutureAdapter {
                 loginInfo.userID,
                 GlobalDataCollection.instance?.accountId ?: 0,
                 goodsId,
-                marketId
+                marketId,
+                loginInfo.clientID
             )
         )
 

+ 4 - 1
RMA/app/src/main/java/cn/muchinfo/rma/business/global/MessageHeadModel.kt

@@ -17,7 +17,7 @@ class MessageHeadModel {
          * @param marketID Int
          * @return Common.MessageHead.Builder
          */
-        fun getHead(funCode: Int, userID: Int, accountID: Long, goodsID: Int, marketID: Int): Common.MessageHead.Builder {
+        fun getHead(funCode: Int, userID: Int, accountID: Long, goodsID: Int, marketID: Int,accountID2: Long = 0): Common.MessageHead.Builder {
             val builder = Common.MessageHead.newBuilder()
             builder.funCode = funCode
             builder.accountID = accountID
@@ -25,6 +25,9 @@ class MessageHeadModel {
                 replace("-", "").substring(0, 16)
             builder.goodsID = goodsID
             builder.marketID = marketID
+            if (accountID2 != 0L){
+                builder.accountID2 = accountID2
+            }
 
             // 登录后报文需要
 

+ 21 - 17
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccMgrRoleMenuData.kt

@@ -7,18 +7,18 @@ import android.os.Parcelable
  * 账户管理角色详情(账户管理/角色设置/角色详情
  */
 data class AccMgrRoleMenuData(
-    val menu : List<RoleSonMenuData>? = arrayListOf(),
-    val subMenu : List<RoleSonMenuData>? = arrayListOf()
+    var Menu : RoleSonMenuData? = RoleSonMenuData(),
+    var SubMenu : List<RoleSonMenuData>? = arrayListOf()
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
-        parcel.createTypedArrayList(RoleSonMenuData),
+        parcel.readParcelable(RoleSonMenuData::class.java.classLoader),
         parcel.createTypedArrayList(RoleSonMenuData)
     ) {
     }
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
-        parcel.writeTypedList(menu)
-        parcel.writeTypedList(subMenu)
+        parcel.writeParcelable(Menu, flags)
+        parcel.writeTypedList(SubMenu)
     }
 
     override fun describeContents(): Int {
@@ -35,20 +35,22 @@ data class AccMgrRoleMenuData(
         }
     }
 
+
 }
 
 data class RoleSonMenuData(
-    val iconame : String? = "",
-    val menutype : String? = "",
-    val parentcode : String? = "",
-    val remark : String? = "",
-    val resourcecode : String? = "",
-    val resourcelevel : String? = "",
-    val resourcename : String? = "",
-    val roleid : String? = "",
-    val sort : String? = "",
-    val url : String? = "",
-    val userid : String? = ""
+    val iconame : String? = "",//菜单图标
+    val menutype : String? = "",//菜单类型 1:管理端 2:交易端 3:终端(企业云平台)
+    val parentcode : String? = "",//上级资源代码
+    val remark : String? = "",//菜单备注
+    val resourcecode : String? = "",//菜单代码
+    val resourcelevel : String? = "",//级别
+    val resourcename : String? = "",//菜单名称
+    val roleid : String? = "",//角色id
+    val sort : String? = "",//排序
+    val url : String? = "",//URL
+    val userid : String? = "",//用户id
+    var isSelcet : Int = 0//是否被选择
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readString(),
@@ -61,7 +63,8 @@ data class RoleSonMenuData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
-        parcel.readString()
+        parcel.readString(),
+        parcel.readInt()
     ) {
     }
 
@@ -77,6 +80,7 @@ data class RoleSonMenuData(
         parcel.writeString(sort)
         parcel.writeString(url)
         parcel.writeString(userid)
+        parcel.writeInt(isSelcet)
     }
 
     override fun describeContents(): Int {

File diff suppressed because it is too large
+ 212 - 116
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/ManageServiceMI2.java


+ 290 - 22
RMA/app/src/main/java/cn/muchinfo/rma/protobuf/protoclasses/SystemMI1.java

@@ -3799,6 +3799,44 @@ public final class SystemMI1 {
      */
     com.google.protobuf.ByteString
         getLoginCodeBytes();
+
+    /**
+     * <pre>
+     * 终端系统信息
+     * </pre>
+     *
+     * <code>optional bytes ClientSystemInfo = 17;</code>
+     * @return Whether the clientSystemInfo field is set.
+     */
+    boolean hasClientSystemInfo();
+    /**
+     * <pre>
+     * 终端系统信息
+     * </pre>
+     *
+     * <code>optional bytes ClientSystemInfo = 17;</code>
+     * @return The clientSystemInfo.
+     */
+    com.google.protobuf.ByteString getClientSystemInfo();
+
+    /**
+     * <pre>
+     * 终端ID(登陆服务分配,用于通道交易关联链路)
+     * </pre>
+     *
+     * <code>optional uint64 ClientID = 18;</code>
+     * @return Whether the clientID field is set.
+     */
+    boolean hasClientID();
+    /**
+     * <pre>
+     * 终端ID(登陆服务分配,用于通道交易关联链路)
+     * </pre>
+     *
+     * <code>optional uint64 ClientID = 18;</code>
+     * @return The clientID.
+     */
+    long getClientID();
   }
   /**
    * <pre>
@@ -3821,6 +3859,7 @@ public final class SystemMI1 {
       accountIDs_ = emptyLongList();
       token_ = "";
       loginCode_ = "";
+      clientSystemInfo_ = com.google.protobuf.ByteString.EMPTY;
     }
 
     @java.lang.Override
@@ -3961,6 +4000,16 @@ public final class SystemMI1 {
               loginCode_ = bs;
               break;
             }
+            case 138: {
+              bitField0_ |= 0x00008000;
+              clientSystemInfo_ = input.readBytes();
+              break;
+            }
+            case 144: {
+              bitField0_ |= 0x00010000;
+              clientID_ = input.readUInt64();
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -4551,6 +4600,60 @@ public final class SystemMI1 {
       }
     }
 
+    public static final int CLIENTSYSTEMINFO_FIELD_NUMBER = 17;
+    private com.google.protobuf.ByteString clientSystemInfo_;
+    /**
+     * <pre>
+     * 终端系统信息
+     * </pre>
+     *
+     * <code>optional bytes ClientSystemInfo = 17;</code>
+     * @return Whether the clientSystemInfo field is set.
+     */
+    @java.lang.Override
+    public boolean hasClientSystemInfo() {
+      return ((bitField0_ & 0x00008000) != 0);
+    }
+    /**
+     * <pre>
+     * 终端系统信息
+     * </pre>
+     *
+     * <code>optional bytes ClientSystemInfo = 17;</code>
+     * @return The clientSystemInfo.
+     */
+    @java.lang.Override
+    public com.google.protobuf.ByteString getClientSystemInfo() {
+      return clientSystemInfo_;
+    }
+
+    public static final int CLIENTID_FIELD_NUMBER = 18;
+    private long clientID_;
+    /**
+     * <pre>
+     * 终端ID(登陆服务分配,用于通道交易关联链路)
+     * </pre>
+     *
+     * <code>optional uint64 ClientID = 18;</code>
+     * @return Whether the clientID field is set.
+     */
+    @java.lang.Override
+    public boolean hasClientID() {
+      return ((bitField0_ & 0x00010000) != 0);
+    }
+    /**
+     * <pre>
+     * 终端ID(登陆服务分配,用于通道交易关联链路)
+     * </pre>
+     *
+     * <code>optional uint64 ClientID = 18;</code>
+     * @return The clientID.
+     */
+    @java.lang.Override
+    public long getClientID() {
+      return clientID_;
+    }
+
     private byte memoizedIsInitialized = -1;
     @java.lang.Override
     public final boolean isInitialized() {
@@ -4613,6 +4716,12 @@ public final class SystemMI1 {
       if (((bitField0_ & 0x00004000) != 0)) {
         com.google.protobuf.GeneratedMessageV3.writeString(output, 16, loginCode_);
       }
+      if (((bitField0_ & 0x00008000) != 0)) {
+        output.writeBytes(17, clientSystemInfo_);
+      }
+      if (((bitField0_ & 0x00010000) != 0)) {
+        output.writeUInt64(18, clientID_);
+      }
       unknownFields.writeTo(output);
     }
 
@@ -4688,6 +4797,14 @@ public final class SystemMI1 {
       if (((bitField0_ & 0x00004000) != 0)) {
         size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, loginCode_);
       }
+      if (((bitField0_ & 0x00008000) != 0)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBytesSize(17, clientSystemInfo_);
+      }
+      if (((bitField0_ & 0x00010000) != 0)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeUInt64Size(18, clientID_);
+      }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
       return size;
@@ -4780,6 +4897,16 @@ public final class SystemMI1 {
         if (!getLoginCode()
             .equals(other.getLoginCode())) return false;
       }
+      if (hasClientSystemInfo() != other.hasClientSystemInfo()) return false;
+      if (hasClientSystemInfo()) {
+        if (!getClientSystemInfo()
+            .equals(other.getClientSystemInfo())) return false;
+      }
+      if (hasClientID() != other.hasClientID()) return false;
+      if (hasClientID()) {
+        if (getClientID()
+            != other.getClientID()) return false;
+      }
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
     }
@@ -4857,6 +4984,15 @@ public final class SystemMI1 {
         hash = (37 * hash) + LOGINCODE_FIELD_NUMBER;
         hash = (53 * hash) + getLoginCode().hashCode();
       }
+      if (hasClientSystemInfo()) {
+        hash = (37 * hash) + CLIENTSYSTEMINFO_FIELD_NUMBER;
+        hash = (53 * hash) + getClientSystemInfo().hashCode();
+      }
+      if (hasClientID()) {
+        hash = (37 * hash) + CLIENTID_FIELD_NUMBER;
+        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+            getClientID());
+      }
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -5031,6 +5167,10 @@ public final class SystemMI1 {
         bitField0_ = (bitField0_ & ~0x00004000);
         loginCode_ = "";
         bitField0_ = (bitField0_ & ~0x00008000);
+        clientSystemInfo_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00010000);
+        clientID_ = 0L;
+        bitField0_ = (bitField0_ & ~0x00020000);
         return this;
       }
 
@@ -5128,6 +5268,14 @@ public final class SystemMI1 {
           to_bitField0_ |= 0x00004000;
         }
         result.loginCode_ = loginCode_;
+        if (((from_bitField0_ & 0x00010000) != 0)) {
+          to_bitField0_ |= 0x00008000;
+        }
+        result.clientSystemInfo_ = clientSystemInfo_;
+        if (((from_bitField0_ & 0x00020000) != 0)) {
+          result.clientID_ = clientID_;
+          to_bitField0_ |= 0x00010000;
+        }
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -5238,6 +5386,12 @@ public final class SystemMI1 {
           loginCode_ = other.loginCode_;
           onChanged();
         }
+        if (other.hasClientSystemInfo()) {
+          setClientSystemInfo(other.getClientSystemInfo());
+        }
+        if (other.hasClientID()) {
+          setClientID(other.getClientID());
+        }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
         return this;
@@ -6459,6 +6613,119 @@ public final class SystemMI1 {
         onChanged();
         return this;
       }
+
+      private com.google.protobuf.ByteString clientSystemInfo_ = com.google.protobuf.ByteString.EMPTY;
+      /**
+       * <pre>
+       * 终端系统信息
+       * </pre>
+       *
+       * <code>optional bytes ClientSystemInfo = 17;</code>
+       * @return Whether the clientSystemInfo field is set.
+       */
+      @java.lang.Override
+      public boolean hasClientSystemInfo() {
+        return ((bitField0_ & 0x00010000) != 0);
+      }
+      /**
+       * <pre>
+       * 终端系统信息
+       * </pre>
+       *
+       * <code>optional bytes ClientSystemInfo = 17;</code>
+       * @return The clientSystemInfo.
+       */
+      @java.lang.Override
+      public com.google.protobuf.ByteString getClientSystemInfo() {
+        return clientSystemInfo_;
+      }
+      /**
+       * <pre>
+       * 终端系统信息
+       * </pre>
+       *
+       * <code>optional bytes ClientSystemInfo = 17;</code>
+       * @param value The clientSystemInfo to set.
+       * @return This builder for chaining.
+       */
+      public Builder setClientSystemInfo(com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00010000;
+        clientSystemInfo_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <pre>
+       * 终端系统信息
+       * </pre>
+       *
+       * <code>optional bytes ClientSystemInfo = 17;</code>
+       * @return This builder for chaining.
+       */
+      public Builder clearClientSystemInfo() {
+        bitField0_ = (bitField0_ & ~0x00010000);
+        clientSystemInfo_ = getDefaultInstance().getClientSystemInfo();
+        onChanged();
+        return this;
+      }
+
+      private long clientID_ ;
+      /**
+       * <pre>
+       * 终端ID(登陆服务分配,用于通道交易关联链路)
+       * </pre>
+       *
+       * <code>optional uint64 ClientID = 18;</code>
+       * @return Whether the clientID field is set.
+       */
+      @java.lang.Override
+      public boolean hasClientID() {
+        return ((bitField0_ & 0x00020000) != 0);
+      }
+      /**
+       * <pre>
+       * 终端ID(登陆服务分配,用于通道交易关联链路)
+       * </pre>
+       *
+       * <code>optional uint64 ClientID = 18;</code>
+       * @return The clientID.
+       */
+      @java.lang.Override
+      public long getClientID() {
+        return clientID_;
+      }
+      /**
+       * <pre>
+       * 终端ID(登陆服务分配,用于通道交易关联链路)
+       * </pre>
+       *
+       * <code>optional uint64 ClientID = 18;</code>
+       * @param value The clientID to set.
+       * @return This builder for chaining.
+       */
+      public Builder setClientID(long value) {
+        bitField0_ |= 0x00020000;
+        clientID_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <pre>
+       * 终端ID(登陆服务分配,用于通道交易关联链路)
+       * </pre>
+       *
+       * <code>optional uint64 ClientID = 18;</code>
+       * @return This builder for chaining.
+       */
+      public Builder clearClientID() {
+        bitField0_ = (bitField0_ & ~0x00020000);
+        clientID_ = 0L;
+        onChanged();
+        return this;
+      }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -14947,7 +15214,7 @@ public final class SystemMI1 {
       "\t \001(\t\022\021\n\tLoginPort\030\n \001(\r\022\020\n\010DeviceID\030\013 \001" +
       "(\t\022\027\n\017EnvironmentInfo\030\014 \001(\t\022\021\n\tLoginCode" +
       "\030\r \001(\t\022\030\n\020ClientSystemInfo\030\016 \001(\014\022\023\n\013Clie" +
-      "ntAppID\030\017 \001(\t\"\330\002\n\010LoginRsp\022\034\n\006Header\030\001 \001" +
+      "ntAppID\030\017 \001(\t\"\204\003\n\010LoginRsp\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\022\017\n\007LoginID\030\004 \001(\004\022\025\n\rLoginUser" +
       "Type\030\005 \001(\r\022\025\n\rAccountStatus\030\006 \001(\r\022\016\n\006Use" +
@@ -14956,26 +15223,27 @@ public final class SystemMI1 {
       "\030\013 \001(\004\022\025\n\rHasUpdatedPwd\030\014 \001(\r\022\023\n\013PwdWron" +
       "gCnt\030\r \001(\r\022\027\n\017PwdWrongLockCnt\030\016 \001(\r\022\030\n\020L" +
       "oginLockHourNum\030\017 \001(\r\022\021\n\tLoginCode\030\020 \001(\t" +
-      "\"m\n\tLogoutReq\022\034\n\006Header\030\001 \001(\0132\014.MessageH" +
-      "ead\022\017\n\007LoginID\030\002 \001(\004\022\r\n\005Token\030\003 \001(\t\022\017\n\007L" +
-      "oginIp\030\004 \001(\t\022\021\n\tLoginPort\030\005 \001(\r\"K\n\tLogou" +
-      "tRsp\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\"t\n\rTokenChe" +
-      "ckReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022\017\n\007L" +
-      "oginID\030\002 \001(\004\022\r\n\005Token\030\003 \001(\t\022\022\n\nSystemTim" +
-      "e\030\004 \001(\004\022\021\n\tCheckType\030\005 \001(\r\"\332\001\n\rTokenChec" +
-      "kRsp\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\017\n\007LoginID\030" +
-      "\004 \001(\004\022\023\n\013TokenStatus\030\005 \001(\r\022\025\n\rLoginUserT" +
-      "ype\030\006 \001(\r\022\016\n\006UserID\030\007 \001(\r\022\024\n\014MemberUserI" +
-      "D\030\010 \001(\r\022\022\n\nAccountIDs\030\t \003(\004\022\022\n\nSystemTim" +
-      "e\030\n \001(\004\"x\n\014ModifyPwdReq\022\034\n\006Header\030\001 \001(\0132" +
-      "\014.MessageHead\022\025\n\rModifyPwdType\030\002 \001(\r\022\023\n\013" +
-      "ModifyPwdID\030\003 \001(\004\022\016\n\006OldPwd\030\004 \001(\t\022\016\n\006New" +
-      "Pwd\030\005 \001(\t\"N\n\014ModifyPwdRsp\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(\tB?\n%cn.muchinfo.rma.protobuf.pr" +
-      "otoclassesZ\026com.muchinfo.mtp.proto"
+      "\022\030\n\020ClientSystemInfo\030\021 \001(\014\022\020\n\010ClientID\030\022" +
+      " \001(\004\"m\n\tLogoutReq\022\034\n\006Header\030\001 \001(\0132\014.Mess" +
+      "ageHead\022\017\n\007LoginID\030\002 \001(\004\022\r\n\005Token\030\003 \001(\t\022" +
+      "\017\n\007LoginIp\030\004 \001(\t\022\021\n\tLoginPort\030\005 \001(\r\"K\n\tL" +
+      "ogoutRsp\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\"t\n\rToke" +
+      "nCheckReq\022\034\n\006Header\030\001 \001(\0132\014.MessageHead\022" +
+      "\017\n\007LoginID\030\002 \001(\004\022\r\n\005Token\030\003 \001(\t\022\022\n\nSyste" +
+      "mTime\030\004 \001(\004\022\021\n\tCheckType\030\005 \001(\r\"\332\001\n\rToken" +
+      "CheckRsp\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\017\n\007Logi" +
+      "nID\030\004 \001(\004\022\023\n\013TokenStatus\030\005 \001(\r\022\025\n\rLoginU" +
+      "serType\030\006 \001(\r\022\016\n\006UserID\030\007 \001(\r\022\024\n\014MemberU" +
+      "serID\030\010 \001(\r\022\022\n\nAccountIDs\030\t \003(\004\022\022\n\nSyste" +
+      "mTime\030\n \001(\004\"x\n\014ModifyPwdReq\022\034\n\006Header\030\001 " +
+      "\001(\0132\014.MessageHead\022\025\n\rModifyPwdType\030\002 \001(\r" +
+      "\022\023\n\013ModifyPwdID\030\003 \001(\004\022\016\n\006OldPwd\030\004 \001(\t\022\016\n" +
+      "\006NewPwd\030\005 \001(\t\"N\n\014ModifyPwdRsp\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(\tB?\n%cn.muchinfo.rma.protobu" +
+      "f.protoclassesZ\026com.muchinfo.mtp.proto"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -14994,7 +15262,7 @@ public final class SystemMI1 {
     internal_static_SystemMI1_LoginRsp_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_SystemMI1_LoginRsp_descriptor,
-        new java.lang.String[] { "Header", "RetCode", "RetDesc", "LoginID", "LoginUserType", "AccountStatus", "UserID", "MemberUserID", "AccountIDs", "Token", "SystemTime", "HasUpdatedPwd", "PwdWrongCnt", "PwdWrongLockCnt", "LoginLockHourNum", "LoginCode", });
+        new java.lang.String[] { "Header", "RetCode", "RetDesc", "LoginID", "LoginUserType", "AccountStatus", "UserID", "MemberUserID", "AccountIDs", "Token", "SystemTime", "HasUpdatedPwd", "PwdWrongCnt", "PwdWrongLockCnt", "LoginLockHourNum", "LoginCode", "ClientSystemInfo", "ClientID", });
     internal_static_SystemMI1_LogoutReq_descriptor =
       getDescriptor().getMessageTypes().get(2);
     internal_static_SystemMI1_LogoutReq_fieldAccessorTable = new

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

@@ -12,6 +12,7 @@ object Constant {
 //    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"
 
     /**
      * 用sp存储基础url的key

+ 63 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleItemViewHolder.kt

@@ -0,0 +1,63 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import android.view.Gravity
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.RoleSonMenuData
+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 AddRoleItemViewHolder(private val activity : AppCompatActivity,private val viewModel: RoleSetViewModel,private val resourcecode : String) : BaseViewHolder<RoleSonMenuData>(activity){
+    override val itemSize: IntArray = intArrayOf(autoSize(300), wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        linearLayout {
+            onThrottleFirstClick {
+                viewModel.setOnCloneClick(resourcecode,dataIndex)
+            }
+            gravity = Gravity.CENTER_VERTICAL
+            imageView {
+
+                data.bindOptional(context){
+                    if (it?.isSelcet == 0){
+                        imageResource = R.mipmap.rma_normal_click
+                    }else{
+                        imageResource = R.mipmap.rma_select_click
+                    }
+                }
+            }.lparams(autoSize(38), autoSize(38)){
+                marginStart =  autoSize(36)
+            }
+
+            textView {
+                data.bindOptional(context){
+                    text = it?.resourcename
+                    if (it?.isSelcet == 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))
+    }
+
+}

+ 76 - 200
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleSetActivity.kt

@@ -6,16 +6,24 @@ import android.view.View
 import android.view.inputmethod.EditorInfo
 import android.widget.EditText
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.global.data.AccMgrRoleMenuData
+import cn.muchinfo.rma.global.data.RoleSonMenuData
+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 com.blankj.utilcode.util.ToastUtils
+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.*
 
 /**
  * 设置里的新增角色/角色详情
  */
-class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
+class AddRoleSetActivity : BaseActivity<RoleSetViewModel>() {
 
     /**
      * 1 新增 2修改 3 详情
@@ -23,30 +31,51 @@ class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
     val type by lazy { intent.getStringExtra("type") }
 
     /**
+     * 修改和详情时需要用到传入的数据
+     */
+    val data by lazy { intent.getParcelableExtra<AccMgrRoleData>("data") as AccMgrRoleData }
+
+    /**
      * 输入的角色名称
      */
-    lateinit var role_name_edittext : EditText
+    private lateinit var role_name_edittext: EditText
+
+    fun initData(){
+        if (type == "1"){
+            viewModel.queryAccMgrRoleMenu()
+        }else{
+            viewModel.queryAccMgrRoleMenu(roleid = data.autoid ?: "")
+        }
+    }
+
+    val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
+
+    private val addRoleAdapter: BaseAdapter<AccMgrRoleMenuData, AddRoleViewHolder> =
+        BaseAdapter { _, _ -> AddRoleViewHolder(this, viewModel,type ?: "") }
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            initData()
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {
                 commonLeftButton()
                 commonTitle {
-                    if (type == "1"){
+                    if (type == "1") {
                         text = "新增角色"
-                    }else if (type == "2"){
+                    } else if (type == "2") {
                         text = "修改角色信息"
-                    }else {
+                    } else {
                         text = "详情"
                     }
                 }
             }
 
             frameLayout {
-                scrollView {
+                nestedScrollView {
                     verticalLayout {
                         linearLayout {
                             gravity = Gravity.CENTER_VERTICAL
@@ -54,7 +83,7 @@ class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
                                 text = "角色名称"
                                 textColorInt = R.color.rma_black_33
                                 textSizeAuto = 31
-                            }.lparams(wrapContent, wrapContent){
+                            }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(37)
                             }
 
@@ -77,7 +106,7 @@ class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
                         }.lparams(matchParent, autoSize(104))
                         view {
                             background = resources.getDrawable(R.color.rma_hint_line_color_eee)
-                        }.lparams(matchParent, autoSize(1)){
+                        }.lparams(matchParent, autoSize(1)) {
                             marginEnd = autoSize(36)
                             marginStart = autoSize(36)
                         }
@@ -88,229 +117,67 @@ class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
                                 text = "角色权限"
                                 textColorInt = R.color.rma_black_33
                                 textSizeAuto = 31
-                            }.lparams(wrapContent, wrapContent){
+                            }.lparams(wrapContent, wrapContent) {
                                 marginStart = autoSize(37)
                             }
 
                             emptyView()
 
                             textView {
-                                if (type == "3"){
+                                if (type == "3") {
                                     visibility = View.GONE
-                                }else{
+                                } else {
                                     visibility = View.VISIBLE
                                 }
                                 text = "请勾选权限功能"
                                 textSizeAuto = 31
                                 textColorInt = R.color.rma_yellow_text_color
-                            }.lparams(wrapContent, wrapContent){
+                            }.lparams(wrapContent, wrapContent) {
                                 marginEnd = autoSize(36)
                             }
                         }.lparams(matchParent, autoSize(104))
 
-                        verticalLayout {
+                        /**
+                         * 角色权限的列表
+                         */
+                        recyclerView {
                             background = resources.getDrawable(R.color.add_role_bg_color)
+                            adapter = addRoleAdapter
+                            isNestedScrollingEnabled = false
+                        }.lparams(matchParent, wrapContent){
+                            bottomMargin = autoSize(200)
+                        }
 
-                            linearLayout {
-                                gravity = Gravity.CENTER_VERTICAL
-                                view {
-                                    background = resources.getDrawable(R.color.rma_blue_color)
-                                }.lparams(autoSize(6), autoSize(36)){
-                                    marginStart = autoSize(36)
-                                }
-
-                                textView {
-                                    text = "采购"
-                                    textSizeAuto = 36
-                                    textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
-                                    marginStart = autoSize(31)
-                                }
-
-                                emptyView()
-
-                                textView {
-                                    if (type == "3"){
-                                        visibility = View.GONE
-                                    }else{
-                                        visibility = View.VISIBLE
-                                    }
-                                    text = "全选"
-                                    textSizeAuto = 31
-                                    textColorInt = R.color.rma_blue_color
-                                }.lparams(wrapContent, wrapContent){
-                                    marginEnd = autoSize(36)
-                                }
-                            }.lparams(matchParent, autoSize(92))
-                            view {
-                                background = resources.getDrawable(R.color.line_hint_color)
-                            }.lparams(matchParent, autoSize(1)){
-                                marginEnd = autoSize(36)
-                                marginStart = autoSize(36)
-                            }
-
-                            /**
-                             * 采购选择的列表
-                             */
-                            recyclerView {
-                                background = resources.getDrawable(R.color.add_role_bg_color)
-
-                            }.lparams(matchParent, wrapContent)
-
-                            linearLayout {
-                                gravity = Gravity.CENTER_VERTICAL
-                                view {
-                                    background = resources.getDrawable(R.color.rma_blue_color)
-                                }.lparams(autoSize(6), autoSize(36)){
-                                    marginStart = autoSize(36)
-                                }
-
-                                textView {
-                                    text = "销售"
-                                    textSizeAuto = 36
-                                    textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
-                                    marginStart = autoSize(31)
-                                }
-
-                                emptyView()
-
-                                textView {
-                                    if (type == "3"){
-                                        visibility = View.GONE
-                                    }else{
-                                        visibility = View.VISIBLE
-                                    }
-                                    text = "全选"
-                                    textSizeAuto = 31
-                                    textColorInt = R.color.rma_blue_color
-                                }.lparams(wrapContent, wrapContent){
-                                    marginEnd = autoSize(36)
-                                }
-                            }.lparams(matchParent, autoSize(92))
-                            view {
-                                background = resources.getDrawable(R.color.line_hint_color)
-                            }.lparams(matchParent, autoSize(1)){
-                                marginEnd = autoSize(36)
-                                marginStart = autoSize(36)
-                            }
-
-                            /**
-                             * 销售选择的列表
-                             */
-                            recyclerView {
-                                background = resources.getDrawable(R.color.add_role_bg_color)
-
-                            }.lparams(matchParent, wrapContent)
-
-                            linearLayout {
-                                gravity = Gravity.CENTER_VERTICAL
-                                view {
-                                    background = resources.getDrawable(R.color.rma_blue_color)
-                                }.lparams(autoSize(6), autoSize(36)){
-                                    marginStart = autoSize(36)
-                                }
-
-                                textView {
-                                    text = "期货"
-                                    textSizeAuto = 36
-                                    textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
-                                    marginStart = autoSize(31)
-                                }
-
-                                emptyView()
-
-                                textView {
-                                    if (type == "3"){
-                                        visibility = View.GONE
-                                    }else{
-                                        visibility = View.VISIBLE
-                                    }
-                                    text = "全选"
-                                    textSizeAuto = 31
-                                    textColorInt = R.color.rma_blue_color
-                                }.lparams(wrapContent, wrapContent){
-                                    marginEnd = autoSize(36)
-                                }
-                            }.lparams(matchParent, autoSize(92))
-                            view {
-                                background = resources.getDrawable(R.color.line_hint_color)
-                            }.lparams(matchParent, autoSize(1)){
-                                marginEnd = autoSize(36)
-                                marginStart = autoSize(36)
-                            }
-
-                            /**
-                             * 期货选择的列表
-                             */
-                            recyclerView {
-                                background = resources.getDrawable(R.color.add_role_bg_color)
-
-                            }.lparams(matchParent, wrapContent)
-
-                            linearLayout {
-                                gravity = Gravity.CENTER_VERTICAL
-                                view {
-                                    background = resources.getDrawable(R.color.rma_blue_color)
-                                }.lparams(autoSize(6), autoSize(36)){
-                                    marginStart = autoSize(36)
-                                }
-
-                                textView {
-                                    text = "敞口"
-                                    textSizeAuto = 36
-                                    textColorInt = R.color.rma_black_33
-                                }.lparams(wrapContent, wrapContent){
-                                    marginStart = autoSize(31)
-                                }
-
-                                emptyView()
-
-                                textView {
-                                    if (type == "3"){
-                                        visibility = View.GONE
-                                    }else{
-                                        visibility = View.VISIBLE
-                                    }
-                                    text = "全选"
-                                    textSizeAuto = 31
-                                    textColorInt = R.color.rma_blue_color
-                                }.lparams(wrapContent, wrapContent){
-                                    marginEnd = autoSize(36)
-                                }
-                            }.lparams(matchParent, autoSize(92))
-                            view {
-                                background = resources.getDrawable(R.color.line_hint_color)
-                            }.lparams(matchParent, autoSize(1)){
-                                marginEnd = autoSize(36)
-                                marginStart = autoSize(36)
-                            }
-
-                            /**
-                             * 敞口选择的列表
-                             */
-                            recyclerView {
-                                background = resources.getDrawable(R.color.add_role_bg_color)
-
-                            }.lparams(matchParent, wrapContent)
-
-                        }.lparams(matchParent, wrapContent)
+                        viewModel.roleMenuDataList.bindOptional(context){
+                            addRoleAdapter.setNewData(it)
+                        }
                     }
                 }
 
                 linearLayout {
                     background = resources.getDrawable(R.color.white)
                     gravity = Gravity.CENTER_VERTICAL
-                    if (type == "3"){
+                    if (type == "3") {
                         visibility = View.GONE
-                    }else{
+                    } else {
                         visibility = View.VISIBLE
                     }
 
                     textView {
                         onThrottleFirstClick {
+                            if (check().not()){
+                                return@onThrottleFirstClick
+                            }
 
+                            if (type == "1"){
+                                viewModel.ManagerRoleOperateReq(operatetype = 1,rolename = role_name_edittext.text.toString(),memberfuncmenus = viewModel.getUpdateMenuDataList()){
+                                    finish()
+                                }
+                            }else if (type == "2"){
+                                viewModel.ManagerRoleOperateReq(autoid = data.autoid?.toLong() ?: 0,operatetype = 2,rolename = role_name_edittext.text.toString(),memberfuncmenus = viewModel.getUpdateMenuDataList()){
+                                    finish()
+                                }
+                            }
                         }
                         gravity = Gravity.CENTER
                         backgroundResource = R.mipmap.rma_submit_bg
@@ -328,4 +195,13 @@ class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
         }
     }
 
+    fun check() : Boolean{
+        if (role_name_edittext.text.toString().isNullOrEmpty()){
+            ToastUtils.showLong("请输入角色名称")
+            return false
+        }
+
+        return true
+    }
+
 }

+ 103 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleViewHolder.kt

@@ -0,0 +1,103 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import androidx.recyclerview.widget.StaggeredGridLayoutManager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccMgrRoleMenuData
+import cn.muchinfo.rma.global.data.RoleSonMenuData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+/**
+ * 角色设置的新增角色
+ * @property activity AppCompatActivity
+ * @property viewModel RoleSetViewModel
+ * @property itemSize IntArray
+ * @constructor
+ */
+class AddRoleViewHolder(private val activity : AppCompatActivity,private val viewModel: RoleSetViewModel,private val type : String) : BaseViewHolder<AccMgrRoleMenuData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+//    //期货合约
+//    private val addRoleItemAdapter: BaseAdapter<RoleSonMenuData, AddRoleItemViewHolder> =
+//        BaseAdapter { _, _ -> AddRoleItemViewHolder(activity, viewModel,dataIndex) }
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                view {
+                    background = resources.getDrawable(R.color.rma_blue_color)
+                }.lparams(autoSize(6), autoSize(36)) {
+                    marginStart = autoSize(36)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.Menu?.resourcename
+                    }
+                    textSizeAuto = 36
+                    textColorInt = R.color.rma_black_33
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(31)
+                }
+
+                emptyView()
+
+                textView {
+
+                    onThrottleFirstClick {
+                        if (data.value?.Menu?.isSelcet == 0){
+                            viewModel.setAllRoleSelect(dataIndex,1)
+                        }else{
+                            viewModel.setAllRoleSelect(dataIndex,0)
+                        }
+                    }
+                    if (type == "3") {
+                        visibility = View.GONE
+                    } else {
+                        visibility = View.VISIBLE
+                    }
+                    data.bindOptional(context){
+                        text = if (it?.Menu?.isSelcet == 0){
+                            "全选"
+                        }else{
+                            "全不选"
+                        }
+                    }
+                    text = "全选"
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_blue_color
+                }.lparams(wrapContent, wrapContent) {
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(92))
+
+            view {
+                background = resources.getDrawable(R.color.line_hint_color)
+            }.lparams(matchParent, autoSize(1)) {
+                marginEnd = autoSize(36)
+                marginStart = autoSize(36)
+            }
+            recyclerView {
+                val staggeredGridLayoutManager = StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL)
+                layoutManager = staggeredGridLayoutManager
+
+                data.bindOptional(context){
+                    val addRoleItemAdapter: BaseAdapter<RoleSonMenuData, AddRoleItemViewHolder> =
+                        BaseAdapter { _, _ -> AddRoleItemViewHolder(activity, viewModel,it?.Menu?.resourcecode ?: "") }
+                    adapter = addRoleItemAdapter
+                    addRoleItemAdapter.setNewData(it?.SubMenu)
+                }
+            }
+
+        }
+    }
+
+}

+ 2 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetActivity.kt

@@ -45,6 +45,8 @@ class RoleSetActivity : BaseActivity<RoleSetViewModel>() {
                 // 新增角色设置
                 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)
                 }

+ 7 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewHolder.kt

@@ -1,5 +1,6 @@
 package cn.muchinfo.rma.view.base.home.rolemanagement
 
+import android.content.Intent
 import android.view.Gravity
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
@@ -13,6 +14,7 @@ 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 com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseViewHolder
 import org.jetbrains.anko.*
 
@@ -95,7 +97,11 @@ class RoleSetViewHolder(private val activity : AppCompatActivity,private val vie
 
                  textView {
                      onThrottleFirstClick {
-
+                         val intent = Intent()
+                         intent.putExtra("type","2")
+                         intent.putExtra("data",data.value)
+                         intent.setClass(context,AddRoleSetActivity::class.java)
+                         ActivityUtils.startActivity(intent)
                      }
                      backgroundResource = R.drawable.rma_item_click_bg
                      gravity = Gravity.CENTER

+ 212 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt

@@ -3,9 +3,17 @@ package cn.muchinfo.rma.view.base.home.rolemanagement
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.global.data.AccMgrRoleMenuData
 import cn.muchinfo.rma.global.data.AccMgrTaaccountData
+import cn.muchinfo.rma.global.data.RoleSonMenuData
+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 kotlinx.coroutines.GlobalScope
+import kotlinx.coroutines.launch
+import mtp.polymer.com.autowidget.utils.TaskUiModel
 
 /**
  * 角色设置viewmodel
@@ -13,11 +21,215 @@ import cn.muchinfo.rma.view.base.BaseViewModel
 class RoleSetViewModel : BaseViewModel(){
 
     /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    /**
      *  角色设置数据
      */
     val roleSetDataList : MutableLiveData<List<AccMgrRoleData>> = MutableLiveData()
 
     /**
+     * 角色详情页面的可选择的menu
+     */
+    val roleMenuDataList : MutableLiveData<List<AccMgrRoleMenuData>> = MutableLiveData()
+
+    /**
+     * 角色详情页面的可选择的menu
+     */
+    val roleHaveMenuDataList : MutableLiveData<List<AccMgrRoleMenuData>> = MutableLiveData()
+
+
+    /**
+     * 查询账户管理角色详情(账户管理/角色设置/角色详情)
+     */
+    fun queryAccMgrRoleMenu(roleid : String = ""){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            if (roleid.isNotEmpty()){
+                put("roleid",roleid)
+            }
+        }
+        MyApplication.getInstance()?.accountManager?.queryAccMgrRoleMenu(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                roleMenuDataList.postValue(respData)
+                if (roleid.isNotEmpty()){
+                    queryHaveAccMgrRoleMenu(roleid)
+                }
+            }
+        }
+    }
+
+    /**
+     * 查询账户管理角色详情(账户管理/角色设置/角色详情)已有权限
+     */
+    fun queryHaveAccMgrRoleMenu(roleid : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+            put("roleid",roleid)
+        }
+        MyApplication.getInstance()?.accountManager?.queryAccMgrRoleMenu(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                flexibleMenu(setClickMenuList(respData ?: arrayListOf()))
+            }
+        }
+    }
+
+    fun setClickMenuList(haveMenuList : List<AccMgrRoleMenuData>) : List<AccMgrRoleMenuData>{
+        val newMenuDataList = arrayListOf<AccMgrRoleMenuData>()
+        haveMenuList.forEach { data ->
+            val newSonMenuList = arrayListOf<RoleSonMenuData>()
+            data.SubMenu?.forEach {
+                newSonMenuList.add(it.copy(isSelcet = 1))
+            }
+            newMenuDataList.add(data.copy(SubMenu = newSonMenuList))
+        }
+        return newMenuDataList
+    }
+
+    fun flexibleMenu(haveMenuList : List<AccMgrRoleMenuData>){
+        val emptyMenuList = roleMenuDataList.value
+        val newMenuDataList = arrayListOf<AccMgrRoleMenuData>()
+        emptyMenuList?.forEach {
+            val newSonMenuList = arrayListOf<RoleSonMenuData>()
+
+//            haveMenuList.forEach {data ->
+//                 if (it.Menu?.resourcecode == data.Menu?.resourcecode){
+//                     data.SubMenu?.let { it1 -> newSonMenuList.addAll(it1) }
+//                 }
+//            }
+            it.SubMenu?.let { it1 -> newSonMenuList.addAll(it1) }
+
+            newMenuDataList.add(it.copy(SubMenu = newSonMenuList))
+        }
+        roleMenuDataList.postValue(newMenuDataList)
+    }
+
+    /**
+     *  item全选点击
+     * @param index Int 点击的item在列表内的索引
+     * isSelect 操作的类型,0 设置全不选 1设置全选
+     */
+    fun setAllRoleSelect(index: Int,isSelect : Int){
+        val newMenuDataList = arrayListOf<AccMgrRoleMenuData>()
+        val oldMenuDataList = roleMenuDataList.value
+        oldMenuDataList?.forEach {
+            if (index == oldMenuDataList.indexOf(it)){
+                val newSonMenuDataList = arrayListOf<RoleSonMenuData>()
+                val oldSonMenuDataList = it.SubMenu
+                val menuData = it.Menu
+                menuData?.isSelcet = isSelect
+                oldSonMenuDataList?.forEach {
+                    newSonMenuDataList.add(it.copy(isSelcet = isSelect))
+                }
+                newMenuDataList.add(it.copy(Menu = menuData,SubMenu = newSonMenuDataList))
+            }else{
+                newMenuDataList.add(it)
+            }
+        }
+
+        roleMenuDataList.postValue(newMenuDataList)
+    }
+
+    /**
+     * item内单个选项点击
+     */
+    fun setOnCloneClick(resourcecode: String,dataIndex : Int){
+        val newMenuDataList = arrayListOf<AccMgrRoleMenuData>()
+        val oldMenuDataList = roleMenuDataList.value
+        oldMenuDataList?.forEach {
+            if (resourcecode == it.Menu?.resourcecode){
+                val newSonMenuDataList = arrayListOf<RoleSonMenuData>()
+                val oldSonMenuDataList = it.SubMenu
+                val menuData = it.Menu
+                oldSonMenuDataList?.forEach { data ->
+                    if (dataIndex == oldSonMenuDataList.indexOf(data)){
+                        if (data.isSelcet == 0){
+                            newSonMenuDataList.add(data.copy(isSelcet = 1))
+                        }else{
+                            newSonMenuDataList.add(data.copy(isSelcet = 0))
+                        }
+                    }else{
+                        newSonMenuDataList.add(data)
+                    }
+                }
+                newMenuDataList.add(AccMgrRoleMenuData(Menu = menuData,SubMenu = newSonMenuDataList))
+            }else{
+                newMenuDataList.add(it)
+            }
+        }
+
+        roleMenuDataList.postValue(newMenuDataList)
+    }
+
+    /**
+     *
+     * @param operatetype Int
+     * @param rolename String
+     * @param memberfuncmenus List<MemberFuncMenu>
+     */
+    fun ManagerRoleOperateReq(
+        autoid : Long = 0,
+        operatetype : Int,
+        modifyremark : String = "",
+        rolename : String,
+        memberfuncmenus : List<ManageServiceMI2.MemberFuncMenu>,
+        isSuccess: (isCompleted: Boolean) -> Unit
+    ){
+        loadingDialogStatus.value = TaskUiModel.inFlight()
+        GlobalScope.launch {
+            MyApplication.getInstance()?.accountManager?.ManagerRoleOperateReq(
+                operatetype = operatetype,
+                rolename = rolename,
+                memberfuncmenus = memberfuncmenus,
+                modifyremark = modifyremark,
+                autoid = autoid
+            ){ isCompleted, err ->
+                if (isCompleted) {
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "请求成功"))
+                    isSuccess(true)
+                } else {
+                    loadingDialogStatus.postValue(
+                        TaskUiModel.failed(
+                            InteractiveException(
+                                errorMessage = err?.message!!
+                            )
+                        )
+                    )
+                }
+            }
+        }
+    }
+
+    /**
+     * 新增修改时填写的menu
+     * @return List<ManageServiceMI2.MemberFuncMenu.Builder>
+     */
+    fun getUpdateMenuDataList() : List<ManageServiceMI2.MemberFuncMenu>{
+        val menuDataList = roleMenuDataList.value
+        val updateMenuList = arrayListOf<ManageServiceMI2.MemberFuncMenu>()
+        menuDataList?.forEach {data ->
+             val mapMenu : HashMap<String,String> = hashMapOf()
+
+            data.SubMenu?.forEach {
+                if (it.isSelcet == 1){
+                    val updataMenuData = ManageServiceMI2.MemberFuncMenu.newBuilder()
+                    updataMenuData.resourcecode = it.resourcecode
+                    updateMenuList.add(updataMenuData.build())
+                    mapMenu.put("resourcecode",data.Menu?.resourcecode ?: "")
+                }
+            }
+            if (mapMenu.isNotEmpty()){
+                val updataMenuData1 = ManageServiceMI2.MemberFuncMenu.newBuilder()
+                updataMenuData1.resourcecode = mapMenu.get("resourcecode")
+                updateMenuList.add(updataMenuData1.build())
+            }
+        }
+        return updateMenuList
+    }
+
+    /**
      * 请求角色设置列表
      */
     fun queryAccMgrRole(){

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


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


+ 1 - 1
RMA/app/src/main/res/values/colors.xml

@@ -41,7 +41,7 @@
     <color name="rma_red_color">#FF2F2C</color>
     <color name="rma_item_bg">#F6F6F8</color>
     <color name="rma_item_yellow_color">#FE9344</color>
-    <color name="add_role_bg_color">#4A97E1</color>
+    <color name="add_role_bg_color">#224A97E1</color>
 
 
     <color name="pickerview_timebtn_nor">#057dff</color>

Some files were not shown because too many files changed in this diff