509 lines
17 KiB
Plaintext
509 lines
17 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"id": "initial_id",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"ExecuteTime": {
|
|
"end_time": "2025-12-22T14:07:08.872399Z",
|
|
"start_time": "2025-12-22T13:48:40.624880Z"
|
|
}
|
|
},
|
|
"source": [
|
|
"import pandas as pd\n",
|
|
"import requests\n",
|
|
"from module import F6_module\n",
|
|
"import time\n",
|
|
"from tqdm import tqdm\n",
|
|
"import datetime\n",
|
|
"import time\n",
|
|
"\n",
|
|
"# === 计算距离今天 19:00 还有多少秒 ===\n",
|
|
"now = datetime.datetime.now()\n",
|
|
"target_time = now.replace(hour=19, minute=0, second=0, microsecond=0)\n",
|
|
"\n",
|
|
"\n",
|
|
"\n",
|
|
"org_name = \"太原胖哥底盘专修\"\n",
|
|
"\n",
|
|
"df = pd.read_excel(fr\"C:\\Users\\zy187\\Desktop\\钉钉文件\\项目停用模板(1).xlsx\", dtype=str, sheet_name=0)\n",
|
|
"type_ = 0 # 1 停用 0启用\n",
|
|
"\n",
|
|
"cookies = {\n",
|
|
" 'f6-ids-goodsSESSIONID': 'c82feb85-1899-4621-9191-0c55fa8e29ce',\n",
|
|
" 'erpLanguage': 'zh-CN',\n",
|
|
" 'tmall': 'false',\n",
|
|
" 'prodOrg': '16024893747162546234',\n",
|
|
" 'unp': '16024896179200360473',\n",
|
|
" '_up': '-NillNN-qyBEJ--t3vnSknvoOF1_z_WFucsE1HI9WudeUPHFoJrQjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqEvUQqIoi0gML_PhRv-ZNHu3M-GTf3pq1HX6ur-pci-sak1DDOhRsrEj9-EHF8svhQWA.',\n",
|
|
" 'sensorsdata2015jssdkcross': '%7B%22distinct_id%22%3A%2216024896179200360473%22%2C%22first_id%22%3A%2219a48e066e68e2-067b1e693596828-4c657b58-2073600-19a48e066e71500%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22%24device_id%22%3A%2219a48e066e68e2-067b1e693596828-4c657b58-2073600-19a48e066e71500%22%7D',\n",
|
|
"}\n",
|
|
"\n",
|
|
"\n",
|
|
"# 2.获取门店id\n",
|
|
"params = {\n",
|
|
" 'currentPage': '1',\n",
|
|
" 'pageSize': '10',\n",
|
|
" 'name': '',\n",
|
|
"}\n",
|
|
"\n",
|
|
"response = requests.get(\n",
|
|
" 'https://yunxiu.f6car.cn/hive/org/getPageOrgGroupMembers',\n",
|
|
" params=params,\n",
|
|
" cookies=cookies,\n",
|
|
")\n",
|
|
"\n",
|
|
"total = response.json().get(\"data\", {}).get(\"total\", \"\")\n",
|
|
"all_page = total // 10 + 1\n",
|
|
"org_id = \"\"\n",
|
|
"all_org_list = []\n",
|
|
"for page in tqdm(range(1, all_page + 1)):\n",
|
|
" params['currentPage'] = str(page)\n",
|
|
" response = requests.get(\n",
|
|
" 'https://yunxiu.f6car.cn/hive/org/getPageOrgGroupMembers',\n",
|
|
" params=params,\n",
|
|
" cookies=cookies,\n",
|
|
" )\n",
|
|
" org_list = response.json().get(\"data\", {}).get(\"list\", [])\n",
|
|
"\n",
|
|
" for item in org_list:\n",
|
|
" if item.get(\"orgName\") == org_name:\n",
|
|
" org_id = item.get(\"orgId\")\n",
|
|
" break\n",
|
|
"\n",
|
|
"# 获取项目信息\n",
|
|
"json_data = {\n",
|
|
" 'param': '',\n",
|
|
" 'name': '',\n",
|
|
" 'customCode': '',\n",
|
|
" 'currentPage': 1,\n",
|
|
" 'pageSize': 100,\n",
|
|
" 'isDel': 1,\n",
|
|
" 'customInvoiceCategory': 0,\n",
|
|
" 'idOwnOrg': org_id,\n",
|
|
"}\n",
|
|
"\n",
|
|
"response = requests.post(\n",
|
|
" 'https://ids-goods.f6car.cn/f6-ids-goods/service/getServiceList',\n",
|
|
" cookies=cookies,\n",
|
|
" json=json_data,\n",
|
|
")\n",
|
|
"all_project_list = []\n",
|
|
"total_pages = response.json().get(\"data\", {}).get(\"totalPages\", \"\")\n",
|
|
"for page in tqdm(range(1, total_pages + 1)):\n",
|
|
" json_data['currentPage'] = str(page)\n",
|
|
" response = requests.post(\n",
|
|
" 'https://ids-goods.f6car.cn/f6-ids-goods/service/getServiceList',\n",
|
|
" cookies=cookies,\n",
|
|
" json=json_data,\n",
|
|
" )\n",
|
|
" project_list = response.json().get(\"data\", {}).get(\"records\", [])\n",
|
|
" all_project_list.extend(project_list)\n",
|
|
"\n",
|
|
"code_list = df.iloc[:, 0].dropna().astype(str).tolist()\n",
|
|
"res_data_list =[]\n",
|
|
"for item in tqdm(all_project_list):\n",
|
|
" custom_code = item.get(\"customCode\")\n",
|
|
" if not custom_code or str(custom_code) not in code_list or not code_list:\n",
|
|
" continue\n",
|
|
" info_id = item.get(\"infoId\")\n",
|
|
" pk_id = item.get(\"pkId\")\n",
|
|
" json_data = {\n",
|
|
" \"orgIdList\": [\n",
|
|
" org_id,\n",
|
|
" ],\n",
|
|
" \"isDel\": type_, # 1 停用 0启用\n",
|
|
" \"infoId\": info_id,\n",
|
|
" \"pkId\": pk_id,\n",
|
|
" \"type\": 1,\n",
|
|
" \"idOwnOrg\": org_id\n",
|
|
" }\n",
|
|
"\n",
|
|
" response = requests.post(\n",
|
|
" 'https://ids-goods.f6car.cn/f6-ids-goods/service/editAttributeByType',\n",
|
|
" cookies=cookies,\n",
|
|
" json=json_data,\n",
|
|
" )\n",
|
|
" try:\n",
|
|
" res_data_list.append(response.json())\n",
|
|
" except:\n",
|
|
" print(response.text)\n",
|
|
" pass\n",
|
|
"df21 = pd.DataFrame(res_data_list)\n",
|
|
"df21.to_excel(r\"C:\\Users\\zy187\\Desktop\\钉钉文件\\项目停用结果3.xlsx\")\n",
|
|
"\n",
|
|
"\n",
|
|
"\n"
|
|
],
|
|
"outputs": [
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"100%|██████████| 1/1 [00:00<00:00, 6.36it/s]\n",
|
|
"100%|██████████| 70/70 [00:13<00:00, 5.28it/s]\n",
|
|
"100%|██████████| 6962/6962 [18:12<00:00, 6.37it/s]\n"
|
|
]
|
|
}
|
|
],
|
|
"execution_count": 7
|
|
},
|
|
{
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2025-12-22T13:48:20.877814Z",
|
|
"start_time": "2025-12-22T13:48:20.873484Z"
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": "len(all_project_list)",
|
|
"id": "ff78eb5852aa93d8",
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"914"
|
|
]
|
|
},
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"execution_count": 6
|
|
},
|
|
{
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2025-12-18T05:40:56.613285Z",
|
|
"start_time": "2025-12-18T05:40:56.443597Z"
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": [
|
|
"json_data = {\n",
|
|
" \"orgIdList\": [\n",
|
|
" \"11240984669917217520\",\n",
|
|
" \"11240984669917400547\"\n",
|
|
" ],\n",
|
|
" \"isDel\": 0,\n",
|
|
" \"infoId\": \"14582097883002122976\",\n",
|
|
" \"pkId\": \"1307770822\",\n",
|
|
" \"type\": 1,\n",
|
|
" \"idOwnOrg\": \"11240984669917217520\"\n",
|
|
"}\n",
|
|
"\n",
|
|
"response = requests.post(\n",
|
|
" 'https://ids-goods.f6car.cn/f6-ids-goods/service/editAttributeByType',\n",
|
|
" cookies=cookies,\n",
|
|
" json=json_data,\n",
|
|
")\n",
|
|
"response.json()"
|
|
],
|
|
"id": "c024dbec14fbe39e",
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'code': 200,\n",
|
|
" 'data': {'abbreviation': '',\n",
|
|
" 'allDel': None,\n",
|
|
" 'allOrgIdList': None,\n",
|
|
" 'amount': 0.0,\n",
|
|
" 'categoryId': 0,\n",
|
|
" 'categoryName': '',\n",
|
|
" 'chain': 1,\n",
|
|
" 'code': '',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'creationDate': '2024-08-27 15:00:39',\n",
|
|
" 'creationtime': 1724742039000,\n",
|
|
" 'creator': '15503028824961978372',\n",
|
|
" 'creatorName': '曹伟',\n",
|
|
" 'customCode': 'XM03448',\n",
|
|
" 'customInfo': None,\n",
|
|
" 'groupId': None,\n",
|
|
" 'groupServiceDetailMap': None,\n",
|
|
" 'idFrom': None,\n",
|
|
" 'idMdmService': '11611918748604174368',\n",
|
|
" 'idOwnOrg': '11240984669917217520',\n",
|
|
" 'idOwnOrgFrom': None,\n",
|
|
" 'idSourceService': '',\n",
|
|
" 'infoId': '14582097883002122976',\n",
|
|
" 'isCommon': 0,\n",
|
|
" 'isDel': 0,\n",
|
|
" 'isLocal': None,\n",
|
|
" 'itemId': '',\n",
|
|
" 'kzServiceName': '',\n",
|
|
" 'labelId': '1297428',\n",
|
|
" 'labelName': '洗车',\n",
|
|
" 'mainOrg': None,\n",
|
|
" 'manageStatus': 0,\n",
|
|
" 'memo': '',\n",
|
|
" 'mnemonic': '',\n",
|
|
" 'modifiedDate': '2025-12-18 13:40:56',\n",
|
|
" 'modifiedtime': 1766036456000,\n",
|
|
" 'modifier': '15865484595890778191',\n",
|
|
" 'modifierName': '张阳',\n",
|
|
" 'name': '外出不修刹车',\n",
|
|
" 'newCategoryId': None,\n",
|
|
" 'operateType': None,\n",
|
|
" 'orgIdList': None,\n",
|
|
" 'pkId': '1307770822',\n",
|
|
" 'price': 0.0,\n",
|
|
" 'priceControl': None,\n",
|
|
" 'projectId': '1307770822',\n",
|
|
" 'rank': None,\n",
|
|
" 'sales': None,\n",
|
|
" 'score': None,\n",
|
|
" 'serviceCarCategoryWorkHourVoList': None,\n",
|
|
" 'serviceCategoryAmountVoList': [{'amount': 0.0,\n",
|
|
" 'amountId': 0,\n",
|
|
" 'carCategoryId': '985696',\n",
|
|
" 'carCategoryName': '分类一1',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'costTypeName': '',\n",
|
|
" 'id': '426925698',\n",
|
|
" 'idOwnOrg': None,\n",
|
|
" 'isCustom': None,\n",
|
|
" 'isDefault': 1,\n",
|
|
" 'isEnable': 1,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'queryMaster': False,\n",
|
|
" 'serviceId': '1307770822',\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoId': None,\n",
|
|
" 'workHour': 1.0,\n",
|
|
" 'workHourId': 0},\n",
|
|
" {'amount': 0.0,\n",
|
|
" 'amountId': 0,\n",
|
|
" 'carCategoryId': '985697',\n",
|
|
" 'carCategoryName': '分类二',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'costTypeName': '',\n",
|
|
" 'id': '426925699',\n",
|
|
" 'idOwnOrg': None,\n",
|
|
" 'isCustom': None,\n",
|
|
" 'isDefault': 0,\n",
|
|
" 'isEnable': 1,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'queryMaster': False,\n",
|
|
" 'serviceId': '1307770822',\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoId': None,\n",
|
|
" 'workHour': 1.0,\n",
|
|
" 'workHourId': 0},\n",
|
|
" {'amount': 0.0,\n",
|
|
" 'amountId': 0,\n",
|
|
" 'carCategoryId': '985698',\n",
|
|
" 'carCategoryName': '分类三',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'costTypeName': '',\n",
|
|
" 'id': '426925700',\n",
|
|
" 'idOwnOrg': None,\n",
|
|
" 'isCustom': None,\n",
|
|
" 'isDefault': 0,\n",
|
|
" 'isEnable': 1,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'queryMaster': False,\n",
|
|
" 'serviceId': '1307770822',\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoId': None,\n",
|
|
" 'workHour': 1.0,\n",
|
|
" 'workHourId': 0},\n",
|
|
" {'amount': 0.0,\n",
|
|
" 'amountId': 0,\n",
|
|
" 'carCategoryId': '985699',\n",
|
|
" 'carCategoryName': '分类四',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'costTypeName': '',\n",
|
|
" 'id': '426925701',\n",
|
|
" 'idOwnOrg': None,\n",
|
|
" 'isCustom': None,\n",
|
|
" 'isDefault': 0,\n",
|
|
" 'isEnable': 1,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'queryMaster': False,\n",
|
|
" 'serviceId': '1307770822',\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoId': None,\n",
|
|
" 'workHour': 1.0,\n",
|
|
" 'workHourId': 0},\n",
|
|
" {'amount': 0.0,\n",
|
|
" 'amountId': 0,\n",
|
|
" 'carCategoryId': '985700',\n",
|
|
" 'carCategoryName': '分类五',\n",
|
|
" 'cost': 0.0,\n",
|
|
" 'costType': 1,\n",
|
|
" 'costTypeName': '',\n",
|
|
" 'id': '426925702',\n",
|
|
" 'idOwnOrg': None,\n",
|
|
" 'isCustom': None,\n",
|
|
" 'isDefault': 0,\n",
|
|
" 'isEnable': 1,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'queryMaster': False,\n",
|
|
" 'serviceId': '1307770822',\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoId': None,\n",
|
|
" 'workHour': 1.0,\n",
|
|
" 'workHourId': 0}],\n",
|
|
" 'serviceCost': 0.0,\n",
|
|
" 'serviceCostType': 0,\n",
|
|
" 'serviceId': None,\n",
|
|
" 'serviceIdList': None,\n",
|
|
" 'serviceInfoDetailVos': [{'abbreviation': '',\n",
|
|
" 'amount': 0.0,\n",
|
|
" 'code': '',\n",
|
|
" 'cost': None,\n",
|
|
" 'costType': None,\n",
|
|
" 'creator': None,\n",
|
|
" 'groupId': None,\n",
|
|
" 'idOwnOrg': '11240984669917400547',\n",
|
|
" 'infoId': '14582097883002122976',\n",
|
|
" 'isCommon': None,\n",
|
|
" 'isDel': 0,\n",
|
|
" 'itemId': '',\n",
|
|
" 'manageFlag': None,\n",
|
|
" 'modifier': None,\n",
|
|
" 'name': '',\n",
|
|
" 'orgIdList': None,\n",
|
|
" 'pkId': 1307769909,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'priceControl': None,\n",
|
|
" 'projectId': None,\n",
|
|
" 'serviceCategoryAmountVoList': None,\n",
|
|
" 'serviceCostType': None,\n",
|
|
" 'serviceInfoIdList': None,\n",
|
|
" 'taxRateOutput': None},\n",
|
|
" {'abbreviation': '',\n",
|
|
" 'amount': 0.0,\n",
|
|
" 'code': '',\n",
|
|
" 'cost': None,\n",
|
|
" 'costType': None,\n",
|
|
" 'creator': None,\n",
|
|
" 'groupId': None,\n",
|
|
" 'idOwnOrg': '11240984669917217520',\n",
|
|
" 'infoId': '14582097883002122976',\n",
|
|
" 'isCommon': None,\n",
|
|
" 'isDel': 0,\n",
|
|
" 'itemId': '',\n",
|
|
" 'manageFlag': None,\n",
|
|
" 'modifier': None,\n",
|
|
" 'name': '',\n",
|
|
" 'orgIdList': None,\n",
|
|
" 'pkId': 1307770822,\n",
|
|
" 'price': 0.0,\n",
|
|
" 'priceControl': None,\n",
|
|
" 'projectId': None,\n",
|
|
" 'serviceCategoryAmountVoList': None,\n",
|
|
" 'serviceCostType': None,\n",
|
|
" 'serviceInfoIdList': None,\n",
|
|
" 'taxRateOutput': None}],\n",
|
|
" 'serviceInfoIdList': None,\n",
|
|
" 'skuId': None,\n",
|
|
" 'sort': None,\n",
|
|
" 'sourceServiceinfoId': None,\n",
|
|
" 'tagTypes': None,\n",
|
|
" 'taxRateOutput': 0.13,\n",
|
|
" 'thirdInfoId': '',\n",
|
|
" 'tmServiceInfoDetailManageVos': None,\n",
|
|
" 'tmallId': None,\n",
|
|
" 'tmallSkuId': None,\n",
|
|
" 'type': None,\n",
|
|
" 'workHour': 1.0},\n",
|
|
" 'message': 'SUCCESS'}"
|
|
]
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"execution_count": 8
|
|
},
|
|
{
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2025-12-18T05:48:24.405581Z",
|
|
"start_time": "2025-12-18T05:48:24.249050Z"
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": [
|
|
"import requests\n",
|
|
"\n",
|
|
"cookies = {\n",
|
|
" 'f6-ids-goodsSESSIONID': '77348607-d493-4ce4-a8ec-7f50c78480e7',\n",
|
|
" 'erpLanguage': 'zh-CN',\n",
|
|
" 'prodOrg': '11240984669917217520',\n",
|
|
" 'unp': '15865484595890778191',\n",
|
|
" '_up': '-NillNN-qyBEJ--t3vnSknvoOF53y_SJuMkA2n43U-daUfnArpjQjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqEvUUq40h1wcN-_dRv-ZNHu3M-GTc1p60EX-sq-RQgeIal1HLPxpurEj95hXctJS3URo.',\n",
|
|
" 'sensorsdata2015jssdkcross': '%7B%22distinct_id%22%3A%2215865484595890778191%22%2C%22first_id%22%3A%2219a48e066e68e2-067b1e693596828-4c657b58-2073600-19a48e066e71500%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22%24device_id%22%3A%2219a48e066e68e2-067b1e693596828-4c657b58-2073600-19a48e066e71500%22%7D',\n",
|
|
" 'tmall': 'false',\n",
|
|
"}\n",
|
|
"\n",
|
|
"response = requests.get(\n",
|
|
" 'https://ids-goods.f6car.cn/f6-ids-goods/permission/queryPermissionOrgsByUserId',\n",
|
|
" cookies=cookies,\n",
|
|
"\n",
|
|
")\n",
|
|
"response.json()"
|
|
],
|
|
"id": "8a2feb81835fecd3",
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'code': 200,\n",
|
|
" 'data': [{'abbreviation': 'F6数据组(废)',\n",
|
|
" 'groupId': '11240984669917212520',\n",
|
|
" 'id': None,\n",
|
|
" 'idOwnOrg': '11240984669917217520',\n",
|
|
" 'isDel': None,\n",
|
|
" 'userId': None},\n",
|
|
" {'abbreviation': '分店测试(废弃)',\n",
|
|
" 'groupId': '11240984669917212520',\n",
|
|
" 'id': None,\n",
|
|
" 'idOwnOrg': '11240984669917400547',\n",
|
|
" 'isDel': None,\n",
|
|
" 'userId': None}],\n",
|
|
" 'message': 'SUCCESS'}"
|
|
]
|
|
},
|
|
"execution_count": 11,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"execution_count": 11
|
|
}
|
|
],
|
|
"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
|
|
}
|