完成3月试用问题修改
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -31,7 +31,8 @@ from apps.createSeiTaiDocument.extensions.logger import GenerateLogger
|
|||||||
# 导入mixins-处理文档片段
|
# 导入mixins-处理文档片段
|
||||||
from apps.createDocument.extensions.mixins import FragementToolsMixin
|
from apps.createDocument.extensions.mixins import FragementToolsMixin
|
||||||
# 导入工具
|
# 导入工具
|
||||||
from apps.createDocument.extensions.tools import demand_sort_by_designKey, set_table_border_by_cell_position, set_cell_margins
|
from apps.createDocument.extensions.tools import demand_sort_by_designKey, set_table_border_by_cell_position
|
||||||
|
from apps.createDocument.extensions.table_creator import create_table_context, RoundType, uniform_static_dynamic_response
|
||||||
|
|
||||||
# @api_controller("/generate", tags=['生成大纲文档'], auth=JWTAuth(), permissions=[IsAuthenticated])
|
# @api_controller("/generate", tags=['生成大纲文档'], auth=JWTAuth(), permissions=[IsAuthenticated])
|
||||||
@api_controller("/generate", tags=['生成大纲文档'])
|
@api_controller("/generate", tags=['生成大纲文档'])
|
||||||
@@ -483,101 +484,10 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
return ChenResponse(status=400, code=400, message="模版文件已打开,请关闭后再试,{0}".format(e))
|
return ChenResponse(status=400, code=400, message="模版文件已打开,请关闭后再试,{0}".format(e))
|
||||||
|
|
||||||
# 通用生成静态软件项、静态硬件项、动态软件项、动态硬件信息、测评数据的context,包含fontnote和table
|
|
||||||
@classmethod
|
|
||||||
def create_table_context(cls, table_data: list[list[str]], doc: DocxTemplate):
|
|
||||||
"""注意:该函数会增加一列序号列,并且支持单元格内回车换行(段落换行)"""
|
|
||||||
subdoc = doc.new_subdoc()
|
|
||||||
rows = len(table_data)
|
|
||||||
cols = len(table_data[0]) + 1
|
|
||||||
table = subdoc.add_table(rows=rows, cols=cols)
|
|
||||||
|
|
||||||
# 单元格处理
|
|
||||||
for row in range(rows):
|
|
||||||
for col in range(cols):
|
|
||||||
cell = table.cell(row, col)
|
|
||||||
set_cell_margins(cell, left=100, right=100, top=100, bottom=100)
|
|
||||||
|
|
||||||
# 获取要显示的文本内容(字符串或按行拆分后的列表)
|
|
||||||
if col == 0:
|
|
||||||
# 序号列
|
|
||||||
lines = ["序号"] if row == 0 else [str(row)]
|
|
||||||
else:
|
|
||||||
raw_text = table_data[row][col - 1]
|
|
||||||
# 按换行符 \n 拆分为多个段落
|
|
||||||
lines = raw_text.split('\n') if raw_text else ['']
|
|
||||||
|
|
||||||
# 清空单元格原有段落(add_table 默认有一个段落)
|
|
||||||
cell.text = ""
|
|
||||||
# 删除默认段落,稍后统一添加
|
|
||||||
for para in cell.paragraphs:
|
|
||||||
p = para._element
|
|
||||||
p.getparent().remove(p)
|
|
||||||
|
|
||||||
# 逐个添加段落
|
|
||||||
for i, line in enumerate(lines):
|
|
||||||
if i == 0:
|
|
||||||
para = cell.add_paragraph(line)
|
|
||||||
else:
|
|
||||||
para = cell.add_paragraph(line)
|
|
||||||
|
|
||||||
# 设置段落对齐(第一列居中,其他左对齐,可根据需要调整)
|
|
||||||
if col == 0:
|
|
||||||
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
||||||
else:
|
|
||||||
para.alignment = WD_ALIGN_PARAGRAPH.LEFT
|
|
||||||
|
|
||||||
# 对第一行(表头)设置黑体字体
|
|
||||||
if row == 0:
|
|
||||||
for run in para.runs:
|
|
||||||
run.font.name = '黑体'
|
|
||||||
run._element.rPr.rFonts.set(qn('w:eastAsia'), '黑体')
|
|
||||||
run.font.bold = False
|
|
||||||
# 表头段落居中(覆盖前面的 left)
|
|
||||||
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
||||||
|
|
||||||
# 垂直居中
|
|
||||||
cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER
|
|
||||||
|
|
||||||
# 设置序号列宽度
|
|
||||||
for cell in table.columns[0].cells:
|
|
||||||
cell.width = Mm(15)
|
|
||||||
for para in cell.paragraphs:
|
|
||||||
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
||||||
|
|
||||||
# 表格居中
|
|
||||||
table.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
||||||
# 设置表格外边框
|
|
||||||
set_table_border_by_cell_position(table)
|
|
||||||
return subdoc
|
|
||||||
|
|
||||||
# 统一静态软件项、静态硬件项、动态软件项、动态硬件信息的word生成 - 模版模式
|
|
||||||
@classmethod
|
|
||||||
def uniform_static_dynamic_response(cls, id: int, filename: str, r_filename: str, model) -> ChenResponse | None:
|
|
||||||
project_obj = get_object_or_404(Project, id=id)
|
|
||||||
input_path = Path.cwd() / 'media' / project_path(id) / 'form_template' / 'dg' / filename
|
|
||||||
doc = DocxTemplate(input_path)
|
|
||||||
qs = model.objects.filter(project=project_obj)
|
|
||||||
if qs.exists():
|
|
||||||
obj = qs.first()
|
|
||||||
table_data = obj.table
|
|
||||||
subdoc = cls.create_table_context(table_data, doc)
|
|
||||||
context = {
|
|
||||||
'fontnote': obj.fontnote,
|
|
||||||
'table': subdoc,
|
|
||||||
}
|
|
||||||
doc.render(context, autoescape=True)
|
|
||||||
try:
|
|
||||||
doc.save(Path.cwd() / "media" / project_path(id) / "output_dir" / r_filename)
|
|
||||||
return ChenResponse(status=200, code=200, message="文档生成成功!")
|
|
||||||
except PermissionError as e:
|
|
||||||
return ChenResponse(status=400, code=400, message="模版文件已打开,请关闭后再试,{0}".format(e))
|
|
||||||
return None
|
|
||||||
|
|
||||||
# 静态软件项
|
# 静态软件项
|
||||||
@route.get('/create/static_soft', url_name='create-static_soft')
|
@route.get('/create/static_soft', url_name='create-static_soft')
|
||||||
def create_static_soft(self, id: int):
|
def create_static_soft(self, id: int, current_round: RoundType = "0"):
|
||||||
res = self.uniform_static_dynamic_response(id, '静态软件项_2.docx', '静态软件项.docx', StaticSoftItem)
|
res = uniform_static_dynamic_response(id, '静态软件项_2.docx', '静态软件项.docx', StaticSoftItem, current_round)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -592,8 +502,11 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
|
|
||||||
# 静态硬件和固件项
|
# 静态硬件和固件项
|
||||||
@route.get('/create/static_hard', url_name='create-static_hard')
|
@route.get('/create/static_hard', url_name='create-static_hard')
|
||||||
def create_static_hard(self, id: int):
|
def create_static_hard(self, id: int, current_round: RoundType = "0"):
|
||||||
res = self.uniform_static_dynamic_response(id, '静态硬件和固件项_2.docx', '静态硬件和固件项.docx', StaticSoftHardware)
|
res = uniform_static_dynamic_response(id, '静态硬件和固件项_2.docx',
|
||||||
|
'静态硬件和固件项.docx',
|
||||||
|
StaticSoftHardware,
|
||||||
|
current_round)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -632,8 +545,8 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
|
|
||||||
# 动态软件项
|
# 动态软件项
|
||||||
@route.get('/create/dynamic_soft', url_name='create-dynamic_soft')
|
@route.get('/create/dynamic_soft', url_name='create-dynamic_soft')
|
||||||
def create_dynamic_soft(self, id: int):
|
def create_dynamic_soft(self, id: int, current_round: RoundType = "0"):
|
||||||
res = self.uniform_static_dynamic_response(id, '动态软件项_2.docx', '动态软件项.docx', DynamicSoftTable)
|
res = uniform_static_dynamic_response(id, '动态软件项_2.docx', '动态软件项.docx', DynamicSoftTable, current_round)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -650,9 +563,9 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
|
|
||||||
# 动态硬件项
|
# 动态硬件项
|
||||||
@route.get('/create/dynamic_hard', url_name='create-dynamic_hard')
|
@route.get('/create/dynamic_hard', url_name='create-dynamic_hard')
|
||||||
def create_dynamic_hard(self, id: int):
|
def create_dynamic_hard(self, id: int, current_round: RoundType = "0"):
|
||||||
res = self.uniform_static_dynamic_response(id, '动态硬件和固件项_2.docx',
|
res = uniform_static_dynamic_response(id, '动态硬件和固件项_2.docx',
|
||||||
'动态硬件和固件项.docx', DynamicHardwareTable)
|
'动态硬件和固件项.docx', DynamicHardwareTable, current_round)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@@ -667,9 +580,9 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
|
|
||||||
# 测试数据
|
# 测试数据
|
||||||
@route.get('/create/test_data', url_name='create-test_data')
|
@route.get('/create/test_data', url_name='create-test_data')
|
||||||
def create_test_data(self, id: int):
|
def create_test_data(self, id: int, current_round: RoundType = "0"):
|
||||||
res = self.uniform_static_dynamic_response(id, '测评数据_2.docx',
|
res = uniform_static_dynamic_response(id, '测评数据_2.docx',
|
||||||
'测评数据.docx', EvaluateData)
|
'测评数据.docx', EvaluateData, current_round)
|
||||||
if res is not None:
|
if res is not None:
|
||||||
return res
|
return res
|
||||||
# 老内容
|
# 老内容
|
||||||
@@ -692,7 +605,7 @@ class GenerateControllerDG(ControllerBase, FragementToolsMixin):
|
|||||||
if qs.exists():
|
if qs.exists():
|
||||||
obj = qs.first()
|
obj = qs.first()
|
||||||
table_data = obj.table
|
table_data = obj.table
|
||||||
subdoc = self.create_table_context(table_data, doc)
|
subdoc = create_table_context(table_data, doc)
|
||||||
context = {
|
context = {
|
||||||
"description": obj.description,
|
"description": obj.description,
|
||||||
"table": subdoc,
|
"table": subdoc,
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ from apps.createDocument.extensions.content_result_tool import create_influence_
|
|||||||
from apps.createSeiTaiDocument.extensions.logger import GenerateLogger
|
from apps.createSeiTaiDocument.extensions.logger import GenerateLogger
|
||||||
# 导入排序
|
# 导入排序
|
||||||
from apps.createDocument.extensions.tools import demand_sort_by_designKey
|
from apps.createDocument.extensions.tools import demand_sort_by_designKey
|
||||||
|
# 导入静态软件项、静态硬件项、动态软件项、动态硬件项、测评数据辅助函数和模型
|
||||||
|
from apps.createDocument.extensions.table_creator import uniform_static_dynamic_response, RoundType
|
||||||
|
from apps.project.models import StaticSoftItem, StaticSoftHardware, DynamicSoftTable, DynamicHardwareTable, EvaluateData
|
||||||
|
|
||||||
chinese_round_name: list = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
|
chinese_round_name: list = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
|
||||||
|
|
||||||
@@ -42,6 +45,38 @@ class GenerateControllerHSM(ControllerBase):
|
|||||||
except PermissionError:
|
except PermissionError:
|
||||||
return ChenResponse(code=400, status=400, message='另一个程序正在占用文件,请关闭后重试')
|
return ChenResponse(code=400, status=400, message='另一个程序正在占用文件,请关闭后重试')
|
||||||
|
|
||||||
|
# ~~~新增5个接口,回归测试说明的~~~
|
||||||
|
# 静态软件项
|
||||||
|
@route.get('/create/static_soft', url_name='create-static_soft-hsm')
|
||||||
|
def create_hsm_static_soft(self, id: int, current_round: RoundType = "0"):
|
||||||
|
return uniform_static_dynamic_response(id, '静态软件项_2.docx', '静态软件项.docx', StaticSoftItem, current_round, isHsm=True)
|
||||||
|
|
||||||
|
# 静态硬件和固件项
|
||||||
|
@route.get('/create/static_hard', url_name='create-static_hard-hsm')
|
||||||
|
def create_hsm_static_hard(self, id: int, current_round: RoundType = "0"):
|
||||||
|
return uniform_static_dynamic_response(id, '静态硬件和固件项_2.docx',
|
||||||
|
'静态硬件和固件项.docx',
|
||||||
|
StaticSoftHardware,
|
||||||
|
current_round)
|
||||||
|
|
||||||
|
# 动态软件项
|
||||||
|
@route.get('/create/dynamic_soft', url_name='create-dynamic_soft-hsm')
|
||||||
|
def create_hsm_dynamic_soft(self, id: int, current_round: RoundType = "0"):
|
||||||
|
return uniform_static_dynamic_response(id, '动态软件项_2.docx', '动态软件项.docx', DynamicSoftTable, current_round, isHsm=True)
|
||||||
|
|
||||||
|
# 动态硬件项
|
||||||
|
@route.get('/create/dynamic_hard', url_name='create-dynamic_hard-hsm')
|
||||||
|
def create_hsm_dynamic_hard(self, id: int, current_round: RoundType = "0"):
|
||||||
|
return uniform_static_dynamic_response(id, '动态硬件和固件项_2.docx',
|
||||||
|
'动态硬件和固件项.docx', DynamicHardwareTable, current_round, isHsm=True)
|
||||||
|
|
||||||
|
# 测试数据
|
||||||
|
@route.get('/create/test_data', url_name='create-test_data-hsm')
|
||||||
|
def create_hsm_test_data(self, id: int, current_round: RoundType = "0"):
|
||||||
|
return uniform_static_dynamic_response(id, '测评数据_2.docx',
|
||||||
|
'测评数据.docx', EvaluateData, current_round, isHsm=True)
|
||||||
|
|
||||||
|
# ~~~5个接口:end~~~
|
||||||
@route.get("/create/basicInformation", url_name="create-basicInformation")
|
@route.get("/create/basicInformation", url_name="create-basicInformation")
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def create_basicInformation(self, id: int):
|
def create_basicInformation(self, id: int):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,7 @@ from datetime import timedelta, date
|
|||||||
from apps.project.models import Project
|
from apps.project.models import Project
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from ninja.errors import HttpError # 从代码抛出该异常,被ninja截取变为response
|
from ninja.errors import HttpError # 从代码抛出该异常,被ninja截取变为response
|
||||||
|
from utils.codes import PROJECT_ENDTIME_ERROR_CODE
|
||||||
|
|
||||||
def format_remove_heng(dateT: date) -> str:
|
def format_remove_heng(dateT: date) -> str:
|
||||||
"""该函数将date对象的横杠-去掉,输出str"""
|
"""该函数将date对象的横杠-去掉,输出str"""
|
||||||
@@ -201,7 +202,8 @@ class DocTime:
|
|||||||
cover_time = self.p_end
|
cover_time = self.p_end
|
||||||
# 这里做判断,如果项目结束时间/最后一轮结束时间
|
# 这里做判断,如果项目结束时间/最后一轮结束时间
|
||||||
if cover_time < self.round_time[-1]['end']:
|
if cover_time < self.round_time[-1]['end']:
|
||||||
raise HttpError(500, message='项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
# 注意系统对HttpError异常重新处理,所以该处status_code看api.py文件
|
||||||
|
raise HttpError(PROJECT_ENDTIME_ERROR_CODE, message='项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
context = times_by_cover_time(cover_time)
|
context = times_by_cover_time(cover_time)
|
||||||
context.update(cover_time=cover_time.strftime("%Y年%m月%d日"))
|
context.update(cover_time=cover_time.strftime("%Y年%m月%d日"))
|
||||||
return context
|
return context
|
||||||
|
|||||||
146
apps/createDocument/extensions/table_creator.py
Normal file
146
apps/createDocument/extensions/table_creator.py
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from typing import Literal
|
||||||
|
from docxtpl import DocxTemplate
|
||||||
|
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
||||||
|
from docx.enum.table import WD_ALIGN_VERTICAL
|
||||||
|
from docx.oxml.ns import qn
|
||||||
|
from docx.shared import Mm
|
||||||
|
from apps.createDocument.extensions.tools import set_table_border_by_cell_position, set_cell_margins
|
||||||
|
from utils.path_utils import project_path
|
||||||
|
from utils.chen_response import ChenResponse
|
||||||
|
from django.shortcuts import get_object_or_404
|
||||||
|
from apps.project.models import Project, Round
|
||||||
|
from django.db.models import QuerySet
|
||||||
|
|
||||||
|
# 创建当前轮次别名
|
||||||
|
RoundType = Literal["0", "not0", "last"]
|
||||||
|
chinese_round_name: list = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
|
||||||
|
|
||||||
|
# 通用生成静态软件项、静态硬件项、动态软件项、动态硬件信息、测评数据的context,包含fontnote和table
|
||||||
|
def create_table_context(table_data: list[list[str]], doc: DocxTemplate, rounds_map: list[list[str]] = None,
|
||||||
|
current_round: str = None):
|
||||||
|
"""
|
||||||
|
注意:该函数会增加一列序号列,并且支持单元格内回车换行(段落换行)
|
||||||
|
传入当前轮次以及rounds_map来过滤一些其他轮次的数据,为None则不过滤
|
||||||
|
"""
|
||||||
|
# 过滤数据处理
|
||||||
|
if rounds_map is not None and current_round is not None and current_round != 'last':
|
||||||
|
filtered_data = []
|
||||||
|
for i, row in enumerate(table_data):
|
||||||
|
# 第一行作为表头,始终保留
|
||||||
|
if i == 0:
|
||||||
|
filtered_data.append(row)
|
||||||
|
else:
|
||||||
|
# 检查该行是否属于当前轮次
|
||||||
|
if current_round in rounds_map[i]:
|
||||||
|
filtered_data.append(row)
|
||||||
|
# table_data先替换后再执行下方生成表格
|
||||||
|
table_data = filtered_data
|
||||||
|
|
||||||
|
subdoc = doc.new_subdoc()
|
||||||
|
rows = len(table_data)
|
||||||
|
cols = len(table_data[0]) + 1
|
||||||
|
table = subdoc.add_table(rows=rows, cols=cols)
|
||||||
|
|
||||||
|
# 单元格处理
|
||||||
|
for row in range(rows):
|
||||||
|
for col in range(cols):
|
||||||
|
cell = table.cell(row, col) # 从上倒下,从左到右取cell
|
||||||
|
set_cell_margins(cell, left=100, right=100, top=100, bottom=100)
|
||||||
|
|
||||||
|
# 获取要显示的文本内容(字符串或按行拆分后的列表)
|
||||||
|
if col == 0:
|
||||||
|
# 序号列
|
||||||
|
lines = ["序号"] if row == 0 else [str(row)]
|
||||||
|
else:
|
||||||
|
raw_text = table_data[row][col - 1]
|
||||||
|
# 按换行符 \n 拆分为多个段落
|
||||||
|
lines = raw_text.split('\n') if raw_text else ['']
|
||||||
|
|
||||||
|
# 清空单元格原有段落(add_table 默认有一个段落)
|
||||||
|
cell.text = ""
|
||||||
|
# 删除默认段落,稍后统一添加
|
||||||
|
for para in cell.paragraphs:
|
||||||
|
p = para._element
|
||||||
|
p.getparent().remove(p)
|
||||||
|
|
||||||
|
# 逐个添加段落
|
||||||
|
for i, line in enumerate(lines):
|
||||||
|
if i == 0:
|
||||||
|
para = cell.add_paragraph(line)
|
||||||
|
else:
|
||||||
|
para = cell.add_paragraph(line)
|
||||||
|
|
||||||
|
# 设置段落对齐(第一列居中,其他左对齐,可根据需要调整)
|
||||||
|
if col == 0:
|
||||||
|
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||||
|
else:
|
||||||
|
para.alignment = WD_ALIGN_PARAGRAPH.LEFT
|
||||||
|
|
||||||
|
# 对第一行(表头)设置黑体字体
|
||||||
|
if row == 0:
|
||||||
|
for run in para.runs:
|
||||||
|
run.font.name = '黑体'
|
||||||
|
run._element.rPr.rFonts.set(qn('w:eastAsia'), '黑体')
|
||||||
|
run.font.bold = False
|
||||||
|
# 表头段落居中(覆盖前面的 left)
|
||||||
|
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||||
|
|
||||||
|
# 垂直居中
|
||||||
|
cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER
|
||||||
|
|
||||||
|
# 设置序号列宽度
|
||||||
|
for cell in table.columns[0].cells:
|
||||||
|
cell.width = Mm(15)
|
||||||
|
for para in cell.paragraphs:
|
||||||
|
para.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||||
|
|
||||||
|
# 表格居中
|
||||||
|
table.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||||
|
# 设置表格外边框
|
||||||
|
set_table_border_by_cell_position(table)
|
||||||
|
return subdoc
|
||||||
|
|
||||||
|
# 统一静态软件项、静态硬件项、动态软件项、动态硬件信息、测评数据5个的word生成 - 模版模式
|
||||||
|
def uniform_static_dynamic_response(id: int, filename: str, r_filename: str, model,
|
||||||
|
current_round: str = "0", isHsm: bool = None) -> ChenResponse | None:
|
||||||
|
""" 通过形参isHsm判断是否是回归测试说明 """
|
||||||
|
project_obj = get_object_or_404(Project, id=id)
|
||||||
|
input_path = Path.cwd() / 'media' / project_path(id) / 'form_template' / 'dg' / filename # 取相同模版
|
||||||
|
doc = DocxTemplate(input_path)
|
||||||
|
qs = model.objects.filter(project=project_obj)
|
||||||
|
if qs.exists():
|
||||||
|
obj = qs.first()
|
||||||
|
table_data = obj.table
|
||||||
|
# 回归测试说明生成多轮次回归测试说明的5个接口分支
|
||||||
|
if isHsm:
|
||||||
|
hround_list: QuerySet[Round] = project_obj.pField.exclude(key='0')
|
||||||
|
for hround in hround_list:
|
||||||
|
round_key = hround.key
|
||||||
|
cname = chinese_round_name[int(round_key)] # 取中文:一、二、三...
|
||||||
|
# key就是current_round,这里就解决文件名和那个的问题
|
||||||
|
subdoc = create_table_context(table_data, doc, obj.rounds_map, round_key)
|
||||||
|
context = {
|
||||||
|
'fontnote': obj.fontnote,
|
||||||
|
'table': subdoc,
|
||||||
|
}
|
||||||
|
doc.render(context, autoescape=True)
|
||||||
|
try:
|
||||||
|
doc.save(Path.cwd() / "media" / project_path(id) / "output_dir/hsm" / "".join([f"第{cname}轮", r_filename]))
|
||||||
|
except PermissionError as e:
|
||||||
|
return ChenResponse(status=400, code=400, message="模版文件已打开,请关闭后再试,{0}".format(e))
|
||||||
|
return ChenResponse(status=200,code=200,message="多个轮次5接口渲染完毕,文档生成完毕")
|
||||||
|
|
||||||
|
# 新增:传入rounds_map进行渲染
|
||||||
|
subdoc = create_table_context(table_data, doc, obj.rounds_map, current_round)
|
||||||
|
context = {
|
||||||
|
'fontnote': obj.fontnote,
|
||||||
|
'table': subdoc,
|
||||||
|
}
|
||||||
|
doc.render(context, autoescape=True)
|
||||||
|
try:
|
||||||
|
doc.save(Path.cwd() / "media" / project_path(id) / "output_dir" / r_filename)
|
||||||
|
return ChenResponse(status=200, code=200, message="文档生成成功!")
|
||||||
|
except PermissionError as e:
|
||||||
|
return ChenResponse(status=400, code=400, message="模版文件已打开,请关闭后再试,{0}".format(e))
|
||||||
|
return None
|
||||||
Binary file not shown.
Binary file not shown.
@@ -460,7 +460,12 @@ class ProjectController(ControllerBase):
|
|||||||
item_qs = self.get_model_from_category(category).objects.filter(project=project_obj)
|
item_qs = self.get_model_from_category(category).objects.filter(project=project_obj)
|
||||||
if item_qs.exists():
|
if item_qs.exists():
|
||||||
item_obj = item_qs.first()
|
item_obj = item_qs.first()
|
||||||
return ChenResponse(status=200, code=25001, data={"table": item_obj.table, "fontnote": item_obj.fontnote})
|
if item_obj:
|
||||||
|
return ChenResponse(status=200, code=25001, data={
|
||||||
|
"table": item_obj.table,
|
||||||
|
"fontnote": item_obj.fontnote,
|
||||||
|
"rounds": item_obj.rounds_map or []
|
||||||
|
})
|
||||||
return ChenResponse(status=200, code=25002, data=None)
|
return ChenResponse(status=200, code=25002, data=None)
|
||||||
|
|
||||||
# ~~~静态软件项、静态硬件项、动态软件项、动态硬件项、测评数据 - 新增或修改~~~
|
# ~~~静态软件项、静态硬件项、动态软件项、动态硬件项、测评数据 - 新增或修改~~~
|
||||||
@@ -470,10 +475,21 @@ class ProjectController(ControllerBase):
|
|||||||
project_obj = self.get_project_by_id(data.id)
|
project_obj = self.get_project_by_id(data.id)
|
||||||
model = self.get_model_from_category(data.category)
|
model = self.get_model_from_category(data.category)
|
||||||
item_qs = model.objects.filter(project=project_obj)
|
item_qs = model.objects.filter(project=project_obj)
|
||||||
|
# 处理rounds_map
|
||||||
|
rounds = data.rounds
|
||||||
|
if rounds is None:
|
||||||
|
rounds = [["0"]] * len(data.table)
|
||||||
|
|
||||||
if item_qs.exists():
|
if item_qs.exists():
|
||||||
# 如果存在则修改
|
# 如果存在则修改
|
||||||
item_qs.delete()
|
item_qs.delete()
|
||||||
model.objects.create(project=project_obj, table=data.table, fontnote=data.fontnote)
|
model.objects.create(
|
||||||
|
project=project_obj,
|
||||||
|
table=data.table,
|
||||||
|
fontnote=data.fontnote,
|
||||||
|
rounds_map=rounds,
|
||||||
|
)
|
||||||
|
return ChenResponse(status=200, code=20000, message="保存成功")
|
||||||
|
|
||||||
# ~~~环境差异性分析 - 获取~~~
|
# ~~~环境差异性分析 - 获取~~~
|
||||||
@route.get("/get_env_analysis/")
|
@route.get("/get_env_analysis/")
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# Generated by Django 6.0.4 on 2026-04-23 18:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('project', '0035_design_is_bidirectional'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='dynamichardwaretable',
|
||||||
|
name='rounds_map',
|
||||||
|
field=models.JSONField(blank=True, default=list, help_text='二维数组,每个内层数组是该行选中的轮次索引(字符串)', verbose_name='轮次数据'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='dynamicsofttable',
|
||||||
|
name='rounds_map',
|
||||||
|
field=models.JSONField(blank=True, default=list, help_text='二维数组,每个内层数组是该行选中的轮次索引(字符串)', verbose_name='轮次数据'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='evaluatedata',
|
||||||
|
name='rounds_map',
|
||||||
|
field=models.JSONField(blank=True, default=list, help_text='二维数组,每个内层数组是该行选中的轮次索引(字符串)', verbose_name='轮次数据'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='staticsofthardware',
|
||||||
|
name='rounds_map',
|
||||||
|
field=models.JSONField(blank=True, default=list, help_text='二维数组,每个内层数组是该行选中的轮次索引(字符串)', verbose_name='轮次数据'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='project',
|
||||||
|
name='beginTime',
|
||||||
|
field=models.DateField(blank=True, help_text='开始时间', null=True, verbose_name='开始时间'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='project',
|
||||||
|
name='endTime',
|
||||||
|
field=models.DateField(blank=True, help_text='结束时间', null=True, verbose_name='结束时间'),
|
||||||
|
),
|
||||||
|
]
|
||||||
18
apps/project/migrations/0037_staticsoftitem_rounds_map.py
Normal file
18
apps/project/migrations/0037_staticsoftitem_rounds_map.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 6.0.4 on 2026-04-23 18:19
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('project', '0036_dynamichardwaretable_rounds_map_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='staticsoftitem',
|
||||||
|
name='rounds_map',
|
||||||
|
field=models.JSONField(blank=True, default=list, help_text='二维数组,每个内层数组是该行选中的轮次索引(字符串)', verbose_name='轮次数据'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Binary file not shown.
Binary file not shown.
@@ -499,6 +499,12 @@ class StaticSoftItem(models.Model):
|
|||||||
verbose_name="关联项目", help_text="关联项目")
|
verbose_name="关联项目", help_text="关联项目")
|
||||||
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
||||||
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
||||||
|
rounds_map = models.JSONField(
|
||||||
|
verbose_name="轮次数据",
|
||||||
|
help_text="二维数组,每个内层数组是该行选中的轮次索引(字符串)",
|
||||||
|
default=list,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'project_static_soft_item'
|
db_table = 'project_static_soft_item'
|
||||||
@@ -511,6 +517,12 @@ class StaticSoftHardware(models.Model):
|
|||||||
verbose_name="关联项目", help_text="关联项目")
|
verbose_name="关联项目", help_text="关联项目")
|
||||||
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
||||||
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
||||||
|
rounds_map = models.JSONField(
|
||||||
|
verbose_name="轮次数据",
|
||||||
|
help_text="二维数组,每个内层数组是该行选中的轮次索引(字符串)",
|
||||||
|
default=list,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'project_static_hardware'
|
db_table = 'project_static_hardware'
|
||||||
@@ -523,6 +535,12 @@ class DynamicSoftTable(models.Model):
|
|||||||
verbose_name="关联项目", help_text="关联项目")
|
verbose_name="关联项目", help_text="关联项目")
|
||||||
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
||||||
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
||||||
|
rounds_map = models.JSONField(
|
||||||
|
verbose_name="轮次数据",
|
||||||
|
help_text="二维数组,每个内层数组是该行选中的轮次索引(字符串)",
|
||||||
|
default=list,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'project_dynamic_soft_item'
|
db_table = 'project_dynamic_soft_item'
|
||||||
@@ -535,6 +553,12 @@ class DynamicHardwareTable(models.Model):
|
|||||||
verbose_name="关联项目", help_text="关联项目")
|
verbose_name="关联项目", help_text="关联项目")
|
||||||
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
||||||
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
||||||
|
rounds_map = models.JSONField(
|
||||||
|
verbose_name="轮次数据",
|
||||||
|
help_text="二维数组,每个内层数组是该行选中的轮次索引(字符串)",
|
||||||
|
default=list,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'project_dynamic_hardware'
|
db_table = 'project_dynamic_hardware'
|
||||||
@@ -547,6 +571,12 @@ class EvaluateData(models.Model):
|
|||||||
verbose_name="关联项目", help_text="关联项目")
|
verbose_name="关联项目", help_text="关联项目")
|
||||||
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
table = models.JSONField(verbose_name="储存表格二维数组", help_text="储存表格二维数组", default=default_json_value)
|
||||||
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
fontnote = models.CharField(max_length=256, null=True, default="", verbose_name="题注", help_text="数据的题注说明")
|
||||||
|
rounds_map = models.JSONField(
|
||||||
|
verbose_name="轮次数据",
|
||||||
|
help_text="二维数组,每个内层数组是该行选中的轮次索引(字符串)",
|
||||||
|
default=list,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'project_evaluate_data'
|
db_table = 'project_evaluate_data'
|
||||||
|
|||||||
Binary file not shown.
@@ -62,6 +62,7 @@ class StaticDynamicData(Schema):
|
|||||||
category: str
|
category: str
|
||||||
table: list[list[str]]
|
table: list[list[str]]
|
||||||
fontnote: Optional[str] = ""
|
fontnote: Optional[str] = ""
|
||||||
|
rounds: Optional[List[List[str]]] = None # 允许不传递
|
||||||
|
|
||||||
# ~~~环境差异性分析~~~
|
# ~~~环境差异性分析~~~
|
||||||
class EnvAnalysisSchema(Schema):
|
class EnvAnalysisSchema(Schema):
|
||||||
|
|||||||
Binary file not shown.
@@ -1,9 +1,12 @@
|
|||||||
from utils.chen_ninja import ChenNinjaAPI
|
from utils.chen_ninja import ChenNinjaAPI
|
||||||
|
from ninja.errors import HttpError
|
||||||
# 导入orjson解析器,渲染器,提升性能
|
# 导入orjson解析器,渲染器,提升性能
|
||||||
from cdtestplant_v1.parser import MyParser
|
from cdtestplant_v1.parser import MyParser
|
||||||
from cdtestplant_v1.renderer import MyRenderer
|
from cdtestplant_v1.renderer import MyRenderer
|
||||||
# swagger-ui配置
|
# swagger-ui配置
|
||||||
from ninja import Swagger
|
from ninja import Swagger
|
||||||
|
# 错误码
|
||||||
|
from utils.codes import PROJECT_ENDTIME_ERROR_CODE
|
||||||
|
|
||||||
api = ChenNinjaAPI(
|
api = ChenNinjaAPI(
|
||||||
title="测试管理平台API",
|
title="测试管理平台API",
|
||||||
@@ -14,5 +17,14 @@ api = ChenNinjaAPI(
|
|||||||
docs=Swagger({"persistAuthorization": True})
|
docs=Swagger({"persistAuthorization": True})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 捕获HttpError - 注意这种方式不过create_response函数,需自己定义
|
||||||
|
@api.exception_handler(HttpError)
|
||||||
|
def in_program_exception_handler(request, exc):
|
||||||
|
# HttpError的status_code这里处理为自定义码,而非HTTP协议的
|
||||||
|
data = {}
|
||||||
|
if exc.status_code is PROJECT_ENDTIME_ERROR_CODE:
|
||||||
|
data['flag'] = PROJECT_ENDTIME_ERROR_CODE
|
||||||
|
return api.create_response(request, status=500, message=exc.message, data=data)
|
||||||
|
|
||||||
# 自动寻找每个app下面controllers.py中被@api_controller修饰的类
|
# 自动寻找每个app下面controllers.py中被@api_controller修饰的类
|
||||||
api.auto_discover_controllers()
|
api.auto_discover_controllers()
|
||||||
|
|||||||
342
logs/root_log
342
logs/root_log
@@ -1,27 +1,5 @@
|
|||||||
[WARNING][2026-04-22 09:45:35,603][log.py:249]Unauthorized: /api/system/getInfo
|
[WARNING][2026-04-23 15:28:58,739][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
[WARNING][2026-04-22 09:45:35,677][log.py:249]Unauthorized: /api/system/logout
|
[ERROR][2026-04-23 15:28:58,748][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
[WARNING][2026-04-22 09:45:39,967][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
|
||||||
[WARNING][2026-04-22 11:03:49,239][operation.py:136]"PUT - DesignController[update_design] /api/project/editDesignDemand/4030" (1048, "Column 'is_bidirectional' cannot be null")
|
|
||||||
[ERROR][2026-04-22 11:03:49,239][errors.py:131](1048, "Column 'is_bidirectional' cannot be null")
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
|
|
||||||
return self.cursor.execute(sql, params)
|
|
||||||
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\mysql\base.py", line 78, in execute
|
|
||||||
return self.cursor.execute(query, args)
|
|
||||||
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
|
||||||
res = self._query(mogrified_query)
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
|
||||||
db.query(q)
|
|
||||||
~~~~~~~~^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\connections.py", line 286, in query
|
|
||||||
_mysql.connection.query(self, query)
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
MySQLdb.IntegrityError: (1048, "Column 'is_bidirectional' cannot be null")
|
|
||||||
|
|
||||||
The above exception was the direct cause of the following exception:
|
|
||||||
|
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
@@ -31,79 +9,43 @@ Traceback (most recent call last):
|
|||||||
)
|
)
|
||||||
File "D:\programs\uv\python\cpython-3.13.11-windows-x86_64-none\Lib\contextlib.py", line 85, in inner
|
File "D:\programs\uv\python\cpython-3.13.11-windows-x86_64-none\Lib\contextlib.py", line 85, in inner
|
||||||
return func(*args, **kwds)
|
return func(*args, **kwds)
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\apps\project\controllers\design.py", line 148, in update_design
|
File "E:\pycharmProjects\cdtestplant_v1\apps\project\controllers\project.py", line 271, in document_time_show
|
||||||
design_qs.save()
|
time = time_return_to(id)
|
||||||
~~~~~~~~~~~~~~^^
|
File "E:\pycharmProjects\cdtestplant_v1\apps\project\tool\timeList.py", line 94, in time_return_to
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\base.py", line 874, in save
|
temp_dict = time_parser.bg_final_time()
|
||||||
self.save_base(
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\extensions\documentTime.py", line 206, in bg_final_time
|
||||||
~~~~~~~~~~~~~~^
|
raise HttpError(PROJECT_ENDTIME_ERROR_CODE, message='项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
using=using,
|
ninja.errors.HttpError: 项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间
|
||||||
^^^^^^^^^^^^
|
|
||||||
...<2 lines>...
|
During handling of the above exception, another exception occurred:
|
||||||
update_fields=update_fields,
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
Traceback (most recent call last):
|
||||||
)
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
|
||||||
^
|
response = get_response(request)
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\base.py", line 966, in save_base
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\core\handlers\base.py", line 198, in _get_response
|
||||||
updated = self._save_table(
|
response = wrapped_callback(request, *callback_args, **callback_kwargs)
|
||||||
raw,
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\operation.py", line 661, in sync_view_wrapper
|
||||||
...<4 lines>...
|
return self._sync_view(request, *args, **kwargs)
|
||||||
update_fields,
|
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
)
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 322, in _sync_view
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\base.py", line 1110, in _save_table
|
return super(PathView, self)._sync_view(request, *args, **kwargs)
|
||||||
results = self._do_update(
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
base_qs,
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\operation.py", line 673, in _sync_view
|
||||||
...<5 lines>...
|
return operation.run(request, *a, **kw)
|
||||||
returning_fields,
|
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
|
||||||
)
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 231, in run
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\base.py", line 1213, in _do_update
|
return self.api.on_exception(request, e)
|
||||||
return filtered._update(values, returning_fields)
|
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
|
||||||
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\main.py", line 617, in on_exception
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\query.py", line 1327, in _update
|
return handler(request, exc)
|
||||||
return query.get_compiler(self.db).execute_returning_sql(returning_fields)
|
File "E:\pycharmProjects\cdtestplant_v1\cdtestplant_v1\api.py", line 24, in in_program_exception_handler
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
|
if exc.detail is PROJECT_ENDTIME_ERROR_CODE:
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 2140, in execute_returning_sql
|
^^^^^^^^^^
|
||||||
row_count = self.execute_sql(ROW_COUNT)
|
AttributeError: 'HttpError' object has no attribute 'detail'
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 2111, in execute_sql
|
[WARNING][2026-04-23 15:29:14,430][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
row_count = super().execute_sql(result_type)
|
[ERROR][2026-04-23 15:29:14,438][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\sql\compiler.py", line 1624, in execute_sql
|
[WARNING][2026-04-23 15:30:11,756][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
cursor.execute(sql, params)
|
[ERROR][2026-04-23 15:30:11,772][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 122, in execute
|
|
||||||
return super().execute(sql, params)
|
|
||||||
~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 79, in execute
|
|
||||||
return self._execute_with_wrappers(
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
|
||||||
sql, params, many=False, executor=self._execute
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
)
|
|
||||||
^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 92, in _execute_with_wrappers
|
|
||||||
return executor(sql, params, many, context)
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 100, in _execute
|
|
||||||
with self.db.wrap_database_errors:
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\utils.py", line 94, in __exit__
|
|
||||||
raise dj_exc_value.with_traceback(traceback) from exc_value
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\utils.py", line 105, in _execute
|
|
||||||
return self.cursor.execute(sql, params)
|
|
||||||
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\backends\mysql\base.py", line 78, in execute
|
|
||||||
return self.cursor.execute(query, args)
|
|
||||||
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
|
||||||
res = self._query(mogrified_query)
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
|
||||||
db.query(q)
|
|
||||||
~~~~~~~~^^^
|
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\MySQLdb\connections.py", line 286, in query
|
|
||||||
_mysql.connection.query(self, query)
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
|
|
||||||
django.db.utils.IntegrityError: (1048, "Column 'is_bidirectional' cannot be null")
|
|
||||||
[ERROR][2026-04-22 11:03:49,254][log.py:249]Internal Server Error: /api/project/editDesignDemand/4030
|
|
||||||
[WARNING][2026-04-22 11:23:22,342][operation.py:136]"POST - DesignController[create_design] /api/project/designDemand/save" ("Design() got unexpected keyword arguments: 'forward_source', 'forward_destination', 'forward_description', 'reverse_source', 'reverse_destination', 'reverse_description'",)
|
|
||||||
[ERROR][2026-04-22 11:23:22,342][errors.py:131]Design() got unexpected keyword arguments: 'forward_source', 'forward_destination', 'forward_description', 'reverse_source', 'reverse_destination', 'reverse_description'
|
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
@@ -113,21 +55,88 @@ Traceback (most recent call last):
|
|||||||
)
|
)
|
||||||
File "D:\programs\uv\python\cpython-3.13.11-windows-x86_64-none\Lib\contextlib.py", line 85, in inner
|
File "D:\programs\uv\python\cpython-3.13.11-windows-x86_64-none\Lib\contextlib.py", line 85, in inner
|
||||||
return func(*args, **kwds)
|
return func(*args, **kwds)
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\apps\project\controllers\design.py", line 116, in create_design
|
File "E:\pycharmProjects\cdtestplant_v1\apps\project\controllers\project.py", line 271, in document_time_show
|
||||||
qs = Design.objects.create(**asert_dict)
|
time = time_return_to(id)
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\manager.py", line 87, in manager_method
|
File "E:\pycharmProjects\cdtestplant_v1\apps\project\tool\timeList.py", line 94, in time_return_to
|
||||||
return getattr(self.get_queryset(), name)(*args, **kwargs)
|
temp_dict = time_parser.bg_final_time()
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\extensions\documentTime.py", line 206, in bg_final_time
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\query.py", line 667, in create
|
raise HttpError(PROJECT_ENDTIME_ERROR_CODE, message='项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
obj = self.model(**kwargs)
|
ninja.errors.HttpError: 项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\db\models\base.py", line 590, in __init__
|
|
||||||
raise TypeError(
|
During handling of the above exception, another exception occurred:
|
||||||
...<2 lines>...
|
|
||||||
)
|
Traceback (most recent call last):
|
||||||
TypeError: Design() got unexpected keyword arguments: 'forward_source', 'forward_destination', 'forward_description', 'reverse_source', 'reverse_destination', 'reverse_description'
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\core\handlers\exception.py", line 55, in inner
|
||||||
[ERROR][2026-04-22 11:23:22,347][log.py:249]Internal Server Error: /api/project/designDemand/save
|
response = get_response(request)
|
||||||
[WARNING][2026-04-22 13:13:59,640][operation.py:136]"GET - GenerateControllerDG[create_interface] /api/generate/create/interface" ("'Design' object has no attribute 'source'",)
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\django\core\handlers\base.py", line 198, in _get_response
|
||||||
[ERROR][2026-04-22 13:13:59,640][errors.py:131]'Design' object has no attribute 'source'
|
response = wrapped_callback(request, *callback_args, **callback_kwargs)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\operation.py", line 661, in sync_view_wrapper
|
||||||
|
return self._sync_view(request, *args, **kwargs)
|
||||||
|
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 322, in _sync_view
|
||||||
|
return super(PathView, self)._sync_view(request, *args, **kwargs)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\operation.py", line 673, in _sync_view
|
||||||
|
return operation.run(request, *a, **kw)
|
||||||
|
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 231, in run
|
||||||
|
return self.api.on_exception(request, e)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja\main.py", line 617, in on_exception
|
||||||
|
return handler(request, exc)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\cdtestplant_v1\api.py", line 26, in in_program_exception_handler
|
||||||
|
return api.create_response(request, status=500, message=exc.message)
|
||||||
|
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
TypeError: ChenNinjaAPI.create_response() missing 1 required positional argument: 'data'
|
||||||
|
[WARNING][2026-04-23 15:31:00,940][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:31:00,948][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:31:09,568][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:31:09,578][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:34:41,469][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:34:41,477][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:34:45,816][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:34:45,824][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:34:50,470][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:34:50,480][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:34:55,380][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:34:55,388][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:34:58,806][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:34:58,814][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:35:14,656][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:35:14,664][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:35:41,998][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:35:42,007][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:38:50,737][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:38:50,745][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:43:24,757][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:43:24,765][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:44:02,062][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:44:02,071][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:44:21,790][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:44:21,798][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:44:32,220][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:44:32,227][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:46:42,165][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:46:42,174][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:47:01,501][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:47:01,509][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:47:40,712][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:47:40,722][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:47:43,095][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:47:43,103][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:53:49,660][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:53:49,667][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:54:00,089][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:54:00,097][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:56:58,912][operation.py:136]"GET - ProjectController[document_time_show] /api/testmanage/project/document_time_show" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:56:58,918][log.py:249]Internal Server Error: /api/testmanage/project/document_time_show
|
||||||
|
[WARNING][2026-04-23 15:58:44,243][operation.py:136]"POST - GenerateSeitaiController[create_bgDocument] /api/create/bgDocument" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-23 15:58:44,244][log.py:249]Internal Server Error: /api/create/bgDocument
|
||||||
|
[WARNING][2026-04-24 13:56:12,151][log.py:249]Unauthorized: /api/system/getInfo
|
||||||
|
[WARNING][2026-04-24 13:56:12,209][log.py:249]Unauthorized: /api/system/logout
|
||||||
|
[WARNING][2026-04-24 13:56:16,702][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []})
|
||||||
|
[WARNING][2026-04-24 14:06:28,243][operation.py:136]"GET - GenerateControllerDG[create_static_soft] /api/generate/create/static_soft" ('GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given',)
|
||||||
|
[ERROR][2026-04-24 14:06:28,243][errors.py:131]GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
@@ -135,8 +144,107 @@ Traceback (most recent call last):
|
|||||||
result = self.route.view_func(
|
result = self.route.view_func(
|
||||||
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
)
|
)
|
||||||
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 417, in create_interface
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 581, in create_static_soft
|
||||||
'source': interface.source,
|
res = self.uniform_static_dynamic_response(id, '静态软件项_2.docx', '静态软件项.docx', StaticSoftItem)
|
||||||
^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
AttributeError: 'Design' object has no attribute 'source'
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 565, in uniform_static_dynamic_response
|
||||||
[ERROR][2026-04-22 13:13:59,650][log.py:249]Internal Server Error: /api/generate/create/interface
|
subdoc = cls.create_table_context(table_data, doc, obj.rounds_map)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
[ERROR][2026-04-24 14:06:28,258][log.py:249]Internal Server Error: /api/generate/create/static_soft
|
||||||
|
[WARNING][2026-04-24 14:06:28,259][operation.py:136]"GET - GenerateControllerDG[create_static_hard] /api/generate/create/static_hard" ('GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given',)
|
||||||
|
[ERROR][2026-04-24 14:06:28,274][errors.py:131]GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 597, in create_static_hard
|
||||||
|
res = self.uniform_static_dynamic_response(id, '静态硬件和固件项_2.docx', '静态硬件和固件项.docx', StaticSoftHardware)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 565, in uniform_static_dynamic_response
|
||||||
|
subdoc = cls.create_table_context(table_data, doc, obj.rounds_map)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
[ERROR][2026-04-24 14:06:28,278][log.py:249]Internal Server Error: /api/generate/create/static_hard
|
||||||
|
[WARNING][2026-04-24 14:06:28,316][operation.py:136]"GET - GenerateControllerDG[create_dynamic_soft] /api/generate/create/dynamic_soft" ('GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given',)
|
||||||
|
[ERROR][2026-04-24 14:06:28,316][errors.py:131]GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 637, in create_dynamic_soft
|
||||||
|
res = self.uniform_static_dynamic_response(id, '动态软件项_2.docx', '动态软件项.docx', DynamicSoftTable)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 565, in uniform_static_dynamic_response
|
||||||
|
subdoc = cls.create_table_context(table_data, doc, obj.rounds_map)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
[ERROR][2026-04-24 14:06:28,319][log.py:249]Internal Server Error: /api/generate/create/dynamic_soft
|
||||||
|
[WARNING][2026-04-24 14:06:28,324][operation.py:136]"GET - GenerateControllerDG[create_test_data] /api/generate/create/test_data" ('GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given',)
|
||||||
|
[WARNING][2026-04-24 14:06:28,324][operation.py:136]"GET - GenerateControllerDG[create_dynamic_hard] /api/generate/create/dynamic_hard" ('GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given',)
|
||||||
|
[ERROR][2026-04-24 14:06:28,326][errors.py:131]GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 672, in create_test_data
|
||||||
|
res = self.uniform_static_dynamic_response(id, '测评数据_2.docx',
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
'测评数据.docx', EvaluateData)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 565, in uniform_static_dynamic_response
|
||||||
|
subdoc = cls.create_table_context(table_data, doc, obj.rounds_map)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
[ERROR][2026-04-24 14:06:28,326][errors.py:131]GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 655, in create_dynamic_hard
|
||||||
|
res = self.uniform_static_dynamic_response(id, '动态硬件和固件项_2.docx',
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
'动态硬件和固件项.docx', DynamicHardwareTable)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 565, in uniform_static_dynamic_response
|
||||||
|
subdoc = cls.create_table_context(table_data, doc, obj.rounds_map)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() takes 3 positional arguments but 4 were given
|
||||||
|
[ERROR][2026-04-24 14:06:28,336][log.py:249]Internal Server Error: /api/generate/create/dynamic_hard
|
||||||
|
[ERROR][2026-04-24 14:06:28,336][log.py:249]Internal Server Error: /api/generate/create/test_data
|
||||||
|
[WARNING][2026-04-24 14:09:36,188][operation.py:136]"GET - GenerateControllerDG[create_env_diff] /api/generate/create/env_diff" ("GenerateControllerDG.create_table_context() missing 1 required positional argument: 'rounds_map'",)
|
||||||
|
[ERROR][2026-04-24 14:09:36,188][errors.py:131]GenerateControllerDG.create_table_context() missing 1 required positional argument: 'rounds_map': Did you fail to use functools.wraps() in a decorator?
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 697, in create_env_diff
|
||||||
|
subdoc = self.create_table_context(table_data, doc)
|
||||||
|
TypeError: GenerateControllerDG.create_table_context() missing 1 required positional argument: 'rounds_map': Did you fail to use functools.wraps() in a decorator?
|
||||||
|
[ERROR][2026-04-24 14:09:36,192][log.py:249]Internal Server Error: /api/generate/create/env_diff
|
||||||
|
[WARNING][2026-04-24 14:43:28,969][operation.py:136]"POST - GenerateSeitaiController[create_bgDocument] /api/create/bgDocument" (500412, '项目结束时间早于最后一轮次结束时间或等于开始时间,请修改项目结束时间')
|
||||||
|
[ERROR][2026-04-24 14:43:28,969][log.py:249]Internal Server Error: /api/create/bgDocument
|
||||||
|
[WARNING][2026-04-24 15:11:55,484][operation.py:136]"GET - GenerateControllerDG[create_env_diff] /api/generate/create/env_diff" ("'GenerateControllerDG' object has no attribute 'create_table_context'",)
|
||||||
|
[ERROR][2026-04-24 15:11:55,484][errors.py:131]'GenerateControllerDG' object has no attribute 'create_table_context'
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\operation.py", line 217, in run
|
||||||
|
result = self.view_func(request, **ctx.kwargs["view_func_kwargs"])
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\.venv\Lib\site-packages\ninja_extra\controllers\route\route_functions.py", line 108, in as_view
|
||||||
|
result = self.route.view_func(
|
||||||
|
ctx.controller_instance, *args, **ctx.view_func_kwargs
|
||||||
|
)
|
||||||
|
File "E:\pycharmProjects\cdtestplant_v1\apps\createDocument\controllers\dg.py", line 633, in create_env_diff
|
||||||
|
subdoc = self.create_table_context(table_data, doc)
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
AttributeError: 'GenerateControllerDG' object has no attribute 'create_table_context'
|
||||||
|
[ERROR][2026-04-24 15:11:55,488][log.py:249]Internal Server Error: /api/generate/create/env_diff
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
media/R2601/final_seitai/第三轮回归测试说明.docx
Normal file
BIN
media/R2601/final_seitai/第三轮回归测试说明.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮动态硬件和固件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮动态硬件和固件项.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮动态软件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮动态软件项.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮回归测试用例概述.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮回归测试用例概述.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮回归测试需求.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮回归测试需求.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮技术依据文件.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮技术依据文件.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮文档概述.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮文档概述.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮测评数据.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮测评数据.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮测试用例.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮测试用例.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮用例追踪.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮用例追踪.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮被测软件基本信息.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮被测软件基本信息.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮软件更改部分.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮软件更改部分.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第三轮静态软件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第三轮静态软件项.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第二轮动态硬件和固件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第二轮动态硬件和固件项.docx
Normal file
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第二轮动态软件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第二轮动态软件项.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第二轮测评数据.docx
Normal file
BIN
media/R2601/output_dir/hsm/第二轮测评数据.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
media/R2601/output_dir/hsm/第二轮静态软件项.docx
Normal file
BIN
media/R2601/output_dir/hsm/第二轮静态软件项.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user