package com.hxzkoa.udp; import com.hxzkoa.json.tb_achor; import com.hxzkoa.util.Config; import com.hxzkoa.util.HttpUtil; import net.sf.json.JSONObject; public class Anchor_info { /* * 2.基站相关信息anchor_info 定位基站相关信息,默认定位引擎开启时候发送一次 * anchor_info,[Length],[anchorid],[x],[y],[z],[layer],[zu],[distance],[ * tongbu],[ip],[version],[mark] */ static String postUrl = Config.getPostUrl(); public static void anchor_info(String message) { postUrl = postUrl + "anchorManagement_add.do"; String[] dis = message.split(","); String anchorid = dis[2]; String x = dis[3]; String y = dis[4]; String z = dis[5]; String layer = dis[6]; String zu = dis[7]; String distance = dis[8]; String tongbu = dis[9]; String ip = dis[10]; String version = dis[11]; tb_achor anchor = new tb_achor(); anchor.setAnchorid(anchorid); anchor.setPOSX(x); anchor.setPOSY(y); anchor.setPOSZ(z); anchor.setLayer(layer); anchor.setZu(zu); anchor.setLiangcheng(distance); anchor.setAnchormode(tongbu); anchor.setAnchorip(ip); anchor.setVersion(version); JSONObject jsonObject = JSONObject.fromObject(anchor); HttpUtil.doPost(postUrl, jsonObject.toString(), Config.getCharset()); } /* * 9.获取基站相关信息get_anchor_info 报文格式 get_anchor_info,[anchorid/all],[end] */ public static void get_anchor_info(String message) { String[] dis = message.split(","); String anchorid = dis[1]; if (("all").equals(anchorid)) { postUrl = postUrl + "anchorManagement.do"; HttpUtil.doPost(postUrl, "", Config.getCharset()); } else { postUrl = postUrl + "anchorManagement_search.do"; String messageJson = "{\"input\":\"" + anchorid + "\"}"; JSONObject jsonObject = JSONObject.fromObject(messageJson); HttpUtil.doPost(postUrl, jsonObject.toString(), Config.getCharset()); } } }