haha
This commit is contained in:
@@ -4225,6 +4225,25 @@ def _prefiling_person_to_info(person_json):
|
||||
return None
|
||||
|
||||
|
||||
def _normalize_client_party_for_search(val):
|
||||
"""
|
||||
将 conflict-search 接口的 client_info/party_info 统一为检索用字符串。
|
||||
支持:JSON 字符串(如 '[{"name":"张三","idNumber":"111"}]')、dict/list、或普通字符串。
|
||||
"""
|
||||
if val is None:
|
||||
return None
|
||||
if isinstance(val, str):
|
||||
val = val.strip()
|
||||
if not val:
|
||||
return None
|
||||
if val.startswith('[') or val.startswith('{'):
|
||||
return _prefiling_person_to_info(val)
|
||||
return val
|
||||
if isinstance(val, (list, dict)):
|
||||
return _prefiling_person_to_info(val)
|
||||
return None
|
||||
|
||||
|
||||
def parse_person_info(person_str):
|
||||
"""
|
||||
解析人员信息字符串,支持多种格式:
|
||||
@@ -4588,20 +4607,20 @@ class ConflictSearch(APIView):
|
||||
利益冲突检索
|
||||
|
||||
请求参数(至少提供一个):
|
||||
- client_info: 委托人身份信息(可选),支持格式:
|
||||
* "张三(3263452342342342)"
|
||||
* "张三,身份证号:3263452342342342"
|
||||
* "张三,3263452342342342"
|
||||
* "张三"
|
||||
- party_info: 相对方身份信息(可选),支持格式同上
|
||||
- client_info: 委托人身份信息(可选),支持 JSON 字符串或普通字符串:
|
||||
* JSON 字符串:'[{"name":"张三","idNumber":"111"}]' 或 '{"name":"张三","idNumber":"111"}'
|
||||
* 普通字符串:"张三(3263452342342342)"、"张三,身份证号:3263452342342342"、"张三"
|
||||
- party_info: 相对方身份信息(可选),格式同上
|
||||
- undertaker: 承办人员(可选)
|
||||
- bidding_unit: 招标单位(可选)
|
||||
- exclude_prefiling_id: 要排除的预立案ID(可选)
|
||||
- exclude_project_id: 要排除的立项ID(可选)
|
||||
- exclude_bid_id: 要排除的投标ID(可选)
|
||||
"""
|
||||
client_info = request.data.get('client_info', '').strip() if request.data.get('client_info') else None
|
||||
party_info = request.data.get('party_info', '').strip() if request.data.get('party_info') else None
|
||||
raw_client = request.data.get('client_info')
|
||||
raw_party = request.data.get('party_info')
|
||||
client_info = _normalize_client_party_for_search(raw_client)
|
||||
party_info = _normalize_client_party_for_search(raw_party)
|
||||
undertaker = request.data.get('undertaker', '').strip() if request.data.get('undertaker') else None
|
||||
bidding_unit = request.data.get('bidding_unit', '').strip() if request.data.get('bidding_unit') else None
|
||||
exclude_prefiling_id = request.data.get('exclude_prefiling_id')
|
||||
|
||||
Reference in New Issue
Block a user