From a98b1db4392c357304036e8b3cdd01646920300d Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 21 Jul 2022 15:41:23 +0800
Subject: [PATCH] 1.山洪

---
 src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java |   65 ++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 21 deletions(-)

diff --git a/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java b/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
index ffe42b5..e0f43eb 100644
--- a/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
+++ b/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
@@ -288,8 +288,12 @@
 							} else {
 								BigDecimal w = (BigDecimal) map.get(i).get("W");
 								double W = w.doubleValue();
-								DecimalFormat df = new DecimalFormat("#0.00");
-								texta += "蓄水量" + df.format(W) + "百万立方米、";
+								if (W == 0.000) {
+									texta += "蓄水量暂无数据、";
+								} else {
+									DecimalFormat df = new DecimalFormat("#0.00");
+									texta += "蓄水量" + df.format(W) + "百万立方米、";
+								}
 							}
 							if (map.get(i).get("OTQ") == null) {
 								texta += "出库流量暂无数据;";
@@ -325,8 +329,12 @@
 							} else {
 								BigDecimal w = (BigDecimal) map.get(i).get("W");
 								double W = w.doubleValue();
-								DecimalFormat df = new DecimalFormat("#0.00");
-								texth += "蓄水量" + df.format(W) + "百万立方米、";
+								if (W == 0.000) {
+									texth += "蓄水量暂无数据、";
+								} else {
+									DecimalFormat df = new DecimalFormat("#0.00");
+									texth += "蓄水量" + df.format(W) + "百万立方米、";
+								}
 							}
 							if (map.get(i).get("OTQ") == null) {
 								texth += "出库流量暂无数据。";
@@ -365,8 +373,12 @@
 							} else {
 								BigDecimal w = (BigDecimal) map.get(i).get("W");
 								double W = w.doubleValue();
-								DecimalFormat df = new DecimalFormat("#0.00");
-								texta += "蓄水量" + df.format(W) + "百万立方米、";
+								if (W == 0.000) {
+									texta += "蓄水量暂无数据、";
+								} else {
+									DecimalFormat df = new DecimalFormat("#0.00");
+									texta += "蓄水量" + df.format(W) + "百万立方米、";
+								}
 							}
 							if (map.get(i).get("OTQ") == null) {
 								texta += "出库流量暂无数据;";
@@ -396,8 +408,12 @@
 							} else {
 								BigDecimal w = (BigDecimal) map.get(i).get("W");
 								double W = w.doubleValue();
-								DecimalFormat df = new DecimalFormat("#0.00");
-								texth += "蓄水量" + df.format(W) + "百万立方米、";
+								if (W == 0.000) {
+									texth += "蓄水量暂无数据、";
+								} else {
+									DecimalFormat df = new DecimalFormat("#0.00");
+									texth += "蓄水量" + df.format(W) + "百万立方米、";
+								}
 							}
 							if (map.get(i).get("OTQ") == null) {
 								texth += "出库流量暂无数据。";
@@ -443,8 +459,12 @@
 								} else {
 									BigDecimal w = (BigDecimal) map.get(i).get("W");
 									double W = w.doubleValue();
-									DecimalFormat df = new DecimalFormat("#0.00");
-									texta += "蓄水量" + df.format(W) + "百万立方米、";
+									if (W == 0.000) {
+										texta += "蓄水量暂无数据、";
+									} else {
+										DecimalFormat df = new DecimalFormat("#0.00");
+										texta += "蓄水量" + df.format(W) + "百万立方米、";
+									}
 								}
 								if (map.get(i).get("OTQ") == null) {
 									texta += "出库流量暂无数据;";
@@ -474,8 +494,12 @@
 								} else {
 									BigDecimal w = (BigDecimal) map.get(i).get("W");
 									double W = w.doubleValue();
-									DecimalFormat df = new DecimalFormat("#0.00");
-									texth += "蓄水量" + df.format(W) + "百万立方米、";
+									if (W == 0.000) {
+										texth += "蓄水量暂无数据、";
+									} else {
+										DecimalFormat df = new DecimalFormat("#0.00");
+										texth += "蓄水量" + df.format(W) + "百万立方米、";
+									}
 								}
 								if (map.get(i).get("OTQ") == null) {
 									texth += "出库流量暂无数据。";
@@ -535,8 +559,7 @@
 //				//获取涨幅最大的信息
 //			}
 			if (beginTime.equals(endTime)) {
-			}
-			else {
+			} else {
 				if (m1.size() != 0) {
 					Object maxKey = getMaxKey(m1);
 					String s1 = m1.get(maxKey).toString();
@@ -1306,7 +1329,7 @@
 		}
 		String code = strArrays.substring(0, strArrays.length() - 1);
 		//水库水情预警信息
-		List<Map<String, Object>> map = rsvrRService.selectskshi(egmd, edmd, timec, time,dateEnd,code);
+		List<Map<String, Object>> map = rsvrRService.selectskshi(egmd, edmd, timec, time, dateEnd, code);
 		//用来判断是否重复统计超警信息
 		Map mnum = new HashMap();
 		//定义list保存预警信息
@@ -1345,7 +1368,7 @@
 						if (RZ == 0) {
 							texta += "库水位暂无数据、";
 						} else {
-							texta += "库水位" + RZ + "米、";
+							texta += "库水位" + dfc.format(RZ) + "米、";
 						}
 						if (v < 0) {
 							texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -1390,7 +1413,7 @@
 						if (RZ == 0) {
 							texth += "库水位暂无数据、";
 						} else {
-							texth += "库水位" + RZ + "米、";
+							texth += "库水位" + dfc.format(RZ) + "米、";
 						}
 						if (v < 0) {
 							texth += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -1447,7 +1470,7 @@
 						if (RZ == 0) {
 							texta += "库水位暂无数据、";
 						} else {
-							texta += "库水位" + RZ + "米、";
+							texta += "库水位" + dfc.format(RZ) + "米、";
 						}
 						if (v < 0) {
 							texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -1488,7 +1511,7 @@
 						if (RZ == 0) {
 							texth += "库水位暂无数据、";
 						} else {
-							texth += "库水位" + RZ + "米、";
+							texth += "库水位" + dfc.format(RZ) + "米、";
 						}
 						if (v < 0) {
 							texth += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -1545,7 +1568,7 @@
 							if (RZ == 0) {
 								texta += "库水位暂无数据、";
 							} else {
-								texta += "库水位" + RZ + "米、";
+								texta += "库水位" + dfc.format(RZ) + "米、";
 							}
 							if (v < 0) {
 								texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -1590,7 +1613,7 @@
 							if (RZ == 0) {
 								texth += "库水位暂无数据、";
 							} else {
-								texth += "库水位" + RZ + "米、";
+								texth += "库水位" + dfc.format(RZ) + "米、";
 							}
 							if (v < 0) {
 								texth += "比昨日8时下降" + Math.abs(v) + "米、";

--
Gitblit v1.9.3