main #7
@@ -182,6 +182,39 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
|
|||||||
logger.error("Metadata processing error: %s", e)
|
logger.error("Metadata processing error: %s", e)
|
||||||
|
|
||||||
doc.save()
|
doc.save()
|
||||||
|
|
||||||
|
def create_weight_report(self):
|
||||||
|
wr_payload = {
|
||||||
|
"chunk_key": 4660139,
|
||||||
|
"gross_weight": 50000,
|
||||||
|
"net_weight": 49500,
|
||||||
|
"tare_total": 500,
|
||||||
|
"bags": 100,
|
||||||
|
"surveyor_code": 1424,
|
||||||
|
"place_key": 100086,
|
||||||
|
"report_date": 20260126
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.post(
|
||||||
|
"http://automation-service:8006/weight-report",
|
||||||
|
json=wr_payload, # 👈 ICI la correction
|
||||||
|
timeout=10
|
||||||
|
)
|
||||||
|
|
||||||
|
response.raise_for_status()
|
||||||
|
data = response.json()
|
||||||
|
|
||||||
|
# Exemple de data retournée :
|
||||||
|
# {
|
||||||
|
# "success": true,
|
||||||
|
# "weight_report_key": 123456789
|
||||||
|
# }
|
||||||
|
|
||||||
|
self.notes = (
|
||||||
|
f"WR creation success: {data.get('success')}\n"
|
||||||
|
f"WEIGHT_REPORT_KEY: {data.get('weight_report_key')}"
|
||||||
|
)
|
||||||
|
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# FULL PIPELINE
|
# FULL PIPELINE
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
@@ -366,7 +399,7 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
|
|||||||
logger.info("ADD_LOT:%s",l)
|
logger.info("ADD_LOT:%s",l)
|
||||||
LotQt.add_physical_lots(lqt,[l])
|
LotQt.add_physical_lots(lqt,[l])
|
||||||
|
|
||||||
|
doc.create_weight_report()
|
||||||
|
|
||||||
# if cls.rule_set.ocr_required:[]
|
# if cls.rule_set.ocr_required:[]
|
||||||
# cls.run_ocr([doc])
|
# cls.run_ocr([doc])
|
||||||
|
|||||||
Reference in New Issue
Block a user