20231111
This commit is contained in:
1 parent
bb45950ba6
commit
bec78cd290
4 files changed
+394
-193
No files matched your search
+65
-120
@@ -10,27 +10,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": null,
|
||||||
"id": "abde40cd-d8e3-434d-ade2-207cf80cab49",
|
"id": "abde40cd-d8e3-434d-ade2-207cf80cab49",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T05:16:54.569572Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T05:16:54.568768Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T05:16:54.594762Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T05:16:54.592567Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T05:16:54.569497Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"ok\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -56,6 +41,57 @@
|
|||||||
"print('ok')"
|
"print('ok')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 4,
|
||||||
|
"id": "1a261b8f-6fa8-41d6-8449-9987ca55133f",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2023-11-10T02:31:09.764304Z",
|
||||||
|
"iopub.status.busy": "2023-11-10T02:31:09.763832Z",
|
||||||
|
"iopub.status.idle": "2023-11-10T02:31:09.786184Z",
|
||||||
|
"shell.execute_reply": "2023-11-10T02:31:09.785822Z",
|
||||||
|
"shell.execute_reply.started": "2023-11-10T02:31:09.764268Z"
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"ok\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",
|
||||||
|
"person = {}\n",
|
||||||
|
"\n",
|
||||||
|
"for n in range(1, sheet.max_row+1):\n",
|
||||||
|
" code = int(sheet.cell(n, 1).value)\n",
|
||||||
|
" person.setdefault(code, {})\n",
|
||||||
|
" dict1 = {}\n",
|
||||||
|
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||||
|
" dict1['unit'] = sheet.cell(n, 6).value\n",
|
||||||
|
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||||
|
" dict1['birth'] = str(sheet.cell(n,4).value).split(' ')[0]\n",
|
||||||
|
" if sheet.cell(n,5).value is not None:\n",
|
||||||
|
" dict1['phone'] = str(sheet.cell(n,5).value)\n",
|
||||||
|
" \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')"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "0dc90cf8-0a51-49ab-8f93-81acfd359e63",
|
"id": "0dc90cf8-0a51-49ab-8f93-81acfd359e63",
|
||||||
@@ -66,28 +102,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": null,
|
||||||
"id": "693820f4-f79d-4e6b-9901-0aae57bc6c92",
|
"id": "693820f4-f79d-4e6b-9901-0aae57bc6c92",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T05:21:49.693975Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T05:21:49.693687Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T05:21:49.714898Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T05:21:49.714209Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T05:21:49.693956Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"84\n",
|
|
||||||
"84\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"import datetime\n",
|
"import datetime\n",
|
||||||
@@ -178,27 +198,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 26,
|
"execution_count": null,
|
||||||
"id": "9230c78a-40d1-47ed-9bfc-94525b44f8f9",
|
"id": "9230c78a-40d1-47ed-9bfc-94525b44f8f9",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T06:50:35.251325Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T06:50:35.250643Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T06:50:35.319251Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T06:50:35.317670Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T06:50:35.251263Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"ok!\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import json\n",
|
"import json\n",
|
||||||
"import time\n",
|
"import time\n",
|
||||||
@@ -341,27 +346,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 27,
|
"execution_count": null,
|
||||||
"id": "c42bb7f4-ae16-4950-8fc9-97e7084e4615",
|
"id": "c42bb7f4-ae16-4950-8fc9-97e7084e4615",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T06:52:29.033946Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T06:52:29.033331Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T06:52:29.132179Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T06:52:29.130961Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T06:52:29.033886Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"ok\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -422,16 +412,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 13,
|
"execution_count": null,
|
||||||
"id": "6038af14-e3cf-4e79-9a02-a5d70cb2ed65",
|
"id": "6038af14-e3cf-4e79-9a02-a5d70cb2ed65",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T05:38:50.524545Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T05:38:50.523900Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T05:38:50.593781Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T05:38:50.592319Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T05:38:50.524484Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -469,16 +452,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 23,
|
"execution_count": null,
|
||||||
"id": "096672ef-c1f1-4b31-a490-efd408b95aec",
|
"id": "096672ef-c1f1-4b31-a490-efd408b95aec",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T06:17:34.577248Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T06:17:34.576465Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T06:17:34.622216Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T06:17:34.620032Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T06:17:34.577174Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -526,28 +502,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 38,
|
"execution_count": null,
|
||||||
"id": "8f801647-a326-4bf1-a651-4b52e0296998",
|
"id": "8f801647-a326-4bf1-a651-4b52e0296998",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T07:12:12.444411Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T07:12:12.443958Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T07:12:12.457264Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T07:12:12.455781Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T07:12:12.444370Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"['18610346996', '15689048244', '17865910365', '15966972231', '15953353009', '10002268211', '13906430187', '18553352007', '15092304241', '13953302959', '15966961587', '13964419753', '13563031324', '13869301368', '15964480260', '17616402467', '18253372927', '15169322152', '18653360448', '15954798900', '15953329509', '13561616627', '13581038337', '13287083771', '18553317009', '13287888080', '13953398130', '13665330312', '18353398071', '15854858198', '13280681081', '13583315663', '18653359308', '18053370113', '18953363875', '15153328391', '13853328246', '13606433819', '13389690177', '18560316978', '18560316897', '18653307232', '18853386200', '13953318999', '15376796462', '18253301688', '13853346368', '18560317186', '13969319707', '13792162471', '15589361996', '15315223331', '13869320577', '13792166751', '15065872512', '13969392534', '13573392557', '13589563291', '13573349783', '13953350485', '18678200603', '13589537205', '13589537205', '13853357150', '13969308397', '13706432240', '18560317061', '13964391029', '18953343833', '18905332691', '13054890607', '13082715936', '15053312268', '15963301381', '15550301285', '13306436916', '15553312972', '13280682857', '13070619391', '18678109571', '15965521907', '13280632498', '13964466366', '18853366997', '13789896882', '15589388169']\n",
|
|
||||||
"18610346996\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
@@ -583,27 +543,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 40,
|
"execution_count": null,
|
||||||
"id": "fbe793e4-04cf-4e7d-8fb8-1776ed474ab9",
|
"id": "fbe793e4-04cf-4e7d-8fb8-1776ed474ab9",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-10-27T07:25:48.897659Z",
|
|
||||||
"iopub.status.busy": "2023-10-27T07:25:48.897196Z",
|
|
||||||
"iopub.status.idle": "2023-10-27T07:25:49.038895Z",
|
|
||||||
"shell.execute_reply": "2023-10-27T07:25:49.038112Z",
|
|
||||||
"shell.execute_reply.started": "2023-10-27T07:25:48.897615Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [
|
"outputs": [],
|
||||||
{
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
"('ptv_0533_sjhy','13070619391','{\"Gender\":\"f\",\"Age\":\"O\",\"q1O\":4,\"q2O\":4,\"q3O\":2,\"q4O\":3,\"q5O\":1,\"q6O\":1,\"q7O\":1,\"q8O\":5,\"q9O\":2,\"q10O\":1,\"q11O\":1,\"q12O\":1,\"q13O\":4,\"q14O\":5,\"q15O\":5,\"q16O\":5,\"q17O\":5,\"q18O\":5,\"q19O\":4,\"q20O\":4,\"q21O\":5,\"q22O\":5,\"q23O\":5,\"q24O\":5,\"q25O\":2,\"q26O\":4,\"q27O\":2,\"q28O\":2,\"q29O\":4,\"q30O\":2,\"q1\":4,\"q3\":1,\"q4\":2,\"q5\":4,\"q6\":4,\"q8\":1,\"q10\":1,\"q13\":4,\"q14\":4,\"q15\":4,\"q16\":5,\"q17\":5,\"q18\":5,\"q19\":5,\"q20\":5,\"q22\":5,\"q23\":1,\"q25\":5,\"q26\":5,\"q27\":1,\"q28\":1,\"q29\":5,\"q30\":5,\"q31\":1,\"q32\":1,\"q33\":2,\"q34\":5,\"q35\":5,\"q36\":1,\"q37\":1,\"q38\":5,\"q39\":5,\"q40\":1,\"q41\":1,\"q42\":5,\"q43\":1,\"q44\":4,\"q45\":1,\"q46\":1,\"q47\":1,\"q48\":5,\"q49\":5,\"q50\":5,\"q51\":1,\"q52\":1,\"q53\":5,\"q54\":5,\"q55\":5,\"q56\":5,\"q57\":5,\"q58\":1,\"q59\":1,\"q60\":5,\"qv1\":1,\"qv2\":1,\"qv3\":1,\"qv4\":2,\"qv5\":1,\"qv6\":1,\"qv7\":2,\"qv8\":1,\"qv9\":2,\"qv10\":1,\"qv11\":1,\"qv12\":1,\"qv13\":2,\"qv14\":2,\"qv15\":1,\"qv16\":1,\"qv17\":1,\"qv18\":1,\"qv19\":1,\"qv20\":2,\"qv21\":1,\"qv22\":2,\"qv23\":2,\"qv24\":1,\"qv25\":1,\"qv26\":2}','2023-10-27 15:00:00'),('ptv_0533_sjhy','13280682857','{\"Gender\":\"f\",\"Age\":\"O\",\"q1O\":2,\"q2O\":2,\"q3O\":2,\"q4O\":1,\"q5O\":4,\"q6O\":4,\"q7O\":4,\"q8O\":4,\"q9O\":4,\"q10O\":1,\"q11O\":3,\"q12O\":5,\"q13O\":4,\"q14O\":4,\"q15O\":4,\"q16O\":5,\"q17O\":4,\"q18O\":4,\"q19O\":4,\"q20O\":3,\"q21O\":5,\"q22O\":5,\"q23O\":5,\"q24O\":5,\"q25O\":3,\"q26O\":4,\"q27O\":4,\"q28O\":4,\"q29O\":3,\"q30O\":4,\"q1\":4,\"q3\":1,\"q4\":3,\"q5\":3,\"q6\":4,\"q8\":2,\"q10\":1,\"q13\":3,\"q14\":1,\"q15\":2,\"q16\":4,\"q17\":3,\"q18\":4,\"q19\":1,\"q20\":1,\"q22\":2,\"q23\":2,\"q25\":1,\"q26\":1,\"q27\":1,\"q28\":3,\"q29\":1,\"q30\":1,\"q31\":3,\"q32\":1,\"q33\":1,\"q34\":1,\"q35\":4,\"q36\":3,\"q37\":1,\"q38\":2,\"q39\":5,\"q40\":1,\"q41\":1,\"q42\":1,\"q43\":1,\"q44\":3,\"q45\":1,\"q46\":1,\"q47\":1,\"q48\":1,\"q49\":2,\"q50\":1,\"q51\":1,\"q52\":1,\"q53\":1,\"q54\":2,\"q55\":1,\"q56\":1,\"q57\":1,\"q58\":1,\"q59\":1,\"q60\":1,\"qv1\":2,\"qv2\":2,\"qv3\":2,\"qv4\":1,\"qv5\":2,\"qv6\":2,\"qv7\":2,\"qv8\":2,\"qv9\":2,\"qv10\":2,\"qv11\":2,\"qv12\":2,\"qv13\":2,\"qv14\":2,\"qv15\":1,\"qv16\":1,\"qv17\":2,\"qv18\":1,\"qv19\":2,\"qv20\":2,\"qv21\":1,\"qv22\":2,\"qv23\":2,\"qv24\":2,\"qv25\":2,\"qv26\":2}','2023-10-27 15:00:00'),('ptv_0533_sjhy','13589537205','{\"Gender\":\"f\",\"Age\":\"O\",\"q1O\":3,\"q2O\":5,\"q3O\":2,\"q4O\":1,\"q5O\":5,\"q6O\":5,\"q7O\":5,\"q8O\":5,\"q9O\":5,\"q10O\":1,\"q11O\":4,\"q12O\":5,\"q13O\":5,\"q14O\":5,\"q15O\":5,\"q16O\":5,\"q17O\":5,\"q18O\":5,\"q19O\":5,\"q20O\":5,\"q21O\":5,\"q22O\":5,\"q23O\":5,\"q24O\":5,\"q25O\":4,\"q26O\":5,\"q27O\":4,\"q28O\":3,\"q29O\":5,\"q30O\":4,\"q1\":4,\"q3\":2,\"q4\":2,\"q5\":1,\"q6\":4,\"q8\":1,\"q10\":1,\"q13\":3,\"q14\":4,\"q15\":1,\"q16\":1,\"q17\":3,\"q18\":2,\"q19\":1,\"q20\":3,\"q22\":5,\"q23\":5,\"q25\":3,\"q26\":1,\"q27\":3,\"q28\":1,\"q29\":1,\"q30\":5,\"q31\":1,\"q32\":3,\"q33\":5,\"q34\":2,\"q35\":2,\"q36\":1,\"q37\":1,\"q38\":5,\"q39\":5,\"q40\":5,\"q41\":1,\"q42\":1,\"q43\":1,\"q44\":3,\"q45\":5,\"q46\":1,\"q47\":3,\"q48\":1,\"q49\":1,\"q50\":1,\"q51\":1,\"q52\":1,\"q53\":1,\"q54\":2,\"q55\":1,\"q56\":1,\"q57\":1,\"q58\":1,\"q59\":1,\"q60\":1,\"qv1\":1,\"qv2\":1,\"qv3\":2,\"qv4\":2,\"qv5\":2,\"qv6\":2,\"qv7\":1,\"qv8\":1,\"qv9\":2,\"qv10\":2,\"qv11\":2,\"qv12\":2,\"qv13\":2,\"qv14\":2,\"qv15\":2,\"qv16\":2,\"qv17\":2,\"qv18\":1,\"qv19\":1,\"qv20\":2,\"qv21\":1,\"qv22\":2,\"qv23\":2,\"qv24\":2,\"qv25\":2,\"qv26\":2}','2023-10-27 15:00:00'),('ptv_0533_sjhy','13573392557','{\"Gender\":\"f\",\"Age\":\"O\",\"q1O\":5,\"q2O\":5,\"q3O\":5,\"q4O\":5,\"q5O\":5,\"q6O\":5,\"q7O\":5,\"q8O\":2,\"q9O\":5,\"q10O\":1,\"q11O\":5,\"q12O\":5,\"q13O\":5,\"q14O\":5,\"q15O\":5,\"q16O\":5,\"q17O\":5,\"q18O\":5,\"q19O\":5,\"q20O\":5,\"q21O\":5,\"q22O\":5,\"q23O\":5,\"q24O\":5,\"q25O\":3,\"q26O\":5,\"q27O\":2,\"q28O\":5,\"q29O\":3,\"q30O\":3,\"q1\":1,\"q3\":3,\"q4\":1,\"q5\":5,\"q6\":4,\"q8\":5,\"q10\":5,\"q13\":3,\"q14\":2,\"q15\":1,\"q16\":1,\"q17\":4,\"q18\":5,\"q19\":5,\"q20\":5,\"q22\":5,\"q23\":3,\"q25\":2,\"q26\":4,\"q27\":5,\"q28\":5,\"q29\":5,\"q30\":4,\"q31\":1,\"q32\":1,\"q33\":1,\"q34\":1,\"q35\":3,\"q36\":1,\"q37\":1,\"q38\":3,\"q39\":4,\"q40\":5,\"q41\":1,\"q42\":1,\"q43\":2,\"q44\":1,\"q45\":3,\"q46\":1,\"q47\":3,\"q48\":3,\"q49\":2,\"q50\":4,\"q51\":1,\"q52\":4,\"q53\":1,\"q54\":3,\"q55\":3,\"q56\":1,\"q57\":5,\"q58\":3,\"q59\":1,\"q60\":5,\"qv1\":1,\"qv2\":1,\"qv3\":2,\"qv4\":2,\"qv5\":1,\"qv6\":2,\"qv7\":2,\"qv8\":2,\"qv9\":1,\"qv10\":2,\"qv11\":1,\"qv12\":1,\"qv13\":1,\"qv14\":2,\"qv15\":1,\"qv16\":1,\"qv17\":2,\"qv18\":2,\"qv19\":2,\"qv20\":1,\"qv21\":1,\"qv22\":2,\"qv23\":2,\"qv24\":2,\"qv25\":2,\"qv26\":2}','2023-10-27 15:00:00'),('ptv_0533_sjhy','15954798900','{\"Gender\":\"f\",\"Age\":\"O\",\"q1O\":3,\"q2O\":2,\"q3O\":2,\"q4O\":2,\"q5O\":5,\"q6O\":5,\"q7O\":5,\"q8O\":4,\"q9Line truncated
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
"source": [
|
||||||
"import openpyxl\n",
|
"import openpyxl\n",
|
||||||
"import json\n",
|
"import json\n",
|
||||||
|
|||||||
+247
-40
@@ -23,8 +23,8 @@
|
|||||||
"mydb = myclient[\"baogao\"]\n",
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
"mycol = mydb[\"place\"]\n",
|
"mycol = mydb[\"place\"]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"id = 469849\n",
|
"id = 624770\n",
|
||||||
"name = \"长炼医院\"\n",
|
"name = \"淄博世纪花园\"\n",
|
||||||
"myquery = { \"id\": id }\n",
|
"myquery = { \"id\": id }\n",
|
||||||
"num = mycol.count_documents(myquery)\n",
|
"num = mycol.count_documents(myquery)\n",
|
||||||
"if num>0:\n",
|
"if num>0:\n",
|
||||||
@@ -63,14 +63,9 @@
|
|||||||
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||||
"mydb = myclient[\"baogao\"]\n",
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"place_id = 624770\n",
|
||||||
"filename = 'data/北京农行人员名单all.json'\n",
|
"place_code = '05'\n",
|
||||||
"with open(filename,'r') as fl:\n",
|
"dw_name = '淄博世纪花园'\n",
|
||||||
" dict1 = json.load(fl) \n",
|
|
||||||
"\n",
|
|
||||||
"place_id = 309118\n",
|
|
||||||
"place_code = '03'\n",
|
|
||||||
"dw_name = '中国农业银行股份有限公司北京市分行'\n",
|
|
||||||
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files'\n",
|
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files'\n",
|
||||||
"fls = glob.glob(f'{fi_path}/{str(place_id)}/*.pdf')\n",
|
"fls = glob.glob(f'{fi_path}/{str(place_id)}/*.pdf')\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -81,7 +76,7 @@
|
|||||||
"list1 = []\n",
|
"list1 = []\n",
|
||||||
"i = 0\n",
|
"i = 0\n",
|
||||||
"while i < len(fls):\n",
|
"while i < len(fls):\n",
|
||||||
" code = random.sample(code_list,5) #随机取6位数\n",
|
" code = random.sample(code_list,4) #随机取4位数\n",
|
||||||
" code_num = ''.join(code) \n",
|
" code_num = ''.join(code) \n",
|
||||||
" if code_num not in list1:\n",
|
" if code_num not in list1:\n",
|
||||||
" list1.append(place_code+code_num)\n",
|
" list1.append(place_code+code_num)\n",
|
||||||
@@ -125,19 +120,20 @@
|
|||||||
"mydb = myclient[\"baogao\"]\n",
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
"mycol = mydb[\"pdf\"]\n",
|
"mycol = mydb[\"pdf\"]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/北京农行人员名单all.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",
|
||||||
"dict2 = {}\n",
|
"dict2 = {}\n",
|
||||||
"place_id = 309118\n",
|
"place_id = 624770\n",
|
||||||
"myquery = { \"place_id\": place_id }\n",
|
"myquery = { \"place_id\": place_id }\n",
|
||||||
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||||
" code = int(x['fn'].split('-')[0])\n",
|
" code = int(x['fn'].split('-')[0])\n",
|
||||||
" if str(code) in dict1.keys():\n",
|
" if str(code) in dict1.keys():\n",
|
||||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
" dict2[code] = {'name':str(dict1[str(code)]['name']),'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" print('no phone')\n",
|
" print(code,'no phone')\n",
|
||||||
"print(dict2)"
|
"for k,v in dict2.items():\n",
|
||||||
|
" print(k,v['name'],v['phone'],v['code'])"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -169,11 +165,11 @@
|
|||||||
"mydb = myclient[\"baogao\"]\n",
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
"mycol = mydb[\"pdf\"]\n",
|
"mycol = mydb[\"pdf\"]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/北京农行人员名单all.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",
|
||||||
"dict2 = {}\n",
|
"dict2 = {}\n",
|
||||||
"place_id = 309118\n",
|
"place_id = 624770\n",
|
||||||
"myquery = { \"place_id\": place_id }\n",
|
"myquery = { \"place_id\": place_id }\n",
|
||||||
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||||
" code = int(x['fn'].split('-')[0])\n",
|
" code = int(x['fn'].split('-')[0])\n",
|
||||||
@@ -181,7 +177,7 @@
|
|||||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||||
" else:\n",
|
" else:\n",
|
||||||
" print('no phone')\n",
|
" print('no phone')\n",
|
||||||
"print(dict2)\n",
|
"#print(dict2)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"#dict2 = {375: {'phone': '13793180751', 'code': '0379208'}}\n",
|
"#dict2 = {375: {'phone': '13793180751', 'code': '0379208'}}\n",
|
||||||
"for k, v in dict2.items():\n",
|
"for k, v in dict2.items():\n",
|
||||||
@@ -193,7 +189,7 @@
|
|||||||
" cred = credential.Credential(secretId, secretKey) \n",
|
" cred = credential.Credential(secretId, secretKey) \n",
|
||||||
" httpProfile = HttpProfile()\n",
|
" httpProfile = HttpProfile()\n",
|
||||||
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
||||||
" httpProfile.reqTimeout = 30 # 请求超时时间,单位为秒(默认60秒)\n",
|
" httpProfile.reqTimeout = 60 # 请求超时时间,单位为秒(默认60秒)\n",
|
||||||
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
||||||
" clientProfile = ClientProfile()\n",
|
" clientProfile = ClientProfile()\n",
|
||||||
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
||||||
@@ -204,7 +200,7 @@
|
|||||||
" req.SmsSdkAppId = \"1400140089\"\n",
|
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||||
" req.SignName = \"坤铭教育\"\n",
|
" req.SignName = \"坤铭教育\"\n",
|
||||||
" req.TemplateId = \"1875765\" \n",
|
" req.TemplateId = \"1875765\" \n",
|
||||||
" req.TemplateParamSet = [\"农行北京市分行体测者\",yzm]\n",
|
" req.TemplateParamSet = [\"淄博世纪花园体测者\",yzm]\n",
|
||||||
" req.PhoneNumberSet = [phone]\n",
|
" req.PhoneNumberSet = [phone]\n",
|
||||||
" req.SessionContext = \"\"\n",
|
" req.SessionContext = \"\"\n",
|
||||||
" req.ExtendCode = \"\"\n",
|
" req.ExtendCode = \"\"\n",
|
||||||
@@ -217,24 +213,6 @@
|
|||||||
" print(v['phone'],err)"
|
" print(v['phone'],err)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "eefec974-c4b7-43c8-82c2-6ad6e5045aa0",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"import json\n",
|
|
||||||
"\n",
|
|
||||||
"filename = 'data/01.json'\n",
|
|
||||||
"with open(filename,'r') as fl:\n",
|
|
||||||
" dict1 = json.load(fl)\n",
|
|
||||||
"for k, v in dict1.items():\n",
|
|
||||||
" phone = '+86'+v['phone']\n",
|
|
||||||
" yzm = v['code']\n",
|
|
||||||
" print(k,phone,yzm)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@@ -246,10 +224,239 @@
|
|||||||
"print(dict1['SendStatusSet'][0][\"Message\"])"
|
"print(dict1['SendStatusSet'][0][\"Message\"])"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "feb02430-8946-4ed2-a99b-7f5106257c8b",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 单个发送短信"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "ba05bd1a-9f33-4df7-b15e-d110c19a5dea",
|
"id": "25a269c3-758f-4e79-ae6d-a6e6f161d64b",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from tencentcloud.common import credential\n",
|
||||||
|
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||||
|
"from tencentcloud.sms.v20210111 import sms_client, models\n",
|
||||||
|
"from tencentcloud.common.profile.client_profile import ClientProfile\n",
|
||||||
|
"from tencentcloud.common.profile.http_profile import HttpProfile\n",
|
||||||
|
"import json\n",
|
||||||
|
"import pymongo\n",
|
||||||
|
"\n",
|
||||||
|
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||||
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
|
"mycol = mydb[\"pdf\"]\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/世纪花园人员信息.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl) \n",
|
||||||
|
"dict2 = {}\n",
|
||||||
|
"place_id = 624770\n",
|
||||||
|
"myquery = { \"place_id\": place_id,\"code\":\"053618\" }\n",
|
||||||
|
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||||
|
" code = int(x['fn'].split('-')[0])\n",
|
||||||
|
" if str(code) in dict1.keys():\n",
|
||||||
|
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||||
|
" else:\n",
|
||||||
|
" print('no phone')\n",
|
||||||
|
"#print(dict2)\n",
|
||||||
|
"\n",
|
||||||
|
"#dict2 = {375: {'phone': '13793180751', 'code': '0379208'}}\n",
|
||||||
|
"for k, v in dict2.items():\n",
|
||||||
|
" phone = '+86'+v['phone']\n",
|
||||||
|
" yzm = v['code']\n",
|
||||||
|
" try: \n",
|
||||||
|
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||||
|
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||||
|
" cred = credential.Credential(secretId, secretKey) \n",
|
||||||
|
" httpProfile = HttpProfile()\n",
|
||||||
|
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
||||||
|
" httpProfile.reqTimeout = 60 # 请求超时时间,单位为秒(默认60秒)\n",
|
||||||
|
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
||||||
|
" clientProfile = ClientProfile()\n",
|
||||||
|
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
||||||
|
" clientProfile.language = \"en-US\"\n",
|
||||||
|
" clientProfile.httpProfile = httpProfile\n",
|
||||||
|
" client = sms_client.SmsClient(cred, \"ap-guangzhou\", clientProfile)\n",
|
||||||
|
" req = models.SendSmsRequest()\n",
|
||||||
|
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||||
|
" req.SignName = \"坤铭教育\"\n",
|
||||||
|
" req.TemplateId = \"1875765\" \n",
|
||||||
|
" req.TemplateParamSet = [\"淄博世纪花园体测者\",yzm]\n",
|
||||||
|
" req.PhoneNumberSet = [phone]\n",
|
||||||
|
" req.SessionContext = \"\"\n",
|
||||||
|
" req.ExtendCode = \"\"\n",
|
||||||
|
" req.SenderId = \"\"\n",
|
||||||
|
" resp = client.SendSms(req)\n",
|
||||||
|
" dict3 = json.loads(resp.to_json_string(indent=2))\n",
|
||||||
|
"\n",
|
||||||
|
" print(v['phone'],dict3['SendStatusSet'][0][\"Message\"])\n",
|
||||||
|
" except TencentCloudSDKException as err:\n",
|
||||||
|
" print(v['phone'],err)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "b1e90a59-0b09-4786-99a5-036b69f793ae",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from tencentcloud.common import credential\n",
|
||||||
|
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||||
|
"from tencentcloud.sms.v20210111 import sms_client, models\n",
|
||||||
|
"from tencentcloud.common.profile.client_profile import ClientProfile\n",
|
||||||
|
"from tencentcloud.common.profile.http_profile import HttpProfile\n",
|
||||||
|
"import json\n",
|
||||||
|
"import pymongo\n",
|
||||||
|
"\n",
|
||||||
|
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||||
|
"mydb = myclient[\"baogao\"]\n",
|
||||||
|
"mycol = mydb[\"pdf\"]\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/世纪花园人员信息.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl) \n",
|
||||||
|
"dict2 = {}\n",
|
||||||
|
"place_id = 624770\n",
|
||||||
|
"myquery = { \"place_id\": place_id,\"code\":\"051067\" }\n",
|
||||||
|
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||||
|
" code = int(x['fn'].split('-')[0])\n",
|
||||||
|
" if str(code) in dict1.keys():\n",
|
||||||
|
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||||
|
" else:\n",
|
||||||
|
" print('no phone')\n",
|
||||||
|
"print(dict2)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "458f1022-ceb9-49f9-b699-3fcc81658335",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 统计短信发送状态"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "411e89ed-8bb2-478b-b180-52188f800adc",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from tencentcloud.common import credential\n",
|
||||||
|
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||||
|
"from tencentcloud.sms.v20210111 import sms_client, models\n",
|
||||||
|
"from tencentcloud.common.profile.client_profile import ClientProfile\n",
|
||||||
|
"from tencentcloud.common.profile.http_profile import HttpProfile\n",
|
||||||
|
"import json\n",
|
||||||
|
"import pymongo\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"try: \n",
|
||||||
|
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||||
|
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||||
|
" cred = credential.Credential(secretId, secretKey) \n",
|
||||||
|
" httpProfile = HttpProfile()\n",
|
||||||
|
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
||||||
|
" httpProfile.reqTimeout = 60 # 请求超时时间,单位为秒(默认60秒)\n",
|
||||||
|
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
||||||
|
" clientProfile = ClientProfile()\n",
|
||||||
|
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
||||||
|
" clientProfile.language = \"en-US\"\n",
|
||||||
|
" clientProfile.httpProfile = httpProfile\n",
|
||||||
|
" client = sms_client.SmsClient(cred, \"ap-guangzhou\", clientProfile)\n",
|
||||||
|
" req = models.SendStatusStatisticsRequest()\n",
|
||||||
|
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||||
|
" \n",
|
||||||
|
" # 拉取最大条数,最多100条\n",
|
||||||
|
" req.Limit = 100\n",
|
||||||
|
" # 偏移量 注:目前固定设置为0\n",
|
||||||
|
" req.Offset = 0\n",
|
||||||
|
" # 开始时间,yyyymmddhh 需要拉取的起始时间,精确到小时\n",
|
||||||
|
" req.BeginTime = \"2023111000\"\n",
|
||||||
|
" # 结束时间,yyyymmddhh 需要拉取的截止时间,精确到小时\n",
|
||||||
|
" # 注:EndTime 必须大于 BeginTime\n",
|
||||||
|
" req.EndTime = \"2023111023\"\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
" # 通过client对象调用SendStatusStatistics方法发起请求。注意请求方法名与请求对象是对应的。\n",
|
||||||
|
" # 返回的resp是一个SendStatusStatisticsResponse类的实例,与请求对象对应。\n",
|
||||||
|
" resp = client.SendStatusStatistics(req)\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
" # 输出json格式的字符串回包\n",
|
||||||
|
" print(resp.to_json_string(indent=2))\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"except TencentCloudSDKException as err:\n",
|
||||||
|
" print(err)\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "51c61809-e6a3-489e-bac7-f439b673dcd3",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 拉取短信下发状态"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "50183bba-2f9d-4003-98a7-0ecda96670ef",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from tencentcloud.common import credential\n",
|
||||||
|
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||||
|
"from tencentcloud.sms.v20210111 import sms_client, models\n",
|
||||||
|
"from tencentcloud.common.profile.client_profile import ClientProfile\n",
|
||||||
|
"from tencentcloud.common.profile.http_profile import HttpProfile\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"try: \n",
|
||||||
|
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||||
|
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||||
|
" cred = credential.Credential(secretId, secretKey) \n",
|
||||||
|
" httpProfile = HttpProfile()\n",
|
||||||
|
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
||||||
|
" httpProfile.reqTimeout = 60 # 请求超时时间,单位为秒(默认60秒)\n",
|
||||||
|
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
||||||
|
" clientProfile = ClientProfile()\n",
|
||||||
|
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
||||||
|
" clientProfile.language = \"en-US\"\n",
|
||||||
|
" clientProfile.httpProfile = httpProfile\n",
|
||||||
|
" client = sms_client.SmsClient(cred, \"ap-guangzhou\", clientProfile)\n",
|
||||||
|
" req = models.PullSmsSendStatusRequest()\n",
|
||||||
|
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||||
|
" req.Limit = 100\n",
|
||||||
|
" resp = client.PullSmsSendStatus(req)\n",
|
||||||
|
" # 输出json格式的字符串回包\n",
|
||||||
|
" print(resp.to_json_string(indent=2))\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"except TencentCloudSDKException as err:\n",
|
||||||
|
" print(err)\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "c3b4d384-9f83-4c91-98aa-0bb1f0e1d4ed",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
|||||||
+16
-16
@@ -1220,15 +1220,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 15,
|
"execution_count": 17,
|
||||||
"id": "1aa45b35-7376-4c50-8275-79b090a6c758",
|
"id": "1aa45b35-7376-4c50-8275-79b090a6c758",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2023-11-09T12:53:06.838265Z",
|
"iopub.execute_input": "2023-11-11T02:58:46.399097Z",
|
||||||
"iopub.status.busy": "2023-11-09T12:53:06.837754Z",
|
"iopub.status.busy": "2023-11-11T02:58:46.398632Z",
|
||||||
"iopub.status.idle": "2023-11-09T12:53:06.915213Z",
|
"iopub.status.idle": "2023-11-11T02:58:46.503284Z",
|
||||||
"shell.execute_reply": "2023-11-09T12:53:06.914129Z",
|
"shell.execute_reply": "2023-11-11T02:58:46.502753Z",
|
||||||
"shell.execute_reply.started": "2023-11-09T12:53:06.838227Z"
|
"shell.execute_reply.started": "2023-11-11T02:58:46.399061Z"
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
@@ -1237,8 +1237,8 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"469\n",
|
"607\n",
|
||||||
"469\n"
|
"607\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -1261,7 +1261,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",
|
||||||
"\n",
|
"\n",
|
||||||
"filename = 'data/places_result_20231109.csv'\n",
|
"filename = 'data/places_result_20231111.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",
|
||||||
@@ -1300,15 +1300,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 16,
|
"execution_count": 18,
|
||||||
"id": "1172a79c-ec8f-4274-8c43-6ec11d95f8ca",
|
"id": "1172a79c-ec8f-4274-8c43-6ec11d95f8ca",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
"execution": {
|
||||||
"iopub.execute_input": "2023-11-09T12:53:43.095567Z",
|
"iopub.execute_input": "2023-11-11T02:59:00.204405Z",
|
||||||
"iopub.status.busy": "2023-11-09T12:53:43.095355Z",
|
"iopub.status.busy": "2023-11-11T02:59:00.204011Z",
|
||||||
"iopub.status.idle": "2023-11-09T12:53:43.122482Z",
|
"iopub.status.idle": "2023-11-11T02:59:00.237385Z",
|
||||||
"shell.execute_reply": "2023-11-09T12:53:43.121793Z",
|
"shell.execute_reply": "2023-11-11T02:59:00.236828Z",
|
||||||
"shell.execute_reply.started": "2023-11-09T12:53:43.095552Z"
|
"shell.execute_reply.started": "2023-11-11T02:59:00.204374Z"
|
||||||
},
|
},
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
@@ -1334,7 +1334,7 @@
|
|||||||
" list2 = [i,k,v['name'],v['unit']]\n",
|
" list2 = [i,k,v['name'],v['unit']]\n",
|
||||||
" i+=1\n",
|
" i+=1\n",
|
||||||
" list1.append(list2)\n",
|
" list1.append(list2)\n",
|
||||||
"filename = f'data/北海炼化未测试人员名单(截至20231109).xlsx'\n",
|
"filename = f'data/北海炼化未测试人员名单(截至20231111).xlsx'\n",
|
||||||
"title = ['序号','员工编号','姓名','部门']\n",
|
"title = ['序号','员工编号','姓名','部门']\n",
|
||||||
"wb = openpyxl.Workbook()\n",
|
"wb = openpyxl.Workbook()\n",
|
||||||
"sheet = wb.active\n",
|
"sheet = wb.active\n",
|
||||||
|
|||||||
+66
-17
@@ -2250,16 +2250,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 244,
|
"execution_count": null,
|
||||||
"id": "3fa6a1a9-63af-4f4e-9d30-b94f4357f7dc",
|
"id": "3fa6a1a9-63af-4f4e-9d30-b94f4357f7dc",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-11-09T12:42:37.907963Z",
|
|
||||||
"iopub.status.busy": "2023-11-09T12:42:37.907493Z",
|
|
||||||
"iopub.status.idle": "2023-11-09T12:42:38.065986Z",
|
|
||||||
"shell.execute_reply": "2023-11-09T12:42:38.065489Z",
|
|
||||||
"shell.execute_reply.started": "2023-11-09T12:42:37.907926Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -2291,16 +2284,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 245,
|
"execution_count": null,
|
||||||
"id": "3f75763f-79bd-4a8c-9612-2eba89ce32f1",
|
"id": "3f75763f-79bd-4a8c-9612-2eba89ce32f1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2023-11-09T12:42:42.685877Z",
|
|
||||||
"iopub.status.busy": "2023-11-09T12:42:42.685491Z",
|
|
||||||
"iopub.status.idle": "2023-11-09T12:42:43.010658Z",
|
|
||||||
"shell.execute_reply": "2023-11-09T12:42:43.010150Z",
|
|
||||||
"shell.execute_reply.started": "2023-11-09T12:42:42.685846Z"
|
|
||||||
},
|
|
||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
@@ -3097,10 +3083,73 @@
|
|||||||
" print()"
|
" print()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "d3d9d517-61e5-4c4c-bddb-1f386a518d99",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## 倒班人员数据分析"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6b0b8d09-ce15-4a36-9421-251ab50ae706",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### 倒班员工数据导入"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 253,
|
||||||
|
"id": "518a1e40-d383-4d78-a4ea-224ddab49b79",
|
||||||
|
"metadata": {
|
||||||
|
"execution": {
|
||||||
|
"iopub.execute_input": "2023-11-10T13:59:53.477003Z",
|
||||||
|
"iopub.status.busy": "2023-11-10T13:59:53.476599Z",
|
||||||
|
"iopub.status.idle": "2023-11-10T13:59:54.275449Z",
|
||||||
|
"shell.execute_reply": "2023-11-10T13:59:54.274890Z",
|
||||||
|
"shell.execute_reply.started": "2023-11-10T13:59:53.476972Z"
|
||||||
|
},
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"1726\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import json\n",
|
||||||
|
"import openpyxl\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"filename = 'data/data_天津231017.json'\n",
|
||||||
|
"with open(filename,'r') as fl:\n",
|
||||||
|
" dict1 = json.load(fl)\n",
|
||||||
|
"\n",
|
||||||
|
" \n",
|
||||||
|
"wb = openpyxl.load_workbook('data/员工个人基础信息-倒班.xlsx')\n",
|
||||||
|
"sheet = wb.active\n",
|
||||||
|
"# sheets = wb.sheetnames\n",
|
||||||
|
"dict2 = {}\n",
|
||||||
|
"i = 1\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, 1).value)\n",
|
||||||
|
" daoban = sheet.cell(n, 6).value\n",
|
||||||
|
" if str(code) in dict1.keys() and daoban == '倒班':\n",
|
||||||
|
" dict2[str(code)] = dict1[str(code)]\n",
|
||||||
|
"print(len(dict2))"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "2ed551b0-85d5-40d4-8cc1-fd0a0c330ad9",
|
"id": "08167b05-8719-41c9-a71d-57906a55eb63",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
|||||||
Reference in new issue
Block a user