经销商新签服务单表单字段更新
This commit is contained in:
+103
-19
@@ -1,20 +1,104 @@
|
||||
{
|
||||
'app_id': '6694d3c4fcb69ca9a111a6c4',
|
||||
'form_id': '693778ee287cfdcc2df85ece',
|
||||
'form_title': '流程表单结构测试',
|
||||
'instance_id': '6937daf6f6e57cd3179c53c0',
|
||||
'url': 'https://dingtalk.jiandaoyun.com/workflow/process_instance/6937daf6f6e57cd3179c53c0',
|
||||
'update_time': '2025-12-09T08:17:36.460Z',
|
||||
'create_time': '2025-12-09T08:16:54.409Z',
|
||||
'finish_time': '2025-12-09T08:17:36.460Z',
|
||||
'status': 1,
|
||||
'creator': {
|
||||
'username': '#admin',
|
||||
'name': 'F6汽车科技',
|
||||
'type': 0,
|
||||
'status': 1,
|
||||
'integrate_id': '#admin'
|
||||
},
|
||||
'tasks': [],
|
||||
'result': 1
|
||||
}
|
||||
"result": [
|
||||
{
|
||||
"processInstanceId": "fa83e004-64d5-40a8-b2a9-122cc24a548f",
|
||||
"operateTimeGMT": "2025-02-28T09:07Z",
|
||||
"showName": "提交申请",
|
||||
"operateType": "NEW_PROCESS",
|
||||
"remark": "",
|
||||
"taskHoldTimeGMT": 0,
|
||||
"type": "HISTORY",
|
||||
"operatorName": "宜搭平台",
|
||||
"actionExit": "submit",
|
||||
"operatorUserId": "yida_pub_account",
|
||||
"activityId": "sid-restartevent",
|
||||
"size": 1,
|
||||
"dataId": 52359309345,
|
||||
"domainList": [],
|
||||
"operatorDisplayName": "宜搭平台",
|
||||
"action": "提交申请",
|
||||
"taskId": "null",
|
||||
"operatorPhotoUrl": "//img.alicdn.com/tfs/TB1mKVJSpXXXXcwaXXXXXXXXXXX-78-80.jpg"
|
||||
},
|
||||
{
|
||||
"processInstanceId": "fa83e004-64d5-40a8-b2a9-122cc24a548f",
|
||||
"operateTimeGMT": "2025-03-18T10:14Z",
|
||||
"showName": "120天联系情况",
|
||||
"operateType": "EXECUTE_TASK_NORMAL",
|
||||
"remark": "提交",
|
||||
"taskHoldTimeGMT": 0,
|
||||
"type": "HISTORY",
|
||||
"operatorName": "孟祥宇",
|
||||
"actionExit": "agree",
|
||||
"operatorUserId": "224616673723465569",
|
||||
"activityId": "sid-6470221a-82ec-4bdd-a873-245ee47a5605",
|
||||
"size": 1,
|
||||
"dataId": 53850072345,
|
||||
"domainList": [],
|
||||
"operatorDisplayName": "孟祥宇",
|
||||
"action": "提交",
|
||||
"taskId": "52359293348",
|
||||
"operatorPhotoUrl": "https://static.dingtalk.com/media/lADPDh0cUUaSfHrNAvDNAnA_624_752.jpg"
|
||||
},
|
||||
{
|
||||
"processInstanceId": "fa83e004-64d5-40a8-b2a9-122cc24a548f",
|
||||
"operateTimeGMT": "2025-04-01T14:08Z",
|
||||
"showName": "60天联系情况",
|
||||
"operateType": "EXECUTE_TASK_NORMAL",
|
||||
"remark": "系统提交",
|
||||
"taskHoldTimeGMT": 0,
|
||||
"type": "HISTORY",
|
||||
"operatorName": "魏子淇",
|
||||
"actionExit": "agree",
|
||||
"operatorUserId": "195159084238961158",
|
||||
"activityId": "sid-ab6374fd-7580-66d5-1628-6b0666bb38ff",
|
||||
"size": 1,
|
||||
"dataId": 55294608170,
|
||||
"domainList": [],
|
||||
"operatorDisplayName": "魏子淇",
|
||||
"action": "提交",
|
||||
"taskId": "53850072349",
|
||||
"operatorPhotoUrl": "https://static.dingtalk.com/media/lADPD2sQvHoyUEbNAtHNAtA_720_721.jpg"
|
||||
},
|
||||
{
|
||||
"processInstanceId": "fa83e004-64d5-40a8-b2a9-122cc24a548f",
|
||||
"operateTimeGMT": "2025-04-01T14:08Z",
|
||||
"showName": "30天联系情况",
|
||||
"operateType": "EXECUTE_TASK_NORMAL",
|
||||
"remark": "系统提交",
|
||||
"taskHoldTimeGMT": 0,
|
||||
"type": "HISTORY",
|
||||
"operatorName": "魏子淇",
|
||||
"actionExit": "agree",
|
||||
"operatorUserId": "195159084238961158",
|
||||
"activityId": "sid-e5928800-154e-4e20-6019-1364274afc49",
|
||||
"size": 1,
|
||||
"dataId": 55294609293,
|
||||
"domainList": [],
|
||||
"operatorDisplayName": "魏子淇",
|
||||
"action": "提交",
|
||||
"taskId": "55294608175",
|
||||
"operatorPhotoUrl": "https://static.dingtalk.com/media/lADPD2sQvHoyUEbNAtHNAtA_720_721.jpg"
|
||||
},
|
||||
{
|
||||
"processInstanceId": "fa83e004-64d5-40a8-b2a9-122cc24a548f",
|
||||
"operateTimeGMT": "2025-04-01T14:08Z",
|
||||
"showName": "0天处理情况",
|
||||
"operateType": "EXECUTE_TASK_NORMAL",
|
||||
"remark": "系统提交",
|
||||
"taskHoldTimeGMT": 0,
|
||||
"type": "HISTORY",
|
||||
"operatorName": "魏子淇",
|
||||
"actionExit": "agree",
|
||||
"operatorUserId": "195159084238961158",
|
||||
"activityId": "sid-ba12125f-bc3a-2663-ebf0-43b5aeb8c32c",
|
||||
"size": 1,
|
||||
"dataId": 55294558885,
|
||||
"domainList": [],
|
||||
"operatorDisplayName": "魏子淇",
|
||||
"action": "同意",
|
||||
"taskId": "55294609301",
|
||||
"operatorPhotoUrl": "https://static.dingtalk.com/media/lADPD2sQvHoyUEbNAtHNAtA_720_721.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import pandas as pd
|
||||
from yd_api import YDAPI
|
||||
from tqdm import tqdm
|
||||
|
||||
yd_api_instance = YDAPI()
|
||||
|
||||
token = yd_api_instance.generateToken()
|
||||
|
||||
df = pd.read_excel(r"C:\Users\zy187\Desktop\流程续约服务数据合并情况总表.xlsx",sheet_name="总表")
|
||||
|
||||
all_data = []
|
||||
for index,row in tqdm(df.iterrows(),total=len(df)):
|
||||
id = row["实例ID"]
|
||||
res = yd_api_instance.get_approval_records(token = token,processInstanceId = id)
|
||||
result_list = res["result"]
|
||||
for result in result_list:
|
||||
result["实例ID"] = id
|
||||
all_data.append(result)
|
||||
|
||||
|
||||
df1 = pd.DataFrame(all_data)
|
||||
|
||||
df2 = pd.merge(df,df1,on="实例ID",how="left")
|
||||
df2.to_excel(r"C:\Users\zy187\Desktop\结果.xlsx")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user