소스 검색

更改过期合同

mengqiankang 2 달 전
부모
커밋
1305520baf
2개의 변경된 파일8개의 추가작업 그리고 24개의 파일을 삭제
  1. 2 18
      alien_store/api/router.py
  2. 6 6
      test.py

+ 2 - 18
alien_store/api/router.py

@@ -245,16 +245,17 @@ async def get_contract_detail(
         except Exception as e:
             logger.error(f"file_download_url failed sign_flow_id={sign_flow_id}: {e}")
             return ErrorResponse(success=False, message="获取合同下载链接失败", raw=str(e))
-
         if row and isinstance(items, list):
             for it in items:
                 if it.get("sign_flow_id") == sign_flow_id:
                     it["contract_download_url"] = contract_download_url
+                    it["contract_url"] = contract_download_url  # 与 status=0 一致,用 file_download_url 更新最新 contract_url
                     break
             await templates_server.update_contract_items(row["id"], items)
 
         return {
             "status": 1,
+            "contract_url": contract_download_url,
             "contract_download_url": contract_download_url,
             "sign_flow_id": sign_flow_id
         }
@@ -367,23 +368,6 @@ async def esign_callback(
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 # @router.post("/esign/callback_auth", response_model=SuccessResponse)
 # async def esign_callback_auth(
 #     payload: dict,

+ 6 - 6
test.py

@@ -19,7 +19,7 @@ import requests
 
 # ----------------------------------------------------------------------------------------------------------------------
 # url = "http://127.0.0.1:8001/api/store/contracts/400"
-# url = "http://120.26.186.130:33333/api/store/contracts/400?status=0"
+# url = "http://120.26.186.130:33333/api/store/contracts/420?status=1"
 # """
 # 商家点击合同管理模块时,可以条件筛选查询 未签署合同和已签署合同
 # status:签署状态 0 未签署 1 已签署
@@ -30,11 +30,11 @@ import requests
 # print(resp.text)
 
 # ----------------------------------------------------------------------------------------------------------------------
-# url = "http://127.0.0.1:8001/api/store/contracts/detail/c2259cb97f3f4066b7bca57a62e3843a"
-# url = "http://120.26.186.130:33333/api/store/contracts/detail/c2259cb97f3f4066b7bca57a62e3843a"
+# url = "http://127.0.0.1:8001/api/store/contracts/detail/c658fe83ce404934971d6912aaa315e0"
+# url = "http://120.26.186.130:33333/api/store/contracts/detail/"
 # """
 # 商家点击到某个具体的合同 向这个接口发送请求
-# 由于e签宝提供的合同模板URL会过期,所以会再次卸载file_id 向e签宝发起请求刷新新的URL
+# 由于e签宝提供的合同模板URL会过期,所以会再次携带flow_id 向e签宝发起请求刷新新的URL
 # 下载URL同理
 # """
 # resp = requests.get(url)
@@ -44,8 +44,8 @@ import requests
 # url = "http://127.0.0.1:8001/api/store/esign/signurl"
 # url = "http://120.26.186.130:33333/api/store/esign/signurl"
 # body = {
-#     "sign_flow_id": "",
-#     "contact_phone": ""
+#     "sign_flow_id": "c658fe83ce404934971d6912aaa315e0",
+#     "contact_phone": "13923864580"
 # }
 # """
 # 当商家点击签署按钮时