Selaa lähdekoodia

3dDisplayEngine YtiotVAlarmServiceImpl.java 吉超博 commit at 2021-04-16

吉超博 4 vuotta sitten
vanhempi
commit
a8c1d109c6
1 muutettua tiedostoa jossa 128 lisäystä ja 0 poistoa
  1. 128 0
      3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

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

@@ -4556,3 +4556,131 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 						map.put("deviceName", "进线一");
 					}else if(o.getDeviceId().equals("DA00013433")) {
 						map.put("deviceName", "进线二");
+					}else if(o.getDeviceId().equals("DA00012827")) {
+						map.put("deviceName", "进线三");
+					}else if(o.getDeviceId().equals("DA00013948")) {
+						map.put("deviceName", "进线四");
+					}
+					
+					if(o.getTrueStatus().equals("1")) {
+						map.put("deviceStatus", "离线");
+						System.out.println("deviceStatusli"+row[1].toString());
+					}else {
+						map.put("deviceStatus", "在线");
+						System.out.println("deviceStatuszai"+row[1].toString());
+					}
+					map.put("deviceAdress", row[1].toString()+row[0].toString());
+					map.put("deviceCode", o.getDeviceId());
+					JSONObject jSONObject = JSONObject.fromObject(map);
+					jSONArray.add(jSONObject);
+				}
+				json.put("data", jSONArray);
+			}
+		}else {
+			json.put("code", 200);
+			json.put("data", jSONArray);
+		}
+		return json.toString();
+		}else {
+			json.put("code", 60001);
+			json.put("data", "缺少参数");
+			return json.toString();
+		}
+	}
+	
+	@Override
+	public String getWjDataStatisticsList(String queryJson, String page, String start, String limit, String sort) throws Exception {
+		// TODO Auto-generated method stub
+		String address = null;
+		String clzt = null;
+		String company_code = null;
+		String company_code_list = null;
+		String Company_Code_List = null;
+		String company_name = null;
+		String device_code = null;
+		String device_code_list = null;
+		String time_start = null;
+		String time_end = null;
+		String COMMSTATUS = null;
+		String V_LOGINNAME = null;
+		String hqlwhere = null;
+		String order = null;
+		String dir = null;
+		String Start = null;
+		String Limit = null;
+		String Page = null;
+		String order_str = null;
+		JSONObject q_json = null;
+		JSONArray Sort = null;
+		JSONArray jSONArray = new JSONArray();
+		JSONObject json = new JSONObject();
+		NumberFormat numberFormat = NumberFormat.getInstance();
+		numberFormat.setMaximumFractionDigits(2);
+//		json.put("action", "getLiftVList");
+		json.put("code", 200);
+		Map map = new HashMap();
+		int totalCount = ytiotVAlarmDao.getWjDeviceCount(hqlwhere);
+		map.put("siteNumber", totalCount);
+		int alarmNumber = ytiotVAlarmDao.getWjAlarmCount(hqlwhere);
+		map.put("alarmNumber", alarmNumber);
+		String processedAlarmhqlwhere = " where u.id.handleState= 1";
+		int processedAlarmNumber = ytiotVAlarmDao.getWjAlarmCount(processedAlarmhqlwhere);
+		map.put("processedAlarmNumber", processedAlarmNumber);
+		String unprocessedAlarmhqlwhere = " where u.id.handleState= 0";
+		int unprocessedAlarmNumber = ytiotVAlarmDao.getWjAlarmCount(unprocessedAlarmhqlwhere);
+		map.put("unprocessedAlarmNumber", unprocessedAlarmNumber);
+		String powerLossAlarmhqlwhere = " where u.id.measName= 'BusOutage'";
+		int powerLossAlarmNumber = ytiotVAlarmDao.getWjAlarmCount(powerLossAlarmhqlwhere);
+		map.put("powerLossAlarmNumber", powerLossAlarmNumber);
+		String lowPressureAlarmhqlwhere = " where u.id.measName != 'BusOutage'";
+		int lowPressureAlarmNumber = ytiotVAlarmDao.getWjAlarmCount(lowPressureAlarmhqlwhere);
+		map.put("lowPressureAlarmNumber", lowPressureAlarmNumber);
+		String powerLossresult = numberFormat.format((float)powerLossAlarmNumber/(float)alarmNumber*100);
+		map.put("powerLossAlarmPercentage", powerLossresult);
+		String lowPressureresult = numberFormat.format((float)lowPressureAlarmNumber/(float)alarmNumber*100);
+		map.put("lowPressureAlarmPercentage", lowPressureresult);
+		JSONObject jSONObject = JSONObject.fromObject(map);
+		jSONArray.add(jSONObject);
+		json.put("data", jSONArray);
+		if(Start!=null){
+			if(Integer.parseInt(Start)>totalCount){
+				Start = "0";
+				Page = "0";
+			}else if(page==null)
+				Page="0";
+		}else{
+			Start = "0";
+			Page = "0";
+		}
+		return json.toString();
+	}
+	
+	@Override
+	public String getWjDeviceInfoList(String queryJson, String page, String start, String limit, String sort) throws Exception {
+		// TODO Auto-generated method stub
+		String address = null;
+		String clzt = null;
+		String company_code = null;
+		String company_code_list = null;
+		String Company_Code_List = null;
+		String company_name = null;
+		String device_code = null;
+		String device_code_list = null;
+		String time_start = null;
+		String deviceName = null;
+		String COMMSTATUS = null;
+		String V_LOGINNAME = null;
+		String hqlwhere = null;
+		String order = null;
+		String dir = null;
+		String Start = null;
+		String Limit = null;
+		String Page = null;
+		String order_str = null;
+		JSONObject q_json = null;
+		JSONArray Sort = null;
+		JSONArray jSONArray = new JSONArray();
+		JSONObject json = new JSONObject();
+//		json.put("action", "getLiftVList");
+		if(queryJson!=null) {
+			q_json = JSONObject.fromObject(queryJson);