diff --git a/apps/project/controllers/__pycache__/case.cpython-313.pyc b/apps/project/controllers/__pycache__/case.cpython-313.pyc index a9f013d..072474e 100644 Binary files a/apps/project/controllers/__pycache__/case.cpython-313.pyc and b/apps/project/controllers/__pycache__/case.cpython-313.pyc differ diff --git a/apps/project/controllers/__pycache__/design.cpython-313.pyc b/apps/project/controllers/__pycache__/design.cpython-313.pyc index 4e579c8..116cdab 100644 Binary files a/apps/project/controllers/__pycache__/design.cpython-313.pyc and b/apps/project/controllers/__pycache__/design.cpython-313.pyc differ diff --git a/apps/project/controllers/__pycache__/testDemand.cpython-313.pyc b/apps/project/controllers/__pycache__/testDemand.cpython-313.pyc index d8c6225..54fabc4 100644 Binary files a/apps/project/controllers/__pycache__/testDemand.cpython-313.pyc and b/apps/project/controllers/__pycache__/testDemand.cpython-313.pyc differ diff --git a/apps/project/controllers/case.py b/apps/project/controllers/case.py index e259ac9..c3f56c5 100644 --- a/apps/project/controllers/case.py +++ b/apps/project/controllers/case.py @@ -283,6 +283,7 @@ class CaseController(ControllerBase): @route.post("/case/replace/", url_name='case-replace') @transaction.atomic def replace_case_step_content(self, payload: ReplaceCaseSchema): + print(payload) # 1.首先查询项目 project_obj: Project = get_object_or_404(Project, id=payload.project_id) # 2.查询[所有轮次]的selectRows的id @@ -301,7 +302,8 @@ class CaseController(ControllerBase): # 批量更新 operation 和 expect step_count = caseStep_qs.update( operation=Replace(F('operation'), Value(payload.originText), Value(payload.replaceText)), - expect=Replace(F('expect'), Value(payload.originText), Value(payload.replaceText)) + expect=Replace(F('expect'), Value(payload.originText), Value(payload.replaceText)), + result=Replace(F('result'), Value(payload.originText), Value(payload.replaceText)) ) # 5.提交更新 replace_count = case_qs.update(**replace_kwargs) diff --git a/apps/project/controllers/testDemand.py b/apps/project/controllers/testDemand.py index 373254a..85bdfac 100644 --- a/apps/project/controllers/testDemand.py +++ b/apps/project/controllers/testDemand.py @@ -16,7 +16,7 @@ from utils.codes import HTTP_INDEX_ERROR from apps.project.models import Design, Dut, Round, TestDemand, TestDemandContent, TestDemandContentStep from apps.project.schemas.testDemand import DeleteSchema, TestDemandModelOutSchema, TestDemandFilterSchema, \ TestDemandTreeReturnSchema, TestDemandTreeInputSchema, TestDemandCreateOutSchema, \ - TestDemandCreateInputSchema, ReplaceDemandContentSchema, \ + TestDemandCreateInputSchema, ReplaceDemandContentSchema, PriorityReplaceSchema, \ TestDemandRelatedSchema, TestDemandExistRelatedSchema, DemandCopyToDesignSchema # 导入ORM from apps.project.models import Project @@ -320,3 +320,11 @@ class TestDemandController(ControllerBase): # 5.提交更新 replace_count = demand_qs.update(**replace_kwargs) return {'count': replace_count + step_count} + + # 批量替换优先级-priority + @route.post("/testDemand/priorityReplace/", url_name='demand-priority-replace') + @transaction.atomic + def multiple_modify_demand_priority(self, payload: PriorityReplaceSchema): + # 替换优先级 + demand_qs = TestDemand.objects.filter(id__in=payload.selectRows) + demand_qs.update(priority=payload.priority) diff --git a/apps/project/schemas/__pycache__/case.cpython-313.pyc b/apps/project/schemas/__pycache__/case.cpython-313.pyc index 8da0420..39f3baf 100644 Binary files a/apps/project/schemas/__pycache__/case.cpython-313.pyc and b/apps/project/schemas/__pycache__/case.cpython-313.pyc differ diff --git a/apps/project/schemas/__pycache__/testDemand.cpython-313.pyc b/apps/project/schemas/__pycache__/testDemand.cpython-313.pyc index 17719c2..40149e4 100644 Binary files a/apps/project/schemas/__pycache__/testDemand.cpython-313.pyc and b/apps/project/schemas/__pycache__/testDemand.cpython-313.pyc differ diff --git a/apps/project/schemas/case.py b/apps/project/schemas/case.py index fdea45d..342cbb9 100644 --- a/apps/project/schemas/case.py +++ b/apps/project/schemas/case.py @@ -150,7 +150,7 @@ class PersonReplaceSchema(Schema): testPerson: str monitorPerson: str -# 事件替换Schema +# 时间替换Schema class ExetimeReplaceSchema(Schema): selectRows: List[int] = None exetime: str diff --git a/apps/project/schemas/testDemand.py b/apps/project/schemas/testDemand.py index 4688ece..8f3ff1b 100644 --- a/apps/project/schemas/testDemand.py +++ b/apps/project/schemas/testDemand.py @@ -125,3 +125,8 @@ class ReplaceDemandContentSchema(Schema): replaceText: str selectRows: List[int] selectColumn: List[str] + +# 优先级替换Schema +class PriorityReplaceSchema(Schema): + selectRows: List[int] = None + priority: str \ No newline at end of file diff --git a/logs/root_log b/logs/root_log index b9ec1c7..91e921f 100644 --- a/logs/root_log +++ b/logs/root_log @@ -27,3 +27,19 @@ [WARNING][2025-05-17 15:36:12,935][log.py:248]Unauthorized: /api/system/getInfo [WARNING][2025-05-17 15:36:13,000][log.py:248]Unauthorized: /api/system/logout [WARNING][2025-05-17 15:36:20,760][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []}) +[WARNING][2025-05-23 10:36:33,307][log.py:248]Not Found: / +[WARNING][2025-05-23 10:36:33,430][log.py:248]Not Found: /favicon.ico +[WARNING][2025-05-26 15:15:24,703][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []}) +[WARNING][2025-05-26 15:19:25,390][log.py:248]Not Found: / +[WARNING][2025-05-26 15:19:25,513][log.py:248]Not Found: /favicon.ico +[WARNING][2025-05-27 09:11:32,138][log.py:248]Not Found: / +[WARNING][2025-05-27 09:11:32,616][log.py:248]Not Found: /favicon.ico +[WARNING][2025-05-27 09:13:04,921][log.py:248]Not Found: / +[WARNING][2025-05-27 09:50:50,827][log.py:248]Unauthorized: /api/system/getInfo +[WARNING][2025-05-27 09:50:50,894][log.py:248]Unauthorized: /api/system/logout +[WARNING][2025-05-27 09:50:59,888][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []}) +[WARNING][2025-05-28 09:24:15,443][log.py:248]Unauthorized: /api/system/getInfo +[WARNING][2025-05-28 09:24:15,480][log.py:248]Unauthorized: /api/system/logout +[WARNING][2025-05-28 09:24:26,068][backend.py:91]Caught LDAPError looking up user: SERVER_DOWN({'result': -1, 'desc': "Can't contact LDAP server", 'ctrls': []}) +[WARNING][2025-05-28 18:35:30,083][log.py:248]Not Found: /api/project/testDemand/priorityReplace/ +[WARNING][2025-05-28 18:35:42,929][log.py:248]Not Found: /api/project/testDemand/priorityReplace/ diff --git a/requirements.txt b/requirements.txt index 4145db3..7c5ed19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ django-ninja-extra~=0.30.0 django-ninja-jwt~=5.3.7 django-tinymce~=4.1.0 PyJWT~=2.10.1 -cryptography~=44.0.3 +cryptography~=45.0.3 ninja-schema~=0.14.2 user-agents~=2.2.0 numpy~=2.2.5