Files
F6--/F6系统常用脚本/F6材料信息删除.ipynb
T
2026-01-30 11:28:35 +08:00

348 lines
15 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 材料信息删除"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas.EL2C6PLE4ZYW3ECEVIV3OXXGRN2NRFM2.gfortran-win_amd64.dll\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas64__v0.3.21-gcc_10_3_0.dll\n",
" warnings.warn(\"loaded more than 1 DLL from .libs:\"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CL0005884 @ 14582097882978937643\n",
"CL0005883 @ 14582097882978840768\n",
"CL0005882 @ 14582097882978836413\n",
"CL0005871 @ 14582097882978835910\n",
"CL0005875 @ 14582097882978835914\n",
"CL0005870 @ 14582097882978835909\n",
"CL0005879 @ 14582097882978835918\n",
"CL0005869 @ 14582097882978835908\n",
"CL0005876 @ 14582097882978835915\n",
"CL0005873 @ 14582097882978835912\n",
"CL0005878 @ 14582097882978835917\n",
"CL0005874 @ 14582097882978835913\n",
"CL0005880 @ 14582097882978835919\n",
"CL0005868 @ 14582097882978835907\n",
"CL0005872 @ 14582097882978835911\n",
"CL0005877 @ 14582097882978835916\n",
"CL0005881 @ 14582097882978835920\n",
"CL0005861 @ 14582097882978832878\n",
"CL0005864 @ 14582097882978832881\n",
"CL0005866 @ 14582097882978832883\n",
"CL0005867 @ 14582097882978832884\n",
"CL0005863 @ 14582097882978832880\n",
"CL0005865 @ 14582097882978832882\n",
"CL0005862 @ 14582097882978832879\n",
"CL0005669 @ 14582097882978831686\n",
"CL0005673 @ 14582097882978831690\n",
"CL0005683 @ 14582097882978831700\n",
"CL0005686 @ 14582097882978831703\n",
"CL0005693 @ 14582097882978831710\n",
"CL0005704 @ 14582097882978831721\n",
"CL0005705 @ 14582097882978831722\n",
"CL0005716 @ 14582097882978831733\n",
"CL0005717 @ 14582097882978831734\n",
"CL0005733 @ 14582097882978831750\n",
"CL0005741 @ 14582097882978831758\n",
"CL0005748 @ 14582097882978831765\n",
"CL0005755 @ 14582097882978831772\n",
"CL0005765 @ 14582097882978831782\n",
"CL0005761 @ 14582097882978831778\n",
"CL0005766 @ 14582097882978831783\n",
"CL0005780 @ 14582097882978832797\n",
"CL0005784 @ 14582097882978832801\n",
"CL0005786 @ 14582097882978832803\n",
"CL0005795 @ 14582097882978832812\n",
"CL0005797 @ 14582097882978832814\n",
"CL0005800 @ 14582097882978832817\n",
"CL0005859 @ 14582097882978832876\n",
"CL0005860 @ 14582097882978832877\n",
"CL0005811 @ 14582097882978832828\n",
"CL0005812 @ 14582097882978832829\n",
"CL0005816 @ 14582097882978832833\n",
"CL0005823 @ 14582097882978832840\n",
"CL0005832 @ 14582097882978832849\n",
"CL0005838 @ 14582097882978832855\n",
"CL0005849 @ 14582097882978832866\n",
"CL0005672 @ 14582097882978831689\n",
"CL0005675 @ 14582097882978831692\n",
"CL0005682 @ 14582097882978831699\n",
"CL0005690 @ 14582097882978831707\n",
"CL0005702 @ 14582097882978831719\n",
"CL0005706 @ 14582097882978831723\n",
"CL0005718 @ 14582097882978831735\n",
"CL0005720 @ 14582097882978831737\n",
"CL0005725 @ 14582097882978831742\n",
"CL0005731 @ 14582097882978831748\n",
"CL0005732 @ 14582097882978831749\n",
"CL0005746 @ 14582097882978831763\n",
"CL0005757 @ 14582097882978831774\n",
"CL0005759 @ 14582097882978831776\n",
"CL0005763 @ 14582097882978831780\n",
"CL0005769 @ 14582097882978831786\n",
"CL0005778 @ 14582097882978832795\n",
"CL0005779 @ 14582097882978832796\n",
"CL0005799 @ 14582097882978832816\n",
"CL0005825 @ 14582097882978832842\n",
"CL0005829 @ 14582097882978832846\n",
"CL0005831 @ 14582097882978832848\n",
"CL0005842 @ 14582097882978832859\n",
"CL0005852 @ 14582097882978832869\n",
"CL0005854 @ 14582097882978832871\n",
"CL0005681 @ 14582097882978831698\n",
"CL0005688 @ 14582097882978831705\n",
"CL0005692 @ 14582097882978831709\n",
"CL0005698 @ 14582097882978831715\n",
"CL0005699 @ 14582097882978831716\n",
"CL0005700 @ 14582097882978831717\n",
"CL0005710 @ 14582097882978831727\n",
"CL0005712 @ 14582097882978831729\n",
"CL0005724 @ 14582097882978831741\n",
"CL0005745 @ 14582097882978831762\n",
"CL0005753 @ 14582097882978831770\n",
"CL0005758 @ 14582097882978831775\n",
"CL0005764 @ 14582097882978831781\n",
"CL0005767 @ 14582097882978831784\n",
"CL0005770 @ 14582097882978831787\n",
"CL0005776 @ 14582097882978832793\n",
"CL0005777 @ 14582097882978832794\n",
"CL0005790 @ 14582097882978832807\n",
"CL0005792 @ 14582097882978832809\n",
"CL0005807 @ 14582097882978832824\n"
]
}
],
"source": [
"import pandas as pd\n",
"import requests\n",
"import json\n",
"import xlrd\n",
"from pprint import pprint\n",
"cookies_str = 'f6-ids-goodsSESSIONID=af571e86-4e73-4006-9c8a-255f6977165c; erpLanguage=zh-CN; tmall=false; unp=10546443564007523766; _up=-NillNN-qyBEJ--t3vnSknvoOFt6yfeJtM4A1X8_WuBYVPLGoZ_QjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqFPoUqI4i0wsJ9_JRv-ZNHu3M-GTZ25y3EXOrq-tRiesdlVTAORVprEj9-knQgcH6NGI.; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2215605564149906554899%22%2C%22first_id%22%3A%2217e08ece80f53a-0448dc86383ae5-3e604809-1327104-17e08ece81094e%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%22https%3A%2F%2Fyunxiu.f6car.com%2Ferp%2Fview%2Findex.html%22%7D%2C%22%24device_id%22%3A%2217e08ece80f53a-0448dc86383ae5-3e604809-1327104-17e08ece81094e%22%7D; prodOrg=11240984669917926035'\n",
"\n",
"cookies_str = cookies_str.encode('utf-8').decode('latin-1')\n",
"\n",
"cookie_dict = {item.split('=')[0]: item.split('=')[1]\n",
" for item in cookies_str.split('; ')}\n",
"\n",
"headers = {\n",
" 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40',\n",
" \"Content-Type\": \"application/json\",\n",
" 'origin': 'https://yunxiu.f6car.cn'\n",
"}\n",
"url = 'https://ids-goods.f6car.com/f6-ids-goods/part/getExactPartStockInfo'\n",
"for a in range(1,56):\n",
" json={\n",
" 'applyModel': \"\",\n",
" 'brand': \"\",\n",
" 'categoryId': \"\",\n",
" 'categoryName': \"\",\n",
" 'currentPage': a,\n",
" 'customCode': \"\",\n",
" 'idOwnOrg': \"11240984669917926035\",\n",
" 'keyWord': \"\",\n",
" 'labelId': \"\",\n",
" 'labelName': \"\",\n",
" 'name': \"\",\n",
" 'pageSize': 100,\n",
" 'sellPurchaseStatuses': [2, 3, 4, 5],\n",
" 'spec': \"\",\n",
" 'supplierCode': \"\"\n",
" }\n",
" res = requests.post(url,cookies=cookie_dict,json=json)\n",
" rr = res.json()\n",
" le=len(rr['data']['records'])\n",
" for i in range(0,le):\n",
" id1={}\n",
" rr0=rr['data']['records'][i]['customCode']\n",
" rr1=rr['data']['records'][i]['infoId']\n",
" print(rr0,\"@\",rr1)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas.EL2C6PLE4ZYW3ECEVIV3OXXGRN2NRFM2.gfortran-win_amd64.dll\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas64__v0.3.21-gcc_10_3_0.dll\n",
" warnings.warn(\"loaded more than 1 DLL from .libs:\"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
]
}
],
"source": [
"import pandas as pd\n",
"import requests\n",
"import json\n",
"import xlrd\n",
"from pprint import pprint\n",
"cookies_str = 'f6-ids-goodsSESSIONID=f20a1664-54ba-46e9-acad-3c911970b63b; gr_user_id=408fef1a-77ed-4e74-8f1e-31dde3446f2e; erpLanguage=zh-CN; tmall=false; unp=10546443564007523766; _up=-NillNN-qyBEJ--t3vnSknvoOFt6yfeJtM4A1X8_WuBYVPLGoZ_QjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqFPoUqIgm1QMN-flRv-ZNHu3M-GTZ25y3EXOrq-tRiesdlVTAORVprEj9zRT49czKaSs.; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2210546443564007523766%22%2C%22first_id%22%3A%221750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0%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%221750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0%22%7D; prodOrg=11240984669917926035'\n",
"\n",
"cookies_str = cookies_str.encode('utf-8').decode('latin-1')\n",
"\n",
"cookie_dict = {item.split('=')[0]: item.split('=')[1]\n",
" for item in cookies_str.split('; ')}\n",
"\n",
"headers = {\n",
" 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40',\n",
" \"Content-Type\": \"application/json\",\n",
" 'origin': 'https://yunxiu.f6car.com'\n",
"}\n",
"result = []\n",
"url = 'https://ids-goods.f6car.com/f6-ids-goods/part/getExactPartStockInfo'\n",
"for a in range(1,60):\n",
" try:\n",
" json={\n",
" 'applyModel': \"\",\n",
" 'brand': \"\",\n",
" 'categoryId': \"\",\n",
" 'categoryName': \"\",\n",
" 'currentPage': a,\n",
" 'customCode': \"\",\n",
" 'idOwnOrg': \"11240984669917926035\",\n",
" 'keyWord': \"\",\n",
" 'labelId': \"\",\n",
" 'labelName': \"\",\n",
" 'name': \"\",\n",
" 'pageSize': 100,\n",
" 'sellPurchaseStatuses': [2, 3, 4, 5],\n",
" 'spec': \"\",\n",
" 'supplierCode': \"\"\n",
" }\n",
" res = requests.post(url,cookies=cookie_dict,json=json)\n",
" rr = res.json()\n",
" le=len(rr['data']['records'])\n",
" for i in range(0,le):\n",
" applyModel=rr['data']['records'][i]['applyModel']\n",
" infoId=rr['data']['records'][i]['infoId']\n",
" name=rr['data']['records'][i]['name']\n",
" accId=rr['data']['records'][i]['accId']\n",
" supplierCode=rr['data']['records'][i]['supplierCode']\n",
" brand=rr['data']['records'][i]['brand']\n",
" result.append({'infoId':infoId,'材料编码':accId,'材料名称':name,'品牌':brand,'零件号':supplierCode,'规格型号':applyModel})\n",
" print(a)\n",
" except:\n",
" pass\n",
"df = pd.DataFrame(result)\n",
"df.to_excel(r'C:\\Users\\admin\\Desktop\\88888888888888888888888888888888888888888品牌零件号查询云材料.xlsx')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 删除材料信息"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas.EL2C6PLE4ZYW3ECEVIV3OXXGRN2NRFM2.gfortran-win_amd64.dll\n",
"c:\\Users\\admin\\.conda\\envs\\F6processing\\lib\\site-packages\\numpy\\.libs\\libopenblas64__v0.3.21-gcc_10_3_0.dll\n",
" warnings.warn(\"loaded more than 1 DLL from .libs:\"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"<Response [200]> {'infoIds': ['14582097882978832878'], 'idOwnOrg': '10546443564007523756'}\n"
]
}
],
"source": [
"import pandas as pd\n",
"import requests\n",
"import json\n",
"import xlrd\n",
"from pprint import pprint\n",
"import time\n",
"cookies_str = 'f6-ids-goodsSESSIONID=f0a4838b-8512-4057-a826-0b1b8ba37c6d; gr_user_id=408fef1a-77ed-4e74-8f1e-31dde3446f2e; erpLanguage=zh-CN; prodOrg=10546443564007523756; unp=10546443564007523766; _up=-NillNN-qyBEJ--t3vnSknvoOFt6yfeJtM4A1X8_WuBYVPLGoZ_QjaZJ9Q3d-WrAAGgt60MgQHajHWBHMKKxj0CuWypi1JgKCFP1EPEk-HbqFPoUoYMj0QQF_vFRv-ZNHu3M-GTZ25y3EXOrq-tRiesdlVTAORVprEj94m_voc22PGg.; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2210546443564007523766%22%2C%22first_id%22%3A%221750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0%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%221750b4690af1f6-089dd3a4874eb8-3d634f03-1327104-1750b4690b09d0%22%7D; tmall=false'\n",
"\n",
"cookies_str = cookies_str.encode('utf-8').decode('latin-1')\n",
"\n",
"cookie_dict = {item.split('=')[0]: item.split('=')[1]\n",
" for item in cookies_str.split('; ')}\n",
"\n",
"headers = {\n",
" 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40',\n",
" \"Content-Type\": \"application/json\",\n",
" 'origin': 'https://yunxiu.f6car.cn'\n",
"}\n",
"url = 'https://ids-goods.f6car.cn/f6-ids-goods/part/deletePartInfo'\n",
"\n",
"data = pd.read_excel(r\"C:\\Users\\admin\\Desktop\\材料信息删除.xlsx\", sheet_name='Sheet1')\n",
"for a in data.index:\n",
" infoId =data.loc[a,\"材料长码\"]\n",
" json={\"infoIds\":[str(infoId)],\"idOwnOrg\":\"10546443564007523756\"}\n",
" resquest = requests.post(url,cookies=cookie_dict,json=json)\n",
" print(resquest,json)\n",
" time.sleep(1)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.4 ('F6processing')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.4"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "f83923c7d0b4d2e003073efbd633777fa3fd66b7578149f24f67f4796b9b3ac4"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}