ansel0926
2022-05-17 585932b46cb2dda666453a493f68cb47d3a5ccd5
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
//重点人口信息管理,条件查询重点人口信息
function queryKeypeopleByBlood() {
    var queryData = {};
    queryData.blood = "AB";
    var args = JSON.stringify(queryData);
    $.ajax({
        type : "post",
        url : "../../easyAPI/keyPeople/queryKeypeopleByBlood.action",
        data : args,
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            if (data.length != 0) {
                showfaceresultlist(data);
            }else{
                ctrlFaceResultlist("none");
                swal("没有识别到符合相貌特征的对象!","请重试!","error");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("识别执行失败!");
        }
    });
}
//保存智能识别结果
function savefaceresult(){
    if(faceresultStr!=''){
        var nowdate = new Date();
        var nowday = nowdate.format("yyyy-MM-dd");
        var obj = {
            'faceId':'0',
            'videoId':prefacevideoId,
            'faceTime':nowday,
            'faceUrl':targetcanvas.toDataURL("image/jpeg"),
            'faceResult':faceresultStr,
        };
        var args = JSON.stringify(obj);
        $.ajax({
            type : "post",
            url : "../../easyAPI/face/insert.action",
            data : args,
            contentType : "application/json;charset=utf-8",
            success : function(data) {
                if(data == 1){
                    swal("保存成功!","请重试!","error");
                }else{
                    swal("保存失败!","请重试!","error");
                }
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                console.log("ajax请求失败!");
            }
        });
    }else{
        swal("没有识别到符合相貌特征的对象,无法保存!","请重试!","error");
    }
}
//根据身份证号获取关键人口
function getKeypeopleByCardId(cardid,videodata,alarmdata) {
    var queryData = {};
    queryData.identity = cardid;
    var args = JSON.stringify(queryData);
    $.ajax({
        type : "post",
        url : "../../easyAPI/keyPeople/queryKeypeople.action",
        data : args,
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            if (data.length != 0) {
                appendAlarmPic(data[0],videodata,alarmdata);
            }else{
                swal("没有重点人口信息符合您的检索条件!","请重试!","error");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("条件查询重点人口信息失败!");
        }
    });
}
//获取全部追踪记录
function getFaceRecord(){
    $.ajax({
        type : "post",
        url : "../../easyAPI/face/getFaceAll.action",
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            showFaceFollowRecord(data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            // 请求失败时执行该函数
            console.log("智能追踪信息获取失败!");
        }
    });
}
//根据id获取追踪记录详细信息
function getFaceFollowById(id){
    $.ajax({
        type : "post",
        url : "../../easyAPI/face/selectFaceById.action",
        data : "faceId=" + id,
        success : function(data) {
            if (data.length != 0) {
                showInfoFaceFollow_3D(data);
            }else{
                console.log("获取追踪记录信息为空!");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("根据ID获取追踪记录详细信息失败!");
        }
    });
}
//获取全部智能识别记录
function getFaceAlarmRecord(){
    $.ajax({
        type : "post",
        url : "../../easyAPI/faceAlarm/getFaceAlarmNoPic.action",
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            showFaceAlarmRecord(data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            // 请求失败时执行该函数
            console.log("智能识别报警信息获取失败!");
        }
    });
}
//根据id获取智能识别报警详细信息
function getFaceAlarmById(id){
    $.ajax({
        type : "post",
        url : "../../easyAPI/faceAlarm/getFaceAlarmById.action",
        data : "faId=" + id,
        success : function(data) {
            if (data.length != 0) {
                showInfoFaceAlarm_3D(data);
            }else{
                console.log("获取智能识别报警信息为空!");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("根据ID获取智能识别报警详细信息失败!");
        }
    });
}
//获取全部刷卡记录
function getCardRecord(){
    $.ajax({
        type : "post",
        url : "../../easyAPI/card/getCardAll.action",
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            showCardRecord(data);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            // 请求失败时执行该函数
            console.log("刷卡记录信息获取失败!");
        }
    });
}
//根据id获取刷卡记录详细信息
function getCardById(id){
    $.ajax({
        type : "post",
        url : "../../easyAPI/card/getCardById.action",
        data : "crId=" + id,
        success : function(data) {
            if (data.length != 0) {
                showInfoCard_3D(data);
            }else{
                console.log("获取刷卡记录信息为空!");
            }
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            console.log("根据ID获取刷卡记录详细信息失败!");
        }
    });
}
//接处警应急,根据坐标获取周边200米范围内的人员(路线显示)
var policemanList = [];  //调用的警员
var rePolicemanList = [] ;   //重复的警员 
function getPolicemanList(position){
    $.ajax({
        type : "post",
        url : "../../easyAPI/police/getPoliceRealDateWithManPos.action",
        contentType : "application/json;charset=utf-8",
        success : function(data) {
            var lng = Number(position[0]);
            var lat = Number(position[1]);
            for (var i = 0; i < data.length; i++) {
                var dis = getFlatternDistance(lng,lat,Number(data[i].longitude),Number(data[i].latitude));
                if(dis <= Number($("#ePoliceRadius").val())){
                    if(rePolicemanList.indexOf(data[i].deviceNum) == -1){
                        rePolicemanList.push(data[i].deviceNum);
                    }else{
                        policemanList = policemanList.filter(item =>item.deviceNum !== data[i].deviceNum); 
                    }
                    policemanList.push(data[i]);
                }
            }
            clearRouteLines();
            showPolice_3D(policemanList,'RHPC');
            showRoadNavs(policemanList);
            startintercom(policemanList,'police');
        },
        error : function(XMLHttpRequest, textStatus, errorThrown) {
            // 请求失败时执行该函数
            console.log("接处警应急200米范围内人员获取失败!");
        }
    });
}
 
//接处警应急,根据坐标获取周边200米范围内的车辆(路线显示)
var policeCarList = [];  //调用的警车
var rePoliceCarList = [];  //重复的警车
function getPoliceCarList(position){
    $.ajax({
        type : "post",
        url : "../../easyAPI/car/getPoliceCarRealData.action",
        contentType : "application/json;charset=utf-8",
        success : function (data){
            var realPoliceCarList = [];
            var lng = Number(position[0]);
            var lat = Number(position[1]);
            for ( var i = 0; i < data.length; i++) {
                if(data[i].realdata != undefined){
                    var dis = getFlatternDistance(lng,lat,data[i].realdata.longitude,data[i].realdata.latitude);
                    if(dis <= Number($("#ePoliceRadius").val())){
                        if(rePoliceCarList.indexOf(data[i].car.carId) == -1){
                            rePoliceCarList.push(data[i].car.carId);
                        }else{
                            policeCarList = policeCarList.filter(item =>item.car.carId !== data[i].car.carId); 
                        }
                        policeCarList.push(data[i]);
                        realPoliceCarList.push(data[i].realdata);
                    }
                }
            }
            clearRouteLines();
            showPoliceCar_3D(policeCarList)//显示200米范围内的车辆
            showRoadNavs(policeCarList);
            startintercom(realPoliceCarList);
        },
        error : function(XMLHttpRequest, textStatus, errorThrown){
            console.log("接处警应急200米范围内车辆获取失败!");
        }
    });
}