|
@@ -86,7 +86,7 @@ public class RouteServiceImpl implements RouteService {
|
|
// System.out.println("https://apis.map.qq.com/ws/geocoder/v1/"+"address="+ URLEncoder.encode(vcMeasurerec.getcSupplydes(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
|
|
// System.out.println("https://apis.map.qq.com/ws/geocoder/v1/"+"address="+ URLEncoder.encode(vcMeasurerec.getcSupplydes(),"utf-8")+"&key=WDTBZ-A5VKJ-UDLFI-KYJY6-WTP2S-A6B4Y");
|
|
//创建托运人需要字段 (本地字段名称:视图字段名称 中文解释)cSupplyid:shipperCode 托运方代码 、cSupplydes:shipperName 托运方名称、addressLongitude 托运方地址经度、addressLatitude托运方地址纬度
|
|
//创建托运人需要字段 (本地字段名称:视图字段名称 中文解释)cSupplyid:shipperCode 托运方代码 、cSupplydes:shipperName 托运方名称、addressLongitude 托运方地址经度、addressLatitude托运方地址纬度
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName") == null ? "安钢集团信阳钢铁有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName") == null ? "安钢集团信阳钢铁有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
String location = searchPoint.getGeocodes().get(0).getLocation();
|
|
String location = searchPoint.getGeocodes().get(0).getLocation();
|
|
String[] split = StringUtils.split(location, ",");
|
|
String[] split = StringUtils.split(location, ",");
|
|
String Lng = split[0];
|
|
String Lng = split[0];
|
|
@@ -103,7 +103,7 @@ public class RouteServiceImpl implements RouteService {
|
|
|
|
|
|
//创建收货地址需要的字段 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
//创建收货地址需要的字段 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
if (searchPoint2.getStatus() == "0") {
|
|
if (searchPoint2.getStatus() == "0") {
|
|
|
|
|
|
if (searchPoint2.getGeocodes() != null) {
|
|
if (searchPoint2.getGeocodes() != null) {
|
|
@@ -281,11 +281,11 @@ public class RouteServiceImpl implements RouteService {
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString());
|
|
Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString());
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName").toString() == null ? "四川省达州钢铁集团有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName").toString() == null ? "四川省达州钢铁集团有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
//创建收货地址 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
//创建收货地址 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
//入网验证
|
|
//入网验证
|
|
String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
|
|
String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
|
|
@@ -374,11 +374,11 @@ public class RouteServiceImpl implements RouteService {
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString());
|
|
Date gateTime = dateFormat.parse(mapValue.get("resultOutGateTime").toString());
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName").toString() == null ? "四川省达州钢铁集团有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("shipperName").toString() == null ? "四川省达州钢铁集团有限责任公司" : mapValue.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
//创建收货地址 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
//创建收货地址 addressProvince 省份、addressDistrict 市区、addressTown 县镇 、addressDeliveryAddress 收货地址、 addressLongitude 收货地址经度、addressLatitude 收货地址纬度
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(mapValue.get("receiveAddress").toString() == null ? "长沙市" : mapValue.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
//入网验证
|
|
//入网验证
|
|
String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
|
|
String netValidationResult = zhongJiaoXingLu.netValidation(mapValue.get("capacityNumber").toString());
|
|
@@ -483,10 +483,10 @@ public class RouteServiceImpl implements RouteService {
|
|
Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
|
|
Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
|
|
if (Integer.parseInt(netValidationMap.get("status").toString()) == 1001 && netValidationMap.get("result").toString().equals("yes")) {
|
|
if (Integer.parseInt(netValidationMap.get("status").toString()) == 1001 && netValidationMap.get("result").toString().equals("yes")) {
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode("四川省达州钢铁集团有限责任公司", "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode("四川省达州钢铁集团有限责任公司", "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("receiveAddress") == null || "".equals(String.valueOf(resultMap.get("receiveAddress"))) ? "长沙市" : resultMap.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("receiveAddress") == null || "".equals(String.valueOf(resultMap.get("receiveAddress"))) ? "长沙市" : resultMap.get("receiveAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
//运单生成之后保存
|
|
//运单生成之后保存
|
|
HashMap<String, String> redisMap = new HashMap<>();
|
|
HashMap<String, String> redisMap = new HashMap<>();
|
|
|
|
|
|
@@ -677,9 +677,9 @@ public class RouteServiceImpl implements RouteService {
|
|
Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
|
|
Map netValidationMap = (Map) JSONObject.parse(netValidationResult);
|
|
if (Integer.parseInt(netValidationMap.get("status").toString()) == 1001 && netValidationMap.get("result").toString().equals("yes")) {
|
|
if (Integer.parseInt(netValidationMap.get("status").toString()) == 1001 && netValidationMap.get("result").toString().equals("yes")) {
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("shipperName").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("addressDeliveryAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
String searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode(resultMap.get("addressDeliveryAddress").toString(), "utf-8") + "&key=" + gaodeTonken);
|
|
- SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint.class);
|
|
|
|
|
|
+ SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
//运单生成之后保存
|
|
//运单生成之后保存
|
|
HashMap<String, String> redisMap = new HashMap<>();
|
|
HashMap<String, String> redisMap = new HashMap<>();
|
|
|
|
|
|
@@ -835,8 +835,8 @@ public class RouteServiceImpl implements RouteService {
|
|
} else {
|
|
} else {
|
|
searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode("四川省达川区", "utf-8") + "&key=" + gaodeTonken);
|
|
searchPointJson2 = HTTPRequestUtils.sendGet("https://restapi.amap.com/v3/geocode/geo", "address=" + URLEncoder.encode("四川省达川区", "utf-8") + "&key=" + gaodeTonken);
|
|
}
|
|
}
|
|
-// SearchPoint2 searchPoint = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson, SearchPoint2.class);
|
|
|
|
-// SearchPoint2 searchPoint2 = (SearchPoint2) DataConversionTool.jsonToBean(searchPointJson2, SearchPoint2.class);
|
|
|
|
|
|
+// SearchPoint2 searchPoint = JSON.parseObject(searchPointJson, SearchPoint2.class);
|
|
|
|
+// SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2, SearchPoint2.class);
|
|
SearchPoint2 searchPoint = JSON.parseObject(searchPointJson,SearchPoint2.class);
|
|
SearchPoint2 searchPoint = JSON.parseObject(searchPointJson,SearchPoint2.class);
|
|
SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2,SearchPoint2.class);
|
|
SearchPoint2 searchPoint2 = JSON.parseObject(searchPointJson2,SearchPoint2.class);
|
|
//运单生成之后保存
|
|
//运单生成之后保存
|