|
@@ -9,7 +9,7 @@ from flask import Flask, request, jsonify, send_file
|
|
|
from add_signature import find_signature_positions, add_signature_to_pdf
|
|
from add_signature import find_signature_positions, add_signature_to_pdf
|
|
|
from add_watermark import add_watermark_to_pdf
|
|
from add_watermark import add_watermark_to_pdf
|
|
|
from extract_table import extract_temp_time, extract_pdf_table_to_excel, extract_temp_by_datetime_pattern, allowed_file, \
|
|
from extract_table import extract_temp_time, extract_pdf_table_to_excel, extract_temp_by_datetime_pattern, allowed_file, \
|
|
|
- safe_filename
|
|
|
|
|
|
|
+ safe_filename, extract_temperature_data_from_pdf
|
|
|
from lib import Qiniu
|
|
from lib import Qiniu
|
|
|
from werkzeug.utils import secure_filename
|
|
from werkzeug.utils import secure_filename
|
|
|
from flask_cors import CORS
|
|
from flask_cors import CORS
|
|
@@ -130,6 +130,8 @@ def extract_table():
|
|
|
df = extract_temp_time(filepath)
|
|
df = extract_temp_time(filepath)
|
|
|
if "设备汇总报告" in text:
|
|
if "设备汇总报告" in text:
|
|
|
df = extract_temp_by_datetime_pattern(filepath)
|
|
df = extract_temp_by_datetime_pattern(filepath)
|
|
|
|
|
+ if "详细数据" in text:
|
|
|
|
|
+ df = extract_temperature_data_from_pdf(filepath)
|
|
|
|
|
|
|
|
if df is None:
|
|
if df is None:
|
|
|
os.remove(filepath)
|
|
os.remove(filepath)
|