Quellcode durchsuchen

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

吉超博 vor 4 Jahren
Ursprung
Commit
3fd7c663fa
1 geänderte Dateien mit 86 neuen und 0 gelöschten Zeilen
  1. 86 0
      3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

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

@@ -4470,3 +4470,89 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 						long nd = 1000*24*60*60;
 						long hour = diff/nh;
 						map.put("timeConsuming", hour);
+						map.put("handleState", "已处理");
+					}
+					JSONObject jSONObject = JSONObject.fromObject(map);
+					jSONArray.add(jSONObject);
+				}
+				json.put("RESULT", 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 getWjDeviceList(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 deviceStatus = 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();
+//		json.put("action", "getLiftVList");
+		if(queryJson!=null) {
+			q_json = JSONObject.fromObject(queryJson);
+			V_LOGINNAME = q_json.has("V_LOGINNAME")?q_json.getString("V_LOGINNAME"):null;
+			deviceStatus = q_json.has("deviceStatus")?q_json.getString("deviceStatus"):null;
+			if(deviceStatus!=null) {
+				if(deviceStatus.equals("离线")) {
+					hqlwhere = chkhw(hqlwhere) + " u.trueStatus"+" = '"+1+"'";
+				}else if(deviceStatus.equals("在线")){
+					hqlwhere = chkhw(hqlwhere) + " u.trueStatus"+" = '"+0+"'";
+				}
+			}	
+		int totalCount = ytiotVAlarmDao.getWjDeviceCount(hqlwhere);
+//		json.put("totalCount", totalCount);
+		if(Start!=null){
+			if(Integer.parseInt(Start)>totalCount){
+				Start = "0";
+				Page = "0";
+			}else if(page==null)
+				Page="0";
+		}else{
+			Start = "0";
+			Page = "0";
+		}
+		if(totalCount>0) {
+			json.put("code", 200);
+			List<?> list = ytiotVAlarmDao.wjDeviceQuery(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++) {
+					WjPowerMonitoringDevice o = (WjPowerMonitoringDevice)list.get(i);
+					String sql = "select siteName,siteAdress from wj_power_monitoring_site where id="+o.getSiteId()+"";
+					List<?>list1 = ytiotVAlarmDao.queryBySQL(sql);
+					Object [] row = (Object [])list1.get(0);
+					Map map = new HashMap();
+					if(o.getDeviceId().equals("DA00012784")) {
+						map.put("deviceName", "进线一");
+					}else if(o.getDeviceId().equals("DA00013596")) {
+						map.put("deviceName", "进线一");
+					}else if(o.getDeviceId().equals("DA00013433")) {
+						map.put("deviceName", "进线二");