增加判断
This commit is contained in:
+15
-3
@@ -50,9 +50,21 @@ class AddrAlaisProcess {
|
||||
def address = ""
|
||||
def map = [:]
|
||||
if (jsonObject) {
|
||||
map.province = jsonObject.get("province")
|
||||
map.city = jsonObject.get("city")
|
||||
map.district = jsonObject.get("district")
|
||||
if (jsonObject.get("province") && jsonObject.get("province") != "null") {
|
||||
map.province = jsonObject.get("province")
|
||||
}else{
|
||||
map.province = ""
|
||||
}
|
||||
if (jsonObject.get("city") && jsonObject.get("city") != "null") {
|
||||
map.city = jsonObject.get("city")
|
||||
}else{
|
||||
map.city = ""
|
||||
}
|
||||
if (jsonObject.get("district") && jsonObject.get("district") != "null") {
|
||||
map.district = jsonObject.get("district")
|
||||
}else{
|
||||
map.district = ""
|
||||
}
|
||||
if (jsonObject.get("street") && jsonObject.get("street") != "null") {
|
||||
address = jsonObject.get("street")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user