Commit 56757441 authored by KeYong's avatar KeYong

修改液位bug

parent 75230cd5
...@@ -34,7 +34,7 @@ public class UnitTransformUtil { ...@@ -34,7 +34,7 @@ public class UnitTransformUtil {
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)) == 0) { } else if (nowVal.compareTo(new BigDecimal(maxValue)) == 0) {
map.put("status", "2"); map.put("status", "1");
map.put("abs", 100); map.put("abs", 100);
} else if (nowVal.compareTo(new BigDecimal(0)) == 0) { } else if (nowVal.compareTo(new BigDecimal(0)) == 0) {
map.put("status", "1"); map.put("status", "1");
...@@ -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));
......
...@@ -96,6 +96,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -96,6 +96,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
BigDecimal divide = new BigDecimal(100); BigDecimal divide = new BigDecimal(100);
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, BigDecimal.ROUND_HALF_UP); BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume"))).multiply(new BigDecimal(String.valueOf(transResult.get("abs")))).divide(divide, 0, BigDecimal.ROUND_HALF_UP);
m.put("levelAbs", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)"); m.put("levelAbs", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)");
} else if (String.valueOf(transResult.get("abs")).equals("100") && String.valueOf(transResult.get("status")).equals("1")) {
BigDecimal bigDecimal = new BigDecimal(String.valueOf(m.get("volume")));
m.put("levelAbs", bigDecimal + "m³ " + " (" + transResult.get("abs") + "%)");
} else { } else {
m.put("levelAbs", transResult.get("abs")); m.put("levelAbs", transResult.get("abs"));
} }
......
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