Explorar o código

3dDisplayEngine YtiotVAlarmServiceImpl.java 吉超博 commit at 2021-01-26

吉超博 %!s(int64=4) %!d(string=hai) anos
pai
achega
4d08b21b8c
Modificáronse 1 ficheiros con 60 adicións e 0 borrados
  1. 60 0
      3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

+ 60 - 0
3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

@@ -2748,3 +2748,63 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 						count += Integer.parseInt(s_count);
 						sum += Integer.parseInt(s_sum);
 						if((company_code!=null)&&(Nrow==0))
+							json.put("company_name", objects[3].toString());
+						Nrow++;
+					}
+				}
+				map2 = new HashMap();
+				map2.put("day_list", daylist);
+				map2.put("count_list", countlist);
+				map2.put("sum_list", sumlist);
+				map2.put("count", count);
+				map2.put("sum", sum);
+				map2.put("id", "water_alarm");
+				jSONObject2 = JSONObject.fromObject(map2);
+				jSONArray.add(jSONObject2);
+			}
+			if((dwtype==null)||(dwtype.equals("6"))) {
+				wheresql = null;
+				if(COMMSTATUS!=null) {
+					if(COMMSTATUS.equals("NO"))
+						wheresql = chkhw(sqlwhere)+" status<>'44' ";
+					else if(COMMSTATUS.equals("ONLY"))
+						wheresql = chkhw(sqlwhere)+" status='44' ";
+					else
+						wheresql = sqlwhere;
+				}
+				list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_rtu.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_rtu "+((wheresql!=null)?wheresql:"")+" group by days order by days desc");
+				count=0;
+				sum=0;
+				daylist = new JSONArray();
+				countlist = new JSONArray();
+				sumlist = new JSONArray();
+				if(list.size()>0) {
+					int Nrow = 0;
+					for(Iterator iterator = list.iterator();iterator.hasNext();){
+						Object[] objects = (Object[]) iterator.next();
+						daylist.add(objects[0].toString());
+						String s_count = objects[1]==null?"0":objects[1].toString();
+						String s_sum = objects[2]==null?"0":objects[2].toString();
+						countlist.add(Integer.parseInt(s_count));
+						sumlist.add(Integer.parseInt(s_sum));
+						count += Integer.parseInt(s_count);
+						sum += Integer.parseInt(s_sum);
+						if((company_code!=null)&&(Nrow==0))
+							json.put("company_name", objects[3].toString());
+						Nrow++;
+					}
+				}
+				map2 = new HashMap();
+				map2.put("day_list", daylist);
+				map2.put("count_list", countlist);
+				map2.put("sum_list", sumlist);
+				map2.put("count", count);
+				map2.put("sum", sum);
+				map2.put("id", "rtu_alarm");
+				jSONObject2 = JSONObject.fromObject(map2);
+				jSONArray.add(jSONObject2);
+			}
+
+
+
+