Ver Fonte

3dDisplayEngine YtiotVAlarmServiceImpl.java 吉超博 commit at 2020-09-30

吉超博 há 4 anos atrás
pai
commit
a0ada399d9
1 ficheiros alterados com 158 adições e 0 exclusões
  1. 158 0
      3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

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

@@ -257,3 +257,161 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 
 			int totalCount = ytiotVAlarmDao.getEFireCount(hhwhere);
 //			System.out.print("shazi");
+//			System.out.println(totalCount);
+
+			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";
+			}
+			json.put("page", Page);
+			json.put("start", Start);
+			json.put("limit", Limit);
+			if(totalCount>0) {
+				List<?> ulist = ytiotVUserphoneDao.query(null, null, null, null, null);
+				List<?> list1 = ytiotVAlarmDao.EFireQuery(hhwhere, order_str, dir, Start, Limit);
+				SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+				if(list1.size()>0) {
+					for(int i=0;i<list1.size();i++) {
+						YtiotVEfire o = (YtiotVEfire)list1.get(i);
+						YtiotVEfireId oid = o.getId();
+						String cl_name = "";
+						Map<String, Comparable> map = new HashMap<String, Comparable>();
+						if((company_code!=null)&&(i==0))
+							json.put("company_name", oid.getCompanyName());
+						map.put("orderIdx", Integer.parseInt(Start)+i+1);
+						map.put("address", oid.getAddress());
+						map.put("cldh", oid.getCldh());
+						map.put("cllx", oid.getCllx());
+						map.put("cllxr", oid.getCllxr());
+						map.put("clnr", oid.getClnr());
+						map.put("clr", oid.getClr());
+						map.put("clwb", oid.getClwb());
+						map.put("clzt", oid.getClzt()==0?"未处理":"已处理");
+						map.put("company_code", oid.getCompanyCode());
+						map.put("company_name", oid.getCompanyName());
+						map.put("compartment", "");
+						map.put("data1", oid.getData1());
+						map.put("data2", oid.getData2());
+						map.put("data3", oid.getData3());
+						map.put("data4", oid.getData4());
+						map.put("data5", oid.getData5());
+						String dv = "";
+						if(oid.getData1().equals("EF0"))
+							dv = "正常/报警撤销";
+						else if(oid.getData1().equals("EF1"))
+							dv = "欠压报警";
+						else if(oid.getData1().equals("EF2"))
+							dv = "过压报警";
+						else if(oid.getData1().equals("EF3"))
+							dv = "过流报警";
+						else if(oid.getData1().equals("EF4"))
+							dv = "漏电报警";
+						else if(oid.getData1().equals("EF5"))
+							dv = "温度1超高报警";
+						else if(oid.getData1().equals("EF6"))
+							dv = "温度2超高报警";
+						else if(oid.getData1().equals("EF7"))
+							dv = "温度3超高报警";
+						else if(oid.getData1().equals("EF8"))
+							dv = "温度4超高报警";
+						else if(oid.getData1().equals("EF9"))
+							dv = "离线";
+						String dw = "";
+						if(oid.getData1().equals("EF0"))
+							dw = "";
+						else if(oid.getData1().equals("EF1"))
+							dw = "V";
+						else if(oid.getData1().equals("EF2"))
+							dw = "V";
+						else if(oid.getData1().equals("EF3"))
+							dw = "mA";
+						else if(oid.getData1().equals("EF4"))
+							dw = "mA";
+						else if(oid.getData1().equals("EF5"))
+							dw = "℃";
+						else if(oid.getData1().equals("EF6"))
+							dw = "℃";
+						else if(oid.getData1().equals("EF7"))
+							dw = "℃";
+						else if(oid.getData1().equals("EF8"))
+							dw = "℃";
+						else if(oid.getData1().equals("EF9"))
+							dw = "";
+						map.put("fullname", oid.getName()+","+dv+","+"告警值:"+oid.getData2()+dw);
+						map.put("data", oid.getData1());
+						if(oid.getClzt()==1)
+							map.put("clsj", df.format(oid.getClsj()));
+						else
+							map.put("clsj", "");
+						map.put("device_code", oid.getDeviceCode());
+						map.put("fireprocess", "");
+						map.put("id", oid.getId());
+						map.put("name", oid.getName());
+						map.put("ncmd", oid.getNcmd());
+						map.put("port", oid.getPort());
+						map.put("position", oid.getPosition());
+						map.put("status", dv);
+						map.put("time", df.format(oid.getTime()));
+						map.put("vidoe", oid.getVideo());
+						if((oid.getClr().length()>0)
+								&&(ulist.size()>0)){
+							for(int j=0;j<ulist.size();j++) {
+								YtiotVUserphone po = (YtiotVUserphone)ulist.get(j);
+								YtiotVUserphoneId poid = po.getId();
+								if(oid.getCldh().equals(poid.getPhone())) {
+									cl_name = poid.getUsername();
+									break;
+								}
+							}
+						}
+						map.put("clr_name", cl_name.length()>0?cl_name:oid.getClr());
+						JSONObject jSONObject = JSONObject.fromObject(map);
+						jSONArray.add(jSONObject);
+					}
+					json.put("RESULT", jSONArray);
+				}
+			}
+			return json.toString();
+		}
+	}
+
+
+
+	@Override
+	public String getHjVList(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 status = 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", "getHjVList");
+		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		if(queryJson!=null) {
+			q_json = JSONObject.fromObject(queryJson);