2024-09-13 15:03:55 +08:00
|
|
|
import json
|
|
|
|
|
|
|
|
from flask_app.货物标.货物标截取pdf import truncate_pdf_main
|
|
|
|
from flask_app.main.format_change import docx2pdf, pdf2docx
|
2024-09-13 16:05:16 +08:00
|
|
|
from flask_app.货物标.技术服务商务要求提取 import get_technical_requirements
|
2024-09-13 15:03:55 +08:00
|
|
|
|
|
|
|
#获取采购清单
|
|
|
|
def fetch_purchasing_list(file_path,output_folder,file_type):
|
|
|
|
if file_type==1:
|
|
|
|
docx_path=file_path
|
|
|
|
pdf_path = docx2pdf(file_path)
|
|
|
|
elif file_type==2:
|
|
|
|
pdf_path=file_path
|
|
|
|
docx_path=pdf2docx(file_path)
|
|
|
|
else:
|
|
|
|
print("未传入指定格式的文件!")
|
|
|
|
return None
|
2024-09-13 16:05:16 +08:00
|
|
|
truncate_file=truncate_pdf_main(pdf_path,output_folder,1)
|
|
|
|
tech_reqs=get_technical_requirements(truncate_file)
|
2024-09-13 15:03:55 +08:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
output_folder = "C:\\Users\\Administrator\\Desktop\\货物标\\货物标output"
|
|
|
|
file_path="C:\\Users\\Administrator\\Desktop\\货物标\\zbfiles\\磋商文件.doc"
|
|
|
|
fetch_purchasing_list(file_path,output_folder,1)
|
|
|
|
|