| | |
| | | if (maps.size() == 0) { |
| | | a = yday + "暂无降雨信息。"; |
| | | } else { |
| | | a = yday + "点降雨量前三为:" + text.substring(0,text.length()-1)+"。"; |
| | | a = yday + "点降雨量前三为:" + text.substring(0, text.length() - 1) + "。"; |
| | | } |
| | | map.put("text", a); |
| | | lists.add(map); |
| | |
| | | List<Map<String, Object>> list2 = regionWeightService.selectLALL(); |
| | | List<Map<String, Object>> list3 = regionWeightService.selectLNam(); |
| | | Map mc = new HashMap(); |
| | | for (int a=0;a<list2.size();a++){ |
| | | for (int b=0;b<list3.size();b++){ |
| | | for (int a = 0; a < list2.size(); a++) { |
| | | for (int b = 0; b < list3.size(); b++) { |
| | | String code = list2.get(a).get("code").toString(); |
| | | String num = list2.get(a).get("num").toString(); |
| | | String code1 = list3.get(b).get("code").toString(); |
| | | if (code.equals(code1)){ |
| | | mc.put(list3.get(b).get("cname").toString(),num); |
| | | if (code.equals(code1)) { |
| | | mc.put(list3.get(b).get("cname").toString(), num); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | } |
| | | Collections.sort(listc, new Comparator<Map<String,Object>>(){ |
| | | public int compare(Map<String,Object> o1,Map<String,Object> o2){ |
| | | return (Double)o1.get("dyp")<(Double)o2.get("dyp")?1:( (Double)o1.get("dyp")==(Double)o2.get("dyp")?0:-1); |
| | | Collections.sort(listc, new Comparator<Map<String, Object>>() { |
| | | public int compare(Map<String, Object> o1, Map<String, Object> o2) { |
| | | return (Double) o1.get("dyp") < (Double) o2.get("dyp") ? 1 : ((Double) o1.get("dyp") == (Double) o2.get("dyp") ? 0 : -1); |
| | | } |
| | | }); |
| | | for (int c=0;c<listc.size();c++){ |
| | | if (c<3){ |
| | | text+=listc.get(c).get("region").toString()+":"+listc.get(c).get("dyp")+"(mm),"; |
| | | for (int c = 0; c < listc.size(); c++) { |
| | | if (c < 3) { |
| | | text += listc.get(c).get("region").toString() + ":" + listc.get(c).get("dyp") + "(mm),"; |
| | | } |
| | | } |
| | | String a="流域前三的为:"+text.substring(0,text.length()-1)+"。"; |
| | | String a = "流域前三的为:" + text.substring(0, text.length() - 1) + "。"; |
| | | mapc.put("List", listc); |
| | | mapc.put("Num", mc); |
| | | mapc.put("text", yday+a); |
| | | mapc.put("text", yday + a); |
| | | lists.add(mapc); |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | |
| | | /** |
| | | * @param type 类型 0:实时 1 历史 |
| | | * @param timez 当前时间 yyyy-MM-dd HH:00:00 |
| | |
| | | lists.add(map); |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | else { |
| | | } else { |
| | | //当前时间 |
| | | String time = timez; |
| | | |
| | |
| | | if (maps.size() == 0) { |
| | | a = yday + "暂无降雨信息。"; |
| | | } else { |
| | | a = yday + "点降雨量前三为:" + text.substring(0,text.length()-1)+"。"; |
| | | a = yday + "点降雨量前三为:" + text.substring(0, text.length() - 1) + "。"; |
| | | } |
| | | map.put("text", a); |
| | | lists.add(map); |