From 31cac151ee472f29ad6e6c57f6039c42ea863ded Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Wed, 08 Sep 2021 08:52:34 +0800
Subject: [PATCH] 1.单位
---
src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java | 117 ++++++++++++++++++++++++++++------------------------------
1 files changed, 57 insertions(+), 60 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 45b462d..bb86591 100644
--- a/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
+++ b/src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
@@ -181,7 +181,7 @@
strArrays += "'" + split[i] + "',";
}
String code = strArrays.substring(0, strArrays.length() - 1);
- List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd,code);
+ List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd, code);
map.addAll(sel);
//用来判断是否重复统计超警信息
Map mnum = new HashMap();
@@ -228,7 +228,7 @@
BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
double INQ = inq.doubleValue();
//DecimalFormat df = new DecimalFormat("#0.000");
- texta += "入库流量" +INQ+ "(立方米每秒)、";
+ texta += "入库流量" + INQ + "(立方米每秒)、";
}
if (map.get(i).get("W") == null) {
texta += "蓄水量暂无数据、";
@@ -243,10 +243,10 @@
BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
double OTQ = otq.doubleValue();
//DecimalFormat df = new DecimalFormat("#0.000");
- texta += "出库流量" +OTQ + "(立方米每秒);";
+ texta += "出库流量" + OTQ + "(立方米每秒);";
}
}
- if(stnm.equals("廖坊")) {
+ if (stnm.equals("廖坊")) {
texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:";
if (RZ == 0) {
texth += "库水位暂无数据、";
@@ -275,7 +275,7 @@
BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
double OTQ = otq.doubleValue();
//DecimalFormat df = new DecimalFormat("#0.000");
- texth += "出库流量" + OTQ + "(立方米每秒)。";
+ texth += "出库流量" + OTQ + "(立方米每秒)。";
}
}
alist.add(map.get(i));
@@ -313,7 +313,7 @@
texta += "出库流量" + OTQ + "(立方米每秒);";
}
}
- if ( stnm.equals("廖坊")) {
+ if (stnm.equals("廖坊")) {
texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:" + "库水位" + RZ + "m、";
if (map.get(i).get("INQ") == null) {
texth += "入库流量暂无数据、";
@@ -412,9 +412,9 @@
}
if (number == 0) {
- text += texta+texth;
+ text += texta + texth;
} else {
- text += "有" + number + "个水库站预警;" + texta+texth;
+ text += "有" + number + "个水库站预警;" + texta + texth;
}
//水库涨幅,跌幅信息
List<Map<String, Object>> selecthds = rsvrRService.selectsk(beginTime, endTime);
@@ -464,14 +464,18 @@
c.put(stcd, v3);
}
}
- //获取涨幅最大的信息
- Object maxKey = getMaxKey(m1);
- String s1 = m1.get(maxKey).toString();
- text += " 涨幅最大的是:" + s1 + "(涨" + maxKey + "米)。";
- //获取跌幅最大的信息
- Object maxKey2 = getMaxKey(m2);
- String s2 = m2.get(maxKey2).toString();
- text += " 跌幅最大的是:" + s2 + "(跌" + maxKey + "米)。";
+ if (m1.size()!=0) {
+ //获取涨幅最大的信息
+ Object maxKey = getMaxKey(m1);
+ String s1 = m1.get(maxKey).toString();
+ text += " 涨幅最大的是:" + s1 + "(涨" + maxKey + "米)。";
+ }
+ if (m2.size()!=0) {
+ //获取跌幅最大的信息
+ Object maxKey2 = getMaxKey(m2);
+ String s2 = m2.get(maxKey2).toString();
+ text += " 跌幅最大的是:" + s2 + "(跌" + maxKey2 + "米)。";
+ }
m.put("text", text);
m.put("number", number);
m.put("Yjlist", ylist);
@@ -516,7 +520,7 @@
//日
String day = strs[2].toString();
//定义短信内容头
- String text = year + "月" + day + "日"+hs+"时";
+ String text = year + "月" + day + "日" + hs + "时";
String texta = "";
String texth = "";
//定义统计数量
@@ -552,7 +556,7 @@
}
}
//水库水情预警信息
- List<Map<String, Object>> map = rsvrRService.selectyjcks(egmd, edmd,timec,timez);
+ List<Map<String, Object>> map = rsvrRService.selectyjcks(egmd, edmd, timec, timez);
//用来判断是否重复统计超警信息
Map mnum = new HashMap();
//定义list保存预警信息
@@ -583,7 +587,7 @@
//站点名称
String stnm = map.get(i).get("STNM").toString();
//实时水库水位值
- if (stnm.equals("洪门") ) {
+ if (stnm.equals("洪门")) {
texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texta += "库水位暂无数据、";
@@ -617,8 +621,7 @@
texta += "出库流量" + OTQ + "(立方米每秒);";
}
// texta += "汛限水位暂无数据;";
- }
- else if ( stnm.equals("廖坊")){
+ } else if (stnm.equals("廖坊")) {
texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texth += "库水位暂无数据、";
@@ -663,7 +666,7 @@
//站点名称
String stnm = map.get(i).get("STNM").toString();
//站点名称
- if (stnm.equals("洪门") ) {
+ if (stnm.equals("洪门")) {
texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texta += "库水位暂无数据、";
@@ -697,8 +700,7 @@
texta += "出库流量" + OTQ + "(立方米每秒);";
}
// texta += "汛限水位暂无数据;";
- }
- else if ( stnm.equals("廖坊")){
+ } else if (stnm.equals("廖坊")) {
texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texth += "库水位暂无数据、";
@@ -748,7 +750,7 @@
String addvcd5 = map.get(i).get("ADDVNM").toString();
//站点名称
String stnm = map.get(i).get("STNM").toString();
- if (stnm.equals("洪门") ) {
+ if (stnm.equals("洪门")) {
texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texta += "库水位暂无数据、";
@@ -782,8 +784,7 @@
texta += "出库流量" + OTQ + "(立方米每秒);";
}
// texta += "汛限水位暂无数据;";
- }
- else if ( stnm.equals("廖坊")){
+ } else if (stnm.equals("廖坊")) {
texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
if (RZ == 0) {
texth += "库水位暂无数据、";
@@ -821,9 +822,9 @@
}
}
if (number == 0) {
- text += texta+texth;
+ text += texta + texth;
} else {
- text += "有" + number + "个水库站超汛限;" + texta+texth;
+ text += "有" + number + "个水库站超汛限;" + texta + texth;
}
}
Map m = new HashMap();
@@ -894,17 +895,17 @@
public R selList(String stcd) {
List<Map<String, Object>> newList = rsvrRService.selList(stcd);
Map<String, List<Map>> mm = new HashMap();
- for(Map temp: newList){
- if(mm.containsKey(temp.get("LNNM")))
+ for (Map temp : newList) {
+ if (mm.containsKey(temp.get("LNNM")))
mm.get(temp.get("LNNM")).add(temp);
- else{
+ else {
List<Map> ll = new ArrayList<>();
ll.add(temp);
mm.put((String) temp.get("LNNM"), ll);
}
}
List<List<Map>> res = new ArrayList();
- for(Map.Entry<String, List<Map>> et: mm.entrySet()){
+ for (Map.Entry<String, List<Map>> et : mm.entrySet()) {
res.add(et.getValue());
}
return R.data(res);
@@ -947,8 +948,8 @@
*/
@ApiLog("水库实时预警")
@PostMapping("/selectyj")
- @ApiOperation(value = "水库实时预警",notes = "")
- public R selectyj(String times,int mou,int k){
+ @ApiOperation(value = "水库实时预警", notes = "")
+ public R selectyj(String times, int mou, int k) {
Date date = null;
// 把Date按照格式转换成字符串
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -959,8 +960,8 @@
}
String dateEnd = sdf.format(date);
- String egmd="";
- String edmd="";
+ String egmd = "";
+ String edmd = "";
List<Map<String, Object>> selectfx = rsvrRService.selectfx();
String b = (String) selectfx.get(0).get("BGMD");
String e = (String) selectfx.get(0).get("EDMD");
@@ -970,35 +971,31 @@
int es = Integer.parseInt(e.trim());
int b2s = Integer.parseInt(b2.trim());
int e2s = Integer.parseInt(e2.trim());
- if(mou>=bs&&mou<=es){
- egmd=b;
- edmd=e;
- }
- else if(mou>=b2s&&mou<=e2s) {
- egmd=b2;
- edmd=e2;
- }
- else {
- String mous="0901";
+ if (mou >= bs && mou <= es) {
+ egmd = b;
+ edmd = e;
+ } else if (mou >= b2s && mou <= e2s) {
+ egmd = b2;
+ edmd = e2;
+ } else {
+ String mous = "0901";
int m = Integer.parseInt(mous);
- if(m>=bs&&m<=es){
- egmd=b;
- edmd=e;
- }
- else if(m>=b2s&&m<=e2s) {
- egmd=b2;
- edmd=e2;
+ if (m >= bs && m <= es) {
+ egmd = b;
+ edmd = e;
+ } else if (m >= b2s && m <= e2s) {
+ egmd = b2;
+ edmd = e2;
}
}
List<Map<String, Object>> map;
- if(k==13){
- map = rsvrRService.selectyj(egmd,edmd,times,dateEnd);
- }
- else {
- map = rsvrRService.selectyj(egmd,edmd,times,dateEnd);
+ if (k == 13) {
+ map = rsvrRService.selectyj(egmd, edmd, times, dateEnd);
+ } else {
+ map = rsvrRService.selectyj(egmd, edmd, times, dateEnd);
}
List<Map<String, Object>> lists = new ArrayList<>();
- for(int i=0;i<map.size();i++) {
+ for (int i = 0; i < map.size(); i++) {
Map<String, Object> maps = new HashMap<String, Object>();
BigDecimal bigDecimaldz = (BigDecimal) map.get(i).get("FSLTDZ");//汛限水位
BigDecimal bigDecimalrz = (BigDecimal) map.get(i).get("RZ");//当前水位
--
Gitblit v1.9.3