100 lines
2.3 KiB
Plaintext
100 lines
2.3 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"metadata": {},
|
|
"cell_type": "markdown",
|
|
"source": "## 宜搭流程",
|
|
"id": "4af5abaa2a1a175f"
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"id": "initial_id",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"ExecuteTime": {
|
|
"end_time": "2025-12-11T06:35:48.340503Z",
|
|
"start_time": "2025-12-11T06:35:10.459870Z"
|
|
}
|
|
},
|
|
"source": [
|
|
"import pandas as pd\n",
|
|
"from yd_api import YDAPI\n",
|
|
"from tqdm.notebook import tqdm\n",
|
|
"\n",
|
|
"yd_api_instance = YDAPI()\n",
|
|
"\n",
|
|
"token = yd_api_instance.generateToken()\n",
|
|
"\n",
|
|
"\n",
|
|
"df = pd.read_excel(r\"C:\\Users\\zy187\\Desktop\\流程续约服务数据合并情况总表.xlsx\",sheet_name=\"总表\")\n",
|
|
"\n",
|
|
"all_data = []\n",
|
|
"for index,row in tqdm(df.iterrows(),total=len(df)):\n",
|
|
" id = row[\"实例ID\"]\n",
|
|
" res = yd_api_instance.get_approval_records(token = token,processInstanceId = id)\n",
|
|
" result_list = res[\"result\"]\n",
|
|
" for result in result_list:\n",
|
|
" result[\"实例ID\"] = id\n",
|
|
" all_data.append(result)\n",
|
|
" break\n",
|
|
"\n",
|
|
"df1 = pd.DataFrame(all_data)\n",
|
|
"\n",
|
|
"df2 = pd.merge(df,df1,on=\"实例ID\",how=\"left\")\n",
|
|
"df2.to_excel(r\"C:\\Users\\zy187\\Desktop\\结果.xlsx\")\n",
|
|
"\n",
|
|
"\n"
|
|
],
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
" 0%| | 0/13252 [00:00<?, ?it/s]"
|
|
],
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
"version_major": 2,
|
|
"version_minor": 0,
|
|
"model_id": "8986e952c720411e9ab60948965b830d"
|
|
}
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data",
|
|
"jetTransient": {
|
|
"display_id": null
|
|
}
|
|
}
|
|
],
|
|
"execution_count": 1
|
|
},
|
|
{
|
|
"metadata": {},
|
|
"cell_type": "code",
|
|
"outputs": [],
|
|
"execution_count": null,
|
|
"source": "",
|
|
"id": "41dfeeb730400c9b"
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 2
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython2",
|
|
"version": "2.7.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|