From 4897c4fa0b24ade5d8cf426b62464a0e5f39856e Mon Sep 17 00:00:00 2001 From: xiongyi <827523911@qq.com> Date: Thu, 29 Jan 2026 17:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=B4=BE=E5=8D=95?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=991=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API/send_data_test.py | 8 ++++---- services/task_service.py | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/API/send_data_test.py b/API/send_data_test.py index 422f7af..48f5c1b 100644 --- a/API/send_data_test.py +++ b/API/send_data_test.py @@ -185,7 +185,7 @@ def get_task_info(): }), 500 -@app.route('/api/ext/artifact/not_pour', methods=['GET']) +@app.route('/api/ext/mould/not_pour_rfid', methods=['GET']) def get_not_pour_info(): """ 模拟获取已入模绑定未浇筑的管片信息接口 @@ -218,11 +218,11 @@ def get_not_pour_info(): "RingTypeCode": "R22", "SizeSpecification": "6900*1500", "BuriedDepth": "中埋", - "BlockNumber": "F", + "BlockNumber": "B3", "HoleRingMarking": "否", "GroutingPipeMarking": "否", "PolypropyleneFiberMarking": "否", - "BetonVolume": 0.6, + "BetonVolume": 1.91, "BetonTaskID": "20251020-01" }, { @@ -256,7 +256,7 @@ def get_not_pour_info(): "HoleRingMarking": "否", "GroutingPipeMarking": "否", "PolypropyleneFiberMarking": "否", - "BetonVolume": 1.9, + "BetonVolume": 1.91, "BetonTaskID": "20251020-01" }, diff --git a/services/task_service.py b/services/task_service.py index 7f0cacb..8624a77 100644 --- a/services/task_service.py +++ b/services/task_service.py @@ -52,7 +52,7 @@ class TaskService: # 更新上一个任务信息 self.task_before = { "beton_task_id": current_task["beton_task_id"], - "beton_volume": current_task["beton_volume"], + "beton_volume": round(current_task["beton_volume"],1), "artifact_id": current_task["artifact_id"], "block_number": current_task["block_number"] } @@ -191,13 +191,13 @@ class TaskService: f_volume = f_blocks[0].get("BetonVolume") if f_blocks else 0 self.half_volume[0] = 0.1#round(total_f_volume / 2, 2)#暂时修改为0.1 self.half_volume[1] = 0.1#f_volume - self.half_volume[0]#暂时修改 - adjusted_volume = current_task["beton_volume"] + self.half_volume[0] + adjusted_volume = round(current_task["beton_volume"],1) + self.half_volume[0] elif f_positions == [1]: - adjusted_volume = current_task["beton_volume"] + self.half_volume[1] + adjusted_volume = round(current_task["beton_volume"],1) + self.half_volume[1] elif f_positions == [0]: adjusted_volume = 0 else: - adjusted_volume = current_task["beton_volume"] + adjusted_volume = round(current_task["beton_volume"],1) block_number = "补方" if f_positions == [0] else current_task["block_number"] @@ -230,14 +230,14 @@ class TaskService: """处理无F块的情况""" tasks = [{ "beton_task_id": current_task["beton_task_id"], - "beton_volume": current_task["beton_volume"], + "beton_volume": round(current_task["beton_volume"],1), "artifact_id": current_task["artifact_id"], "block_number": current_task["block_number"], }] send_list = [{ "beton_task_id": current_task["beton_task_id"], - "beton_volume": current_task["beton_volume"], + "beton_volume": round(current_task["beton_volume"],1), "artifact_id": current_task["artifact_id"], "block_number": current_task["block_number"], "beton_grade": current_task["task_data"]["BetonGrade"], @@ -366,7 +366,7 @@ class TaskService: produce_mix_id=task_info["ProduceMixID"], project_name=task_info["ProjectName"], beton_grade=task_info["BetonGrade"], - adjusted_volume=round(beton_volume,2), + adjusted_volume=round(beton_volume,1), artifact_id=artifact_id, half_volume=half_volume, # 已经调整后的方量 @@ -385,7 +385,7 @@ class TaskService: "produce_mix_id": task_info["ProduceMixID"], # 配比号 "project_name": task_info["ProjectName"], # 任务名 "beton_grade": task_info["BetonGrade"], # 砼强度 - "adjusted_volume": round(beton_volume,2), # 方量 + "adjusted_volume": round(beton_volume,1), # 方量 "flag": "已插入", # 状态 "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S") # 时间 } @@ -405,7 +405,7 @@ class TaskService: produce_mix_id=task_info["ProduceMixID"], project_name=task_info["ProjectName"], beton_grade=task_info["BetonGrade"], - adjusted_volume=round(beton_volume,2), + adjusted_volume=round(beton_volume,1), artifact_id=artifact_id, half_volume=half_volume, )