This commit is contained in:
512song committed 2023-05-28 00:11:39 +08:00
1 parent 8242dc00aa
commit 7200d7334c
4 files changed
+1458 -258

No files matched your search

File diff suppressed because it is too large. Load diff
+21 -2
View File
@@ -712,12 +712,31 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 6,
"id": "69b5f5e5-04e4-4509-8518-b7fc54cd4e45", "id": "69b5f5e5-04e4-4509-8518-b7fc54cd4e45",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-26T13:50:58.194003Z",
"iopub.status.busy": "2023-05-26T13:50:58.193208Z",
"iopub.status.idle": "2023-05-26T13:50:58.371452Z",
"shell.execute_reply": "2023-05-26T13:50:58.370543Z",
"shell.execute_reply.started": "2023-05-26T13:50:58.193961Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:779人,男性:678人,女性:101人\n",
"256~332分人数:1009人,男性:786人,女性:223人\n",
"333~367分人数:316人,男性:189人,女性:127人\n",
"368~500分人数:129人,男性:57人,女性:72人\n",
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
+109 -29
View File
@@ -64,23 +64,23 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "96d5b4bd-4198-4725-9005-070ac4e4f324", "id": "31d36f3c-f046-40a9-bf90-ba139fdcce3a",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 每日成绩导入" "## 新增人员信息"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 7,
"id": "4b52477e-926a-44b5-b8a0-20bff98d101d", "id": "5cea2f5e-37fc-4857-8455-090a634a1c0a",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-05-15T10:43:30.775840Z", "iopub.execute_input": "2023-05-26T10:04:21.856051Z",
"iopub.status.busy": "2023-05-15T10:43:30.775025Z", "iopub.status.busy": "2023-05-26T10:04:21.855163Z",
"iopub.status.idle": "2023-05-15T10:43:30.794406Z", "iopub.status.idle": "2023-05-26T10:04:22.498099Z",
"shell.execute_reply": "2023-05-15T10:43:30.793511Z", "shell.execute_reply": "2023-05-26T10:04:22.497093Z",
"shell.execute_reply.started": "2023-05-15T10:43:30.775797Z" "shell.execute_reply.started": "2023-05-26T10:04:21.856007Z"
}, },
"tags": [] "tags": []
}, },
@@ -89,8 +89,75 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"6\n", "528\n",
"6\n" "ok\n",
"992\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/长炼医院新增监测花名册.xlsx')\n",
"sheet = wb.active\n",
"# sheets = wb.sheetnames\n",
"filename = 'data/长炼医院人员名单.json'\n",
"with open(filename,'r') as fl:\n",
" person = json.load(fl) \n",
"print(len(person))\n",
"for n in range(2, sheet.max_row+1):\n",
" if sheet.cell(n,1).value is not None:\n",
" code = int(sheet.cell(n, 4).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 6).value\n",
" if int(sheet.cell(n, 7).value) ==1:\n",
" sex = '男'\n",
" else:\n",
" sex = '女'\n",
" dict1['sex'] = sex\n",
" birth = str(sheet.cell(n, 8).value).split()[0]\n",
" dict1['birth'] = birth\n",
" dict1['unit'] = sheet.cell(n, 3).value\n",
" person[code] = dict1\n",
"filename = 'data/长炼医院人员名单.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(person, fl, ensure_ascii=False)\n",
"print('ok')\n",
"print(len(person))"
]
},
{
"cell_type": "markdown",
"id": "96d5b4bd-4198-4725-9005-070ac4e4f324",
"metadata": {},
"source": [
"## 每日成绩导入"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "4b52477e-926a-44b5-b8a0-20bff98d101d",
"metadata": {
"execution": {
"iopub.execute_input": "2023-05-26T10:04:49.499896Z",
"iopub.status.busy": "2023-05-26T10:04:49.499463Z",
"iopub.status.idle": "2023-05-26T10:04:49.522644Z",
"shell.execute_reply": "2023-05-26T10:04:49.521747Z",
"shell.execute_reply.started": "2023-05-26T10:04:49.499867Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"73\n",
"73\n"
] ]
} }
], ],
@@ -112,8 +179,8 @@
"filename = 'data/长炼医院人员名单.json'\n", "filename = 'data/长炼医院人员名单.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
"rq = '20230515'\n", "rq = '20230526'\n",
"filename = f'data/places_result_{rq}-clyy.csv'\n", "filename = f'data/places_result_{rq}.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n", "with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n", " fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n", " header = next(fl) \n",
@@ -143,15 +210,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 4,
"id": "033cc564-4aa9-4e88-b38b-ec62a02b1661", "id": "033cc564-4aa9-4e88-b38b-ec62a02b1661",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-05-15T10:43:39.337088Z", "iopub.execute_input": "2023-05-26T08:29:09.963390Z",
"iopub.status.busy": "2023-05-15T10:43:39.336252Z", "iopub.status.busy": "2023-05-26T08:29:09.962538Z",
"iopub.status.idle": "2023-05-15T10:43:39.361956Z", "iopub.status.idle": "2023-05-26T08:29:10.005878Z",
"shell.execute_reply": "2023-05-15T10:43:39.360904Z", "shell.execute_reply": "2023-05-26T08:29:10.004986Z",
"shell.execute_reply.started": "2023-05-15T10:43:39.337046Z" "shell.execute_reply.started": "2023-05-26T08:29:09.963348Z"
}, },
"tags": [] "tags": []
}, },
@@ -160,9 +227,22 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"6\n", "67\n",
"6\n", "133 杨诚 已测试!\n",
"18\n" "76 李克胜 已测试!\n",
"24 李璇 已测试!\n",
"45 乔志刚 已测试!\n",
"136 胡茂山 已测试!\n",
"182 刘立文 已测试!\n",
"163 乐文清 已测试!\n",
"160 李莉 已测试!\n",
"128 王聪 已测试!\n",
"161 王雅琴 已测试!\n",
"72 彭姝 已测试!\n",
"164 高维 已测试!\n",
"134 索怡心 已测试!\n",
"67\n",
"72\n"
] ]
} }
], ],
@@ -185,7 +265,7 @@
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
"#rq = '20230510'\n", "#rq = '20230510'\n",
"filename = f'data/places_result_{rq}-clyy.csv'\n", "filename = f'data/places_result_{rq}.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n", "with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n", " fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n", " header = next(fl) \n",
@@ -238,15 +318,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 9,
"id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a", "id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-05-15T10:43:56.982893Z", "iopub.execute_input": "2023-05-26T10:05:01.804203Z",
"iopub.status.busy": "2023-05-15T10:43:56.982045Z", "iopub.status.busy": "2023-05-26T10:05:01.803362Z",
"iopub.status.idle": "2023-05-15T10:43:57.010597Z", "iopub.status.idle": "2023-05-26T10:05:01.863171Z",
"shell.execute_reply": "2023-05-15T10:43:57.009606Z", "shell.execute_reply": "2023-05-26T10:05:01.862349Z",
"shell.execute_reply.started": "2023-05-15T10:43:56.982852Z" "shell.execute_reply.started": "2023-05-26T10:05:01.804161Z"
}, },
"tags": [] "tags": []
}, },
+8 -8
View File
@@ -364,14 +364,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 9,
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-05-25T04:57:08.561094Z", "iopub.execute_input": "2023-05-26T09:39:22.980282Z",
"iopub.status.busy": "2023-05-25T04:57:08.560220Z", "iopub.status.busy": "2023-05-26T09:39:22.979405Z",
"iopub.status.idle": "2023-05-25T04:57:08.638199Z", "iopub.status.idle": "2023-05-26T09:39:23.099441Z",
"shell.execute_reply": "2023-05-25T04:57:08.637153Z", "shell.execute_reply": "2023-05-26T09:39:23.098684Z",
"shell.execute_reply.started": "2023-05-25T04:57:08.561054Z" "shell.execute_reply.started": "2023-05-26T09:39:22.980241Z"
}, },
"tags": [] "tags": []
}, },
@@ -388,12 +388,12 @@
"import yaml\n", "import yaml\n",
"import json\n", "import json\n",
"\n", "\n",
"filename = 'data/全维健康职工心理测评量表.yml'\n", "filename = 'data/西藏石油中医、心理测评量表.yaml'\n",
"with open(filename, 'r', encoding='utf-8') as f:\n", "with open(filename, 'r', encoding='utf-8') as f:\n",
" result = yaml.load(f.read(), Loader=yaml.FullLoader)\n", " result = yaml.load(f.read(), Loader=yaml.FullLoader)\n",
"i = 1\n", "i = 1\n",
"#print(result)\n", "#print(result)\n",
"filename = 'data/全维健康职工心理测评量表.json'\n", "filename = 'data/西藏石油中医、心理测评量表.json'\n",
"with open(filename, 'w') as fl:\n", "with open(filename, 'w') as fl:\n",
" json.dump(result, fl, ensure_ascii=False)\n", " json.dump(result, fl, ensure_ascii=False)\n",
"print('ok')" "print('ok')"