Ver Fonte

风险管理7月13日提交代码-liu.bolan-千海金

Liu.bolan há 4 anos atrás
pai
commit
c8ad15cf7e
24 ficheiros alterados com 339 adições e 93 exclusões
  1. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/AccountManager.kt
  2. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccountData.kt
  3. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/PickAreaData.kt
  4. 73 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/RootUserAccountData.kt
  5. 3 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/UserAccountData.kt
  6. 6 6
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt
  7. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/MyApplication.kt
  8. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  9. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureNumberViewHolder.kt
  10. 11 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt
  11. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeViewModel.kt
  12. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeViewModel.kt
  13. 10 10
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt
  14. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/set/SettingActivity.kt
  15. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  16. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/register/RegisterViewModel.kt
  17. 35 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainFragment.kt
  18. 46 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainViewModel.kt
  19. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/addressmanagement/StoresAddressViewHolder.kt
  20. 22 19
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/reward/RewardRuleActivity.kt
  21. 45 4
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/team/MyTeamActivity.kt
  22. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalActivity.kt
  23. 12 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalViewModel.kt
  24. 3 23
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/DealDetailsActivity.kt

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

@@ -1203,4 +1203,31 @@ class AccountManager {
     }
 
 
+    /**
+     * 查询顶级用户信息
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<BankInfoData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryRootUserAccount(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<RootUserAccountData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp3/QueryRootUserAccount",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<RootUserAccountData>>>() {
+                override fun onResponse(response: BaseResult<List<RootUserAccountData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+
 }

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

@@ -214,10 +214,10 @@ open class AccountData(
             /** 计算建仓市值 */
             orderValue += data.opencost
         }
-        /** 计算可用金额 **/
+        /** 计算可用金额 期末-占用-冻结(冻结保证金 + 手续费冻结 + 出金冻结 + 其他冻结) 详情见bug96382 **/
         canUserAmount =
-            currentbalance.plus(keep_watch_profit_and_loss).minus(usedmargin).minus(freezecharge)
-                .minus(otherfreezemargin).minus(outamountfreeze)
+            currentbalance.minus(usedmargin).minus(freezecharge)
+                .minus(otherfreezemargin).minus(outamountfreeze).minus(freezemargin)
         /** 权益 **/
         rightsAndInterests = currentbalance.plus(keep_watch_profit_and_loss)
 

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

@@ -5,6 +5,7 @@ import android.os.Parcelable
 
 //提货门店
 data class PickAreaData(
+    val address : String? = "",//详细地址
     val cityid : String? = "",//市
     val cityname : String? = "",//城市名称
     val countryid : String? = "",//国家
@@ -32,11 +33,13 @@ data class PickAreaData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
 
     override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(address)
         parcel.writeString(cityid)
         parcel.writeString(cityname)
         parcel.writeString(countryid)

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

@@ -0,0 +1,73 @@
+package cn.muchinfo.rma.global.data
+
+import com.google.gson.annotations.SerializedName
+
+/**
+ * 顶级用户信息
+ */
+data class RootUserAccountData(
+    @SerializedName("accountname")
+    val accountname : String? = "",//账户名称(机构名称)
+    @SerializedName("accountstatus")
+    val accountstatus : String? = "",//账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)
+    @SerializedName("applysrc")
+    val applysrc : String? = "",//申请来源 - 1:管理端 2:终端
+    @SerializedName("auditremark")
+    val auditremark : String? = "",//审核备注
+    @SerializedName("auditsrc")
+    val auditsrc : String? = "",//审核来源 - 1:管理端 2:终端
+    @SerializedName("audittime")
+    val audittime : String? = "",//审核时间
+    @SerializedName("audituserid")
+    val audituserid : String? = "",//审核人
+    @SerializedName("broker")
+    val broker : String? = "",//所属经纪人ID
+    @SerializedName("canceltime")
+    val canceltime : String? = "",//销户时间
+    @SerializedName("canceluserid")
+    val canceluserid : String? = "",//销户人
+    @SerializedName("canrecommend")
+    val canrecommend : String? = "",//是否可推荐 - 0:不可 1;可
+    @SerializedName("createtime")
+    val createtime : String? = "",//创建时间
+    @SerializedName("creatorid")
+    val creatorid : String? = "",//创建人
+    @SerializedName("hasauth")
+    val hasauth : String? = "",//是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
+    @SerializedName("isanonymous")
+    val isanonymous : String? = "",//是否匿名下单 - 0:否 1:是
+    @SerializedName("maxinvestornum")
+    val maxinvestornum : String? = "",//最大用户数(经纪会员下投资者个数)
+    @SerializedName("memberuserid")
+    val memberuserid : String? = "",//所属会员ID
+    @SerializedName("modifierid")
+    val modifierid : String? = "",//修改人
+    @SerializedName("modifyremark")
+    val modifyremark : String? = "",//变更备注
+    @SerializedName("modifystatus")
+    val modifystatus : String? = "",//变更状态 1 未变更 2 变更中 3 变更待审核 4 变更待复核(投资者)
+    @SerializedName("modifytime")
+    val modifytime : String? = "",//修改时间
+    @SerializedName("parenttopuser")
+    val parenttopuser : String? = "",//上级顶级机构 [092=0,1时,默认为1, 092=2时若自已为顶级,则填入自己,自己不为顶级,填入ParentUserID的"ParentTopUser"]
+    @SerializedName("parentuserid")
+    val parentuserid : String? = "",//所属机构ID
+    @SerializedName("reckonaccountid")
+    val reckonaccountid : String? = "",//默认结算资金账号ID(机构分润使用) 作废
+    @SerializedName("refercount")
+    val refercount : String? = "",//推荐总人数
+    @SerializedName("refereeuserid")
+    val refereeuserid : String? = "",//推荐人ID
+    @SerializedName("refernum")
+    val refernum : String? = "",//推荐码
+    @SerializedName("rootuserid")
+    val rootuserid : String? = "",//根用户ID
+    @SerializedName("subaccountlevel")
+    val subaccountlevel : String? = "",//子账户层数
+    @SerializedName("subarealevelpath")
+    val subarealevelpath : String? = "",//子机构层级路径(逗号分隔,首尾加逗号)
+    @SerializedName("userid")
+    val userid : String? = "",//用户ID
+    @SerializedName("usertype")
+    val usertype : String? = ""//账户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户 7:企业成员(云平台)
+)

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

@@ -17,6 +17,7 @@ data class UserAccountData(
     val hasauth : Int = 0,//是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
     val isanonymous : Int = 0,//是否匿名下单 - 0:否 1:是
     val maxinvestornum : Int = 0,//最大用户数(经纪会员下投资者个数)
+    val canrecommend : String = "",//是否可推荐 - 0:不可 1;可
     val memberuserid : Long = 0,//所属会员ID
     val modifierid : Long = 0,//修改人
     val modifyremark : String = "",//变更备注
@@ -29,5 +30,5 @@ data class UserAccountData(
     val refernum : String = "",//推荐码
     val subarealevelpath : String = "",//子机构层级路径(逗号分隔,首尾加逗号)
     val userid : Long = 0,//用户ID
-    val usertype : Int = 0//账户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户
-)
+    val usertype : Int = 0//1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户 7:企业成员(云平台)
+)// usertype == 6 && canrecommend == 0

+ 6 - 6
RMA/app/src/main/java/cn/muchinfo/rma/view/MainViewModel.kt

@@ -85,12 +85,12 @@ class MainViewModel : BaseViewModel() {
                 }
             }
         }
-        try {
-            GlobalDataCollection.instance?.errorCodeEntityList =
-                DataBase.getInstance().errorCodeDao().getList()
-        } catch (e: Exception) {
-            e.printStackTrace()
-        }
+//        try {
+//            GlobalDataCollection.instance?.errorCodeEntityList =
+//                DataBase.getInstance().errorCodeDao().getList()
+//        } catch (e: Exception) {
+//            e.printStackTrace()
+//        }
 
         queryUserFavoriteGoodses()
         if (Constant.IS_QHJ){

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

@@ -202,6 +202,7 @@ class MyApplication : BaseApplication() {
      * 对本地数据进行插入数据库操作,只在第一次启动app时有此操作
      */
     private fun initsqData(){
+        GlobalDataCollection.instance?.clean()
 //        if (SPUtils.getInstance().getBoolean(Constant.FISTOPENAPP,true)){
             /** 地址信息的dao **/
             val addressDao = DataBase.getInstance().addressDao()

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

@@ -7,7 +7,7 @@ object Constant {
      * 获取基础url的接口
      */
 //    const val baseurl = "http://103.40.249.123:8280/cfg?key=mtp_20"//千海金外盘
-//    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
+    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
 //        const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"//李倩千海金 18611112222
@@ -19,7 +19,7 @@ object Constant {
 //    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
 
 //     const val baseurl = "http://192.168.31.176:8080/cfg?key=test_176" // 9999  123123  黄老板千海金
-    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
+//    const val baseurl = "http://192.168.31.171:8080/cfg?key=test_171" // 邓工 签约解约环境
 //    const val baseurl = "http://192.168.21.71:8280/cfg?key=mtp_20"
 
     /**

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

@@ -109,10 +109,10 @@ class ExposureNumberViewHolder(
                             if (it?.decreaseqty == "-0"){
                                 text = "0"
                             } else{
-                                text = it?.decreaseqty + it?.enumdicname
+                                text = NumberUtils.roundNum(it?.decreaseqty,2) + it?.enumdicname
                             }
                         }else{
-                           text = it?.decreaseqty + "手"
+                           text = NumberUtils.roundNum(it?.decreaseqty,2) + "手"
                         }
                      }
                      textSizeAuto = 31

+ 11 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeActivity.kt

@@ -327,7 +327,7 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                 textView {
                     viewModel.allWorth.bindOptional(context){
                         if (it?.isNullOrEmpty()?.not() == true){
-                            text = "权益:${NumberUtils.checkDecimalPlace(it)}"
+                            text = "权益:${NumberUtils.roundNum(it,2)}"
                         }
                     }
                     textSizeAuto = 31
@@ -344,6 +344,16 @@ class GoodsTradeActivity : BaseActivity<GoodsTradeViewModel>() {
                 }.lparams(wrapContent, wrapContent)
 
                 emptyView()
+
+                textView {
+                    viewModel.freezeAmount.bindOptional(context){
+                        text = "保证金:" + NumberUtils.roundNum(it,2)
+                    }
+                    textSizeAuto = 31
+                    textColorInt = R.color.rma_yellow_text_color
+                }.lparams(wrapContent, wrapContent)
+
+                emptyView()
             }.lparams(matchParent, autoSize(70))
 
             verticalLayout {

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/future/trade/GoodsTradeViewModel.kt

@@ -54,6 +54,11 @@ class GoodsTradeViewModel : BaseViewModel() {
     val canUseWorth : MutableLiveData<String> = MutableLiveData()
 
     /**
+     * 冻结
+     */
+    val freezeAmount : MutableLiveData<String> = MutableLiveData()
+
+    /**
      * 请求盘面信息
      * @param first Int
      * @param last Int
@@ -125,6 +130,7 @@ class GoodsTradeViewModel : BaseViewModel() {
         accountData?.setNormalData()
         canUseWorth.postValue(accountData?.canUserAmount.toString())
         allWorth.postValue(accountData?.rightsAndInterests.toString())
+        freezeAmount.postValue(accountData?.usedmargin.toString())
     }
 
     /**

+ 21 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/HomeViewModel.kt

@@ -66,6 +66,11 @@ class HomeViewModel : BaseViewModel(){
      * 咨询信息
      */
     val SiteColumnDetailList : MutableLiveData<List<SiteColumnDetailData>> = MutableLiveData()
+
+    /**
+     * 顶级用户信息
+     */
+    val rootUserAccountData : MutableLiveData<RootUserAccountData> = MutableLiveData()
     /**
      * 查询咨询
      */
@@ -81,6 +86,22 @@ class HomeViewModel : BaseViewModel(){
     }
 
     /**
+     * 查询顶级用户信息
+     */
+    fun queryRootUserAccount(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.accountManager?.queryRootUserAccount(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                if (respData?.size ?: 0 > 0){
+                    rootUserAccountData.postValue(respData?.get(0))
+                }
+            }
+        }
+    }
+
+    /**
      * 在请求之前先获取数据库存储的banner信息
      */
     fun getBanner(){

+ 10 - 10
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/NewHomeFragment.kt

@@ -201,6 +201,7 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
     override fun onResume() {
         super.onResume()
         viewModel.queryPendingAuditInfo()
+        viewModel.queryRootUserAccount()
     }
 
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -252,9 +253,14 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
 //                            }.show()
                         }
                         textView {
-                            viewModel.userAccount.bindOptional(context) {
-                                text = it?.accountname?.isBlankString()
+                            viewModel.rootUserAccountData.bindOptional(context) {
+                                if (it?.accountname.isNullOrEmpty()){
+                                    text = "--"
+                                }else{
+                                    text = it?.accountname?.isBlankString()
+                                }
                             }
+                            text = "--"
                             text = GlobalDataCollection.instance?.loginRsp?.userID.toString()
                             textColorInt = R.color.white
                             textSizeAuto = 36
@@ -263,14 +269,8 @@ class NewHomeFragment : BaseFragment<HomeViewModel>() {
                         }
                         textView {
                             viewModel.loginQueryData.bindOptional(context) {
-                                if (SPUtils.getInstance().getString(Constant.oem) == "qhj"){
-                                    if (it?.userInfo?.customername.isNullOrEmpty().not()){
-                                        text = "(" + it?.userInfo?.customername + ")"
-                                    }
-                                }else{
-                                    if (it?.username.isNullOrEmpty().not()){
-                                        text = it?.username + "(" + it?.loginAccount?.logincode + ")"
-                                    }
+                                if (it?.username.isNullOrEmpty().not()){
+                                    text = it?.username + "(" + it?.loginAccount?.logincode + ")"
                                 }
                             }
                             textColorStr = "#AED6F0"

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

@@ -6,6 +6,7 @@ import android.os.Bundle
 import android.os.CountDownTimer
 import android.view.Gravity
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.future.trade.itemView
@@ -114,6 +115,7 @@ class SettingActivity : BaseActivity<SettingViewModel>(){
 
             textView {
                 onThrottleFirstClick {
+                    GlobalDataCollection.instance?.clean()
                     viewModel.loginOut {
                         if (it){
                             AppUtils.relaunchApp()

+ 3 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt

@@ -328,8 +328,6 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
                     ToastUtils.showLong("当前版本低于服务器版本,请更新后登陆")
                     return@onClick
                 }
-
-                GlobalDataCollection.instance?.clean()
                 // 开始登录
                 login()
             }
@@ -386,7 +384,9 @@ class LoginActivity : BaseActivity<LoginViewModel>(), UserPopupWindow.OnClearAcc
                     }
                 }
 
-            }.lparams(matchParent, wrapContent)
+            }.lparams(matchParent, wrapContent){
+                topMargin = autoSize(40)
+            }
 
             emptyView()
 

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

@@ -191,6 +191,7 @@ class RegisterViewModel : BaseViewModel(){
         }else{
             val json = JSONObject()
             json["vcode"] = vcode
+            json["refernum"] = refernum
             json["loginpwd"] = EncodeUtils.base64Encode(loginpwd)
             json["mobilephone"] = mobilephone
             json["isaudit"] = "1"

+ 35 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainFragment.kt

@@ -1,6 +1,7 @@
 package cn.muchinfo.rma.view.base.main
 
 import android.Manifest
+import android.annotation.SuppressLint
 import android.content.Intent
 import android.content.pm.PackageManager
 import android.os.Bundle
@@ -8,6 +9,7 @@ import android.view.Gravity
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.widget.TextView
 import androidx.core.app.ActivityCompat
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
@@ -60,9 +62,11 @@ import org.jetbrains.anko.support.v4.UI
  */
 class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
 
+    lateinit var phone_num : TextView
+
     override fun onResume() {
         super.onResume()
-        viewModel.initDataUsrAccount()
+        viewModel.getUserAccount()
         viewModel.queryBrokerApply()
     }
 
@@ -95,6 +99,7 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
         }
     }
 
+    @SuppressLint("MissingPermission")
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,
@@ -102,7 +107,7 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
     ): View? {
         EventBus.getDefault().register(this)
         return UI {
-
+            viewModel.queryAreaFinanceConfig()
             verticalLayout {
                 createLoadingDialog(hintStr = "请求中...").bindTaskStatus(
                     context,
@@ -198,19 +203,28 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                                     linearLayout {
                                         visibility = View.GONE
                                         onThrottleFirstClick {
-                                            if (viewModel.brokerApplyData.value?.applystatus == "1" || viewModel.brokerApplyData.value?.applystatus == "2"){//只展示
+                                            if (viewModel.brokerApplyData.value?.applystatus.isNullOrEmpty()){
                                                 val intent = Intent()
-                                                intent.putExtra("type","3")
-                                                intent.putExtra("data",viewModel.brokerApplyData.value)
+                                                intent.putExtra("type","1")
+                                                intent.putExtra("data",BrokerApplyData())
                                                 intent.setClass(context,ApplyPromotionCodeActivity::class.java)
                                                 ActivityUtils.startActivity(intent)
-                                            }else if (viewModel.brokerApplyData.value?.applystatus == "3" || viewModel.brokerApplyData.value?.applystatus == "4"){//可修改
+                                            }else{
+                                                if (viewModel.brokerApplyData.value?.applystatus == "1" || viewModel.brokerApplyData.value?.applystatus == "2"){//只展示
+                                                    val intent = Intent()
+                                                    intent.putExtra("type","3")
+                                                    intent.putExtra("data",viewModel.brokerApplyData.value)
+                                                    intent.setClass(context,ApplyPromotionCodeActivity::class.java)
+                                                    ActivityUtils.startActivity(intent)
+                                                }else if (viewModel.brokerApplyData.value?.applystatus == "3" || viewModel.brokerApplyData.value?.applystatus == "4"){//可修改
                                                     val intent = Intent()
                                                     intent.putExtra("type","2")
                                                     intent.putExtra("data",viewModel.brokerApplyData.value)
                                                     intent.setClass(context,ApplyPromotionCodeActivity::class.java)
                                                     ActivityUtils.startActivity(intent)
+                                                }
                                             }
+
                                         }
                                         viewModel.brokerApplyData.bindOptional(context){
                                             if (GlobalDataCollection.instance?.loginQueryData?.userInfo?.userinfotype == 2){
@@ -821,6 +835,12 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                         }.lparams(matchParent, autoSize(140))
 
                         linearLayout {
+                            visibility = View.GONE
+                            viewModel.areaFinanceConfigData.bindOptional(context){
+                                if (it?.size ?: 0 > 0){
+                                    visibility = View.VISIBLE
+                                }
+                            }
                             onThrottleFirstClick {
                                  if (ActivityCompat.checkSelfPermission(
                                          context,
@@ -836,7 +856,7 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                                      // for ActivityCompat#requestPermissions for more details.
                                      return@onThrottleFirstClick
                                  }
-                                PhoneUtils.call("0755-36856253")
+                                PhoneUtils.call(phone_num.text.toString())
                             }
                             gravity = Gravity.CENTER_VERTICAL
 
@@ -849,10 +869,17 @@ class SeaKingMainFragment : BaseFragment<SeaKingMainViewModel>() {
                             }.lparams(wrapContent, wrapContent)
 
                             textView {
-                                text = "0755-36856253"
+                                phone_num = this
+                                viewModel.areaFinanceConfigData.bindOptional(context){
+                                    if (it?.size ?: 0 > 0){
+                                        text = it?.get(0)?.customerservicenum
+                                    }
+                                }
                                 textSizeAuto = 29
                                 textColorStr = "#FFA127"
                             }.lparams(wrapContent, wrapContent)
+
+                            emptyView()
                         }.lparams(matchParent, autoSize(80))
 
                     }.lparams(matchParent, matchParent)

+ 46 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/SeaKingMainViewModel.kt

@@ -2,17 +2,19 @@ package cn.muchinfo.rma.view.base.main
 
 import androidx.lifecycle.MutableLiveData
 import cn.muchinfo.rma.global.GlobalDataCollection
-import cn.muchinfo.rma.global.data.AccountData
-import cn.muchinfo.rma.global.data.BankAccountSignData
-import cn.muchinfo.rma.global.data.BrokerApplyData
-import cn.muchinfo.rma.global.data.UserCollectConfigData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.data.account.loginQeruy.UserAccount
 import cn.muchinfo.rma.netManage.base.InteractiveException
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.app.Constant
+import cn.muchinfo.rma.view.eventbus.EventConstent
+import cn.muchinfo.rma.view.eventbus.MessageEvent
+import com.blankj.utilcode.util.SPUtils
 import kotlinx.coroutines.GlobalScope
 import kotlinx.coroutines.launch
 import mtp.polymer.com.autowidget.utils.TaskUiModel
+import org.greenrobot.eventbus.EventBus
 
 /**
  * 千海金我的页面viewmodel
@@ -26,7 +28,7 @@ class SeaKingMainViewModel : BaseViewModel(){
     /**
      * useraccount
      */
-    val userAccount : MutableLiveData<UserAccount> = MutableLiveData()
+    val userAccount : MutableLiveData<UserAccountData> = MutableLiveData()
 
     /**
      * 当前选择的资金账户
@@ -38,6 +40,12 @@ class SeaKingMainViewModel : BaseViewModel(){
      */
     val brokerApplyData : MutableLiveData<BrokerApplyData> = MutableLiveData()
 
+    /**
+     * 企业配置信息
+     */
+    val areaFinanceConfigData : MutableLiveData<List<AreaFinanceConfigData>> = MutableLiveData()
+
+
     //重新赋值资金账户
     fun resetAccountData(){
         val accountDataList = GlobalDataCollection.instance?.accountDataList
@@ -71,15 +79,45 @@ class SeaKingMainViewModel : BaseViewModel(){
             if (isSuccess) {
                 if (respData?.size ?: 0 > 0){
                     brokerApplyData.postValue(respData?.get(0))
+                }else {
+                    brokerApplyData.postValue(BrokerApplyData())
                 }
             }
         }
     }
 
+    /**
+     * 获取用户账号信息
+     */
+    fun getUserAccount() {
+        val params = mutableMapOf<String, String>().apply {
+            put("userID", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+
+        MyApplication.getInstance()?.initializeManager?.getUserAccount(params = params) { isSuccess, respData, error ->
+
+            if (isSuccess) {
+                userAccount.postValue(respData)
+                EventBus.getDefault().post(MessageEvent(EventConstent.get_useraccount_info))//查询成功发送消息用于页面数据更新
+            } else {
+                loadingDialogStatus.postValue(TaskUiModel.idel())
+            }
+        }
+    }
+
+    /**
+     * 企业配置
+     */
+    fun queryAreaFinanceConfig(){
+        val params = mutableMapOf<String,String>().apply {
+            put("userid",GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
 
-    //设置页面userAccount
-    fun initDataUsrAccount(){
-        userAccount.postValue(GlobalDataCollection.instance?.loginQueryData?.userAccount)
+        MyApplication.getInstance()?.accountManager?.queryAreaFinanceConfig(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                areaFinanceConfigData.postValue(respData)
+            }
+        }
     }
 
 

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

@@ -43,7 +43,7 @@ class StoresAddressViewHolder(private val activity : AppCompatActivity, private
 
                     textView {
                         data.bindOptional(context){
-                            text = it?.provincename + it?.cityid + it?.districtname + "--"
+                            text = it?.provincename + it?.cityname + it?.districtname + it?.address
                         }
                         textSizeAuto = 29
                         textColorInt = R.color.rma_gray_color

+ 22 - 19
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/reward/RewardRuleActivity.kt

@@ -63,12 +63,8 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        viewModel.areaFinanceConfigData.bindOptional(context){data ->
-                            val data = data?.find { it?.consumptionmodel == "1" }
-                            if (data?.consumptiondirectreward.isNullOrEmpty().not()){
-                                text = data?.consumptiondirectreward
-                            }
-                        }
+                        text = "一级奖励"
+
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -81,12 +77,8 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        viewModel.areaFinanceConfigData.bindOptional(context){data ->
-                            val data = data?.find { it?.consumptionmodel == "1" }
-                            if (data?.consumptionindirectreward.isNullOrEmpty().not()){
-                                text = data?.consumptionindirectreward
-                            }
-                        }
+                        text = "二级奖励"
+
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -130,7 +122,7 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        text = "固定金额(元)"
+                        text = "固定"
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -144,11 +136,12 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                     gravity = Gravity.CENTER
                     textView {
                         viewModel.areaFinanceConfigData.bindOptional(context){data ->
-                            val data = data?.find { it?.consumptionmodel == "2" }
-                            if (data?.promotionvalue.isNullOrEmpty().not()){
-                                text = data?.consumptiondirectreward
+                            val data = data?.find { it?.consumptionmodel == "1" }
+                            if (data?.consumptiondirectreward.isNullOrEmpty().not()){
+                                text = data?.consumptiondirectreward + "元"
                             }
                         }
+
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -204,7 +197,7 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        text = "固定金额比例(%)"
+                        text = "比例"
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -217,7 +210,12 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        text = "0.5"
+                        viewModel.areaFinanceConfigData.bindOptional(context){data ->
+                            val data = data?.find { it?.consumptionmodel == "2" }
+                            if (data?.promotionvalue.isNullOrEmpty().not()){
+                                text = data?.consumptiondirectreward + "%"
+                            }
+                        }
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)
@@ -230,7 +228,12 @@ class RewardRuleActivity : BaseActivity<MyRewardViewModel>(){
                 linearLayout {
                     gravity = Gravity.CENTER
                     textView {
-                        text = "0.3"
+                         viewModel.areaFinanceConfigData.bindOptional(context){data ->
+                            val data = data?.find { it?.consumptionmodel == "1" }
+                            if (data?.consumptionindirectreward.isNullOrEmpty().not()){
+                                text = data?.consumptionindirectreward + "%"
+                            }
+                        }
                         textSizeAuto = 31
                         textColorInt = R.color.rma_blue_color
                     }.lparams(wrapContent, wrapContent)

+ 45 - 4
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/team/MyTeamActivity.kt

@@ -25,12 +25,16 @@ import cn.muchinfo.rma.view.base.BaseActivity
 import cn.muchinfo.rma.view.base.app.Constant
 import cn.muchinfo.rma.view.base.home.accountmanager.accountviewholder.AccountManagerViewHolder
 import cn.muchinfo.rma.view.base.home.contract.emptyView
+import com.blankj.utilcode.util.ConvertUtils
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
 import com.qmuiteam.qmui.widget.tab.QMUITabSegment
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
 import mtp.polymer.com.autowidget.utils.TaskUiModel
 import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.*
 import org.jetbrains.anko.sdk25.coroutines.textChangedListener
+import org.jetbrains.anko.support.v4.viewPager
 
 /**
  * 我的团队页面
@@ -92,6 +96,7 @@ class MyTeamActivity : BaseActivity<MyTeamViewModel>(){
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
+            initMenuData()
 //            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             topBar {
                 commonLeftButton()
@@ -99,7 +104,42 @@ class MyTeamActivity : BaseActivity<MyTeamViewModel>(){
                     text = "我的团队"
                 }
             }
+            tabSegment {
+                segment = this
+                background = resources.getDrawable(R.color.segtabment_bg_color)
+                addOnTabSelectedListener(object :
+                    QMUITabSegment.OnTabSelectedListener {
+                    override fun onDoubleTap(index: Int) {}
+                    override fun onTabReselected(index: Int) {}
+                    override fun onTabUnselected(index: Int) {}
+                    override fun onTabSelected(index: Int) {
+                        selectedTabIndex = index
+                    }
+                })
+                setIndicator(
+                    QMUITabIndicator(
+                        QMUIDisplayHelper.dp2px(context, 2),
+                        false,
+                        true
+                    )
+                )
+                setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+            }.lparams(matchParent, autoSize(80))
+
+            view {
+                background = resources.getDrawable(R.color.main_hit_bg_color)
+            }.lparams(matchParent, autoSize(1)) {
+                marginStart = autoSize(32)
+                marginEnd = autoSize(32)
+            }
+            viewPager {
+                background = resources.getDrawable(R.color.white)
+                viewPager = this
+                adapter = newPagerAdapter
+            }.lparams(matchParent, matchParent)
 
+            segment.setupWithViewPager(viewPager)
+            segment.selectTab(selectedTabIndex)
 
         }
     }
@@ -256,12 +296,13 @@ class TeamOrderUI(private val activity : AppCompatActivity,private val viewModel
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 linearLayout {
-                    backgroundDrawable = createRoundRectDrawable("#f4f4f4", 24)
-                    gravity = Gravity.CENTER_VERTICAL
+                    backgroundDrawable = createRoundRectDrawable("#f4f4f4", 4)
+
                     imageView {
                         imageResource = R.mipmap.rma_search
                     }.lparams(autoSize(35), autoSize(35)) {
                         marginStart = autoSize(20)
+                        topMargin = autoSize(20)
                     }
 
                     editText {
@@ -286,7 +327,7 @@ class TeamOrderUI(private val activity : AppCompatActivity,private val viewModel
 //                            }
 //
 //                        })
-
+                        setPadding(0,20,0,15)
                         setInputType(InputType.TYPE_CLASS_TEXT)
                         setSingleLine(true)
                         setImeOptions(EditorInfo.IME_ACTION_SEND)
@@ -296,7 +337,7 @@ class TeamOrderUI(private val activity : AppCompatActivity,private val viewModel
                         hintColorStr = "#666666"
                         textSizeAuto = 28
                         textColorStr = "#000000"
-                    }
+                    }.lparams(matchParent, autoSize(67))
 
                 }.lparams(0, autoSize(67), 1f) {
                     marginStart = autoSize(36)

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

@@ -515,6 +515,7 @@ class MoneyOutUI(
                             Amount = amount_input.text.toString().toDouble(),
                             extend_info = getJSONExtendInfo() ?: ""
                         ) {
+                            viewModel.getTaAccounts()
                             amount_input.setText("")
                         }
                     }

+ 12 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/withdrawmanagement/WithdrawalViewModel.kt

@@ -106,7 +106,18 @@ class WithdrawalViewModel : BaseViewModel(){
         }
     }
 
-
+    //查询资金账号信息
+    fun getTaAccounts(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+        }
+        MyApplication.getInstance()?.initializeManager?.getTaAccounts(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                GlobalDataCollection.instance?.accountDataList = respData
+                resetAccountData()
+            }
+        }
+    }
 
     /**
      * 出金请求

+ 3 - 23
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/DealDetailsActivity.kt

@@ -6,6 +6,7 @@ import android.view.View
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.data.ContractTradeDetailData
 import cn.muchinfo.rma.global.toPercentage
+import cn.muchinfo.rma.global.toShowTime2
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.autoWidget.utils.NumberUtils
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -28,7 +29,7 @@ class DealDetailsActivity : BaseActivity<PayViewModel>(){
                 // 返回
                 commonLeftButton()
                 commonTitle {
-                    text = "待付详情"
+                    text = "成交详情"
                 }
             }
 
@@ -149,27 +150,6 @@ class DealDetailsActivity : BaseActivity<PayViewModel>(){
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                     gravity = Gravity.LEFT
-                    text = "成交金额"
-                    textSizeAuto = 36
-                    textColorInt = R.color.rma_gray_color
-                }.lparams(autoSize(220), wrapContent){
-                    marginStart = autoSize(36)
-                }
-
-                textView {
-                    text = NumberUtils.roundNum(data.tradeamount,2)
-                    textSizeAuto = 36
-                    textColorInt = R.color.rma_black_33
-                }.lparams(wrapContent, wrapContent)
-
-            }.lparams(matchParent, autoSize(75))
-
-            itemView()
-
-            linearLayout {
-                gravity = Gravity.CENTER_VERTICAL
-                textView {
-                    gravity = Gravity.LEFT
                     text = "手续费"
                     textSizeAuto = 36
                     textColorInt = R.color.rma_gray_color
@@ -272,7 +252,7 @@ class DealDetailsActivity : BaseActivity<PayViewModel>(){
                 }
 
                 textView {
-                    text = data.tradetime
+                    text = data.tradetime?.toShowTime2()
                     textSizeAuto = 36
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent)