Browse Source

风险管理5月22日提交代码-liu.bolan

Liu.bolan 4 năm trước cách đây
mục cha
commit
a937621345
16 tập tin đã thay đổi với 1625 bổ sung396 xóa
  1. 24 0
      RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt
  2. 55 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaSpotplReportData.kt
  3. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaSumPLData.kt
  4. 2 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FinanceReportData.kt
  5. 19 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  6. 263 330
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt
  7. 315 43
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  8. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/SpotReportViewHolder.kt
  9. 24 8
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java
  10. 250 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/FanacelReportContentAdapter.java
  11. 258 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SpotReportContentAdapter.java
  12. 254 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SummaryReportContentAdapter.java
  13. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/newreportquery/NewReportQueryActivity.kt
  14. 5 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsActivity.kt
  15. 123 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt
  16. 29 2
      RMA/app/src/main/res/layout/exposure_report_layout_item_content.xml

+ 24 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt

@@ -243,6 +243,30 @@ class ReportManager {
     }
 
     /**
+     * 新版查询现货报表
+     */
+    fun qryAreaSpotplReport(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AreaSpotplReportData>?, error: Error?) -> Unit
+    ){
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryAreaSpotplReport\n",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AreaSpotplReportData>>>(){
+                override fun onResponse(response: BaseResult<List<AreaSpotplReportData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+
+            }
+        )
+    }
+
+    /**
      * 查询汇总损益表
      */
     fun qryAreaSumPL(

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

@@ -0,0 +1,55 @@
+package cn.muchinfo.rma.global.data
+
+//新版现货报表实体
+data class AreaSpotplReportData(
+    val accountid : String = "",//期货账户ID (作废, 默认为0)
+    val accountname : String = "",//机构名称
+    val actualpl : String = "",//现货损益
+    val areauserid : String = "",//所属机构\交易用户ID
+    val biztype : String = "",//业务类型 - 1:套保 2:套利
+    val brandname : String = "",//品牌名称
+    val curamount : String = "",//期末额
+    val curaverageprice : String = "",//期末均价
+    val curbuyamount : String = "",//期末采购总额
+    val curbuyqty : String = "",//期末采购总量
+    val curmarketvalue : String = "",//参考市值(期末市值)
+    val curqty : String = "",//期末量
+    val currencyid : String = "",//结算币种ID【原值】
+    val currencyname : String = "",//币种名称
+    val cursellamount : String = "",//期末销售总额
+    val cursellqty : String = "",//期末销售总量
+    val curspotprice : String = "",//参考市价(最新价)
+    val cycletime : String = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+    val cycletype : String = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    val deliverygoodscode : String = "",//现货商品代码
+    val deliverygoodsid : String = "",//现货品种ID
+    val deliverygoodsname : String = "",//现货商品名称
+    val enumdicname : String = "",//现货商品单位名称
+    val floatpl : String = "",//浮动损益
+    val goodsunitid : String = "",//现货商品单位id
+    val oriamount : String = "",//期初额
+    val oriaverageprice : String = "",//期初均价
+    val oribuyamount:  String = "",//期初采购总额
+    val oribuyqty : String = "",//期初采购总量
+    val oriqty : String = "",//期初量
+    val orisellamount:  String = "",//期初销售总额
+    val orisellqty:  String = "",//期初销售总量
+    val reckondate:  String = "",//日照时期(yyyyMMdd)
+    val spotgoodsbrandid: String = "",//现货品牌ID
+    val todaybuyamount : String = "",//今日采购额(今采购额)
+    val todaybuyaverageprice : String = "",//今日采购均价
+    val todaybuyqty: String = "",//今日采购量(今采购量)
+    val todayinqty: String = "",//今日入库量(今入库量)
+    val todayoutqty : String ="",//今日出库量(今出库量)
+    val todaysellamount :String = "",//今日销售额(今销售额)
+    val todaysellaverageprice : String = "",//今日销售均价
+    val todaysellqty : String = "",//今日销售量(今销售量)
+    val unitid : String = "",//品类单位id
+    val unitidname : String = "",//品类单位名称
+    val updatetime : String = "",//更新时间
+    val wrfactortypeid : String = "",//仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+    val wrstandardcode : String = "",//品类代码
+    val wrstandardid : String = "",//现货品类ID
+    val wrstandardname : String = "",//品类名称
+    var rightData : List<String>? = arrayListOf()//组装的右侧数据
+)

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

@@ -15,5 +15,6 @@ data class AreaSumPLData(
     val spotfloatpl : String = "",//现货浮动损益
     val sumactualpl : String = "",//实际损益 = (ActualPL + FutureActualPL)
     val sumpl : String = "",//汇总损益
-    val updatetime : String = ""//更新时间
+    val updatetime : String = "",//更新时间
+    var rightData : List<String>? = arrayListOf()//组装的右侧数据
 )

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

@@ -28,5 +28,6 @@ data class FinanceReportData(
     val todayreceivesum: String = "",//今收款合计
     val updatetime: String = "",//更新时间
     val wrfactortypeid: String = "",//仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
-    val wrstandardid: String = ""//现货商品ID
+    val wrstandardid: String = "",//现货商品ID
+    var rightData : List<String>? = arrayListOf()//组装的右侧数据
 )

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

@@ -6,10 +6,10 @@ object Constant {
     /**
      * 获取基础url的接口
      */
-    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
+//    const val baseurl = "http://103.40.249.127:28280/cfg?key=mtp_20"
 //    const val baseurl = "http://192.168.30.125:8080/cfg?key=test_125"
 //    const val baseurl = "http://192.168.31.114:8080/cfg?key=test_114" // shenzhen01  123123
-//    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
+    const val baseurl = "http://192.168.31.220:8080/cfg?key=test_220"//李倩
 //      const val baseurl = "http://192.168.30.211:8080/cfg?key=test_211"// 瑶姐
 //    const val baseurl = "http://192.168.31.175:8080/cfg?key=test_175" // 8888  123123
 //    const val baseurl = "http://192.168.31.223:8080/cfg?key=test_223"
@@ -91,6 +91,18 @@ object Constant {
     /** 财务报表月报表 **/
     const val table_mobile_report_fincial_month = "table_mobile_report_fincial_month"
 
+    /** 财务报表  **/
+    const val table_mobile_report_fincial = "table_mobile_report_fincial"
+
+    /** 汇总损益 **/
+    const val table_mobile_report_sumprofit = "table_mobile_report_sumprofit"
+
+    /** 汇总损益 **/
+    const val table_mobile_report_sumprofit_detail = "table_mobile_report_sumprofit_detail"
+
+    /** 财务报表日报表明细  **/
+    const val table_mobile_report_fincial_detail = "table_mobile_report_fincial_detail"
+
     /** 敞口报表 **/
     const val table_mobile_report_expose = "table_mobile_report_expose"
 
@@ -103,6 +115,9 @@ object Constant {
     /** 现货报表 **/
     const val table_mobile_report_spot = "table_mobile_report_spot"
 
+    /** 现货报表明细 **/
+    const val table_mobile_report_spot_detail = "table_mobile_report_spot_detail"
+
     /** 库存报表 **/
     const val table_mobile_stock_report = "table_mobile_stock_report"
 
@@ -155,4 +170,6 @@ object Constant {
 
     /** 记录最后一次商品信息请求的时间 **/
     const val QUERY_GOODS_TIME = "query_goods_time"
+
+    const val SUCCESS_ADD_CUSTOMER = "SUCCESS_ADD_CUSTOMER"
 }

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

@@ -1,6 +1,5 @@
 package cn.muchinfo.rma.view.base.home.reportquery
 
-import android.annotation.SuppressLint
 import android.content.Intent
 import android.os.Build
 import android.os.Bundle
@@ -19,17 +18,15 @@ import androidx.viewpager.widget.ViewPager
 import cn.muchinfo.rma.R
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.data.*
-import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
-import cn.muchinfo.rma.view.base.app.Constant
-import cn.muchinfo.rma.view.base.exposure.ExposureContentAdapter
 import cn.muchinfo.rma.view.base.home.contract.emptyView
-import cn.muchinfo.rma.view.base.home.financial.FinancialViewholder
 import cn.muchinfo.rma.view.base.home.financial.InvoiceRegisterActivity
-import cn.muchinfo.rma.view.base.home.inventory.inventorymanager.adapter.ApplyRecordAdapter
-import cn.muchinfo.rma.view.base.procurement.ContentAdapter
+import cn.muchinfo.rma.view.base.home.reportquery.adapter.ExposureReportContentAdapter
+import cn.muchinfo.rma.view.base.home.reportquery.adapter.FanacelReportContentAdapter
+import cn.muchinfo.rma.view.base.home.reportquery.adapter.SpotReportContentAdapter
+import cn.muchinfo.rma.view.base.home.reportquery.adapter.SummaryReportContentAdapter
 import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
 import com.blankj.utilcode.util.*
 import com.qmuiteam.qmui.util.QMUIDisplayHelper
@@ -56,7 +53,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
 
     /** tab标题 **/
     private val tabsArray: List<String> by lazy {
-        arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表","现货损益报表")
+        arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表","汇总损益表")
     }
 
     /** 财务报表 **/
@@ -136,10 +133,8 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
         }
     }
 
-
     private val dialog by lazy { createLoadingDialog(hintStr = "请求中...") }
 
-
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         verticalLayout {
@@ -205,7 +200,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
 class FinancialReportUI(
     private val activity: AppCompatActivity,
     private val viewModel: ReportQueryViewModel
-) : ExposureReportContentAdapter.OnContentScrollListener {
+) : FanacelReportContentAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
@@ -217,7 +212,10 @@ class FinancialReportUI(
     }
 
     val contentAdapter by lazy {
-        ExposureReportContentAdapter(activity)
+        FanacelReportContentAdapter(
+            activity,
+            "1"
+        )
     }
 
     /**
@@ -242,7 +240,7 @@ class FinancialReportUI(
     }
 
     init {
-        viewModel.queryTradingAccMgrLoginUser(tradedate = tradedate)
+        viewModel.queryTradingAccMgrLoginUserByFinancial(tradedate = tradedate)
         dateType.postValue(SelectData(id = "1",value = "日报表"))
     }
 
@@ -317,11 +315,11 @@ class FinancialReportUI(
                     backgroundResource = R.drawable.rma_time_click_bg
                     onThrottleFirstClick {
                         activity.creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
-                            viewModel.exposureSelectTransactionUser.postValue(this)
+                            viewModel.financialSelectTransactionUser.postValue(this)
 
                         }
                     }
-                    viewModel.exposureSelectTransactionUser.bindOptional(context){
+                    viewModel.financialSelectTransactionUser.bindOptional(context){
                         text = it?.value
                         contentAdapter.setTransaction(it?.value)
                         contentAdapter.setTransactionUserid(it?.id)
@@ -337,9 +335,9 @@ class FinancialReportUI(
                     backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     onThrottleFirstClick {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
                         }else if (dateType.value?.id == "3"){//周报表
 
                         }
@@ -362,7 +360,7 @@ class FinancialReportUI(
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
                     textView {//待点价头部左侧数据
-                        viewModel.exposureReportTitle.bindOptional(context) {
+                        viewModel.fincialReportTitle.bindOptional(context) {
                             text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
                         }
                         textColorStr = "#AAAAAA"
@@ -376,7 +374,7 @@ class FinancialReportUI(
                     horScrollview = this
                     setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
                         contentAdapter.offestX = scrollX
-                        val viewHolderCacheList: List<ExposureReportContentAdapter.ItemViewHolder> =
+                        val viewHolderCacheList: List<FanacelReportContentAdapter.ItemViewHolder> =
                             contentAdapter.viewHolderCacheList
 
                         if (null != viewHolderCacheList) {
@@ -397,7 +395,7 @@ class FinancialReportUI(
                             background = resources.getDrawable(R.color.white)
                             adapter = topAdapter
                         }
-                        viewModel.exposureReportTitle.bindOptional(context) {
+                        viewModel.fincialReportTitle.bindOptional(context) {
                             val titleStringList = arrayListOf<String>()
                             it?.subList(1, it.size)?.forEach { data ->
                                 titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
@@ -413,7 +411,7 @@ class FinancialReportUI(
 //                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
-                    setEnableRefresh(true)
+                    setEnableRefresh(false)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
                         /**
@@ -430,7 +428,7 @@ class FinancialReportUI(
                         addOnScrollListener(object : RecyclerView.OnScrollListener() {
                             override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
                                 super.onScrolled(recyclerView, dx, dy)
-                                val viewHolderCacheList: List<ExposureReportContentAdapter.ItemViewHolder> =
+                                val viewHolderCacheList: List<FanacelReportContentAdapter.ItemViewHolder> =
                                     contentAdapter.viewHolderCacheList
                                 if (null != viewHolderCacheList) {
                                     val size = viewHolderCacheList.size
@@ -451,7 +449,7 @@ class FinancialReportUI(
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.exposureReportDataList.bindOptional(context) {
+            viewModel.fincialReportDataList.bindOptional(context) {
                 if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
                 } else {
@@ -488,7 +486,10 @@ class ExposureReportUI(
     }
 
     val contentAdapter by lazy {
-        ExposureReportContentAdapter(activity)
+        ExposureReportContentAdapter(
+            activity,
+            "2"
+        )
     }
 
     /**
@@ -747,12 +748,27 @@ class ExposureReportUI(
 class SpotReportUI(
     private val activity: AppCompatActivity,
     private val viewModel: ReportQueryViewModel
-) {
-
+) : SpotReportContentAdapter.OnContentScrollListener{
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
-    private val spotReportAdapter: BaseAdapter<SpotReportData, SpotReportViewHolder> =
-        BaseAdapter { _, _ -> SpotReportViewHolder(activity, viewModel) }
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    val contentAdapter by lazy {
+        SpotReportContentAdapter(
+            activity,
+            "3"
+        )
+    }
+
+    /**
+     * 选择的报表周期类型
+     */
+    val dateType : MutableLiveData<SelectData> = MutableLiveData()
 
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
@@ -765,29 +781,34 @@ class SpotReportUI(
     /** 查询时间textview **/
     lateinit var tradedatetextview: TextView
 
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    init {
+        viewModel.queryTradingAccMgrLoginUserBySpot(tradedate = tradedate)
+        dateType.postValue(SelectData(id = "1",value = "日报表"))
+    }
+
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
-            viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
+//            viewModel.qryReportDayExposure(tradedate = tradedate.replace("-",""))
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 linearLayout {
                     onThrottleFirstClick {
-                        if (viewModel.isselectSpotMonthOrDay.value == "1") {
-                            viewModel.isselectSpotMonthOrDay.postValue("2")
-                        } else {
-                            viewModel.isselectSpotMonthOrDay.postValue("1")
+                        activity.creatBottomSheetDialog("请选择报表周期", viewModel.getSelectDateType()) {
+                            dateType.postValue(this)
+                            contentAdapter.setTimeType(this.id)//item设置时间类型
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        viewModel.isselectSpotMonthOrDay.bindOptional(context) {
-                            if (it == "1") {
-                                text = "日报表"
-                            } else if (it == "2") {
-                                text = "月报表"
-                            }
+                        dateType.bindOptional(context){
+                            text = it?.value
                         }
                         text = "日报表"
                         textColorInt = R.color.rma_hint_text_color_ccc
@@ -795,22 +816,18 @@ class SpotReportUI(
                     }.lparams(wrapContent, wrapContent) {
                         marginStart = autoSize(18)
                     }
-
                     emptyView()
 
-                    imageView {
-                        imageResource = R.mipmap.rma_down
-                    }.lparams(autoSize(25), autoSize(25))
-
-                }.lparams(autoSize(288), autoSize(67)) {
+                }.lparams(0, autoSize(67),1f) {
                     marginStart = autoSize(36)
                 }
 
                 linearLayout {
                     onThrottleFirstClick {
-                        activity.showDataSelectDialog(type = viewModel.isselectSpotMonthOrDay.value.toString()) {
+                        activity.showDataSelectDialog(type = dateType.value?.id ?: "1") {
                             tradedate = this
                             tradedatetextview.text = this
+                            contentAdapter.setTime(this)
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
@@ -832,113 +849,148 @@ class SpotReportUI(
                     imageView {
                         imageResource = R.mipmap.rma_search_by_time
                     }.lparams(autoSize(38), autoSize(38))
-                }.lparams(autoSize(370), autoSize(67)) {
-                    marginStart = autoSize(12)
+                }.lparams(0, autoSize(67),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
                 }
 
+            }.lparams(matchParent, autoSize(100))
+
+
+            linearLayout {
                 textView {
+                    backgroundResource = R.drawable.rma_time_click_bg
                     onThrottleFirstClick {
-                        if (viewModel.isselectSpotMonthOrDay.value == "1") {
-                            viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
-                        } else {
-                            viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-", ""))
+                        activity.creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
+                            viewModel.spotSelectTransactionUser.postValue(this)
+
                         }
                     }
+                    viewModel.spotSelectTransactionUser.bindOptional(context){
+                        text = it?.value
+                        contentAdapter.setTransaction(it?.value)
+                        contentAdapter.setTransactionUserid(it?.id)
+                    }
                     gravity = Gravity.CENTER
+                    text = "请选择交易用户"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(67),1f){
+                    marginStart = autoSize(36)
+                }
+                textView {
                     backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
+                    onThrottleFirstClick {
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
+                        }else if (dateType.value?.id == "3"){//周报表
+
+                        }
+
+                    }
+                    gravity = Gravity.CENTER
                     text = "查询"
-                    textSizeAuto = 31
                     textColorInt = R.color.white
-                }.lparams(autoSize(144), autoSize(67)) {
-                    marginStart = autoSize(12)
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(67),1f){
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
                 }
 
             }.lparams(matchParent, autoSize(100))
 
+//            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
+
             linearLayout {
-                verticalLayout {
-                    gravity = Gravity.START
-                    textView {
-                        text = "现货品种"
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//待点价头部左侧数据
+                        viewModel.sspotReportTitle.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
                         textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
                     }.lparams(wrapContent, wrapContent) {
-                        marginStart = autoSize(36)
-                        topMargin = autoSize(15)
+                        marginStart = autoSize(30)
                     }
-                }.lparams(autoSize(225), autoSize(97))
-
-                verticalLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "采购定价量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent)
-
-                    textView {
-                        text = "销售定价量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(225), autoSize(97))
-
-                verticalLayout {
-                    gravity = Gravity.CENTER
-                    textView {
-                        text = "采购确定量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent)
+                }.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
 
-                    textView {
-                        text = "销售确定量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent)
-                }.lparams(autoSize(225), autoSize(97))
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                        contentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<SpotReportContentAdapter.ItemViewHolder> =
+                            contentAdapter.viewHolderCacheList
 
-                verticalLayout {
-                    gravity = Gravity.END
-                    textView {
-                        text = "采购入库量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent) {
-                        marginEnd = autoSize(36)
-                        topMargin = autoSize(15)
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
                     }
-
-                    textView {
-                        text = "销售出库量"
-                        textSizeAuto = 24
-                        textColorInt = R.color.hint_text_color
-                    }.lparams(wrapContent, wrapContent) {
-                        marginEnd = autoSize(36)
+                    relativeLayout {
+                        recyclerView {//待点价头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.sspotReportTitle.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
                     }
-                }.lparams(autoSize(225), autoSize(97))
-            }.lparams(matchParent, autoSize(97))
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
 
             statusLayout(contentBlock = {
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
-                    setEnableRefresh(true)
+                    setEnableRefresh(false)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-                        if (viewModel.isselectSpotMonthOrDay.value == "1") {
-                            viewModel.qryReportDaySpot(tradedate = tradedate.replace("-", ""))
-                        } else {
-                            viewModel.qryReportMonthSpot(tradedate = tradedate.replace("-", ""))
-                        }
+                        /**
+                         * 下拉刷新
+                         */
+//                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
-                    recyclerView {
+
+                    recyclerView {//待点价列表
                         background = resources.getDrawable(R.color.white)
-                        adapter = spotReportAdapter
-                    }.lparams(matchParent, matchParent)
+                        adapter = contentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<SpotReportContentAdapter.ItemViewHolder> =
+                                    contentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
+
+
                 }
             }, emptyBlock = {
                 emptyView(hint = resources.getString(R.string.now_no_data))
@@ -950,17 +1002,20 @@ class SpotReportUI(
                 } else {
                     if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
                     }
                     statusLayout.showSuccess()
-                    spotReportAdapter.setNewData(it)
+                    contentAdapter.setDatas(it)
                 }
             }
         }
     }
+
 }
 
+
 /**
- * 现货收益报
+ * 汇总损益
  * @property activity AppCompatActivity
  * @property viewModel ReportQueryViewModel
  * @constructor
@@ -968,30 +1023,27 @@ class SpotReportUI(
 class SpotEarningReportUI(
     private val activity: AppCompatActivity,
     private val viewModel: ReportQueryViewModel
-) : SpotEarningRecordAdapter.OnContentScrollListener{
+) : SummaryReportContentAdapter.OnContentScrollListener{
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
     lateinit var horScrollview: CustomHorizontalScrollView
     lateinit var recyclerView: RecyclerView
 
-    //列表头部的数据adapter
     val topAdapter by lazy {
         TopTabAdpater(activity)
     }
 
-    //列表adapter
-    val exposureContentAdapter by lazy {
-        SpotEarningRecordAdapter(activity)
+    val contentAdapter by lazy {
+        SummaryReportContentAdapter(
+            activity,
+            "5"
+        )
     }
 
-    /** 选择的现货品种 */
-    private val selectDeiveryData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
-
-    /** 选择的型号品类 **/
-    private val selectWrStandModel: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
-
-    /** 选择的品牌 ***/
-    private val selectWrStandBrand: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+    /**
+     * 选择的报表周期类型
+     */
+    val dateType : MutableLiveData<SelectData> = MutableLiveData()
 
     /**
      * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
@@ -1004,37 +1056,34 @@ class SpotEarningReportUI(
     /** 查询时间textview **/
     lateinit var tradedatetextview: TextView
 
-    fun initData(){
-        viewModel.queryDeliveryGoods()//查询现货品种
-        viewModel.queryGoodsWrstandard()//查询品类
-        viewModel.queryGoodsbrand()//查询品牌
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
+
+    init {
+        viewModel.queryTradingAccMgrLoginUserBySummary(tradedate = tradedate)
+        dateType.postValue(SelectData(id = "1",value = "日报表"))
     }
 
     @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
-            initData()
+//            viewModel.qryReportDayExposure(tradedate = tradedate.replace("-",""))
             linearLayout {
                 gravity = Gravity.CENTER_VERTICAL
                 linearLayout {
                     onThrottleFirstClick {
-                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1") {
-                            viewModel.isSelectspotEarningMonthOrDay.postValue("2")
-                        } else {
-                            viewModel.isSelectspotEarningMonthOrDay.postValue("1")
+                        activity.creatBottomSheetDialog("请选择报表周期", viewModel.getSelectDateType()) {
+                            dateType.postValue(this)
+                            contentAdapter.setTimeType(this.id)//item设置时间类型
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        viewModel.isSelectspotEarningMonthOrDay.bindOptional(context) {
-                            if (it == "1") {
-                                text = "日报表"
-                                exposureContentAdapter.setquerytype("1")
-                            } else if (it == "2") {
-                                text = "月报表"
-                                exposureContentAdapter.setquerytype("2")
-                            }
+                        dateType.bindOptional(context){
+                            text = it?.value
                         }
                         text = "日报表"
                         textColorInt = R.color.rma_hint_text_color_ccc
@@ -1042,25 +1091,18 @@ class SpotEarningReportUI(
                     }.lparams(wrapContent, wrapContent) {
                         marginStart = autoSize(18)
                     }
-
                     emptyView()
 
-                    imageView {
-                        imageResource = R.mipmap.rma_down
-                    }.lparams(autoSize(25), autoSize(25)){
-                        marginEnd = autoSize(10)
-                    }
-
-                }.lparams(autoSize(264), autoSize(67)) {
+                }.lparams(0, autoSize(67),1f) {
                     marginStart = autoSize(36)
                 }
 
                 linearLayout {
                     onThrottleFirstClick {
-                        activity.showDataSelectDialog(type = viewModel.isSelectspotEarningMonthOrDay.value.toString()) {
+                        activity.showDataSelectDialog(type = dateType.value?.id ?: "1") {
                             tradedate = this
-                            exposureContentAdapter.setquerydate(this)
                             tradedatetextview.text = this
+                            contentAdapter.setTime(this)
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
@@ -1081,155 +1123,66 @@ class SpotEarningReportUI(
 
                     imageView {
                         imageResource = R.mipmap.rma_search_by_time
-                    }.lparams(autoSize(38), autoSize(38)){
-                        marginEnd = autoSize(10)
-                    }
-                }.lparams(autoSize(264), autoSize(67)) {
-                    marginStart = autoSize(12)
-                }
-
-                linearLayout {
-                    onThrottleFirstClick {
-                        activity.creatBottomSheetDialog(
-                            "请选择现货品种",
-                            viewModel.getDeliverySelectData()
-                        ) {
-                            selectDeiveryData.postValue(this)
-                        }
-                    }
-                    backgroundResource = R.drawable.rma_time_click_bg
-                    gravity = Gravity.CENTER_VERTICAL
-                    textView {
-                        selectDeiveryData.bindOptional(context) {
-                            text = it?.value
-                            textColorInt = R.color.rma_black_33
-                        }
-                        text = "现货品种"
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                        textSizeAuto = 31
-                    }.lparams(wrapContent, wrapContent) {
-                        marginStart = autoSize(18)
-                    }
-
-                    emptyView()
-
-                    imageView {
-                        imageResource = R.mipmap.rma_down
-                    }.lparams(autoSize(38), autoSize(38)){
-                        marginEnd = autoSize(10)
-                    }
-                }.lparams(autoSize(264), autoSize(67)) {
-                    marginStart = autoSize(12)
+                    }.lparams(autoSize(38), autoSize(38))
+                }.lparams(0, autoSize(67),1f) {
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
                 }
 
-
             }.lparams(matchParent, autoSize(100))
 
+
             linearLayout {
-                linearLayout {
-                    onThrottleFirstClick {
-                        activity.creatBottomSheetDialog(
-                            "请选择品类",
-                            viewModel.getGoodsWrstandardSelectList()
-                        ) {
-                            selectWrStandModel.postValue(this)
-                        }
-                    }
+                textView {
                     backgroundResource = R.drawable.rma_time_click_bg
-                    gravity = Gravity.CENTER_VERTICAL
-                    textView {
-                        selectWrStandModel.bindOptional(context) {
-                            text = it?.value
-                            textColorInt = R.color.rma_black_33
-                        }
-                        text = "品类"
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                        textSizeAuto = 31
-                    }.lparams(wrapContent, wrapContent) {
-                        marginStart = autoSize(18)
-                    }
-
-                    emptyView()
-
-                    imageView {
-                        imageResource = R.mipmap.rma_down
-                    }.lparams(autoSize(38), autoSize(38)){
-                        marginEnd = autoSize(10)
-                    }
-                }.lparams(0, autoSize(67), 1f) {
-                    marginStart = autoSize(12)
-                }
-                linearLayout {
                     onThrottleFirstClick {
-                        activity.creatBottomSheetDialog(
-                            "请选择品牌",
-                            viewModel.getGoodsBrandSelectList()
-                        ) {
-                            selectWrStandBrand.postValue(this)
+                        activity.creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
+                            viewModel.summarySelectTransactionUser.postValue(this)
+
                         }
                     }
-                    backgroundResource = R.drawable.rma_time_click_bg
-                    gravity = Gravity.CENTER_VERTICAL
-                    textView {
-                        selectWrStandBrand.bindOptional(context) {
-                            text = it?.value
-                            textColorInt = R.color.rma_black_33
-                        }
-                        text = "品牌"
-                        textColorInt = R.color.rma_hint_text_color_ccc
-                        textSizeAuto = 31
-                    }.lparams(wrapContent, wrapContent) {
-                        marginStart = autoSize(18)
-                    }
-
-                    emptyView()
-
-                    imageView {
-                        imageResource = R.mipmap.rma_down
-                    }.lparams(autoSize(38), autoSize(38)){
-                        marginEnd = autoSize(10)
+                    viewModel.summarySelectTransactionUser.bindOptional(context){
+                        text = it?.value
+                        contentAdapter.setTransaction(it?.value)
+                        contentAdapter.setTransactionUserid(it?.id)
                     }
-                }.lparams(0, autoSize(67), 1f) {
-                    marginStart = autoSize(12)
+                    gravity = Gravity.CENTER
+                    text = "请选择交易用户"
+                    textColorInt = R.color.rma_black_33
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(67),1f){
+                    marginStart = autoSize(36)
                 }
-
-
                 textView {
+                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     onThrottleFirstClick {
-                        var querydate = ""
-                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1"){//日报表
-                            querydate = tradedate.replace("-", "")
-                        }else{//月报表
-                            querydate = tradedate.replace("-", "")
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
+                        }else if (dateType.value?.id == "3"){//周报表
+
                         }
-                        viewModel.qryReportAreaSpotPL(
-                            querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
-                            querydate = querydate,
-                            deliverygoodsid = selectDeiveryData.value?.id ?: "",
-                            spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                            wrstandardid = selectWrStandModel.value?.id ?: ""
-                        )
+
                     }
                     gravity = Gravity.CENTER
-                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     text = "查询"
-                    textSizeAuto = 31
                     textColorInt = R.color.white
-                }.lparams(autoSize(122), autoSize(67)) {
-                    marginStart = autoSize(12)
+                    textSizeAuto = 31
+                }.lparams(0, autoSize(67),1f){
+                    marginStart = autoSize(36)
+                    marginEnd = autoSize(36)
                 }
+
             }.lparams(matchParent, autoSize(100))
-            //初始化数据进行头部数据请求
-            viewModel.querySpotEarningTitle(
-                querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
-                querydate = tradedate.replace("-", "")
-            )
-            exposureContentAdapter.setOnContentScrollListener(this@SpotEarningReportUI)
+
+//            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
+
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
-                    textView {//头部右侧数据
-                        viewModel.spotEarningRecordTitle.bindOptional(context) {
+                    textView {//待点价头部左侧数据
+                        viewModel.summaryReportTitle.bindOptional(context) {
                             text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
                         }
                         textColorStr = "#AAAAAA"
@@ -1237,21 +1190,19 @@ class SpotEarningReportUI(
                     }.lparams(wrapContent, wrapContent) {
                         marginStart = autoSize(30)
                     }
-                }.lparams(autoSize(SizeUtils.dp2px(90f)), autoSize(100))
+                }.lparams(autoSize(SizeUtils.dp2px(135f)), autoSize(100))
 
                 inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
                     horScrollview = this
-                    /**
-                     * 用来同步内容列表的item左右滑动
-                     */
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
-                        exposureContentAdapter.offestX = scrollX
-                        val viewHolderCacheList: List<SpotEarningRecordAdapter.ItemViewHolder> =
-                            exposureContentAdapter.viewHolderCacheList
+                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                        contentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<SummaryReportContentAdapter.ItemViewHolder> =
+                            contentAdapter.viewHolderCacheList
+
                         if (null != viewHolderCacheList) {
                             val size = viewHolderCacheList.size
                             for (i in 0 until size) {
-                                viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
+                                viewHolderCacheList[i].horItemScrollview.scrollTo(
                                     scrollX,
                                     0
                                 )
@@ -1259,14 +1210,14 @@ class SpotEarningReportUI(
                         }
                     }
                     relativeLayout {
-                        recyclerView {//头部右侧数据
+                        recyclerView {//待点价头部右侧数据
                             val linearLayoutManager = LinearLayoutManager(context)
                             linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
                             layoutManager = linearLayoutManager
                             background = resources.getDrawable(R.color.white)
                             adapter = topAdapter
                         }
-                        viewModel.spotEarningRecordTitle.bindOptional(context) {
+                        viewModel.summaryReportTitle.bindOptional(context) {
                             val titleStringList = arrayListOf<String>()
                             it?.subList(1, it.size)?.forEach { data ->
                                 titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
@@ -1276,47 +1227,36 @@ class SpotEarningReportUI(
                     }
                 }.lparams(matchParent, matchParent)
             }.lparams(matchParent, autoSize(100))
+
             statusLayout(contentBlock = {
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
-                    setEnableRefresh(true)
+                    setEnableRefresh(false)
                     setEnableLoadMore(false)
                     setOnRefreshListener {
-                        var querydate = ""
-                        if (viewModel.isSelectspotEarningMonthOrDay.value == "1"){//日报表
-                            querydate = tradedate.replace("-", "")
-                        }else{//月报表
-                            querydate = tradedate.replace("-", "")
-                        }
                         /**
                          * 下拉刷新
                          */
-                        viewModel.qryReportAreaSpotPL(
-                            querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
-                            querydate = querydate,
-                            deliverygoodsid = selectDeiveryData.value?.id ?: "",
-                            spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                            wrstandardid = selectWrStandModel.value?.id ?: ""
-                        )
+//                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
 
-                    recyclerView {
+                    recyclerView {//待点价列表
                         background = resources.getDrawable(R.color.white)
-                        adapter = exposureContentAdapter
+                        adapter = contentAdapter
                         addOnScrollListener(object : RecyclerView.OnScrollListener() {
                             override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
                                 super.onScrolled(recyclerView, dx, dy)
-                                val viewHolderCacheList: List<SpotEarningRecordAdapter.ItemViewHolder> =
-                                    exposureContentAdapter.viewHolderCacheList
+                                val viewHolderCacheList: List<SummaryReportContentAdapter.ItemViewHolder> =
+                                    contentAdapter.viewHolderCacheList
                                 if (null != viewHolderCacheList) {
                                     val size = viewHolderCacheList.size
                                     for (i in 0 until size) {
-                                        viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
-                                            exposureContentAdapter.getOffestX(),
+                                        viewHolderCacheList[i].horItemScrollview.scrollTo(
+                                            contentAdapter.getOffestX(),
                                             0
                                         )
                                     }
@@ -1324,35 +1264,28 @@ class SpotEarningReportUI(
                             }
                         })
                     }
+
+
                 }
             }, emptyBlock = {
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.spotEarningDataList.bindOptional(context) {
-
+            viewModel.summaryReportDataList.bindOptional(context) {
                 if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
                 } else {
                     if (swipeToLayout.getIsRefreshing()) {
                         swipeToLayout.finishRefresh()
+//                        mHeadHeaderHSView.scrollTo(scrollXView,scrollYView)
                     }
                     statusLayout.showSuccess()
-                    exposureContentAdapter.setDatas(it)
+                    contentAdapter.setDatas(it)
                 }
             }
         }
     }
 
-
-
-    override fun onScroll(event: MotionEvent?) {
-        //处理单个item滚动时,顶部tab需要联动
-        if (null != horScrollview) horScrollview.onTouchEvent(event)
-    }
-
-
-
 }
 
 /**

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

@@ -27,6 +27,21 @@ class ReportQueryViewModel : BaseViewModel(){
     val exposureReportTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
 
     /**
+     * 实时敞口头部数据
+     */
+    val fincialReportTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 汇总损益报表头部数据
+     */
+    val summaryReportTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
+     * 汇总损益报表头部数据
+     */
+    val sspotReportTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
      * 财务报表头部数据
      */
     val financialReportTitleData : MutableLiveData<FinancialReportData> = MutableLiveData()
@@ -52,19 +67,34 @@ class ReportQueryViewModel : BaseViewModel(){
     val financialReportMonthDataList : MutableLiveData<List<FinancialReportData>> = MutableLiveData()
 
     /**
-     * 敞口报表数据
+     * 敞口报表数据
      */
     val exposureReportDataList : MutableLiveData<List<ExposureReportData>> = MutableLiveData()
 
     /**
-     * 现货报表选择的日报表还是月报表 1为日报表 2为月报表
+     * 财务报表数据新
      */
-    val isselectSpotMonthOrDay : MutableLiveData<String> = MutableLiveData<String>().apply { value = "1" }
+    val fincialReportDataList : MutableLiveData<List<FinanceReportData>> = MutableLiveData()
 
     /**
-     * 现货报表列表数据(日/月)
+     * 汇总损益报表数据新
      */
-    val spotReportDataList : MutableLiveData<List<SpotReportData>> = MutableLiveData()
+    val summaryReportDataList : MutableLiveData<List<AreaSumPLData>> = MutableLiveData()
+
+    /**
+     * 汇总损益报表数据新
+     */
+    val spotReportDataList : MutableLiveData<List<AreaSpotplReportData>> = MutableLiveData()
+
+    /**
+     * 现货报表选择的日报表还是月报表 1为日报表 2为月报表
+     */
+    val isselectSpotMonthOrDay : MutableLiveData<String> = MutableLiveData<String>().apply { value = "1" }
+
+//    /**
+//     * 现货报表列表数据(日/月)
+//     */
+//    val spotReportDataList : MutableLiveData<List<SpotReportData>> = MutableLiveData()
 
     /**
      * 现货报表详情列表
@@ -142,6 +172,15 @@ class ReportQueryViewModel : BaseViewModel(){
     /** 敞口报表选择的交易用户 **/
     val exposureSelectTransactionUser : MutableLiveData<SelectData> = MutableLiveData()
 
+    /** 财务报表选择的交易用户 **/
+    val financialSelectTransactionUser : MutableLiveData<SelectData> = MutableLiveData()
+
+    /** 汇总损益报表选择的交易用户 **/
+    val summarySelectTransactionUser : MutableLiveData<SelectData> = MutableLiveData()
+
+    /** 汇总损益报表选择的交易用户 **/
+    val spotSelectTransactionUser : MutableLiveData<SelectData> = MutableLiveData()
+
     /**
      * 查询财务日报表(菜单:报表查询/财务报表/日报表)
      * @param tradedate String
@@ -227,15 +266,10 @@ class ReportQueryViewModel : BaseViewModel(){
     }
 
 
-
     /**
-     * querytype 查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日])日报表的情况下只需要传querytype tradedate
-     * 敞口报表第三步先查询日报表(进入页面默认查询日报表)
-     * cycletime 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
-     * 查询敞口日报表
-     * @param tradedate String
+     * 现货报表第三部查询
      */
-    fun qryReckonAreaExpourse(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+    fun qryAreaSpotplReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
         val params = mutableMapOf<String, String>().apply {
             put("userid", userid)
             put("querytype",querytype)
@@ -248,68 +282,96 @@ class ReportQueryViewModel : BaseViewModel(){
                 put("cycletype",cycletype)
                 put("tradedate", tradedate)
             }
-
         }
 
-        MyApplication.getInstance()?.reportManager?.qryReckonAreaExpourse(params = params){isSuccess, respData, error ->
+        MyApplication.getInstance()?.reportManager?.qryAreaSpotplReport(params = params){isSuccess, respData, error ->
             if (isSuccess){
-                exposureReportDataList.postValue(getReportDayExposureRightData(respData ?: arrayListOf()))
+                spotReportDataList.postValue(getSpotExposureRightData(respData ?: arrayListOf()))
             }
         }
     }
 
     /**
-     * 查询现货日报表(菜单:报表查询/现货报表/现货日报表)
-     * @param tradedate String
+     * 汇总损益报表第三部查询
      */
-    fun qryReportDaySpot(tradedate : String){
+    fun qrySummaryReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
         val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("tradedate", tradedate)
+            put("userid", userid)
+            put("querytype",querytype)
+            if (querytype == "1"){
+                put("tradedate", tradedate)
+            }else if (querytype == "2"){//月
+                put("cycletime",tradedate)
+                put("cycletype",cycletype)
+            }else{//周
+                put("cycletype",cycletype)
+                put("tradedate", tradedate)
+            }
         }
-        MyApplication.getInstance()?.reportManager?.qryReportDaySpot(params = params){isSuccess, respData, error ->
+
+        MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
             if (isSuccess){
-                spotReportDataList.postValue(respData)
+                summaryReportDataList.postValue(getSummaryExposureRightData(respData ?: arrayListOf()))
             }
         }
     }
 
     /**
-     * 查询现货月报表(菜单:报表查询/现货报表/现货月报表)
-     * @param tradedate String
+     * 财务报表第三步查询日报表
      */
-    fun qryReportMonthSpot(tradedate : String){
+    fun qryFinanceReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
         val params = mutableMapOf<String, String>().apply {
-            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
-            put("tradedate", tradedate)
+            put("userid", userid)
+            put("querytype",querytype)
+            if (querytype == "1"){
+                put("tradedate", tradedate)
+            }else if (querytype == "2"){//月
+                put("cycletime",tradedate)
+                put("cycletype",cycletype)
+            }else{//周
+                put("cycletype",cycletype)
+                put("tradedate", tradedate)
+            }
         }
-        MyApplication.getInstance()?.reportManager?.qryReportMonthSpot(params = params){isSuccess, respData, error ->
+
+        MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
             if (isSuccess){
-                spotReportDataList.postValue(respData)
+                fincialReportDataList.postValue(getFincialExposureRightData(respData ?: arrayListOf()))
             }
         }
     }
 
     /**
-     * 对于列表点击展开后的数据处理
-     * @param index Int
+     * querytype 查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日])日报表的情况下只需要传querytype tradedate
+     * 敞口报表第三步先查询日报表(进入页面默认查询日报表)
+     * cycletime 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+     * 查询敞口日报表
+     * @param tradedate String
      */
-    fun resetDataList(index: Int) {
-        val datanewlist = arrayListOf<SpotReportData>()
-        spotReportDataList.value?.forEach {
-            if (index == spotReportDataList.value?.indexOf(it)) {
-                if (it.indexSelect == 0) {
-                    datanewlist.add(it.copy(indexSelect = 1))
-                } else {
-                    datanewlist.add(it.copy(indexSelect = 0))
-                }
-            } else {
-                datanewlist.add(it)
+    fun qryReckonAreaExpourse(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", userid)
+            put("querytype",querytype)
+            if (querytype == "1"){
+                put("tradedate", tradedate)
+            }else if (querytype == "2"){//月
+                put("cycletime",tradedate)
+                put("cycletype",cycletype)
+            }else{//周
+                put("cycletype",cycletype)
+                put("tradedate", tradedate)
+            }
+        }
+
+        MyApplication.getInstance()?.reportManager?.qryReckonAreaExpourse(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                exposureReportDataList.postValue(getReportDayExposureRightData(respData ?: arrayListOf()))
             }
         }
-        spotReportDataList.postValue(datanewlist)
     }
 
+
+
     /**
      * 查询现货日报表详情(菜单:报表查询/现货报表/现货日报表详情)
      * @param wrstandardid String
@@ -349,6 +411,76 @@ class ReportQueryViewModel : BaseViewModel(){
     }
 
     /**
+     * 现货报表第一步查询交易用户
+     */
+    fun queryTradingAccMgrLoginUserBySpot(tradedate : String){
+        if (tradingAccountManagerList.value.isNullOrEmpty()){
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype", "2")
+            }
+            MyApplication.getInstance()?.accountManager?.queryAccMgrLoginUser(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    tradingAccountManagerList.postValue(respData)
+                    spotSelectTransactionUser.postValue(SelectData(id = respData?.get(0)?.roleid ?: "",value = respData?.get(0)?.rolename ?: ""))
+                    querySpotTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+                }
+            }
+        }else{
+            spotSelectTransactionUser.postValue(SelectData(id = tradingAccountManagerList.value?.get(0)?.roleid ?: "",value = tradingAccountManagerList.value?.get(0)?.rolename ?: ""))
+            querySpotTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+
+        }
+
+    }
+
+    /**
+     * 汇总损益报表第一步查询交易用户
+     */
+    fun queryTradingAccMgrLoginUserBySummary(tradedate : String){
+        if (tradingAccountManagerList.value.isNullOrEmpty()){
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype", "2")
+            }
+            MyApplication.getInstance()?.accountManager?.queryAccMgrLoginUser(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    tradingAccountManagerList.postValue(respData)
+                    summarySelectTransactionUser.postValue(SelectData(id = respData?.get(0)?.roleid ?: "",value = respData?.get(0)?.rolename ?: ""))
+                    querySummaryTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+                }
+            }
+        }else{
+            summarySelectTransactionUser.postValue(SelectData(id = tradingAccountManagerList.value?.get(0)?.roleid ?: "",value = tradingAccountManagerList.value?.get(0)?.rolename ?: ""))
+            querySummaryTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+
+        }
+
+    }
+
+    /**
+     * 财务报表第一步也是查询交易用户
+     */
+    fun queryTradingAccMgrLoginUserByFinancial(tradedate : String){
+        if (tradingAccountManagerList.value.isNullOrEmpty()){
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype", "2")
+            }
+            MyApplication.getInstance()?.accountManager?.queryAccMgrLoginUser(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    tradingAccountManagerList.postValue(respData)
+                    summarySelectTransactionUser.postValue(SelectData(id = respData?.get(0)?.roleid ?: "",value = respData?.get(0)?.rolename ?: ""))
+                    queryFincialTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+                }
+            }
+        }else{
+            financialSelectTransactionUser.postValue(SelectData(id = tradingAccountManagerList.value?.get(0)?.roleid ?: "",value = tradingAccountManagerList.value?.get(0)?.rolename ?: ""))
+        }
+
+    }
+
+    /**
      * 敞口报表第一步先查询交易用户
      * 查询账户管理登录账号(账户管理/交易账号)
      */
@@ -389,6 +521,65 @@ class ReportQueryViewModel : BaseViewModel(){
         return selectDataList
     }
 
+    /**
+     * 现货报表第二部查询列头
+     */
+    fun querySpotTitle(tableKey: String,cycletime: String,cycletype : String,userid : String,querytype : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                sspotReportTitle.postValue(newlist)
+                qrySummaryReport(tradedate = cycletime,userid = userid,querytype = querytype)
+            }
+        }
+    }
+
+    /**
+     * 汇总损益报表第二部查询列头
+     */
+    fun querySummaryTitle(tableKey: String,cycletime: String,cycletype : String,userid : String,querytype : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                summaryReportTitle.postValue(newlist)
+                qrySummaryReport(tradedate = cycletime,userid = userid,querytype = querytype)
+            }
+        }
+    }
+
+    /**
+     * 财务报表第二部查询列头
+     */
+    fun queryFincialTitle(tableKey: String,cycletime: String,cycletype : String,userid : String,querytype : String){
+        val params = mutableMapOf<String, String>().apply {
+            put("tableKey", tableKey)
+            put("tableType", "3")
+        }
+        MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
+            if (isSuccess) {
+                val newlist = respData?.get(0)?.columns?.toArrayList()
+                newlist?.sortWith(Comparator { t1, t2 ->
+                    t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
+                })
+                fincialReportTitle.postValue(newlist)
+                qryReckonAreaExpourse(tradedate = cycletime,userid = userid,querytype = querytype)
+            }
+        }
+    }
 
     /**
      * 敞口报表第二步先查询列头
@@ -413,6 +604,87 @@ class ReportQueryViewModel : BaseViewModel(){
     }
 
     /**
+     * 现货报表右部数据组装
+     */
+    fun getSpotExposureRightData(respData: List<AreaSpotplReportData>) : List<AreaSpotplReportData>{
+        val newList = arrayListOf<AreaSpotplReportData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //'现货品类 '
+            newRightData.add(it.wrstandardname)
+            //'期初量/\n 期末量 '
+            newRightData.add(NumberUtils.doubleDistortion(it.oriqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.oriqty) + it.curqty)
+            //'今采购量/\n 今销售量 '
+            newRightData.add(NumberUtils.doubleDistortion(it.todaybuyqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.todaysellqty) + it.curqty)
+            //'今入库量/\n 今出库量 '
+            newRightData.add(NumberUtils.doubleDistortion(it.todayinqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.todayoutqty) + it.curqty)
+            //'期初额/\n 期末额 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.curamount),2) + it.currencyname)
+            // '期初均价/\n 期末均价 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriaverageprice),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.curaverageprice),2) + it.currencyname)
+            // '今采购额/\n 今销售额 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaybuyamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaysellamount),2) + it.currencyname)
+            // '采购均价/\n 销售均价 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaybuyaverageprice),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaysellaverageprice),2) + it.currencyname)
+            // '现货损益/\n 浮动损益 '
+            newRightData.add(it.actualpl + "\n" + it.floatpl)
+            // '最新价/\n 期末市值 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.curspotprice),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.curmarketvalue),2) + it.currencyname)
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+    /**
+     * 汇总损益报表右部数据组装
+     */
+    fun getSummaryExposureRightData(respData: List<AreaSumPLData>) : List<AreaSumPLData>{
+        val newList = arrayListOf<AreaSumPLData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //'现货损益/\n 现货浮动损益 '
+            newRightData.add(it.spotactualpl + "\n" + it.spotfloatpl)
+            //'期货损益/\n 期货浮动损益 '
+            newRightData.add(it.futureactualpl + "\n" + it.futurefloatpl)
+            //'实际损益/\n 汇总损益 '
+            newRightData.add(it.sumactualpl + "\n" + it.sumpl)
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+    /**
+     * 财务报表组装右侧数据
+     */
+    fun getFincialExposureRightData(respData: List<FinanceReportData>) : List<FinanceReportData>{
+        val newList = arrayListOf<FinanceReportData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            //今付贷款额/\n 今收退款额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodaysettleamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodayrefundamount),2) + it.currencyname)
+            //'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.selltodaysettleamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2) + it.currencyname)
+            //'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodayinvoiceamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2) + it.currencyname)
+            //预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyprepaidamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyunpaidamount),2) + it.currencyname)
+            //'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buypreinvoicedamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyuninvoicedamount),2) + it.currencyname)
+            //''预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellprepaidamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellunpaidamount),2) + it.currencyname)
+            //'预开票额/\n 应开票额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellpreinvoicedamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.selluninvoicedamount),2) + it.currencyname)
+            //'今收款合计/\n 今付款合计'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todayreceivesum),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaypaysum),2) + it.currencyname)
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
+    /**
      * 敞口组装右部数据
      * @param respData List<RealExposureData>
      * @return List<RealExposureData>

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

@@ -36,7 +36,7 @@ class SpotReportViewHolder(
 
         verticalLayout {
             onThrottleFirstClick {
-                viewModel.resetDataList(index = dataIndex)
+//                viewModel.resetDataList(index = dataIndex)
             }
             data.bindOptional(context) {
                 if (it?.indexSelect == 0) {

+ 24 - 8
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ExposureReportContentAdapter.java → RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java

@@ -1,4 +1,4 @@
-package cn.muchinfo.rma.view.base.home.reportquery;
+package cn.muchinfo.rma.view.base.home.reportquery.adapter;
 
 import android.annotation.SuppressLint;
 import android.content.Context;
@@ -40,6 +40,7 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
     private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
     public int offestX = 0;
     private OnContentScrollListener onContentScrollListener;
+    //1是财务报表,2是敞口报表 3是现货报表 4是库存报表 5是汇总损益表
     private String type;
 
     //---------------往下级传的参数----------------
@@ -79,7 +80,7 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
     }
 
 
-    public ExposureReportContentAdapter(Context context) {
+    public ExposureReportContentAdapter(Context context, String type) {
         this.context = context;
         this.listType = listType;
         this.type = type;
@@ -140,6 +141,18 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
                 setPosition(i);
             }
         });
+        if (type.equals("2")){
+            itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+            itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
+        }else if (type.equals("1")){
+            itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+        }
+        //财务明细
+        itemViewHolder.warehouse_register.setOnClickListener(view -> {
+
+        });
         //现货合同明细
         itemViewHolder.invoice_register.setOnClickListener(view -> {
             Intent intent = new Intent();
@@ -163,11 +176,7 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
             intent.putExtra("title","参数调整明细");
             intent.putExtra("time",this.time);
             intent.putExtra("transaction",this.transaction);
-            if (this.timeType.equals("1")){//日明细报表
-                intent.putExtra("tabtitle", Constant.table_mobile_report_expose_hedgeplan);
-            }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_expose);
-            }
+            intent.putExtra("tabtitle",this.tabtitle);
             intent.putExtra("timeType",this.timeType);
             intent.putExtra("transactionUserid",this.transactionUserid);
             intent.setClass(context, ReportCommonDetailsActivity.class);
@@ -191,11 +200,16 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
             intent.putExtra("title","套保计划明细");
             intent.putExtra("time",this.time);
             intent.putExtra("transaction",this.transaction);
-            intent.putExtra("tabtitle",this.tabtitle);
+            if (this.timeType.equals("1")){//日明细报表
+                intent.putExtra("tabtitle", Constant.table_mobile_report_expose_hedgeplan);
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_expose);
+            }
             intent.putExtra("timeType",this.timeType);
             intent.putExtra("transactionUserid",this.transactionUserid);
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
+
         });
 
         itemViewHolder.load_more.setOnClickListener(view -> {
@@ -239,6 +253,7 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
         TextView midpoints_registration;//参数调整明细
         TextView settlement_of_registration;//期货明细
         TextView payment_registration;//套保计划明细
+        TextView warehouse_register;//财务明细
         ImageView load_more;//更多
         LinearLayout allView;//隐藏的底部操作空间
         LinearLayout all_click_View;//item左侧点击控件
@@ -261,6 +276,7 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
             midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
             settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
             payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
             load_more = itemView.findViewById(R.id.load_more);
             tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
             rvItemRight = itemView.findViewById(R.id.rv_item_right);

+ 250 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/FanacelReportContentAdapter.java

@@ -0,0 +1,250 @@
+package cn.muchinfo.rma.view.base.home.reportquery.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 java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.ExposureReportData;
+import cn.muchinfo.rma.global.data.FinanceReportData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.app.Constant;
+import cn.muchinfo.rma.view.base.home.reportquery.reportdetail.ReportCommonDetailsActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 财务报表adapter
+ */
+public class FanacelReportContentAdapter extends RecyclerView.Adapter<FanacelReportContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<FinanceReportData> datas;
+    private String listType;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    //1是财务报表,2是敞口报表 3是现货报表 4是库存报表 5是汇总损益表
+    private String type;
+
+    //---------------往下级传的参数----------------
+    private String time;//时间日期
+    private String timeType = "1";//日明细,周/月明细 默认是日
+    private String transaction;//交易用户名称
+    private String transactionUserid;//选择的交易用户id
+    private String tabtitle;//列头
+
+    public void setTime(String time){
+        this.time = time;
+    }
+
+    public void setTimeType(String timeType){
+        this.timeType = timeType;
+    }
+
+    public void setTransaction(String transaction){
+        this.transaction = transaction;
+    }
+
+    public void setTransactionUserid(String transactionUserid){
+        this.transactionUserid = transactionUserid;
+    }
+
+    public void setTabtitle(String tabtitle){
+        this.tabtitle = tabtitle;
+    }
+
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public FanacelReportContentAdapter(Context context, String type) {
+        this.context = context;
+        this.listType = listType;
+        this.type = type;
+    }
+
+    public void setDatas(List<FinanceReportData> 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.exposure_report_layout_item_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).getCurrencyname());
+//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            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(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+        if (type.equals("2")){
+            itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+            itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
+        }else if (type.equals("1")){
+            itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+        }
+        //财务明细
+        itemViewHolder.warehouse_register.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("title","财务报表明细");
+            intent.putExtra("time",this.time);
+            intent.putExtra("transaction",this.transaction);
+            if (this.timeType.equals("1")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_fincial_detail);
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_fincial);
+            }
+            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
+            intent.putExtra("middlegoodsid","");
+            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
+        itemViewHolder.load_more.setOnClickListener(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 details;//详情
+        TextView invoice_register;//现货合同明细
+        TextView midpoints_registration;//参数调整明细
+        TextView settlement_of_registration;//期货明细
+        TextView payment_registration;//套保计划明细
+        TextView warehouse_register;//财务明细
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        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);
+            midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
+            settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
+            payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            load_more = itemView.findViewById(R.id.load_more);
+            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);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

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

@@ -0,0 +1,258 @@
+package cn.muchinfo.rma.view.base.home.reportquery.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 java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.AreaSpotplReportData;
+import cn.muchinfo.rma.global.data.AreaSumPLData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.app.Constant;
+import cn.muchinfo.rma.view.base.home.reportquery.reportdetail.ReportCommonDetailsActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 财务报表adapter
+ */
+public class SpotReportContentAdapter extends RecyclerView.Adapter<SpotReportContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<AreaSpotplReportData> datas;
+    private String listType;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    //1是财务报表,2是敞口报表 3是现货报表 4是库存报表 5是汇总损益表
+    private String type;
+
+    //---------------往下级传的参数----------------
+    private String time;//时间日期
+    private String timeType = "1";//日明细,周/月明细 默认是日
+    private String transaction;//交易用户名称
+    private String transactionUserid;//选择的交易用户id
+    private String tabtitle;//列头
+
+    public void setTime(String time){
+        this.time = time;
+    }
+
+    public void setTimeType(String timeType){
+        this.timeType = timeType;
+    }
+
+    public void setTransaction(String transaction){
+        this.transaction = transaction;
+    }
+
+    public void setTransactionUserid(String transactionUserid){
+        this.transactionUserid = transactionUserid;
+    }
+
+    public void setTabtitle(String tabtitle){
+        this.tabtitle = tabtitle;
+    }
+
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public SpotReportContentAdapter(Context context, String type) {
+        this.context = context;
+        this.listType = listType;
+        this.type = type;
+    }
+
+    public void setDatas(List<AreaSpotplReportData> 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.exposure_report_layout_item_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).getCurrencyname());
+//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            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(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+        if (type.equals("2")){
+            itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+            itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
+        }else if (type.equals("1")){
+            itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+        }else if (type.equals("5")){
+            itemViewHolder.summary_details.setVisibility(View.VISIBLE);
+        }else if (type.equals("3")){
+            itemViewHolder.spot_details.setVisibility(View.VISIBLE);
+        }
+        //财务明细
+        itemViewHolder.spot_details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("title","现货报表明细");
+            intent.putExtra("time",this.time);
+            intent.putExtra("transaction",this.transaction);
+            if (this.timeType.equals("1")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_spot_detail);
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_spot);
+            }
+            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
+            intent.putExtra("middlegoodsid","");
+            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
+        itemViewHolder.load_more.setOnClickListener(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 details;//详情
+        TextView invoice_register;//现货合同明细
+        TextView midpoints_registration;//参数调整明细
+        TextView settlement_of_registration;//期货明细
+        TextView payment_registration;//套保计划明细
+        TextView warehouse_register;//财务明细
+        TextView summary_details;//损益明细
+        TextView spot_details;//现货明细
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        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);
+            midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
+            settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
+            payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            spot_details = itemView.findViewById(R.id.spot_details);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            summary_details = itemView.findViewById(R.id.summary_details);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

+ 254 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SummaryReportContentAdapter.java

@@ -0,0 +1,254 @@
+package cn.muchinfo.rma.view.base.home.reportquery.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 java.util.ArrayList;
+import java.util.List;
+
+import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.AreaSumPLData;
+import cn.muchinfo.rma.global.data.FinanceReportData;
+import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
+import cn.muchinfo.rma.view.base.app.Constant;
+import cn.muchinfo.rma.view.base.home.reportquery.reportdetail.ReportCommonDetailsActivity;
+import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
+
+/**
+ * 财务报表adapter
+ */
+public class SummaryReportContentAdapter extends RecyclerView.Adapter<SummaryReportContentAdapter.ItemViewHolder> {
+
+    private Context context;
+    private List<AreaSumPLData> datas;
+    private String listType;
+    private int index = -1;
+    private int position = -1;
+    private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
+    public int offestX = 0;
+    private OnContentScrollListener onContentScrollListener;
+    //1是财务报表,2是敞口报表 3是现货报表 4是库存报表 5是汇总损益表
+    private String type;
+
+    //---------------往下级传的参数----------------
+    private String time;//时间日期
+    private String timeType = "1";//日明细,周/月明细 默认是日
+    private String transaction;//交易用户名称
+    private String transactionUserid;//选择的交易用户id
+    private String tabtitle;//列头
+
+    public void setTime(String time){
+        this.time = time;
+    }
+
+    public void setTimeType(String timeType){
+        this.timeType = timeType;
+    }
+
+    public void setTransaction(String transaction){
+        this.transaction = transaction;
+    }
+
+    public void setTransactionUserid(String transactionUserid){
+        this.transactionUserid = transactionUserid;
+    }
+
+    public void setTabtitle(String tabtitle){
+        this.tabtitle = tabtitle;
+    }
+
+
+    public interface OnContentScrollListener {
+        void onScroll(MotionEvent event);
+    }
+
+    public void setOnContentScrollListener(OnContentScrollListener onContentScrollListener) {
+        this.onContentScrollListener = onContentScrollListener;
+    }
+
+
+    public SummaryReportContentAdapter(Context context, String type) {
+        this.context = context;
+        this.listType = listType;
+        this.type = type;
+    }
+
+    public void setDatas(List<AreaSumPLData> 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.exposure_report_layout_item_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).getCurrencyname());
+//        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
+        //右边滑动部分
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
+        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        itemViewHolder.rvItemRight.setLayoutManager(linearLayoutManager);
+        itemViewHolder.rvItemRight.setHasFixedSize(true);
+        RightScrollAdapter rightScrollAdapter = new RightScrollAdapter(context);
+        rightScrollAdapter.setDatas(datas.get(i).getRightData());
+        itemViewHolder.rvItemRight.setAdapter(rightScrollAdapter);
+        //缓存当前holder
+        if (!mViewHolderList.contains(itemViewHolder)) {
+            mViewHolderList.add(itemViewHolder);
+        }
+        itemViewHolder.allView.setVisibility(View.GONE);
+
+        if (i == this.position) {
+            itemViewHolder.roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
+            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(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                setPosition(i);
+            }
+        });
+        if (type.equals("2")){
+            itemViewHolder.invoice_register.setVisibility(View.VISIBLE);
+            itemViewHolder.midpoints_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.settlement_of_registration.setVisibility(View.VISIBLE);
+            itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
+        }else if (type.equals("1")){
+            itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+        }else if (type.equals("5")){
+            itemViewHolder.summary_details.setVisibility(View.VISIBLE);
+        }
+        //财务明细
+        itemViewHolder.summary_details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("title","汇总损益表明细");
+            intent.putExtra("time",this.time);
+            intent.putExtra("transaction",this.transaction);
+            if (this.timeType.equals("1")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_sumprofit_detail);
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_sumprofit);
+            }
+            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
+            intent.putExtra("middlegoodsid","");
+            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+
+        itemViewHolder.load_more.setOnClickListener(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 details;//详情
+        TextView invoice_register;//现货合同明细
+        TextView midpoints_registration;//参数调整明细
+        TextView settlement_of_registration;//期货明细
+        TextView payment_registration;//套保计划明细
+        TextView warehouse_register;//财务明细
+        TextView summary_details;//损益明细
+        ImageView load_more;//更多
+        LinearLayout allView;//隐藏的底部操作空间
+        LinearLayout all_click_View;//item左侧点击控件
+        TextView tvLeftTitle;//左边销售方字段
+        TextView tv_left_bottom_title;//合同编号
+        RecyclerView rvItemRight;//右方的列表
+        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);
+            midpoints_registration = itemView.findViewById(R.id.midpoints_registration);
+            settlement_of_registration = itemView.findViewById(R.id.settlement_of_registration);
+            payment_registration = itemView.findViewById(R.id.payment_registration);
+            warehouse_register = itemView.findViewById(R.id.warehouse_register);
+            load_more = itemView.findViewById(R.id.load_more);
+            tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
+            summary_details = itemView.findViewById(R.id.summary_details);
+            rvItemRight = itemView.findViewById(R.id.rv_item_right);
+            horItemScrollview = itemView.findViewById(R.id.hor_item_scrollview);
+            allView = itemView.findViewById(R.id.all_view);
+            tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            all_click_View = itemView.findViewById(R.id.all_click_View);
+            invoice_register = itemView.findViewById(R.id.invoice_register);
+
+            roots_view = itemView.findViewById(R.id.roots_view);
+        }
+    }
+}

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

@@ -15,7 +15,7 @@
 //import cn.muchinfo.rma.view.autoWidget.*
 //import cn.muchinfo.rma.view.base.BaseActivity
 //import cn.muchinfo.rma.view.base.home.contract.emptyView
-//import cn.muchinfo.rma.view.base.home.reportquery.ExposureReportContentAdapter
+//import cn.muchinfo.rma.view.base.home.reportquery.adapter.ExposureReportContentAdapter
 //import cn.muchinfo.rma.view.base.home.reportquery.ReportQueryViewModel
 //import cn.muchinfo.rma.view.base.procurement.TopTabAdpater
 //import com.blankj.utilcode.util.SizeUtils

+ 5 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsActivity.kt

@@ -51,6 +51,11 @@ class ReportCommonDetailsActivity : BaseActivity<ReportCommonDetailsViewModel>()
         intent.getStringExtra("middlegoodsid")
     }
 
+    //查询财务报表日报表明细时需要用到currencyid
+    private val currencyid by lazy {
+        intent.getStringExtra("currencyid")
+    }
+
     //列表头部表头adapter
     val topAdapter by lazy {
         TopTabAdpater(this)

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

@@ -1,10 +1,7 @@
 package cn.muchinfo.rma.view.base.home.reportquery.reportdetail
 
 import androidx.lifecycle.MutableLiveData
-import cn.muchinfo.rma.global.data.AreaExpourseContractDetailData
-import cn.muchinfo.rma.global.data.ColumnsData
-import cn.muchinfo.rma.global.data.ExposureReportData
-import cn.muchinfo.rma.global.data.ReportCommonDetailData
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
@@ -29,7 +26,7 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
      * 请求该页面的列头
      * @param tabName String
      */
-    fun queryTitle(tabName : String,tradedate: String = "",userid : String = "",querytype : String = "",cycletype : String = "",middlegoodsid : String = ""){
+    fun queryTitle(tabName : String,tradedate: String = "",userid : String = "",querytype : String = "",cycletype : String = "",middlegoodsid : String = "",currencyid : String = ""){
         val params = mutableMapOf<String, String>().apply {
             put("tableKey", tabName)
             put("tableType", "3")
@@ -42,12 +39,12 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
                 })
                 exposureReportTitle.postValue(newlist)
                 //TODO 根据不同的taName进行不同的接口调用
-                queryListByTabName(tabName, tradedate, userid, querytype, cycletype,middlegoodsid )
+                queryListByTabName(tabName, tradedate, userid, querytype, cycletype,middlegoodsid ,currencyid)
             }
         }
     }
 
-    fun queryListByTabName(tabName : String,tradedate: String = "",userid : String = "",querytype : String = "",cycletype : String = "",middlegoodsid : String = ""){
+    fun queryListByTabName(tabName : String,tradedate: String = "",userid : String = "",querytype : String = "",cycletype : String = "",middlegoodsid : String = "",currencyid : String = ""){
         if (tabName == Constant.table_mobile_report_expose_spotcontract){//查询敞口合同明细(敞口报表/现货合同明细) QryAreaExpourseContractDetail
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
@@ -83,6 +80,56 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
                     exposureReportDataList.postValue(resetAreaExpourseHedgeplanDetail(respData ?: arrayListOf()))
                 }
             }
+        } else if (tabName == Constant.table_mobile_report_fincial){//财务月报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("querytype",querytype)
+                put("tradedate", tradedate)
+            }
+
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    exposureReportDataList.postValue(getReportDayFanacelRightData(respData ?: arrayListOf(),"1"))
+                }
+            }
+        } else if (tabName == Constant.table_mobile_report_fincial_detail){//财务报表日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("querytype","4")//日报表明细
+                put("tradedate", tradedate)
+                put("currencyid",currencyid)
+            }
+
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    exposureReportDataList.postValue(getReportDayFanacelRightData(respData ?: arrayListOf(),"4"))
+                }
+            }
+        }else if(tabName == Constant.table_mobile_report_sumprofit){//汇总损益报表月报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("querytype",querytype)
+                put("tradedate", tradedate)
+            }
+
+            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    exposureReportDataList.postValue(getReportDaySummaryRightData(respData ?: arrayListOf(),"1"))
+                }
+            }
+        }else if(tabName == Constant.table_mobile_report_sumprofit_detail){//汇总损益报表日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("querytype","4")//日报表明细
+                put("tradedate", tradedate)
+                put("currencyid",currencyid)
+            }
+
+            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
+                if (isSuccess){
+                    exposureReportDataList.postValue(getReportDaySummaryRightData(respData ?: arrayListOf(),"4"))
+                }
+            }
         }
     }
 
@@ -122,6 +169,75 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
         return newList
     }
 
+
+    /**
+     * 汇总损益组装右部数据
+     * @param respData List<RealExposureData>
+     * @return List<RealExposureData>
+     */
+    private fun getReportDaySummaryRightData(respData: List<AreaSumPLData>,type: String) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        respData.forEach {
+            val data = ReportCommonDetailData()
+
+            val newRightData = arrayListOf<String>()
+            if (type == "4"){
+                //'结算币种/\n 套保品种 '
+                data.leftContent = it.currencyname  + "\n" + it.middlegoodsid//TODO 这里是显示名称,不是id,需要后台提供
+            }else{
+                data.leftContent = it.currencyname ?: ""
+            }
+            //'现货损益/\n 现货浮动损益 '
+            newRightData.add(it.spotactualpl + "\n" + it.spotfloatpl)
+            //'期货损益/\n 期货浮动损益 '
+            newRightData.add(it.futureactualpl + "\n" + it.futurefloatpl)
+            //'实际损益/\n 汇总损益 '
+            newRightData.add(it.sumactualpl + "\n" + it.sumpl)
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+
+    /**
+     * 财务组装右部数据
+     * @param respData List<RealExposureData>
+     * @return List<RealExposureData>
+     */
+    private fun getReportDayFanacelRightData(respData: List<FinanceReportData>,type: String) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        respData.forEach {
+            val data = ReportCommonDetailData()
+            data.leftContent = it.currencyname ?: ""
+            val newRightData = arrayListOf<String>()
+            if (type == "4"){
+                //'现货品种/\n 现货品类 '
+                newRightData.add(it.deliverygoodsid + "\n" + it.wrstandardid)//TODO 这里是显示名称,不是id,需要后台提供
+            }
+            //今付贷款额/\n 今收退款额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodaysettleamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodayrefundamount),2) + it.currencyname)
+            //'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.selltodaysettleamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2) + it.currencyname)
+            //'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buytodayinvoiceamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2) + it.currencyname)
+            //预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyprepaidamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyunpaidamount),2) + it.currencyname)
+            //'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buypreinvoicedamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.buyuninvoicedamount),2) + it.currencyname)
+            //''预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellprepaidamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellunpaidamount),2) + it.currencyname)
+            //'预开票额/\n 应开票额
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.sellpreinvoicedamount),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.selluninvoicedamount),2) + it.currencyname)
+            //'今收款合计/\n 今付款合计'
+            newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todayreceivesum),2) + it.currencyname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.todaypaysum),2) + it.currencyname)
+
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
     /**
      * 敞口组装右部数据
      * @param respData List<RealExposureData>

+ 29 - 2
RMA/app/src/main/res/layout/exposure_report_layout_item_content.xml

@@ -76,6 +76,7 @@
         android:gravity="end|center_vertical"
         android:orientation="horizontal">
         <TextView
+            android:visibility="gone"
             android:id="@+id/midpoints_registration"
             android:layout_marginEnd="10dp"
             android:gravity="center"
@@ -87,6 +88,7 @@
             android:background="@drawable/rma_item_click_bg"/>
 
         <TextView
+            android:visibility="gone"
             android:id="@+id/settlement_of_registration"
             android:layout_marginEnd="10dp"
             android:gravity="center"
@@ -98,6 +100,7 @@
             android:background="@drawable/rma_item_click_bg"/>
 
         <TextView
+            android:visibility="gone"
             android:id="@+id/payment_registration"
             android:layout_marginEnd="10dp"
             android:gravity="center"
@@ -109,7 +112,7 @@
             android:background="@drawable/rma_item_click_bg"/>
 
         <TextView
-
+            android:visibility="gone"
             android:id="@+id/invoice_register"
             android:layout_marginEnd="10dp"
             android:gravity="center"
@@ -128,7 +131,31 @@
             android:textSize="12sp"
             android:layout_width="70dp"
             android:layout_height="25dp"
-            android:text="发票登记"
+            android:text="财务明细"
+            android:textColor="@color/rma_blue_color"
+            android:background="@drawable/rma_item_click_bg"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/summary_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"/>
+
+        <TextView
+            android:visibility="gone"
+            android:id="@+id/spot_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"/>