|
|
@@ -7,12 +7,14 @@ import android.view.inputmethod.EditorInfo
|
|
|
import android.widget.EditText
|
|
|
import androidx.lifecycle.MutableLiveData
|
|
|
import cn.muchinfo.rma.R
|
|
|
+import cn.muchinfo.rma.global.GlobalDataCollection
|
|
|
import cn.muchinfo.rma.global.MTPEnums
|
|
|
import cn.muchinfo.rma.global.data.AccMgrBizGroupSetData
|
|
|
import cn.muchinfo.rma.global.data.AccMgrLoginUserData
|
|
|
import cn.muchinfo.rma.global.data.AccMgrTaaccountSonData
|
|
|
import cn.muchinfo.rma.global.data.Userlist
|
|
|
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
|
|
|
@@ -100,7 +102,7 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
if (type == "1"){//新增
|
|
|
viewModel.queryAccMgrTaaccount(type ?: "1")
|
|
|
}else{// TODO 查询时和新增期货账户传入的实体不同,具体做时再做修改
|
|
|
-// viewModel.queryAccMgrTaaccount(type ?: "1",data ?: AccMgrBizGroupSetData())
|
|
|
+ viewModel.queryAccMgrTaaccountBymanager(type ?: "1",data1 ,data1.clientroleid ?: "")
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -129,295 +131,350 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- linearLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
+ frameLayout {
|
|
|
+ scrollView {
|
|
|
+ verticalLayout {
|
|
|
|
|
|
- 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)
|
|
|
- }
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
|
|
|
- editText {
|
|
|
- isEnabled = type == "1"//登录账号只能在新增时修改
|
|
|
- if (type != "1") {
|
|
|
- setText(data1.rolename)
|
|
|
- }
|
|
|
- login_account = this
|
|
|
- hint = "请输入登录账号"
|
|
|
- background = null
|
|
|
- inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
+ 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 {
|
|
|
+ isEnabled = type == "1"//登录账号只能在新增时修改
|
|
|
+ if (type != "1") {
|
|
|
+ setText(data1.logincode)
|
|
|
+ }
|
|
|
+ login_account = 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))
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorStr = "#333333"
|
|
|
+ }.lparams(matchParent, autoSize(132)) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
- itemView()
|
|
|
+ itemView()
|
|
|
|
|
|
- linearLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
+ 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)
|
|
|
- }
|
|
|
+ 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 {
|
|
|
- account_name = this
|
|
|
- isEnabled = type == "1" || type == "3"
|
|
|
- if (type != "1") {
|
|
|
- setText(data1.accountname)
|
|
|
- }
|
|
|
- hint = "请输入账户名称"
|
|
|
- background = null
|
|
|
- inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
+ editText {
|
|
|
+ account_name = this
|
|
|
+ isEnabled = type == "1" || type == "3"
|
|
|
+ if (type != "1") {
|
|
|
+ setText(data1.accountname)
|
|
|
+ }
|
|
|
+ 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))
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorStr = "#333333"
|
|
|
+ }.lparams(matchParent, autoSize(132)) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
- itemView()
|
|
|
+ itemView()
|
|
|
|
|
|
- linearLayout {
|
|
|
- if (type == "1") {
|
|
|
- visibility = View.VISIBLE
|
|
|
- } else {
|
|
|
- visibility = View.GONE
|
|
|
- }
|
|
|
- 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)
|
|
|
- }
|
|
|
+ linearLayout {
|
|
|
+ if (type == "1") {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ } else {
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
+ 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 {
|
|
|
- login_password = this
|
|
|
- isEnabled = type == "1" || type == "3"
|
|
|
- if (type != "1") {
|
|
|
- setText("********")
|
|
|
- }
|
|
|
- hint = "请输入登录密码"
|
|
|
- background = null
|
|
|
- inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
+ editText {
|
|
|
+ login_password = this
|
|
|
+ isEnabled = type == "1" || type == "3"
|
|
|
+ if (type != "1") {
|
|
|
+ setText("********")
|
|
|
+ }
|
|
|
+ hint = "请输入登录密码"
|
|
|
+ background = null
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_TEXT
|
|
|
// setDecimalInputType()
|
|
|
- hintColorStr = "#CCCCCC"
|
|
|
- textSizeAuto = 31
|
|
|
- textColorStr = "#333333"
|
|
|
- }.lparams(matchParent, autoSize(132)) {
|
|
|
- marginStart = autoSize(80)
|
|
|
- }
|
|
|
+ hintColorStr = "#CCCCCC"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorStr = "#333333"
|
|
|
+ }.lparams(matchParent, autoSize(132)) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- }.lparams(matchParent, autoSize(132))
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
- itemView()
|
|
|
+ itemView()
|
|
|
|
|
|
- linearLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
+ 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)
|
|
|
- }
|
|
|
+ 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 {
|
|
|
- phone_number = this
|
|
|
- isEnabled = type == "1" || type == "3"
|
|
|
- if (type == "1") {
|
|
|
- setText("")
|
|
|
- } else {
|
|
|
- setText(data1.mobile)
|
|
|
- }
|
|
|
- hint = "可用于找回密码"
|
|
|
- background = null
|
|
|
- inputType = EditorInfo.TYPE_CLASS_PHONE
|
|
|
+ editText {
|
|
|
+ phone_number = this
|
|
|
+ isEnabled = type == "1" || type == "3"
|
|
|
+ if (type == "1") {
|
|
|
+ setText("")
|
|
|
+ } else {
|
|
|
+ setText(data1.mobile)
|
|
|
+ }
|
|
|
+ hint = "可用于找回密码"
|
|
|
+ background = null
|
|
|
+ inputType = EditorInfo.TYPE_CLASS_PHONE
|
|
|
// 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
|
|
|
- onThrottleFirstClick {
|
|
|
- if (type == "2") {
|
|
|
- return@onThrottleFirstClick
|
|
|
- }
|
|
|
- creatBottomSheetDialog("请选择账户权限", getSelectDataList()) {
|
|
|
- roleTypeSelectData.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 {
|
|
|
- roleTypeSelectData.bindOptional(context) {
|
|
|
- text = it?.value
|
|
|
- }
|
|
|
- text = data.rolename
|
|
|
- textSizeAuto = 31
|
|
|
- textColorInt = R.color.rma_black_33
|
|
|
- }.lparams(wrapContent, wrapContent) {
|
|
|
- marginStart = autoSize(80)
|
|
|
- }
|
|
|
-
|
|
|
- emptyView()
|
|
|
-
|
|
|
- imageView {
|
|
|
- if (type == "1") {
|
|
|
- visibility = View.VISIBLE
|
|
|
- } else {
|
|
|
- visibility = View.GONE
|
|
|
- }
|
|
|
- imageResource = R.mipmap.rma_more
|
|
|
- }.lparams(autoSize(36), autoSize(36)) {
|
|
|
- marginEnd = autoSize(25)
|
|
|
- }
|
|
|
- }.lparams(matchParent, autoSize(132))
|
|
|
-
|
|
|
- // TODO 增加期货账户关联功能
|
|
|
+ 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
|
|
|
+ onThrottleFirstClick {
|
|
|
+ if (type == "2") {
|
|
|
+ return@onThrottleFirstClick
|
|
|
+ }
|
|
|
+ creatBottomSheetDialog("请选择账户权限", getSelectDataList()) {
|
|
|
+ roleTypeSelectData.postValue(this)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ textView {
|
|
|
+ text = "*"
|
|
|
+ textColorInt = R.color.rma_star_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(37)
|
|
|
+ }
|
|
|
|
|
|
- linearLayout {
|
|
|
+ textView {
|
|
|
+ text = "账户权限"
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(10)
|
|
|
+ }
|
|
|
|
|
|
- }.lparams(matchParent, wrapContent)
|
|
|
+ textView {
|
|
|
+ roleTypeSelectData.bindOptional(context) {
|
|
|
+ text = it?.value
|
|
|
+ }
|
|
|
+ text = data.rolename
|
|
|
+ textSizeAuto = 31
|
|
|
+ textColorInt = R.color.rma_black_33
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(80)
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 期货账户的列表
|
|
|
- */
|
|
|
- recyclerView {
|
|
|
- background = resources.getDrawable(R.color.add_role_bg_color)
|
|
|
- adapter = addFutureAccountRoleAdapter
|
|
|
- }.lparams(matchParent, wrapContent)
|
|
|
+ emptyView()
|
|
|
+
|
|
|
+ imageView {
|
|
|
+ if (type == "1") {
|
|
|
+ visibility = View.VISIBLE
|
|
|
+ } else {
|
|
|
+ visibility = View.GONE
|
|
|
+ }
|
|
|
+ imageResource = R.mipmap.rma_more
|
|
|
+ }.lparams(autoSize(36), autoSize(36)) {
|
|
|
+ marginEnd = autoSize(25)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
+
|
|
|
+
|
|
|
+ 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)
|
|
|
+ }
|
|
|
|
|
|
- viewModel.futureDataList.bindOptional(context) {
|
|
|
- addFutureAccountRoleAdapter.setNewData(it)
|
|
|
- }
|
|
|
+ textView {
|
|
|
+ if (type == "2"){
|
|
|
+ text = "已勾选期货账户"
|
|
|
+ }else{
|
|
|
+ text = "请勾选期货账户"
|
|
|
+ }
|
|
|
+
|
|
|
+ textColorInt = R.color.rma_yellow_text_color
|
|
|
+ textSizeAuto = 31
|
|
|
+ }.lparams(wrapContent, wrapContent) {
|
|
|
+ marginStart = autoSize(40)
|
|
|
+ }
|
|
|
+ }.lparams(matchParent, autoSize(132))
|
|
|
|
|
|
|
|
|
- view {
|
|
|
+ /**
|
|
|
+ * 期货账户的列表
|
|
|
+ */
|
|
|
+ recyclerView {
|
|
|
+ background = resources.getDrawable(R.color.add_role_bg_color)
|
|
|
+ adapter = addFutureAccountRoleAdapter
|
|
|
+ }.lparams(matchParent, wrapContent){
|
|
|
+ bottomMargin = autoSize(145)
|
|
|
+ }
|
|
|
|
|
|
- }.lparams(autoSize(1), 0, 1f)
|
|
|
+ viewModel.futureDataList.bindOptional(context) {
|
|
|
+ addFutureAccountRoleAdapter.setNewData(it)
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- linearLayout {
|
|
|
- background = resources.getDrawable(R.color.white)
|
|
|
- gravity = Gravity.CENTER_VERTICAL
|
|
|
- textView {
|
|
|
- onThrottleFirstClick {
|
|
|
- if (check().not()) {
|
|
|
- return@onThrottleFirstClick
|
|
|
- }
|
|
|
- if (type == "1") {// 1 新增 2 详情 3 修改 4 锁定 5 注销
|
|
|
- viewModel.LoginaccountOperateReq(
|
|
|
- operatetype = 3,
|
|
|
- logincode = login_account.text.toString(),
|
|
|
- accountname = account_name.text.toString(),
|
|
|
- password = login_password.text.toString(),
|
|
|
- mobile = phone_number.text.toString(),
|
|
|
- roleids = arrayListOf(roleTypeSelectData.value?.id?.toLong() ?: 0)
|
|
|
- ) {
|
|
|
- finish()
|
|
|
+ linearLayout {
|
|
|
+ background = resources.getDrawable(R.color.white)
|
|
|
+ gravity = Gravity.CENTER_VERTICAL
|
|
|
+ textView {
|
|
|
+ onThrottleFirstClick {
|
|
|
+ if (check().not()) {
|
|
|
+ return@onThrottleFirstClick
|
|
|
}
|
|
|
- } else if (type == "3") {//修改
|
|
|
- viewModel.LoginaccountOperateReq(
|
|
|
- operatetype = 4,
|
|
|
- userid = data1.userid?.toLong() ?: 0,
|
|
|
- loginid = data1.loginid?.toLong() ?: 0,
|
|
|
- logincode = login_account.text.toString(),
|
|
|
- accountname = account_name.text.toString(),
|
|
|
- password = login_password.text.toString(),
|
|
|
- mobile = phone_number.text.toString(),
|
|
|
- roleids = arrayListOf(roleTypeSelectData.value?.id?.toLong() ?: 0)
|
|
|
- ) {
|
|
|
- finish()
|
|
|
+ if (type == "1") {// 1 新增 2 详情 3 修改 4 锁定 5 注销
|
|
|
+ viewModel.LoginaccountOperateReq(
|
|
|
+ operatetype = 3,
|
|
|
+ userid = GlobalDataCollection.instance?.loginRsp?.userID?.toLong() ?: 0,
|
|
|
+ logincode = login_account.text.toString(),
|
|
|
+ accountname = account_name.text.toString(),
|
|
|
+ password = login_password.text.toString(),
|
|
|
+ mobile = phone_number.text.toString(),
|
|
|
+ logintaaccounts = getSelectFuture(),
|
|
|
+ roleids = arrayListOf(roleTypeSelectData.value?.id?.toLong() ?: 0)
|
|
|
+ ) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
+ } else if (type == "3") {//修改
|
|
|
+ viewModel.LoginaccountOperateReq(
|
|
|
+ operatetype = 4,
|
|
|
+ userid = data1.userid?.toLong() ?: 0,
|
|
|
+ loginid = data1.loginid?.toLong() ?: 0,
|
|
|
+ logincode = login_account.text.toString(),
|
|
|
+ accountname = account_name.text.toString(),
|
|
|
+ password = login_password.text.toString(),
|
|
|
+ mobile = phone_number.text.toString(),
|
|
|
+ logintaaccounts = getSelectFuture(),
|
|
|
+ roleids = arrayListOf(roleTypeSelectData.value?.id?.toLong() ?: 0)
|
|
|
+ ) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ gravity = Gravity.CENTER
|
|
|
+ backgroundResource = R.mipmap.rma_submit_bg
|
|
|
+ text = "完成"
|
|
|
+ textColorInt = R.color.white
|
|
|
+ textSizeAuto = 38
|
|
|
+ }.lparams(matchParent, autoSize(119)) {
|
|
|
+ marginStart = autoSize(60)
|
|
|
+ marginEnd = autoSize(60)
|
|
|
}
|
|
|
- gravity = Gravity.CENTER
|
|
|
- backgroundResource = R.mipmap.rma_submit_bg
|
|
|
- text = "完成"
|
|
|
- textColorInt = R.color.white
|
|
|
- textSizeAuto = 38
|
|
|
- }.lparams(matchParent, autoSize(119)) {
|
|
|
- marginStart = autoSize(60)
|
|
|
- marginEnd = autoSize(60)
|
|
|
+ }.lparams(matchParent, autoSize(144)){
|
|
|
+ gravity = Gravity.BOTTOM
|
|
|
}
|
|
|
- }.lparams(matchParent, autoSize(144))
|
|
|
+ }.lparams(matchParent, matchParent)
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取提交资料时期货账户的列表
|
|
|
+ * @return List<ManageServiceMI2.LoginTaaccount>
|
|
|
+ */
|
|
|
+ fun getSelectFuture() : List<ManageServiceMI2.LoginTaaccount>{
|
|
|
+ val loginTaaccountDataList = arrayListOf<ManageServiceMI2.LoginTaaccount>()
|
|
|
+ viewModel.futureDataList.value?.forEach {
|
|
|
+ val loginTaaccountData = ManageServiceMI2.LoginTaaccount.newBuilder()
|
|
|
+ if (it.isSelect == 1){
|
|
|
+ loginTaaccountData.setAccountid(it.accountid?.toLong() ?: 0)
|
|
|
+ loginTaaccountDataList.add(loginTaaccountData.build())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return loginTaaccountDataList
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 可选择的账户角色
|
|
|
*/
|
|
|
fun getSelectDataList(): List<SelectData> {
|
|
|
@@ -450,6 +507,12 @@ class AddRoleActivity : BaseActivity<RoleSetViewModel>() {
|
|
|
ToastUtils.showLong("密码最少为6位")
|
|
|
return false
|
|
|
}
|
|
|
+
|
|
|
+ val selectData = viewModel.futureDataList.value?.find { it.isSelect == 1 }
|
|
|
+ if (selectData?.accountid.isNullOrEmpty()){
|
|
|
+ ToastUtils.showLong("请选择期货账户")
|
|
|
+ return false
|
|
|
+ }
|
|
|
return true
|
|
|
}
|
|
|
|