|
@@ -79,12 +79,16 @@ async def create_esign_templates(templates_data: TemplatesCreate, templates_serv
|
|
|
return {"success": False, "message": "e签宝返回缺少 signFlowId", "raw": sign_json}
|
|
return {"success": False, "message": "e签宝返回缺少 signFlowId", "raw": sign_json}
|
|
|
|
|
|
|
|
result_contract = {
|
|
result_contract = {
|
|
|
- "contract_url": contract_url,
|
|
|
|
|
- "file_name": file_name,
|
|
|
|
|
- "file_id": file_id,
|
|
|
|
|
- "status": 0,
|
|
|
|
|
- "sign_flow_id": sing_id,
|
|
|
|
|
- "sign_url": ""
|
|
|
|
|
|
|
+ "contract_url": contract_url, # 合同模版链接
|
|
|
|
|
+ "file_name": file_name, # 签署的合同的文件名称
|
|
|
|
|
+ "file_id": file_id, # 生成的文件ID
|
|
|
|
|
+ "status": 0, # 签署状态 0 未签署 1 已签署
|
|
|
|
|
+ "sign_flow_id": sing_id, # 从
|
|
|
|
|
+ "sign_url": "", # e签宝生成的签署页面
|
|
|
|
|
+ "signing_time": "", # 签署合同的时间
|
|
|
|
|
+ "effective_time": "", # 合同生效的时间
|
|
|
|
|
+ "expiry_time": "", # 合同失效的时间
|
|
|
|
|
+ "contract_download_url": "", # 合同签署完成后 下载文件的链接
|
|
|
}
|
|
}
|
|
|
updated = await templates_server.append_contract_url(templates_data, result_contract)
|
|
updated = await templates_server.append_contract_url(templates_data, result_contract)
|
|
|
logger.info(f"get_esign_templates success contact_phone={templates_data.contact_phone}, sign_flow_id={sing_id}")
|
|
logger.info(f"get_esign_templates success contact_phone={templates_data.contact_phone}, sign_flow_id={sing_id}")
|
|
@@ -107,6 +111,13 @@ async def get_all_templates(
|
|
|
|
|
|
|
|
@router.post("/esign/signurl")
|
|
@router.post("/esign/signurl")
|
|
|
async def get_esign_sign_url(body: SignUrl, templates_server: ContractServer = Depends(get_contract_service)):
|
|
async def get_esign_sign_url(body: SignUrl, templates_server: ContractServer = Depends(get_contract_service)):
|
|
|
|
|
+ """
|
|
|
|
|
+ 当商家点击签署按钮时
|
|
|
|
|
+ 携带合同相关的签署id和联系方式向e签宝发起请求
|
|
|
|
|
+ 获取到签署的页面链接
|
|
|
|
|
+ 并将签署url存入该合同对应的sign_url中
|
|
|
|
|
+ """
|
|
|
|
|
+
|
|
|
sing_flow_id = body.sign_flow_id
|
|
sing_flow_id = body.sign_flow_id
|
|
|
contact_phone = body.contact_phone
|
|
contact_phone = body.contact_phone
|
|
|
logger.info(f"esign/signurl request contact_phone={contact_phone}, sign_flow_id={sing_flow_id}")
|
|
logger.info(f"esign/signurl request contact_phone={contact_phone}, sign_flow_id={sing_flow_id}")
|