|
|
@@ -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)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|