feat: 添加多个功能模块和工具脚本

- 新增websocket客户端和服务端实现
- 添加图片压缩工具和快速压缩脚本
- 实现学生信息处理相关API
- 添加MQTT客户端和消息处理功能
- 更新.gitignore忽略更多文件类型
- 添加数据库操作工具和示例
- 实现多个测试脚本和工具类
This commit is contained in:
2026-04-13 14:47:50 +08:00
parent 2cfd7c5a08
commit aac9f5934d
87 changed files with 216279 additions and 6519 deletions
File diff suppressed because one or more lines are too long
+592
View File
@@ -0,0 +1,592 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "c9588f47",
"metadata": {},
"outputs": [],
"source": [
"from requests import get,post\n",
"import pandas as pd\n",
"import time\n",
"teamId = 106\n",
"ip = \"http://192.168.0.244:8100\"\n",
"# ip = 'http://10.143.25.3:8090'\n",
"param = {\n",
" \"username\": \"tangchao\",\n",
" \"password\": \"123456a\",\n",
" \"client_id\": \"client\",\n",
" \"grant_type\": \"password\",\n",
" \"client_secret\": \"123456\",\n",
"}\n",
"data = get(url=f\"{ip}/oauth/token\",params=param).json()\n",
"token = data[\"access_token\"]\n",
"header = {\n",
" \"content-type\": \"application/json\",\n",
" \"authorization\": f\"Bearer {token}\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "2d1236e0",
"metadata": {},
"outputs": [],
"source": [
"data = get(\"http://192.168.0.209:8105/classAndRoom/nolist?teamId=106&access_token=2682259d-279c-425a-a260-daa57b94ed98\").json()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "b183905b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'success': True,\n",
" 'msg': '操作成功',\n",
" 'code': 0,\n",
" 'data': [{'id': None,\n",
" 'classId': None,\n",
" 'roomId': 245,\n",
" 'className': None,\n",
" 'roomName': '1-202',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 246,\n",
" 'className': None,\n",
" 'roomName': '1-203',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 247,\n",
" 'className': None,\n",
" 'roomName': '1-204',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 248,\n",
" 'className': None,\n",
" 'roomName': '1-205',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 249,\n",
" 'className': None,\n",
" 'roomName': '1-206',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 250,\n",
" 'className': None,\n",
" 'roomName': '1-207',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 251,\n",
" 'className': None,\n",
" 'roomName': '1-301',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 252,\n",
" 'className': None,\n",
" 'roomName': '1-302',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 253,\n",
" 'className': None,\n",
" 'roomName': '1-303',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 254,\n",
" 'className': None,\n",
" 'roomName': '1-304',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 255,\n",
" 'className': None,\n",
" 'roomName': '1-305',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 256,\n",
" 'className': None,\n",
" 'roomName': '1-306',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 257,\n",
" 'className': None,\n",
" 'roomName': '1-307',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 258,\n",
" 'className': None,\n",
" 'roomName': '1-310',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 259,\n",
" 'className': None,\n",
" 'roomName': '1-402',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 261,\n",
" 'className': None,\n",
" 'roomName': '1-403',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 262,\n",
" 'className': None,\n",
" 'roomName': '1-404',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 263,\n",
" 'className': None,\n",
" 'roomName': '1-405',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 264,\n",
" 'className': None,\n",
" 'roomName': '1-406',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 265,\n",
" 'className': None,\n",
" 'roomName': '1-407',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 266,\n",
" 'className': None,\n",
" 'roomName': '1-410',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 267,\n",
" 'className': None,\n",
" 'roomName': '2-202',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 268,\n",
" 'className': None,\n",
" 'roomName': '2-203',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 269,\n",
" 'className': None,\n",
" 'roomName': '2-204',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 270,\n",
" 'className': None,\n",
" 'roomName': '2-205',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 271,\n",
" 'className': None,\n",
" 'roomName': '2-206',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 272,\n",
" 'className': None,\n",
" 'roomName': '2-207',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 273,\n",
" 'className': None,\n",
" 'roomName': '2-208',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 274,\n",
" 'className': None,\n",
" 'roomName': '2-209',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 284,\n",
" 'className': None,\n",
" 'roomName': '2-402',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 285,\n",
" 'className': None,\n",
" 'roomName': '2-403',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 286,\n",
" 'className': None,\n",
" 'roomName': '2-404',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 287,\n",
" 'className': None,\n",
" 'roomName': '2-405',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 288,\n",
" 'className': None,\n",
" 'roomName': '2-406',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 289,\n",
" 'className': None,\n",
" 'roomName': '2-407',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 290,\n",
" 'className': None,\n",
" 'roomName': '2-408',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 291,\n",
" 'className': None,\n",
" 'roomName': '2-409',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 292,\n",
" 'className': None,\n",
" 'roomName': '2-301',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 293,\n",
" 'className': None,\n",
" 'roomName': '2-302',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 294,\n",
" 'className': None,\n",
" 'roomName': '2-303',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 295,\n",
" 'className': None,\n",
" 'roomName': '2-304',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 296,\n",
" 'className': None,\n",
" 'roomName': '2-305',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 297,\n",
" 'className': None,\n",
" 'roomName': '2-306',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 298,\n",
" 'className': None,\n",
" 'roomName': '2-307',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 299,\n",
" 'className': None,\n",
" 'roomName': '2-308',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 300,\n",
" 'className': None,\n",
" 'roomName': '2-309',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 301,\n",
" 'className': None,\n",
" 'roomName': '1-210',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106},\n",
" {'id': None,\n",
" 'classId': None,\n",
" 'roomId': 302,\n",
" 'className': None,\n",
" 'roomName': '9-308',\n",
" 'gradeName': None,\n",
" 'gradeId': None,\n",
" 'classIds': None,\n",
" 'teamId': 106}]}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "6d60192d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"10.143.25.7\n",
"10.143.25.10\n",
"10.143.25.13\n",
"10.143.25.16\n",
"10.143.25.19\n",
"10.143.25.22\n",
"10.143.25.25\n",
"10.143.25.28\n",
"10.143.25.31\n",
"10.143.25.34\n",
"10.143.25.37\n",
"10.143.25.40\n",
"10.143.25.43\n",
"10.143.25.46\n",
"10.143.25.49\n",
"10.143.25.52\n",
"10.143.25.79\n",
"10.143.25.55\n",
"10.143.25.58\n",
"10.143.25.61\n",
"10.143.25.64\n",
"10.143.25.67\n",
"10.143.25.70\n",
"10.143.25.73\n",
"10.143.25.76\n",
"10.143.25.82\n",
"10.143.25.85\n",
"10.143.25.88\n",
"10.143.25.91\n",
"10.143.25.94\n",
"10.143.25.97\n",
"10.143.25.100\n",
"10.143.25.106\n",
"10.143.25.109\n",
"10.143.25.112\n",
"10.143.25.115\n",
"10.143.25.118\n",
"10.143.25.121\n",
"10.143.25.124\n",
"10.143.25.127\n",
"10.143.25.130\n",
"10.143.25.133\n",
"10.143.25.136\n",
"10.143.25.139\n",
"10.143.25.142\n",
"10.143.25.145\n",
"10.143.25.148\n",
"10.143.25.103\n"
]
}
],
"source": [
"for item in data[\"data\"][\"records\"]:\n",
" print(item[\"ip\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cb48d4bf",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
+32
View File
@@ -0,0 +1,32 @@
from requests import get,post
import pandas as pd
import time
import os
teamId = 106
ip = "http://10.143.25.3:8090"
param = {
"username": "tangchao",
"password": "123456a",
"client_id": "client",
"grant_type": "password",
"client_secret": "123456",
}
data = get(url=f"{ip}/oauth/token",params=param).json()
token = data["access_token"]
header = {
"content-type": "application/json",
"authorization": f"Bearer {token}",
}
for root, dirs, files in os.walk("./students/"):
for file in files:
formFile = open(os.path.join(root, file), "rb")
mu_files = {
"file": (file, formFile, "image/jpeg"),
}
response = post(url=f"{ip}/school/stuface/upload", headers=, files=mu_files)
print(file)
print(response.json())
formFile.close()
break
break
+512
View File
@@ -0,0 +1,512 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "7aa426df",
"metadata": {},
"outputs": [],
"source": [
"from requests import get,post,put\n",
"import pandas as pd\n",
"import time\n",
"import os\n",
"\n",
"teamId = 106\n",
"ip = \"http://10.143.25.3:8090\"\n",
"param = {\n",
" \"username\": \"tangchao\",\n",
" \"password\": \"123456a\",\n",
" \"client_id\": \"client\",\n",
" \"grant_type\": \"password\",\n",
" \"client_secret\": \"123456\",\n",
"}\n",
"data = get(url=f\"{ip}/oauth/token\",params=param).json()\n",
"token = data[\"access_token\"]\n",
"header = {\n",
" \"content-type\": \"application/json\",\n",
" \"authorization\": f\"Bearer {token}\",\n",
"}\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "d790454a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"文件: 丁真泽仁.jpg\n",
"响应: {'success': True, 'msg': 'http://10.143.25.3:9000/iot-school/2025-11-06/e286b47e3c9d4db396400167b77b4b1b.JPG', 'code': 0, 'data': None}\n"
]
}
],
"source": [
"with open(\"./students/丁云钻.JPG\", \"rb\") as formFile:\n",
" # 正确的方式创建文件上传数据\n",
" mu_files = {\n",
" \"file\": (\"丁云钻.JPG\", formFile, \"application/octet-stream\")\n",
" }\n",
" \n",
" # 使用 files 参数而不是 data\n",
" response = post(\n",
" url=f\"{ip}/school/device/content/upload\",\n",
" headers={\n",
" \"authorization\": f\"Bearer {token}\"\n",
" },\n",
" files=mu_files\n",
" )\n",
" print(f\"文件: 丁真泽仁.jpg\")\n",
" print(f\"响应: {response.json()}\")\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "68b6d980",
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "9d2f61cf",
"metadata": {},
"outputs": [],
"source": [
"def getStudentInfo(name):\n",
" data = get(f\"{ip}/school/stuface/list?teamId=106&page=1&pageSize=15&gradeId=&classId=&stuName={name}&stuNo=&pageNumber=0&sortField=create_time&sortOrder=asc&access_token=908c0ba4-ead2-44a3-a3c4-6aaf0cfbeb8a\",headers=header).json()\n",
" if data['success']:\n",
" students = data['data']['records']\n",
" if len(students)==1:\n",
" return students[0]\n",
" elif len(students)>1:\n",
" count = 0\n",
" for stu in students:\n",
" if name == stu['stuName']:\n",
" count += 1\n",
" if count == 0:\n",
" return f\"姓名{name}没有学生,请检查\" \n",
" elif count > 1:\n",
" return f\"姓名{name}有{count}个学生,请检查\"\n",
" else:\n",
" for stu in students:\n",
" if name == stu['stuName']:\n",
" return stu\n",
" else:\n",
" return f\"姓名{name}有{len(students)}个学生,请检查\"\n",
"def uploadFace(file_path):\n",
" with open(file_path, \"rb\") as formFile:\n",
" mu_files = {\n",
" \"file\": (Path(file_path).name, formFile,\"application/octet-stream\")\n",
" }\n",
" response = post(f\"{ip}/school/device/content/upload\",\n",
" headers={\n",
" \"authorization\": f\"Bearer {token}\"\n",
" },\n",
" files=mu_files\n",
" ).json()\n",
" if response['success']:\n",
" return response\n",
" else:\n",
" return f\"上传失败{response['msg']}\"\n",
"def updateFaceInfo(stuInfo,files):\n",
" data = put(f\"{ip}/school/stuface/save\",\n",
" headers=header,\n",
" json={\n",
" \"studentId\": stuInfo['studentId'],\n",
" \"files\": files\n",
" }\n",
" ).json()\n",
" if data['success']:\n",
" print(\"更新成功\")\n",
" return data\n",
" else:\n",
" print(f\"更新失败{data['msg']}\")\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "97d03b64",
"metadata": {},
"outputs": [],
"source": [
"count = 0"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "b27da758",
"metadata": {},
"outputs": [],
"source": [
"fail_student=[]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "4eb1025d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"丁真 更新成功\n",
"丁真仁真 更新成功\n",
"丁真拥青 更新成功\n",
"丁真月登 姓名丁真月登有0个学生,请检查\n",
"丁真罗布 更新成功\n",
"丹增拥西 更新成功\n",
"丹增拥西.jpg.temp 姓名丹增拥西.jpg.temp有0个学生,请检查\n",
"丹真珠扎 更新成功\n",
"久美郎加 更新成功\n",
"于焜豪 更新成功\n",
"仁真曲珍 更新成功\n",
"仁青彭措 更新成功\n",
"付森林 更新成功\n",
"代子浩 更新成功\n",
"伍金次仁 更新成功\n",
"何奥雪 更新成功\n",
"何子健 更新成功\n",
"何瑞林 更新成功\n",
"何绮琪 更新成功\n",
"何雨洁 更新成功\n",
"佘芯欣 更新成功\n",
"余帅 更新成功\n",
"佟诗佳 更新成功\n",
"倪杰博文 更新成功\n",
"其麦 更新成功\n",
"冯文童 更新成功\n",
"冯星宇 更新成功\n",
"刘佳 更新成功\n",
"刘冬晨 更新成功\n",
"刘宸驿 更新成功\n",
"刘峻熙 更新成功\n",
"刘志欣 更新成功\n",
"刘权 更新成功\n",
"刘杰 姓名刘杰有3个学生,请检查\n",
"刘玉婷 姓名刘玉婷有2个学生,请检查\n",
"刘王昊杰 更新成功\n",
"刘肖 更新成功\n",
"刘芮 更新成功\n",
"刘芸汐 更新成功\n",
"刘萭菡 更新成功\n",
"卓玛曲忠 更新成功\n",
"单孜扎巴 更新成功\n",
"单真赤里 更新成功\n",
"卢朝亭 更新成功\n",
"古绒曲珍 更新成功\n",
"向雨涵 更新成功\n",
"吴瑞鑫 更新成功\n",
"吴雪 更新成功\n",
"周杰 更新成功\n",
"呷松泽仁 更新成功\n",
"呷绒拉姆 更新成功\n",
"呷绒拉姆.jpg.temp 姓名呷绒拉姆.jpg.temp有0个学生,请检查\n",
"唐越 更新成功\n",
"唐雨轩 姓名唐雨轩有0个学生,请检查\n",
"唐韵玲 更新成功\n",
"四郎吉称 更新成功\n",
"四郎娜姆 更新成功\n",
"四郎志玛 更新成功\n",
"四郎降村 更新成功\n",
"土登称来 更新成功\n",
"夏处 更新成功\n",
"夏宁静 姓名夏宁静有0个学生,请检查\n",
"夏思乐 更新成功\n",
"央珠尼玛 更新成功\n",
"姜唯怡 更新成功\n",
"姜唯怡.jpg.temp 姓名姜唯怡.jpg.temp有0个学生,请检查\n",
"娄源 更新成功\n",
"孙婧仪 更新成功\n",
"尹荣强 更新成功\n",
"尼玛拉姆 姓名尼玛拉姆有2个学生,请检查\n",
"巩天姚 更新成功\n",
"巴措 姓名巴措有2个学生,请检查\n",
"巴桑 更新成功\n",
"巴桑卓玛 更新成功\n",
"帅紫欣 更新成功\n",
"廖爽 更新成功\n",
"张世鑫 更新成功\n",
"张健霖 更新成功\n",
"张勇 姓名张勇有2个学生,请检查\n",
"张友林 更新成功\n",
"张康萌 更新成功\n",
"张旭东 更新成功\n",
"张明瑞 更新成功\n",
"张林丰 更新成功\n",
"张永科 更新成功\n",
"张澜 更新成功\n",
"张鑫雨 更新成功\n",
"张雨歆 更新成功\n",
"彭嘉妮 更新成功\n",
"彭小青 更新成功\n",
"彭徐馨 更新成功\n",
"彭馨怡 更新成功\n",
"徐宇奇 更新成功\n",
"德青巴姆 更新成功\n",
"德青翁姆 更新成功\n",
"志玛拥忠 更新成功\n",
"成宇轩 更新成功\n",
"戚昕钰 更新成功\n",
"房明勇 更新成功\n",
"扎西 更新成功\n",
"扎西华本 更新成功\n",
"扎西多吉 姓名扎西多吉有3个学生,请检查\n",
"扎西巴拥 姓名扎西巴拥有2个学生,请检查\n",
"扎西彭措 更新成功\n",
"扎西翁姆 姓名扎西翁姆有2个学生,请检查\n",
"扎西邓珠 姓名扎西邓珠有3个学生,请检查\n",
"拉热 更新成功\n",
"拥吉拉姆 更新成功\n",
"措姆 更新成功\n",
"斯朗让步 姓名斯朗让步有0个学生,请检查\n",
"斯郎泽仁 更新成功\n",
"方思淇 更新成功\n",
"昂翁落珠 更新成功\n",
"普布 更新成功\n",
"普灯 更新成功\n",
"曲云登降措 更新成功\n",
"曲巴降措 更新成功\n",
"曲机卓玛 更新成功\n",
"曲登志玛 更新成功\n",
"更扎 更新成功\n",
"曹正怡甫 姓名曹正怡甫有0个学生,请检查\n",
"曹海龙 更新成功\n",
"曹芮瑞 更新成功\n",
"曹青川 更新成功\n",
"曾佳佳 更新成功\n",
"曾昊然 更新成功\n",
"曾英杰 更新成功\n",
"朱俊 更新成功\n",
"朱杨成程 更新成功\n",
"朱绿红 更新成功\n",
"李东生 更新成功\n",
"李作浩 更新成功\n",
"李俊希 更新成功\n",
"李偌熙 已上传照片\n",
"李子浩 更新成功\n",
"李想 更新成功\n",
"李杨杨 更新成功\n",
"李杰 更新成功\n",
"李梦雪 更新成功\n",
"李洋 更新成功\n",
"李艾灵 更新成功\n",
"李茹茜 更新成功\n",
"李雨萱 更新成功\n",
"李雯静 更新成功\n",
"杜芸熙 更新成功\n",
"杨健鑫 更新成功\n",
"杨博为 更新成功\n",
"杨帆 姓名杨帆有2个学生,请检查\n",
"杨慧怡 更新成功\n",
"杨明高 更新成功\n",
"杨淞琳 更新成功\n",
"杨美玲 更新成功\n",
"杨钦城 更新成功\n",
"杨雪丽 更新成功\n",
"松安丁真 更新成功\n",
"林菲儿 更新成功\n",
"柔门 更新成功\n",
"根秋泽措 更新成功\n",
"格绒曲初 更新成功\n",
"梁湘怡 更新成功\n",
"梅宝文 更新成功\n",
"樊林钰 更新成功\n",
"次乃曲觉 更新成功\n",
"欧炤彬 更新成功\n",
"欧韦博 更新成功\n",
"段芸凯 更新成功\n",
"母林苹 更新成功\n",
"母玉洁 更新成功\n",
"毛滢 姓名毛滢有0个学生,请检查\n",
"毛雨荨 姓名毛雨荨有0个学生,请检查\n",
"江若溪 更新成功\n",
"汪彦丞 更新成功\n",
"汪秦川 更新成功\n",
"沈俊 更新成功\n",
"泽仁拥忠 姓名泽仁拥忠有2个学生,请检查\n",
"泽仁拥珍 更新成功\n",
"泽仁林波 更新成功\n",
"泽仁桑珠 更新成功\n",
"泽仁正呷 更新成功\n",
"泽仁邓珠 更新成功\n",
"泽绒拥桌 姓名泽绒拥桌有0个学生,请检查\n",
"泽翁拉姆 更新成功\n",
"洛绒刀登 姓名洛绒刀登有2个学生,请检查\n",
"洛绒央宗 更新成功\n",
"洛绒曲西 更新成功\n",
"洛绒银登 更新成功\n",
"洛让普错 更新成功\n",
"淳思琴 更新成功\n",
"熊建 更新成功\n",
"熊鑫豪 更新成功\n",
"牛泽浩 更新成功\n",
"王子轩 姓名王子轩有4个学生,请检查\n",
"王宇希杨 更新成功\n",
"王忠翔 更新成功\n",
"王思函 更新成功\n",
"王思涵 更新成功\n",
"王怡之 更新成功\n",
"王成鹏 更新成功\n",
"王星怡 更新成功\n",
"王浩 更新成功\n",
"王羌宇 更新成功\n",
"王羽 更新成功\n",
"王艺 姓名王艺有2个学生,请检查\n",
"王艺小 姓名王艺小有0个学生,请检查\n",
"王营凯 更新成功\n",
"王薛文 更新成功\n",
"王诗语 更新成功\n",
"王辛如 更新成功\n",
"王陈俊祎 更新成功\n",
"王雪瑞 更新成功\n",
"王震太 更新成功\n",
"王静煊 更新成功\n",
"珍珠拉姆 更新成功\n",
"班志 更新成功\n",
"生呷 更新成功\n",
"田文涛 更新成功\n",
"田玉峰 更新成功\n",
"登真翁姆 更新成功\n",
"登镇降措 姓名登镇降措有0个学生,请检查\n",
"白浩洋 更新成功\n",
"白玛泽真 姓名白玛泽真有0个学生,请检查\n",
"白马恩珠 姓名白马恩珠有0个学生,请检查\n",
"石雨鑫 更新成功\n",
"秀雯 更新成功\n",
"罗得 姓名罗得有0个学生,请检查\n",
"罗湘缘 更新成功\n",
"罗琛 更新成功\n",
"罗绒多吉 更新成功\n",
"肖宇欣 更新成功\n",
"胡仟军 更新成功\n",
"蒋刘杨吉 更新成功\n",
"蒋苏豪 更新成功\n",
"薛佳佳 更新成功\n",
"许博文 更新成功\n",
"谢佳心 更新成功\n",
"谢晓丽 更新成功\n",
"谢耀辉 更新成功\n",
"谭明涛 更新成功\n",
"贾馥嫣 更新成功\n",
"赵亚军豪 更新成功\n",
"赵元兵 更新成功\n",
"赵星宇 更新成功\n",
"赵欢 更新成功\n",
"赵瑛杰 更新成功\n",
"赵禹婷 更新成功\n",
"达瓦泽仁 更新成功\n",
"邓丽君 更新成功\n",
"邓婉麟 更新成功\n",
"邓曹华 更新成功\n",
"邓汶汶 更新成功\n",
"邓玉 更新成功\n",
"邓蔡清 更新成功\n",
"邱明辉 更新成功\n",
"邱骏熙 更新成功\n",
"邹志栋 更新成功\n",
"邹晞 更新成功\n",
"邹铭洋 姓名邹铭洋有0个学生,请检查\n",
"郑丁山 更新成功\n",
"郑霜侨 更新成功\n",
"钟渝萍 更新成功\n",
"错日娜 姓名错日娜有0个学生,请检查\n",
"阳志 更新成功\n",
"阿布 更新成功\n",
"陈峰 更新成功\n",
"陈新幻 更新成功\n",
"陈新摇 更新成功\n",
"陈爽 更新成功\n",
"陈琳 更新成功\n",
"陈雪梅 更新成功\n",
"陈静 更新成功\n",
"降批所郎 更新成功\n",
"降拥巴姆 姓名降拥巴姆有2个学生,请检查\n",
"陶茂宇 更新成功\n",
"青美泽仁 更新成功\n",
"青麦翁姆 更新成功\n",
"韩思月 更新成功\n",
"韩艺菱 更新成功\n",
"马博俊 更新成功\n",
"高唐德胜 更新成功\n",
"高让桑章 更新成功\n",
"魏佳莉 更新成功\n",
"鲁绒珍珠 姓名鲁绒珍珠有0个学生,请检查\n",
"黄俊豪 更新成功\n",
"黄友诚 更新成功\n",
"黄定瑞 更新成功\n",
"黄若翔 更新成功\n",
"龙凤辛迪 更新成功\n"
]
}
],
"source": [
"for root, dirs, files in os.walk(\"./students/\"):\n",
" for index,file in enumerate(files):\n",
" file_path = os.path.join(root, file)\n",
" stuName = Path(file_path).stem\n",
" print(stuName ,end=\" \")\n",
" stuInfo = getStudentInfo(stuName)\n",
" if isinstance(stuInfo, str):\n",
" print(stuInfo)\n",
" count += 1\n",
" continue\n",
" if stuInfo[\"files\"] and 'http' in stuInfo[\"files\"]:\n",
" print(f\"已上传照片\")\n",
" continue\n",
" if count > index:\n",
" print(f\"已上传张照片\")\n",
" continue\n",
" res = uploadFace(file_path)\n",
" if isinstance(res, str):\n",
" print(f\"上传图片失败{res}\")\n",
" count += 1\n",
" fail_student.append(stuInfo)\n",
" continue\n",
" updateFaceInfo(stuInfo, [{\"url\":res['msg'],\"name\":file}])\n",
" count+=1"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6f4fcfcf",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
+277
View File
@@ -0,0 +1,277 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
上传人脸照片修复版 - 解决文件太大问题
自动压缩超过3MB的照片后再上传
"""
from requests import get, post
import os
from PIL import Image
import io
def compress_image_for_upload(image_path, max_size_mb=3):
"""
压缩图片用于上传
Args:
image_path: 图片路径
max_size_mb: 最大文件大小(MB)
Returns:
bytes: 压缩后的图片数据,如果失败返回None
"""
try:
# 检查文件大小
original_size = os.path.getsize(image_path)
original_size_mb = original_size / (1024 * 1024)
print(f"原始文件大小: {original_size_mb:.2f}MB")
# 如果文件已经小于目标大小,直接读取返回
if original_size_mb <= max_size_mb:
with open(image_path, 'rb') as f:
return f.read()
# 打开图片进行压缩
with Image.open(image_path) as img:
# 转换为RGB模式
if img.mode != 'RGB':
img = img.convert('RGB')
width, height = img.size
print(f"原始尺寸: {width}x{height}")
# 如果图片很大,先调整尺寸
if max(width, height) > 2000:
scale = 2000 / max(width, height)
new_width = int(width * scale)
new_height = int(height * scale)
img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
print(f"调整尺寸至: {new_width}x{new_height}")
# 尝试不同质量等级进行压缩
for quality in [85, 75, 65, 55, 45, 35, 25]:
output_buffer = io.BytesIO()
img.save(output_buffer, format='JPEG', quality=quality, optimize=True)
compressed_data = output_buffer.getvalue()
compressed_size_mb = len(compressed_data) / (1024 * 1024)
print(f"质量{quality}%: {compressed_size_mb:.2f}MB")
if compressed_size_mb <= max_size_mb:
compression_ratio = (original_size - len(compressed_data)) / original_size * 100
print(f"✓ 压缩成功!压缩率: {compression_ratio:.1f}%")
return compressed_data
output_buffer.close()
print("✗ 无法压缩到目标大小")
return None
except Exception as e:
print(f"压缩失败: {str(e)}")
return None
def upload_face_photo(file_path, server_url="http://10.143.25.3:8090", max_size_mb=3):
"""
上传单张人脸照片(带压缩)
Args:
file_path: 照片文件路径
server_url: 服务器地址
max_size_mb: 最大文件大小(MB)
Returns:
bool: 上传是否成功
str: 结果信息
"""
try:
filename = os.path.basename(file_path)
print(f"\n处理照片: {filename}")
# 检查文件是否存在
if not os.path.exists(file_path):
return False, f"文件不存在: {file_path}"
# 检查文件格式
if not file_path.lower().endswith(('.jpg', '.jpeg', '.png')):
return False, f"不支持的文件格式: {file_path}"
# 压缩图片
print("正在压缩图片...")
compressed_data = compress_image_for_upload(file_path, max_size_mb)
if compressed_data is None:
return False, "图片压缩失败"
# 准备上传数据
files = {
"file": (filename, compressed_data, "image/jpeg"),
}
# 获取认证token
print("正在获取认证token...")
param = {
"username": "tangchao",
"password": "123456a",
"client_id": "client",
"grant_type": "password",
"client_secret": "123456",
}
try:
token_response = get(url=f"{server_url}/oauth/token", params=param, timeout=10)
token_data = token_response.json()
token = token_data["access_token"]
except Exception as e:
return False, f"获取token失败: {e}"
# 设置请求头
headers = {
"authorization": f"Bearer {token}",
}
# 上传文件
print("正在上传文件...")
try:
response = post(
url=f"{server_url}/school/stuface/upload",
headers=headers,
files=files,
timeout=60 # 60秒超时
)
if response.status_code == 200:
result = response.json()
if result.get('success'):
return True, f"上传成功: {filename}"
else:
error_msg = result.get('msg', '未知错误')
return False, f"上传失败: {error_msg}"
else:
return False, f"HTTP错误: {response.status_code}"
except Exception as e:
return False, f"上传请求失败: {e}"
except Exception as e:
return False, f"处理过程出错: {e}"
def batch_upload_faces(students_dir="./students/", max_size_mb=3):
"""
批量上传学生人脸照片
Args:
students_dir: 学生照片目录路径
max_size_mb: 最大文件大小(MB)
"""
if not os.path.exists(students_dir):
print(f"目录不存在: {students_dir}")
return
print("开始批量上传学生人脸照片...")
print("=" * 50)
success_count = 0
failed_count = 0
failed_files = []
# 支持的图片格式
valid_extensions = {'.jpg', '.jpeg', '.png'}
# 获取所有图片文件
image_files = []
for root, dirs, files in os.walk(students_dir):
for file in files:
file_ext = os.path.splitext(file)[1].lower()
if file_ext in valid_extensions:
image_files.append(os.path.join(root, file))
print(f"找到 {len(image_files)} 张照片")
print("-" * 50)
# 处理每张照片
for i, file_path in enumerate(image_files, 1):
print(f"\n[{i}/{len(image_files)}] 处理: {os.path.basename(file_path)}")
success, message = upload_face_photo(file_path, max_size_mb=max_size_mb)
if success:
success_count += 1
print(f"{message}")
else:
failed_count += 1
failed_files.append(os.path.basename(file_path))
print(f"{message}")
# 短暂延迟,避免服务器压力过大
import time
time.sleep(0.5)
# 打印统计结果
print("\n" + "=" * 50)
print("上传完成!")
print(f"成功: {success_count}")
print(f"失败: {failed_count}")
print(f"总计: {len(image_files)}")
if failed_files:
print(f"\n失败的文件:")
for failed_file in failed_files:
print(f" - {failed_file}")
def main():
"""
主函数
"""
import sys
print("上传人脸照片修复版")
print("=" * 30)
print("自动压缩超过3MB的照片后再上传")
print()
if len(sys.argv) > 1:
# 命令行模式
path = sys.argv[1]
if os.path.exists(path):
if os.path.isfile(path):
# 上传单张照片
success, message = upload_face_photo(path)
print(message)
elif os.path.isdir(path):
# 批量上传
batch_upload_faces(path)
else:
print(f"路径不存在: {path}")
else:
# 交互模式
print("选择操作:")
print("1. 批量上传学生照片目录")
print("2. 上传单张照片")
print("3. 自定义目录上传")
choice = input("\n请输入选择(1-3): ").strip()
if choice == "1":
batch_upload_faces()
elif choice == "2":
file_path = input("请输入照片文件路径: ").strip()
if os.path.exists(file_path):
success, message = upload_face_photo(file_path)
print(message)
else:
print(f"文件不存在: {file_path}")
elif choice == "3":
dir_path = input("请输入照片目录路径: ").strip()
if os.path.exists(dir_path):
batch_upload_faces(dir_path)
else:
print(f"目录不存在: {dir_path}")
else:
print("无效选择")
if __name__ == "__main__":
main()
+234
View File
@@ -0,0 +1,234 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
JPG照片压缩脚本
自动压缩超过3MB的JPG格式照片到小于3MB
"""
import os
from PIL import Image
import argparse
from pathlib import Path
def compress_jpg_to_size(file_path, max_size_mb=1, quality=85, step=5):
"""
压缩JPG图片到指定大小以下
Args:
file_path: 图片文件路径
max_size_mb: 最大文件大小(MB)
quality: 初始压缩质量(1-95)
step: 每次降低质量的步长
Returns:
bool: 是否成功压缩
str: 结果信息
"""
try:
# 获取文件大小
original_size = os.path.getsize(file_path)
original_size_mb = original_size / (1024 * 1024)
print(f"原始文件: {os.path.basename(file_path)}")
print(f"原始大小: {original_size_mb:.2f}MB")
# 如果文件已经小于目标大小,直接返回
if original_size_mb <= max_size_mb:
return True, f"文件已小于{max_size_mb}MB,无需压缩"
# 打开图片
with Image.open(file_path) as img:
# 确保是RGB模式
if img.mode != 'RGB':
img = img.convert('RGB')
# 获取图片尺寸
width, height = img.size
print(f"图片尺寸: {width}x{height}")
# 如果图片尺寸很大,先调整尺寸
max_dimension = 4000 # 最大边长限制
if width > max_dimension or height > max_dimension:
if width > height:
new_width = max_dimension
new_height = int(height * max_dimension / width)
else:
new_height = max_dimension
new_width = int(width * max_dimension / height)
img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
print(f"调整尺寸至: {new_width}x{new_height}")
# 尝试不同质量等级进行压缩
current_quality = quality
while current_quality >= 20: # 最低质量限制
# 保存为临时文件来检查大小
temp_output = f"{file_path}.temp.jpg"
img.save(temp_output, format='JPEG', quality=current_quality, optimize=True)
# 检查压缩后的大小
compressed_size = os.path.getsize(temp_output)
compressed_size_mb = compressed_size / (1024 * 1024)
print(f"尝试质量{current_quality}%: {compressed_size_mb:.2f}MB")
if compressed_size_mb <= max_size_mb:
# 压缩成功,替换原文件
os.replace(temp_output, file_path)
compression_ratio = (original_size - compressed_size) / original_size * 100
return True, f"压缩成功!质量:{current_quality}%, 大小:{compressed_size_mb:.2f}MB, 压缩率:{compression_ratio:.1f}%"
else:
# 删除临时文件,继续尝试更低质量
os.remove(temp_output)
current_quality -= step
# 如果还是太大,尝试进一步调整尺寸
print("质量压缩不足,尝试调整尺寸...")
# 逐步减小尺寸
scale_factor = 0.9
current_quality = quality # 重置质量
while scale_factor >= 0.5: # 最小尺寸限制
new_width = int(width * scale_factor)
new_height = int(height * scale_factor)
resized_img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
temp_output = f"{file_path}.temp.jpg"
resized_img.save(temp_output, format='JPEG', quality=current_quality, optimize=True)
compressed_size = os.path.getsize(temp_output)
compressed_size_mb = compressed_size / (1024 * 1024)
print(f"尝试尺寸{new_width}x{new_height} + 质量{current_quality}%: {compressed_size_mb:.2f}MB")
if compressed_size_mb <= max_size_mb:
os.replace(temp_output, file_path)
compression_ratio = (original_size - compressed_size) / original_size * 100
return True, f"压缩成功!尺寸:{new_width}x{new_height}, 质量:{current_quality}%, 大小:{compressed_size_mb:.2f}MB, 压缩率:{compression_ratio:.1f}%"
else:
os.remove(temp_output)
scale_factor -= 0.1
return False, "无法压缩到目标大小,图片可能过于复杂"
except Exception as e:
return False, f"压缩失败: {str(e)}"
def compress_single_file(file_path, max_size_mb=1):
"""
压缩单个文件
"""
# 检查文件是否存在
if not os.path.exists(file_path):
print(f"文件不存在: {file_path}")
return False
# 检查文件扩展名
if not file_path.lower().endswith(('.jpg', '.jpeg')):
print(f"不是JPG格式文件: {file_path}")
return False
success, message = compress_jpg_to_size(file_path, max_size_mb)
print(message)
return success
def compress_directory(directory_path, max_size_mb=1, recursive=True):
"""
压缩目录中的所有JPG文件
"""
if not os.path.exists(directory_path):
print(f"目录不存在: {directory_path}")
return
success_count = 0
failed_count = 0
skipped_count = 0
# 获取所有JPG文件
jpg_files = []
if recursive:
for root, dirs, files in os.walk(directory_path):
for file in files:
if file.lower().endswith(('.jpg', '.jpeg')):
jpg_files.append(os.path.join(root, file))
else:
for file in os.listdir(directory_path):
if file.lower().endswith(('.jpg', '.jpeg')):
full_path = os.path.join(directory_path, file)
if os.path.isfile(full_path):
jpg_files.append(full_path)
print(f"找到 {len(jpg_files)} 个JPG文件")
print("-" * 50)
# 处理每个文件
for i, file_path in enumerate(jpg_files, 1):
print(f"\\n[{i}/{len(jpg_files)}] 处理: {os.path.basename(file_path)}")
# 检查文件大小
file_size_mb = os.path.getsize(file_path) / (1024 * 1024)
if file_size_mb <= max_size_mb:
print(f"文件已小于{max_size_mb}MB,跳过")
skipped_count += 1
continue
success, message = compress_jpg_to_size(file_path, max_size_mb)
if success:
success_count += 1
else:
failed_count += 1
print(f"失败: {message}")
# 打印统计结果
print("\\n" + "=" * 50)
print(f"处理完成!")
print(f"成功: {success_count}")
print(f"失败: {failed_count}")
print(f"跳过: {skipped_count}")
print(f"总计: {len(jpg_files)}")
def main():
"""
主函数
"""
parser = argparse.ArgumentParser(description='JPG照片压缩工具')
parser.add_argument('path', help='文件或目录路径')
parser.add_argument('-s', '--size', type=float, default=3, help='目标文件大小(MB),默认3MB')
parser.add_argument('-r', '--recursive', action='store_true', help='递归处理子目录')
parser.add_argument('-q', '--quality', type=int, default=60, help='初始压缩质量(1-95),默认85')
args = parser.parse_args()
if os.path.isfile(args.path):
compress_single_file(args.path, args.size)
elif os.path.isdir(args.path):
compress_directory(args.path, args.size, args.recursive)
else:
print(f"路径不存在: {args.path}")
if __name__ == "__main__":
# 如果没有命令行参数,使用交互模式
if len(os.sys.argv) == 1:
print("JPG照片压缩工具")
print("=" * 30)
path = input("请输入文件或目录路径: ").strip()
if not path:
print("未输入路径,退出程序")
exit()
if os.path.isfile(path):
compress_single_file(path)
elif os.path.isdir(path):
recursive = input("是否递归处理子目录?(y/n): ").lower().strip() == 'y'
compress_directory(path, recursive=recursive)
else:
print(f"路径不存在: {path}")
else:
main()
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
压缩照片使用示例
"""
import os
from 压缩照片 import compress_single_file, compress_directory
def demo_compress_single():
"""演示单个文件压缩"""
print("=== 单个文件压缩示例 ===")
# 示例:压缩单个文件
test_file = "./students/何杨.jpg" # 替换为你的文件路径
if os.path.exists(test_file):
print(f"压缩文件: {test_file}")
success = compress_single_file(test_file, max_size_mb=3)
if success:
print("✓ 压缩成功!")
else:
print("✗ 压缩失败!")
else:
print(f"测试文件不存在: {test_file}")
print("请修改 test_file 路径为你的实际文件路径")
def demo_compress_directory():
"""演示目录压缩"""
print("\n=== 目录批量压缩示例 ===")
# 示例:压缩整个目录
test_dir = "./students/" # 替换为你的目录路径
if os.path.exists(test_dir):
print(f"压缩目录: {test_dir}")
print("开始批量压缩...")
compress_directory(test_dir, max_size_mb=3, recursive=True)
else:
print(f"测试目录不存在: {test_dir}")
print("请修改 test_dir 路径为你的实际目录路径")
def demo_custom_compress():
"""演示自定义压缩参数"""
print("\n=== 自定义压缩参数示例 ===")
# 你可以自定义以下参数:
# max_size_mb: 目标文件大小(MB
# quality: 初始压缩质量(1-95
test_file = "./students/何杨.jpg" # 替换为你的文件路径
if os.path.exists(test_file):
print(f"自定义压缩: {test_file}")
print("目标大小: 2MB, 初始质量: 90%")
from 压缩照片 import compress_jpg_to_size
success, message = compress_jpg_to_size(
test_file,
max_size_mb=2, # 压缩到2MB以下
quality=90, # 初始质量90%
step=3 # 每次降低3%质量
)
print(message)
else:
print(f"测试文件不存在: {test_file}")
if __name__ == "__main__":
print("JPG照片压缩工具使用示例")
print("=" * 40)
# 运行示例
demo_compress_single()
demo_compress_directory()
demo_custom_compress()
print("\n" + "=" * 40)
print("使用说明:")
print("1. 直接运行 压缩照片.py 进入交互模式")
print("2. 命令行模式:")
print(" python 压缩照片.py 文件路径")
print(" python 压缩照片.py 目录路径 -r")
print(" python 压缩照片.py 目录路径 -s 2 -r") # 压缩到2MB,递归处理
print("\n参数说明:")
print("-s: 目标文件大小(MB),默认3MB")
print("-r: 递归处理子目录")
print("-q: 初始压缩质量(1-95),默认85")
File diff suppressed because it is too large Load Diff
+184
View File
@@ -0,0 +1,184 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
快速压缩脚本 - 专门解决上传照片文件太大问题
自动压缩超过3MB的JPG照片到小于3MB
"""
import os
from PIL import Image
def quick_compress_for_upload(file_path, max_size_mb=3):
"""
快速压缩图片,专门用于解决上传问题
Args:
file_path: 图片文件路径
max_size_mb: 最大文件大小(MB)
Returns:
bool: 是否成功压缩
"""
try:
# 检查文件大小
original_size = os.path.getsize(file_path)
original_size_mb = original_size / (1024 * 1024)
print(f"处理文件: {os.path.basename(file_path)}")
print(f"原始大小: {original_size_mb:.2f}MB")
# 如果文件已经小于目标大小,直接返回
if original_size_mb <= max_size_mb:
print(f"✓ 文件已小于{max_size_mb}MB,无需压缩")
return True
# 打开图片
with Image.open(file_path) as img:
# 转换为RGB模式
if img.mode != 'RGB':
img = img.convert('RGB')
width, height = img.size
# 如果图片尺寸很大,先调整尺寸
if max(width, height) > 2000:
scale = 2000 / max(width, height)
new_width = int(width * scale)
new_height = int(height * scale)
img = img.resize((new_width, new_height), Image.Resampling.LANCZOS)
print(f"调整尺寸至: {new_width}x{new_height}")
# 快速压缩算法
for quality in [85, 75, 65, 55, 45, 35, 25]:
temp_file = f"{file_path}.temp"
img.save(temp_file, format='JPEG', quality=quality, optimize=True)
compressed_size = os.path.getsize(temp_file)
compressed_size_mb = compressed_size / (1024 * 1024)
print(f"质量{quality}%: {compressed_size_mb:.2f}MB")
if compressed_size_mb <= max_size_mb:
# 成功压缩,替换原文件
os.replace(temp_file, file_path)
compression_ratio = (original_size - compressed_size) / original_size * 100
print(f"✓ 压缩成功!质量:{quality}%, 压缩率:{compression_ratio:.1f}%")
return True
else:
os.remove(temp_file)
print("✗ 无法压缩到目标大小")
return False
except Exception as e:
print(f"✗ 压缩失败: {str(e)}")
return False
def compress_student_photos():
"""
压缩学生照片目录中的所有照片
"""
students_dir = "./students/"
if not os.path.exists(students_dir):
print(f"目录不存在: {students_dir}")
return
print("开始压缩学生照片...")
print("=" * 40)
success_count = 0
failed_count = 0
skipped_count = 0
# 获取所有JPG文件
jpg_files = []
for root, dirs, files in os.walk(students_dir):
for file in files:
if file.lower().endswith(('.jpg', '.jpeg')):
jpg_files.append(os.path.join(root, file))
print(f"找到 {len(jpg_files)} 张照片")
print("-" * 40)
# 处理每张照片
for i, file_path in enumerate(jpg_files, 1):
print(f"\n[{i}/{len(jpg_files)}] {os.path.basename(file_path)}")
# 快速压缩
if quick_compress_for_upload(file_path, max_size_mb=3):
success_count += 1
else:
failed_count += 1
# 统计结果
print("\n" + "=" * 40)
print("压缩完成!")
print(f"成功: {success_count}")
print(f"失败: {failed_count}")
print(f"总计: {len(jpg_files)}")
def compress_single_photo(file_path):
"""
压缩单张照片
"""
if not os.path.exists(file_path):
print(f"文件不存在: {file_path}")
return
if not file_path.lower().endswith(('.jpg', '.jpeg')):
print(f"不是JPG格式文件: {file_path}")
return
print(f"压缩单张照片: {os.path.basename(file_path)}")
print("-" * 30)
quick_compress_for_upload(file_path, max_size_mb=3)
if __name__ == "__main__":
import sys
print("快速照片压缩工具")
print("=" * 30)
print("专门解决上传照片文件太大问题")
print()
if len(sys.argv) > 1:
# 命令行模式
file_path = sys.argv[1]
if os.path.exists(file_path):
if os.path.isfile(file_path):
compress_single_photo(file_path)
elif os.path.isdir(file_path):
# 如果是目录,切换到该目录并压缩
original_dir = os.getcwd()
os.chdir(file_path)
compress_student_photos()
os.chdir(original_dir)
else:
print(f"路径不存在: {file_path}")
else:
# 交互模式
print("选择操作:")
print("1. 压缩学生照片目录")
print("2. 压缩单张照片")
print("3. 自定义目录")
choice = input("\n请输入选择(1-3): ").strip()
if choice == "1":
compress_student_photos()
elif choice == "2":
file_path = input("请输入照片文件路径: ").strip()
compress_single_photo(file_path)
elif choice == "3":
dir_path = input("请输入目录路径: ").strip()
if os.path.exists(dir_path):
original_dir = os.getcwd()
os.chdir(dir_path)
compress_student_photos()
os.chdir(original_dir)
else:
print(f"目录不存在: {dir_path}")
else:
print("无效选择")
File diff suppressed because it is too large Load Diff
+497
View File
@@ -0,0 +1,497 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "cc8c5f25",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "5144b9ba",
"metadata": {},
"outputs": [],
"source": [
"df1 = pd.read_excel('./学生信息_v2筛选.xlsx')"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "425258f8",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>学号</th>\n",
" <th>姓名</th>\n",
" <th>性别</th>\n",
" <th>年级</th>\n",
" <th>班级</th>\n",
" <th>手机号</th>\n",
" <th>身份证件号</th>\n",
" <th>专业代码</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>202205270</td>\n",
" <td>王雪瑞</td>\n",
" <td>女</td>\n",
" <td>2023级</td>\n",
" <td>2322数字媒体</td>\n",
" <td>19881645679</td>\n",
" <td>510727200702202323</td>\n",
" <td>710204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>202220063</td>\n",
" <td>秋央娜姆</td>\n",
" <td>女</td>\n",
" <td>2023级</td>\n",
" <td>2328数字媒体2班</td>\n",
" <td>13558500183</td>\n",
" <td>513332200605030824</td>\n",
" <td>710204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>202301001</td>\n",
" <td>巴措</td>\n",
" <td>女</td>\n",
" <td>2023级</td>\n",
" <td>2301五年制电子</td>\n",
" <td>18383622297</td>\n",
" <td>513330200708083467</td>\n",
" <td>510101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>202301002</td>\n",
" <td>白玛曲扎</td>\n",
" <td>男</td>\n",
" <td>2023级</td>\n",
" <td>2301五年制电子</td>\n",
" <td>18227480605</td>\n",
" <td>513336200805020036</td>\n",
" <td>510101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>202301003</td>\n",
" <td>白玛曲珍</td>\n",
" <td>女</td>\n",
" <td>2023级</td>\n",
" <td>2301五年制电子</td>\n",
" <td>1552882598</td>\n",
" <td>513334200809080228</td>\n",
" <td>510101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2977</th>\n",
" <td>5107424271057</td>\n",
" <td>丁学锋</td>\n",
" <td>男</td>\n",
" <td>2024级</td>\n",
" <td>2424运动训练</td>\n",
" <td>18281971757</td>\n",
" <td>510726200902126015</td>\n",
" <td>770303</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2978</th>\n",
" <td>5113423260389</td>\n",
" <td>张雨祺</td>\n",
" <td>女</td>\n",
" <td>2023级</td>\n",
" <td>2328数字媒体2班</td>\n",
" <td>18208164054</td>\n",
" <td>51018220071117002X</td>\n",
" <td>710204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2979</th>\n",
" <td>5119824270112</td>\n",
" <td>王金山</td>\n",
" <td>男</td>\n",
" <td>2024级</td>\n",
" <td>2407电商升学</td>\n",
" <td>19160527010</td>\n",
" <td>510724200812220013</td>\n",
" <td>510101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2980</th>\n",
" <td>202308640</td>\n",
" <td>刘一</td>\n",
" <td>男</td>\n",
" <td>2023级</td>\n",
" <td>2311电商军事</td>\n",
" <td>18190656121</td>\n",
" <td>510726200809206010</td>\n",
" <td>510101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2981</th>\n",
" <td>202401540</td>\n",
" <td>董芷妍</td>\n",
" <td>女</td>\n",
" <td>2024级</td>\n",
" <td>2419数媒2班</td>\n",
" <td>17760930318</td>\n",
" <td>510726200904167021</td>\n",
" <td>710204</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2982 rows × 8 columns</p>\n",
"</div>"
],
"text/plain": [
" 学号 姓名 性别 年级 班级 手机号 \\\n",
"0 202205270 王雪瑞 女 2023级 2322数字媒体 19881645679 \n",
"1 202220063 秋央娜姆 女 2023级 2328数字媒体2班 13558500183 \n",
"2 202301001 巴措 女 2023级 2301五年制电子 18383622297 \n",
"3 202301002 白玛曲扎 男 2023级 2301五年制电子 18227480605 \n",
"4 202301003 白玛曲珍 女 2023级 2301五年制电子 1552882598 \n",
"... ... ... .. ... ... ... \n",
"2977 5107424271057 丁学锋 男 2024级 2424运动训练 18281971757 \n",
"2978 5113423260389 张雨祺 女 2023级 2328数字媒体2班 18208164054 \n",
"2979 5119824270112 王金山 男 2024级 2407电商升学 19160527010 \n",
"2980 202308640 刘一 男 2023级 2311电商军事 18190656121 \n",
"2981 202401540 董芷妍 女 2024级 2419数媒2班 17760930318 \n",
"\n",
" 身份证件号 专业代码 \n",
"0 510727200702202323 710204 \n",
"1 513332200605030824 710204 \n",
"2 513330200708083467 510101 \n",
"3 513336200805020036 510101 \n",
"4 513334200809080228 510101 \n",
"... ... ... \n",
"2977 510726200902126015 770303 \n",
"2978 51018220071117002X 710204 \n",
"2979 510724200812220013 510101 \n",
"2980 510726200809206010 510101 \n",
"2981 510726200904167021 710204 \n",
"\n",
"[2982 rows x 8 columns]"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df1"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "3e40ca7a",
"metadata": {},
"outputs": [],
"source": [
"tem = df1[\"姓名\"].value_counts().to_dict()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "eaeba7cc",
"metadata": {},
"outputs": [],
"source": [
"temp = []\n",
"for i,j in tem.items():\n",
" if j>1:\n",
" temp.append(i)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "db508acd",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['王子轩',\n",
" '洛绒丁真',\n",
" '王俊杰',\n",
" '李鑫',\n",
" '杨杰',\n",
" '扎西邓珠',\n",
" '王鑫',\n",
" '扎西多吉',\n",
" '刘杰',\n",
" '刘欣怡',\n",
" '唐诗雨',\n",
" '刘洋',\n",
" '尼玛拉姆',\n",
" '扎西措姆',\n",
" '洛绒扎西',\n",
" '王豪',\n",
" '唐诗语',\n",
" '陈思雨',\n",
" '唐欣怡',\n",
" '张勇',\n",
" '王宏宇',\n",
" '尼玛邓珠',\n",
" '四郎',\n",
" '扎西',\n",
" '李佳鑫',\n",
" '何晓琴',\n",
" '洛绒刀登',\n",
" '赵鑫',\n",
" '李昊燃',\n",
" '李欣怡',\n",
" '卓玛拉姆',\n",
" '李佳颖',\n",
" '扎西拉姆',\n",
" '刘玉婷',\n",
" '李长平',\n",
" '王强',\n",
" '王雨辰',\n",
" '扎西泽仁',\n",
" '扎西翁姆',\n",
" '王韬',\n",
" '洛绒次称',\n",
" '罗程',\n",
" '张馨悦',\n",
" '王嘉豪',\n",
" '王志豪',\n",
" '唐浩',\n",
" '刘诗语',\n",
" '张雨婷',\n",
" '李涛',\n",
" '王诗怡',\n",
" '陈鑫',\n",
" '肖雨萱',\n",
" '登真尼玛',\n",
" '李欣蕊',\n",
" '降拥巴姆',\n",
" '李柯贤',\n",
" '扎西次仁',\n",
" '杨博文',\n",
" '泽仁拉姆',\n",
" '王欣悦',\n",
" '泽仁拥忠',\n",
" '王雪如',\n",
" '洛绒达吉',\n",
" '降央邓珠',\n",
" '杨帆',\n",
" '四郎泽仁',\n",
" '王祥',\n",
" '王昊',\n",
" '扎西巴拥',\n",
" '张洪宇',\n",
" '白玛曲珍',\n",
" '王艺',\n",
" '张浩',\n",
" '巴措',\n",
" '洛绒达洼']"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"temp"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "04e4c021",
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "06c6454f",
"metadata": {},
"outputs": [],
"source": [
"temp2 = []#来自文件夹\n",
"for root, dirs, files in os.walk(\"./students/\"):\n",
" for file in files:\n",
" temp2.append(Path(file).stem)\n",
" # print(Path(file).stem)\n",
" # if Path(file).suffix in IMAGE_EXTENSIONS:\n",
" # file_path = Path(root) / file\n",
" # images.append(file_path)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "241165d0",
"metadata": {},
"outputs": [],
"source": [
"temp3 = []\n",
"for item in temp:\n",
" if item in temp2:\n",
" temp3.append(item)\n",
" # print(item)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "659f4fec",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"temp3"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "9e785320",
"metadata": {},
"outputs": [],
"source": [
"import shutil"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "a724658f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"发现重复文件: 何晓琴\n",
"发现重复文件: 刘杰\n",
"发现重复文件: 刘诗语\n",
"发现重复文件: 卓玛拉姆\n",
"发现重复文件: 唐浩\n",
"发现重复文件: 唐诗雨\n",
"发现重复文件: 四郎泽仁\n",
"发现重复文件: 巴措\n",
"发现重复文件: 张勇\n",
"发现重复文件: 张浩\n",
"发现重复文件: 张雨婷\n",
"发现重复文件: 扎西\n",
"发现重复文件: 扎西多吉\n",
"发现重复文件: 扎西巴拥\n",
"发现重复文件: 扎西次仁\n",
"发现重复文件: 扎西泽仁\n",
"发现重复文件: 扎西邓珠\n",
"发现重复文件: 李柯贤\n",
"发现重复文件: 李长平\n",
"发现重复文件: 杨帆\n",
"发现重复文件: 杨杰\n",
"发现重复文件: 泽仁拉姆\n",
"发现重复文件: 洛绒丁真\n",
"发现重复文件: 洛绒扎西\n",
"发现重复文件: 洛绒达吉\n",
"发现重复文件: 王嘉豪\n",
"发现重复文件: 王强\n",
"发现重复文件: 王志豪\n",
"发现重复文件: 王韬\n",
"发现重复文件: 登真尼玛\n",
"发现重复文件: 白玛曲珍\n",
"发现重复文件: 罗程\n",
"发现重复文件: 赵鑫\n",
"发现重复文件: 陈鑫\n",
"发现重复文件: 降央邓珠\n",
"发现重复文件: 降拥巴姆\n"
]
}
],
"source": [
"for root, dirs, files in os.walk(\"./students/\"):\n",
" for file in files:\n",
" name = Path(file).stem\n",
" if name in temp3:\n",
" print(\"发现重复文件:\", name)\n",
" shutil.move(os.path.join(root, file), os.path.join(\"./duplicates/\", file))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+649
View File
@@ -0,0 +1,649 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"id": "31ae8ce1",
"metadata": {},
"outputs": [],
"source": [
"from requests import get,post,put\n",
"import pandas as pd\n",
"import time\n",
"teamId = 106\n",
"# ip = \"http://192.168.0.244:8101\"\n",
"ip = \"http://10.143.25.3:8090\"\n",
"param = {\n",
" \"username\": \"tangchao\",\n",
" \"password\": \"123456a\",\n",
" \"client_id\": \"client\",\n",
" \"grant_type\": \"password\",\n",
" \"client_secret\": \"123456\",\n",
"}\n",
"data = get(url=f\"{ip}/oauth/token\",params=param).json()\n",
"token = data[\"access_token\"]\n",
"header = {\n",
" \"content-type\": \"application/json\",\n",
" \"authorization\": f\"Bearer {token}\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "1f16ce18",
"metadata": {},
"outputs": [],
"source": [
"#获取所有班级\n",
"grades=[322,327,326]\n",
"classnames =[]\n",
"for i in grades:\n",
" tem = get(f\"http://10.143.25.3:8090/uc/class/listClass?teamId=106&gradeId={i}\",headers=header).json()[\"data\"]\n",
" classnames.extend(tem)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "40617922",
"metadata": {},
"outputs": [],
"source": [
"#获取班级和年级对应关系\n",
"data = get(f\"{ip}/classAndRoom/listPage?teamId=106&page=1&pageSize=100&pageNumber=0\",headers=header).json()[\"data\"][\"records\"]"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "9a36e8cb",
"metadata": {},
"outputs": [],
"source": [
"rooms = {}\n",
"for item in data:\n",
" if item.get('classAndRooms',[]) :\n",
" rooms[item['classAndRooms'][0]['roomName']] = item['classIds']"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "992aee00",
"metadata": {},
"outputs": [],
"source": [
"# #获取班级下的学生\n",
"# for item in classnames[\"data\"]:\n",
"# stus = get(f\"http://10.143.25.3:8090/uc/student/pageInfo?teamId=106&gradeId={item['gradeId']}&classId={item['id']}&type=0&pageSize=3000&pageNumber=0&orderDirection=asc\",headers=header).json()['data']['content']\n",
"# class2stu[f'{item['id']}'] = [stu['id'] for stu in stus]"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "d2d1b2c6",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"with open(\"class2stu.json\",\"r\") as f:\n",
" class2stu = json.load(f)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "69e91964",
"metadata": {},
"outputs": [],
"source": [
"weeks = [\"周一\",\"周二\",\"周三\",\"周四\",\"周五\"]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "d71df9a0",
"metadata": {},
"outputs": [],
"source": [
"alldata = get(\"http://10.143.25.3:8090/culum/get/56\",headers=header).json()[\"data\"][\"classTableData\"]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "0333286a",
"metadata": {},
"outputs": [],
"source": [
"teacher2class=[f'24老师{i}' for i in range(1,27)]\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "29b6893d",
"metadata": {},
"outputs": [],
"source": [
"teacher2class = dict(zip(teacher2class,list(class2stu.keys())))"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "93d03775",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'id': 8662, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8663, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8664, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8665, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8666, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8667, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8668, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8669, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8670, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8671, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8672, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8673, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8674, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8675, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8676, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8677, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8678, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8679, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8680, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8681, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8682, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8683, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8684, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8685, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8686, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8687, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8688, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8689, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8690, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8691, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8692, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8693, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8694, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8695, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8696, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8697, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8698, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8699, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8700, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8701, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8702, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8703, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8704, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8705, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8706, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8707, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8708, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8709, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8710, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8711, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8712, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8713, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8714, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8715, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8716, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8717, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8718, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8719, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8720, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8721, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8722, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8723, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8724, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8725, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8726, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8727, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8728, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8729, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8730, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8731, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8732, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8733, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8734, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8735, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8736, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8737, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8738, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8739, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8740, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8741, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8742, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8743, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8744, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8745, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8746, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8747, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8748, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8749, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8750, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8751, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8752, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8753, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8754, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8755, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8756, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8757, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8758, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8759, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8760, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8761, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8762, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8763, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8764, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8765, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8766, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8767, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8768, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8769, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8770, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8771, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8772, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8773, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8774, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8775, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8776, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8777, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8778, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8779, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8780, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8781, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8782, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8783, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8784, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8785, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8786, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8787, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8788, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8789, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8790, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8791, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8792, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8793, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8794, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8795, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8796, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8797, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8798, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8799, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8800, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8801, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8802, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8803, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8804, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8805, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8806, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8807, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8808, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8809, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8810, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8811, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8812, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8813, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8814, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8815, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8816, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8817, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8818, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8819, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8820, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8821, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8822, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8823, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8824, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8825, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8826, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8827, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8828, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8829, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8830, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8831, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8832, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8833, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8834, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8835, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8836, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8837, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8838, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8839, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8840, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8841, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8842, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8843, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8844, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8845, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8846, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8847, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8848, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8849, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8850, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8851, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8852, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8853, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8854, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8855, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8856, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8857, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8858, 'ids': '884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8859, 'ids': '1327,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1670,1671,1672,1773,2978'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8860, 'ids': '1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n",
"{'id': 8861, 'ids': '1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1317,1318,1320,1321,1322,1323,1324,1326'}\n",
"{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}\n"
]
}
],
"source": [
"for kejie in alldata:\n",
" for week in weeks:\n",
" kes = kejie[week]\n",
" for ke in kes:\n",
" id = ke['id']\n",
" my_key = ke['teaName']\n",
" v= teacher2class.get(my_key,None)\n",
" if v:\n",
" my_stu = class2stu[str(rooms[ke['classRoom']])]\n",
" my_stu = [str(stu) for stu in my_stu]\n",
" ids = ','.join(my_stu)\n",
" res=post(f\"http://10.143.25.3:8090/culum/add/culum\",headers=header,json={\n",
" \"id\": id,\n",
" \"ids\": ids,\n",
" })\n",
" print({\n",
" \"id\": id,\n",
" \"ids\": ids,\n",
" })\n",
" print(res.text)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 69,
"id": "046f5ede",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Response [200]>"
]
},
"execution_count": 69,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"post(f\"http://10.143.25.3:8090/culum/add/culum\",headers=header,json={'id': 3728, 'ids': '1,101,131,142,163,164,165,166,167,191,222,232,234,243,247,250,252,256,257,259,457,463,464,466,468,469,472,473,509,522,525,532,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,800,801,802,870,875,1766'})\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "57b7445d",
"metadata": {},
"outputs": [],
"source": [
"for item in alldata:\n",
" for k in weeks:\n",
" print(item[k])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3e2a74cb",
"metadata": {},
"outputs": [],
"source": [
"data = get(\"http://10.143.25.3/prod-api/culum/get/culum?id=1538&gradeId=326&serial=3&week=%E5%91%A8%E4%B8%80&access_token=ebe5f44c-ce0f-4f28-871e-6e4c2421854b\").json()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4f05fc88",
"metadata": {},
"outputs": [],
"source": [
"for item in data[\"data\"][\"left\"]:\n",
" "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
File diff suppressed because it is too large Load Diff
+630
View File
@@ -0,0 +1,630 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "dd7947a8",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "b6ac03f8",
"metadata": {},
"outputs": [],
"source": [
"df = pd.read_excel(\"./在校生综合信息查询20251020.xls\")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "7339d4d0",
"metadata": {},
"outputs": [],
"source": [
"df =df.astype(str)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "baa3220b",
"metadata": {},
"outputs": [],
"source": [
"df1= pd.read_excel(\"./在校生综合信息查询.xlsx\")\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "baa0e866",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>身份证件号</th>\n",
" <th>姓名</th>\n",
" <th>性别</th>\n",
" <th>出生日期</th>\n",
" <th>民族</th>\n",
" <th>籍贯</th>\n",
" <th>户口性质</th>\n",
" <th>学生类别</th>\n",
" <th>入学年月</th>\n",
" <th>学校名称</th>\n",
" <th>...</th>\n",
" <th>电子信箱</th>\n",
" <th>英文姓名</th>\n",
" <th>姓名拼音</th>\n",
" <th>省</th>\n",
" <th>市</th>\n",
" <th>县</th>\n",
" <th>学习形式</th>\n",
" <th>专业简称</th>\n",
" <th>在校生状态</th>\n",
" <th>健康状况</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>510726200805055219</td>\n",
" <td>韩震</td>\n",
" <td>男</td>\n",
" <td>20080505</td>\n",
" <td>羌族</td>\n",
" <td>四川省绵阳市北川羌族自治县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202309</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>HanZhen</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>数字媒体技术应用(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>510704200802282127</td>\n",
" <td>胥倩文</td>\n",
" <td>女</td>\n",
" <td>20080228</td>\n",
" <td>汉族</td>\n",
" <td>四川省绵阳市游仙区</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202309</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>XuQingWen</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>数字媒体技术应用(2021</td>\n",
" <td>正常在校</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>513332200405011637</td>\n",
" <td>四郎</td>\n",
" <td>男</td>\n",
" <td>20040501</td>\n",
" <td>藏族</td>\n",
" <td>四川省甘孜藏族自治州石渠县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202309</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>SiLang</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>数字媒体技术应用(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>513327200706166519</td>\n",
" <td>东红丹巴达吉</td>\n",
" <td>男</td>\n",
" <td>20070616</td>\n",
" <td>藏族</td>\n",
" <td>四川省甘孜藏族自治州炉霍县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202309</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>DongHongDanBaDaJi</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>数字媒体技术应用(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>513333200805241614</td>\n",
" <td>尼谢交</td>\n",
" <td>男</td>\n",
" <td>20080524</td>\n",
" <td>藏族</td>\n",
" <td>四川省甘孜藏族自治州色达县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202309</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>NiXieJiao</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>数字媒体技术应用(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2977</th>\n",
" <td>510726201003181410</td>\n",
" <td>杨马浩</td>\n",
" <td>男</td>\n",
" <td>20100318</td>\n",
" <td>羌族</td>\n",
" <td>四川省绵阳市北川羌族自治县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202509</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>YangMaHao</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>智能设备运行与维护(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2978</th>\n",
" <td>510724201007141616</td>\n",
" <td>杨逸晨</td>\n",
" <td>男</td>\n",
" <td>20100714</td>\n",
" <td>汉族</td>\n",
" <td>四川省绵阳市安县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202509</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>YangYiChen</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>智能设备运行与维护(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2979</th>\n",
" <td>510724201005172056</td>\n",
" <td>张文博</td>\n",
" <td>男</td>\n",
" <td>20100517</td>\n",
" <td>汉族</td>\n",
" <td>四川省绵阳市安县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202509</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>ZhangWenBo</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>智能设备运行与维护(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2980</th>\n",
" <td>50022820100822337X</td>\n",
" <td>张玺毓</td>\n",
" <td>男</td>\n",
" <td>20100822</td>\n",
" <td>汉族</td>\n",
" <td>重庆市梁平县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202509</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>ZhangXiYu</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>智能设备运行与维护(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2981</th>\n",
" <td>510724201007140816</td>\n",
" <td>张宇鹏</td>\n",
" <td>男</td>\n",
" <td>20100714</td>\n",
" <td>羌族</td>\n",
" <td>四川省绵阳市安县</td>\n",
" <td>农业户口</td>\n",
" <td>职业高中学生</td>\n",
" <td>202509</td>\n",
" <td>北川羌族自治县“七一”职业中学</td>\n",
" <td>...</td>\n",
" <td>nan</td>\n",
" <td>nan</td>\n",
" <td>ZhangYuPeng</td>\n",
" <td>四川省</td>\n",
" <td>绵阳市</td>\n",
" <td>北川羌族自治县</td>\n",
" <td>全日制</td>\n",
" <td>智能设备运行与维护(2021</td>\n",
" <td>正常在校</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>2982 rows × 42 columns</p>\n",
"</div>"
],
"text/plain": [
" 身份证件号 姓名 性别 出生日期 民族 籍贯 户口性质 \\\n",
"0 510726200805055219 韩震 男 20080505 羌族 四川省绵阳市北川羌族自治县 农业户口 \n",
"1 510704200802282127 胥倩文 女 20080228 汉族 四川省绵阳市游仙区 农业户口 \n",
"2 513332200405011637 四郎 男 20040501 藏族 四川省甘孜藏族自治州石渠县 农业户口 \n",
"3 513327200706166519 东红丹巴达吉 男 20070616 藏族 四川省甘孜藏族自治州炉霍县 农业户口 \n",
"4 513333200805241614 尼谢交 男 20080524 藏族 四川省甘孜藏族自治州色达县 农业户口 \n",
"... ... ... .. ... .. ... ... \n",
"2977 510726201003181410 杨马浩 男 20100318 羌族 四川省绵阳市北川羌族自治县 农业户口 \n",
"2978 510724201007141616 杨逸晨 男 20100714 汉族 四川省绵阳市安县 农业户口 \n",
"2979 510724201005172056 张文博 男 20100517 汉族 四川省绵阳市安县 农业户口 \n",
"2980 50022820100822337X 张玺毓 男 20100822 汉族 重庆市梁平县 农业户口 \n",
"2981 510724201007140816 张宇鹏 男 20100714 羌族 四川省绵阳市安县 农业户口 \n",
"\n",
" 学生类别 入学年月 学校名称 ... 电子信箱 英文姓名 姓名拼音 省 \\\n",
"0 职业高中学生 202309 北川羌族自治县“七一”职业中学 ... nan nan HanZhen 四川省 \n",
"1 职业高中学生 202309 北川羌族自治县“七一”职业中学 ... nan nan XuQingWen 四川省 \n",
"2 职业高中学生 202309 北川羌族自治县“七一”职业中学 ... nan nan SiLang 四川省 \n",
"3 职业高中学生 202309 北川羌族自治县“七一”职业中学 ... nan nan DongHongDanBaDaJi 四川省 \n",
"4 职业高中学生 202309 北川羌族自治县“七一”职业中学 ... nan nan NiXieJiao 四川省 \n",
"... ... ... ... ... ... ... ... ... \n",
"2977 职业高中学生 202509 北川羌族自治县“七一”职业中学 ... nan nan YangMaHao 四川省 \n",
"2978 职业高中学生 202509 北川羌族自治县“七一”职业中学 ... nan nan YangYiChen 四川省 \n",
"2979 职业高中学生 202509 北川羌族自治县“七一”职业中学 ... nan nan ZhangWenBo 四川省 \n",
"2980 职业高中学生 202509 北川羌族自治县“七一”职业中学 ... nan nan ZhangXiYu 四川省 \n",
"2981 职业高中学生 202509 北川羌族自治县“七一”职业中学 ... nan nan ZhangYuPeng 四川省 \n",
"\n",
" 市 县 学习形式 专业简称 在校生状态 健康状况 \n",
"0 绵阳市 北川羌族自治县 全日制 数字媒体技术应用(2021) 正常在校 1 \n",
"1 绵阳市 北川羌族自治县 全日制 数字媒体技术应用(2021) 正常在校 2 \n",
"2 绵阳市 北川羌族自治县 全日制 数字媒体技术应用(2021) 正常在校 1 \n",
"3 绵阳市 北川羌族自治县 全日制 数字媒体技术应用(2021) 正常在校 1 \n",
"4 绵阳市 北川羌族自治县 全日制 数字媒体技术应用(2021) 正常在校 1 \n",
"... ... ... ... ... ... ... \n",
"2977 绵阳市 北川羌族自治县 全日制 智能设备运行与维护(2021) 正常在校 1 \n",
"2978 绵阳市 北川羌族自治县 全日制 智能设备运行与维护(2021) 正常在校 1 \n",
"2979 绵阳市 北川羌族自治县 全日制 智能设备运行与维护(2021) 正常在校 1 \n",
"2980 绵阳市 北川羌族自治县 全日制 智能设备运行与维护(2021) 正常在校 1 \n",
"2981 绵阳市 北川羌族自治县 全日制 智能设备运行与维护(2021) 正常在校 1 \n",
"\n",
"[2982 rows x 42 columns]"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "46443947",
"metadata": {},
"outputs": [],
"source": [
"names = '''嘎玛丁杰\n",
"孙振涛\n",
"张宏\n",
"曲扎\n",
"朱晴源\n",
"李学涛\n",
"李治李\n",
"杨涵熙\n",
"杨瑞昕\n",
"甘佳馨\n",
"罗雨霏\n",
"肖潇\n",
"苏胜步\n",
"蒲弘垣\n",
"贾惠青\n",
"邓城林\n",
"陈祝遥加\n",
"陈飞扬\n",
"韦浩添\n",
"黎席伟'''.split(\"\\n\")"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "54ebb990",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n",
"Series([], Name: 姓名, dtype: object)\n"
]
}
],
"source": [
"for item in names:\n",
" print(df.loc[df['姓名']==item,'姓名'])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "c039a73f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 510726200805055219\n",
"1 510704200802282127\n",
"2 513332200405011637\n",
"3 513327200706166519\n",
"4 513333200805241614\n",
" ... \n",
"2977 510726201003181410\n",
"2978 510724201007141616\n",
"2979 510724201005172056\n",
"2980 50022820100822337X\n",
"2981 510724201007140816\n",
"Name: 身份证件号, Length: 2982, dtype: object"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df['身份证件号']"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "9d88637a",
"metadata": {},
"outputs": [],
"source": [
"a =df1['身份证件号']\n",
"b = df['身份证件号']\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "d875c809",
"metadata": {},
"outputs": [],
"source": [
"a = df1['身份证件号'].astype(str).str.strip()\n",
"b = df['身份证件号'].astype(str).str.strip()\n",
"diff_values = b[~b.isin(a)].drop_duplicates()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "42939b6f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Series([], Name: 身份证件号, dtype: object)"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"diff_values"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "7f52438a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"set()"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"set(b)-set(a)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f32dec2e",
"metadata": {},
"outputs": [],
"source": [
"嘎玛丁杰\n",
"孙振涛\n",
"张宏\n",
"曲扎\n",
"朱晴源\n",
"李学涛\n",
"李治李\n",
"杨涵熙\n",
"杨瑞昕\n",
"甘佳馨\n",
"罗雨霏\n",
"肖潇\n",
"苏胜步\n",
"蒲弘垣\n",
"贾惠青\n",
"邓城林\n",
"陈祝遥加\n",
"陈飞扬\n",
"韦浩添\n",
"黎席伟"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}