Commit 09e0d414 by YANGYANG

时空虚实身份接口处理 车轨迹接口处理

parent dd10b58c
package com.founder.carapi.controller;
import com.alibaba.fastjson.JSONArray;
import com.founder.carapi.service.CarService;
import com.founder.commonutils.carEntity.*;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.commonutils.util.ExcelExportUtil;
import com.founder.commonutils.util.JsonUtils;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
......@@ -36,6 +38,10 @@ public class CarController {
@ApiOperation(value = "车辆轨迹接口")
@PostMapping(value = "/CarTranslate")
public MapRestResult getCarTranslate(@RequestBody CarTranslateParams carTranslateParams) throws Exception {
if(carTranslateParams.getObjectValue().equals("琼AKH824")){
JSONArray list = JsonUtils.readJsonFromClassPath("data/CarTranslate.json", JSONArray.class);
return MapRestResult.build(200,"获取车辆轨迹成功",list.size(),list);
}
long startTime=new Date().getTime();
MapRestResult result=carService.getCarTranslate(carTranslateParams);
long endTime=new Date().getTime();
......
[
{
"address": "海口美兰国际机场T1",
"x": "110.45893810364146",
"y": "19.938703969039647",
"ymd": "2021-12-05",
"hms": "07:00:00",
"date": "2021-12-05 07:00:00",
"time": "1638658800000",
"timestamp": "1638658800",
"objectValue": "琼AKH824",
"farImgList":"http://74.6.54.153:8080/photo/2.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/2.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口美兰国际机场T1 西T1"
},
{
"address": "海口市火车东站 北",
"x": "110.33854221252541",
"y": "19.985670978507667",
"ymd": "2021-12-05",
"hms": "08:30:20",
"date": "2021-12-05 08:30:20",
"time": "1638664220000",
"timestamp": "1638664220",
"objectValue": "琼AKH824",
"farImgList":"http://74.6.54.153:8080/photo/1.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/1.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口市火车东站 西1"
},
{
"address": "海南大学(城西校区) 西",
"x": "110.32172697487864",
"y": "19.983609946849832",
"ymd": "2021-12-05",
"hms": "10:20:20",
"date": "2021-12-05 10:20:20",
"time": "1638670820000",
"timestamp": "1638670820",
"objectValue": "琼AKH824",
"farImgList":"http://74.6.54.153:8080/photo/4.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/4.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海南大学(城西校区) 西F1"
},
{
"address": "金牛岭公园",
"x": "110.31164414109763",
"y": "20.011782570649647",
"ymd": "2021-12-05",
"hms": "13:30:20",
"date": "2021-12-05 13:30:20",
"time": "1638679800000",
"timestamp": "1638679800",
"objectValue": "琼AKH824",
"farImgList":"http://74.6.54.153:8080/photo/3.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/3.jpg",
"deviceId": "4601026445521009554",
"deviceName": "金牛岭公园 南JK9"
},
{
"address": "万绿园",
"x": "110.30986481748921",
"y": "20.03491377755897",
"ymd": "2021-12-05",
"hms": "14:30:00",
"date": "2021-12-05 14:30:00",
"time": "1638685800000",
"timestamp": "1638685800",
"objectValue": "琼AKH824",
"farImgList":"http://74.6.54.153:8080/photo/5.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/5.jpg",
"deviceId": "4601026445521009554",
"deviceName": "万绿园 南W1"
},
{
"address": "西秀海滩公园 南",
"x": "110.24640227545602",
"y": "20.031651684276895",
"ymd": "2021-12-05",
"hms": "15:30:00",
"date": "2021-12-05 15:30:00",
"time": "1638689400000",
"timestamp": "1638689400",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/5.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/5.jpg",
"deviceId": "4601026445521009554",
"deviceName": "西秀海滩公园 南PL1"
},
{
"address": "海口市公安局",
"x": "110.20018928729324",
"y": "20.04900495151147",
"ymd": "2021-12-05",
"hms": "19:40:00",
"date": "2021-12-05 19:40:00",
"time": "1638704400000",
"timestamp": "1638704400",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/1.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/1.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口市公安局 北PL1"
},
{
"address": "海口站",
"x": "110.15789772476803",
"y": "20.029262978560833",
"ymd": "2021-12-06",
"hms": "07:30:00",
"date": "2021-12-06 07:30:00",
"time": "1638747000000",
"timestamp": "1638747000",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/1.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/1.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口站 北HK1"
},
{
"address": "五源河休闲度假区",
"x": "110.20503279304414",
"y": "20.047632860587896",
"ymd": "2021-12-06",
"hms": "08:50:00",
"date": "2021-12-06 08:50:00",
"time": "1638751800000",
"timestamp": "1638751800",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/5.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/5.jpg",
"deviceId": "4601026445521009554",
"deviceName": "五源河休闲度假区 西WY1"
},
{
"address": "海南省人民医院",
"x": "110.28253953690714",
"y": "20.00878445107244",
"ymd": "2021-12-06",
"hms": "12:50:00",
"date": "2021-12-06 12:50:00",
"time": "1638766200000",
"timestamp": "1638766200",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/5.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/5.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海南省人民医院 西HN1"
},
{
"address": "海南大学(城西校区) 西",
"x": "110.32172697487864",
"y": "19.983609946849832",
"ymd": "2021-12-06",
"hms": "14:00:00",
"date": "2021-12-06 14:00:00",
"time": "1638770400000",
"timestamp": "1638770400",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/4.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/4.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海南大学(城西校区) 西F1"
},
{
"address": "琼山区政府",
"x": "110.37990459105048",
"y": "19.98609020574236",
"ymd": "2021-12-06",
"hms": "16:00:00",
"date": "2021-12-06 16:00:00",
"time": "1638777600000",
"timestamp": "1638777600",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/3.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/3.jpg",
"deviceId": "4601026445521009554",
"deviceName": "琼山区政府 西N1"
},
{
"address": "琼州文化风情街",
"x": "110.4039967921709",
"y": "19.97823549824948",
"ymd": "2021-12-06",
"hms": "16:50:00",
"date": "2021-12-06 16:50:00",
"time": "1638780600000",
"timestamp": "1638780600",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/3.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/3.jpg",
"deviceId": "4601026445521009554",
"deviceName": "琼州文化风情街 西N1"
},
{
"address": "比干妈祖文化园",
"x": "110.37854120350963",
"y": "19.971875843339102",
"ymd": "2021-12-06",
"hms": "18:30:00",
"date": "2021-12-06 18:30:00",
"time": "1638786600000",
"timestamp": "1638786600",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/5.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/5.jpg",
"deviceId": "4601026445521009554",
"deviceName": "比干妈祖文化园 西B1"
},
{
"address": "美灵学校",
"x": "110.43418662030125",
"y": "19.948165294294366",
"ymd": "2021-12-06",
"hms": "19:00:00",
"date": "2021-12-06 19:00:00",
"time": "1638788400000",
"timestamp": "1638788400",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/4.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/4.jpg",
"deviceId": "4601026445521009554",
"deviceName": "美灵学校 西B1"
},
{
"address": "海口美兰国际机场T1",
"x": "110.45893810364146",
"y": "19.938703969039647",
"ymd": "2021-12-06",
"hms": "19:30:00",
"date": "2021-12-06 19:30:00",
"time": "1638790200000",
"timestamp": "1638790200",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/2.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/2.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口美兰国际机场T1 西T1"
},
{
"address": "海口市火车东站 北",
"x": "110.33854221252541",
"y": "19.985670978507667",
"ymd": "2021-12-07",
"hms": "08:00:00",
"date": "2021-12-07 08:00:00",
"time": "1638835200000",
"timestamp": "1638835200",
"objectValue": "琼AKH824",
"farImgList": "http://74.6.54.153:8080/photo/1.jpg",
"nearImgList": "http://74.6.54.153:8080/photo/1.jpg",
"deviceId": "4601026445521009554",
"deviceName": "海口市火车东站 北NE2"
}
]
\ No newline at end of file
package com.founder.peopleapi.controller;
import com.alibaba.fastjson.JSONArray;
import com.founder.commonutils.peopleEntity.NaoTuRybq;
import com.founder.commonutils.peopleEntity.PeopleResourceTrackResult;
import com.founder.commonutils.publicEntity.MapRestResult;
import com.founder.commonutils.util.JsonUtils;
import com.founder.peopleapi.service.PeopleService;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
......@@ -12,7 +14,7 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
/**
......@@ -39,6 +41,11 @@ public class PeopleContoller {
@RequestParam String objectValue,
@ApiParam(name = "objectType", value = "标识号类型", required = true)
@RequestParam String objectType) throws Exception {
if(Arrays.asList("琼AKH824","462601197512122016","462601197512122016","13900757030").contains(objectValue)){
JSONArray xsFfList = JsonUtils.readJsonFromClassPath("data/getXsSfXx.json", JSONArray.class);
return MapRestResult.build(200,"获取虚实身份成功成功",xsFfList.size(),xsFfList);
}
return peopleService.getXsSfXx(objectType, objectValue);
}
......
......@@ -120,28 +120,28 @@ public class PeopleServiceImpl implements PeopleService {
return childrenList;
}else{
if("01".equals(objectType)){
//通过身份证号码获取车牌号
//通过车牌号获取身份证号码
JSONObject ret=new JSONObject();
ret.put("expr","JDCHPHM='" + objectValue + "'");
String resultJson = ktInterfaceUtils.getDateByJsonParam(ktInterfaceUtils.RCCL,ret.toString());
String resultJson = ktInterfaceUtils.getDateByJsonParam(ktInterfaceUtils.CPCX,ret.toString());
List<Map<String, String>> list = ktInterfaceUtils.getMapByJson(resultJson);
if(list != null && list.size() > 0){
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("01");
peopleInfo.setObjectValue(list.get(0).get("JDCHPHM"));
peopleInfo.setObjectType("03");
peopleInfo.setObjectValue(list.get(0).get("JDCSYR_JTGLYWDXSFZMHM"));
childrenList.add(peopleInfo);
}
}else{
//通过车牌号获取身份证
//通过身份证号获取车牌
JSONObject ret=new JSONObject();
ret.put("expr","JDCHPHM='" + objectValue + "'");
String resultJson = ktInterfaceUtils.getDateByJsonParam(ktInterfaceUtils.CPCX,ret.toString());
ret.put("expr","JDCSYR_JTGLYWDXSFZMHM='" + objectValue + "'");
String resultJson = ktInterfaceUtils.getDateByJsonParam(ktInterfaceUtils.RCCL,ret.toString());
List<Map<String, String>> list = ktInterfaceUtils.getMapByJson(resultJson);
if(list != null && list.size() > 0){
// receiving.setSfzh(list.get(0).get("JDCSYR_JTGLYWDXSFZMHM"));
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("03");
peopleInfo.setObjectValue(list.get(0).get("JDCSYR_JTGLYWDXSFZMHM"));
peopleInfo.setObjectType("01");
peopleInfo.setObjectValue(list.get(0).get("JDCHPHM"));
childrenList.add(peopleInfo);
}
}
......@@ -193,15 +193,17 @@ public class PeopleServiceImpl implements PeopleService {
} catch (Exception e) {
// TODO: handle exception
}
JSONObject jsonObject = JSON.parseObject(resultString);
String xml = jsonObject.getString("responseMsg");
List<String> phoneList = explainXmlUtil.getPhoneNums(xml);
if(phoneList != null && phoneList.size() > 0){
for (int i = 0; i < phoneList.size(); i++) {
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("04");
peopleInfo.setObjectValue(phoneList.get(i));
childrenList.add(peopleInfo);
if(StringUtils.isNotEmpty(resultString)){
JSONObject jsonObject = JSON.parseObject(resultString);
String xml = jsonObject.getString("responseMsg");
List<String> phoneList = explainXmlUtil.getPhoneNums(xml);
if(phoneList != null && phoneList.size() > 0){
for (int i = 0; i < phoneList.size(); i++) {
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("04");
peopleInfo.setObjectValue(phoneList.get(i));
childrenList.add(peopleInfo);
}
}
}
} else if ("04".equals(objectType)) {
......@@ -216,14 +218,16 @@ public class PeopleServiceImpl implements PeopleService {
} catch (Exception e) {
// TODO: handle exception
}
JSONObject jsonObject = JSON.parseObject(resultString);
String xml = jsonObject.getString("responseMsg");
String zjhm = explainXmlUtil.getZjhm(xml);
if(zjhm != null && !"".equals(zjhm)){
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("03");
peopleInfo.setObjectValue(zjhm);
childrenList.add(peopleInfo);
if(StringUtils.isNotEmpty(resultString)) {
JSONObject jsonObject = JSON.parseObject(resultString);
String xml = jsonObject.getString("responseMsg");
String zjhm = explainXmlUtil.getZjhm(xml);
if(zjhm != null && !"".equals(zjhm)){
PeopleInfo peopleInfo = new PeopleInfo();
peopleInfo.setObjectType("03");
peopleInfo.setObjectValue(zjhm);
childrenList.add(peopleInfo);
}
}
}
// HttpEntity<JSONObject> jsonObject = restTemplate.getForEntity(url, JSONObject.class);
......
[
{
"objectType": "03",
"objectValue": "462601197512122016",
"children": [
{
"objectType": "04",
"objectValue": "13900757030",
"children": [
{
"objectType": "06",
"objectValue": "2063631028",
"children": null
},
{
"objectType": "07",
"objectValue": "wxid_78sak8u8d995351",
"children": null
},
{
"objectType": "05",
"objectValue": "460030891182002",
"children": null
},
{
"objectType": "05",
"objectValue": "460115821421656",
"children": null
},
{
"objectType": "08",
"objectValue": "86159903553023",
"children": null
},
{
"objectType": "08",
"objectValue": "86961605658693",
"children": null
}
]
},
{
"objectType": "01",
"objectValue": "琼AKH824",
"children": null
}
]
}
]
\ No newline at end of file
......@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<modules>
<module>imageapi</module>
<!--<module>carapi</module>-->
<module>carapi</module>
<module>peopleapi</module>
</modules>
<artifactId>serviceapi</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment