def department(): api_method = 'organization/v1/queryOrganization' # api_bodyValue= '' km = KangMian(api_method, '{}') responseData = km.callAPI() # print(type(responseData)) print(responseData)
def employee(): api_method = 'employee/v2/queryEmployee' # api_bodyValue= '' km = KangMian(api_method, '{}') responseData = km.callAPI() emp = ParseEmployee() sqlDict, colDict = emp.getTabAndSql_Dict() list_sql = Util.dealResponseData(responseData, sqlDict, colDict) print(len(list_sql)) pg = pypgsql.dba() pg.execListSql(list_sql)
'store_v1_querystore_linkmans' ] pg = pypgsql.dba() sql_truncate = 'truncate table ' for _ in tableName: _sql = sql_truncate + schemaName + '.' + _ + ';' print(_sql) pg.execsql(_sql) i = 0 while True: i += 1 api_bodyValue = '{"page_number":"' + str(i) + '"}' print(api_bodyValue) # exit(0) km = KangMian(api_method, api_bodyValue) # 拿到ResponData responseData = km.callAPI() if len(responseData) == 0: break # 拿到对应的数据库结构 sqlDict, colDict = common.getDict(schemaName, tableName) list_sql = Util.dealResponseData(responseData, sqlDict, colDict) print(len(list_sql)) t1 = time.time() pg.execListSql(list_sql) print(time.time() - t1)