7.1
15832144755
2021-07-01 ba21fcf8482029f7634b62d60daf171538001769
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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());
        }
    }
}