|
@@ -11,6 +11,8 @@ import rarfile
|
|
import py7zr
|
|
import py7zr
|
|
import tarfile
|
|
import tarfile
|
|
from zipfile import ZipFile
|
|
from zipfile import ZipFile
|
|
|
|
+import requests
|
|
|
|
+from requests.adapters import HTTPAdapter
|
|
|
|
|
|
import logging
|
|
import logging
|
|
|
|
|
|
@@ -141,19 +143,19 @@ def get_base_info(lines):
|
|
if rst.get("出生日期"):
|
|
if rst.get("出生日期"):
|
|
dates = re.findall(r'\d+' ,rst["出生日期"][0]["text"])
|
|
dates = re.findall(r'\d+' ,rst["出生日期"][0]["text"])
|
|
if len(dates) == 1:
|
|
if len(dates) == 1:
|
|
- rst["出生日期"][0]["text"] = "{:4d}年01月".format(int(dates[0]))
|
|
|
|
|
|
+ rst["出生日期"][0]["text"] = "{:4d}-01-01".format(int(dates[0]))
|
|
elif len(dates) == 2:
|
|
elif len(dates) == 2:
|
|
- rst["出生日期"][0]["text"] = "{:4d}年{:02d}月".format(int(dates[0]), int(dates[1]))
|
|
|
|
|
|
+ rst["出生日期"][0]["text"] = "{:4d}-{:02d}-01".format(int(dates[0]), int(dates[1]))
|
|
elif len(dates) == 3:
|
|
elif len(dates) == 3:
|
|
- rst["出生日期"][0]["text"] = "{:4d}年{:02d}月".format(int(dates[0]), int(dates[1]))
|
|
|
|
|
|
+ rst["出生日期"][0]["text"] = "{:4d}-{:02d}-01".format(int(dates[0]), int(dates[1]))
|
|
if rst.get("参加工作时间"):
|
|
if rst.get("参加工作时间"):
|
|
dates = re.findall(r'\d+' ,rst["参加工作时间"][0]["text"])
|
|
dates = re.findall(r'\d+' ,rst["参加工作时间"][0]["text"])
|
|
if len(dates) == 1:
|
|
if len(dates) == 1:
|
|
- rst["参加工作时间"][0]["text"] = "{:4d}年01月".format(int(dates[0]))
|
|
|
|
|
|
+ rst["参加工作时间"][0]["text"] = "{:4d}-01-01".format(int(dates[0]))
|
|
elif len(dates) == 2:
|
|
elif len(dates) == 2:
|
|
- rst["参加工作时间"][0]["text"] = "{:4d}年{:02d}月".format(int(dates[0]), int(dates[1]))
|
|
|
|
|
|
+ rst["参加工作时间"][0]["text"] = "{:4d}-{:02d}-01".format(int(dates[0]), int(dates[1]))
|
|
elif len(dates) == 3:
|
|
elif len(dates) == 3:
|
|
- rst["参加工作时间"][0]["text"] = "{:4d}年{:02d}月".format(int(dates[0]), int(dates[1]))
|
|
|
|
|
|
+ rst["参加工作时间"][0]["text"] = "{:4d}-{:02d}-01".format(int(dates[0]), int(dates[1]))
|
|
return {key:rst[key][0]["text"] for key in rst.keys()}
|
|
return {key:rst[key][0]["text"] for key in rst.keys()}
|
|
|
|
|
|
|
|
|
|
@@ -1481,6 +1483,17 @@ def detection_type(path, system):
|
|
filename = os.path.join(tempdir, file)
|
|
filename = os.path.join(tempdir, file)
|
|
with open(filename, "r", encoding="utf-8") as ff:
|
|
with open(filename, "r", encoding="utf-8") as ff:
|
|
rst = json.load(ff)
|
|
rst = json.load(ff)
|
|
|
|
+ url = "http://192.168.1.110:9999/talent/getResumeData"
|
|
|
|
+ session = requests.Session()
|
|
|
|
+ session.mount('http://', HTTPAdapter(max_retries = 3))
|
|
|
|
+ try:
|
|
|
|
+ headers = {
|
|
|
|
+ 'contentType':'Application/json'
|
|
|
|
+ }
|
|
|
|
+ response = session.post(url=url, headers=headers, json={"ResumeData":rst}, timeout=10)
|
|
|
|
+ print(response.text)
|
|
|
|
+ except Exception as e:
|
|
|
|
+ print(e)
|
|
console.print(rst, style="red", justify="left")
|
|
console.print(rst, style="red", justify="left")
|
|
|
|
|
|
|
|
|