This commit is contained in:
512song committed 2024-01-03 22:28:08 +08:00
1 parent 996379d3cb
commit 5e368c4b76
4 files changed
+501 -320

No files matched your search

+22 -33
View File
@@ -125,19 +125,21 @@
"mydb = myclient[\"baogao\"]\n",
"mycol = mydb[\"pdf\"]\n",
"\n",
"filename = 'data/积家村报告明细.json'\n",
"filename = 'data/北京农行百日筑基.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"dict2 = {}\n",
"place_id = 698465\n",
"place_id = 309118\n",
"myquery = { \"place_id\": place_id }\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() and 'phone' in dict1[str(code)].keys():\n",
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
" if str(code) in dict1.keys():\n",
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code'],'name':x['fn']}\n",
" else:\n",
" print(code,'no phone')\n",
" print('no phone')\n",
"#print(dict2)\n",
"i=1\n",
"#dict2 = {375: {'phone': '13793180751', 'code': '0379208'}}\n",
"for k, v in dict2.items():\n",
" phone = '+86'+v['phone']\n",
" yzm = v['code']\n",
@@ -158,15 +160,17 @@
" req.SmsSdkAppId = \"1400140089\"\n",
" req.SignName = \"坤铭教育\"\n",
" req.TemplateId = \"1875765\" \n",
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\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",
" #resp = client.SendSms(req)\n",
" #dict3 = json.loads(resp.to_json_string(indent=2))\n",
"\n",
" print(v['phone'],dict3['SendStatusSet'][0][\"Message\"])\n",
" #print(v['phone'],dict3['SendStatusSet'][0][\"Message\"])\n",
" print(i,v['phone'],v['name'],)\n",
" i+=1\n",
" except TencentCloudSDKException as err:\n",
" print(v['phone'],err)"
]
@@ -200,16 +204,16 @@
"mydb = myclient[\"baogao\"]\n",
"mycol = mydb[\"pdf\"]\n",
"\n",
"filename = 'data/世纪花园人员信息.json'\n",
"filename = 'data/北京农行百日筑基.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"dict2 = {}\n",
"place_id = 698465\n",
"place_id = 309118\n",
"myquery = { \"place_id\": place_id }\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",
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code'],'name':x['fn']}\n",
" else:\n",
" print('no phone')\n",
"#print(dict2)\n",
@@ -235,7 +239,7 @@
" req.SmsSdkAppId = \"1400140089\"\n",
" req.SignName = \"坤铭教育\"\n",
" req.TemplateId = \"1875765\" \n",
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\n",
" req.TemplateParamSet = [\"北京农行体测员工\",yzm]\n",
" req.PhoneNumberSet = [phone]\n",
" req.SessionContext = \"\"\n",
" req.ExtendCode = \"\"\n",
@@ -269,27 +273,12 @@
},
{
"cell_type": "code",
"execution_count": 86,
"execution_count": null,
"id": "25a269c3-758f-4e79-ae6d-a6e6f161d64b",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-27T03:02:47.586339Z",
"iopub.status.busy": "2023-11-27T03:02:47.585869Z",
"iopub.status.idle": "2023-11-27T03:02:47.873412Z",
"shell.execute_reply": "2023-11-27T03:02:47.872245Z",
"shell.execute_reply.started": "2023-11-27T03:02:47.586301Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"+8618264313303 send success\n"
]
}
],
"outputs": [],
"source": [
"from tencentcloud.common import credential\n",
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
@@ -301,8 +290,8 @@
"\n",
"\n",
"\n",
"phone = '+86'+'18264313303'\n",
"yzm = '066357'\n",
"phone = '+86'+'13520300915'\n",
"yzm = '036578'\n",
"try: \n",
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
@@ -320,7 +309,7 @@
" req.SmsSdkAppId = \"1400140089\"\n",
" req.SignName = \"坤铭教育\"\n",
" req.TemplateId = \"1875765\" \n",
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\n",
" req.TemplateParamSet = [\"北京农行体测者\",yzm]\n",
" req.PhoneNumberSet = [phone]\n",
" req.SessionContext = \"\"\n",
" req.ExtendCode = \"\"\n",