package com.szpg.util;

public class DataPushInterface {
	
	public static String apiUrl = Configure.getProperty("sys", "SZGLGS_API_URL", "http://10.10.2.19:9056/");

	/**
	 * 推送温度监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param tempValue 温度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addTempData(String zcbh, String tempValue, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".TemValue");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(tempValue);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送温度报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addTempAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("温度高报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送湿度监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param humValue 温度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addHumData(String zcbh, String humValue, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".WetValue");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(humValue);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送湿度报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addHumAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BLBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("湿度高报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送甲烷监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param ch4Value 甲烷浓度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addCH4Data(String zcbh, String ch4Value, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".Value");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(ch4Value);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送甲烷报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addCH4AlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("甲烷高浓度报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送一氧化碳监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param coValue 一氧化碳浓度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addCOData(String zcbh, String coValue, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".Value");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(coValue);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送一氧化碳报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addCOAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("一氧化碳高浓度报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送氧气监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param o2value 氧气浓度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addO2Data(String zcbh, String o2value, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".Value");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(o2value);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送氧气报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addO2AlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("氧气低浓度报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送硫化氢监测值至市管廊公司平台
	 * @param zcbh 资产编号
	 * @param hsValue 硫化氢浓度值
	 * @param ts 时间戳
	 * @return
	 */
	public static String addHSData(String zcbh, String hsValue, String ts) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=HJSBBLZB");
		sb.append("&Ent.BLBH=").append(zcbh + ".Value");
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BLZ=").append(hsValue);
		sb.append("&Ent.SJC=").append(ts);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送硫化氢报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addHSAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("硫化氢高浓度报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送舱段对射报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addDSAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("报警主机入侵报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送液位爆管报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addYWAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("舱段液位爆管报警");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送风机故障报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addFJAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("风机故障");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送照明故障报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addZMAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("照明故障");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送水泵故障报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addSBAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("水泵故障");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
	
	/**
	 * 推送井盖故障报警记录至市管廊公司平台
	 * @param bjbh
	 * @param zcbh
	 * @param bjms
	 * @param bjsj
	 * @return
	 */
	public static String addJGAlarmData(String bjbh, String zcbh, String bjms, String bjsj) {
		StringBuilder sb = new StringBuilder();
		sb.append("tableName=BJRZB");
		sb.append("&Ent.BJBH=").append(bjbh);
		sb.append("&Ent.ZCBH=").append(zcbh);
		sb.append("&Ent.BJLX=").append("电子井盖故障");
		sb.append("&Ent.BJMS=").append(bjms);
		sb.append("&Ent.BJSJ=").append(bjsj);
		
		String resp = HttpRequest.sendPostByHttp(apiUrl + "GLTHXC/api/Common/AddData", sb.toString());
		
		return resp;
	}
}
