|
@@ -6,14 +6,16 @@ import com.miaxis.common.constant.Constants;
|
|
|
import com.miaxis.common.core.controller.BaseController;
|
|
|
import com.miaxis.common.core.domain.Response;
|
|
|
import com.miaxis.common.sms.MD5Utils;
|
|
|
-import com.miaxis.dict.domain.DictCity;
|
|
|
import com.miaxis.dict.service.IDictCityService;
|
|
|
+import com.miaxis.dict.vo.DictCityVo;
|
|
|
import com.miaxis.feign.service.IWxMapService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -64,21 +66,12 @@ public class WxMapController extends BaseController {
|
|
|
JSONObject addressComponent = (JSONObject) resultNode.get("address_component");
|
|
|
String province = addressComponent.get("province").toString();
|
|
|
String city = addressComponent.get("city").toString();
|
|
|
+ String county = addressComponent.get("district").toString();
|
|
|
System.out.println("province = " + province);
|
|
|
System.out.println("city = " + city);
|
|
|
- DictCity dictCity = dictCityService.getDictCityByName(city);
|
|
|
- System.out.println("parentCcode = " + dictCity.getParentcode());
|
|
|
- System.out.println("code = " + dictCity.getCode());
|
|
|
-
|
|
|
- // List<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
-
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
- map.put("province", province);
|
|
|
- map.put("city", city);
|
|
|
- map.put("provinceCode", dictCity.getParentcode());
|
|
|
- map.put("cityCode", dictCity.getCode());
|
|
|
- System.out.println(map);
|
|
|
- return Response.success(map);
|
|
|
+ System.out.println("county = " + county);
|
|
|
+ DictCityVo dictCityVo = dictCityService.getDictGrandByName(county);
|
|
|
+ return Response.success(dictCityVo);
|
|
|
} else {
|
|
|
Response response = new Response(502, "腾讯地图接口请求错误");
|
|
|
return response;
|