#!/usr/bin/env python
# -*- coding: utf-8 -*-
#author:nancydai
import types
import json
class apiValue:
# 获取字典中的objkey对应的值,适用于字典嵌套
# dict:字典
# objkey:目标key
# default:找不到时返回的默认值
def dict_get(self, dict, objkey, default):
tmp = dict
for k, v in tmp.items():
if k == objkey:
return v
else:
if type(v) is types.DictType:
ret = self.dict_get(v, objkey, default)
if ret is not default:
return ret
return default
jsonvalue ={u'msg': u'\u6210\u529f', u'currDate': u'2019-01-17 14:01:49', u'code': 200, u'data': {u'analysisModelFields': {u'115088951357734912': [{u'checked': True, u'dataType': u'binary(0)', u'tableName': u'v_balance_of_payments', u'comments': u'\u589e\u957f\u7387', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'income_grow_rate'}, {u'checked': True, u'dataType': u'int(7)', u'tableName': u'v_balance_of_payments', u'comments': u'\u4e1a\u52a1\u652f\u51fa', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'bus_outcome'}, {u'checked': True, u'dataType': u'int(4)', u'tableName': u'v_balance_of_payments', u'comments': u'\u5e74-\u534a\u5e74', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'year_half_year_code'}, {u'checked': True, u'dataType': u'decimal(13,10)', u'tableName': u'v_balance_of_payments', u'comments': u'\u6536\u652f\u7ed3\u4f59\u7387', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'balance_of_payments'}, {u'checked': True, u'dataType': u'int(7)', u'tableName': u'v_balance_of_payments', u'comments': u'\u533b\u7597\u6536\u5165', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'medical_income'}, {u'checked': True, u'dataType': u'int(4)', u'tableName': u'v_balance_of_payments', u'comments': u'\u5e74-\u5b63', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'year_season_code'}, {u'checked': True, u'dataType': u'int(7)', u'tableName': u'v_balance_of_payments', u'comments': u'\u533b\u7597\u6210\u672c', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'medical_all_cost'}, {u'checked': True, u'dataType': u'int(1)', u'tableName': u'v_balance_of_payments', u'comments': u'\u533b\u9662\u7f16\u7801', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'hosp_code'}, {u'checked': True, u'dataType': u'int(8)', u'tableName': u'v_balance_of_payments', u'comments': u'\u4e1a\u52a1\u6536\u5165', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'bus_income'}, {u'checked': True, u'dataType': u'varchar(5)', u'tableName': u'v_balance_of_payments', u'comments': u'\u533b\u9662\u540d\u79f0', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'hosp_name'}, {u'checked': True, u'dataType': u'int(4)', u'tableName': u'v_balance_of_payments', u'comments': u'\u5e74', u'aliasName': None, u'fieldType': u'dimension', u'fieldName': u'year_code'}, {u'checked': True, u'dataType': u'int(4)', u'tableName': u'v_balance_of_payments', u'comments': u'\u5e74-\u6708', u'aliasName': None, u'fieldType': u'dimension', u'fieldName': u'year_month_code'}, {u'checked': True, u'dataType': u'varchar(8)', u'tableName': u'v_balance_of_payments', u'comments': u'\u7ef4\u5ea6', u'aliasName': None, u'fieldType': u'dimension', u'fieldName': u'dimension'}, {u'checked': True, u'dataType': u'binary(0)', u'tableName': u'v_balance_of_payments', u'comments': u'\u6210\u672c\u63a7\u5236\u7387', u'aliasName': None, u'fieldType': u'measure', u'fieldName': u'cost_control_rate'}]}, u'controlModel': {u'key': u'115138501816614912', u'updateTime': u'2018-12-06 09:01:24.0', u'code': None, u'name': u'\u6536\u652f\u7ed3\u4f59\u7387\u660e\u7ec6', u'creator': u'suishanwen', u'type': u'table', u'remark': u'', u'createTime': u'2018-08-14 17:19:18.0', u'content': u'{"Report":{"ReportHeader":{"Items":{"Tables":[],"TextBoxs":[]},"height":80,"isShow":false},"ReportBody":{"Items":{"Tables":[{"type":"table","fixedHeader":true,"pageTotalRows":20,"fixedColumn":true,"position":{"x":0,"y":0},"columns":[{"fieldName":"hosp_name","type":"dimension","width":"","style":"","isSort":false,"isShow":true,"comments":"\u533b\u9662\u540d\u79f0","sortfieldName":""},{"fieldName":"bus_income","type":"measure","width":"","style":"","isSort":false,"isShow":true,"comments":"\u4e1a\u52a1\u6536\u5165","sortfieldName":""},{"fieldName":"bus_outcome","type":"measure","width":"","style":"","isSort":false,"isShow":true,"comments":"\u4e1a\u52a1\u652f\u51fa","sortfieldName":""},{"fieldName":"balance_of_payments","type":"measure","width":"","style":"","isSort":false,"isShow":true,"comments":"\u6536\u652f\u7ed3\u4f59\u7387","sortfieldName":""},{"fieldName":"medical_income","width":"","type":"measure","style":"","isSort":false,"comments":"\u533b\u7597\u6536\u5165","sortfieldName":""},{"fieldName":"income_grow_rate","width":"","type":"measure","style":"","isSort":false,"comments":"\u589e\u957f\u7387","sortfieldName":""},{"fieldName":"medical_all_cost","width":"","type":"measure","style":"","isSort":false,"comments":"\u533b\u7597\u6210\u672c","sortfieldName":""},{"fieldName":"cost_control_rate","width":"","type":"measure","style":"","isSort":true,"comments":"\u6210\u672c\u63a7\u5236\u7387","sortfieldName":""},{"fieldName":"hosp_code","width":"","type":"measure","style":"","isSort":false,"comments":"\u533b\u9662\u7f16\u7801","sortfieldName":"","isShow":false}],"heights":[28,28],"widths":[219,111,109,105,109,119,101,107,80],"corner":[[]],"body":[[{"rowspan":1,"colspan":1,"display":1,"textBox":{"autoWrap":true,"name":"","location":{"left":0,"top":0},"size":{"width":84,"height":28},"backGroundColor":"rgba(255, 255, 255, 0.1)","fontColor":"none","
|