|
@@ -581,12 +581,12 @@ public class TaPersonController extends BaseController {
|
581
|
581
|
|
582
|
582
|
/**
|
583
|
583
|
* 微信添加人员添加城市
|
584
|
|
- * @param location
|
|
584
|
+ * @param params
|
585
|
585
|
* @param request
|
586
|
586
|
* @return
|
587
|
587
|
*/
|
588
|
588
|
@PutMapping("/wx/person/city")
|
589
|
|
- public ResponseBean updatePersonCity(@RequestBody String location, HttpServletRequest request) {
|
|
589
|
+ public ResponseBean updatePersonCity(@RequestBody String params, HttpServletRequest request) {
|
590
|
590
|
ResponseBean responseBean = new ResponseBean();
|
591
|
591
|
String openid = JWTUtils.getSubject(request);
|
592
|
592
|
List<TaPerson> taPersons = taPersonService.getPersonsByOpenId(openid);
|
|
@@ -594,9 +594,12 @@ public class TaPersonController extends BaseController {
|
594
|
594
|
return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
|
595
|
595
|
}
|
596
|
596
|
TaPerson person = taPersons.get(0);
|
597
|
|
- JSONObject jsonObject = JSONObject.parseObject(location);
|
|
597
|
+ JSONObject jsonObject = JSONObject.parseObject(params);
|
|
598
|
+ String lat = jsonObject.getString("lat");
|
|
599
|
+ String lon = jsonObject.getString("lon");
|
|
600
|
+ String location = lon+","+lat;
|
598
|
601
|
RestTemplate restTemplate = new RestTemplate();
|
599
|
|
- String result = restTemplate.getForObject("https://restapi.amap.com/v3/geocode/regeo?key="+ CommConstant.GD_KEY + "&location=" + jsonObject.getString("location") + "&output=json", String.class);
|
|
602
|
+ String result = restTemplate.getForObject("https://restapi.amap.com/v3/geocode/regeo?key="+ CommConstant.GD_KEY + "&location=" +location+ "&output=json", String.class);
|
600
|
603
|
JSONObject resultJson = JSONObject.parseObject(result);
|
601
|
604
|
if (!resultJson.getString("status").equals(CommConstant.STATUS_NORMAL)){
|
602
|
605
|
String adcode = resultJson.getJSONObject("regeocode").getJSONObject("addressComponent").getString("adcode");
|