浏览代码

update 端口回滚为5123

yue 1 周之前
父节点
当前提交
20a20ce3f8

+ 1 - 1
SourceCode/IntelligentRailwayCosting/Docker/Dockerfile

@@ -28,7 +28,7 @@ COPY app/ /app
 
 
 # 暴露端口
-EXPOSE 8080
+EXPOSE 5123
 
 
 # 启动命令

+ 1 - 1
SourceCode/IntelligentRailwayCosting/Docker/docker-compose.yml

@@ -51,7 +51,7 @@ services:
     networks:
       - railway_costing_v1
     ports:
-      - "7010:8080"
+      - "7010:5123"
     restart: always
 
 networks:

+ 1 - 1
SourceCode/IntelligentRailwayCosting/Docker/docker-compose_mysql.yml

@@ -33,7 +33,7 @@ services:
     networks:
       - railway_costing_mysql_v1
     ports:
-      - "7011:8080"
+      - "7011:5123"
     restart: always
 
 networks:

+ 1 - 1
SourceCode/IntelligentRailwayCosting/Docker/docker-compose_sqlserver.yml

@@ -15,5 +15,5 @@ services:
       - /home/docker/iwb_railway_costing_v1/app/logs:/app/logs
       - /home/docker/iwb_railway_costing_v1/app/temp_files:/app/temp_files
     ports:
-      - "7010:8080"
+      - "7010:5123"
     restart: always

+ 3 - 3
SourceCode/IntelligentRailwayCosting/app/core/dtos/chapter.py

@@ -67,9 +67,9 @@ class ChapterDto(BaseModel):
 
     @classmethod
     def from_model(
-            cls,
-            chapter_model: ChapterModel,
-            budget_item_model: Optional[TotalBudgetItemModel] = None,
+        cls,
+        chapter_model: ChapterModel,
+        budget_item_model: Optional[TotalBudgetItemModel] = None,
     ) -> "ChapterDto":
         """从数据库模型创建DTO对象"""
         dto = cls(

+ 32 - 32
SourceCode/IntelligentRailwayCosting/app/core/dtos/excel_parse.py

@@ -52,18 +52,18 @@ class ExcelParseFileDto:
 
 class ExcelParseDto:
     def __init__(
-            self,
-            task_id: int,
-            version: str,
-            project_id: str,
-            project_name: str,
-            project_stage: str,
-            selected_zgs_id: int,
-            zgs_list: list[ExcelParseZgsDto],
-            selected_chapter: list[ExcelParseItemDto],
-            # hierarchy: list[ExcelParseItemDto],
-            # components: list[ExcelParseItemDto],
-            files: list[ExcelParseFileDto],
+        self,
+        task_id: int,
+        version: str,
+        project_id: str,
+        project_name: str,
+        project_stage: str,
+        selected_zgs_id: int,
+        zgs_list: list[ExcelParseZgsDto],
+        selected_chapter: list[ExcelParseItemDto],
+        # hierarchy: list[ExcelParseItemDto],
+        # components: list[ExcelParseItemDto],
+        files: list[ExcelParseFileDto],
     ):
         self.task_id = task_id
         self.version = version
@@ -112,21 +112,21 @@ class ExcelParseResultDataDto:
     #     "ex_amount": excel中给出的数量, // number
     # }
     def __init__(
-            self,
-            zgs_id: int,  # 总概算id
-            zgs_code: str,  # 总概算编号
-            item_id: int,  # 条⽬序号
-            item_code: str,  # 条⽬编码
-            entry_name: str,  # ⼯程或费⽤项⽬名称,来⾃于定额表,
-            dinge_code: str,  # 定额编号,
-            units: str,  # 单位,
-            amount: float,  # 数量,
-            target_id: int,  # ⽤户数据库中条⽬的id,-1表示没有,
-            ex_file_id: str,  # excel⽂件id,
-            ex_cell: str,  # 数量单元格位置,例如 "C17",
-            ex_row: str,  # 该⾏内容,由逗号连接多个单元格得到,
-            ex_unit: str,  # excel中给出的单位,
-            ex_amount: float,  # excel中给出的数量,
+        self,
+        zgs_id: int,  # 总概算id
+        zgs_code: str,  # 总概算编号
+        item_id: int,  # 条⽬序号
+        item_code: str,  # 条⽬编码
+        entry_name: str,  # ⼯程或费⽤项⽬名称,来⾃于定额表,
+        dinge_code: str,  # 定额编号,
+        units: str,  # 单位,
+        amount: float,  # 数量,
+        target_id: int,  # ⽤户数据库中条⽬的id,-1表示没有,
+        ex_file_id: str,  # excel⽂件id,
+        ex_cell: str,  # 数量单元格位置,例如 "C17",
+        ex_row: str,  # 该⾏内容,由逗号连接多个单元格得到,
+        ex_unit: str,  # excel中给出的单位,
+        ex_amount: float,  # excel中给出的数量,
     ):
         self.zgs_id = zgs_id
         self.zgs_code = zgs_code
@@ -192,11 +192,11 @@ class ExcelParseResultDataDto:
 
 class ExcelParseResultDto:
     def __init__(
-            self,
-            task_id: int,
-            result: int = -1,
-            reason: str = "",
-            data: list[ExcelParseResultDataDto] = None,
+        self,
+        task_id: int,
+        result: int = -1,
+        reason: str = "",
+        data: list[ExcelParseResultDataDto] = None,
     ):
         self.task_id = task_id
         self.result = result  # -1-失败;0-运行中;1-成功

+ 12 - 12
SourceCode/IntelligentRailwayCosting/app/executor/task_processor.py

@@ -176,14 +176,14 @@ class TaskProcessor:
             return None, msg
 
     def _build_api_body(
-            self,
-            task: ProjectTaskDto,
-            project: ProjectDto,
-            budgets: list[TotalBudgetInfoDto],
-            chapter: list[ChapterDto],
-            # parents: list[ChapterDto],
-            # children: list[ChapterDto],
-            files: list[ExcelParseFileDto],
+        self,
+        task: ProjectTaskDto,
+        project: ProjectDto,
+        budgets: list[TotalBudgetInfoDto],
+        chapter: list[ChapterDto],
+        # parents: list[ChapterDto],
+        # children: list[ChapterDto],
+        files: list[ExcelParseFileDto],
     ):
         try:
             budgets_data = [ExcelParseZgsDto.from_dto(budget) for budget in budgets]
@@ -233,10 +233,10 @@ class TaskProcessor:
             raise Exception(msg)
 
     def _insert_data(
-            self,
-            task: ProjectTaskDto,
-            project: ProjectDto,
-            data: list[ExcelParseResultDataDto],
+        self,
+        task: ProjectTaskDto,
+        project: ProjectDto,
+        data: list[ExcelParseResultDataDto],
     ):
         try:
             self._logger.debug(f"开始插入数据:{task.task_name}")

+ 1 - 1
SourceCode/IntelligentRailwayCosting/app/main.py

@@ -13,7 +13,7 @@ def main():
     thread.daemon = True
     thread.start()
 
-    app.run(host="0.0.0.0", port=8080)  # 指定HTTP端口为8080
+    app.run(host="0.0.0.0", port=5123)  # 指定HTTP端口为5123
 
 
 if __name__ == "__main__":

+ 1 - 0
SourceCode/IntelligentRailwayCosting/app/routes/project.py

@@ -84,6 +84,7 @@ def get_all_chapters(task_id: int):
 
         return handle_api_error(e, "项目章节条目")
 
+
 # @project_api.route('/budget-item/<budget_id>/<project_id>', methods=['POST'])
 # @Permission.authorize
 # def get_budget_items(budget_id:str,project_id:str):

+ 1 - 1
SourceCode/IntelligentRailwayCosting/app/routes/project_quota.py

@@ -34,7 +34,7 @@ def get_page_list(budget_id: int, project_id: str, item_code: str):
 )
 @Permission.authorize
 def get_quotas_by_task_paginated(
-        task_id: int, budget_id: int, project_id: str, item_code: str
+    task_id: int, budget_id: int, project_id: str, item_code: str
 ):
     try:
         data = request.get_json()

+ 11 - 11
SourceCode/IntelligentRailwayCosting/app/services/project.py

@@ -16,13 +16,13 @@ class ProjectService:
         self._chapter_store = ChapterStore()
 
     def get_projects_paginated(
-            self,
-            page: int,
-            page_size: int,
-            keyword: Optional[str] = None,
-            start_time: Optional[str] = None,
-            end_time: Optional[str] = None,
-            can_edit: Optional[int] = 0,
+        self,
+        page: int,
+        page_size: int,
+        keyword: Optional[str] = None,
+        start_time: Optional[str] = None,
+        end_time: Optional[str] = None,
+        can_edit: Optional[int] = 0,
     ):
 
         # 处理开始时间和结束时间
@@ -115,8 +115,8 @@ class ProjectService:
                     team_item_code = (
                         None
                         if team_item_code_str == "None"
-                           or team_item_code_str == "0"
-                           or team_item_code_str == ""
+                        or team_item_code_str == "0"
+                        or team_item_code_str == ""
                         else team_item_code_str.split(",")
                     )
             items = self._chapter_store.get_top_chapter_items(
@@ -167,8 +167,8 @@ class ProjectService:
                     team_item_code = (
                         None
                         if team_item_code_str == "None"
-                           or team_item_code_str == "0"
-                           or team_item_code_str == ""
+                        or team_item_code_str == "0"
+                        or team_item_code_str == ""
                         else team_item_code_str.split(",")
                     )
             items = self._budget_store.get_top_budget_items(

+ 17 - 17
SourceCode/IntelligentRailwayCosting/app/services/project_quota.py

@@ -17,14 +17,14 @@ class ProjectQuotaService:
         self._logger = utils.get_logger()
 
     def get_quotas_paginated(
-            self,
-            budget_id: int,
-            project_id: str,
-            item_code: str,
-            page: int = 1,
-            page_size: int = 10,
-            keyword: Optional[str] = None,
-            send_status: Optional[int] = None,
+        self,
+        budget_id: int,
+        project_id: str,
+        item_code: str,
+        page: int = 1,
+        page_size: int = 10,
+        keyword: Optional[str] = None,
+        send_status: Optional[int] = None,
     ):
         """获取项目定额列表
 
@@ -61,15 +61,15 @@ class ProjectQuotaService:
             raise
 
     def get_quotas_by_task_paginated(
-            self,
-            task_id: int,
-            budget_id,
-            project_id,
-            item_code,
-            page: int = 1,
-            page_size: int = 10,
-            keyword: Optional[str] = None,
-            send_status: Optional[int] = None,
+        self,
+        task_id: int,
+        budget_id,
+        project_id,
+        item_code,
+        page: int = 1,
+        page_size: int = 10,
+        keyword: Optional[str] = None,
+        send_status: Optional[int] = None,
     ):
         try:
             data = self.store.get_quotas_by_task_paginated(

+ 8 - 8
SourceCode/IntelligentRailwayCosting/app/services/project_task.py

@@ -122,14 +122,14 @@ class ProjectTaskService:
                 raise
 
     def get_tasks_paginated(
-            self,
-            project_id: str,
-            item_code: str,
-            page: int = 1,
-            page_size: int = 10,
-            keyword: Optional[str] = None,
-            process_status: Optional[int] = None,
-            send_status: Optional[int] = None,
+        self,
+        project_id: str,
+        item_code: str,
+        page: int = 1,
+        page_size: int = 10,
+        keyword: Optional[str] = None,
+        process_status: Optional[int] = None,
+        send_status: Optional[int] = None,
     ):
         """获取项目任务列表
 

+ 1 - 1
SourceCode/IntelligentRailwayCosting/app/stores/chapter.py

@@ -142,7 +142,7 @@ class ChapterStore:
             return items
 
     def get_child_chapter_items(
-            self, project_id: str, parent_item_code: str, task_first: bool
+        self, project_id: str, parent_item_code: str, task_first: bool
     ):
         # 构建子节点的模式:支持两种格式
         # 1. 父级编号后跟-和两位数字(如:01-01)

+ 19 - 19
SourceCode/IntelligentRailwayCosting/app/stores/railway_costing_mysql/project_quota.py

@@ -22,14 +22,14 @@ class ProjectQuotaStore:
         return self._current_user
 
     def get_quotas_paginated(
-            self,
-            budget_id: int,
-            project_id: str,
-            item_code: str,
-            page: int = 1,
-            page_size: int = 10,
-            keyword: Optional[str] = None,
-            send_status: Optional[int] = None,
+        self,
+        budget_id: int,
+        project_id: str,
+        item_code: str,
+        page: int = 1,
+        page_size: int = 10,
+        keyword: Optional[str] = None,
+        send_status: Optional[int] = None,
     ):
         """分页查询定额列表
 
@@ -81,15 +81,15 @@ class ProjectQuotaStore:
             return {"total": total_count, "data": quotas}
 
     def get_quotas_by_task_paginated(
-            self,
-            task_id: int,
-            budget_id,
-            project_id,
-            item_code,
-            page: int = 1,
-            page_size: int = 10,
-            keyword: Optional[str] = None,
-            send_status: Optional[int] = None,
+        self,
+        task_id: int,
+        budget_id,
+        project_id,
+        item_code,
+        page: int = 1,
+        page_size: int = 10,
+        keyword: Optional[str] = None,
+        send_status: Optional[int] = None,
     ):
         with db_helper.mysql_query_session(self._database) as db_session:
             query = db_session.query(ProjectQuotaModel).filter(
@@ -176,7 +176,7 @@ class ProjectQuotaStore:
         return ProjectQuotaDto.from_model(quota) if quota else None
 
     def get_quota_by_quota_input(
-            self, project_id: str, budget_id: int, quota_input_id: int
+        self, project_id: str, budget_id: int, quota_input_id: int
     ):
         with db_helper.mysql_query_session(self._database) as db_session:
             quota = (
@@ -263,7 +263,7 @@ class ProjectQuotaStore:
             return ProjectQuotaDto.from_model(quota)
 
     def update_quota_chapter(
-            self, quota_id: int, item_id: int, item_code: str
+        self, quota_id: int, item_id: int, item_code: str
     ) -> Optional[ProjectQuotaDto]:
         quota = self.get_quota(quota_id)
         if not quota: