zhouhui.jiang

update

......@@ -42,6 +42,7 @@ def create_waybill_d(consignmentCode: str, Authorization: str = None) -> str:
- message: 创建结果描述(成功时:"创建运单成功",失败时:具体的失败原因)
- consignmentCode: 运单编号
- waybill_id: 运单ID
- consStatus: 运单状态
- operate_unit_name: 操作单位名称
- operate_unit_code: 操作单位代码
- detailList: 明细列表
......@@ -96,6 +97,7 @@ def create_waybill_d(consignmentCode: str, Authorization: str = None) -> str:
result_data = {
"consignmentCode": code,
"waybill_id": str(waybill_id) if waybill_id else "",
"consStatus": "",
"operate_unit_name": "",
"operate_unit_code": "",
"detailList": []
......@@ -118,6 +120,7 @@ def create_waybill_d(consignmentCode: str, Authorization: str = None) -> str:
if head_resp.status_code == 200:
head_json = head_resp.json()
head_extra = (head_json.get("data") or {}).get("extra") or {}
result_data["consStatus"] = head_extra.get("consStatus") or ""
result_data["operate_unit_name"] = head_extra.get("operateUnitName") or ""
result_data["operate_unit_code"] = head_extra.get("operateUnitCode") or ""
except Exception:
......@@ -243,6 +246,7 @@ def query_waybill_info(consignmentCode: str, Authorization: str = None) -> str:
- message: 查询结果描述(成功时:"查询详情成功",失败时:具体的失败原因)
- consignmentCode: 运单编号
- waybill_id: 运单ID
- consStatus: 运单状态
- operate_unit_name: 操作单位名称
- operate_unit_code: 操作单位代码
- detailList: 明细列表
......@@ -257,6 +261,7 @@ def query_waybill_info(consignmentCode: str, Authorization: str = None) -> str:
result_data = {
"consignmentCode": consignmentCode,
"waybill_id": "",
"consStatus": "",
"operate_unit_name": "",
"operate_unit_code": "",
"detailList": []
......@@ -285,6 +290,9 @@ def query_waybill_info(consignmentCode: str, Authorization: str = None) -> str:
result_data["consignmentCode"] = returned_code
result_data["waybill_id"] = str(waybill_id) if waybill_id else ""
# 提取运单状态
result_data["consStatus"] = head_extra.get("consStatus") or ""
# 提取公司信息
result_data["operate_unit_name"] = head_extra.get("operateUnitName") or ""
result_data["operate_unit_code"] = head_extra.get("operateUnitCode") or ""
......