changes docx导出接口

This commit is contained in:
P3ngSaM 2023-07-03 09:54:16 +08:00
parent 2310a26b2e
commit f7cfde17f1
3 changed files with 41 additions and 33 deletions

Binary file not shown.

View File

@ -1,15 +1,15 @@
{
"公司领导动态": {
"杨秋岭": "",
"王春来": "",
"施建军": "",
"刘彤祥": "",
"朱菁": "",
"金磊": "",
"付晓东": "",
"高利鹏": "",
"张馨予": "",
"卢志怀": ""
"杨秋岭": "未报送",
"王春来": "未报送",
"施建军": "未报送",
"刘彤祥": "未报送",
"朱菁": "未报送",
"金磊": "未报送",
"付晓东": "未报送",
"高利鹏": "未报送",
"张馨予": "未报送",
"卢志怀": "未报送"
},
"各部门和分子公司动态": {
"业务发展一部": "",
@ -28,7 +28,6 @@
"信贷评级部": "",
"信评委": "",
"研究与发展部": "",
"创新业务部": "",
"绿色金融部": "",
"数字化部": "",
"博士后工作站": "",

View File

@ -207,7 +207,8 @@ def daily_export_to_pdf(req: DailySchemas.DailyExportToPdfReq, db: Session = Dep
def format_conversion(string):
if not string:
return ""
parts = string.split(";")
string = string.replace(";", "")
parts = string.split("")
formatted_parts = []
for part in parts:
part = part.replace("", "")
@ -252,6 +253,9 @@ def daily_export_to_pdf(req: DailySchemas.DailyExportToPdfReq, db: Session = Dep
res = format_conversion(content)
department[k2].append(res + '' + '({}报送)'.format(item.get('填报人')))
if department[k2]:
if len(department[k2]) == 1:
department[k2] = department[k2][0]
else:
first = department[k2].pop(0)
department[k2] = "\n".join(department[k2])
department[k2] = "\n".join([" " + line for line in department[k2].split("\n")])
@ -270,6 +274,9 @@ def daily_export_to_pdf(req: DailySchemas.DailyExportToPdfReq, db: Session = Dep
content = content + '({}报送)'.format(item.get('填报人'))
supervise[k3].append(content)
if supervise[k3]:
if len(supervise[k3]) == 1:
supervise[k3] = supervise[k3][0]
else:
first = supervise[k3].pop(0)
first = '1、' + first
for i in range(len(supervise[k3])):
@ -292,6 +299,9 @@ def daily_export_to_pdf(req: DailySchemas.DailyExportToPdfReq, db: Session = Dep
subject[k4].append(content)
if subject[k4]:
if len(subject[k4]) == 1:
subject[k4] = subject[k4][0]
else:
first = subject[k4].pop(0)
first = '1、' + first
for i in range(len(subject[k4])):
@ -302,7 +312,6 @@ def daily_export_to_pdf(req: DailySchemas.DailyExportToPdfReq, db: Session = Dep
subject[k4] = first + '\n' + subject[k4]
else:
subject[k4] = '未报送'
current_date = datetime.datetime.now()
merged_dict = {
"": req.day.year,
"": req.day.month,