|
|
@@ -30,7 +30,8 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
|
|
|
* @param tabName String
|
|
|
*/
|
|
|
fun queryTitle(tabName : String,userid : String = "",financeReportData : FinanceReportData = FinanceReportData(),exposureReportData : ExposureReportData = ExposureReportData(),
|
|
|
- areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData()
|
|
|
+ areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData(),
|
|
|
+ futureDataReportData : FutureDataReportData = FutureDataReportData()
|
|
|
){
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("tableKey", tabName)
|
|
|
@@ -44,13 +45,14 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
|
|
|
})
|
|
|
exposureReportTitle.postValue(newlist)
|
|
|
//TODO 根据不同的tabName进行不同的接口调用
|
|
|
- queryListByTabName(tabName, userid, financeReportData,exposureReportData,areaSpotplReportData,areaSumPLData,areaStockReportData)
|
|
|
+ queryListByTabName(tabName, userid, financeReportData,exposureReportData,areaSpotplReportData,areaSumPLData,areaStockReportData,futureDataReportData)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
fun queryListByTabName(tabName : String,userid : String = "",financeReportData : FinanceReportData = FinanceReportData(),exposureReportData : ExposureReportData = ExposureReportData()
|
|
|
- ,areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData()){
|
|
|
+ ,areaSpotplReportData : AreaSpotplReportData = AreaSpotplReportData(),areaSumPLData : AreaSumPLData = AreaSumPLData(),areaStockReportData : AreaStockReportData = AreaStockReportData(),
|
|
|
+ futureDataReportData : FutureDataReportData = FutureDataReportData()){
|
|
|
if (tabName == Constant.table_mobile_report_fincial_brand_daydetail){// 报表-财务报表-品牌日报表明细
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("userid", userid)
|
|
|
@@ -335,7 +337,157 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
|
|
|
exposureReportDataList.postValue(resetreport_wrstandstock_brand_weekmonthdetail(respData ?: arrayListOf()))
|
|
|
}
|
|
|
}
|
|
|
+ }else if (tabName == Constant.table_mobile_report_futures_daydetail){//报表-期货报表_账户明细-日报表-
|
|
|
+ val params = mutableMapOf<String, String>().apply {
|
|
|
+ put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ put("querytype","2")
|
|
|
+ put("cycletype",futureDataReportData.cycletype ?: "")
|
|
|
+ put("cycletime",futureDataReportData.cycletime ?: "")
|
|
|
+ put("currencyid",futureDataReportData.currencyid ?: "")
|
|
|
+ put("goodsgroupid",futureDataReportData.goodsgroupid ?: "")
|
|
|
+ put("goodsid",futureDataReportData.goodsid ?: "")
|
|
|
+ put("buyorsell",futureDataReportData.buyorsell ?: "")
|
|
|
+ }
|
|
|
+ MyApplication.getInstance()?.reportManager?.qryTaFutureDataReport(params = params) { isSuccess, respData, error ->
|
|
|
+ if (isSuccess) {
|
|
|
+ exposureReportDataList.postValue(resettable_mobile_report_futures_daydetail(respData ?: arrayListOf()))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (tabName == Constant.table_mobile_report_futures_weekmonthdetail){//报表-期货报表_账户明细-周月报表
|
|
|
+ val params = mutableMapOf<String, String>().apply {
|
|
|
+ put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
+ put("querytype","2")
|
|
|
+ put("cycletype",futureDataReportData.cycletype ?: "")
|
|
|
+ put("cycletime",futureDataReportData.cycletime ?: "")
|
|
|
+ put("currencyid",futureDataReportData.currencyid ?: "")
|
|
|
+ put("goodsgroupid",futureDataReportData.goodsgroupid ?: "")
|
|
|
+ put("goodsid",futureDataReportData.goodsid ?: "")
|
|
|
+ put("buyorsell",futureDataReportData.buyorsell ?: "")
|
|
|
+ }
|
|
|
+ MyApplication.getInstance()?.reportManager?.qryTaFutureDataReport(params = params) { isSuccess, respData, error ->
|
|
|
+ if (isSuccess) {
|
|
|
+ exposureReportDataList.postValue(resettable_mobile_report_futures_weekmonthdetail(respData ?: arrayListOf()))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (tabName == Constant.table_mobile_report_expose_futures_day){//敞口-期货变动量明细——日报表
|
|
|
+ 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?.qryAreaExpourseFutuDetail(params = params) { isSuccess, respData, error ->
|
|
|
+ if (isSuccess) {
|
|
|
+ exposureReportDataList.postValue(resettable_mobile_report_expose_futures_day(respData ?: arrayListOf()))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (tabName == Constant.table_mobile_report_expose_futures_weekmonth){//敞口-期货变动量明细-月周报表
|
|
|
+ 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?.qryAreaExpourseFutuDetail(params = params) { isSuccess, respData, error ->
|
|
|
+ if (isSuccess) {
|
|
|
+ exposureReportDataList.postValue(resettable_mobile_report_expose_futures_weekmonth(respData ?: arrayListOf()))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //敞口-期货变动量明细-月周报表
|
|
|
+ fun resettable_mobile_report_expose_futures_weekmonth(dataList : List<ExpourseFutuDetailData>) : List<ReportCommonDetailData>{
|
|
|
+ val newList = arrayListOf<ReportCommonDetailData>()
|
|
|
+ dataList.forEach {
|
|
|
+ val data = ReportCommonDetailData()
|
|
|
+ val newRightData = arrayListOf<String>()
|
|
|
+ data.leftContent = it.tradedate ?: ""//日期
|
|
|
+ newRightData.add(it.accountname + "\n" +it.goodsname) //'交易账户/\n 交易品种 ' TODO 交易品种
|
|
|
+ newRightData.add(it.goodsname + "\n" + if (it.buyorsell == "0"){ "买" }else{ "卖" })//'交易合约/\n 方向 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.holdqty,2) + it.enumdicname)//'期初持仓量/\n 期末持仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.todaycloseqty,2) + it.enumdicname)//'今开仓量/\n 今平仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.difftradeqty,2) + it.enumdicname )//'交易品种今变化量 '
|
|
|
+ newRightData.add(it.middlegoodsname + "\n" + NumberUtils.roundNum(it.diffmgqty,2) + it.enumdicname)//'套保品种/\n套保品种今变化量 '
|
|
|
+ data.rightData = newRightData
|
|
|
+ newList.add(data)
|
|
|
+ }
|
|
|
+ return newList
|
|
|
+ }
|
|
|
+
|
|
|
+ //敞口-期货变动量明细——日报表
|
|
|
+ fun resettable_mobile_report_expose_futures_day(dataList : List<ExpourseFutuDetailData>) : List<ReportCommonDetailData>{
|
|
|
+ val newList = arrayListOf<ReportCommonDetailData>()
|
|
|
+ dataList.forEach {
|
|
|
+ val data = ReportCommonDetailData()
|
|
|
+ val newRightData = arrayListOf<String>()
|
|
|
+ data.leftContent = it.accountname + "\n" +it.goodsname //'交易账户/\n 交易品种 ' TODO 交易品种
|
|
|
+ newRightData.add(it.goodsname + "\n" + if (it.buyorsell == "0"){ "买" }else{ "卖" })//'交易合约/\n 方向 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.holdqty,2) + it.enumdicname)//'期初持仓量/\n 期末持仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.todaycloseqty,2) + it.enumdicname)//'今开仓量/\n 今平仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.difftradeqty,2) + it.enumdicname )//'交易品种今变化量 '
|
|
|
+ newRightData.add(it.middlegoodsname + "\n" + NumberUtils.roundNum(it.diffmgqty,2) + it.enumdicname)//'套保品种/\n套保品种今变化量 '
|
|
|
+ data.rightData = newRightData
|
|
|
+ newList.add(data)
|
|
|
+ }
|
|
|
+ return newList
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询报表-库存报表-(品类维度)_品牌日报表明细
|
|
|
+ fun resettable_mobile_report_futures_weekmonthdetail(dataList : List<FutureDataReportData>) : List<ReportCommonDetailData>{
|
|
|
+ val newList = arrayListOf<ReportCommonDetailData>()
|
|
|
+ dataList.forEach {
|
|
|
+ val data = ReportCommonDetailData()
|
|
|
+ val newRightData = arrayListOf<String>()
|
|
|
+ data.leftContent = it.reckondate ?: ""//日期
|
|
|
+ newRightData.add(it.accountname + "\n" + it.currencyid)//'交易账户/\n 结算币种 '
|
|
|
+ newRightData.add(it.goodsgroupname + "\n" + it.goodsname + "/" + if (it.buyorsell == "0") {"买"}else{"卖"})//'交易品种/\n 交易合约/方向 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.holdqty,2) + it.enumdicname)//''期初持仓量/\n 期末持仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.todaycloseqty,2) + it.enumdicname)//''今开仓量/\n 今平仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriopenamount,2) + "\n" + NumberUtils.roundNum(it.openamount,2))//'期初开仓额/\n 期末开仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdamount,2) + "\n" + NumberUtils.roundNum(it.holdamount,2))//'期初持仓额/\n 期末持仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenamount,2) + "\n" + NumberUtils.roundNum(it.todaycloseamount,2))//'今开仓额/\n 今平仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenamount,2) + "\n" + NumberUtils.roundNum(it.todaycloseamount,2))//'开仓均价/\n 平仓均价 ' TODO 缺少
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.reckonprice,2) + "\n" + NumberUtils.roundNum(it.reckonholdamount,2))//'结算价/\n 结算持仓额 ',
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.closepl,2) + "\n" + NumberUtils.roundNum(it.reckonpl,2))//'平仓损益/\n 结算损益 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.charge,2) + "\n" + NumberUtils.roundNum(it.goodsgroupspotqty,2))//'续费/\n 交易品种期末量 '
|
|
|
+ newRightData.add(it.middlegoodsqty + "\n" + NumberUtils.roundNum(it.todaymiddlegoodsqty,2) + it.enumdicname)//'套保品种/\n 套保品种变动量 'TODO 缺少套保品种
|
|
|
+ data.rightData = newRightData
|
|
|
+ newList.add(data)
|
|
|
}
|
|
|
+ return newList
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询报表-库存报表-(品类维度)_品牌日报表明细
|
|
|
+ fun resettable_mobile_report_futures_daydetail(dataList : List<FutureDataReportData>) : List<ReportCommonDetailData>{
|
|
|
+ val newList = arrayListOf<ReportCommonDetailData>()
|
|
|
+ dataList.forEach {
|
|
|
+ val data = ReportCommonDetailData()
|
|
|
+ val newRightData = arrayListOf<String>()
|
|
|
+ data.leftContent = it.accountname + "\n" + it.currencyid//'交易账户/\n 结算币种 '
|
|
|
+ newRightData.add(it.goodsgroupname + "\n" + it.goodsname + "/" + if (it.buyorsell == "0") {"买"}else{"卖"})//'交易品种/\n 交易合约/方向 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.holdqty,2) + it.enumdicname)//''期初持仓量/\n 期末持仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenqty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.todaycloseqty,2) + it.enumdicname)//''今开仓量/\n 今平仓量 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriopenamount,2) + "\n" + NumberUtils.roundNum(it.openamount,2))//'期初开仓额/\n 期末开仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.oriholdamount,2) + "\n" + NumberUtils.roundNum(it.holdamount,2))//'期初持仓额/\n 期末持仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenamount,2) + "\n" + NumberUtils.roundNum(it.todaycloseamount,2))//'今开仓额/\n 今平仓额 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.todayopenamount,2) + "\n" + NumberUtils.roundNum(it.todaycloseamount,2))//'开仓均价/\n 平仓均价 ' TODO 缺少
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.reckonprice,2) + "\n" + NumberUtils.roundNum(it.reckonholdamount,2))//'结算价/\n 结算持仓额 ',
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.closepl,2) + "\n" + NumberUtils.roundNum(it.reckonpl,2))//'平仓损益/\n 结算损益 '
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.charge,2) + "\n" + NumberUtils.roundNum(it.goodsgroupspotqty,2))//'续费/\n 交易品种期末量 '
|
|
|
+ newRightData.add(it.middlegoodsqty + "\n" + NumberUtils.roundNum(it.todaymiddlegoodsqty,2) + it.enumdicname)//'套保品种/\n 套保品种变动量 'TODO 缺少套保品种
|
|
|
+ data.rightData = newRightData
|
|
|
+ newList.add(data)
|
|
|
+ }
|
|
|
+ return newList
|
|
|
}
|
|
|
|
|
|
//查询报表-库存报表-(品类维度)_品牌周月报表明细
|
|
|
@@ -661,12 +813,12 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
|
|
|
val data = ReportCommonDetailData()
|
|
|
val newRightData = arrayListOf<String>()
|
|
|
data.leftContent = it.tradedate//日期//
|
|
|
- newRightData.add(it.deliverygoodsname + "\n" + it.middlegoodsname)//'现货品种/\n 套保品种 '
|
|
|
- newRightData.add(it.wrstandardname + "\n" + if (it.contracttype == "1"){ "套保" }else{ "套利" })//'现货品类/\n 业务类型 '
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//采购量/\n 销售量 '// TODO 缺少 采购量 销售量
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量 销售计划套保量
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffqty,2) + it.enumdicname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
|
|
|
- newRightData.add(it.convertratio)//'数量折算系数 '
|
|
|
+ newRightData.add(it.contractno + "\n" + if (it.contracttype == "1"){ "采购" }else{ "销售" })//'合同编号/\n 合同类型 '
|
|
|
+ newRightData.add(it.buyusername + "\n" + it.sellusername)//'采购方/\n 销售方 '
|
|
|
+ newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
|
|
|
+ newRightData.add(it.deliverygoodsname + "\n" + NumberUtils.roundNum(it.todaypricedqty,2) + it.enumdicname)//'期现用途/\n 今定价量 ' TODO缺少期现用途
|
|
|
+ newRightData.add(it.middlegoodsname + "\n" + NumberUtils.roundNum(it.diffhedgeqty,2) + it.enumdicname)//'套保品种/\n 套保变动量 ' //
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.diffneedhedgeqty,2) + it.enumdicname)//'应套保变动量 ',
|
|
|
data.rightData = newRightData
|
|
|
newList.add(data)
|
|
|
}
|
|
|
@@ -679,12 +831,12 @@ class ReportCommonDetailsViewModel : BaseViewModel(){
|
|
|
dataList.forEach {
|
|
|
val data = ReportCommonDetailData()
|
|
|
val newRightData = arrayListOf<String>()
|
|
|
- data.leftContent = it.deliverygoodsname + "\n" + it.middlegoodsname//'现货品种/\n 套保品种 '
|
|
|
- newRightData.add(it.wrstandardname + "\n" + if (it.contracttype == "1"){ "套保" }else{ "套利" })//'现货品类/\n 业务类型 '
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//采购量/\n 销售量 '// TODO 缺少 采购量 销售量
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.qty,2) + it.enumdicname)//'采购计划套保量/\n 销售计划套保量 '// TODO 缺少 采购计划套保量 销售计划套保量
|
|
|
- newRightData.add(NumberUtils.roundNum(it.qty,2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffqty,2) + it.enumdicname)//'合计变动量/\n 套保品种变动量 ' // TODO 缺少合计变动量
|
|
|
- newRightData.add(it.convertratio)//'数量折算系数 '
|
|
|
+ data.leftContent = it.contractno + "\n" + if (it.contracttype == "1"){ "采购" }else{ "销售" }//'合同编号/\n 合同类型 '
|
|
|
+ newRightData.add(it.buyusername + "\n" + it.sellusername)//'采购方/\n 销售方 '
|
|
|
+ newRightData.add(it.deliverygoodsname + "\n" + it.wrstandardname)//'现货品种/\n 现货品类 '
|
|
|
+ newRightData.add(it.deliverygoodsname + "\n" + NumberUtils.roundNum(it.todaypricedqty,2) + it.enumdicname)//'期现用途/\n 今定价量 ' TODO缺少期现用途
|
|
|
+ newRightData.add(it.middlegoodsname + "\n" + NumberUtils.roundNum(it.diffhedgeqty,2) + it.enumdicname)//'套保品种/\n 套保变动量 ' //
|
|
|
+ newRightData.add(NumberUtils.roundNum(it.diffneedhedgeqty,2) + it.enumdicname)//'应套保变动量 ',
|
|
|
data.rightData = newRightData
|
|
|
newList.add(data)
|
|
|
}
|