|
@@ -134,6 +134,11 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
val ermcp3GoodsbrandDataList : MutableLiveData<List<Ermcp3GoodsbrandData>> = MutableLiveData()
|
|
val ermcp3GoodsbrandDataList : MutableLiveData<List<Ermcp3GoodsbrandData>> = MutableLiveData()
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 交易账号列表
|
|
|
|
|
+ */
|
|
|
|
|
+ val tradingAccountManagerList : MutableLiveData<List<AccMgrLoginUserData>> = MutableLiveData()
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 查询财务日报表(菜单:报表查询/财务报表/日报表)
|
|
* 查询财务日报表(菜单:报表查询/财务报表/日报表)
|
|
|
* @param tradedate String
|
|
* @param tradedate String
|
|
|
*/
|
|
*/
|
|
@@ -218,13 +223,14 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 查询敞口日报表(菜单:报表查询/敞口报表/敞口日报表)
|
|
|
|
|
|
|
+ * 查询敞口周期报表(报表/敞口报表/周(月、季、年)报表)
|
|
|
* @param tradedate String
|
|
* @param tradedate String
|
|
|
*/
|
|
*/
|
|
|
- fun qryReportDayExposure(tradedate: String){
|
|
|
|
|
|
|
+ fun qryReportAreaExpourse(cycletime: String,cycletype : String,userid : String){
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
- put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
|
|
- put("tradedate", tradedate)
|
|
|
|
|
|
|
+ put("userid", userid)
|
|
|
|
|
+ put("cycletime", cycletime)
|
|
|
|
|
+ put("cycletype",cycletype)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
MyApplication.getInstance()?.reportManager?.qryReportDayExposure(params = params){isSuccess, respData, error ->
|
|
MyApplication.getInstance()?.reportManager?.qryReportDayExposure(params = params){isSuccess, respData, error ->
|
|
@@ -235,6 +241,24 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 敞口报表第三步先查询日报表(进入页面默认查询日报表)
|
|
|
|
|
+ * 查询敞口日报表
|
|
|
|
|
+ * @param tradedate String
|
|
|
|
|
+ */
|
|
|
|
|
+ fun qryReckonAreaExpourse(tradedate: String,userid : String){
|
|
|
|
|
+ val params = mutableMapOf<String, String>().apply {
|
|
|
|
|
+ put("userid", userid)
|
|
|
|
|
+ put("tradedate", tradedate)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ MyApplication.getInstance()?.reportManager?.qryReckonAreaExpourse(params = params){isSuccess, respData, error ->
|
|
|
|
|
+ if (isSuccess){
|
|
|
|
|
+ exposureReportDataList.postValue(getReportDayExposureRightData(respData ?: arrayListOf()))
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 查询现货日报表(菜单:报表查询/现货报表/现货日报表)
|
|
* 查询现货日报表(菜单:报表查询/现货报表/现货日报表)
|
|
|
* @param tradedate String
|
|
* @param tradedate String
|
|
|
*/
|
|
*/
|
|
@@ -324,12 +348,42 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 敞口报表第一步先查询交易用户
|
|
|
|
|
+ * 查询账户管理登录账号(账户管理/交易账号)
|
|
|
|
|
+ */
|
|
|
|
|
+ fun queryTradingAccMgrLoginUser(tradedate : String){
|
|
|
|
|
+ val params = mutableMapOf<String, String>().apply {
|
|
|
|
|
+ put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
|
|
|
|
|
+ put("querytype", "2")
|
|
|
|
|
+ }
|
|
|
|
|
+ MyApplication.getInstance()?.accountManager?.queryAccMgrLoginUser(params = params){isSuccess, respData, error ->
|
|
|
|
|
+ if (isSuccess){
|
|
|
|
|
+ tradingAccountManagerList.postValue(respData)
|
|
|
|
|
+ queryTitle(tableKey = Constant.table_mobile_report_expose,cycletime = tradedate.replace("-", ""),userid = respData?.get(0)?.roleid ?: "",cycletype = "")
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取可供选择的交易用户列表
|
|
|
|
|
+ * @return List<SelectData>
|
|
|
|
|
+ */
|
|
|
|
|
+ fun getCanSelectTradingAccount() : List<SelectData>{
|
|
|
|
|
+ val selectDataList = arrayListOf<SelectData>()
|
|
|
|
|
+ tradingAccountManagerList.value?.forEach {
|
|
|
|
|
+ selectDataList.add(SelectData(id = it.roleid ?: "",value = it.rolename ?: ""))
|
|
|
|
|
+ }
|
|
|
|
|
+ return selectDataList
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 敞口报表第二步先查询列头
|
|
|
* 敞口报表列表头部数据
|
|
* 敞口报表列表头部数据
|
|
|
* @param tableKey String
|
|
* @param tableKey String
|
|
|
*/
|
|
*/
|
|
|
- fun queryTitle(tableKey: String,tradedate : String) {
|
|
|
|
|
|
|
+ fun queryTitle(tableKey: String,cycletime: String,cycletype : String,userid : String) {
|
|
|
val params = mutableMapOf<String, String>().apply {
|
|
val params = mutableMapOf<String, String>().apply {
|
|
|
put("tableKey", tableKey)
|
|
put("tableKey", tableKey)
|
|
|
put("tableType", "3")
|
|
put("tableType", "3")
|
|
@@ -341,7 +395,7 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
|
|
t1.orderindex?.toInt()?.minus(t2.orderindex?.toInt() ?: 0) ?: 0
|
|
|
})
|
|
})
|
|
|
exposureReportTitle.postValue(newlist)
|
|
exposureReportTitle.postValue(newlist)
|
|
|
- qryReportDayExposure(tradedate = tradedate)
|
|
|
|
|
|
|
+ qryReckonAreaExpourse(tradedate = cycletime,userid = userid)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -355,12 +409,24 @@ class ReportQueryViewModel : BaseViewModel(){
|
|
|
val newList = arrayListOf<ExposureReportData>()
|
|
val newList = arrayListOf<ExposureReportData>()
|
|
|
respData.forEach {
|
|
respData.forEach {
|
|
|
val newRightData = arrayListOf<String>()
|
|
val newRightData = arrayListOf<String>()
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalspotqty),2) + it.enumdicname + "\n" + it.middlegoodshedgeratio?.toPercentage())
|
|
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalneedhedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.totalfutureqty,2) + it.enumdicname)
|
|
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.needhedgeexposoure),2) + it.enumdicname + "\n" + it.needhedgeratio?.toPercentage())
|
|
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalexposure),2) + it.enumdicname + "\n" +it.totalhedgeratio?.toPercentage())
|
|
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriTotalSpotQty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffSpotQty),2) + it.enumdicname)
|
|
|
|
|
- newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.oriTotalFutuQty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffFutuQty),2) + it.enumdicname)
|
|
|
|
|
|
|
+ //'套保量/\n 套利量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.hedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.arbitrageqty),2) + it.enumdicname)
|
|
|
|
|
+ //'现货总量/\n 变动量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalspotqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffhedgeqty,2) + it.enumdicname)
|
|
|
|
|
+ //'套保变动量/\n 套利变动量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffmgqtya),2) + it.enumdicname + "\n" + NumberUtils.roundNum(it.diffmgqtyb,2) + it.enumdicname)
|
|
|
|
|
+ //'套保比例/\n 套利比例 '
|
|
|
|
|
+ newRightData.add(it.mgneedhedgeratio?.toPercentage() + "\n" +it.needarbitrageratio?.toPercentage())
|
|
|
|
|
+ //'应套保量/\n 应套利量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.needhedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.needarbitrageqty),2) + it.enumdicname)
|
|
|
|
|
+ //'现货应套保总量/\n 变动量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalneedhedgeqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffhedgeqty),2) + it.enumdicname)
|
|
|
|
|
+ //'期货总量/\n 变动量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalfutureqty),2) + it.enumdicname + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffFutuQty),2) + it.enumdicname)
|
|
|
|
|
+ //'套保敞口/\n 变动量 '
|
|
|
|
|
+ newRightData.add(it.needhedgeexposoure + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffexposure),2) + it.enumdicname)
|
|
|
|
|
+ //'总敞口/\n 变动量 '
|
|
|
|
|
+ newRightData.add(NumberUtils.roundNum(NumberUtils.doubleDistortion(it.totalexposure),2) + "\n" + NumberUtils.roundNum(NumberUtils.doubleDistortion(it.diffqty),2) + it.enumdicname)
|
|
|
val newData = it.copy(rightData = newRightData)
|
|
val newData = it.copy(rightData = newRightData)
|
|
|
newList.add(newData)
|
|
newList.add(newData)
|
|
|
}
|
|
}
|