Selaa lähdekoodia

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

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

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

@@ -4276,3 +4276,197 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 			if(Integer.parseInt(Start)>totalCount){
 				Start = "0";
 				Page = "0";
+			}else if(page==null)
+				Page="0";
+		}else{
+			Start = "0";
+			Page = "0";
+		}
+		json.put("page", Page);
+		json.put("start", Start);
+		json.put("limit", Limit);
+		if(totalCount>0) {
+			json.put("code", 200);
+			List<?> list = ytiotVAlarmDao.wjAlarmQuery(hqlwhere, order_str, dir, Start, Limit);
+			SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+			if(list.size()>0) {
+				for(int i=0;i<list.size();i++) {
+					WjPowerMonitoringAlarm o = (WjPowerMonitoringAlarm)list.get(i);
+					Map map = new HashMap();
+					String deviceName=o.getDeviceName();
+					map.put("alarmId", o.getId());
+					if(deviceName.equals("DA00012784")) {
+						map.put("companyName", "宝辉冶金");
+						map.put("userName", "韩正义");
+						map.put("userPhone", "15122423833");
+						map.put("siteName", "测试站点一");
+						map.put("companyAdress", "沪太路8786弄155号");
+						map.put("lineName", "进线一");
+						map.put("measDesc", "进线一,"+o.getMeasDesc());
+					}else if(deviceName.equals("DA00013596")) {
+						map.put("companyName", "永鑫汽车配件");
+						map.put("userName", "韩锐");
+						map.put("userPhone", "17630065224");
+						map.put("siteName", "测试站点二");
+						map.put("companyAdress", "上海市嘉定区宝安公路2442号");
+						map.put("lineName", "进线一");
+						map.put("measDesc", "进线一,"+o.getMeasDesc());
+					}else if(deviceName.equals("DA00013433")) {
+						map.put("companyName", "宝辉冶金");
+						map.put("userName", "韩正义");
+						map.put("userPhone", "15122423833");
+						map.put("siteName", "测试站点三");
+						map.put("companyAdress", "沪太路8786弄155号");
+						map.put("lineName", "进线二");
+						map.put("measDesc", "进线二,"+o.getMeasDesc());
+					}else if(deviceName.equals("DA00012827")) {
+						map.put("companyName", "永鑫汽车配件");
+						map.put("userName", "韩锐");
+						map.put("userPhone", "17630065224");
+						map.put("siteName", "测试站点四");
+						map.put("companyAdress", "上海市嘉定区宝安公路2442号");
+						map.put("lineName", "进线三");
+						map.put("measDesc", "进线三,"+o.getMeasDesc());
+					}else if(deviceName.equals("DA00013948")) {
+						map.put("companyName", "永鑫汽车配件");
+						map.put("userName", "韩锐");
+						map.put("userPhone", "17630065224");
+						map.put("siteName", "测试站点五");
+						map.put("companyAdress", "上海市嘉定区宝安公路2442号");
+						map.put("lineName", "进线四");
+						map.put("measDesc", "进线四,"+o.getMeasDesc());
+					}
+					
+	                switch (o.getMeasName()) {
+                    case "DI1":
+                        map.put("measName", "开入1");
+                        break;
+                    case "DI2":
+                    	map.put("measName", "开入2");
+                        break;
+                    case "DI3":
+                    	map.put("measName", "开入3");
+                        break;
+                    case "FireAlarm":
+                    	map.put("measName", "火灾预警总");
+                        break;
+                    case "EleAlarm":
+                        map.put("measName", "线路电气故障总");
+                        break;
+                    case "PhaseLoss":
+                        map.put("measName", "缺相");
+                        break;
+                    case "LoadLive":
+                        map.put("measName", "线路带电");
+                        break;
+                    case "LoadBrkState":
+                        map.put("measName", "线路开关状态");
+                        break;
+                    case "OverV":
+                        map.put("measName", "过压");
+                        break;
+                    case "UnderV":
+                        map.put("measName", "低压");
+                        break;
+                    case "OverI":
+                        map.put("measName", "电流越限");
+                        break;
+                    case "Trip":
+                        map.put("measName", "过流跳闸");
+                        break;
+                    case "BusOutage":
+                        map.put("measName", "母线停电");
+                        break;
+                    case "OverIr":
+                        map.put("measName", "剩余电流越限");
+                        break;
+                    case "OverT1":
+                        map.put("measName", "测温点1超温");
+                        break;
+                    case "OverT2":
+                        map.put("measName", "测温点2超温");
+                        break;
+                    case "OverT3":
+                        map.put("measName", "测温点3超温");
+                        break;
+                    case "OverT4":
+                        map.put("measName", "测温点4超温");
+                        break;
+                    case "OverEvT":
+                        map.put("measName", "环境温度越限");
+                        break;
+                    case "ArcA":
+                        map.put("measName", "A相燃弧");
+                        break;
+                    case "ArcB":
+                        map.put("measName", "B相燃弧");
+                        break;
+                    case "ArcC":
+                        map.put("measName", "C相燃弧");
+                        break;
+                    case "OverUH":
+                        map.put("measName", "电压谐波越限");
+                        break;
+                    case "OverIH":
+                        map.put("measName", "电流谐波越限");
+                        break;
+                    case "OverDemandP":
+                        map.put("measName", "有功需量超限");
+                        break;
+                    case "OverDemandS":
+                        map.put("measName", "视在需量超限");
+                        break;
+                    case "MeasFailure":
+                        map.put("measName", "测量通道故障");
+                        break;
+                    case "DevAbnormal":
+                        map.put("measName", "设备异常");
+                        break;
+                    case "Mute":
+                        map.put("measName", "消音");
+                        break;
+                    case "DO1":
+                        map.put("measName", "开出1");
+                        break;
+                    case "DO2":
+                        map.put("measName", "开出2");
+                        break;
+                    case "ResDI1":
+                        map.put("measName", "备用遥信1");
+                        break;
+                    case "ResDI2":
+                        map.put("measName", "备用遥信2");
+                        break;
+                    case "ResDI3":
+                        map.put("measName", "备用遥信3");
+                        break;
+                    case "ResDI4":
+                        map.put("measName", "备用遥信4");
+                        break;
+                    default:
+                    	map.put("measName", "未知");
+                        break;
+                    }
+					int alarmStatus=o.getDigitalValue();
+					if(alarmStatus==0) {
+						map.put("digitalValue", "复归");
+					}else if(alarmStatus==1) {
+						map.put("digitalValue", "动作");
+					}
+					map.put("deviceCode", o.getDeviceName());
+					map.put("handleContent", o.getHandleContent());
+					map.put("handleMisinformation", o.getHandleMisinformation());
+					map.put("sendingTime", df.format(o.getSendingTime()));
+					map.put("pictureUrl", o.getPictureUrl());
+					int handleState = o.getHandleState();
+					if(handleState==0) {
+						map.put("timeConsuming", "--");
+						map.put("handleState", "未处理");
+					}else if(handleState==1) {
+						String endTime = df.format(o.getHandleTime());
+						String startTime = df.format(o.getSendingTime());
+						long diff = df.parse(endTime).getTime() - df.parse(startTime).getTime();
+						long nh = 1000*60*60;
+						long nd = 1000*24*60*60;
+						long hour = diff/nh;
+						map.put("timeConsuming", hour);