京东商城创建直辖市
This commit is contained in:
@@ -107,25 +107,28 @@ func (p *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
|||||||
}
|
}
|
||||||
//证明这个店可能隶属直辖市
|
//证明这个店可能隶属直辖市
|
||||||
if model.ZXCityCodeMap[store.CityCode] != "" {
|
if model.ZXCityCodeMap[store.CityCode] != "" {
|
||||||
result1, _ := api.JdShopAPI.GetProvince()
|
result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(store.Lng), jxutils.IntCoordinate2Standard(store.Lat))
|
||||||
for _, v := range result1 {
|
if result["regeocode"] != nil {
|
||||||
if strings.Contains(model.ZXCityCodeMap[store.CityCode], v.AreaName) {
|
street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string)
|
||||||
result2, _ := api.JdShopAPI.GetCity(v.AreaID)
|
if street != "" {
|
||||||
for _, vv := range result2 {
|
result1, _ := api.JdShopAPI.GetProvince()
|
||||||
if strings.Contains(store.DistrictName, vv.AreaName) {
|
for _, v := range result1 {
|
||||||
result3, _ := api.JdShopAPI.GetCounty(vv.AreaID)
|
if strings.Contains(model.ZXCityCodeMap[store.CityCode], v.AreaName) {
|
||||||
for _, vvv := range result3 {
|
result2, _ := api.JdShopAPI.GetCity(v.AreaID)
|
||||||
result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(store.Lng), jxutils.IntCoordinate2Standard(store.Lat))
|
for _, vv := range result2 {
|
||||||
if result["regeocode"] != nil {
|
if strings.Contains(store.DistrictName, vv.AreaName) {
|
||||||
street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string)
|
result3, _ := api.JdShopAPI.GetCounty(vv.AreaID)
|
||||||
if street != "" {
|
for _, vvv := range result3 {
|
||||||
if street == vvv.AreaName {
|
if street == vvv.AreaName {
|
||||||
createEntityStoreParam.AddCode = vvv.AreaID
|
createEntityStoreParam.AddCode = vvv.AreaID
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user