|
|
@@ -534,31 +534,35 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
)
|
|
|
if (it != null) {
|
|
|
it!!.postValueOfPosition.bindOptional(context) { its ->
|
|
|
- if (its != null) {
|
|
|
- if (parmasvalue == "1") {//1.净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
- text = NumberUtils.roundNum(
|
|
|
- NumberUtils.doubleDistortion(
|
|
|
- it?.currentbalance?.plus(
|
|
|
- it.valueOfposition
|
|
|
- )
|
|
|
- ?.plus(its!!)
|
|
|
- ?.minus(it.otherfreezemargin)
|
|
|
- ?.minus(it.outamountfreeze)
|
|
|
- .toString()
|
|
|
- ), 2
|
|
|
- )
|
|
|
- } else {//0.净值=期末余额+市值+浮动盈亏(收益权)
|
|
|
- text = NumberUtils.roundNum(
|
|
|
- NumberUtils.doubleDistortion(
|
|
|
- it?.currentbalance?.plus(
|
|
|
- it.valueOfposition
|
|
|
- )
|
|
|
- ?.plus(its!!)
|
|
|
- .toString()
|
|
|
- ), 2
|
|
|
- )
|
|
|
+ if (isOpenEye.value == true) {
|
|
|
+ if (its != null) {
|
|
|
+ if (parmasvalue == "1") {//1.净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ NumberUtils.doubleDistortion(
|
|
|
+ it?.currentbalance?.plus(
|
|
|
+ it.valueOfposition
|
|
|
+ )
|
|
|
+ ?.plus(its!!)
|
|
|
+ ?.minus(it.otherfreezemargin)
|
|
|
+ ?.minus(it.outamountfreeze)
|
|
|
+ .toString()
|
|
|
+ ), 2
|
|
|
+ )
|
|
|
+ } else {//0.净值=期末余额+市值+浮动盈亏(收益权)
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ NumberUtils.doubleDistortion(
|
|
|
+ it?.currentbalance?.plus(
|
|
|
+ it.valueOfposition
|
|
|
+ )
|
|
|
+ ?.plus(its!!)
|
|
|
+ .toString()
|
|
|
+ ), 2
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ text = "****"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -782,27 +786,31 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
var lastprice: Double? = 0.0
|
|
|
if (it != null) {
|
|
|
it!!.postValueOfPosition.bindOptional(context) { its ->
|
|
|
- if(its != null) {
|
|
|
- if (its != lastprice || (its == lastprice && lastprice == 0.0)) {
|
|
|
- lastprice = its
|
|
|
- text = NumberUtils.roundNum(
|
|
|
- NumberUtils.doubleDistortion(its?.toString()),
|
|
|
- 2
|
|
|
- )
|
|
|
+ if (isOpenEye.value == true) {
|
|
|
+ if (its != null) {
|
|
|
+ if (its != lastprice || (its == lastprice && lastprice == 0.0)) {
|
|
|
+ lastprice = its
|
|
|
+ text = NumberUtils.roundNum(
|
|
|
+ NumberUtils.doubleDistortion(its?.toString()),
|
|
|
+ 2
|
|
|
+ )
|
|
|
|
|
|
- textColorInt = when {
|
|
|
- its ?: 0.0 > 0.0 -> {
|
|
|
- R.color.rma_red_color
|
|
|
- }
|
|
|
- its ?: 0.0 < 0.0 -> {
|
|
|
- R.color.rma_green_color
|
|
|
- }
|
|
|
- else -> {
|
|
|
- R.color.rma_black_33
|
|
|
+ textColorInt = when {
|
|
|
+ its ?: 0.0 > 0.0 -> {
|
|
|
+ R.color.rma_red_color
|
|
|
+ }
|
|
|
+ its ?: 0.0 < 0.0 -> {
|
|
|
+ R.color.rma_green_color
|
|
|
+ }
|
|
|
+ else -> {
|
|
|
+ R.color.rma_black_33
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ text = "****"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -839,41 +847,46 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
if (it != null) {
|
|
|
it!!.postValueOfPosition.bindOptional(context) { its ->
|
|
|
///// 0 - 占用/净值 1 - 净值/占用
|
|
|
- if (its != null) {
|
|
|
- val parmasvalue =
|
|
|
- GlobalDataCollection.instance?.getSystemParamsValue(
|
|
|
- "087"
|
|
|
- )
|
|
|
- val worth: Double
|
|
|
- worth =
|
|
|
- if (parmasvalue == "1") {//1.风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
- it?.currentbalance?.plus(
|
|
|
- it.valueOfposition
|
|
|
+ if (isOpenEye.value == true) {
|
|
|
+ if (its != null) {
|
|
|
+ val parmasvalue =
|
|
|
+ GlobalDataCollection.instance?.getSystemParamsValue(
|
|
|
+ "087"
|
|
|
)
|
|
|
- ?.plus(its)
|
|
|
- ?.minus(it.otherfreezemargin)
|
|
|
- ?.minus(it.outamountfreeze)
|
|
|
- ?: 0.0
|
|
|
-
|
|
|
-
|
|
|
- } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
- it?.currentbalance?.plus(its)
|
|
|
- ?.minus(it.otherfreezemargin)
|
|
|
- ?.minus(it.outamountfreeze)
|
|
|
- ?: 1.0
|
|
|
- }
|
|
|
+ val worth: Double
|
|
|
+ worth =
|
|
|
+ if (parmasvalue == "1") {//1.风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
+ it?.currentbalance?.plus(
|
|
|
+ it.valueOfposition
|
|
|
+ )
|
|
|
+ ?.plus(its)
|
|
|
+ ?.minus(it.otherfreezemargin)
|
|
|
+ ?.minus(it.outamountfreeze)
|
|
|
+ ?: 0.0
|
|
|
+
|
|
|
+
|
|
|
+ } else {//0.净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
|
|
|
+ it?.currentbalance?.plus(its)
|
|
|
+ ?.minus(it.otherfreezemargin)
|
|
|
+ ?.minus(it.outamountfreeze)
|
|
|
+ ?: 1.0
|
|
|
+ }
|
|
|
|
|
|
- var risk = 0.0
|
|
|
+ var risk = 0.0
|
|
|
// if (it?.valueOfposition != 0.0) {
|
|
|
- if (worth != 0.0) {
|
|
|
- risk = it?.usedmargin?.div(worth) ?: 0.0
|
|
|
- }
|
|
|
+ if (worth != 0.0) {
|
|
|
+ risk = it?.usedmargin?.div(worth)
|
|
|
+ ?: 0.0
|
|
|
+ }
|
|
|
// text = NumberUtils.roundNum(
|
|
|
// NumberUtils.doubleDistortion(risk.toString()), 4
|
|
|
// ).toPercentage2()
|
|
|
|
|
|
- text = risk.toString().toPercentage2()
|
|
|
+ text = risk.toString().toPercentage2()
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ text = "****"
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -976,11 +989,13 @@ class HnstMainFragment : BaseFragment<HnstMainViewmodel>() {
|
|
|
//预售仓单
|
|
|
verticalLayout {
|
|
|
visibility =
|
|
|
- if (SPUtils.getInstance()
|
|
|
- .getString(Constant.oem) == "tjmd" || SPUtils.getInstance()
|
|
|
+ if (
|
|
|
+// SPUtils.getInstance()
|
|
|
+// .getString(Constant.oem) == "tjmd" ||
|
|
|
+ SPUtils.getInstance()
|
|
|
.getString(Constant.oem) == "xhcp"
|
|
|
) {
|
|
|
- View.GONE//任务 2621
|
|
|
+ View.GONE//任务 2621 // #3740
|
|
|
} else {
|
|
|
View.VISIBLE
|
|
|
}
|