tangzy
2021-10-07 2461281f7bdf6a4e7a016b528280ed5ec7b9f2a2
src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
@@ -172,17 +172,17 @@
            edmd = e2;
         }
      }
//      String s = rsvrRService.selectCode(beginTime, endTime);
//      String[] split = s.split(",");
//      String strArrays = "";
//      for (int i = 0; i < split.length; i++) {
//         strArrays += "'" + split[i] + "',";
//      }
//      String code = strArrays.substring(0, strArrays.length() - 1);
      //水库水情预警信息
      List<Map<String, Object>> map = rsvrRService.selectyjck(egmd, edmd, beginTime, endTime);
      String s = rsvrRService.selectCode(beginTime, endTime);
      String[] split = s.split(",");
      String strArrays = "";
      for (int i = 0; i < split.length; i++) {
         strArrays += "'" + split[i] + "',";
      }
      String code = strArrays.substring(0, strArrays.length() - 1);
      List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd,code);
      map.addAll(sel);
//      List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd, code);
//      map.addAll(sel);
      //用来判断是否重复统计超警信息
      Map mnum = new HashMap();
      Map mnums = new HashMap();
@@ -220,7 +220,7 @@
                        texta += "库水位暂无数据、";
                     } else {
                        DecimalFormat df = new DecimalFormat("#0.00");
                        texta += "库水位" + df.format(RZ) + "(米)、";
                        texta += "库水位" + df.format(RZ) + "米、";
                     }
                     if (map.get(i).get("INQ") == null) {
                        texta += "入库流量暂无数据、";
@@ -228,14 +228,14 @@
                        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 += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texta += "蓄水量" + W + "(百万立方米)、";
                        texta += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        texta += "出库流量暂无数据;";
@@ -243,16 +243,16 @@
                        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 += "库水位暂无数据、";
                     } else {
                        DecimalFormat df = new DecimalFormat("#0.00");
                        texth += "库水位" + df.format(RZ) + "(米)、";
                        texth += "库水位" + df.format(RZ) + "米、";
                     }
                     if (map.get(i).get("INQ") == null) {
                        texth += "入库流量暂无数据、";
@@ -260,14 +260,14 @@
                        BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                        double INQ = inq.doubleValue();
                        //DecimalFormat df = new DecimalFormat("#0.000");
                        texth += "入库流量" + INQ + "(立方米每秒)、";
                        texth += "入库流量" + INQ + "立方米每秒、";
                     }
                     if (map.get(i).get("W") == null) {
                        texth += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texth += "蓄水量" + W + "(百万立方米)、";
                        texth += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        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));
@@ -288,21 +288,21 @@
                  //站点名称
                  String stnm = map.get(i).get("STNM").toString();
                  if (stnm.equals("洪门")) {
                     texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:" + "库水位" + RZ + "m、";
                     texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:" + "库水位" + RZ + "米、";
                     if (map.get(i).get("INQ") == null) {
                        texta += "入库流量暂无数据、";
                     } else {
                        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 += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texta += "蓄水量" + W + "(百万立方米)、";
                        texta += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        texta += "出库流量暂无数据;";
@@ -310,25 +310,25 @@
                        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("廖坊")) {
                     texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:" + "库水位" + RZ + "m、";
                  if (stnm.equals("廖坊")) {
                     texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:" + "库水位" + RZ + "米、";
                     if (map.get(i).get("INQ") == null) {
                        texth += "入库流量暂无数据、";
                     } else {
                        BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                        double INQ = inq.doubleValue();
                        //DecimalFormat df = new DecimalFormat("#0.000");
                        texth += "入库流量" + INQ + "(立方米每秒)、";
                        texth += "入库流量" + INQ + "立方米每秒、";
                     }
                     if (map.get(i).get("W") == null) {
                        texth += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texth += "蓄水量" + W + "(百万立方米)、";
                        texth += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        texth += "出库流量暂无数据。";
@@ -336,7 +336,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));
@@ -355,21 +355,21 @@
                     //站点名称
                     String stnm = map.get(i).get("STNM").toString();
                     if (stnm.equals("洪门")) {
                        texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:超出水位" + v3 + "m、" + "库水位" + RZ + "m、";
                        texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:超出水位" + v3 + "米、" + "库水位" + RZ + "米、";
                        if (map.get(i).get("INQ") == null) {
                           texta += "入库流量暂无数据、";
                        } else {
                           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 += "蓄水量暂无数据、";
                        } else {
                           BigDecimal w = (BigDecimal) map.get(i).get("W");
                           double W = w.doubleValue();
                           texta += "蓄水量" + W + "(百万立方米)、";
                           texta += "蓄水量" + W + "百万立方米、";
                        }
                        if (map.get(i).get("OTQ") == null) {
                           texta += "出库流量暂无数据;";
@@ -377,25 +377,25 @@
                           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("廖坊")) {
                        texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:超出水位" + v3 + "m、" + "库水位" + RZ + "m、";
                        texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&:超出水位" + v3 + "米、" + "库水位" + RZ + "米、";
                        if (map.get(i).get("INQ") == null) {
                           texth += "入库流量暂无数据、";
                        } else {
                           BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                           double INQ = inq.doubleValue();
                           //DecimalFormat df = new DecimalFormat("#0.000");
                           texth += "入库流量" + INQ + "(立方米每秒)、";
                           texth += "入库流量" + INQ + "立方米每秒、";
                        }
                        if (map.get(i).get("W") == null) {
                           texth += "蓄水量暂无数据、";
                        } else {
                           BigDecimal w = (BigDecimal) map.get(i).get("W");
                           double W = w.doubleValue();
                           texth += "蓄水量" + W + "(百万立方米)、";
                           texth += "蓄水量" + W + "百万立方米、";
                        }
                        if (map.get(i).get("OTQ") == null) {
                           texth += "出库流量暂无数据。";
@@ -403,7 +403,7 @@
                           BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                           double OTQ = otq.doubleValue();
                           //DecimalFormat df = new DecimalFormat("#0");
                           texth += "出库流量" + OTQ + "(立方米每秒)。";
                           texth += "出库流量" + OTQ + "立方米每秒。";
                        }
                     }
                  }
@@ -412,66 +412,50 @@
         }
         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);
//         //水库涨幅,跌幅信息
         //List<Map<String, Object>> selecthds = rsvrRService.selectsk(beginTime, endTime);
         Map m1 = new HashMap();
         Map m2 = new HashMap();
         Map m = new HashMap();
         for (int j = 0; j < selecthds.size(); j++) {
            String stcd = selecthds.get(j).get("STCD").toString();
            //站点名称
            String stnm = selecthds.get(j).get("STNM").toString();
            if (selecthds.get(j).get("ADDVNM") == null) {
               continue;
            }
            //省,市
            String addvcd5 = selecthds.get(j).get("ADDVNM").toString();
            //最大值
            BigDecimal maxZ = (BigDecimal) selecthds.get(j).get("maxZ");
            //最大值出现时间
            String maxTM = selecthds.get(j).get("maxTM").toString();
            //最小值
            BigDecimal minZ = (BigDecimal) selecthds.get(j).get("minZ");
            //最小值出现时间
            String minTM = selecthds.get(j).get("minTM").toString();
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date sd1 = df.parse(maxTM);
            Date sd2 = df.parse(minTM);
            //如果最大时间大于最小时间就是涨幅
            if (sd1.after(sd2)) {
               //创建一个map集合保存涨幅数据
               double v = maxZ.doubleValue();
               double v1 = minZ.doubleValue();
               //涨幅值
               double v2 = v - v1;
               double v3 = (double) Math.round(v2 * 100) / 100;
               m1.put(v3, stnm.replaceAll(" ", "") + "站");
               c.put(stcd, v3);
            }
            //跌幅
            else {
               //创建一个map集合保存跌幅数据
               double v = maxZ.doubleValue();
               double v1 = minZ.doubleValue();
               //涨幅值
               double v2 = v1 - v;
               double v3 = (double) Math.round(v2 * 100) / 100;
               m2.put(Math.abs(v3), stnm.replaceAll(" ", "") + "站");
               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 + "米)。";
//         for (int j = 0; j < selecthds.size(); j++) {
//            String stcd = selecthds.get(j).get("STCD").toString();
//            //站点名称
//            String stnm = selecthds.get(j).get("STNM").toString();
//            if (selecthds.get(j).get("ADDVNM") == null) {
//               continue;
//            }
//            //省,市
//            String addvcd5 = selecthds.get(j).get("ADDVNM").toString();
//            //最大值
//            BigDecimal maxZ = (BigDecimal) selecthds.get(j).get("maxZ");
//            //最大值出现时间
//            String maxTM = selecthds.get(j).get("maxTM").toString();
//            //最小值
//            BigDecimal minZ = (BigDecimal) selecthds.get(j).get("minZ");
//            //最小值出现时间
//            String minTM = selecthds.get(j).get("minTM").toString();
//            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//            Date sd1 = df.parse(maxTM);
//            Date sd2 = df.parse(minTM);
//            double v = maxZ.doubleValue();
//            double v1 = minZ.doubleValue();
//            //涨幅值
//            double v2 = v - v1;
//            double v3 = (double) Math.round(v2 * 100) / 100;
//            m1.put(v3, stnm.replaceAll(" ", "") + "站");
//            c.put(stcd, v3);
//            //获取涨幅最大的信息
//         }
//         if (m1.size() != 0) {
//            Object maxKey = getMaxKey(m1);
//            String s1 = m1.get(maxKey).toString();
//            text += " 涨幅最大的是:" + s1 + "(涨" + maxKey + "米)。";
//         }
         m.put("text", text);
         m.put("number", number);
         m.put("Yjlist", ylist);
@@ -490,6 +474,15 @@
      int ws = 1;
      SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      String time = df.format(new Date());
      Date date = null;
      // 把Date按照格式转换成字符串
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
      try {
         date = sdf.parse(time);
      } catch (ParseException e) {
         e.printStackTrace();
      }
      String dateEnd = sdf.format(date);
      SimpleDateFormat dfz = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
      String timez = dfz.format(new Date());
      String yearc = time.substring(0, 4);
@@ -516,7 +509,7 @@
      //日
      String day = strs[2].toString();
      //定义短信内容头
      String text = year + "月" + day + "日"+hs+"时";
      String text = year + "月" + day + "日" + hs + "时";
      String texta = "";
      String texth = "";
      //定义统计数量
@@ -552,7 +545,7 @@
         }
      }
      //水库水情预警信息
      List<Map<String, Object>> map = rsvrRService.selectyjcks(egmd, edmd,timec,timez);
      List<Map<String, Object>> map = rsvrRService.selectyjcks(egmd, edmd, timec, timez,time,dateEnd);
      //用来判断是否重复统计超警信息
      Map mnum = new HashMap();
      //定义list保存预警信息
@@ -570,7 +563,7 @@
            RZ = rz.doubleValue();
            String stcd = map.get(i).get("STCD").toString();
            String ti = map.get(i).get("TM").toString();
            Map<String, Object> stringObjectMap = rsvrRService.selectRZ(stcd, timec);
            //Map<String, Object> stringObjectMap = rsvrRService.selectRZ(stcd, timec);
            //BigDecimal zc = (BigDecimal) stringObjectMap.get("RZ");
            BigDecimal zc = (BigDecimal) map.get(i).get("RZS");
            double ZC = zc.doubleValue();
@@ -583,12 +576,12 @@
               //站点名称
               String stnm = map.get(i).get("STNM").toString();
               //实时水库水位值
               if (stnm.equals("洪门") ) {
               if (stnm.equals("洪门")) {
                  texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
                  if (RZ == 0) {
                     texta += "库水位暂无数据、";
                  } else {
                     texta += "库水位" + RZ + "(米)、";
                     texta += "库水位" + RZ + "米、";
                  }
                  if (v < 0) {
                     texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -600,30 +593,29 @@
                  } else {
                     BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                     double INQ = inq.doubleValue();
                     texta += "入库流量" + INQ + "(立方米每秒)、";
                     texta += "入库流量" + INQ + "立方米每秒、";
                  }
                  if (map.get(i).get("W") == null) {
                     texta += "蓄水量暂无数据、";
                  } else {
                     BigDecimal w = (BigDecimal) map.get(i).get("W");
                     double W = w.doubleValue();
                     texta += "蓄水量" + W + "(百万立方米)、";
                     texta += "蓄水量" + W + "百万立方米、";
                  }
                  if (map.get(i).get("OTQ") == null) {
                     texta += "出库流量暂无数据、";
                  } else {
                     BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                     double OTQ = otq.doubleValue();
                     texta += "出库流量" + OTQ + "(立方米每秒);";
                     texta += "出库流量" + OTQ + "立方米每秒;";
                  }
//                  texta += "汛限水位暂无数据;";
               }
               else if ( stnm.equals("廖坊")){
               } else if (stnm.equals("廖坊")) {
                  texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
                  if (RZ == 0) {
                     texth += "库水位暂无数据、";
                  } else {
                     texth += "库水位" + RZ + "(米)、";
                     texth += "库水位" + RZ + "米、";
                  }
                  if (v < 0) {
                     texth += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -635,21 +627,21 @@
                  } else {
                     BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                     double INQ = inq.doubleValue();
                     texth += "入库流量" + INQ + "(立方米每秒)、";
                     texth += "入库流量" + INQ + "立方米每秒、";
                  }
                  if (map.get(i).get("W") == null) {
                     texth += "蓄水量暂无数据、";
                  } else {
                     BigDecimal w = (BigDecimal) map.get(i).get("W");
                     double W = w.doubleValue();
                     texth += "蓄水量" + W + "(百万立方米)、";
                     texth += "蓄水量" + W + "百万立方米、";
                  }
                  if (map.get(i).get("OTQ") == null) {
                     texth += "出库流量暂无数据、";
                  } else {
                     BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                     double OTQ = otq.doubleValue();
                     texth += "出库流量" + OTQ + "(立方米每秒)。";
                     texth += "出库流量" + OTQ + "立方米每秒。";
                  }
               }
               blist.add(map.get(i));
@@ -663,12 +655,12 @@
               //站点名称
               String stnm = map.get(i).get("STNM").toString();
               //站点名称
               if (stnm.equals("洪门") ) {
               if (stnm.equals("洪门")) {
                  texta += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
                  if (RZ == 0) {
                     texta += "库水位暂无数据、";
                  } else {
                     texta += "库水位" + RZ + "(米)、";
                     texta += "库水位" + RZ + "米、";
                  }
                  if (v < 0) {
                     texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -680,30 +672,29 @@
                  } else {
                     BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                     double INQ = inq.doubleValue();
                     texta += "入库流量" + INQ + "(立方米每秒)、";
                     texta += "入库流量" + INQ + "立方米每秒、";
                  }
                  if (map.get(i).get("W") == null) {
                     texta += "蓄水量暂无数据、";
                  } else {
                     BigDecimal w = (BigDecimal) map.get(i).get("W");
                     double W = w.doubleValue();
                     texta += "蓄水量" + W + "(百万立方米)、";
                     texta += "蓄水量" + W + "百万立方米、";
                  }
                  if (map.get(i).get("OTQ") == null) {
                     texta += "出库流量暂无数据;";
                  } else {
                     BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                     double OTQ = otq.doubleValue();
                     texta += "出库流量" + OTQ + "(立方米每秒);";
                     texta += "出库流量" + OTQ + "立方米每秒;";
                  }
//                  texta += "汛限水位暂无数据;";
               }
               else if ( stnm.equals("廖坊")){
               } else if (stnm.equals("廖坊")) {
                  texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
                  if (RZ == 0) {
                     texth += "库水位暂无数据、";
                  } else {
                     texth += "库水位" + RZ + "(米)、";
                     texth += "库水位" + RZ + "米、";
                  }
                  if (v < 0) {
                     texth += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -715,21 +706,21 @@
                  } else {
                     BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                     double INQ = inq.doubleValue();
                     texth += "入库流量" + INQ + "(立方米每秒)、";
                     texth += "入库流量" + INQ + "立方米每秒、";
                  }
                  if (map.get(i).get("W") == null) {
                     texth += "蓄水量暂无数据、";
                  } else {
                     BigDecimal w = (BigDecimal) map.get(i).get("W");
                     double W = w.doubleValue();
                     texth += "蓄水量" + W + "(百万立方米)、";
                     texth += "蓄水量" + W + "百万立方米、";
                  }
                  if (map.get(i).get("OTQ") == null) {
                     texth += "出库流量暂无数据。";
                  } else {
                     BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                     double OTQ = otq.doubleValue();
                     texth += "出库流量" + OTQ + "(立方米每秒)。";
                     texth += "出库流量" + OTQ + "立方米每秒。";
                  }
               }
               blist.add(map.get(i));
@@ -748,12 +739,12 @@
                  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 += "库水位暂无数据、";
                     } else {
                        texta += "库水位" + RZ + "(米)、";
                        texta += "库水位" + RZ + "米、";
                     }
                     if (v < 0) {
                        texta += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -765,30 +756,29 @@
                     } else {
                        BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                        double INQ = inq.doubleValue();
                        texta += "入库流量" + INQ + "(立方米每秒)、";
                        texta += "入库流量" + INQ + "立方米每秒、";
                     }
                     if (map.get(i).get("W") == null) {
                        texta += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texta += "蓄水量" + W + "(百万立方米)、";
                        texta += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        texta += "出库流量暂无数据;";
                     } else {
                        BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                        double OTQ = otq.doubleValue();
                        texta += "出库流量" + OTQ + "(立方米每秒);";
                        texta += "出库流量" + OTQ + "立方米每秒;";
                     }
//                  texta += "汛限水位暂无数据;";
                  }
                  else if ( stnm.equals("廖坊")){
                  } else if (stnm.equals("廖坊")) {
                     texth += "$$$$$" + stnm.replaceAll(" ", "") + "水库&&&&&";
                     if (RZ == 0) {
                        texth += "库水位暂无数据、";
                     } else {
                        texth += "库水位" + RZ + "(米)、";
                        texth += "库水位" + RZ + "米、";
                     }
                     if (v < 0) {
                        texth += "比昨日8时下降" + Math.abs(v) + "米、";
@@ -800,30 +790,30 @@
                     } else {
                        BigDecimal inq = (BigDecimal) map.get(i).get("INQ");
                        double INQ = inq.doubleValue();
                        texth += "入库流量" + INQ + "(立方米每秒)、";
                        texth += "入库流量" + INQ + "立方米每秒、";
                     }
                     if (map.get(i).get("W") == null) {
                        texth += "蓄水量暂无数据、";
                     } else {
                        BigDecimal w = (BigDecimal) map.get(i).get("W");
                        double W = w.doubleValue();
                        texth += "蓄水量" + W + "(百万立方米)、";
                        texth += "蓄水量" + W + "百万立方米、";
                     }
                     if (map.get(i).get("OTQ") == null) {
                        texth += "出库流量暂无数据。";
                     } else {
                        BigDecimal otq = (BigDecimal) map.get(i).get("OTQ");
                        double OTQ = otq.doubleValue();
                        texth += "出库流量" + OTQ + "(立方米每秒)。";
                        texth += "出库流量" + OTQ + "立方米每秒。";
                     }
                  }
               }
            }
         }
         if (number == 0) {
            text += texta+texth;
            text += texta + texth;
         } else {
            text += "有" + number + "个水库站超汛限;" + texta+texth;
            text += "有" + number + "个水库站超汛限;" + texta + texth;
         }
      }
      Map m = new HashMap();
@@ -894,17 +884,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 +937,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 +949,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 +960,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");//当前水位
@@ -1035,3 +1021,4 @@
   }
}