/**
* jsonarray 数值条件更新;
*/
public JSONArray JsonStrTran(JSONArray arr){
if( arr != null && arr.size() > 0){
for (int i = 0; i < arr.size(); i++) {
JSONObject obj = (JSONObject) arr.get(i);
// 取出 jsonObject 中的字段的值的空格
Iterator itt = obj.keys();
while (itt.hasNext()) {
String key = itt.next().toString();
String value = obj.getString(key);
switch(key)
{
case "Jczlx":
if("0".equals(value))
obj.put(key, "aaa");
else
obj.put(key, "bbb");
break;
case "Qxhmyz":
value = obj.getString(key);
if("N".equals(value))
obj.put(key, "");
else
obj.put(key, "aaa");
break;
case "Hxhmyz":
value = obj.getString(key);
if("N".equals(value))
obj.put(key, "");
else
obj.put(key, "aaa");
break;
case "Hgs":
value = obj.getString(key);
if("0".equals(value))
obj.put(key, "无");
if("1".equals(value))
obj.put(key, "有");
if("-1".equals(value))
obj.put(key, "未");
break;
default:
break;
}
}
arr.set(i, obj );
}
}
return arr;
}