Commit 59f330db authored by 李秀明's avatar 李秀明

fix: 监盘总览-cafs水箱液位达到最高的时候,应该展示最大余量

【web端】站端3711-监盘总览-cafs水箱液位最大时,余量应该是100%,但是展示的是“--” Closes http://113.142.68.105:5080/zentao/bug-view-18196.html
parent 0e78acd4
...@@ -33,12 +33,12 @@ public class UnitTransformUtil { ...@@ -33,12 +33,12 @@ public class UnitTransformUtil {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) { if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0"); map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) > 0) { // 当前值大于最大值
map.put("status", "2"); map.put("status", "2");
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1"); map.put("status", "1");
map.put("abs", "--"); map.put("abs", 100);
} else { } else {
map.put("status", "1"); map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
...@@ -71,7 +71,7 @@ public class UnitTransformUtil { ...@@ -71,7 +71,7 @@ public class UnitTransformUtil {
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1"); map.put("status", "1");
map.put("abs", "--"); map.put("abs", 100);
} else { } else {
map.put("status", "1"); map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
...@@ -104,7 +104,7 @@ public class UnitTransformUtil { ...@@ -104,7 +104,7 @@ public class UnitTransformUtil {
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1"); map.put("status", "1");
map.put("abs", "--"); map.put("abs", 100);
} else { } else {
map.put("status", "1"); map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
...@@ -139,7 +139,7 @@ public class UnitTransformUtil { ...@@ -139,7 +139,7 @@ public class UnitTransformUtil {
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "1"); map.put("status", "1");
map.put("abs", "--"); map.put("abs", 100);
} else { } else {
map.put("status", "1"); map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2)); map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment