Jelajahi Sumber

风险管理5月30日提交代码-liu.bolan--报表

Liu.bolan 4 tahun lalu
induk
melakukan
848b5e4062
24 mengubah file dengan 2022 tambahan dan 722 penghapusan
  1. 2 1
      RMA/app/src/main/AndroidManifest.xml
  2. 1 1
      RMA/app/src/main/java/cn/muchinfo/rma/business/report/ReportManager.kt
  3. 27 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/ViewEnumUtils.kt
  4. 4 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaExpourseContractDetailData.kt
  5. 181 50
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaSpotplReportData.kt
  6. 7 0
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaStockReportData.kt
  7. 76 15
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/AreaSumPLData.kt
  8. 147 1
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/ExposureReportData.kt
  9. 136 30
      RMA/app/src/main/java/cn/muchinfo/rma/global/data/FinanceReportData.kt
  10. 2 2
      RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt
  11. 65 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/app/Constant.kt
  12. 97 46
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/InventoryRecordAdapter.java
  13. 460 349
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryActivity.kt
  14. 141 101
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/ReportQueryViewModel.kt
  15. 25 11
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java
  16. 39 9
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/FanacelReportContentAdapter.java
  17. 16 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SpotReportContentAdapter.java
  18. 15 7
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/SummaryReportContentAdapter.java
  19. 3 3
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/RecordDetailsAdapter.java
  20. 34 13
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsActivity.kt
  21. 511 62
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/ReportCommonDetailsViewModel.kt
  22. 2 0
      RMA/app/src/main/java/cn/muchinfo/rma/view/base/main/castsurely/MyCastSurelyViewHolder.kt
  23. 15 1
      RMA/app/src/main/res/layout/exposure_report_layout_item_content.xml
  24. 16 2
      RMA/app/src/main/res/layout/layout_item_inventory_current.xml

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

@@ -162,7 +162,8 @@
             android:windowSoftInputMode="adjustPan" />
         <activity android:name=".view.base.home.tradingquery.TradingQueryActivity"/>
 
-        <activity android:name=".view.base.home.reportquery.ReportQueryActivity"/>
+        <activity android:name=".view.base.home.reportquery.ReportQueryActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize"/>
 
         <activity android:name=".view.base.exposure.RealTimeExposureDetailsActivity"/>
 

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

@@ -250,7 +250,7 @@ class ReportManager {
         responseBack: (isSuccess: Boolean, respData: List<AreaSpotplReportData>?, error: Error?) -> Unit
     ){
         MyOkHttpUtils().query(
-            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryAreaSpotplReport\n",
+            URL = SPUtils.getInstance().getString(Constant.goCommonSearchUrl) + "/Ermcp3/QryAreaSpotplReport",
             params = params,
             type = "1",
             callback = object : ResponseCallback<BaseResult<List<AreaSpotplReportData>>>(){

+ 27 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/ViewEnumUtils.kt

@@ -105,6 +105,33 @@ object ViewEnumUtils {
         }
     }
 
+    //套保计划状态
+    fun getHedgeplanstatus(type: String): String {
+        return when (type) {
+            "1" -> {
+                "未提交"
+            }
+            "2" -> {
+                "待审核"
+            }
+            "3" -> {
+                "执行中"
+            }
+            "4" -> {
+                "正常完结"
+            }
+            "5" -> {
+                "审核拒绝"
+            }
+            "6" -> {
+                "异常完结"
+            }
+            else -> {
+                "已撤回"
+            }
+        }
+    }
+
     /**
      * 敞口-现货头寸-现货明细-type
      * @param contracttype String

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

@@ -31,6 +31,10 @@ data class AreaExpourseContractDetailData(
     val changqty : String = "",//应套保总量变化量
     val hedgeplanid : String = "",//套保计划id
     val hedgeplanno : String = "",//套保计划编号
+    val brandname : String = "",//品牌名称
+    val deliverygoodscode : String = "",//现货商品代码
+    val deliverygoodsname : String = "",//现货商品名称
+    val hedgeplanstatus : String = "",//套保计划状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
     val mgunitidname : String = ""//单位名称(套保商品)
 
 )

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

@@ -1,55 +1,186 @@
 package cn.muchinfo.rma.global.data
 
+import android.os.Parcel
+import android.os.Parcelable
+
 //新版现货报表实体
 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 = "",//品类名称
+    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? = "",//品类名称
+    val begindate : String? = "",//开始交易日
+    val enddate : String? = "",//结束交易日
     var rightData : List<String>? = arrayListOf()//组装的右侧数据
-)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(accountid)
+        parcel.writeString(accountname)
+        parcel.writeString(actualpl)
+        parcel.writeString(areauserid)
+        parcel.writeString(biztype)
+        parcel.writeString(brandname)
+        parcel.writeString(curamount)
+        parcel.writeString(curaverageprice)
+        parcel.writeString(curbuyamount)
+        parcel.writeString(curbuyqty)
+        parcel.writeString(curmarketvalue)
+        parcel.writeString(curqty)
+        parcel.writeString(currencyid)
+        parcel.writeString(currencyname)
+        parcel.writeString(cursellamount)
+        parcel.writeString(cursellqty)
+        parcel.writeString(curspotprice)
+        parcel.writeString(cycletime)
+        parcel.writeString(cycletype)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(enumdicname)
+        parcel.writeString(floatpl)
+        parcel.writeString(goodsunitid)
+        parcel.writeString(oriamount)
+        parcel.writeString(oriaverageprice)
+        parcel.writeString(oribuyamount)
+        parcel.writeString(oribuyqty)
+        parcel.writeString(oriqty)
+        parcel.writeString(orisellamount)
+        parcel.writeString(orisellqty)
+        parcel.writeString(reckondate)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(todaybuyamount)
+        parcel.writeString(todaybuyaverageprice)
+        parcel.writeString(todaybuyqty)
+        parcel.writeString(todayinqty)
+        parcel.writeString(todayoutqty)
+        parcel.writeString(todaysellamount)
+        parcel.writeString(todaysellaverageprice)
+        parcel.writeString(todaysellqty)
+        parcel.writeString(unitid)
+        parcel.writeString(unitidname)
+        parcel.writeString(updatetime)
+        parcel.writeString(wrfactortypeid)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(wrstandardname)
+        parcel.writeString(begindate)
+        parcel.writeString(enddate)
+        parcel.writeStringList(rightData)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaSpotplReportData> {
+        override fun createFromParcel(parcel: Parcel): AreaSpotplReportData {
+            return AreaSpotplReportData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaSpotplReportData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -39,6 +39,9 @@ data class AreaStockReportData(
     val diffqty : String? = "",//库存变化量 = 期末 - 期初
     val reckondate : String? = "",//日照时期(yyyyMMdd)
     val unbuyinqty : String? = "",//采购未入库量(数据库未找到相关字段?)
+    val begindate : String? = "",//开始交易日
+    val enddate : String? = "",//结束交易日
+
     val unselloutqty : String? = ""//销售未出库量(数据库未找到相关字段?)
 ) : Parcelable{
     constructor(parcel: Parcel) : this(
@@ -74,6 +77,8 @@ data class AreaStockReportData(
         parcel.readString(),
         parcel.readString(),
         parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
         parcel.readString()
     ) {
     }
@@ -111,6 +116,8 @@ data class AreaStockReportData(
         parcel.writeString(diffqty)
         parcel.writeString(reckondate)
         parcel.writeString(unbuyinqty)
+        parcel.writeString(begindate)
+        parcel.writeString(enddate)
         parcel.writeString(unselloutqty)
     }
 

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

@@ -1,20 +1,81 @@
 package cn.muchinfo.rma.global.data
 
+import android.os.Parcel
+import android.os.Parcelable
+
 //查询汇总损益表
 data class AreaSumPLData(
-    val areauserid :String = "",//所属机构\交易用户ID
-    val currencyid :String = "",//结算币种ID
-    val currencyname : String = "",//币种名称
-    val cycletime : String = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
-    val cycletype : String = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    val futureactualpl : String = "",//期货损益
-    val futurefloatpl : String = "",//期货浮动损益
-    val middlegoodsid : String = "",//套保品种ID(SEQ_ERMS_MIDDLEGOODS)
-    val reckondate : String = "",//日照时期(yyyyMMdd)
-    val spotactualpl : String = "",//现货损益
-    val spotfloatpl : String = "",//现货浮动损益
-    val sumactualpl : String = "",//实际损益 = (ActualPL + FutureActualPL)
-    val sumpl : String = "",//汇总损益
-    val updatetime : String = "",//更新时间
+    val areauserid :String? = "",//所属机构\交易用户ID
+    val currencyid :String? = "",//结算币种ID
+    val currencyname : String? = "",//币种名称
+    val cycletime : String? = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+    val cycletype : String? = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    val futureactualpl : String? = "",//期货损益
+    val futurefloatpl : String? = "",//期货浮动损益
+    val middlegoodsid : String? = "",//套保品种ID(SEQ_ERMS_MIDDLEGOODS)
+    val reckondate : String? = "",//日照时期(yyyyMMdd)
+    val spotactualpl : String? = "",//现货损益
+    val spotfloatpl : String? = "",//现货浮动损益
+    val sumactualpl : String? = "",//实际损益 = (ActualPL + FutureActualPL)
+    val sumpl : String? = "",//汇总损益
+    val updatetime : String? = "",//更新时间
+    val begindate : String? = "",//开始交易日
+    val enddate : String? = "",//结束交易日
     var rightData : List<String>? = arrayListOf()//组装的右侧数据
-)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(currencyid)
+        parcel.writeString(currencyname)
+        parcel.writeString(cycletime)
+        parcel.writeString(cycletype)
+        parcel.writeString(futureactualpl)
+        parcel.writeString(futurefloatpl)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(reckondate)
+        parcel.writeString(spotactualpl)
+        parcel.writeString(spotfloatpl)
+        parcel.writeString(sumactualpl)
+        parcel.writeString(sumpl)
+        parcel.writeString(updatetime)
+        parcel.writeString(begindate)
+        parcel.writeString(enddate)
+        parcel.writeStringList(rightData)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AreaSumPLData> {
+        override fun createFromParcel(parcel: Parcel): AreaSumPLData {
+            return AreaSumPLData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AreaSumPLData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+}

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

@@ -1,5 +1,8 @@
 package cn.muchinfo.rma.global.data
 
+import android.os.Parcel
+import android.os.Parcelable
+
 /**
  * 敞口报表数据
  */
@@ -60,5 +63,148 @@ data class ExposureReportData(
     val oritotalfutureqty : String? = "",//期初期货头寸总量
     val oritotalneedhedgeqty : String? = "",//期初应套保总量
     val unitid : String? = "",//单位id
+    val begindate : String? = "",//开始交易日
+    val enddate : String? = "",//结束交易日
     val updatetime : String? = ""//更新时间
-)
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(buyfutureqty)
+        parcel.writeString(buyplanqty)
+        parcel.writeString(buypricedqty)
+        parcel.writeString(diffFutuQty)
+        parcel.writeString(diffSpotQty)
+        parcel.writeString(enumdicname)
+        parcel.writeString(middlegoodscode)
+        parcel.writeString(middlegoodshedgeratio)
+        parcel.writeString(middlegoodsid)
+        parcel.writeString(middlegoodsname)
+        parcel.writeString(needhedgeexposoure)
+        parcel.writeString(needhedgeratio)
+        parcel.writeString(oriTotalFutuQty)
+        parcel.writeString(oriTotalSpotQty)
+        parcel.writeString(oribuyfutureqty)
+        parcel.writeString(oribuyplanqty)
+        parcel.writeString(oribuypricedqty)
+        parcel.writeString(orisellfutureqty)
+        parcel.writeString(orisellplanqty)
+        parcel.writeString(orisellpricedqty)
+        parcel.writeString(reckondate)
+        parcel.writeString(sellfutureqty)
+        parcel.writeString(sellplanqty)
+        parcel.writeString(sellpricedqty)
+        parcel.writeString(totalexposure)
+        parcel.writeString(totalfutureqty)
+        parcel.writeString(totalhedgeratio)
+        parcel.writeString(totalneedhedgeqty)
+        parcel.writeString(totalspotqty)
+        parcel.writeStringList(rightData)
+        parcel.writeString(accountid)
+        parcel.writeString(accountname)
+        parcel.writeString(arbitrageqty)
+        parcel.writeString(cycletime)
+        parcel.writeString(cycletype)
+        parcel.writeString(diffexposure)
+        parcel.writeString(diffhedgeqty)
+        parcel.writeString(diffmgqtya)
+        parcel.writeString(diffmgqtyb)
+        parcel.writeString(diffqty)
+        parcel.writeString(hedgeqty)
+        parcel.writeString(mgneedhedgeratio)
+        parcel.writeString(middlgoodscode)
+        parcel.writeString(needarbitrageqty)
+        parcel.writeString(needarbitrageratio)
+        parcel.writeString(needhedgeqty)
+        parcel.writeString(oriarbitrageqty)
+        parcel.writeString(orihedgeqty)
+        parcel.writeString(orineedarbitrageqty)
+        parcel.writeString(orineedhedgeexposoure)
+        parcel.writeString(orineedhedgeqty)
+        parcel.writeString(oritotalexposure)
+        parcel.writeString(oritotalfutureqty)
+        parcel.writeString(oritotalneedhedgeqty)
+        parcel.writeString(unitid)
+        parcel.writeString(begindate)
+        parcel.writeString(enddate)
+        parcel.writeString(updatetime)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<ExposureReportData> {
+        override fun createFromParcel(parcel: Parcel): ExposureReportData {
+            return ExposureReportData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<ExposureReportData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

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

@@ -1,33 +1,139 @@
 package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
 //查询财务报表
 data class FinanceReportData(
-    val areauserid: String = "",//所属机构\交易用户ID
-    val biztype: String = "",//业务类型 - 1:套保 2:套利
-    val buypreinvoicedamount: String = "",//采购预收票额(预收票额)
-    val buyprepaidamount: String = "",//采购预付款额(预付货款额)
-    val buytodayinvoiceamount: String = "",//采购今收票额(今收票额)
-    val buytodayrefundamount: String = "",//采购今收退款额(今收退款额)
-    val buytodaysettleamount: String = "",//采购今付款额(今付货款额)
-    val buyuninvoicedamount: String = "",//采购应收票额(应收票额)
-    val buyunpaidamount: String = "",//采购应付款额(应付货款额)
-    val currencyid: String = "",//结算币种ID
-    val currencyname: String = "",//币种名称
-    val cycletime: String = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
-    val cycletype: String = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    val deliverygoodsid: String = "",//现货品种ID
-    val reckondate: String = "",//日照时期(yyyyMMdd)
-    val sellpreinvoicedamount: String = "",//销售预开票额(预开票额)
-    val sellprepaidamount: String = "",//销售预收款额(预收货款额)
-    val selltodayinvoiceamount: String = "",//销售今开票额(今开票额)
-    val selltodayrefundamount: String = "",//销售今付退款额(今付退款额)
-    val selltodaysettleamount: String = "",//销售今收款额(今收货款额)
-    val selluninvoicedamount: String = "",//销售应开票额(应开票额)
-    val sellunpaidamount: String = "",//销售应收款额(应收货款额)
-    val spotgoodsbrandid: String = "",//现货品牌ID
-    val todaypaysum: String = "",//今付款合计
-    val todayreceivesum: String = "",//今收款合计
-    val updatetime: String = "",//更新时间
-    val wrfactortypeid: String = "",//仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
-    val wrstandardid: String = "",//现货商品ID
-    var rightData : List<String>? = arrayListOf()//组装的右侧数据
-)
+    val areauserid: String? = "",//所属机构\交易用户ID
+    val biztype: String? = "",//业务类型 - 1:套保 2:套利
+    val buypreinvoicedamount: String? = "",//采购预收票额(预收票额)
+    val buyprepaidamount: String? = "",//采购预付款额(预付货款额)
+    val buytodayinvoiceamount: String? = "",//采购今收票额(今收票额)
+    val buytodayrefundamount: String? = "",//采购今收退款额(今收退款额)
+    val buytodaysettleamount: String? = "",//采购今付款额(今付货款额)
+    val buyuninvoicedamount: String? = "",//采购应收票额(应收票额)
+    val buyunpaidamount: String? = "",//采购应付款额(应付货款额)
+    val currencyid: String? = "",//结算币种ID
+    val currencyname: String? = "",//币种名称
+    val cycletime: String? = "",//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+    val cycletype: String? = "",//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    val deliverygoodsid: String? = "",//现货品种ID
+    val reckondate: String? = "",//日照时期(yyyyMMdd)
+    val sellpreinvoicedamount: String? = "",//销售预开票额(预开票额)
+    val sellprepaidamount: String? = "",//销售预收款额(预收货款额)
+    val selltodayinvoiceamount: String? = "",//销售今开票额(今开票额)
+    val selltodayrefundamount: String? = "",//销售今付退款额(今付退款额)
+    val selltodaysettleamount: String? = "",//销售今收款额(今收货款额)
+    val selluninvoicedamount: String? = "",//销售应开票额(应开票额)
+    val sellunpaidamount: String? = "",//销售应收款额(应收货款额)
+    val spotgoodsbrandid: String? = "",//现货品牌ID
+    val todaypaysum: String? = "",//今付款合计
+    val todayreceivesum: String? = "",//今收款合计
+    val updatetime: String? = "",//更新时间
+    val wrfactortypeid: String? = "",//仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+    val wrstandardid: String? = "",//现货商品ID
+    val begindate : String? = "",//开始交易日
+    val brandname : String? = "",//品牌名称
+    val deliverygoodscode : String? = "",//现货品种代码
+    val deliverygoodsname : String? = "",//现货品种名称
+    val enddate : String? = "",//结束交易日
+    val wrstandardcode : String? = "",//品类代码
+    val wrstandardname : String? = "",//品类名称
+    var rightData : List<String?>? = arrayListOf()//组装的右侧数据
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.createStringArrayList()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(biztype)
+        parcel.writeString(buypreinvoicedamount)
+        parcel.writeString(buyprepaidamount)
+        parcel.writeString(buytodayinvoiceamount)
+        parcel.writeString(buytodayrefundamount)
+        parcel.writeString(buytodaysettleamount)
+        parcel.writeString(buyuninvoicedamount)
+        parcel.writeString(buyunpaidamount)
+        parcel.writeString(currencyid)
+        parcel.writeString(currencyname)
+        parcel.writeString(cycletime)
+        parcel.writeString(cycletype)
+        parcel.writeString(deliverygoodsid)
+        parcel.writeString(reckondate)
+        parcel.writeString(sellpreinvoicedamount)
+        parcel.writeString(sellprepaidamount)
+        parcel.writeString(selltodayinvoiceamount)
+        parcel.writeString(selltodayrefundamount)
+        parcel.writeString(selltodaysettleamount)
+        parcel.writeString(selluninvoicedamount)
+        parcel.writeString(sellunpaidamount)
+        parcel.writeString(spotgoodsbrandid)
+        parcel.writeString(todaypaysum)
+        parcel.writeString(todayreceivesum)
+        parcel.writeString(updatetime)
+        parcel.writeString(wrfactortypeid)
+        parcel.writeString(wrstandardid)
+        parcel.writeString(begindate)
+        parcel.writeString(brandname)
+        parcel.writeString(deliverygoodscode)
+        parcel.writeString(deliverygoodsname)
+        parcel.writeString(enddate)
+        parcel.writeString(wrstandardcode)
+        parcel.writeString(wrstandardname)
+        parcel.writeStringList(rightData)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<FinanceReportData> {
+        override fun createFromParcel(parcel: Parcel): FinanceReportData {
+            return FinanceReportData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<FinanceReportData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

+ 2 - 2
RMA/app/src/main/java/cn/muchinfo/rma/view/autoWidget/dialog/Dialog.kt

@@ -197,7 +197,7 @@ fun AppCompatActivity.creatGoodsHedgeBottomSheetDialog(
 /**
  * 查询单据用的时间选择器
  * @receiver AppCompatActivity
- * type 1 是选择年月日 2 是选择年月
+ * type 1 是选择年月日 2 是选择年月  3是选择周,但是传给后台也实际就是年月日所以返回和日报表一样的时间
  * @param selectTime [@kotlin.ExtensionFunctionType] Function1<String, Unit>?
  */
 @RequiresApi(Build.VERSION_CODES.N)
@@ -209,7 +209,7 @@ fun AppCompatActivity.showDataSelectDialog(
     DatePickerDialog(
         this,
         DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->
-            if (type == "1") {
+            if (type == "1" || type == "3") {
                 selectTime?.invoke("$year-${monthOfYear.monthformatting()}-$dayOfMonth")//月份要加1
             } else {
                 selectTime?.invoke("$year-${monthOfYear.monthformatting()}")//月份要加1

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

@@ -9,8 +9,8 @@ object Constant {
 //    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.30.211:8080/cfg?key=test_211"// 瑶姐
+//    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"
 //    const val baseurl = "http://192.168.31.174:8080/cfg?key=test_174"// 邓工
@@ -93,12 +93,6 @@ 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"
 
@@ -114,9 +108,6 @@ object Constant {
     /** 报表-敞口报表-套保计划变动量明细 **/
     const val table_mobile_report_expose_hedgeplan = "table_mobile_report_expose_hedgeplan"
 
-    /** 现货报表 **/
-    const val table_mobile_report_spot = "table_mobile_report_spot"
-
     /** 现货报表明细 **/
     const val table_mobile_report_spot_detail = "table_mobile_report_spot_detail"
 
@@ -141,6 +132,69 @@ object Constant {
     /** 现货损益报表 **/
     const val table_mobile_report_spot_profit = "table_mobile_report_spot_profit"
 
+    //-------------------------------损益报表----------------------------
+    /** 报表-汇总损益报表 **/
+    const val table_mobile_report_sumprofit = "table_mobile_report_sumprofit"
+
+    /** 报表-汇总损益报表-日报表明细 **/
+    const val table_mobile_report_sumprofit_daydetail = "table_mobile_report_sumprofit_daydetail"
+
+    /** 报表-汇总损益报表-周月报表明细 **/
+    const val table_mobile_report_sumprofit_weekmonthdetail = "table_mobile_report_sumprofit_weekmonthdetail"
+
+    //-------------------------------现货报表-----------------------------
+    /** 报表-现货报表 **/
+    const val table_mobile_report_spot = "table_mobile_report_spot"
+
+    /** 报表-现货报表-日报表明细 **/
+    const val table_mobile_report_spot_daydetail = "table_mobile_report_spot_daydetail"
+
+    /** 报表-现货报表-周月报表明细 */
+    const val table_mobile_report_spot_weekmonthdetail = "table_mobile_report_spot_weekmonthdetail"
+
+
+    //-------------------------------财务报表------------------------------
+    /** 报表-财务报表 **/
+    const val table_mobile_report_fincial = "table_mobile_report_fincial"
+
+    /** 报表-财务报表-品类日报表明细 **/
+    const val table_mobile_report_fincial_wrstandard_daydetail = "table_mobile_report_fincial_wrstandard_daydetail"
+
+    /** 报表-财务报表-品类周月报表明细 **/
+    const val table_mobile_report_fincial_wrstandard_weekmonthdetail = "table_mobile_report_fincial_wrstandard_weekmonthdetail"
+
+    /** 报表-财务报表-品牌日报表明细 **/
+    const val table_mobile_report_fincial_brand_daydetail = "table_mobile_report_fincial_brand_daydetail"
+
+    /** 报表-财务报表-品牌周月报表明细 **/
+    const val table_mobile_report_fincial_brand_weekmonthdetail = "table_mobile_report_fincial_brand_weekmonthdetail"
+
+    //-------------------------------库存报表--------------------------------
+
+    /** 库存报表 品类 ***/
+    const val table_mobile_report_wrstandstock = "table_mobile_report_wrstandstock"
+
+    /** 报表-库存报表(品类维度)_仓库日报表明细 ***/
+    const val table_mobile_report_wrstandstock_warehouse_daydetail = "table_mobile_report_wrstandstock_warehouse_daydetail"
+
+    /** 报表-库存报表(品类维度)_仓库周月报表明细 ***/
+    const val table_mobile_report_wrstandstock_warehouse_weekmonthdetail = "table_mobile_report_wrstandstock_warehouse_weekmonthdetail"
+
+    /** 报表-库存报表-(品类维度)_品牌日报表明细 **/
+    const val table_mobile_report_wrstandstock_brand_daydetail = "table_mobile_report_wrstandstock_brand_daydetail"
+
+    /** 报表-库存报表-(品类维度)_品牌周月报表明细 **/
+    const val table_mobile_report_wrstandstock_brand_weekmonthdetail = "table_mobile_report_wrstandstock_brand_weekmonthdetail"
+
+    /** 报表-库存报表-(仓库维度) **/
+    const val table_mobile_report_warehousestock = "table_mobile_report_warehousestock"
+
+    /** 报表-库存报表-(仓库维度)_日报表明细 ***/
+    const val table_mobile_report_warehousestock_daydetail = "table_mobile_report_warehousestock_daydetail"
+
+    /** 报表-库存报表-(仓库维度)_周月报表明细 **/
+    const val table_mobile_report_warehousestock_weekmonthdetail = "table_mobile_report_warehousestock_weekmonthdetail"
+
     /**--------------------------------------------------------------------------------------**/
 
     const val FISTOPENAPP = "first_open_app"

+ 97 - 46
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/InventoryRecordAdapter.java

@@ -23,11 +23,16 @@ import java.util.List;
 
 import cn.muchinfo.rma.R;
 import cn.muchinfo.rma.global.ViewEnumUtils;
+import cn.muchinfo.rma.global.data.AreaSpotplReportData;
 import cn.muchinfo.rma.global.data.AreaStockApplyData;
 import cn.muchinfo.rma.global.data.AreaStockReportData;
+import cn.muchinfo.rma.global.data.AreaSumPLData;
+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.inventory.inventorymanager.InventoryDetailsActivity;
+import cn.muchinfo.rma.view.base.home.reportquery.reportdetail.ReportCommonDetailsActivity;
 import cn.muchinfo.rma.view.base.procurement.RightScrollAdapter;
 
 /**
@@ -42,6 +47,7 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
     private List<ItemViewHolder> mViewHolderList = new ArrayList<>();
     public int offestX = 0;
     private OnContentScrollListener onContentScrollListener;
+    private int pageType;//1 是品类库存报表 2是仓库库存报表
 
 
     //---------------往下级传的参数----------------
@@ -51,23 +57,23 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
     private String transactionUserid;//选择的交易用户id
     private String tabtitle;//列头
 
-    public void setTime(String time){
+    public void setTime(String time) {
         this.time = time;
     }
 
-    public void setTimeType(String timeType){
+    public void setTimeType(String timeType) {
         this.timeType = timeType;
     }
 
-    public void setTransaction(String transaction){
+    public void setTransaction(String transaction) {
         this.transaction = transaction;
     }
 
-    public void setTransactionUserid(String transactionUserid){
+    public void setTransactionUserid(String transactionUserid) {
         this.transactionUserid = transactionUserid;
     }
 
-    public void setTabtitle(String tabtitle){
+    public void setTabtitle(String tabtitle) {
         this.tabtitle = tabtitle;
     }
 
@@ -80,8 +86,9 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
         this.onContentScrollListener = onContentScrollListener;
     }
 
-    public InventoryRecordAdapter(Context context) {
+    public InventoryRecordAdapter(Context context, int pageType) {
         this.context = context;
+        this.pageType = pageType;
     }
 
     public void setDatas(List<AreaStockReportData> datas) {
@@ -90,7 +97,7 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
     }
 
 
-    private void setPosition(int position){
+    private void setPosition(int position) {
         if (this.position == position) {
             this.position = -1;
             notifyItemChanged(index);
@@ -111,12 +118,14 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
-        if (TextUtils.isEmpty(datas.get(i).getDeliverygoodsname())){
-            itemViewHolder.exposure_tvLeftTitle.setText("--");
-        }else {
-            itemViewHolder.exposure_tvLeftTitle.setText(datas.get(i).getDeliverygoodsname());
+        AreaStockReportData data = datas.get(i);
+        if (pageType == 1) {//品类
+            itemViewHolder.exposure_tvLeftTitle.setText(data.getDeliverygoodsname());
+            itemViewHolder.exposure_tv_left_bottom_title.setText(data.getWrstandardname());
+        } else if (pageType == 2) {//仓库
+            itemViewHolder.exposure_tvLeftTitle.setText(data.getWarehousename());
+            itemViewHolder.exposure_tv_left_bottom_title.setText(data.getDeliverygoodsname());
         }
-        itemViewHolder.exposure_tv_left_bottom_title.setText(datas.get(i).getWrstandardname());
         //右边滑动部分
         LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
         linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
@@ -129,52 +138,92 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
         if (!mViewHolderList.contains(itemViewHolder)) {
             mViewHolderList.add(itemViewHolder);
         }
-        if (i == this.position){
+        if (i == this.position) {
             itemViewHolder.exposure_roots_view.setBackgroundColor(context.getResources().getColor(R.color.rma_list_select_color));
             itemViewHolder.exposure_allView.setVisibility(View.VISIBLE);
-        }else {
+        } else {
             itemViewHolder.exposure_roots_view.setBackgroundColor(context.getResources().getColor(R.color.white));
             itemViewHolder.exposure_allView.setVisibility(View.GONE);
         }
 
+        if (pageType == 1) {
+            itemViewHolder.futures_subsidiary.setVisibility(View.VISIBLE);
+            itemViewHolder.place_the_order.setVisibility(View.VISIBLE);
+        } else {
+            itemViewHolder.inventory_details.setVisibility(View.VISIBLE);
+        }
+
         itemViewHolder.exposure_all_click_View.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
                 setPosition(i);
             }
         });
-
-        //入库明细
+        //库存明细
+        itemViewHolder.inventory_details.setOnClickListener(view -> {
+            Intent intent = new Intent();
+            intent.putExtra("title", "现货报表明细");
+            intent.putExtra("time", this.time);
+            intent.putExtra("transaction", this.transaction);
+            if (data.getCycletype().equals("0")) {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_warehousestock_daydetail);
+                intent.putExtra("time", data.getReckondate());
+            } else {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_warehousestock_weekmonthdetail);
+                intent.putExtra("time", data.getBegindate() + "~" + data.getEnddate());
+            }
+            intent.putExtra("AreaStockReportData", data);
+            intent.putExtra("AreaSumPLData", new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData", new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData", new ExposureReportData());
+            intent.putExtra("transactionUserid", this.transactionUserid);
+            intent.putExtra("FinanceReportData", new FinanceReportData());
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+        //仓库明细
         itemViewHolder.futures_subsidiary.setOnClickListener(view -> {
-//            Intent intent = new Intent();
-//            intent.putExtra("isFrom","2");//从仓库管理页面进入
-//            intent.putExtra("detailtype","1");//入库明细
-//            intent.putExtra("wrstandardname",datas.get(i).getWrstandardname());
-//            intent.putExtra("title", Constant.table_mobile_stock_report_in_detail);//出库明细的列头
-//            intent.putExtra("querytype",querytype);//日报表/月报表  这里不需要传入值
-//            intent.putExtra("querydate",datas.get(i).getUpdatetime());//查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
-//            intent.putExtra("wrstandardid",datas.get(i).getWrstandardid());//现货商品ID 此处不需要传
-//            intent.putExtra("spotgoodsbrandid",datas.get(i).getSpotgoodsbrandid());//通过报表页面进入需要的参数 : 品牌ID 此处不需要传
-//            intent.putExtra("spotgoodsmodelid",datas.get(i).getSpotgoodsmodelid());//通过报表页面进入需要的参数 : 型号ID 此处不需要传
-//            intent.putExtra("warehouseinfoid",datas.get(i).getWarehouseinfoid());//通过报表页面进入需要的参数 : 仓库ID 此处不需要传
-//            intent.setClass(context, InventoryDetailsActivity.class);
-//            ActivityUtils.startActivity(intent);
+            Intent intent = new Intent();
+            intent.putExtra("title", "现货报表明细");
+            intent.putExtra("time", this.time);
+            intent.putExtra("transaction", this.transaction);
+            if (data.getCycletype().equals("0")) {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_wrstandstock_warehouse_daydetail);
+                intent.putExtra("time", data.getReckondate());
+            } else {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_wrstandstock_warehouse_weekmonthdetail);
+                intent.putExtra("time", data.getBegindate() + "~" + data.getEnddate());
+            }
+            intent.putExtra("AreaStockReportData", data);
+            intent.putExtra("AreaSumPLData", new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData", new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData", new ExposureReportData());
+            intent.putExtra("transactionUserid", this.transactionUserid);
+            intent.putExtra("FinanceReportData", new FinanceReportData());
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
         });
-        //出库明细
+        //品牌明细
         itemViewHolder.place_the_order.setOnClickListener(view -> {
-//            Intent intent = new Intent();
-//            intent.putExtra("isFrom","2");//从仓库管理页面进入
-//            intent.putExtra("detailtype","2");//出库明细
-//            intent.putExtra("wrstandardname",datas.get(i).getWrstandardname());
-//            intent.putExtra("title", Constant.table_mobile_stock_report_in_detail);//出库明细的列头
-//            intent.putExtra("querytype",querytype);//日报表/月报表  这里不需要传入值
-//            intent.putExtra("querydate",datas.get(i).getUpdatetime());//查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
-//            intent.putExtra("wrstandardid",datas.get(i).getWrstandardid());//现货商品ID
-//            intent.putExtra("spotgoodsbrandid",datas.get(i).getSpotgoodsbrandid());//通过报表页面进入需要的参数 : 品牌ID
-//            intent.putExtra("spotgoodsmodelid",datas.get(i).getSpotgoodsmodelid());//通过报表页面进入需要的参数 : 型号ID
-//            intent.putExtra("warehouseinfoid",datas.get(i).getWarehouseinfoid());//通过报表页面进入需要的参数 : 仓库ID
-//            intent.setClass(context, InventoryDetailsActivity.class);
-//            ActivityUtils.startActivity(intent);
+            Intent intent = new Intent();
+            intent.putExtra("title", "现货报表明细");
+            intent.putExtra("time", this.time);
+            intent.putExtra("transaction", this.transaction);
+            if (data.getCycletype().equals("0")) {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_wrstandstock_brand_daydetail);
+                intent.putExtra("time", data.getReckondate());
+            } else {
+                intent.putExtra("tabtitle", Constant.table_mobile_report_wrstandstock_brand_weekmonthdetail);
+                intent.putExtra("time", data.getBegindate() + "~" + data.getEnddate());
+            }
+            intent.putExtra("AreaStockReportData", data);
+            intent.putExtra("AreaSumPLData", new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData", new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData", new ExposureReportData());
+            intent.putExtra("transactionUserid", this.transactionUserid);
+            intent.putExtra("FinanceReportData", new FinanceReportData());
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
         });
 
         itemViewHolder.exposure_horItemScrollview.setEventListener(event -> {
@@ -209,6 +258,7 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
         LinearLayout exposure_roots_view;//根部布局
         TextView futures_subsidiary;//
         TextView place_the_order;//
+        TextView inventory_details;//库存报表
         LinearLayout exposure_allView;//隐藏的底部操作空间
         LinearLayout exposure_all_click_View;//item左侧点击控件
         TextView exposure_tvLeftTitle;//左边
@@ -227,14 +277,15 @@ public class InventoryRecordAdapter extends RecyclerView.Adapter<InventoryRecord
 
         public ItemViewHolder(@NonNull View itemView) {
             super(itemView);
+            inventory_details = itemView.findViewById(R.id.inventory_details);
             futures_subsidiary = itemView.findViewById(R.id.futures_subsidiary);
             place_the_order = itemView.findViewById(R.id.place_the_order);
-            exposure_tvLeftTitle = itemView.findViewById(R.id.exposure_tv_left_title);
+            exposure_tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
             exposure_rvItemRight = itemView.findViewById(R.id.exposure_rv_item_right);
             exposure_horItemScrollview = itemView.findViewById(R.id.exposure_hor_item_scrollview);
             exposure_allView = itemView.findViewById(R.id.exposure_all_view);
-            exposure_tv_left_bottom_title = itemView.findViewById(R.id.exposure_tv_left_bottom_title);
-            exposure_all_click_View = itemView.findViewById(R.id.exposure_all_click_View);
+            exposure_tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            exposure_all_click_View = itemView.findViewById(R.id.all_click_View);
             exposure_roots_view = itemView.findViewById(R.id.exposure_roots_view);
         }
     }

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

@@ -21,6 +21,7 @@ import cn.muchinfo.rma.global.data.*
 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.home.contract.emptyView
 import cn.muchinfo.rma.view.base.home.financial.InvoiceRegisterActivity
 import cn.muchinfo.rma.view.base.home.reportquery.adapter.ExposureReportContentAdapter
@@ -53,7 +54,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
 
     /** tab标题 **/
     private val tabsArray: List<String> by lazy {
-        arrayListOf("财务报表", "敞口报表", "现货报表", "库存报表","汇总损益表")
+        arrayListOf("财务报表", "敞口报表", "现货报表", "库存(品类)报表","库存(仓库)报表","汇总损益表")
     }
 
     /** 财务报表 **/
@@ -65,12 +66,15 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
     /** 现货报表 **/
     private val spotReportUI by lazy { SpotReportUI(this, viewModel) }
 
-    /** 库存报表 ***/
+    /** 库存(品类)报表 ***/
     private val invertoryReportUI by lazy { InvertoryReportUI(this, viewModel) }
 
     /** 现货损益报表 **/
     private val spotEarningReportUI by lazy { SpotEarningReportUI(this,viewModel) }
 
+    /** 库存(仓库)报表 **/
+    private val invertoryWarehouseReportUI by lazy { InvertoryWarehouseReportUI(this, viewModel) }
+
     private val pagerAdapter: PagerAdapter by lazy {
         object : PagerAdapter() {
 
@@ -103,7 +107,7 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
                         }
                     }
                     3 -> {
-                        return invertoryReportUI.root.apply {//库存报表
+                        return invertoryReportUI.root.apply {//库存报表 (品类)
                             container.addView(
                                 this,
                                 ViewGroup.LayoutParams(matchParent, matchParent)
@@ -111,6 +115,14 @@ class ReportQueryActivity : BaseActivity<ReportQueryViewModel>() {
                         }
                     }
                     4 -> {
+                        return invertoryWarehouseReportUI.root.apply {//库存报表 (仓库)
+                            container.addView(
+                                this,
+                                ViewGroup.LayoutParams(matchParent, matchParent)
+                            )
+                        }
+                    }
+                    5 -> {
                         return spotEarningReportUI.root.apply {//现货损益报表
                             container.addView(
                                 this,
@@ -335,11 +347,11 @@ class FinancialReportUI(
                     backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     onThrottleFirstClick {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
                         }
 
                     }
@@ -355,7 +367,7 @@ class FinancialReportUI(
             }.lparams(matchParent, autoSize(100))
 
 //            viewModel.queryTitle(tableKey = Constant.table_mobile_report_expose, cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "",querytype = "1")
-
+            contentAdapter.setOnContentScrollListener(this@FinancialReportUI)
             linearLayout {
                 linearLayout {
                     gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
@@ -372,7 +384,7 @@ class FinancialReportUI(
 
                 inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
                     horScrollview = this
-                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY -> //代码重复,可以抽取/////
+                    setOnCustomScrollChangeListener { _, scrollX, _, _, _ ->
                         contentAdapter.offestX = scrollX
                         val viewHolderCacheList: List<FanacelReportContentAdapter.ItemViewHolder> =
                             contentAdapter.viewHolderCacheList
@@ -408,7 +420,6 @@ class FinancialReportUI(
 
             statusLayout(contentBlock = {
                 statusLayout = this
-//                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
                     setEnableRefresh(false)
@@ -418,11 +429,11 @@ class FinancialReportUI(
                          * 下拉刷新
                          */
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "2",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1")
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.qryFinanceReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.financialSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
                         }
                     }
                     setEnableScrollContentWhenLoaded(false)
@@ -596,7 +607,6 @@ class ExposureReportUI(
                     onThrottleFirstClick {
                         activity.creatBottomSheetDialog("请选择指定交易用户", viewModel.getCanSelectTradingAccount()) {
                             viewModel.exposureSelectTransactionUser.postValue(this)
-
                         }
                     }
                     viewModel.exposureSelectTransactionUser.bindOptional(context){
@@ -615,13 +625,12 @@ class ExposureReportUI(
                     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.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
                         }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.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
                         }
-
                     }
                     gravity = Gravity.CENTER
                     text = "查询"
@@ -697,7 +706,13 @@ class ExposureReportUI(
                         /**
                          * 下拉刷新
                          */
-//                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
+                        }else if (dateType.value?.id == "3"){//周报表
+                            viewModel.qryReckonAreaExpourse(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.exposureSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
+                        }
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -888,11 +903,11 @@ class SpotReportUI(
                     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())
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
                         }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")
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = true)
                         }
 
                     }
@@ -970,6 +985,13 @@ class SpotReportUI(
                         /**
                          * 下拉刷新
                          */
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = false)
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = false)
+                        }else if (dateType.value?.id == "3"){//周报表
+                            viewModel.qryAreaSpotplReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.spotSelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "4",isFrashByUser = false)
+                        }
 //                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
                     }
                     setEnableScrollContentWhenLoaded(false)
@@ -1162,11 +1184,11 @@ class SpotEarningReportUI(
                     backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
                     onThrottleFirstClick {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
                         }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")
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
                         }
 
                     }
@@ -1244,7 +1266,13 @@ class SpotEarningReportUI(
                         /**
                          * 下拉刷新
                          */
-//                        viewModel.qryReportAreaExpourse(cycletime = tradedate.replace("-", ""),cycletype = "",userid = selectTransactionUser.value?.id ?: "")
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "1",isFrashByUser = true)
+                        }else if (dateType.value?.id == "3"){//周报表
+                            viewModel.qrySummaryReport(tradedate = tradedate.replace("-", ""),querytype = "1",userid = viewModel.summarySelectTransactionUser.value?.id ?: GlobalDataCollection.instance?.loginRsp?.userID.toString(),cycletype = "0",isFrashByUser = true)
+                        }
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -1294,7 +1322,7 @@ class SpotEarningReportUI(
 }
 
 /**
- * 库存报表
+ * 库存报表(品类)
  * @property activity AppCompatActivity
  * @property viewModel ReportQueryViewModel
  * @constructor
@@ -1316,21 +1344,15 @@ class InvertoryReportUI(
 
     //列表adapter
     val exposureContentAdapter by lazy {
-        InventoryRecordAdapter(activity)
+        InventoryRecordAdapter(activity,1)
     }
 
-    /** 选择的现货商品类型 */
-    private val selectWrStandardData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+    /** 选择的现货品种 */
+    private val selectdeliverygoodsData: 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 = "") }
-
-    /** 选择的仓库 **/
-    private val selectWareHouse: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
-
     /**
      * 选择的报表周期类型
      */
@@ -1351,7 +1373,7 @@ class InvertoryReportUI(
         dateType.postValue(SelectData(id = "1",value = "日报表"))
         viewModel.queryDeliveryGoods()//查询现货品种
         viewModel.queryGoodsWrstandard()//查询品类
-        viewModel.queryGoodsbrand()//查询品牌
+//        viewModel.queryGoodsbrand()//查询品牌//第四版报表,此报表为库存品类报表
 //        viewModel.queryWarehouseInfo()//查询可选择的仓库信息(新版库存报表不用选择仓库,暂时注释掉,不知道后面要不要加回去)
     }
 
@@ -1431,14 +1453,13 @@ class InvertoryReportUI(
                             "请选择现货品种",
                             viewModel.getDeliverySelectData()
                         ) {
-                            selectWrStandardData.postValue(this)
-
+                            selectdeliverygoodsData.postValue(this)
                         }
                     }
                     backgroundResource = R.drawable.rma_time_click_bg
                     gravity = Gravity.CENTER_VERTICAL
                     textView {
-                        selectWrStandardData.bindOptional(context) {
+                        selectdeliverygoodsData.bindOptional(context) {
                             text = it?.value
                             textColorInt = R.color.rma_black_33
                         }
@@ -1497,87 +1518,32 @@ class InvertoryReportUI(
                 }.lparams(0, autoSize(67), 1f) {
                     marginStart = autoSize(12)
                 }
-                linearLayout {
-                    onThrottleFirstClick {
-                        activity.creatBottomSheetDialog(
-                            "请选择品牌",
-                            viewModel.getGoodsBrandSelectList()
-                        ) {
-                            selectWrStandBrand.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)
-                    }
-                }.lparams(0, autoSize(67), 1f) {
-                    marginStart = autoSize(12)
-                }
-                //新版仓库报表没有仓库选择
-                linearLayout {
-                    visibility = View.GONE
-                    onThrottleFirstClick {
-                        val selectDataList = viewModel.setSelectWarehouseList(
-                            viewModel.normalWarehouseInfo.value ?: arrayListOf()
-                        )
-                        activity.creatBottomSheetDialog("请选择仓库", selectDataList) {
-                            selectWareHouse.postValue(this)
-                        }
-                    }
-                    backgroundResource = R.drawable.rma_time_click_bg
-                    gravity = Gravity.CENTER_VERTICAL
-                    textView {
-                        selectWareHouse.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)
-                }
 
                 textView {
                     onThrottleFirstClick {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",wrstandardid = selectWrStandardData.value?.id ?: "",
-                                spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                                spotgoodsmodelid = selectWrStandModel.value?.id ?: "")
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "0",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                            isFrashByUser = true)
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",wrstandardid = selectWrStandardData.value?.id ?: "",
-                                spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                                spotgoodsmodelid = selectWrStandModel.value?.id ?: "",cycletype = "1")
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "1",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                            isFrashByUser = true)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "4",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                            isFrashByUser = true)
                         }
                     }
                     gravity = Gravity.CENTER
@@ -1591,7 +1557,9 @@ class InvertoryReportUI(
             }.lparams(matchParent, autoSize(100))
             //初始化数据进行头部数据请求
             viewModel.queryInventoryTitle(
-                querytype = dateType.value?.id ?: "1",
+                sumfields = "1,2",
+                titleTab = Constant.table_mobile_report_wrstandstock,
+                querytype = "1",
                 tradedate = tradedate.replace("-", "")
             )
             exposureContentAdapter.setOnContentScrollListener(this@InvertoryReportUI)
@@ -1655,34 +1623,27 @@ class InvertoryReportUI(
                     setEnableLoadMore(true)
                     setOnRefreshListener {
                         if (dateType.value?.id == "1"){//日报表
-                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",wrstandardid = selectWrStandardData.value?.id ?: "",
-                                spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                                spotgoodsmodelid = selectWrStandModel.value?.id ?: "")
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "0",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
                         }else if (dateType.value?.id == "2"){//月报表
-                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",wrstandardid = selectWrStandardData.value?.id ?: "",
-                                spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-                                spotgoodsmodelid = selectWrStandModel.value?.id ?: "",cycletype = "1")
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "1",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
                         }else if (dateType.value?.id == "3"){//周报表
-
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "4",
+                                titleTab = Constant.table_mobile_report_wrstandstock,
+                                sumfields = "1,2",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
                         }
-//                        var querydate = ""
-//                        if (viewModel.isSelectInventoryMonthOrDay.value == "1"){//日报表
-//                            querydate = tradedate.replace("-", "")
-//                        }else{//月报表
-//                            querydate = tradedate.replace("-", "")
-//                        }
-//                        /**
-//                         * 下拉刷新
-//                         */
-//                        viewModel.queryAreaStockReport(
-//                            querytype = viewModel.isSelectInventoryMonthOrDay.value ?: "1",
-//                            querydate = querydate,
-//                            wrstandardid = selectWrStandardData.value?.id ?: "",
-//                            spotgoodsbrandid = selectWrStandBrand.value?.id ?: "",
-//                            spotgoodsmodelid = selectWrStandModel.value?.id ?: "",
-//                            warehouseinfoid = selectWareHouse.value?.id ?: ""
-//
-//                        )
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
@@ -1734,111 +1695,402 @@ class InvertoryReportUI(
 }
 
 /**
- * 财务报表-款项UI
+ * 库存报表(仓库)
  * @property activity AppCompatActivity
  * @property viewModel ReportQueryViewModel
  * @constructor
  */
-class FinancialPaymentUI(
+class InvertoryWarehouseReportUI(
     private val activity: AppCompatActivity,
     private val viewModel: ReportQueryViewModel
-) {
+) : InventoryRecordAdapter.OnContentScrollListener {
 
     private lateinit var swipeToLayout: SwipeToLoadLayout
     private lateinit var statusLayout: StatusLayout
-    private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
-        BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
+    lateinit var horScrollview: CustomHorizontalScrollView
+    lateinit var recyclerView: RecyclerView
+
+    //列表头部的数据adapter
+    val topAdapter by lazy {
+        TopTabAdpater(activity)
+    }
+
+    //列表adapter
+    val exposureContentAdapter by lazy {
+        InventoryRecordAdapter(activity,2)
+    }
+
+    /** 选择的现货品种 */
+    private val selectdeliverygoodsData: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /** 选择的型号类型/品类 **/
+    private val selectWrStandModel: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /** 选择的仓库 **/
+    private val selectWareHouse: MutableLiveData<SelectData> = MutableLiveData<SelectData>().apply { value = SelectData(id = "",value = "") }
+
+    /**
+     * 选择的报表周期类型
+     */
+    val dateType : MutableLiveData<SelectData> = MutableLiveData()
 
-    fun queryRefrashByTime(tradeDate: String) {
-        viewModel.qryReportDayFinanceKx(tradedate = tradeDate.replace("-", ""))
+    /**
+     * 查询所用的date 注意(页面显示时间规则yyyy-MM-dd,而接口请求规则yyyyMMdd,简直无fuck可说)
+     */
+    var tradedate: String = TimeUtils.millis2String(
+        TimeUtils.getNowMills().minus(86400000),
+        SimpleDateFormat("yyyy-MM-dd")
+    )
+
+    /** 查询时间textview **/
+    lateinit var tradedatetextview: TextView
+
+    init {
+        dateType.postValue(SelectData(id = "1",value = "日报表"))
+        viewModel.queryDeliveryGoods()//查询现货品种
+        viewModel.queryGoodsWrstandard()//查询品类
+//        viewModel.queryGoodsbrand()//查询品牌
+        viewModel.queryWarehouseInfo()//查询可选择的仓库信
     }
 
+    @RequiresApi(Build.VERSION_CODES.N)
     val root = _FrameLayout(activity).apply {
         verticalLayout {
-            viewModel.qryReportDayFinanceKx(tradedate = TimeUtils.getNowString(SimpleDateFormat("yyyyMMdd")))
-            FinanciclReportDayTitleUI(type = "1")
-            statusLayout(contentBlock = {
-                statusLayout = this
-//                bindTaskStatus(viewModule.status)
-                swipeToLoadLayout {
-                    swipeToLayout = this
-                    setEnableRefresh(false)
-                    setEnableLoadMore(false)
-                    setOnRefreshListener {
+            linearLayout {
+                gravity = Gravity.CENTER_VERTICAL
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog("请选择报表周期", viewModel.getSelectDateType()) {
+                            dateType.postValue(this)
+                            exposureContentAdapter.setTimeType(this.id)//item设置时间类型
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        dateType.bindOptional(context){
+                            text = it?.value
+                        }
+                        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(25), autoSize(25)){
+                        marginEnd = autoSize(10)
                     }
-                    setEnableScrollContentWhenLoaded(false)
-                    setEnableLoadMoreWhenContentNotFull(false)
-                    recyclerView {
-                        background = resources.getDrawable(R.color.white)
-                        adapter = financialReportDayAdapter
-                    }.lparams(matchParent, matchParent)
+
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(36)
                 }
-            }, emptyBlock = {
-                emptyView(hint = resources.getString(R.string.now_no_data))
-            }).lparams(matchParent, matchParent)
 
-            viewModel.financialReportDayPaymentDataList.bindOptional(context) {
-                if (it?.isEmpty() == true || it?.size == 0) {
-                    statusLayout.showEmpty()
-                } else {
-                    if (swipeToLayout.getIsRefreshing()) {
-                        swipeToLayout.finishRefresh()
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.showDataSelectDialog(type = viewModel.isselectSpotMonthOrDay.value.toString()) {
+                            tradedate = this
+                            exposureContentAdapter.setTime(this)
+                            tradedatetextview.text = this
+                        }
                     }
-                    statusLayout.showSuccess()
-                    financialReportDayAdapter.setNewData(it)
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        tradedatetextview = this
+                        text = TimeUtils.millis2String(
+                            TimeUtils.getNowMills().minus(86400000),
+                            SimpleDateFormat("yyyy-MM-dd")
+                        )
+                        textColorInt = R.color.rma_hint_text_color_ccc
+                        textSizeAuto = 31
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(18)
+                    }
+
+                    emptyView()
+
+                    imageView {
+                        imageResource = R.mipmap.rma_search_by_time
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(12)
                 }
-            }
-        }
-    }
-}
 
-/**
- * 财务报表-发票UI
- * @property activity AppCompatActivity
- * @property viewModel ReportQueryViewModel
- * @constructor
- */
-class FinancialInvoiceUI(
-    private val activity: AppCompatActivity,
-    private val viewModel: ReportQueryViewModel
-) {
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog(
+                            "请选择现货品种",
+                            viewModel.getDeliverySelectData()
+                        ) {
+                            selectdeliverygoodsData.postValue(this)
 
-    private lateinit var swipeToLayout: SwipeToLoadLayout
-    private lateinit var statusLayout: StatusLayout
-    private val financialReportDayAdapter: BaseAdapter<FinancialReportData, FinancialDayViewHolder> =
-        BaseAdapter { _, _ -> FinancialDayViewHolder(activity, viewModel, "1") }
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        selectdeliverygoodsData.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)
+                    }
 
-    fun queryRefrashByTime(tradeDate: String) {
-        viewModel.qryReportDayFinanceFp(tradedate = tradeDate.replace("-", ""))
-    }
+                    emptyView()
 
-    val root = _FrameLayout(activity).apply {
-        verticalLayout {
-            viewModel.qryReportDayFinanceFp(tradedate = TimeUtils.getNowString(SimpleDateFormat("yyyyMMdd")))
-            FinanciclReportDayTitleUI(type = "2")
+                    imageView {
+                        imageResource = R.mipmap.rma_down
+                    }.lparams(autoSize(38), autoSize(38)){
+                        marginEnd = autoSize(10)
+                    }
+                }.lparams(autoSize(264), autoSize(67)) {
+                    marginStart = autoSize(12)
+                }
+
+
+            }.lparams(matchParent, autoSize(100))
+
+            linearLayout {
+                linearLayout {
+                    onThrottleFirstClick {
+                        activity.creatBottomSheetDialog(
+                            "请选择品类",
+                            viewModel.getGoodsWrstandardSelectList()
+                        ) {
+                            selectWrStandModel.postValue(this)
+                        }
+                    }
+                    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 {
+                        val selectDataList = viewModel.setSelectWarehouseList(
+                            viewModel.normalWarehouseInfo.value ?: arrayListOf()
+                        )
+                        activity.creatBottomSheetDialog("请选择仓库", selectDataList) {
+                            selectWareHouse.postValue(this)
+                        }
+                    }
+                    backgroundResource = R.drawable.rma_time_click_bg
+                    gravity = Gravity.CENTER_VERTICAL
+                    textView {
+                        selectWareHouse.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)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "0",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = true)
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "1",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = true)
+                        }else if (dateType.value?.id == "3"){//周报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "4",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = true)
+                        }
+                    }
+                    gravity = Gravity.CENTER
+                    backgroundDrawable = createCommonBottomRoundBg(color = "#2481DD", corner = 5)
+                    text = "查询"
+                    textSizeAuto = 31
+                    textColorInt = R.color.white
+                }.lparams(autoSize(122), autoSize(67)) {
+                    marginStart = autoSize(12)
+                }
+            }.lparams(matchParent, autoSize(100))
+            //初始化数据进行头部数据请求
+            viewModel.queryInventoryTitle(
+                sumfields = "1,2,4",
+                titleTab = Constant.table_mobile_report_warehousestock,
+                querytype = "1",
+                tradedate = tradedate.replace("-", "")
+            )
+            exposureContentAdapter.setOnContentScrollListener(this@InvertoryWarehouseReportUI)
+            linearLayout {
+                linearLayout {
+                    gravity = Gravity.LEFT or Gravity.CENTER_VERTICAL
+                    textView {//头部右侧数据
+                        viewModel.inventoryWarehouseRecordTitle.bindOptional(context) {
+                            text = it?.get(0)?.columntitle?.replace("\\n", "\n") ?: ""
+                        }
+                        textColorStr = "#AAAAAA"
+                        textSizeAuto = 24
+                    }.lparams(wrapContent, wrapContent) {
+                        marginStart = autoSize(30)
+                    }
+                }.lparams(autoSize(SizeUtils.dp2px(90f)), autoSize(100))
+
+                inflateLayout<CustomHorizontalScrollView>(R.layout.scrollview) {
+                    horScrollview = this
+                    /**
+                     * 用来同步内容列表的item左右滑动
+                     */
+                    setOnCustomScrollChangeListener { listener, scrollX, scrollY, oldScrollX, oldScrollY ->
+                        exposureContentAdapter.offestX = scrollX
+                        val viewHolderCacheList: List<InventoryRecordAdapter.ItemViewHolder> =
+                            exposureContentAdapter.viewHolderCacheList
+                        if (null != viewHolderCacheList) {
+                            val size = viewHolderCacheList.size
+                            for (i in 0 until size) {
+                                viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
+                                    scrollX,
+                                    0
+                                )
+                            }
+                        }
+                    }
+                    relativeLayout {
+                        recyclerView {//头部右侧数据
+                            val linearLayoutManager = LinearLayoutManager(context)
+                            linearLayoutManager.orientation = LinearLayoutManager.HORIZONTAL
+                            layoutManager = linearLayoutManager
+                            background = resources.getDrawable(R.color.white)
+                            adapter = topAdapter
+                        }
+                        viewModel.inventoryWarehouseRecordTitle.bindOptional(context) {
+                            val titleStringList = arrayListOf<String>()
+                            it?.subList(1, it.size)?.forEach { data ->
+                                titleStringList.add(data.columntitle?.replace("\\n", "\n") ?: "")
+                            }
+                            topAdapter.setDatas(titleStringList)
+                        }
+                    }
+                }.lparams(matchParent, matchParent)
+            }.lparams(matchParent, autoSize(100))
             statusLayout(contentBlock = {
                 statusLayout = this
 //                bindTaskStatus(viewModule.status)
                 swipeToLoadLayout {
                     swipeToLayout = this
-                    setEnableRefresh(false)
-                    setEnableLoadMore(false)
+                    setEnableRefresh(true)
+                    setEnableLoadMore(true)
                     setOnRefreshListener {
-
+                        if (dateType.value?.id == "1"){//日报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "0",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
+                        }else if (dateType.value?.id == "2"){//月报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "2",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "1",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
+                        }else if (dateType.value?.id == "3"){//周报表
+                            viewModel.queryAreaStockReport(tradedate = tradedate.replace("-", ""),querytype = "1",deliverygoodsid = selectdeliverygoodsData.value?.id ?: "",
+                                cycletype = "4",
+                                titleTab = Constant.table_mobile_report_warehousestock,
+                                sumfields = "1,2,4",
+                                warehouseinfoid = selectWareHouse.value?.id ?: "",
+                                wrstandardid = selectWrStandModel.value?.id ?: "",
+                                isFrashByUser = false)
+                        }
                     }
                     setEnableScrollContentWhenLoaded(false)
                     setEnableLoadMoreWhenContentNotFull(false)
+
                     recyclerView {
                         background = resources.getDrawable(R.color.white)
-                        adapter = financialReportDayAdapter
-                    }.lparams(matchParent, matchParent)
+                        adapter = exposureContentAdapter
+                        addOnScrollListener(object : RecyclerView.OnScrollListener() {
+                            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
+                                super.onScrolled(recyclerView, dx, dy)
+                                val viewHolderCacheList: List<InventoryRecordAdapter.ItemViewHolder> =
+                                    exposureContentAdapter.viewHolderCacheList
+                                if (null != viewHolderCacheList) {
+                                    val size = viewHolderCacheList.size
+                                    for (i in 0 until size) {
+                                        viewHolderCacheList[i].exposure_horItemScrollview.scrollTo(
+                                            exposureContentAdapter.getOffestX(),
+                                            0
+                                        )
+                                    }
+                                }
+                            }
+                        })
+                    }
                 }
             }, emptyBlock = {
                 emptyView(hint = resources.getString(R.string.now_no_data))
             }).lparams(matchParent, matchParent)
 
-            viewModel.financialReportDayInvoiceDataList.bindOptional(context) {
+            viewModel.inventoryWarehouseDetailsDataList.bindOptional(context) {
+
                 if (it?.isEmpty() == true || it?.size == 0) {
                     statusLayout.showEmpty()
                 } else {
@@ -1846,155 +2098,14 @@ class FinancialInvoiceUI(
                         swipeToLayout.finishRefresh()
                     }
                     statusLayout.showSuccess()
-                    financialReportDayAdapter.setNewData(it)
+                    exposureContentAdapter.setDatas(it)
                 }
             }
         }
     }
-}
-
-
-/**
- * 财务报表日报表头部
- * type  1 款项 2 发票
- */
-fun _LinearLayout.FinanciclReportDayTitleUI(type: String) {
-    linearLayout {
-        verticalLayout {
-            gravity = Gravity.START
-            textView {
-                text = if (type == "1") {
-                    "款项发生时间"
-                } else {
-                    "发票发生时间"
-                }
-                textSizeAuto = 24
-                textColorInt = R.color.hint_text_color
-            }.lparams(wrapContent, wrapContent) {
-                marginStart = autoSize(36)
-                topMargin = autoSize(15)
-            }
-        }.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)
-            textView {
-                text = "金额"
-                textSizeAuto = 24
-                textColorInt = R.color.hint_text_color
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(225), autoSize(97))
-
-        verticalLayout {
-            gravity = Gravity.END
-            textView {
-                text = "操作人"
-                textSizeAuto = 24
-                textColorInt = R.color.hint_text_color
-            }.lparams(wrapContent, wrapContent) {
-                marginEnd = autoSize(36)
-                topMargin = autoSize(15)
-            }
-        }.lparams(autoSize(225), autoSize(97))
-    }.lparams(matchParent, autoSize(97))
-}
-
-/**
- * 财务报表月报表头部
- * @receiver _LinearLayout
- */
-fun _LinearLayout.FinancialReportUiTitle() {
-    linearLayout {
-        verticalLayout {
-            gravity = Gravity.CENTER
-            textView {
-                text = "日期"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(180), autoSize(97))
 
-        verticalLayout {
-            gravity = Gravity.END
-            textView {
-                text = "收款笔数"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-
-            textView {
-                text = "收款金额"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(180), autoSize(97))
-
-        verticalLayout {
-            gravity = Gravity.END
-            textView {
-                text = "付款笔数"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-
-            textView {
-                text = "付款金额"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(180), autoSize(97))
-
-        verticalLayout {
-            gravity = Gravity.END
-            textView {
-                text = "收票笔数"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-
-            textView {
-                text = "收票金额"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent)
-        }.lparams(autoSize(180), autoSize(97))
-
-        verticalLayout {
-            gravity = Gravity.END
-            textView {
-                text = "开票笔数"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent){
-                marginEnd = autoSize(30)
-            }
-
-            textView {
-                text = "开票金额"
-                textSizeAuto = 24
-                textColorInt = R.color.text_hit_color
-            }.lparams(wrapContent, wrapContent){
-                marginEnd = autoSize(30)
-            }
-        }.lparams(autoSize(180), autoSize(97))
-    }.lparams(matchParent, autoSize(97))
+    override fun onScroll(event: MotionEvent?) {
+        //处理单个item滚动时,顶部tab需要联动
+        if (null != horScrollview) horScrollview.onTouchEvent(event)
+    }
 }

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

@@ -107,11 +107,16 @@ class ReportQueryViewModel : BaseViewModel(){
 //    val isSelectInventoryMonthOrDay : MutableLiveData<String> = MutableLiveData<String>().apply { value = "1" }
 
     /**
-     * 库存报表数据
+     * 库存报表数据(品类)
      */
     val inventoryDetailsDataList: MutableLiveData<List<AreaStockReportData>> = MutableLiveData()
 
     /**
+     * 库存报表数据(仓库)
+     */
+    val inventoryWarehouseDetailsDataList: MutableLiveData<List<AreaStockReportData>> = MutableLiveData()
+
+    /**
      * 现货收益报表数据
      */
     val spotEarningDataList: MutableLiveData<List<ReportAreaSpotPLData>> = MutableLiveData()
@@ -122,11 +127,16 @@ class ReportQueryViewModel : BaseViewModel(){
     val isSelectspotEarningMonthOrDay : MutableLiveData<String> = MutableLiveData<String>().apply { value = "1" }
 
     /**
-     * 库存报表数据头部数据
+     * 库存报表数据头部数据(品类纬度)
      */
     val inventoryRecordTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
 
     /**
+     * 库存报表数据头部数据(仓库纬度)
+     */
+    val inventoryWarehouseRecordTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
+
+    /**
      * 现货损益报表数据头部数据
      */
     val spotEarningRecordTitle: MutableLiveData<List<ColumnsData>> = MutableLiveData()
@@ -272,23 +282,22 @@ class ReportQueryViewModel : BaseViewModel(){
     /**
      * 现货报表第三部查询
      */
-    fun qryAreaSpotplReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+    fun qryAreaSpotplReport(tradedate: String,userid : String,querytype : String,cycletype : String,isFrashByUser : Boolean = false){
+        if (isFrashByUser){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
         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)
-            }
+            put("cycletime",tradedate)
+            put("cycletype",cycletype)
         }
 
         MyApplication.getInstance()?.reportManager?.qryAreaSpotplReport(params = params){isSuccess, respData, error ->
             if (isSuccess){
+                if (isFrashByUser){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功..."))
+                }
                 spotReportDataList.postValue(getSpotExposureRightData(respData ?: arrayListOf()))
             }
         }
@@ -297,23 +306,22 @@ class ReportQueryViewModel : BaseViewModel(){
     /**
      * 汇总损益报表第三部查询
      */
-    fun qrySummaryReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+    fun qrySummaryReport(tradedate: String,userid : String,querytype : String,cycletype : String,isFrashByUser : Boolean = false){
+        if (isFrashByUser){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
         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)
-            }
+            put("cycletime",tradedate)
+            put("cycletype",cycletype)
         }
 
         MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
             if (isSuccess){
+                if (isFrashByUser){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功..."))
+                }
                 summaryReportDataList.postValue(getSummaryExposureRightData(respData ?: arrayListOf()))
             }
         }
@@ -322,52 +330,51 @@ class ReportQueryViewModel : BaseViewModel(){
     /**
      * 财务报表第三步查询日报表
      */
-    fun qryFinanceReport(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+    fun qryFinanceReport(tradedate: String,userid : String,querytype : String,cycletype : String,isFrashByUser : Boolean = false){
+        if (isFrashByUser){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
         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)
-            }
+            put("cycletype",cycletype)
+            put("cycletime",tradedate)
         }
 
         MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
             if (isSuccess){
+                if (isFrashByUser){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功..."))
+                }
                 fincialReportDataList.postValue(getFincialExposureRightData(respData ?: arrayListOf()))
             }
         }
     }
 
     /**
-     * querytype 查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日])日报表的情况下只需要传querytype tradedate
+     * querytype 查询类型 1-报表, 这个接口只查报表;明细的字段完全不同,另有接口
      * 敞口报表第三步先查询日报表(进入页面默认查询日报表)
-     * cycletime 周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(0)【原值】
+     * cycletype 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+     * cycletime 周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
      * 查询敞口日报表
      * @param tradedate String
      */
-    fun qryReckonAreaExpourse(tradedate: String,userid : String,querytype : String,cycletype : String = ""){
+    fun qryReckonAreaExpourse(tradedate: String,userid : String,querytype : String,cycletype : String,isFrashByUser : Boolean = false){
+        if (isFrashByUser){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
         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)
-            }
+            put("querytype","1")
+            put("cycletype",cycletype)
+            put("cycletime",tradedate)
         }
 
         MyApplication.getInstance()?.reportManager?.qryReckonAreaExpourse(params = params){isSuccess, respData, error ->
             if (isSuccess){
+                if (isFrashByUser){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功..."))
+                }
                 exposureReportDataList.postValue(getReportDayExposureRightData(respData ?: arrayListOf()))
             }
         }
@@ -426,12 +433,12 @@ class ReportQueryViewModel : BaseViewModel(){
                 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")
+                    querySpotTitle(tableKey = Constant.table_mobile_report_spot,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "0",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")
+            querySpotTitle(tableKey = Constant.table_mobile_report_spot,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "0",querytype = "1")
 
         }
 
@@ -450,12 +457,12 @@ class ReportQueryViewModel : BaseViewModel(){
                 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")
+                    querySummaryTitle(tableKey = Constant.table_mobile_report_sumprofit,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "0",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")
+            querySummaryTitle(tableKey = Constant.table_mobile_report_sumprofit,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "0",querytype = "1")
 
         }
 
@@ -473,13 +480,13 @@ class ReportQueryViewModel : BaseViewModel(){
             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")
+                    financialSelectTransactionUser.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 = "0",querytype = "1")
                 }
             }
         }else{
             financialSelectTransactionUser.postValue(SelectData(id = tradingAccountManagerList.value?.get(0)?.roleid ?: "",value = tradingAccountManagerList.value?.get(0)?.rolename ?: ""))
-            queryFincialTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+            queryFincialTitle(tableKey = Constant.table_mobile_report_fincial,cycletime = tradedate.replace("-", ""),userid = tradingAccountManagerList.value?.get(0)?.roleid ?: "",cycletype = "0",querytype = "1")
         }
 
     }
@@ -497,7 +504,7 @@ class ReportQueryViewModel : BaseViewModel(){
             if (isSuccess){
                 tradingAccountManagerList.postValue(respData)
                 exposureSelectTransactionUser.postValue(SelectData(id = respData?.get(0)?.roleid ?: "",value = respData?.get(0)?.rolename ?: ""))
-                queryTitle(tableKey = Constant.table_mobile_report_expose,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "",querytype = "1")
+                queryTitle(tableKey = Constant.table_mobile_report_expose,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "0",querytype = "1")
             }
         }
     }
@@ -540,7 +547,7 @@ class ReportQueryViewModel : BaseViewModel(){
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 sspotReportTitle.postValue(newlist)
-                qryAreaSpotplReport(tradedate = cycletime,userid = userid,querytype = querytype)
+                qryAreaSpotplReport(tradedate = cycletime,userid = userid,querytype = querytype,cycletype = cycletype)
             }
         }
     }
@@ -560,7 +567,7 @@ class ReportQueryViewModel : BaseViewModel(){
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 summaryReportTitle.postValue(newlist)
-                qrySummaryReport(tradedate = cycletime,userid = userid,querytype = querytype)
+                qrySummaryReport(tradedate = cycletime,userid = userid,querytype = querytype,cycletype = cycletype)
             }
         }
     }
@@ -580,7 +587,7 @@ class ReportQueryViewModel : BaseViewModel(){
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 fincialReportTitle.postValue(newlist)
-                qryFinanceReport(tradedate = cycletime,userid = userid,querytype = querytype)
+                qryFinanceReport(tradedate = cycletime,userid = userid,querytype = querytype,cycletype = cycletype)
             }
         }
     }
@@ -602,7 +609,7 @@ class ReportQueryViewModel : BaseViewModel(){
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 exposureReportTitle.postValue(newlist)
-                qryReckonAreaExpourse(tradedate = cycletime,userid = userid,querytype = querytype)
+                qryReckonAreaExpourse(tradedate = cycletime,userid = userid,querytype = querytype,cycletype = cycletype)
             }
         }
     }
@@ -615,7 +622,7 @@ class ReportQueryViewModel : BaseViewModel(){
         respData.forEach {
             val newRightData = arrayListOf<String>()
             //'现货品类 '
-            newRightData.add(it.wrstandardname)
+            newRightData.add(it.wrstandardname ?: "")
             //'期初量/\n 期末量 '
             newRightData.add(NumberUtils.doubleDistortion(it.oriqty) + it.enumdicname + "\n" + NumberUtils.doubleDistortion(it.oriqty) + it.curqty)
             //'今采购量/\n 今销售量 '
@@ -722,74 +729,84 @@ class ReportQueryViewModel : BaseViewModel(){
     }
 
     /**
-     * 从报表页面进入出入库报表明细
+     * 库存报表请求
      */
     fun queryAreaStockReport(
+        titleTab : String,
         tradedate: String,
         querytype : String,
+        sumfields : String,
         cycletype : String = "",
-        wrstandardid: String = "",
-        spotgoodsbrandid: String = "",
-        spotgoodsmodelid: String = ""
+        deliverygoodsid : String = "",//品种
+        wrstandardid: String = "",//品类
+        warehouseinfoid: String = "",//仓库
+        isFrashByUser : Boolean = false
     ) {
+        if (isFrashByUser){
+            loadingDialogStatus.postValue(TaskUiModel.inFlight())
+        }
         val params = mutableMapOf<String, String>().apply {
             put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
             put("querytype", querytype)
-            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)
-            }
-
+            put("cycletype",cycletype)
+            put("cycletime",tradedate)
+            put("sumfields",sumfields)
             if (wrstandardid.isNotEmpty()){
                 put("wrstandardid",wrstandardid)
             }
-            if (spotgoodsbrandid.isNotEmpty()){
-                put("spotgoodsbrandid",spotgoodsbrandid)
+            if (deliverygoodsid.isNotEmpty()){
+                put("deliverygoodsid",deliverygoodsid)
             }
-            if (spotgoodsmodelid.isNotEmpty()){
-                put("spotgoodsmodelid",spotgoodsmodelid)
+            if (warehouseinfoid.isNotEmpty()){
+                put("warehouseinfoid",warehouseinfoid)
             }
         }
         MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
             if (isSuccess) {
-                /**
-                 * 对数据进行组装
-                 */
-                inventoryDetailsDataList.postValue(
-                    getInventoryAuditRightData(
-                        respData ?: arrayListOf()
-                    )
-                )
+                if (isFrashByUser){
+                    loadingDialogStatus.postValue(TaskUiModel.success(msg = "数据请求成功..."))
+                }
+                 if (titleTab == Constant.table_mobile_report_wrstandstock){//库存管理品类纬度数据组装
+                     inventoryDetailsDataList.postValue(
+                         getInventoryAuditRightData(
+                             respData ?: arrayListOf()
+                         )
+                     )
+                 }else if (titleTab == Constant.table_mobile_report_warehousestock){//库存管理仓库纬度数据组装
+                     inventoryWarehouseDetailsDataList.postValue(
+                         getInventoryWarehouseAuditRightData(
+                             respData ?: arrayListOf()
+                         )
+                     )
+                 }
+
             }
         }
     }
 
     /**
-     * querytype 查询类型 1-日报表 2-月报表
-     * querydate 查询日期(格式 日报表YYYYMMDD, 月报表YYYYMM)
-     * wrstandardid 现货商品ID
-     * spotgoodsbrandid 品牌ID
-     * spotgoodsmodelid 型号ID
-     * warehouseinfoid 仓库ID
-     * 查询列表头部数据
-     * @param tableKey String
+     *
+     * @param titleTab String 请求列头
+     * @param tradedate String 日期 周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+     * @param querytype String 查询类型 1-报表 2-报表明细
+     * @param sumfields String 汇总维度(逗号隔开) 1-品种 2-品类 3-品牌 4-仓库
+     * @param cycletype String 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+     * @param deliverygoodsid String 品种ID
+     * @param wrstandardid String 品类ID
+     * @param warehouseinfoid String 仓库ID
      */
     fun queryInventoryTitle(
+        titleTab : String,
         tradedate: String,
         querytype : String,
+        sumfields : String,
         cycletype : String = "",
-        wrstandardid: String = "",
-        spotgoodsbrandid: String = "",
-        spotgoodsmodelid: String = ""
+        deliverygoodsid : String = "",//品种
+        wrstandardid: String = "",//品类
+        warehouseinfoid: String = ""//仓库
     ) {
         val params = mutableMapOf<String, String>().apply {
-            put("tableKey", Constant.table_mobile_report_stock)
+            put("tableKey", titleTab)
             put("tableType", "3")
         }
         MyApplication.getInstance()?.commonManager?.queryTableDefine(params = params) { isSuccess, respData, error ->
@@ -798,14 +815,18 @@ class ReportQueryViewModel : BaseViewModel(){
                 newlist?.sortWith(Comparator { t1, t2 ->
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
-                inventoryRecordTitle.postValue(newlist)
-                queryAreaStockReport(querytype = querytype,tradedate = tradedate,cycletype = cycletype,wrstandardid = wrstandardid,spotgoodsmodelid = spotgoodsmodelid,spotgoodsbrandid = spotgoodsbrandid)
+                if (titleTab == Constant.table_mobile_report_wrstandstock){//库存报表 品类纬度列头
+                    inventoryRecordTitle.postValue(newlist)
+                }else if (titleTab == Constant.table_mobile_report_warehousestock){//库存报表 仓库纬度列头
+                    inventoryWarehouseRecordTitle.postValue(newlist)
+                }
+                queryAreaStockReport(titleTab = titleTab,querytype = querytype,tradedate = tradedate,cycletype = "0",sumfields = sumfields,wrstandardid = wrstandardid,deliverygoodsid = deliverygoodsid,warehouseinfoid = warehouseinfoid)
             }
         }
     }
 
     /**
-     * 库存报表组装右部数据
+     * 库存报表组装右部数据 品类纬度
      * @param respData List<RealExposureData>
      * @return List<RealExposureData>
      */
@@ -813,7 +834,7 @@ class ReportQueryViewModel : BaseViewModel(){
         val newList = arrayListOf<AreaStockReportData>()
         respData.forEach {
             val newRightData = arrayListOf<String>()
-            newRightData.add(it.brandname + "\n" + it.diffqty + it.enumdicname)
+            newRightData.add(it.diffqty + it.enumdicname)
             newRightData.add(it.oristock ?: "--" + it.enumdicname + "\n" + it.curstock + it.enumdicname)
             newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)
             newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)
@@ -824,6 +845,25 @@ class ReportQueryViewModel : BaseViewModel(){
         return newList
     }
 
+    /**
+     * 库存报表组装右部数据 仓库纬度
+     * @param respData List<RealExposureData>
+     * @return List<RealExposureData>
+     */
+    private fun getInventoryWarehouseAuditRightData(respData: List<AreaStockReportData>): List<AreaStockReportData> {
+        val newList = arrayListOf<AreaStockReportData>()
+        respData.forEach {
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.wrstandardname + "\n" + it.diffqty + it.enumdicname)
+            newRightData.add(it.oristock ?: "--" + it.enumdicname + "\n" + it.curstock + it.enumdicname)
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)
+            val newData = it.copy(rightData = newRightData)
+            newList.add(newData)
+        }
+        return newList
+    }
+
 
 
     /**

+ 25 - 11
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/adapter/ExposureReportContentAdapter.java

@@ -21,7 +21,11 @@ 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.AreaStockReportData;
+import cn.muchinfo.rma.global.data.AreaSumPLData;
 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;
@@ -112,6 +116,8 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
+        ExposureReportData data = datas.get(i);
+
         itemViewHolder.tvLeftTitle.setText(datas.get(i).getMiddlegoodsname());
 //        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
         //右边滑动部分
@@ -156,17 +162,21 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
         //现货合同明细
         itemViewHolder.invoice_register.setOnClickListener(view -> {
             Intent intent = new Intent();
-            intent.putExtra("title","现货合同明细");
-            intent.putExtra("time",this.time);
+            intent.putExtra("title","现货合同变动量明细");
             intent.putExtra("transaction",this.transaction);
-            if (this.timeType.equals("1")){
+            if (data.getCycletype().equals("0")){
                 intent.putExtra("tabtitle", Constant.table_mobile_report_expose_spotcontract);
+                intent.putExtra("time",data.getReckondate());
             }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_expose);
+                intent.putExtra("tabtitle",Constant.table_mobile_report_expose_spotcontract);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
             }
-            intent.putExtra("middlegoodsid",datas.get(i).getMiddlegoodsid());
-            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData",new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData",data);
             intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",new FinanceReportData());
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
         });
@@ -198,18 +208,22 @@ public class ExposureReportContentAdapter extends RecyclerView.Adapter<ExposureR
         itemViewHolder.payment_registration.setOnClickListener(view -> {
             Intent intent = new Intent();
             intent.putExtra("title","套保计划明细");
-            intent.putExtra("time",this.time);
             intent.putExtra("transaction",this.transaction);
-            if (this.timeType.equals("1")){//日明细报表
+            if (data.getCycletype().equals("0")){
                 intent.putExtra("tabtitle", Constant.table_mobile_report_expose_hedgeplan);
+                intent.putExtra("time",data.getReckondate());
             }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_expose);
+                intent.putExtra("tabtitle",Constant.table_mobile_report_expose_hedgeplan);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
             }
-            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData",new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData",data);
             intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",new FinanceReportData());
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
-
         });
 
         itemViewHolder.load_more.setOnClickListener(view -> {

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

@@ -22,6 +22,8 @@ import java.util.ArrayList;
 import java.util.List;
 
 import cn.muchinfo.rma.R;
+import cn.muchinfo.rma.global.data.AreaStockReportData;
+import cn.muchinfo.rma.global.data.AreaSumPLData;
 import cn.muchinfo.rma.global.data.ExposureReportData;
 import cn.muchinfo.rma.global.data.FinanceReportData;
 import cn.muchinfo.rma.view.autoWidget.CustomHorizontalScrollView;
@@ -114,6 +116,8 @@ public class FanacelReportContentAdapter extends RecyclerView.Adapter<FanacelRep
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
+        FinanceReportData data = datas.get(i);
+
         if (datas.get(i).getCurrencyname().isEmpty()){
             itemViewHolder.tvLeftTitle.setText("--");
         }else {
@@ -155,22 +159,46 @@ public class FanacelReportContentAdapter extends RecyclerView.Adapter<FanacelRep
             itemViewHolder.payment_registration.setVisibility(View.VISIBLE);
         }else if (type.equals("1")){
             itemViewHolder.warehouse_register.setVisibility(View.VISIBLE);
+            itemViewHolder.fanacel_register.setVisibility(View.VISIBLE);
         }
-        //财务明细
+        //财务明细 品牌明细
         itemViewHolder.warehouse_register.setOnClickListener(view -> {
             Intent intent = new Intent();
-            intent.putExtra("title","财务报表明细");
+            intent.putExtra("title","品牌明细");
+            intent.putExtra("transaction",this.transaction);
+            if (data.getCycletype().equals("0")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_fincial_brand_daydetail);
+                intent.putExtra("time",data.getReckondate());
+            }else {
+                intent.putExtra("tabtitle",Constant.table_mobile_report_fincial_brand_weekmonthdetail);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
+            }
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("ExposureReportData",new ExposureReportData());
+            intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",data);
+            intent.setClass(context, ReportCommonDetailsActivity.class);
+            ActivityUtils.startActivity(intent);
+        });
+        //财务明细 品类明细
+        itemViewHolder.fanacel_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);
+            if (data.getCycletype().equals("0")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_fincial_wrstandard_daydetail);
+                intent.putExtra("time",data.getReckondate());
             }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_fincial);
+                intent.putExtra("tabtitle",Constant.table_mobile_report_fincial_wrstandard_weekmonthdetail);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
             }
-            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
-            intent.putExtra("middlegoodsid","");
-            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("ExposureReportData",new ExposureReportData());
             intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",data);
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
         });
@@ -216,7 +244,8 @@ public class FanacelReportContentAdapter extends RecyclerView.Adapter<FanacelRep
         TextView midpoints_registration;//参数调整明细
         TextView settlement_of_registration;//期货明细
         TextView payment_registration;//套保计划明细
-        TextView warehouse_register;//财务明细
+        TextView warehouse_register;//财务明细 品牌明细
+        TextView fanacel_register;//财务 品类明细
         ImageView load_more;//更多
         LinearLayout allView;//隐藏的底部操作空间
         LinearLayout all_click_View;//item左侧点击控件
@@ -240,6 +269,7 @@ public class FanacelReportContentAdapter extends RecyclerView.Adapter<FanacelRep
             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);
+            fanacel_register = itemView.findViewById(R.id.fanacel_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);

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

@@ -23,7 +23,10 @@ import java.util.List;
 
 import cn.muchinfo.rma.R;
 import cn.muchinfo.rma.global.data.AreaSpotplReportData;
+import cn.muchinfo.rma.global.data.AreaStockReportData;
 import cn.muchinfo.rma.global.data.AreaSumPLData;
+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;
@@ -114,6 +117,8 @@ public class SpotReportContentAdapter extends RecyclerView.Adapter<SpotReportCon
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
+
+        AreaSpotplReportData data = datas.get(i);
         itemViewHolder.tvLeftTitle.setText(datas.get(i).getCurrencyname());
 //        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
         //右边滑动部分
@@ -155,21 +160,25 @@ public class SpotReportContentAdapter extends RecyclerView.Adapter<SpotReportCon
         }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);
+            if (data.getCycletype().equals("0")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_spot_daydetail);
+                intent.putExtra("time",data.getReckondate());
             }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_spot);
+                intent.putExtra("tabtitle",Constant.table_mobile_report_spot_weekmonthdetail);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
             }
-            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
-            intent.putExtra("middlegoodsid","");
-            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",new AreaSumPLData());
+            intent.putExtra("AreaSpotplReportData",data);
+            intent.putExtra("ExposureReportData",new ExposureReportData());
             intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",new FinanceReportData());
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
         });

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

@@ -22,7 +22,10 @@ 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.AreaStockReportData;
 import cn.muchinfo.rma.global.data.AreaSumPLData;
+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;
@@ -114,6 +117,7 @@ public class SummaryReportContentAdapter extends RecyclerView.Adapter<SummaryRep
     @Override
     public void onBindViewHolder(@NonNull final ItemViewHolder itemViewHolder, int i) {
         this.index = i;
+        AreaSumPLData data = datas.get(i);
         itemViewHolder.tvLeftTitle.setText(datas.get(i).getCurrencyname());
 //        itemViewHolder.tv_left_bottom_title.setText(datas.get(i).getMiddlegoodscode());
         //右边滑动部分
@@ -156,18 +160,22 @@ public class SummaryReportContentAdapter extends RecyclerView.Adapter<SummaryRep
         //财务明细
         itemViewHolder.summary_details.setOnClickListener(view -> {
             Intent intent = new Intent();
-            intent.putExtra("title","汇总损益表明细");
+            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);
+            if (data.getCycletype().equals("0")){
+                intent.putExtra("tabtitle", Constant.table_mobile_report_sumprofit_daydetail);
+                intent.putExtra("time",data.getReckondate());
             }else {
-                intent.putExtra("tabtitle",Constant.table_mobile_report_sumprofit);
+                intent.putExtra("tabtitle",Constant.table_mobile_report_sumprofit_weekmonthdetail);
+                intent.putExtra("time",data.getBegindate() + "~" + data.getEnddate());
             }
-            intent.putExtra("currencyid",datas.get(i).getCurrencyid());
-            intent.putExtra("middlegoodsid","");
-            intent.putExtra("timeType",this.timeType);
+            intent.putExtra("AreaStockReportData",new AreaStockReportData());
+            intent.putExtra("AreaSumPLData",data);
+            intent.putExtra("AreaSpotplReportData",new AreaSpotplReportData());
+            intent.putExtra("ExposureReportData",new ExposureReportData());
             intent.putExtra("transactionUserid",this.transactionUserid);
+            intent.putExtra("FinanceReportData",new FinanceReportData());
             intent.setClass(context, ReportCommonDetailsActivity.class);
             ActivityUtils.startActivity(intent);
         });

+ 3 - 3
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/reportquery/reportdetail/RecordDetailsAdapter.java

@@ -188,12 +188,12 @@ public class RecordDetailsAdapter extends RecyclerView.Adapter<RecordDetailsAdap
             super(itemView);
             futures_subsidiary = itemView.findViewById(R.id.futures_subsidiary);
             place_the_order = itemView.findViewById(R.id.place_the_order);
-            exposure_tvLeftTitle = itemView.findViewById(R.id.exposure_tv_left_title);
+            exposure_tvLeftTitle = itemView.findViewById(R.id.tv_left_title);
             exposure_rvItemRight = itemView.findViewById(R.id.exposure_rv_item_right);
             exposure_horItemScrollview = itemView.findViewById(R.id.exposure_hor_item_scrollview);
             exposure_allView = itemView.findViewById(R.id.exposure_all_view);
-            exposure_tv_left_bottom_title = itemView.findViewById(R.id.exposure_tv_left_bottom_title);
-            exposure_all_click_View = itemView.findViewById(R.id.exposure_all_click_View);
+            exposure_tv_left_bottom_title = itemView.findViewById(R.id.tv_left_bottom_title);
+            exposure_all_click_View = itemView.findViewById(R.id.all_click_View);
             exposure_roots_view = itemView.findViewById(R.id.exposure_roots_view);
         }
     }

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

@@ -3,9 +3,11 @@ package cn.muchinfo.rma.view.base.home.reportquery.reportdetail
 import android.os.Bundle
 import android.view.Gravity
 import android.view.MotionEvent
+import android.view.View
 import androidx.recyclerview.widget.LinearLayoutManager
 import androidx.recyclerview.widget.RecyclerView
 import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.*
 import cn.muchinfo.rma.lifecycle.bindOptional
 import cn.muchinfo.rma.view.autoWidget.*
 import cn.muchinfo.rma.view.base.BaseActivity
@@ -36,25 +38,40 @@ class ReportCommonDetailsActivity : BaseActivity<ReportCommonDetailsViewModel>()
         intent.getStringExtra("tabtitle")
     }
 
-    //时间类型 1 是日明细。2是月明细 3是周明细
-    private val timeType by lazy {
-        intent.getStringExtra("timeType")
-    }
-
     //上个页面选择的用户id
     private val transactionUserid by lazy {
         intent.getStringExtra("transactionUserid")
     }
 
-    //查询敞口合同明细(敞口报表/现货合同明细)专用参数
-    private val middlegoodsid by lazy {
-        intent.getStringExtra("middlegoodsid")
+    //1 是日报表明细 2 是周月报表明细
+    private val timeType by lazy {
+        intent.getStringExtra("timeType")
     }
 
-    //查询财务报表日报表明细时需要用到currencyid
-    private val currencyid by lazy {
-        intent.getStringExtra("currencyid")
-    }
+    /**
+     * 财务报表传入的实体数据
+     */
+     private val financeReportData by lazy { intent.getParcelableExtra<FinanceReportData>("FinanceReportData") as FinanceReportData }
+
+    /**
+     * 敞口报表传入的实体数据
+     */
+    private val exposureReportData by lazy { intent.getParcelableExtra<ExposureReportData>("ExposureReportData") as ExposureReportData }
+
+    /**
+     * 现货报表传入的实体数据
+     */
+    private val areaSpotplReportData by lazy { intent.getParcelableExtra<AreaSpotplReportData>("AreaSpotplReportData") as AreaSpotplReportData }
+
+    /**
+     * 损益报表明细传入的实体数据
+     */
+    private val areaSumPLData by lazy { intent.getParcelableExtra<AreaSumPLData>("AreaSumPLData") as AreaSumPLData }
+
+    /***
+     * 库存报表传入的实体数据
+     */
+    private val areaStockReportData by lazy { intent.getParcelableExtra<AreaStockReportData>("AreaStockReportData") as AreaStockReportData }
 
     //列表头部表头adapter
     val topAdapter by lazy {
@@ -73,7 +90,8 @@ class ReportCommonDetailsActivity : BaseActivity<ReportCommonDetailsViewModel>()
 
     //数据初始化
     fun initData(){
-        viewModel.queryTitle(tabName = tabtitle ?: "",tradedate = time ?: "",userid = transactionUserid ?: "",middlegoodsid = middlegoodsid ?: "",querytype = timeType ?: "")
+        viewModel.queryTitle(tabName = tabtitle ?: "",userid = transactionUserid ?: "",financeReportData = financeReportData,exposureReportData = exposureReportData,areaSpotplReportData = areaSpotplReportData
+        ,areaSumPLData = areaSumPLData,areaStockReportData = areaStockReportData)
     }
 
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -105,6 +123,9 @@ class ReportCommonDetailsActivity : BaseActivity<ReportCommonDetailsViewModel>()
                 }
 
                 textView {
+                    if (transaction.isNullOrEmpty()){
+                        visibility = View.GONE
+                    }
                     text = "交易用户:"
                     textSizeAuto = 31
                     textColorInt = R.color.white

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

@@ -1,7 +1,10 @@
 package cn.muchinfo.rma.view.base.home.reportquery.reportdetail
 
 import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.ViewEnumUtils
 import cn.muchinfo.rma.global.data.*
+import cn.muchinfo.rma.global.isBlankString
 import cn.muchinfo.rma.global.toPercentage
 import cn.muchinfo.rma.view.MyApplication
 import cn.muchinfo.rma.view.autoWidget.toArrayList
@@ -26,7 +29,9 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
      * 请求该页面的列头
      * @param tabName String
      */
-    fun queryTitle(tabName : String,tradedate: String = "",userid : String = "",querytype : String = "",cycletype : String = "",middlegoodsid : String = "",currencyid : String = ""){
+    fun queryTitle(tabName : String,userid : String = "",financeReportData : FinanceReportData = FinanceReportData(),exposureReportData : ExposureReportData = ExposureReportData(),
+                   areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData()
+    ){
         val params = mutableMapOf<String, String>().apply {
             put("tableKey", tabName)
             put("tableType", "3")
@@ -38,99 +43,544 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
                     t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
                 })
                 exposureReportTitle.postValue(newlist)
-                //TODO 根据不同的taName进行不同的接口调用
-                queryListByTabName(tabName, tradedate, userid, querytype, cycletype,middlegoodsid ,currencyid)
+                //TODO 根据不同的tabName进行不同的接口调用
+                queryListByTabName(tabName, userid, financeReportData,exposureReportData,areaSpotplReportData,areaSumPLData,areaStockReportData)
             }
         }
     }
 
-    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
+    fun queryListByTabName(tabName : String,userid : String = "",financeReportData : FinanceReportData = FinanceReportData(),exposureReportData : ExposureReportData = ExposureReportData()
+    ,areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData()){
+        if (tabName == Constant.table_mobile_report_fincial_brand_daydetail){// 报表-财务报表-品牌日报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("middlegoodsid", middlegoodsid)
-                put("tradedate",tradedate)
+                put("querytype","2")
+                put("cycletype",financeReportData.cycletype ?: "")
+                put("cycletime",financeReportData.reckondate ?: "")
+                put("currencyid",financeReportData.currencyid ?: "")
             }
-            MyApplication.getInstance()?.reportManager?.qryAreaExpourseContractDetail(params = params) { isSuccess, respData, error ->
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params) { isSuccess, respData, error ->
                 if (isSuccess) {
-                    exposureReportDataList.postValue(resetAreaExpourseContractDetail(respData ?: arrayListOf()))
+                    exposureReportDataList.postValue(resetfincial_brand_daydetail(respData ?: arrayListOf()))
                 }
             }
-        }else if (tabName == Constant.table_mobile_report_expose){//敞口日报表明细
+        }else if (tabName == Constant.table_mobile_report_fincial_brand_weekmonthdetail){//报表-财务报表-品牌周月报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("querytype", "3")
-                put("begindate",(tradedate + "01").replace("-",""))
-                put("enddate",(tradedate + getMonthDays(tradedate)).replace("-",""))
-
+                put("querytype","2")
+                put("cycletype",financeReportData.cycletype ?: "")
+                put("cycletime",financeReportData.cycletime ?: "")
+            }
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetfincial_brand_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_fincial_wrstandard_daydetail){//报表-财务报表-品类日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("querytype","2")
+                put("cycletype",financeReportData.cycletype ?: "")
+                put("cycletime",financeReportData.reckondate ?: "")
+                put("currencyid",financeReportData.currencyid ?: "")
             }
-            MyApplication.getInstance()?.reportManager?.qryReckonAreaExpourse(params = params){isSuccess, respData, error ->
-                if (isSuccess){
-                    exposureReportDataList.postValue(getReportDayExposureRightData(respData ?: arrayListOf()))
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetfincial_wrstandard_daydetail(respData ?: arrayListOf()))
                 }
             }
-        } else if (tabName == Constant.table_mobile_report_expose_hedgeplan){//查询敞口套保计划明细(敞口报表/套保计划明细)
+        }else if (tabName == Constant.table_mobile_report_fincial_wrstandard_weekmonthdetail){//报表-财务报表-品类周月报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("middlegoodsid", middlegoodsid)
-                put("tradedate",tradedate)
+                put("querytype","2")
+                put("cycletype",financeReportData.cycletype ?: "")
+                put("cycletime",financeReportData.cycletime ?: "")
+            }
+            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetfincial_wrstandard_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_expose_spotcontract){//查询敞口合同明细(敞口报表/现货合同明细) QryAreaExpourseContractDetail
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("middlegoodsid", exposureReportData.middlegoodsid ?: "")
+                put("cycletype",exposureReportData.cycletype ?: "")
+                if (exposureReportData.cycletype == "0"){
+                    put("cycletime",exposureReportData.reckondate ?: "")
+                }else{
+                    put("cycletime",exposureReportData.cycletime ?: "")
+                }
+            }
+            MyApplication.getInstance()?.reportManager?.qryAreaExpourseContractDetail(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetAreaExpourseContractDetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_expose_hedgeplan){//查询敞口套保计划明细(敞口报表/套保计划明细)
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", userid)
+                put("middlegoodsid", exposureReportData.middlegoodsid ?: "")
+                put("cycletype",exposureReportData.cycletype ?: "")
+                if (exposureReportData.cycletype == "0"){
+                    put("cycletime",exposureReportData.reckondate ?: "")
+                }else{
+                    put("cycletime",exposureReportData.cycletime ?: "")
+                }
             }
             MyApplication.getInstance()?.reportManager?.qryAreaExpourseHedgeplanDetail(params = params) { isSuccess, respData, error ->
                 if (isSuccess) {
                     exposureReportDataList.postValue(resetAreaExpourseHedgeplanDetail(respData ?: arrayListOf()))
                 }
             }
-        } else if (tabName == Constant.table_mobile_report_fincial){//财务月报表明细
+        }else if (tabName == Constant.table_mobile_report_spot_daydetail){//报表-现货报表-日报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("querytype",querytype)
-                put("tradedate", tradedate)
+                put("querytype","2")
+                put("cycletype",areaSpotplReportData.cycletype ?: "")
+                put("cycletime",areaSpotplReportData.reckondate ?: "")
+                put("deliverygoodsid",areaSpotplReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaSpotplReportData.wrstandardid ?: "")
+                put("currencyid",areaSpotplReportData.currencyid ?: "")
             }
-
-            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
-                if (isSuccess){
-                    exposureReportDataList.postValue(getReportDayFanacelRightData(respData ?: arrayListOf(),"1"))
+            MyApplication.getInstance()?.reportManager?.qryAreaSpotplReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_spot_daydetail(respData ?: arrayListOf()))
                 }
             }
-        } else if (tabName == Constant.table_mobile_report_fincial_detail){//财务报表日报表明细
+        }else if (tabName == Constant.table_mobile_report_spot_weekmonthdetail){//报表-现货报表-周月报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("querytype","4")//日报表明细
-                put("tradedate", tradedate)
-                put("currencyid",currencyid)
+                put("querytype","2")
+                put("cycletype",areaSpotplReportData.cycletype ?: "")
+                put("cycletime",areaSpotplReportData.cycletime ?: "")
+                put("deliverygoodsid",areaSpotplReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaSpotplReportData.wrstandardid ?: "")
+                put("currencyid",areaSpotplReportData.currencyid ?: "")
             }
-
-            MyApplication.getInstance()?.reportManager?.qryFinanceReport(params = params){isSuccess, respData, error ->
-                if (isSuccess){
-                    exposureReportDataList.postValue(getReportDayFanacelRightData(respData ?: arrayListOf(),"4"))
+            MyApplication.getInstance()?.reportManager?.qryAreaSpotplReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_spot_weekmonthdetail(respData ?: arrayListOf()))
                 }
             }
-        }else if(tabName == Constant.table_mobile_report_sumprofit){//汇总损益报表月报表明细
+        }else if (tabName == Constant.table_mobile_report_sumprofit_daydetail){//报表-汇总损益报表-日报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("querytype",querytype)
-                put("tradedate", tradedate)
+                put("querytype","2")
+                put("cycletype",areaSumPLData.cycletype ?: "")
+                put("cycletime",areaSumPLData.reckondate ?: "")
+                put("currencyid",areaSumPLData.currencyid ?: "")
             }
-
-            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
-                if (isSuccess){
-                    exposureReportDataList.postValue(getReportDaySummaryRightData(respData ?: arrayListOf(),"1"))
+            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_sumprofit_daydetail(respData ?: arrayListOf()))
                 }
             }
-        }else if(tabName == Constant.table_mobile_report_sumprofit_detail){//汇总损益报表日报表明细
+        }else if (tabName == Constant.table_mobile_report_sumprofit_weekmonthdetail){//报表-汇总损益报表-周月报表明细
             val params = mutableMapOf<String, String>().apply {
                 put("userid", userid)
-                put("querytype","4")//日报表明细
-                put("tradedate", tradedate)
-                put("currencyid",currencyid)
+                put("querytype","2")
+                put("cycletype",areaSumPLData.cycletype ?: "")
+                put("cycletime",areaSumPLData.cycletime ?: "")
+                put("currencyid",areaSumPLData.currencyid ?: "")
             }
-
-            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params){isSuccess, respData, error ->
-                if (isSuccess){
-                    exposureReportDataList.postValue(getReportDaySummaryRightData(respData ?: arrayListOf(),"4"))
+            MyApplication.getInstance()?.reportManager?.qryAreaSumPL(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_sumprofit_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_warehousestock_daydetail){//报表-库存报表-(仓库维度)_日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.reckondate ?: "")
+                if (areaStockReportData.deliverygoodsid != "0"){
+                    put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                }
+                if (areaStockReportData.wrstandardid != "0"){
+                    put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                }
+                if (areaStockReportData.spotgoodsbrandid!= "0"){
+                    put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                }
+                if (areaStockReportData.warehouseinfoid != "0"){
+                    put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                }
+                put("sumfields","1,2,3,4")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_warehousestock_daydetail(respData ?: arrayListOf()))
+                }
+            }
+        } else if (tabName == Constant.table_mobile_report_warehousestock_weekmonthdetail){//报表-库存报表-(仓库维度)_周月报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.cycletime ?: "")
+                put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                put("sumfields","1,2,3,4")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_warehousestock_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_wrstandstock_warehouse_daydetail){//报表-库存报表-(品类维度)_仓库日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.reckondate ?: "")
+                put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                put("sumfields","1,2,3,4")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_wrstandstock_warehouse_daydetail(respData ?: arrayListOf()))
                 }
             }
+        }else if (tabName == Constant.table_mobile_report_wrstandstock_warehouse_weekmonthdetail){//报表-库存报表(品类维度)_仓库周月报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.cycletime ?: "")
+                put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                put("sumfields","1,2,3,4")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_wrstandstock_warehouse_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_wrstandstock_brand_daydetail){//报表-库存报表-(品类维度)_品牌日报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.reckondate ?: "")
+                put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                put("sumfields","1,2,3")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_wrstandstock_brand_daydetail(respData ?: arrayListOf()))
+                }
+            }
+        }else if (tabName == Constant.table_mobile_report_wrstandstock_brand_weekmonthdetail){//报表-库存报表-(品类维度)_品牌周月报表明细
+            val params = mutableMapOf<String, String>().apply {
+                put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+                put("querytype","2")
+                put("cycletype",areaStockReportData.cycletype ?: "")
+                put("cycletime",areaStockReportData.cycletime ?: "")
+                put("deliverygoodsid",areaStockReportData.deliverygoodsid ?: "")
+                put("wrstandardid",areaStockReportData.wrstandardid ?: "")
+                put("spotgoodsbrandid",areaStockReportData.spotgoodsbrandid ?: "")
+                put("warehouseinfoid",areaStockReportData.warehouseinfoid ?: "")
+                put("sumfields","1,2,3,4")
+            }
+            MyApplication.getInstance()?.warehouseManager?.queryAreaStockReport(params = params) { isSuccess, respData, error ->
+                if (isSuccess) {
+                    exposureReportDataList.postValue(resetreport_wrstandstock_brand_weekmonthdetail(respData ?: arrayListOf()))
+                }
+            }
+        }
+    }
+
+    //查询报表-库存报表-(品类维度)_品牌周月报表明细
+    fun resetreport_wrstandstock_brand_weekmonthdetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.reckondate ?: ""//日期
+            newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
+            newRightData.add(it.brandname  + "\n" + it.diffqty + it.enumdicname)//'现货品牌/\n 库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            newRightData.add(it.unbuyinqty + it.enumdicname + "\n" + it.unselloutqty + it.enumdicname)//''采购未入库量/\n 销售未出库量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-库存报表-(品类维度)_品牌日报表明细
+    fun resetreport_wrstandstock_brand_daydetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.deliverygoodsname + "\n" + it.wrstandardname//'现货品种/\n 现货品类 '
+            newRightData.add(it.brandname  + "\n" + it.diffqty + it.enumdicname)//'现货品牌/\n 库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            newRightData.add(it.unbuyinqty + it.enumdicname + "\n" + it.unselloutqty + it.enumdicname)//''采购未入库量/\n 销售未出库量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //报表-库存报表(品类维度)_仓库周月报表明细
+    fun resetreport_wrstandstock_warehouse_weekmonthdetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            data.leftContent = it.reckondate ?: ""//日期
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.warehousename + "\n" + it.deliverygoodsname)//'仓库/\n 现货品种 '
+            newRightData.add(it.wrstandardname  + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.diffqty + it.enumdicname)//'库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            data.rightData = newRightData
+            newList.add(data)
         }
+        return newList
+    }
+
+    //查询报表-库存报表(品类维度)_仓库日报表明细
+    fun resetreport_wrstandstock_warehouse_daydetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.warehousename + "\n" + it.deliverygoodsname//'仓库/\n 现货品种 '
+            newRightData.add(it.wrstandardname  + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.diffqty + it.enumdicname)//'库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-库存报表-(仓库维度)_周月报表明细
+    fun resetreport_warehousestock_weekmonthdetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            data.leftContent = it.reckondate ?: ""//日期
+            val newRightData = arrayListOf<String>()
+            newRightData.add(it.warehousename + "\n" + it.deliverygoodsname)//'仓库/\n 现货品种 '
+            newRightData.add(it.wrstandardname  + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.diffqty + it.enumdicname)//'库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-库存报表-(仓库维度)_日报表明细
+    fun resetreport_warehousestock_daydetail(dataList : List<AreaStockReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.warehousename + "\n" + it.deliverygoodsname//'仓库/\n 现货品种 '
+            newRightData.add(it.wrstandardname  + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.diffqty + it.enumdicname)//'库存变化量 '
+            newRightData.add(it.oristock + it.enumdicname + "\n" + it.curstock + it.enumdicname)//'期初库存量/\n 期末库存量'
+            newRightData.add(it.todaybuyinqty + it.enumdicname + "\n" + it.todayselloutqty + it.enumdicname)//'采购入库量/\n 销售出库量'
+            newRightData.add(it.todayproduceinqty + it.enumdicname + "\n" + it.todayproduceoutqty + it.enumdicname)//'内部入库量/\n 内部出库量 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-汇总损益报表-周月报表明细
+    fun resetreport_sumprofit_weekmonthdetail(dataList : List<AreaSumPLData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.reckondate ?: ""//日期
+            newRightData.add(it.currencyname  + "\n" + it.middlegoodsid)//'结算币种/\n 套保品种 ' TODO 缺少套保品种
+            newRightData.add(NumberUtils.roundNum(it.spotactualpl,2) + "\n" + NumberUtils.roundNum(it.spotfloatpl,2))//'现货损益/\n 现货浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.futureactualpl,2) + "\n" + NumberUtils.roundNum(it.futurefloatpl,2))//'期货损益/\n 期货浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.sumactualpl,2) + "\n" + NumberUtils.roundNum(it.sumpl,2))//'实际损益/\n 汇总损益 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+
+    //查询报表-汇总损益报表-日报表明细
+    fun resetreport_sumprofit_daydetail(dataList : List<AreaSumPLData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.currencyname  + "\n" + it.middlegoodsid//'结算币种/\n 套保品种 ' TODO 缺少套保品种
+            newRightData.add(NumberUtils.roundNum(it.spotactualpl,2) + "\n" + NumberUtils.roundNum(it.spotfloatpl,2))//'现货损益/\n 现货浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.futureactualpl,2) + "\n" + NumberUtils.roundNum(it.futurefloatpl,2))//'期货损益/\n 期货浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.sumactualpl,2) + "\n" + NumberUtils.roundNum(it.sumpl,2))//'实际损益/\n 汇总损益 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-现货报表-周月报表明细
+    fun resetreport_spot_weekmonthdetail(dataList : List<AreaSpotplReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.reckondate ?: ""//日期
+            newRightData.add(it.currencyname + "\n" + it.deliverygoodsname)//'结算币种/\n现货品种'
+            newRightData.add(it.wrstandardname + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.oriqty + it.enumdicname + "\n" + it.curqty + it.enumdicname)//'期初量/\n 期末量 '
+            newRightData.add(it.todaybuyqty + it.enumdicname + "\n" + it.todaysellqty + it.enumdicname)//'今采购量/\n 今销售量 '
+            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 '
+            newRightData.add(NumberUtils.roundNum(it.oriamount,2) + "\n" + NumberUtils.roundNum(it.curamount,2))//'期初额/\n 期末额 '
+            newRightData.add(NumberUtils.roundNum(it.oriaverageprice,2) + "\n" + NumberUtils.roundNum(it.curaverageprice,2))//'期初均价/\n 期末均价 '
+            newRightData.add(NumberUtils.roundNum(it.todaybuyamount,2) + "\n" + NumberUtils.roundNum(it.todaysellamount,2))//'今采购额/\n 今销售额 '
+            newRightData.add(NumberUtils.roundNum(it.todaybuyaverageprice,2) + "\n" + NumberUtils.roundNum(it.todaysellaverageprice,2))//'采购均价/\n 销售均价 ',
+            newRightData.add(NumberUtils.roundNum(it.actualpl,2) + "\n" + NumberUtils.roundNum(it.floatpl,2))//'现货损益/\n 浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.curspotprice,2) + "\n" + NumberUtils.roundNum(it.curmarketvalue,2))// '最新价/\n 期末市值 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-现货报表-日报表明细
+    fun resetreport_spot_daydetail(dataList : List<AreaSpotplReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.currencyname + "\n" + it.deliverygoodsname//'结算币种/\n现货品种'
+            newRightData.add(it.wrstandardname + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(it.oriqty + it.enumdicname + "\n" + it.curqty + it.enumdicname)//'期初量/\n 期末量 '
+            newRightData.add(it.todaybuyqty + it.enumdicname + "\n" + it.todaysellqty + it.enumdicname)//'今采购量/\n 今销售量 '
+            newRightData.add(it.todayinqty + it.enumdicname + "\n" + it.todayoutqty + it.enumdicname)//'今入库量/\n 今出库量 '
+            newRightData.add(NumberUtils.roundNum(it.oriamount,2) + "\n" + NumberUtils.roundNum(it.curamount,2))//'期初额/\n 期末额 '
+            newRightData.add(NumberUtils.roundNum(it.oriaverageprice,2) + "\n" + NumberUtils.roundNum(it.curaverageprice,2))//'期初均价/\n 期末均价 '
+            newRightData.add(NumberUtils.roundNum(it.todaybuyamount,2) + "\n" + NumberUtils.roundNum(it.todaysellamount,2))//'今采购额/\n 今销售额 '
+            newRightData.add(NumberUtils.roundNum(it.todaybuyaverageprice,2) + "\n" + NumberUtils.roundNum(it.todaysellaverageprice,2))//'采购均价/\n 销售均价 ',
+            newRightData.add(NumberUtils.roundNum(it.actualpl,2) + "\n" + NumberUtils.roundNum(it.floatpl,2))//'现货损益/\n 浮动损益 '
+            newRightData.add(NumberUtils.roundNum(it.curspotprice,2) + "\n" + NumberUtils.roundNum(it.curmarketvalue,2))// '最新价/\n 期末市值 '
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-财务报表-品牌日报表明细
+    fun resetfincial_brand_daydetail(dataList : List<FinanceReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.currencyname + "\n" + it.deliverygoodsname//'结算币种/\n现货品种'
+            newRightData.add(it.wrstandardname + "\n" + it.brandname)//'现货品类/\n 现货品牌 '
+            newRightData.add(NumberUtils.roundNum(it.buytodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.buytodayrefundamount,2))//'今付贷款额/\n 今收退款额 '
+            newRightData.add(NumberUtils.roundNum(it.selltodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2))//'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(it.buytodayinvoiceamount,2) + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2))//'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(it.buyprepaidamount,2) + "\n" + NumberUtils.roundNum(it.buyunpaidamount,2))//预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(it.buypreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.buyuninvoicedamount,2))//'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(it.sellprepaidamount,2) + "\n" + NumberUtils.roundNum(it.sellunpaidamount,2))//'预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(it.sellpreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.selluninvoicedamount,2))//'预开票额/\n 应开票额'
+            newRightData.add(NumberUtils.roundNum(it.todayreceivesum,2) + "\n" + NumberUtils.roundNum(it.todaypaysum,2))//'今收款合计/\n 今付款合计'
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-财务报表-品牌周月报表明细
+    fun resetfincial_brand_weekmonthdetail(dataList : List<FinanceReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.reckondate + "\n" + it.currencyname//'日期/\n结算币种'
+            newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
+            newRightData.add(it.brandname ?: "--")//'现货品牌'
+            newRightData.add(NumberUtils.roundNum(it.buytodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.buytodayrefundamount,2))//'今付贷款额/\n 今收退款额 '
+            newRightData.add(NumberUtils.roundNum(it.selltodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2))//'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(it.buytodayinvoiceamount,2) + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2))//'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(it.buyprepaidamount,2) + "\n" + NumberUtils.roundNum(it.buyunpaidamount,2))//预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(it.buypreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.buyuninvoicedamount,2))//'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(it.sellprepaidamount,2) + "\n" + NumberUtils.roundNum(it.sellunpaidamount,2))//'预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(it.sellpreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.selluninvoicedamount,2))//'预开票额/\n 应开票额'
+            newRightData.add(NumberUtils.roundNum(it.todayreceivesum,2) + "\n" + NumberUtils.roundNum(it.todaypaysum,2))//'今收款合计/\n 今付款合计'
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-财务报表-品类日报表明细
+    fun resetfincial_wrstandard_daydetail(dataList : List<FinanceReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.currencyname ?: "--"//'结算币种'
+            newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
+            newRightData.add(NumberUtils.roundNum(it.buytodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.buytodayrefundamount,2))//'今付贷款额/\n 今收退款额 '
+            newRightData.add(NumberUtils.roundNum(it.selltodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2))//'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(it.buytodayinvoiceamount,2) + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2))//'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(it.buyprepaidamount,2) + "\n" + NumberUtils.roundNum(it.buyunpaidamount,2))//预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(it.buypreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.buyuninvoicedamount,2))//'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(it.sellprepaidamount,2) + "\n" + NumberUtils.roundNum(it.sellunpaidamount,2))//'预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(it.sellpreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.selluninvoicedamount,2))//'预开票额/\n 应开票额'
+            newRightData.add(NumberUtils.roundNum(it.todayreceivesum,2) + "\n" + NumberUtils.roundNum(it.todaypaysum,2))//'今收款合计/\n 今付款合计'
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
+    }
+
+    //查询报表-财务报表-品类周月报表明细
+    fun resetfincial_wrstandard_weekmonthdetail(dataList : List<FinanceReportData>) : List<ReportCommonDetailData>{
+        val newList = arrayListOf<ReportCommonDetailData>()
+        dataList.forEach {
+            val data = ReportCommonDetailData()
+            val newRightData = arrayListOf<String>()
+            data.leftContent = it.reckondate + "\n" + it.currencyname ?: "--"//'日期/\n结算币种'
+            newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
+            newRightData.add(NumberUtils.roundNum(it.buytodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.buytodayrefundamount,2))//'今付贷款额/\n 今收退款额 '
+            newRightData.add(NumberUtils.roundNum(it.selltodaysettleamount,2) + "\n" + NumberUtils.roundNum(it.selltodayrefundamount,2))//'今收货款额/\n 今付退款额 '
+            newRightData.add(NumberUtils.roundNum(it.buytodayinvoiceamount,2) + "\n" + NumberUtils.roundNum(it.selltodayinvoiceamount,2))//'今收票额/\n 今开票额'
+            newRightData.add(NumberUtils.roundNum(it.buyprepaidamount,2) + "\n" + NumberUtils.roundNum(it.buyunpaidamount,2))//预付贷款额/\n 应付贷款额'
+            newRightData.add(NumberUtils.roundNum(it.buypreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.buyuninvoicedamount,2))//'预收票额/\n 应收票额'
+            newRightData.add(NumberUtils.roundNum(it.sellprepaidamount,2) + "\n" + NumberUtils.roundNum(it.sellunpaidamount,2))//'预收贷款额/\n 应收贷款额'
+            newRightData.add(NumberUtils.roundNum(it.sellpreinvoicedamount,2) + "\n" + NumberUtils.roundNum(it.selluninvoicedamount,2))//'预开票额/\n 应开票额'
+            newRightData.add(NumberUtils.roundNum(it.todayreceivesum,2) + "\n" + NumberUtils.roundNum(it.todaypaysum,2))//'今收款合计/\n 今付款合计'
+            data.rightData = newRightData
+            newList.add(data)
+        }
+        return newList
     }
 
     //查询敞口套保计划明细(敞口报表/套保计划明细)
@@ -139,12 +589,11 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
         dataList.forEach {
             val data = ReportCommonDetailData()
             val newRightData = arrayListOf<String>()
-            data.leftContent = it.contractno + "\n" + if (it.contracttype == "1"){ "采购" }else{ "销售" }
-            newRightData.add(it.buyusername + "\n" + it.sellusername)
-            newRightData.add(it.deliverygoodsid + "\n" + it.middlegoodsname)//缺少现货品种名称
-            newRightData.add(it.wrstandardname + "\n" + it.wrstandardname)//缺少品牌名称
-            newRightData.add(it.curqty + it.enumdicname + "\n" + it.diffqty + it.enumdicname)
-            newRightData.add(if (it.contracttype == "1"){ "套保" }else{ "套利" })
+            data.leftContent = if (it.contracttype == "1"){ "采购" }else{ "销售" } + "\n" + ViewEnumUtils.getHedgeplanstatus(it.hedgeplanstatus)//'计划类型/\n 计划状态 '
+            newRightData.add(it.deliverygoodsname + "\n" + it.middlegoodsname)//'现货品种/\n 套保品种 '
+            newRightData.add(it.wrstandardname + "\n" + it.qty + it.enumdicname)//'现货品类/\n 计划量 '
+            newRightData.add(it.diffqty + it.enumdicname + "\n" + it.changqty + it.enumdicname)//'套保品种今变动量/\n 应套保总量变动量 '
+            newRightData.add(it.tradedate + "\n" + it.tradedate)//'期现用途/\n 登记日 ' // TODO 缺少期限用途
             data.rightData = newRightData
             newList.add(data)
         }
@@ -157,12 +606,12 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
         dataList.forEach {
             val data = ReportCommonDetailData()
             val newRightData = arrayListOf<String>()
-            data.leftContent = if (it.contracttype == "1"){ "采购" }else{ "销售" } + "\n" + if (it.contracttype == "1"){ "采购" }else{ "销售" }//缺少套保计划状态
-            newRightData.add(it.buyusername + "\n" + it.sellusername)
-            newRightData.add(it.deliverygoodsid + "\n" + it.middlegoodsname)//缺少现货品种名称
-            newRightData.add(it.wrstandardname + "\n" + it.qty + it.mgunitidname)//缺少品牌名称
-            newRightData.add(it.diffqty + it.mgunitidname + "\n" + it.changqty + it.mgunitidname)
-            newRightData.add(if (it.contracttype == "1"){ "套保" }else{ "套利" } + "\n" + it.tradedate)
+            data.leftContent = it.deliverygoodsname + "\n" + it.middlegoodsname//'现货品种/\n 套保品种 '
+            newRightData.add(it.brandname + "\n" + if (it.contracttype == "1"){ "套保" }else{ "套利" })//'现货品类/\n 业务类型 '
+            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//采购量/\n 销售量 '// TODO 缺少 采购量  销售量
+            newRightData.add(it.qty + it.mgunitidname + "\n" + it.qty + it.mgunitidname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量  销售计划套保量
+            newRightData.add(it.qty + it.mgunitidname + "\n" + it.diffqty + it.mgunitidname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
+            newRightData.add(it.convertratio.toPercentage())//'数量折算系数 '
             data.rightData = newRightData
             newList.add(data)
         }

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

@@ -0,0 +1,2 @@
+package cn.muchinfo.rma.view.base.main.castsurely
+

+ 15 - 1
RMA/app/src/main/res/layout/exposure_report_layout_item_content.xml

@@ -123,6 +123,7 @@
             android:textColor="@color/rma_blue_color"
             android:background="@drawable/rma_item_click_bg"/>
 
+<!--        财务明细 品牌明细-->
         <TextView
             android:visibility="gone"
             android:id="@+id/warehouse_register"
@@ -131,7 +132,20 @@
             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/fanacel_register"
+            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"/>
 

+ 16 - 2
RMA/app/src/main/res/layout/layout_item_inventory_current.xml

@@ -77,24 +77,38 @@
 
 
         <TextView
+            android:visibility="gone"
             android:id="@+id/futures_subsidiary"
             android:layout_marginEnd="10dp"
             android:gravity="center"
             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/place_the_order"
             android:layout_marginEnd="10dp"
             android:gravity="center"
             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/inventory_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"/>