Jelajahi Sumber

风险管理6月1日提交代码-liu.bolan--企业风管bug+千海金部分UI

Liu.bolan 4 tahun lalu
induk
melakukan
c046b31434
66 mengubah file dengan 2162 tambahan dan 116 penghapusan
  1. 22 2
      RMA/app/build.gradle
  2. 3 1
      RMA/app/src/main/AndroidManifest.xml
  3. 9 3
      RMA/app/src/main/java/cn/muchinfo/rma/business/account/adapter/AccountAdapter.kt
  4. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccMgrLoginUserData.kt
  5. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccMgrTaaccountData.kt
  6. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ExposureReportData.kt
  7. 3 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/NumberSpotData.kt
  8. 28 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt
  9. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/exposure/ExposureNumberViewHolder.kt
  10. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/AccountUserViewHolder.kt
  11. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/FutureManagerViewHolder.kt
  12. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/FutureUserViewHolder.kt
  13. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/bussinessaccount/TradingUserViewHolder.kt
  14. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureAccountActivity.kt
  15. 12 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/futureaccount/AddFutureSonAccountActivity.kt
  16. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/manageaccount/ManagerUserViewHolder.kt
  17. 5 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractViewModel.kt
  18. 13 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/adapter/ContractAdapter.java
  19. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt
  20. 8 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  21. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SpotReportContentAdapter.java
  22. 12 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt
  23. 6 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddTradingLoginRoleActivity.kt
  24. 5 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetActivity.kt
  25. 15 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewHolder.kt
  26. 29 12
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt
  27. 6 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt
  28. 24 17
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/login/LoginActivity.kt
  29. 183 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureFragment.kt
  30. 30 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureViewModel.kt
  31. 6 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/DemoData.kt
  32. 221 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java
  33. 59 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QhjRightScrollAdapter.java
  34. 77 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt
  35. 22 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumCancellationsUI.kt
  36. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumDealUI.kt
  37. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumMoneyUI.kt
  38. 21 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumPositionUI.kt
  39. 200 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt
  40. 12 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt
  41. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ContractDetailActivity.kt
  42. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementFragment.kt
  43. 4 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementViewModel.kt
  44. 0 5
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/RightScrollAdapter.java
  45. 101 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjAnnouncementViewHolder.kt
  46. 667 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjHomeFragment.kt
  47. 131 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjHomeViewModel.kt
  48. 1 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/sale/SaleFragment.kt
  49. 1 1
      RMA/app/src/main/res/drawable/ic_down_select.xml
  50. 7 0
      RMA/app/src/main/res/drawable/qhj_green_bg.xml
  51. 7 0
      RMA/app/src/main/res/drawable/qhj_red_bg.xml
  52. 121 0
      RMA/app/src/main/res/layout/layout_item_platinum_content.xml
  53. 22 0
      RMA/app/src/main/res/layout/layout_qhj_item_scroll.xml
  54. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/ic_check_normal.png
  55. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/ic_check_select.png
  56. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/img_start.png
  57. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_cast_surely_management.png
  58. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_money_information.png
  59. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_select_goods.png
  60. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_title_down_click.png
  61. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_trading_query.png
  62. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/qhj_withdrawal.png
  63. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/rma_login_bg.png
  64. TEMPAT SAMPAH
      RMA/app/src/main/res/mipmap-xhdpi/rma_login_logo.png
  65. 2 0
      RMA/app/src/main/res/values/colors.xml
  66. 1 1
      RMA/app/src/main/res/values/strings.xml

+ 22 - 2
RMA/app/build.gradle

@@ -19,8 +19,8 @@ android {
         applicationId "cn.muchinfo.rma"
         minSdkVersion 24
         targetSdkVersion 30
-        versionCode 50004
-        versionName "5.0.04"
+        versionCode 50005
+        versionName "5.0.05"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         //指定room.schemaLocation生成的文件路径
@@ -29,6 +29,26 @@ android {
                 arguments = [moduleName: project.getName()]
             }
         }
+        flavorDimensions "versionCode"
+    }
+
+    productFlavors{
+        // app1
+        app1 {
+            // 设置applicationId(这里很重要,两个相同applicationId的apk不同同时安装在同一台Android手机中)
+            applicationId "cn.muchinfo.rma"
+            // 自动生成@string/app_name为demo
+            resValue "string","app_name","风管云平台"
+            // 定义app_icon字段,在AndroidManifest.xml文件中用到
+            manifestPlaceholders = [app_icon : "@mipmap/ic_launcher"]
+        }
+        // app2
+        app2 {
+            // 解释同app1
+            applicationId "cn.muchinfo.qhj"
+            resValue "string","app_name","千海金"
+            manifestPlaceholders = [app_icon : "@mipmap/ic_launcher"]
+        }
     }
 
     buildTypes {

+ 3 - 1
RMA/app/src/main/AndroidManifest.xml

@@ -28,7 +28,7 @@
     <application
         android:name=".view.MyApplication"
         android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
+        android:icon="${app_icon}"
         android:label="@string/app_name"
         android:roundIcon="@mipmap/ic_launcher"
         android:requestLegacyExternalStorage="true"
@@ -279,6 +279,8 @@
         <activity android:name=".view.base.main.castsurely.CastSurelyDetailsActivity"/>
 
         <activity android:name=".view.base.main.addressmanagement.MyAddressManagementActivity"/>
+
+        <activity android:name=".view.base.platinumtreasure.trade.PlatinumTradeActivity"/>
     </application>
 
 </manifest>

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

@@ -428,7 +428,7 @@ class AccountAdapter {
             autoid : Long = 0,
             operatetype : Int,
             modifyremark : String = "",
-            rolename : String,
+            rolename : String = "",
             memberfuncmenus : List<ManageServiceMI2.MemberFuncMenu>
         ) : Packet50{
             val builder = ManageServiceMI2.ManagerRoleOperateReq.newBuilder()
@@ -449,9 +449,15 @@ class AccountAdapter {
             builder.operatetype = operatetype
             builder.areauserid = loginInfo.userID.toLong()
             builder.modifierid = loginInfo.loginID
+
             builder.modifyremark = modifyremark
-            builder.rolename = rolename
-            builder.addAllMemberfuncmenus(memberfuncmenus)
+            if (rolename.isNotEmpty()){
+                builder.rolename = rolename
+            }
+            if (memberfuncmenus.isNotEmpty()){
+                builder.addAllMemberfuncmenus(memberfuncmenus)
+            }
+
 
             val arrayOutputStream = ByteArrayOutputStream()
             builder.build().writeTo(arrayOutputStream)

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

@@ -11,7 +11,7 @@ data class AccMgrLoginUserData(
     val rolename : String? = "",//角色名称
     val userlist : List<Userlist>? = arrayListOf(),//用户列表
     val usertype : String? = "",//用户类型 2-机构 7-企业成员(云平台)
-    var isSelect : Int = 0, //是否展开
+    var isSelect : Int = 1, //是否展开
     val roleid : String? = "",//角色id
     val accountstatus : String? = "",//账户的状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:停用(注销) 7:注销(删除)
     val mobile : String? = "",//手机号

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

@@ -9,7 +9,7 @@ import android.os.Parcelable
 data class AccMgrTaaccountData(
     val mainAcc : AccMgrTaaccountSonData? = AccMgrTaaccountSonData(),
     val subacclist : List<AccMgrTaaccountSonData>? = arrayListOf(),//子账户列表
-    var isSelect : Int = 0//是否点击展开
+    var isSelect : Int = 1//是否点击展开
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
         parcel.readParcelable(AccMgrTaaccountSonData::class.java.classLoader),

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

@@ -11,7 +11,7 @@ data class ExposureReportData(
     val buyfutureqty : String? = "",//买入期货数量
     val buyplanqty : String? = "",//采购计划数量
     val buypricedqty : String? = "",//采购合同已定价数量
-    val diffFutuQty : String? = "",//变动量(期货)
+    val diffFutuQty : String? = "0",//变动量(期货)
     val diffSpotQty : String? = "",//变动量(现货)
     val enumdicname : String? = "",//单位名称
     val middlegoodscode : String? = "",//套保品种代码
@@ -44,7 +44,7 @@ data class ExposureReportData(
     val cycletime : String? = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
     val cycletype : String? = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
     val diffexposure : String? = "",//变动量(套保敞口)
-    val diffhedgeqty : String? = "",//变动量(现货应套保总量)
+    val diffhedgeqty : String? = "0",//变动量(现货应套保总量)
     val diffmgqtya : String? = "",//套保变动量
     val diffmgqtyb : String? = "",//套利变动量
     val diffqty : String? = "",//变动量(总敞口)

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

@@ -44,6 +44,7 @@ data class NumberSpotData(
     //------------三期-----------
     val deliverygoodsname : String? = "",//现货品种名称
     val deliverygoodsid : String? = "",//现货品种id
+    val enumdicname : String? = "",//单位
     val deliverygoodscode : String? = ""//现货品种代码
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
@@ -81,6 +82,7 @@ data class NumberSpotData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -120,6 +122,7 @@ data class NumberSpotData(
         parcel.writeString(ydsellposition)
         parcel.writeString(deliverygoodsname)
         parcel.writeString(deliverygoodsid)
+        parcel.writeString(enumdicname)
         parcel.writeString(deliverygoodscode)
     }
 

+ 28 - 12
RMA/app/src/main/java/cn/muchinfo/rma/view/MainActivity.kt

@@ -15,7 +15,9 @@ import cn.muchinfo.rma.view.base.exposure.ExposureFragment
 import cn.muchinfo.rma.view.base.future.FutureFragment
 import cn.muchinfo.rma.view.base.home.HomeFragment
 import cn.muchinfo.rma.view.base.main.SeaKingMainFragment
+import cn.muchinfo.rma.view.base.platinumtreasure.PlatinumTreasureFragment
 import cn.muchinfo.rma.view.base.procurement.ProcurementFragment
+import cn.muchinfo.rma.view.base.qhjhome.QhjHomeFragment
 import cn.muchinfo.rma.view.base.sale.SaleFragment
 import cn.muchinfo.rma.view.eventbus.EventConstent
 import cn.muchinfo.rma.view.eventbus.MessageEvent
@@ -37,6 +39,11 @@ import kotlin.concurrent.schedule
 
 class MainActivity : BaseActivity<MainViewModel>() {
 
+    /** 千海金首页 **/
+    val qhjHomeFragment by lazy {
+        QhjHomeFragment()
+    }
+
     /** 首页 **/
     val homeFragment by lazy {
         HomeFragment()
@@ -62,10 +69,16 @@ class MainActivity : BaseActivity<MainViewModel>() {
         ExposureFragment()
     }
 
+    /** 千海金我的页面 ***/
     val seaKingMainFragment by lazy {
         SeaKingMainFragment()
     }
 
+    /** 千海金-铂金宝 ***/
+    val platinumTreasureFragment by lazy {
+        PlatinumTreasureFragment()
+    }
+
     /** 状态控制页 **/
     private lateinit var statusLayout: StatusLayout
 
@@ -119,10 +132,12 @@ class MainActivity : BaseActivity<MainViewModel>() {
     }
 
     fun initFragmentData(){
+//        newFragments.add(qhjHomeFragment)
         newFragments.add(homeFragment)
         newTabText.add("首页")
         newNormalIcon.add(R.mipmap.main_tab_1)
         newSelectIcon.add(R.mipmap.rma_select_main_tab_1)
+
         if (GlobalDataCollection.instance?.getFirstLevelMenu("client_po") == true){
             newFragments.add(procurementFragment)
             newTabText.add("采购")
@@ -148,22 +163,23 @@ class MainActivity : BaseActivity<MainViewModel>() {
             newSelectIcon.add(R.mipmap.rma_select_main_tab_5)
         }
 
-        //前海金我的页面
-//        newFragments.add(seaKingMainFragment)
-//        newTabText.add("我的")
-//        newNormalIcon.add(R.mipmap.qhj_main_tab_normal)
-//        newSelectIcon.add(R.mipmap.qhj_main_tab_select)
-
         //前海金铂金宝
-//        newTabText.add("铂金宝")
-//        newNormalIcon.add(R.mipmap.qhj_bjb_tab_normal)
-//        newSelectIcon.add(R.mipmap.qhj_bjb_tab_select)
+        newFragments.add(platinumTreasureFragment)
+        newTabText.add("铂金宝")
+        newNormalIcon.add(R.mipmap.qhj_bjb_tab_normal)
+        newSelectIcon.add(R.mipmap.qhj_bjb_tab_select)
 
         //前海金饰品回购
 //        newTabText.add("饰品回购")
 //        newNormalIcon.add(R.mipmap.qhj_sphg_tab_normal)
 //        newSelectIcon.add(R.mipmap.qhj_sphg_tab_select)
 
+        //前海金我的页面
+//        newFragments.add(seaKingMainFragment)
+//        newTabText.add("我的")
+//        newNormalIcon.add(R.mipmap.qhj_main_tab_normal)
+//        newSelectIcon.add(R.mipmap.qhj_main_tab_select)
+
     }
 
     private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
@@ -221,9 +237,9 @@ class MainActivity : BaseActivity<MainViewModel>() {
                     .setOnTabClickListener(object : EasyNavigationBar.OnTabClickListener{
                         override fun onTabSelectEvent(view: View?, position: Int): Boolean {
                              // FIXME 后期在此处添加首页滑动到顶部处理
-                            if (position == 0){
-                                homeFragment.refrashAccount()
-                            }
+//                            if (position == 0){
+//                                homeFragment.refrashAccount()
+//                            }
                             return false
                         }
 

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

@@ -80,7 +80,7 @@ class ExposureNumberViewHolder(
                 textView {
                     data.bindOptional(context){
                         text = if (type == "1"){
-                            NumberUtils.roundNum(it?.oritoalspotqty,2)
+                            NumberUtils.roundNum(it?.oritoalspotqty,2) + it?.enumdicname
                         }else{
                             it?.totalydqty + "手"
                         }
@@ -95,7 +95,7 @@ class ExposureNumberViewHolder(
                 textView {
                     data.bindOptional(context){
                         text = if (type == "1"){
-                            it?.increaseqty
+                            it?.increaseqty + it?.enumdicname
                         }else{
                             it?.increaseqty + "手"
                         }
@@ -109,7 +109,7 @@ class ExposureNumberViewHolder(
                             if (it?.decreaseqty == "-0"){
                                 text = "0"
                             } else{
-                                text = it?.decreaseqty
+                                text = it?.decreaseqty + it?.enumdicname
                             }
                         }else{
                            text = it?.decreaseqty + "手"

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/AccountUserViewHolder.kt

@@ -196,7 +196,7 @@ class AccountUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "锁定"
+                    text = "冻结"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {
@@ -257,7 +257,7 @@ class AccountUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "解"
+                    text = "解"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/FutureManagerViewHolder.kt

@@ -52,7 +52,7 @@ class FutureManagerViewHolder(private val activity : AppCompatActivity,private v
 
                 textView {
                     data.bindOptional(context) {
-                        text = it?.mainAcc?.accountname + "  -  " +  it?.mainAcc?.accountid + "           " + it?.mainAcc?.fcname
+                        text = it?.mainAcc?.accountname + "  -  " +  it?.mainAcc?.hedgeaccountcode + "           " + it?.mainAcc?.fcname
                     }
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
@@ -109,7 +109,7 @@ class FutureManagerViewHolder(private val activity : AppCompatActivity,private v
                     val futureUserAdapter: BaseAdapter<AccMgrTaaccountSonData, FutureUserViewHolder> =
                         BaseAdapter { _, _ -> FutureUserViewHolder(activity, viewModel,dataIndex,data.value?.mainAcc ?: AccMgrTaaccountSonData()) }
                     adapter = futureUserAdapter
-                    futureUserAdapter.setNewData(it?.subacclist)
+                    futureUserAdapter.setNewData(it?.subacclist?.remove { it.tradestatus == "7" })
                 }
 
             }.lparams(matchParent, wrapContent)

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/accountviewholder/FutureUserViewHolder.kt

@@ -56,7 +56,7 @@ class FutureUserViewHolder(private val activity : AppCompatActivity,private val
                 gravity = Gravity.CENTER_VERTICAL
                 textView {
                     data.bindOptional(context) {
-                        text = it?.accountname + "  -  " + it?.accountid
+                        text = it?.accountname + "  -  " + it?.hedgeaccountcode
                     }
                     textColorInt = R.color.rma_black_33
                     textSizeAuto = 31
@@ -198,7 +198,7 @@ class FutureUserViewHolder(private val activity : AppCompatActivity,private val
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "解"
+                    text = "解"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/bussinessaccount/TradingUserViewHolder.kt

@@ -200,7 +200,7 @@ class TradingUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "锁定"
+                    text = "冻结"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {
@@ -261,7 +261,7 @@ class TradingUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "解"
+                    text = "解"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {

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

@@ -203,7 +203,7 @@ class AddFutureAccountActivity : BaseActivity<FutureAccountViewModel>(){
                 editText {
                     login_account = this
                     if (type == "2"){
-                        setText(data.accountid)
+                        setText(data.hedgeaccountcode)
                     }
                     hint = "请输入期货登录账号"
                     background = null

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

@@ -54,7 +54,8 @@ class AddFutureSonAccountActivity : BaseActivity<FutureAccountViewModel>() {
      */
     fun init() {
         viewModel.queryTradeConfigTMP()
-        viewModel.queryTradingAccMgrLoginUser(type = type ?: "",relateduserid = data.relateduserid ?: "")
+        viewModel.queryTradingAccMgrLoginUser(type = type ?: "",relateduserid = dataSon.relateduserid ?: "")
+
     }
 
     val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
@@ -92,7 +93,7 @@ class AddFutureSonAccountActivity : BaseActivity<FutureAccountViewModel>() {
                 }
 
                 textView {
-                    text = data.accountname + "/" + data.accountid
+                    text = data.accountname + "/" + data.hedgeaccountcode
                     textSizeAuto = 31
                     textColorInt = R.color.rma_black_33
                 }.lparams(wrapContent, wrapContent) {
@@ -250,6 +251,9 @@ class AddFutureSonAccountActivity : BaseActivity<FutureAccountViewModel>() {
                 background = resources.getDrawable(R.color.white)
                 gravity = Gravity.CENTER_VERTICAL
                 onThrottleFirstClick {
+                    if (type == "3"){
+                        return@onThrottleFirstClick
+                    }
                     creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
                         viewModel.selectTradingAccountData.postValue(this)
                     }
@@ -277,10 +281,16 @@ class AddFutureSonAccountActivity : BaseActivity<FutureAccountViewModel>() {
                 emptyView()
 
                 imageView {
+                    if (type == "3"){
+                        visibility = View.GONE
+                    }
                     imageResource = R.mipmap.rma_more
                 }.lparams(autoSize(43), autoSize(43))
 
                 imageView {
+                    if (type == "3"){
+                        visibility = View.GONE
+                    }
                     onThrottleFirstClick {
                         val intent = Intent()
                         intent.putExtra("type","1")

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/accountmanager/manageaccount/ManagerUserViewHolder.kt

@@ -192,7 +192,7 @@ class ManagerUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "锁定"
+                    text = "冻结"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {
@@ -253,7 +253,7 @@ class ManagerUserViewHolder(
                     }
                     backgroundResource = R.drawable.rma_item_click_bg
                     gravity = Gravity.CENTER
-                    text = "解"
+                    text = "解"
                     textColorInt = R.color.rma_item_click_color
                     textSizeAuto = 26
                 }.lparams(autoSize(110), autoSize(48)) {

+ 5 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/ContractViewModel.kt

@@ -115,7 +115,9 @@ class ContractViewModel : BaseViewModel() {
     fun getCanSelectTradingAccountList(): List<SelectData> {
         val selectDataList = arrayListOf<SelectData>()
         tradingAccountManagerList.value?.forEach {
-            selectDataList.add(SelectData(id = it.roleid ?: "", value = it.rolename ?: ""))
+            if (it.accountstatus != "7"){
+                selectDataList.add(SelectData(id = it.roleid ?: "", value = it.rolename ?: ""))
+            }
         }
         return selectDataList
     }
@@ -187,7 +189,7 @@ class ContractViewModel : BaseViewModel() {
         accountManagerList.value?.forEach {
             if (it.roleid == "22") {
                 it.userlist?.forEach {
-                    if (it.roletype?.contains("22") == true) {
+                    if (it.roletype?.contains("22") == true && it.loginstatus != "3") {
                         newSelectData.add(
                             SelectData(
                                 id = it.userid ?: "",
@@ -210,7 +212,7 @@ class ContractViewModel : BaseViewModel() {
         accountManagerList.value?.forEach {
             if (it.roleid == "23") {
                 it.userlist?.forEach {
-                    if (it.roletype?.contains("23") == true) {
+                    if (it.roletype?.contains("23") == true && it.loginstatus != "3") {
                         newSelectData.add(
                             SelectData(
                                 id = it.userid ?: "",

+ 13 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/adapter/ContractAdapter.java

@@ -252,11 +252,19 @@ public class ContractAdapter extends RecyclerView.Adapter<ContractAdapter.ItemVi
         });
         //详情
         itemViewHolder.contract_details.setOnClickListener(view -> {
-            Intent intent = new Intent();
-            intent.putExtra("data", datas.get(i));
-            intent.putExtra("type",this.type);
-            intent.setClass(context, ContractDetailActivity.class);
-            context.startActivity(intent);
+            if (datas.get(i).getContracctstatus().equals("0") || datas.get(i).getContracctstatus().equals("1")){
+                Intent intent = new Intent();
+                intent.putExtra("data", datas.get(i));
+                intent.putExtra("type","1");
+                intent.setClass(context, ContractDetailsActivity.class);
+                context.startActivity(intent);
+            }else {
+                Intent intent = new Intent();
+                intent.putExtra("data", datas.get(i));
+                intent.putExtra("type",this.type);
+                intent.setClass(context, ContractDetailActivity.class);
+                context.startActivity(intent);
+            }
         });
 
         itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {

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

@@ -976,7 +976,7 @@ class SpotReportUI(
 //                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
-                    setEnableRefresh(false)
+                    setEnableRefresh(true)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
                         /**

+ 8 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt

@@ -624,11 +624,11 @@ class ReportQueryViewModel : BaseViewModel(){
             //'现货品类 '
             newRightData.add(it.wrstandardname ?: "")
             //'期初量/\n 期末量 '
-            newRightData.add(NumberUtils.doubleDistortion(it.oriqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.oriqty) + it.enumdicname)
+            newRightData.add(NumberUtils.doubleDistortion(it.oriqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.curqty) + it.enumdicname)
             //'今采购量/\n 今销售量 '
             newRightData.add(NumberUtils.doubleDistortion(it.todaybuyqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.todaysellqty) + it.enumdicname)
-            //'今入库量/\n 今出库量 '
-            newRightData.add(NumberUtils.doubleDistortion(it.todayinqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.todayoutqty) + it.enumdicname)
+//            //'今入库量/\n 今出库量 ' 任务 #95307
+//            newRightData.add(NumberUtils.doubleDistortion(it.todayinqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.todayoutqty) + it.enumdicname)
             //'期初额/\n 期末额 '
             newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriamount),2)  + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.curamount),2) )
             // '期初均价/\n 期末均价 '
@@ -707,7 +707,7 @@ class ReportQueryViewModel : BaseViewModel(){
             //'套保量/\n 套利量 '
             newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.hedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.arbitrageqty),2) + it.enumdicname)
             //'现货总量/\n 变动量 '
-            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalspotqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffhedgeqty,2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalspotqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffSpotQty,2) + it.enumdicname)
             //'套保变动量/\n 套利变动量 '
             newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffmgqtya),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffmgqtyb,2) + it.enumdicname)
             //'套保比例/\n 套利比例 '
@@ -719,9 +719,9 @@ class ReportQueryViewModel : BaseViewModel(){
             //'期货总量/\n 变动量 '
             newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalfutureqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffFutuQty),2) + it.enumdicname)
             //'套保敞口/\n 变动量 '
-            newRightData.add(it.needhedgeexposoure + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffexposure),2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.needhedgeexposoure),2) + it.enumdicname +  "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffexposure),2) + it.enumdicname)
             //'总敞口/\n 变动量 '
-            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalexposure),2) + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffqty),2) + it.enumdicname)
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalexposure),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffqty),2) + it.enumdicname)
             val newData = it.copy(rightData = newRightData)
             newList.add(newData)
         }
@@ -835,7 +835,7 @@ class ReportQueryViewModel : BaseViewModel(){
         respData.forEach {
             val newRightData = arrayListOf<String>()
             newRightData.add(it.diffqty + it.enumdicname)
-            newRightData.add(it.oristock ?: "--" + it.enumdicname + "\n" + it.curstock + it.enumdicname)
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)
             newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)
             newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)
             newRightData.add(it.unbuyinqty + it.enumdicname + "\n" + it.unselloutqty + it.enumdicname)
@@ -855,7 +855,7 @@ class ReportQueryViewModel : BaseViewModel(){
         respData.forEach {
             val newRightData = arrayListOf<String>()
             newRightData.add(it.wrstandardname + "\n" + it.diffqty + it.enumdicname)
-            newRightData.add(it.oristock ?: "--" + it.enumdicname + "\n" + it.curstock + it.enumdicname)
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)
             newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)
             newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)
             val newData = it.copy(rightData = newRightData)

+ 1 - 1
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SpotReportContentAdapter.java

@@ -121,7 +121,7 @@ public class SpotReportContentAdapter extends RecyclerView.Adapter<SpotReportCon
 
         AreaSpotplReportData data = datas.get(i);
         itemViewHolder.tvLeftTitle.setText(datas.get(i).getCurrencyname());
-//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getDeliverygoodsname());
         //右边滑动部分
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
         linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);

+ 12 - 12
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt

@@ -490,7 +490,7 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             newRightData.add(it.wrstandardname + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
             newRightData.add(it.oriqty + it.enumdicname + "\n" + it.curqty + it.enumdicname)//'期初量/\n 期末量 '
             newRightData.add(it.todaybuyqty + it.enumdicname + "\n" + it.todaysellqty + it.enumdicname)//'今采购量/\n 今销售量 '
-            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 '
+//            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 ' 任务 #95314
             newRightData.add(NumberUtils.roundNum(it.oriamount,2) + "\n" + NumberUtils.roundNum(it.curamount,2))//'期初额/\n 期末额 '
             newRightData.add(NumberUtils.roundNum(it.oriaverageprice,2) + "\n" + NumberUtils.roundNum(it.curaverageprice,2))//'期初均价/\n 期末均价 '
             newRightData.add(NumberUtils.roundNum(it.todaybuyamount,2) + "\n" + NumberUtils.roundNum(it.todaysellamount,2))//'今采购额/\n 今销售额 '
@@ -513,7 +513,7 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             newRightData.add(it.wrstandardname + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
             newRightData.add(it.oriqty + it.enumdicname + "\n" + it.curqty + it.enumdicname)//'期初量/\n 期末量 '
             newRightData.add(it.todaybuyqty + it.enumdicname + "\n" + it.todaysellqty + it.enumdicname)//'今采购量/\n 今销售量 '
-            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 '
+//            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 ' 任务 #95314
             newRightData.add(NumberUtils.roundNum(it.oriamount,2) + "\n" + NumberUtils.roundNum(it.curamount,2))//'期初额/\n 期末额 '
             newRightData.add(NumberUtils.roundNum(it.oriaverageprice,2) + "\n" + NumberUtils.roundNum(it.curaverageprice,2))//'期初均价/\n 期末均价 '
             newRightData.add(NumberUtils.roundNum(it.todaybuyamount,2) + "\n" + NumberUtils.roundNum(it.todaysellamount,2))//'今采购额/\n 今销售额 '
@@ -624,8 +624,8 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             data.leftContent = it.tradedate
             newRightData.add(if (it.contracttype == "1"){ "采购" }else{ "销售" } + "\n" + ViewEnumUtils.getHedgeplanstatus(it.hedgeplanstatus))//'计划类型/\n 计划状态 '
             newRightData.add(it.deliverygoodsname + "\n" + it.middlegoodsname)//'现货品种/\n 套保品种 '
-            newRightData.add(it.wrstandardname + "\n" + it.qty + it.enumdicname)//'现货品类/\n 计划量 '
-            newRightData.add(it.diffqty + it.enumdicname + "\n" + it.changqty + it.enumdicname)//'套保品种今变动量/\n 应套保总量变动量 '
+            newRightData.add(it.wrstandardname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'现货品类/\n 计划量 '
+            newRightData.add(NumberUtils.roundNum(it.diffqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.changqty,2) + it.enumdicname)//'套保品种今变动量/\n 应套保总量变动量 '
             newRightData.add(if (it.contracttype == "1"){ "套保" }else{ "套利" } + "\n" + it.tradedate)//'期现用途/\n 登记日 '
             data.rightData = newRightData
             newList.add(data)
@@ -641,8 +641,8 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             val newRightData = arrayListOf<String>()
             data.leftContent = if (it.contracttype == "1"){ "采购" }else{ "销售" } + "\n" + ViewEnumUtils.getHedgeplanstatus(it.hedgeplanstatus)//'计划类型/\n 计划状态 '
             newRightData.add(it.deliverygoodsname + "\n" + it.middlegoodsname)//'现货品种/\n 套保品种 '
-            newRightData.add(it.wrstandardname + "\n" + it.qty + it.enumdicname)//'现货品类/\n 计划量 '
-            newRightData.add(it.diffqty + it.enumdicname + "\n" + it.changqty + it.enumdicname)//'套保品种今变动量/\n 应套保总量变动量 '
+            newRightData.add(it.wrstandardname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'现货品类/\n 计划量 '
+            newRightData.add(NumberUtils.roundNum(it.diffqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.changqty,2) + it.enumdicname)//'套保品种今变动量/\n 应套保总量变动量 '
             newRightData.add(if (it.contracttype == "1"){ "套保" }else{ "套利" } + "\n" + it.tradedate)//'期现用途/\n 登记日 '
             data.rightData = newRightData
             newList.add(data)
@@ -659,9 +659,9 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             data.leftContent = it.tradedate//日期//
             newRightData.add(it.deliverygoodsname + "\n" + it.middlegoodsname)//'现货品种/\n 套保品种 '
             newRightData.add(it.brandname + "\n" + if (it.contracttype == "1"){ "套保" }else{ "套利" })//'现货品类/\n 业务类型 '
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//采购量/\n 销售量 '// TODO 缺少 采购量  销售量
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量  销售计划套保量
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.diffqty + it.mgunitidname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//采购量/\n 销售量 '// TODO 缺少 采购量  销售量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量  销售计划套保量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffqty,2) + it.enumdicname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
             newRightData.add(it.convertratio.toPercentage())//'数量折算系数 '
             data.rightData = newRightData
             newList.add(data)
@@ -677,9 +677,9 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
             val newRightData = arrayListOf<String>()
             data.leftContent = it.deliverygoodsname + "\n" + it.middlegoodsname//'现货品种/\n 套保品种 '
             newRightData.add(it.brandname + "\n" + if (it.contracttype == "1"){ "套保" }else{ "套利" })//'现货品类/\n 业务类型 '
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//采购量/\n 销售量 '// TODO 缺少 采购量  销售量
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量  销售计划套保量
-            newRightData.add(it.qty + it.mgunitidname + "\n" + it.diffqty + it.mgunitidname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//采购量/\n 销售量 '// TODO 缺少 采购量  销售量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量  销售计划套保量
+            newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffqty,2) + it.enumdicname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
             newRightData.add(it.convertratio.toPercentage())//'数量折算系数 '
             data.rightData = newRightData
             newList.add(data)

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

@@ -481,7 +481,12 @@ class AddTradingLoginRoleActivity : BaseActivity<RoleSetViewModel>() {
                             }
 
                             textView {
-                                text = "请勾选期货账户"
+                                if (type == "2"){
+                                    text = "已勾选期货账户"
+                                }else{
+                                    text = "请勾选期货账户"
+                                }
+                                
                                 textColorInt = R.color.rma_yellow_text_color
                                 textSizeAuto = 31
                             }.lparams(wrapContent, wrapContent) {

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

@@ -10,6 +10,8 @@ import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
 import com.blankj.utilcode.util.ActivityUtils
 import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import mtp.polymer.com.autowidget.dialog.createLoadingDialog
+import mtp.polymer.com.autowidget.utils.bindTaskStatus
 import org.jetbrains.anko.linearLayout
 import org.jetbrains.anko.matchParent
 import org.jetbrains.anko.textView
@@ -30,6 +32,8 @@ class RoleSetActivity : BaseActivity<RoleSetViewModel>() {
     private val roleSetAdapter: BaseAdapter<AccMgrRoleData, RoleSetViewHolder> =
         BaseAdapter { _, _ -> RoleSetViewHolder(this, viewModel) }
 
+    val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
+
     //每次回到页面就刷新下数据
     override fun onResume() {
         super.onResume()
@@ -41,6 +45,7 @@ class RoleSetActivity : BaseActivity<RoleSetViewModel>() {
         super.onCreate(savedInstanceState)
         verticalLayout {
             viewModel.queryAccMgrRole()
+            dialog.bindTaskStatus(context, viewModel.loadingDialogStatus)
             background = resources.getDrawable(R.color.main_hit_bg_color)
             //页面标题
             topBar {

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

@@ -97,6 +97,21 @@ class RoleSetViewHolder(private val activity : AppCompatActivity,private val vie
 
                  textView {
                      onThrottleFirstClick {
+                         viewModel.ManagerRoleOperateReq(autoid = data.value?.autoid?.toLong() ?: 0,operatetype = 3){
+                             viewModel.queryAccMgrRole()
+                         }
+                     }
+                     backgroundResource = R.drawable.rma_item_click_bg
+                     gravity = Gravity.CENTER
+                     text = "删除"
+                     textColorInt = R.color.rma_item_click_color
+                     textSizeAuto = 26
+                 }.lparams(autoSize(120), autoSize(48)) {
+                     marginEnd = autoSize(24)
+                 }
+
+                 textView {
+                     onThrottleFirstClick {
                          val intent = Intent()
                          intent.putExtra("type","2")
                          intent.putExtra("data",data.value)

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

@@ -73,20 +73,37 @@ class RoleSetViewModel : BaseViewModel(){
         }
         futureDataList.postValue(newDataList)
         if (type != "1"){
-            val newFutureList = arrayListOf<AccMgrTaaccountSonData>()
-            newDataList?.forEach { result ->
-                LogUtils.eTag("dasdadsadasd",result.accountid)
-                val findData = data.acclist?.find {
-                    it.accountid == result.accountid
+            if (type == "2"){
+                val newFutureList = arrayListOf<AccMgrTaaccountSonData>()
+                newDataList?.forEach { result ->
+                    LogUtils.eTag("dasdadsadasd",result.accountid)
+                    val findData = data.acclist?.find {
+                        it.accountid == result.accountid
+                    }
+                    if (findData?.accountid.isNullOrEmpty()){
+//                        newFutureList.add(result)
+                    }else{
+                        newFutureList.add(result.copy(isSelect = 1))
+                    }
                 }
-                if (findData?.accountid.isNullOrEmpty()){
-                    newFutureList.add(result)
+                futureDataList.postValue(newFutureList)
+            }else{
+                val newFutureList = arrayListOf<AccMgrTaaccountSonData>()
+                newDataList?.forEach { result ->
+                    LogUtils.eTag("dasdadsadasd",result.accountid)
+                    val findData = data.acclist?.find {
+                        it.accountid == result.accountid
+                    }
+                    if (findData?.accountid.isNullOrEmpty()){
+                        newFutureList.add(result)
 
-                }else{
-                    newFutureList.add(result.copy(isSelect = 1))
+                    }else{
+                        newFutureList.add(result.copy(isSelect = 1))
+                    }
                 }
+                futureDataList.postValue(newFutureList)
             }
-            futureDataList.postValue(newFutureList)
+
         }
     }
 
@@ -332,8 +349,8 @@ class RoleSetViewModel : BaseViewModel(){
         autoid : Long = 0,
         operatetype : Int,
         modifyremark : String = "",
-        rolename : String,
-        memberfuncmenus : List<ManageServiceMI2.MemberFuncMenu>,
+        rolename : String = "",
+        memberfuncmenus : List<ManageServiceMI2.MemberFuncMenu> = arrayListOf(),
         isSuccess: (isCompleted: Boolean) -> Unit
     ){
         loadingDialogStatus.value = TaskUiModel.inFlight()

+ 6 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/spotmarket/SpotMarketPriceViewHolder.kt

@@ -108,11 +108,12 @@ class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private
                 }
 
                 textView {
-                    if (GlobalDataCollection.instance?.getSecondLevelMenu(firstCode = "client_spotmarketprice",secondCode = "client_spotmarketprice_delete") == true){
-                        visibility = View.VISIBLE
-                    }else{
-                        visibility = View.GONE
-                    }
+                    visibility = View.GONE //任务 #95309
+//                    if (GlobalDataCollection.instance?.getSecondLevelMenu(firstCode = "client_spotmarketprice",secondCode = "client_spotmarketprice_delete") == true){
+//                        visibility = View.VISIBLE
+//                    }else{
+//                        visibility = View.GONE
+//                    }
                     onThrottleFirstClick {
                         activity.createWarningDialog {
                             setTitle("温馨提示")

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

@@ -8,6 +8,7 @@ import android.os.Bundle
 import android.text.InputType.TYPE_CLASS_TEXT
 import android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD
 import android.view.Gravity
+import android.view.View
 import android.widget.CheckBox
 import android.widget.EditText
 import android.widget.FrameLayout
@@ -110,14 +111,15 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
         dialog.bindTaskStatus(context = this, taskUiModelData = viewModel.loadingDialogStatus)
 
         verticalLayout {
-
+            backgroundResource = R.mipmap.rma_login_bg
             imageView {
+                visibility = View.INVISIBLE
                 imageResource = R.mipmap.login_top
             }.lparams(matchParent, autoSize(507))
 
             imageView {
-                imageResource = R.mipmap.login_logo
-            }.lparams(autoSize(306), autoSize(306)) {
+                imageResource = R.mipmap.rma_login_logo
+            }.lparams(autoSize(480), autoSize(240)) {
                 gravity = Gravity.CENTER_HORIZONTAL
                 topMargin = -autoSize(150)
             }
@@ -153,6 +155,8 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                             }
                         }
                     }
+                    hintColorStr = "#83B7FF"
+                    textColorInt = R.color.white
                     loginCodeEditText = this
                     hint = "手机号码/登录账号"
                     background = null
@@ -215,7 +219,8 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                     background = null
                     textSizeAuto = 34
                     inputType = TYPE_CLASS_TEXT or TYPE_TEXT_VARIATION_PASSWORD
-
+                    hintColorStr = "#83B7FF"
+                    textColorInt = R.color.white
                 }.lparams(matchParent, wrapContent) {
                     leftMargin = autoSize(53)
                 }
@@ -225,7 +230,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
             }
 
             view {
-                backgroundColor = R.color.rma_blue_color
+                backgroundColor = R.color.white
             }.lparams(matchParent, autoSize(1)) {
                 leftMargin = autoSize(36)
                 rightMargin = autoSize(36)
@@ -247,7 +252,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
 
                 textView {
                     text = "记住密码"
-                    textColorInt = R.color.rma_black_33
+                    textColorInt = R.color.white
                     textSizeAuto = 34
                 }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(20)
@@ -262,7 +267,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                         ActivityUtils.startActivity(intent)
                     }
                     text = "忘记密码?"
-                    textColorInt = R.color.rma_black_33
+                    textColorInt = R.color.white
                     textSizeAuto = 34
                 }.lparams(wrapContent, wrapContent) {
                     marginEnd = autoSize(20)
@@ -271,12 +276,14 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
             }.lparams(matchParent, autoSize(120))
 
             button {
-                gravity = Gravity.CENTER_HORIZONTAL
+                gravity = Gravity.CENTER
                 text = "登录"
                 textSizeAuto = 40
                 textColorInt = R.color.white
-                backgroundResource = R.mipmap.login_btn
-            }.lparams(autoSize(820), autoSize(143)) {
+                backgroundDrawable =
+                    createRoundRectDrawable("#2794FF", 45)
+//                backgroundResource = R.mipmap.login_btn
+            }.lparams(autoSize(820), autoSize(96)) {
                 gravity = Gravity.CENTER_HORIZONTAL
                 topMargin = autoSize(25)
             }.onClick {
@@ -310,18 +317,18 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                 imageView {
                     isReadAgreement.bindOptional(context) {
                         imageResource = if (it == true) {
-                            R.drawable.ic_check_select
+                            R.mipmap.ic_check_select
                         } else {
-                            R.drawable.ic_check_normal
+                            R.mipmap.ic_check_normal
                         }
                     }
-                    imageResource = R.drawable.ic_check_normal
+                    imageResource = R.mipmap.ic_check_normal
                 }.lparams(autoSize(35), autoSize(35))
 
                 textView {
                     text = "我已阅读并同意"
                     textSizeAuto = 31
-                    textColorInt = R.color.text_hint_color_two
+                    textColorStr = "#83B7FF"
                 }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(15)
                 }
@@ -334,7 +341,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                     }
                     text = "《用户协议》"
                     textSizeAuto = 31
-                    textColorInt = R.color.rma_blue_color
+                    textColorStr = "#83B7FF"
                 }.lparams(wrapContent, wrapContent) {
                     marginStart = autoSize(15)
                 }
@@ -350,7 +357,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                 textView {
                     text = "Copyright © 2021 Muchinfo. All rights reserved."
                     textSizeAuto = 26
-                    textColorInt = R.color.rma_black_33
+                    textColorInt = R.color.white
                 }.lparams(wrapContent, wrapContent)
             }.lparams(matchParent, wrapContent)
 
@@ -359,7 +366,7 @@ class LoginActivity : BaseActivity<LoginViewModel>() , UserPopupWindow.OnClearAc
                 textView {
                     text = "版本号:V" + BuildConfig.VERSION_NAME
                     textSizeAuto = 20
-                    textColorInt = R.color.rma_black_33
+                    textColorInt = R.color.white
                 }.lparams(wrapContent, wrapContent)
             }.lparams(matchParent, wrapContent) {
                 topMargin = autoSize(10)

+ 183 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureFragment.kt

@@ -0,0 +1,183 @@
+package cn.muchinfo.rma.view.base.platinumtreasure
+
+import android.os.Bundle
+import android.view.*
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.platinumtreasure.adapter.PlatnumTreasureAdapter
+import cn.muchinfo.rma.view.base.procurement.ContentAdapter
+import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
+import com.blankj.utilcode.util.SizeUtils
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.UI
+
+/**
+ * 铂金宝fragment
+ */
+class PlatinumTreasureFragment : BaseFragment<PlatinumTreasureViewModel>() , PlatnumTreasureAdapter.OnContentScrollListener{
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    //标题头部
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val platnumTreasureAdapter by lazy {
+        PlatnumTreasureAdapter(activity)
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        return UI {
+            viewModel.initData()
+            verticalLayout {
+                linearLayout {
+                    background = resources.getDrawable(R.color.main_title_bg_color)
+                    verticalLayout {
+                        gravity = Gravity.CENTER_VERTICAL
+                        textView {
+                            text = "铂金宝"
+                            textColorInt = R.color.white
+                            textSizeAuto = 36
+                        }.lparams(wrapContent, wrapContent) {
+                            gravity = Gravity.CENTER_HORIZONTAL
+                        }
+                    }.lparams(autoSize(620), autoSize(90)) {
+                        marginStart = autoSize(140)
+                    }
+
+                    imageView {
+                        imageResource = R.mipmap.main_search
+                    }.lparams(autoSize(45), autoSize(45)) {
+                        marginStart = autoSize(32)
+                        topMargin = autoSize(20)
+                    }
+                }.lparams(matchParent, autoSize(100))
+
+                linearLayout {
+                    linearLayout {
+                        gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                        textView {//待点价头部左侧数据
+//                            viewModel.titleList.bindOptional(context) {
+//                                text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+//                            }
+                            text = "商品"
+                            textColorStr = "#AAAAAA"
+                            textSizeAuto = 31
+                        }.lparams(wrapContent, wrapContent){
+                            marginStart = autoSize(30)
+                        }
+                    }.lparams(autoSize(SizeUtils.dp2px(80f)), autoSize(100))
+                    platnumTreasureAdapter.setOnContentScrollListener(this@PlatinumTreasureFragment)
+                    inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                        horScrollview = this
+                        setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                            platnumTreasureAdapter.offestX = scrollX
+                            val viewHolderCacheList: List<PlatnumTreasureAdapter.ItemViewHolder> =
+                                platnumTreasureAdapter.viewHolderCacheList
+                            if (null != viewHolderCacheList) {
+                                val size = viewHolderCacheList.size
+                                for (i in 0 until size) {
+                                    viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                        scrollX,
+                                        0
+                                    )
+                                }
+                            }
+                        }
+                        relativeLayout {
+                            recyclerView {//待点价头部右侧数据
+                                val linearLayoutManager = LinearLayoutManager(context)
+                                linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                                layoutManager = linearLayoutManager
+                                background = resources.getDrawable(R.color.white)
+                                adapter = topAdapter
+                            }
+//                            viewModel.titleList.bindOptional(context) {
+//                                val titleStringList = arrayListOf<String>()
+//                                it?.subList(1, it.size)?.forEach { data ->
+//                                    titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+//                                }
+//                                topAdapter.setDatas(titleStringList)
+//                            }
+                            topAdapter.setDatas(arrayListOf("回购","销售","涨幅","涨跌","今开","最高","最低","昨收","时间"))
+                        }
+                    }.lparams(matchParent, matchParent)
+                }.lparams(matchParent, autoSize(100))
+
+                statusLayout(contentBlock = {
+                    statusLayout = this
+                    setRetryAction {
+
+                    }
+//                bindTaskStatus(viewModule.status)
+                    swipeToLoadLayout {
+                        swipeToLayout = this
+                        setEnableRefresh(true)
+                        setEnableLoadMore(false)
+                        setOnRefreshListener {
+
+                        }
+                        setEnableScrollContentWhenLoaded(false)
+                        setEnableLoadMoreWhenContentNotFull(false)
+
+                        recyclerView {//待点价列表
+                            background = resources.getDrawable(R.color.white)
+                            adapter = platnumTreasureAdapter
+                            addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                                override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                    super.onScrolled(recyclerView, dx, dy)
+                                    val viewHolderCacheList: List<PlatnumTreasureAdapter.ItemViewHolder> =
+                                        platnumTreasureAdapter.viewHolderCacheList
+                                    if (null != viewHolderCacheList) {
+                                        val size = viewHolderCacheList.size
+                                        for (i in 0 until size) {
+                                            viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                                platnumTreasureAdapter.getOffestX(),
+                                                0
+                                            )
+                                        }
+                                    }
+                                }
+                            })
+                        }
+
+
+                    }
+                }, emptyBlock = {
+                    emptyView(hint = resources.getString(R.string.now_no_data))
+                }).lparams(matchParent, matchParent)
+
+                viewModel.demoList.bindOptional(context) {
+                    if (it?.isEmpty() == true || it?.size == 0) {
+                        statusLayout.showEmpty()
+                    } else {
+                        if (swipeToLayout.getIsRefreshing()) {
+                            swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
+                        }
+                        statusLayout.showSuccess()
+                        platnumTreasureAdapter.setDatas(it)
+                    }
+                }
+            }
+        }.view
+    }
+
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+}

+ 30 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/PlatinumTreasureViewModel.kt

@@ -0,0 +1,30 @@
+package cn.muchinfo.rma.view.base.platinumtreasure
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.data.ColumnsData
+import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.platinumtreasure.adapter.DemoData
+
+/**
+ * 铂金宝viewmodel
+ */
+class PlatinumTreasureViewModel : BaseViewModel(){
+
+    val demoList : MutableLiveData<List<DemoData>> = MutableLiveData()
+
+    val titleList : MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    fun initData(){
+        val dataList = arrayListOf<DemoData>()
+        val data = DemoData(titleString = "黄金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
+        val data1 = DemoData(titleString = "白金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
+        val data2 = DemoData(titleString = "白银",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
+        val data3 = DemoData(titleString = "彩金",rightData = arrayListOf("10","11","12","13","14","15","16","17","198"))
+        dataList.add(data)
+        dataList.add(data1)
+        dataList.add(data2)
+        dataList.add(data3)
+        demoList.postValue(dataList)
+    }
+
+}

+ 6 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/DemoData.kt

@@ -0,0 +1,6 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.adapter
+
+data class DemoData(
+    var titleString : String = "",
+    var rightData : List<String>? = arrayListOf()
+)

+ 221 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/PlatnumTreasureAdapter.java

@@ -0,0 +1,221 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.blankj.utilcode.util.ActivityUtils;
+import com.blankj.utilcode.util.ToastUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.GlobalDataCollection;
+import cn.muchinfo.rma.global.data.ContractData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.home.registration.InvoiceRegistrationActivity;
+import cn.muchinfo.rma.view.base.home.registration.MidpointsRegistrationActivity;
+import cn.muchinfo.rma.view.base.home.registration.PaymentRegistrationActivity;
+import cn.muchinfo.rma.view.base.home.registration.SettlementRegistrationActivity;
+import cn.muchinfo.rma.view.base.home.registration.WarehouseRegistrationActivity;
+import cn.muchinfo.rma.view.base.platinumtreasure.trade.PlatinumTradeActivity;
+import cn.muchinfo.rma.view.base.procurement.ContractDetailActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 用于千海金铂金宝页面额adapter
+ */
+public class PlatnumTreasureAdapter extends RecyclerView.Adapter<PlatnumTreasureAdapter.ItemViewHolder> {
+
+
+    private Context context;
+    private List<DemoData> datas;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public PlatnumTreasureAdapter(Context context) {
+        this.context = context;
+    }
+
+    public void setDatas(List<DemoData> datas) {
+        this.datas = datas;
+        notifyDataSetChanged();
+    }
+
+    private void setPosition(int position) {
+        if (this.position == position) {
+            this.position = -1;
+            notifyItemChanged(index);
+        } else {
+            this.position = position;
+            notifyItemChanged(position);
+        }
+    }
+
+    @NonNull
+    @Override
+    public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.layout_item_platinum_content, viewGroup, false);
+        return new ItemViewHolder(view);
+    }
+
+    @SuppressLint("SetTextI18n")
+    @Override
+    public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
+        this.index = i;
+        itemViewHolder.tvLeftTitle.setText(datas.get(i).getTitleString());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        QhjRightScrollAdapter qhjRightScrollAdapter = new QhjRightScrollAdapter(context);
+        qhjRightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(qhjRightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.qhj_click_bg));
+            itemViewHolder.allView.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
+            itemViewHolder.allView.setVisibility(View.GONE);
+        }
+
+        itemViewHolder.all_click_View.setOnClickListener(view -> setPosition(i));
+        itemViewHolder.horItemScrollview.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+        //买入点击
+        itemViewHolder.platnum_buy.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Intent intent = new Intent();
+                intent.setClass(context, PlatinumTradeActivity.class);
+                ActivityUtils.startActivity(intent);
+            }
+        });
+        //卖出点击
+        itemViewHolder.platnum_sell.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Intent intent = new Intent();
+                intent.setClass(context, PlatinumTradeActivity.class);
+                ActivityUtils.startActivity(intent);
+            }
+        });
+        //图表点击
+        itemViewHolder.platnum_chart.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
+        //详情点击
+        itemViewHolder.platnum_details.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+
+            }
+        });
+
+        itemViewHolder.horItemScrollview.setEventListener(new CustomHorizontalScrollView.EventListener() {
+            @Override
+            public void onEvent(MotionEvent event) {
+                if (null != onContentScrollListener) onContentScrollListener.onScroll(event);
+            }
+        });
+        //由于viewHolder的缓存,在1级缓存取出来是2个viewholder,并且不会被重新赋值,所以这里需要处理缓存的viewholder的位移
+        itemViewHolder.horItemScrollview.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+            @Override
+            public void onGlobalLayout() {
+                if (!itemViewHolder.isLayoutFinish()) {
+                    itemViewHolder.horItemScrollview.scrollTo(offestX, 0);
+                    itemViewHolder.setLayoutFinish(true);
+                }
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == datas ? 0 : datas.size();
+    }
+
+    public List<ItemViewHolder> getViewHolderCacheList() {
+        return mViewHolderList;
+    }
+
+    public int getOffestX() {
+        return offestX;
+    }
+
+    public static class ItemViewHolder extends RecyclerView.ViewHolder {
+        LinearLayout roots_view;//根部布局
+        TextView platnum_buy;//买入
+        TextView platnum_sell;//卖出
+        TextView platnum_chart;//图表
+        TextView platnum_details;//详情
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        RecyclerView rvItemRight;//右方的列表
+        ImageView click_icon;//图标
+        public CustomHorizontalScrollView horItemScrollview;//右方的滑动控件
+        private boolean isLayoutFinish;//自定义字段,用于标记layout
+
+        public boolean isLayoutFinish() {
+            return isLayoutFinish;
+        }
+
+        public void setLayoutFinish(boolean layoutFinish) {
+            isLayoutFinish = layoutFinish;
+        }
+
+        public ItemViewHolder(@NonNull View itemView) {
+            super(itemView);
+            click_icon = itemView.findViewById(R.id.click_icon);
+            platnum_buy = itemView.findViewById(R.id.platnum_buy);
+            platnum_sell = itemView.findViewById(R.id.platnum_sell);
+            platnum_chart = itemView.findViewById(R.id.platnum_chart);
+            platnum_details = itemView.findViewById(R.id.platnum_details);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 59 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/adapter/QhjRightScrollAdapter.java

@@ -0,0 +1,59 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+
+public class QhjRightScrollAdapter extends RecyclerView.Adapter<QhjRightScrollAdapter.ScrollViewHolder> {
+
+
+    private Context context;
+    private List<String> rightDatas;
+
+    public QhjRightScrollAdapter(Context context) {
+        this.context = context;
+    }
+
+    public void setDatas(List<String> rightDatas) {
+        this.rightDatas = rightDatas;
+        notifyDataSetChanged();
+    }
+
+
+    @NonNull
+    @Override
+    public ScrollViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+        View view = LayoutInflater.from(context).inflate(R.layout.layout_qhj_item_scroll, viewGroup, false);
+        return new ScrollViewHolder(view);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull ScrollViewHolder scrollViewHolder, int i) {
+        scrollViewHolder.mTvScrollItem.setText(rightDatas.get(i));
+    }
+
+    @Override
+    public int getItemCount() {
+        return null == rightDatas ? 0 : rightDatas.size();
+    }
+
+    class ScrollViewHolder extends RecyclerView.ViewHolder {
+
+        TextView mTvScrollItem;
+
+        public ScrollViewHolder(@NonNull View itemView) {
+            super(itemView);
+            mTvScrollItem = itemView.findViewById(R.id.tv_right_scroll);
+
+        }
+    }
+}

+ 77 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumBuyOrSellUI.kt

@@ -0,0 +1,77 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.future.trade.itemView
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import org.jetbrains.anko.*
+
+/**
+ * 千海金交易买入卖出页面
+ * @property activity PlatinumTradeActivity
+ * @property viewModel PlatinumTradeViewModel
+ * @property type String 1 : 买入  2 : 卖出
+ * @property root _FrameLayout
+ * @constructor
+ */
+class PlatinumBuyOrSellUI(private val activity: PlatinumTradeActivity,private val viewModel: PlatinumTradeViewModel,private val type : String){
+
+    val root = _FrameLayout(activity).apply {
+
+        verticalLayout {
+            linearLayout {
+                onThrottleFirstClick {
+
+                }
+                gravity = Gravity.CENTER_VERTICAL
+                textView {
+                    text = "品种"
+                    textColorInt = R.color.rma_gray_color
+                    textSizeAuto = 36
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(31)
+                }
+
+                textView {
+                    text = "黄金"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 36
+                }.lparams(wrapContent, wrapContent){
+                    marginStart = autoSize(35)
+                }
+
+                emptyView()
+
+                imageView {
+                    imageResource = R.mipmap.qhj_select_goods
+                }.lparams(autoSize(48), autoSize(48)){
+                    marginEnd = autoSize(31)
+                }
+            }.lparams(matchParent, autoSize(107))
+
+            itemView()
+
+            linearLayout {
+                verticalLayout {
+
+                }.lparams(autoSize(547), autoSize(214))
+
+                view {
+                    background = resources.getDrawable(R.color.rma_hint_line_color_eee)
+                }.lparams(autoSize(1), autoSize(214))
+
+                verticalLayout {
+
+                }.lparams(autoSize(352), autoSize(214))
+            }.lparams(matchParent, autoSize(214))
+
+
+        }.lparams(matchParent, matchParent)
+
+    }
+
+}

+ 22 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumCancellationsUI.kt

@@ -0,0 +1,22 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import org.jetbrains.anko._FrameLayout
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 千海金交易-撤单UI
+ * @property activity PlatinumTradeActivity
+ * @property viewModel PlatinumTradeViewModel
+ * @constructor
+ */
+class PlatinumCancellationsUI(private val activity: PlatinumTradeActivity,private val viewModel: PlatinumTradeViewModel){
+
+    val root = _FrameLayout(activity).apply {
+
+        verticalLayout {
+
+        }
+
+    }
+
+}

+ 21 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumDealUI.kt

@@ -0,0 +1,21 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import org.jetbrains.anko._FrameLayout
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 千海金交易-成交单列表页UI
+ * @property activity PlatinumTradeActivity
+ * @property viewModel PlatinumTradeViewModel
+ * @property root _FrameLayout
+ * @constructor
+ */
+class PlatinumDealUI(private val activity: PlatinumTradeActivity,private val viewModel: PlatinumTradeViewModel){
+
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+
+        }
+    }
+
+}

+ 21 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumMoneyUI.kt

@@ -0,0 +1,21 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import org.jetbrains.anko._FrameLayout
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 千海金交易-资金信息UI
+ * @property activity PlatinumTradeActivity
+ * @property viewModel PlatinumTradeViewModel
+ * @property root _FrameLayout
+ * @constructor
+ */
+class PlatinumMoneyUI(private val activity: PlatinumTradeActivity,private val viewModel: PlatinumTradeViewModel){
+
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+
+        }
+    }
+
+}

+ 21 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumPositionUI.kt

@@ -0,0 +1,21 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import org.jetbrains.anko._FrameLayout
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 千海金交易-持仓列表页UI
+ * @property activity PlatinumTradeActivity
+ * @property viewModel PlatinumTradeViewModel
+ * @property root _FrameLayout
+ * @constructor
+ */
+class PlatinumPositionUI(private val activity: PlatinumTradeActivity,private val viewModel: PlatinumTradeViewModel){
+
+    val root = _FrameLayout(activity).apply {
+        verticalLayout {
+
+        }
+    }
+
+}

+ 200 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeActivity.kt

@@ -0,0 +1,200 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import android.view.ViewGroup
+import androidx.viewpager.widget.PagerAdapter
+import androidx.viewpager.widget.ViewPager
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.tabSegment
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.BaseActivity
+import com.blankj.utilcode.util.ConvertUtils
+import com.qmuiteam.qmui.util.QMUIDisplayHelper
+import com.qmuiteam.qmui.util.QMUIStatusBarHelper
+import com.qmuiteam.qmui.widget.tab.QMUITabIndicator
+import com.qmuiteam.qmui.widget.tab.QMUITabSegment
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.viewPager
+
+/**
+ * 千海金交易页面
+ * @property platinumBuyUI PlatinumBuyOrSellUI
+ */
+class PlatinumTradeActivity : BaseActivity<PlatinumTradeViewModel>(){
+
+    lateinit var segment: QMUITabSegment
+    var selectedTabIndex: Int = 0
+    private lateinit var viewPager: ViewPager
+
+    //交易买入UI
+    private val platinumBuyUI by lazy {
+        PlatinumBuyOrSellUI(this,viewModel,"1")
+    }
+
+    //交易卖出UI
+    private val platinumSellUI by lazy {
+        PlatinumBuyOrSellUI(this,viewModel,"2")
+    }
+
+    //撤单UI
+    private val platinumCancellationsUI by lazy {
+        PlatinumCancellationsUI(this,viewModel)
+    }
+
+    //持仓UI
+    private val platinumPositionUI by lazy {
+        PlatinumPositionUI(this,viewModel)
+    }
+
+    //成交UI
+    private val platinumDealUI by lazy {
+        PlatinumDealUI(this,viewModel)
+    }
+
+    //资金UI
+    private val platinumMoneyUI by lazy {
+        PlatinumMoneyUI(this,viewModel)
+    }
+
+    //viewpager的适配器
+    private var newPagerAdapter : PagerAdapter? = null
+
+    //tabSegment标题
+    private val newTabsArray : ArrayList<String> = arrayListOf()
+
+    //暂存的页面组
+    private val uiList : ArrayList<_FrameLayout> = arrayListOf()
+
+    private fun initDataView(){
+        newTabsArray.add("买入")
+        uiList.add(platinumBuyUI.root)
+        newTabsArray.add("卖出")
+        uiList.add(platinumSellUI.root)
+        newTabsArray.add("撤单")
+        uiList.add(platinumCancellationsUI.root)
+        newTabsArray.add("持仓")
+        uiList.add(platinumPositionUI.root)
+        newTabsArray.add("成交")
+        uiList.add(platinumDealUI.root)
+        newTabsArray.add("资金")
+        uiList.add(platinumMoneyUI.root)
+        newPagerAdapter = object : PagerAdapter() {
+
+            override fun getPageTitle(position: Int): CharSequence? = newTabsArray[position]
+
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                return uiList.get(position).apply {
+                    container.addView(
+                        this,
+                        ViewGroup.LayoutParams(matchParent, matchParent)
+                    )
+                }
+            }
+
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
+            }
+
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = newTabsArray.size
+
+        }
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        QMUIStatusBarHelper.translucent(this)
+        verticalLayout {
+            initDataView()
+            linearLayout {
+                background = resources.getDrawable(R.color.main_title_bg_color)
+                linearLayout {
+                    imageView {
+                        imageResource = R.mipmap.back
+                    }.lparams(autoSize(45), autoSize(45)) {
+                        marginStart = autoSize(32)
+                        topMargin = autoSize(20)
+                    }
+
+
+                    verticalLayout {
+                        gravity = Gravity.CENTER_HORIZONTAL
+                        textView {
+                            text = "交易"
+                            textColorInt = R.color.white
+                            textSizeAuto = 43
+                        }.lparams(wrapContent, wrapContent){
+                            marginEnd = autoSize(36)
+                        }
+
+                        linearLayout {
+                            textView {
+                                text = "周星星(200000001)"
+                                textSizeAuto = 29
+                                textColorInt = R.color.qhj_title_hint_color
+                            }.lparams(wrapContent, wrapContent)
+
+                            imageView {
+                                imageResource = R.mipmap.qhj_title_down_click
+                            }.lparams(autoSize(36), autoSize(36)){
+                                marginStart = autoSize(50)
+                            }
+                        }.lparams(wrapContent, wrapContent)
+                    }.lparams(matchParent, autoSize(100))
+
+
+                    imageView {
+                        visibility = View.INVISIBLE
+                        imageResource = R.mipmap.back
+                    }.lparams(autoSize(45), autoSize(45)) {
+                        marginEnd = autoSize(32)
+                        topMargin = autoSize(20)
+                    }
+
+                }.lparams(matchParent, autoSize(100)){
+                    topMargin = autoSize(60)
+                }
+            }.lparams(matchParent, autoSize(160))
+
+            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
+                    }
+                })
+                mode = QMUITabSegment.MODE_FIXED
+                setIndicator(QMUITabIndicator(QMUIDisplayHelper.dp2px(context, 2), false, true))
+                setDefaultTextSize(ConvertUtils.sp2px(16f), ConvertUtils.sp2px(16f))
+            }.lparams(matchParent, autoSize(100))
+
+            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)
+
+        }
+    }
+
+}

+ 12 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/platinumtreasure/trade/PlatinumTradeViewModel.kt

@@ -0,0 +1,12 @@
+package cn.muchinfo.rma.view.base.platinumtreasure.trade
+
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 千海金交易页面的viewmodel
+ */
+class PlatinumTradeViewModel : BaseViewModel(){
+
+
+
+}

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

@@ -616,14 +616,14 @@ class InventoryRecordUI(
     }
 
     fun refresh() {
-        viewModel.queryAreaStockApply(type = type)
+        viewModel.queryAreaStockApply(type = type,data = data)
     }
 
     val root = _FrameLayout(activity).apply {
         verticalLayout {
             viewModel.queryInventoryTitle(
                 title = Constant.table_mobile_stock_manage_applylog,
-                type = type
+                type = type,data = data
             )
             exposureContentAdapter.setOnContentScrollListener(this@InventoryRecordUI)
 
@@ -690,7 +690,7 @@ class InventoryRecordUI(
                         /**
                          * 下拉刷新
                          */
-                        viewModel.queryAreaStockApply(type = type)
+                        viewModel.queryAreaStockApply(type = type,data = data)
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)

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

@@ -113,6 +113,7 @@ class ProcurementFragment : BaseFragment<ProcurementViewModel>() {
                     }
 
                     imageView {
+                        visibility = View.GONE
                         imageResource = R.mipmap.main_search
                     }.lparams(autoSize(45), autoSize(45)) {
                         marginStart = autoSize(32)

+ 4 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/ProcurementViewModel.kt

@@ -415,7 +415,7 @@ class ProcurementViewModel : BaseViewModel() {
     /**
      * 查询库存申请(出入库记录|库存审核)
      */
-    fun queryAreaStockApply(type: String) {
+    fun queryAreaStockApply(type: String,data: ContractData) {
         val params = mutableMapOf<String, String>()
         params.put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
 
@@ -424,6 +424,7 @@ class ProcurementViewModel : BaseViewModel() {
         }else{
             params.put("inouttype","2,4")
         }
+        params.put("spotcontractid",data.spotcontractid ?: "")
         MyApplication.getInstance()?.warehouseManager?.queryAreaStockApply(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
                 applyRecordDataList.postValue(getapplyRecordRightData(respData ?: arrayListOf()))
@@ -462,7 +463,7 @@ class ProcurementViewModel : BaseViewModel() {
      * 查询记录头部
      * @param tableKey String
      */
-    fun queryInventoryTitle(title: String,type: String) {
+    fun queryInventoryTitle(title: String,type: String,data: ContractData) {
         val params = mutableMapOf<String, String>().apply {
             put("tableKey", title)
             put("tableType", "3")
@@ -474,7 +475,7 @@ class ProcurementViewModel : BaseViewModel() {
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 applyRecordTitle.postValue(newlist)
-                queryAreaStockApply(type)
+                queryAreaStockApply(type,data = data)
             }
         }
     }

+ 0 - 5
RMA/app/src/main/java/cn/muchinfo/rma/view/base/procurement/RightScrollAdapter.java

@@ -14,11 +14,6 @@ import java.util.List;
 
 import cn.muchinfo.rma.R;
 
-/**
- * @author:JianFeng
- * @date:2019/3/26 16:36
- * @description:
- */
 public class RightScrollAdapter extends RecyclerView.Adapter<RightScrollAdapter.ScrollViewHolder> {
 
 

+ 101 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjAnnouncementViewHolder.kt

@@ -0,0 +1,101 @@
+package cn.muchinfo.rma.view.base.qhjhome
+
+import android.content.Intent
+import android.graphics.Typeface
+import android.text.TextUtils
+import android.view.Gravity
+import androidx.fragment.app.Fragment
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.isShowTimeString
+import cn.muchinfo.rma.global.toShowTime
+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.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import mtp.polymer.com.information_management.hnstocks.message.MessageDetailsActivity
+import org.jetbrains.anko.*
+
+class QhjAnnouncementViewHolder(
+    private val baseFragment: Fragment,
+    private val viewModel: QhjHomeViewModel
+) : BaseViewHolder<NoticeData>(baseFragment.context!!) {
+    override val itemSize: IntArray = intArrayOf(matchParent, autoSize(160))
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+
+            onThrottleFirstClick {
+                val intent = Intent()
+                intent.putExtra("data",data.value)
+                intent.setClass(context,MessageDetailsActivity::class.java)
+                ActivityUtils.startActivity(intent)
+            }
+
+            linearLayout {
+                imageView {
+                    data.bindOptional(context){
+                        if (it?.msgtype == "1"){
+                            imageResource = R.mipmap.main_announcement_logo
+                        }else{
+                            imageResource = R.mipmap.rma_message_img
+                        }
+                    }
+                }.lparams(autoSize(56), autoSize(41)) {
+                    marginStart = autoSize(32)
+                }
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.title
+                    }
+                    maxEms = 14
+                    maxLines = 1
+                    ellipsize = TextUtils.TruncateAt.END
+                    typeface = Typeface.defaultFromStyle(Typeface.BOLD)
+                    textColorInt = R.color.black
+                    textSizeAuto = 34
+                }.lparams(wrapContent, wrapContent) {
+                    marginStart = autoSize(14)
+                }
+
+                view { }.lparams(0, autoSize(1), 1f)
+
+                textView {
+                    data.bindOptional(context){
+                        text = it?.createtime?.toShowTime("yyyy-MM-dd HH:mm")
+                    }
+                    textColorInt = R.color.text_hit_color
+                    textSizeAuto = 26
+                }.lparams(wrapContent, wrapContent) {
+                    gravity = Gravity.CENTER_VERTICAL
+                    marginEnd = autoSize(32)
+                }
+
+            }.lparams(matchParent, wrapContent) {
+                topMargin = autoSize(30)
+            }
+
+            textView {
+                maxLines = 1
+                ellipsize = TextUtils.TruncateAt.END
+                data.bindOptional(context){
+                    text = it?.content
+                }
+                textColorInt = R.color.text_hint_color_two
+                textSizeAuto = 26
+            }.lparams(matchParent, wrapContent) {
+                marginStart = autoSize(102)
+                topMargin = autoSize(20)
+            }
+            view { }.lparams(autoSize(1), 0, 1f)
+            view {
+                background = resources.getDrawable(R.color.main_hit_bg_color)
+            }.lparams(matchParent, autoSize(1))
+        }.lparams(matchParent, autoSize(160))
+    }
+
+}

+ 667 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjHomeFragment.kt

@@ -0,0 +1,667 @@
+package cn.muchinfo.rma.view.base.qhjhome
+
+import android.annotation.SuppressLint
+import android.content.Intent
+import android.graphics.Rect
+import android.net.Uri
+import android.os.Bundle
+import android.view.*
+import android.widget.ImageView
+import androidx.appcompat.app.AppCompatActivity
+import androidx.cardview.widget.CardView
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.MutableLiveData
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager.widget.PagerAdapter
+import androidx.viewpager.widget.ViewPager
+import cn.bingoogolapple.bgabanner.BGABanner
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.lifecycle.getAppCompatActivity
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseFragment
+import cn.muchinfo.rma.view.base.future.trade.GoodsTradeActivity
+import cn.muchinfo.rma.view.base.home.accountmanager.AccountManagerActivity
+import cn.muchinfo.rma.view.base.home.business.BusinessManagementActivity
+import cn.muchinfo.rma.view.base.home.commodity.CommodityInformationActivity
+import cn.muchinfo.rma.view.base.home.commodity.newcommodity.NewCommodityInformationActivity
+import cn.muchinfo.rma.view.base.home.contract.ContractActivity
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import cn.muchinfo.rma.view.base.home.customerdata.CustomerDataActivity
+import cn.muchinfo.rma.view.base.home.financial.FinancialActivity
+import cn.muchinfo.rma.view.base.home.hedge.HedgePlanActivity
+import cn.muchinfo.rma.view.base.home.inventory.inventoryaudit.InventoryAuditActivity
+import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.InventoryManagerActivity
+import cn.muchinfo.rma.view.base.home.reportquery.ReportQueryActivity
+import cn.muchinfo.rma.view.base.home.set.SettingActivity
+import cn.muchinfo.rma.view.base.home.spotmarket.SpotMarketPriceActivity
+import cn.muchinfo.rma.view.base.home.tradingquery.TradingQueryActivity
+import cn.muchinfo.rma.view.base.home.warehouse.WarehouseInformationActivity
+import cn.muchinfo.rma.view.eventbus.EventConstent
+import cn.muchinfo.rma.view.eventbus.MessageEvent
+import com.blankj.utilcode.util.ActivityUtils
+import com.blankj.utilcode.util.ConvertUtils
+import com.blankj.utilcode.util.LogUtils
+import com.blankj.utilcode.util.ToastUtils
+import com.facebook.drawee.view.SimpleDraweeView
+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.dialog.creatSelectAccountDialog
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+import org.jetbrains.anko.*
+import org.jetbrains.anko.support.v4.UI
+import org.jetbrains.anko.support.v4.viewPager
+import q.rorbin.badgeview.QBadgeView
+
+/**
+ * 千海金首页(虽说和企业风管首页极为相似,但是防止设计乱改,还是copy出来一份为好)
+ * @property statusLayout StatusLayout
+ * @property segment QMUITabSegment
+ * @property segment1 QMUITabSegment
+ * @property selectedTabIndex Int
+ * @property viewPager ViewPager
+ * @property announcementUI AnnouncementUI
+ * @property researchReportUI ResearchReportUI
+ * @property informationUI InformationUI
+ * @property menuTab MutableLiveData<Int>
+ * @property segment2 QMUITabSegment
+ * @property selectedTabIndex1 Int
+ * @property viewPager1 ViewPager
+ * @property firstTabUI FirstTabUI
+ * @property secondTabUI SecondTabUI
+ * @property tabsArray1 List<String>
+ * @property pagerAdapter1 PagerAdapter
+ * @property userqBadgeView QBadgeView
+ * @property userImage ImageView
+ * @property tabsArray List<String>
+ * @property pagerAdapter PagerAdapter
+ */
+class QhjHomeFragment : BaseFragment<QhjHomeViewModel>() {
+
+    companion object {
+        fun newInstance() = QhjHomeFragment()
+    }
+
+    private lateinit var statusLayout: StatusLayout
+    lateinit var segment: QMUITabSegment
+    lateinit var segment1: QMUITabSegment
+    var selectedTabIndex: Int = 0
+    private lateinit var viewPager: ViewPager
+    private val announcementUI: QhjAnnouncementUI by lazy { QhjAnnouncementUI(this, viewModel) }//公告
+    private val researchReportUI: QhjResearchReportUI by lazy { QhjResearchReportUI(this, viewModel) }//研报
+    private val informationUI: QhjInformationUI by lazy { QhjInformationUI(this, viewModel) }//咨讯
+
+
+    val menuTab: MutableLiveData<Int> = MutableLiveData<Int>().apply { value = 0 }//用于控制菜单页切换后的点点显示
+    lateinit var segment2: QMUITabSegment//用于菜单的tab
+    var selectedTabIndex1: Int = 0//用于菜单的selectedTabIndex
+    private lateinit var viewPager1: ViewPager//用于菜单的viewpager
+
+    /**
+     * 用户未读标识
+     */
+    private val userqBadgeView: QBadgeView by lazy {
+        QBadgeView(getAppCompatActivity())
+    }
+    lateinit var userImage: ImageView
+
+    private val tabsArray: List<String> by lazy { arrayListOf("公告", "研报", "资讯") }
+
+    private val pagerAdapter: PagerAdapter by lazy {
+        object : PagerAdapter() {
+
+            override fun getPageTitle(position: Int): CharSequence? = tabsArray[position]
+
+            override fun instantiateItem(container: ViewGroup, position: Int): Any {
+                if (position == 0) {
+                    return announcementUI.root.apply {
+                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
+                    }
+                } else if (position == 1) {
+                    return researchReportUI.root.apply {
+                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
+                    }
+                } else if (position == 2) {
+                    return informationUI.root.apply {
+                        container.addView(this, ViewGroup.LayoutParams(matchParent, matchParent))
+                    }
+                }
+                return super.instantiateItem(container, position)
+            }
+
+            override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+                (`object` as? View)?.let { container.removeView(it) }
+            }
+
+            override fun isViewFromObject(view: View, `object`: Any): Boolean = view == `object`
+
+            override fun getCount(): Int = tabsArray.size
+
+        }
+    }
+
+    override fun onResume() {
+        super.onResume()
+        viewModel.queryPendingAuditInfo()
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        EventBus.getDefault().register(this)
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        EventBus.getDefault().unregister(this)
+    }
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMessageEvent(messageEvent: MessageEvent) {
+        if (messageEvent.messageType == EventConstent.USERACCOUNTCHANGE) {
+            viewModel.initAccountData()
+        }
+    }
+
+    /**
+     * 用于切换首页tab时刷新资金账户信息
+     */
+    fun refrashAccount() {
+        viewModel.initAccountData()//初始化页面时进行一次资金账号的拿取
+        viewModel.queryPendingAuditInfo()
+    }
+
+
+    @SuppressLint("SetTextI18n")
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        return UI {
+            // FIXME: - test
+//            viewModel.login()
+            viewModel.getBanner()
+
+            verticalLayout {
+                linearLayout {
+                    background = resources.getDrawable(R.color.main_title_bg_color)
+                    verticalLayout {
+                        /** 资金账户选择  s首页不能进行资金选择**/
+                        onThrottleFirstClick {
+//                            (context as AppCompatActivity).creatSelectAccountDialog{
+//                                EventBus.getDefault().post(MessageEvent(EventConstent.USERACCOUNTCHANGE))
+//                            }.show()
+                        }
+                        textView {
+                            viewModel.userAccount.bindOptional(context) {
+                                text = it?.accountname
+                            }
+                            text = GlobalDataCollection.instance?.loginRsp?.userID.toString()
+                            textColorInt = R.color.white
+                            textSizeAuto = 36
+                        }.lparams(wrapContent, wrapContent) {
+                            gravity = Gravity.CENTER_HORIZONTAL
+                        }
+                        textView {
+                            viewModel.loginQueryData.bindOptional(context) {
+                                text = it?.username + "(" + it?.loginAccount?.logincode + ")"
+                            }
+                            textColorStr = "#AED6F0"
+                            textSizeAuto = 29
+                        }.lparams(wrapContent, wrapContent) {
+                            gravity = Gravity.CENTER_HORIZONTAL
+                        }
+                    }.lparams(autoSize(620), autoSize(90)) {
+                        marginStart = autoSize(140)
+                    }
+
+                    imageView {
+                        onThrottleFirstClick {
+                            val intent = Intent()
+                            intent.setClass(context, SettingActivity::class.java)
+                            ActivityUtils.startActivity(intent)
+                        }
+                        imageResource = R.mipmap.rma_set
+                    }.lparams(autoSize(45), autoSize(45)) {
+                        marginStart = autoSize(32)
+                        topMargin = autoSize(20)
+                    }
+
+                }.lparams(matchParent, autoSize(120))
+
+//                inflateLayout<NestedScrollView>(R.layout.view_home_scrollview) {
+                relativeLayout {
+                    nestedScrollView {
+                        setOnScrollChangeListener(object : View.OnScrollChangeListener {
+                            override fun onScrollChange(
+                                p0: View?,
+                                p1: Int,
+                                p2: Int,
+                                p3: Int,
+                                p4: Int
+                            ) {
+                                val scrollRect = Rect()
+                                getHitRect(scrollRect)
+                                LogUtils.eTag("adakhsfkjahsfa", "x = " + p1 + "y = " + p2)
+                                if (p2 > 1000) {
+                                    segment1.visibility = View.VISIBLE
+                                } else {
+                                    segment1.visibility = View.INVISIBLE
+                                }
+                            }
+                        })
+                        verticalLayout {
+                            background = resources.getDrawable(R.color.white)
+
+                            imageView {
+                                scaleType = ImageView.ScaleType.CENTER_CROP
+                                imageResource = R.mipmap.banner
+                            }.lparams(matchParent, autoSize(400))
+
+                            inflateLayout<BGABanner>(R.layout.banner) {
+                                visibility = View.GONE
+                                // TODO 目前没有banner
+//                                viewModel.bannerList.bindOptional(context) {
+//                                    setData(
+//                                        R.layout.item_fresco,
+//                                        it,
+//                                        null
+//                                    )
+//                                }
+
+
+                                setAdapter(object : BGABanner.Adapter<CardView, String> {
+                                    override fun fillBannerItem(
+                                        banner: BGABanner?,
+                                        itemView: CardView?,
+                                        model: String?,
+                                        position: Int
+                                    ) {
+                                        val simpleDraweeView: SimpleDraweeView =
+                                            itemView!!.findViewById(R.id.sdv_item_fresco_content)
+                                        simpleDraweeView.setImageURI(Uri.parse(model))
+                                    }
+                                })
+
+                            }.lparams(matchParent, autoSize(400))
+
+
+                            linearLayout {
+                                relativeLayout {
+//                                    if (GlobalDataCollection.instance?.getFirstLevelMenu(code = "client_customer") == true) {
+//                                        visibility = View.VISIBLE
+//                                    } else {
+//                                        visibility = View.GONE
+//                                    }
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.qhj_trading_query
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "交易查询"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            topMargin = autoSize(20)
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+//                                        viewModel.pendingAudit.bindOptional(context) {
+//                                            if (it?.userqty?.toInt() ?: 0 > 99) {
+//                                                text = "99+"
+//                                            } else {
+//                                                text = it?.userqty.toString()
+//                                            }
+//                                            if (it?.userqty?.toInt() == 0) {
+//                                                visibility = View.GONE
+//                                            } else {
+//                                                visibility = View.VISIBLE
+//                                            }
+//                                        }
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(0, matchParent, 1f)
+
+
+                                verticalLayout {
+//                                    if (GlobalDataCollection.instance?.getFirstLevelMenu(code = "client_deliverygoods") == true) {
+//                                        visibility = View.VISIBLE
+//                                    } else {
+//                                        visibility = View.GONE
+//                                    }
+                                    onThrottleFirstClick {
+
+                                    }
+                                    imageView {
+                                        imageResource = R.mipmap.qhj_cast_surely_management
+                                    }.lparams(autoSize(72), autoSize(72)) {
+                                        gravity = Gravity.CENTER_HORIZONTAL
+                                    }
+
+                                    textView {
+                                        text = "定投管理"
+                                        textColorInt = R.color.black
+                                        textSizeAuto = 26
+                                    }.lparams(wrapContent, wrapContent) {
+                                        topMargin = autoSize(20)
+                                        gravity = Gravity.CENTER_HORIZONTAL
+                                    }
+                                }.lparams(0, matchParent, 1f)
+
+                                relativeLayout {
+//                                    if (GlobalDataCollection.instance?.getFirstLevelMenu(code = "client_spotcontract") == true) {
+//                                        visibility = View.VISIBLE
+//                                    } else {
+//                                        visibility = View.GONE
+//                                    }
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.qhj_money_information
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "资金信息"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                            topMargin = autoSize(20)
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+//                                        viewModel.pendingAudit.bindOptional(context) {
+//                                            if (it?.spotcontractqty?.toInt() ?: 0 > 99) {
+//                                                text = "99+"
+//                                            } else {
+//                                                text = it?.spotcontractqty.toString()
+//                                            }
+//
+//                                            if (it?.spotcontractqty?.toInt() == 0) {
+//                                                visibility = View.GONE
+//                                            } else {
+//                                                visibility = View.VISIBLE
+//                                            }
+//                                        }
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(0, matchParent, 1f)
+
+                                relativeLayout {
+//                                    if (GlobalDataCollection.instance?.getFirstLevelMenu(code = "client_hedgeplan") == true) {
+//                                        visibility = View.VISIBLE
+//                                    } else {
+//                                        visibility = View.GONE
+//                                    }
+                                    verticalLayout {
+                                        onThrottleFirstClick {
+
+                                        }
+                                        imageView {
+                                            imageResource = R.mipmap.qhj_withdrawal
+                                        }.lparams(autoSize(72), autoSize(72)) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                        }
+
+                                        textView {
+                                            text = "充值提现"
+                                            textColorInt = R.color.black
+                                            textSizeAuto = 26
+                                        }.lparams(wrapContent, wrapContent) {
+                                            gravity = Gravity.CENTER_HORIZONTAL
+                                            topMargin = autoSize(20)
+                                        }
+                                    }.lparams(matchParent, matchParent)
+
+                                    textView {
+                                        visibility = View.GONE
+//                                        viewModel.pendingAudit.bindOptional(context) {
+//
+//                                            if (it?.hedgeplanqty?.toInt() ?: 0 > 99) {
+//                                                text = "99+"
+//                                            } else {
+//                                                text = it?.hedgeplanqty.toString()
+//                                            }
+//                                            if (it?.hedgeplanqty?.toInt() == 0) {
+//                                                visibility = View.GONE
+//                                            } else {
+//                                                visibility = View.VISIBLE
+//                                            }
+//                                        }
+                                        textColorInt = R.color.p_global_write_color
+                                        textSizeAuto = 15
+                                        setPadding(
+                                            autoSize(10),
+                                            autoSize(6),
+                                            autoSize(10),
+                                            autoSize(6)
+                                        )
+                                        backgroundDrawable =
+                                            createRoundRectDrawable("#fe671a", 45)
+                                    }.lparams(wrapContent, wrapContent) {
+                                        marginStart = autoSize(130)
+                                    }
+                                }.lparams(0, matchParent, 1f)
+
+                            }.lparams(matchParent, autoSize(140)) {
+                                topMargin = autoSize(40)
+                            }
+
+                            view {
+                                background = resources.getDrawable(R.color.main_hit_bg_color)
+                            }.lparams(matchParent, autoSize(24)) {
+                                topMargin = autoSize(34)
+                            }
+
+                            tabSegment {
+                                segment = this
+                                background = resources.getDrawable(R.color.white)
+                                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(100))
+
+                            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 = pagerAdapter
+                            }.lparams(matchParent, autoSize(2000))
+
+                            segment.setupWithViewPager(viewPager)
+                            segment.selectTab(selectedTabIndex)
+                        }
+                    }.lparams(matchParent, matchParent)
+                    tabSegment {
+                        visibility = View.GONE
+                        segment1 = this
+                        visibility = View.INVISIBLE
+                        background = resources.getDrawable(R.color.white)
+                        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))
+//                        setHasIndicator(true)
+//                        setDefaultNormalColor(Color.parseColor("#000000"))
+//                        setDefaultSelectedColor(Color.parseColor("#60a1e3"))
+//                        setTabTextSize(ConvertUtils.sp2px(16f))
+                    }.lparams(matchParent, autoSize(100))
+
+                    segment1.setupWithViewPager(viewPager)
+                    segment1.selectTab(selectedTabIndex)
+                }
+
+
+//                }.lparams(matchParent, matchParent)
+            }
+
+        }.view
+    }
+
+}
+
+/**
+ * 公告
+ */
+class QhjAnnouncementUI(private val baseFragment: Fragment, private val viewModule: QhjHomeViewModel) {
+
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    lateinit var recyclerView: RecyclerView
+
+    private val announcementAdapter: BaseAdapter<NoticeData, QhjAnnouncementViewHolder> =
+        BaseAdapter { _, _ -> QhjAnnouncementViewHolder(baseFragment, viewModule) }
+
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            viewModule.queryNotice()
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(false)
+                    setEnableLoadMore(false)
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = announcementAdapter
+                        isNestedScrollingEnabled = false
+                    }.lparams(matchParent, matchParent) {
+                        marginStart = autoSize(32)
+                        marginEnd = autoSize(20)
+                    }
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+            viewModule.noticeDataList.bindOptional(context) {
+                announcementAdapter.setNewData(it)
+            }
+        }
+    }
+}
+
+
+/**
+ * 研报
+ */
+class QhjResearchReportUI(
+    private val baseFragment: Fragment,
+    private val viewModule: QhjHomeViewModel
+) {
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            textView {
+                text = "研报"
+                textColorInt = R.color.black
+                textSizeAuto = 100
+            }.lparams(matchParent, wrapContent) {
+                topMargin = autoSize(200)
+            }
+        }
+    }
+}
+
+
+/**
+ * 咨讯
+ */
+
+class QhjInformationUI(private val baseFragment: Fragment, private val viewModule: QhjHomeViewModel) {
+    val root = _FrameLayout(baseFragment.context!!).apply {
+        verticalLayout {
+            textView {
+                text = "资讯"
+                textColorInt = R.color.black
+                textSizeAuto = 100
+            }.lparams(matchParent, wrapContent) {
+                topMargin = autoSize(200)
+            }
+        }
+    }
+}
+

+ 131 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/qhjhome/QhjHomeViewModel.kt

@@ -0,0 +1,131 @@
+package cn.muchinfo.rma.view.base.qhjhome
+
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.AccountData
+import cn.muchinfo.rma.global.data.NoticeData
+import cn.muchinfo.rma.global.data.PendingAuditInfoData
+import cn.muchinfo.rma.global.data.UserAccountData
+import cn.muchinfo.rma.global.data.account.LoginQueryData
+import cn.muchinfo.rma.global.data.database.BannerEntity
+import cn.muchinfo.rma.global.database.DataBase
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.protobuf.protoclasses.SystemMI1
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.SPUtils
+import mtp.polymer.com.autowidget.utils.TaskUiModel
+import okhttp3.Call
+import java.lang.Exception
+
+class QhjHomeViewModel : BaseViewModel(){
+
+    /**
+     * 加载状态控制
+     */
+    val loadingDialogStatus: MutableLiveData<TaskUiModel> = MutableLiveData()
+
+    val bannerList : MutableLiveData<List<String>> = MutableLiveData()
+
+    /**
+     * 使用的当前的资金账户信息
+     */
+    val usedAccountData : MutableLiveData<AccountData> = MutableLiveData()
+
+    /**
+     * 当前的账户信息
+     */
+    val userAccount : MutableLiveData<UserAccountData> = MutableLiveData()
+
+    /**
+     * 查询的信息
+     */
+    val loginQueryData : MutableLiveData<LoginQueryData> = MutableLiveData()
+
+    /**
+     * 公告信息
+     */
+    val noticeDataList : MutableLiveData<List<NoticeData>> = MutableLiveData()
+
+    val pendingAudit : MutableLiveData<PendingAuditInfoData> = MutableLiveData()
+
+    /**
+     * 在请求之前先获取数据库存储的banner信息
+     */
+    fun getBanner(){
+        GlobalDataCollection.instance?.loginQueryData
+        val dao = DataBase.getInstance().bannerDao()
+        dao.getBannerList().let {
+            getBannerUrlList(it)
+        }
+        val params = mutableMapOf<String,String>()
+        params.put("imageType","1")
+        MyOkHttpUtils().query(URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Common/QueryImageConfigs",
+            callback = object : ResponseCallback<BaseResult<List<BannerEntity>>>() {
+                override fun onResponse(response: BaseResult<List<BannerEntity>>?, id: Int) {
+                    dao.insertBanner(banners = response?.data ?: arrayListOf())
+                    getBannerUrlList(response?.data ?: arrayListOf())
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+
+                }
+
+            },params = params,type = "1")
+    }
+
+    /**
+     * @param datalist List<BannerEntity>
+     */
+    fun getBannerUrlList(datalist : List<BannerEntity>){
+        val bannerUrlList = arrayListOf<String>()
+        datalist.forEach {
+            bannerUrlList.add(SPUtils.getInstance().getString(Constant.openApiUrl) + it.imagepath.substring(1))
+        }
+        bannerList.postValue(bannerUrlList)
+    }
+
+    /**
+     * 更新hoefragment的account
+     */
+    fun initAccountData(){
+        val accountData = GlobalDataCollection.instance?.userAccountData
+        userAccount.postValue(accountData)
+        loginQueryData.postValue(GlobalDataCollection.instance?.loginQueryData)
+    }
+
+    /**
+     * 通知公告查询
+     */
+    fun queryNotice(){
+        val params = mutableMapOf<String, String>().apply {
+            put("loginID", GlobalDataCollection.instance?.loginRsp?.loginID.toString())
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryNotice(params = params){ isSuccess, respData, error ->
+            if (isSuccess){
+                noticeDataList.postValue(respData)
+            }
+        }
+    }
+
+    /**
+     * 查询未读消息数
+     */
+    fun queryPendingAuditInfo(){
+        val params = mutableMapOf<String, String>().apply {
+            put("UserId", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+
+        MyApplication.getInstance()?.commonManager?.queryPendingAuditInfo(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                pendingAudit.postValue(respData?.get(0))
+            }
+        }
+    }
+
+}

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

@@ -100,6 +100,7 @@ class SaleFragment : BaseFragment<SaleViewModel>() {
                     }
 
                     imageView {
+                        visibility = View.GONE
                         imageResource = R.mipmap.main_search
                     }.lparams(autoSize(45), autoSize(45)) {
                         marginStart = autoSize(32)

+ 1 - 1
RMA/app/src/main/res/drawable/ic_down_select.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="1024"
     android:viewportHeight="1024">
   <path
-      android:fillColor="#368FDF"
+      android:fillColor="#ffffff"
       android:pathData="M65.58,288.79l446.42,446.42 446.42,-446.42z"/>
 </vector>

+ 7 - 0
RMA/app/src/main/res/drawable/qhj_green_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#DDFFF4"/>
+    <corners android:radius="10px"
+        />
+</shape>

+ 7 - 0
RMA/app/src/main/res/drawable/qhj_red_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#FFEAEC"/>
+    <corners android:radius="10px"
+        />
+</shape>

+ 121 - 0
RMA/app/src/main/res/layout/layout_item_platinum_content.xml

@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:id="@+id/roots_view"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:id="@+id/all_click_View"
+        android:layout_width="match_parent"
+        android:orientation="horizontal"
+        android:layout_height="35dp">
+
+        <LinearLayout
+            android:layout_width="100dp"
+            android:orientation="horizontal"
+            android:layout_height="match_parent">
+            <LinearLayout
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:layout_width="70dp"
+                android:layout_height="match_parent">
+
+                <TextView
+                    android:layout_marginEnd="20dp"
+                    android:layout_gravity="center"
+                    android:layout_marginStart="7dp"
+                    android:id="@+id/tv_left_title"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="13sp"
+                    android:textColor="#333333" />
+
+            </LinearLayout>
+            <ImageView
+                android:id="@+id/click_icon"
+                android:layout_gravity="center_vertical"
+                android:layout_width="15dp"
+                android:layout_height="15dp"
+                android:src="@mipmap/rma_down"/>
+
+        </LinearLayout>
+
+        <cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView
+            android:id="@+id/hor_item_scrollview"
+            android:overScrollMode="never"
+            android:scrollbars="none"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
+
+                <androidx.recyclerview.widget.RecyclerView
+                    android:id="@+id/rv_item_right"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"
+                    android:scrollbars="none">
+
+                </androidx.recyclerview.widget.RecyclerView>
+            </RelativeLayout>
+        </cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView>
+    </LinearLayout>
+
+    <LinearLayout
+        android:visibility="gone"
+        android:id="@+id/all_view"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:gravity="end|center_vertical"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/platnum_buy"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="买入"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:id="@+id/platnum_sell"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="卖出"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:id="@+id/platnum_chart"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="图表"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:id="@+id/platnum_details"
+            android:layout_marginEnd="10dp"
+            android:gravity="center"
+            android:textSize="12sp"
+            android:layout_width="70dp"
+            android:layout_height="25dp"
+            android:text="详情"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+
+    </LinearLayout>
+
+</LinearLayout>

+ 22 - 0
RMA/app/src/main/res/layout/layout_qhj_item_scroll.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="100dp"
+    android:layout_height="45dp"
+    android:gravity="center"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="60dp"
+        android:layout_height="35dp">
+        <TextView
+            android:background="@drawable/qhj_green_bg"
+            android:textSize="12sp"
+            android:gravity="center"
+            android:id="@+id/tv_right_scroll"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:textColor="#AAAAAA" />
+    </LinearLayout>
+
+
+</LinearLayout>

TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/ic_check_normal.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/ic_check_select.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/img_start.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_cast_surely_management.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_money_information.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_select_goods.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_title_down_click.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_trading_query.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/qhj_withdrawal.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/rma_login_bg.png


TEMPAT SAMPAH
RMA/app/src/main/res/mipmap-xhdpi/rma_login_logo.png


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

@@ -91,4 +91,6 @@
     <color name="qhj_hint_text_color">#A1B1C5</color>
     <color name="qhj_yellow_text_color">#FF881D</color>
     <color name="qhj_blue_text_color">#2794FF</color>
+    <color name="qhj_click_bg">#184A97E1</color>
+    <color name="qhj_title_hint_color">#AED6F0</color>
 </resources>

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

@@ -1,5 +1,5 @@
 <resources>
-    <string name="app_name">风管云平台</string>
+
 
 
     <string name="now_no_data">暂无数据</string>