|
@@ -12,10 +12,10 @@ from data_clean.env.const import mongo_table_prefix
|
|
from data_clean.exception.ruler_validation_exception import RulerValidationException
|
|
from data_clean.exception.ruler_validation_exception import RulerValidationException
|
|
from data_clean.utils.base_utils import *
|
|
from data_clean.utils.base_utils import *
|
|
from data_clean.utils.case_utils import case_no_year_datetime
|
|
from data_clean.utils.case_utils import case_no_year_datetime
|
|
|
|
+from data_clean.utils.case_utils import get_case_party
|
|
from data_clean.utils.date_utils import str_2_date_time, get_update_time, establish_state_time
|
|
from data_clean.utils.date_utils import str_2_date_time, get_update_time, establish_state_time
|
|
from data_clean.utils.party_name_verify_utils import person_name_list_verify, remove_null_party
|
|
from data_clean.utils.party_name_verify_utils import person_name_list_verify, remove_null_party
|
|
from data_clean.utils.str_utils import json_str_2_list
|
|
from data_clean.utils.str_utils import json_str_2_list
|
|
-from data_clean.utils.case_utils import get_case_party
|
|
|
|
|
|
|
|
# 必须命名为dim_handle
|
|
# 必须命名为dim_handle
|
|
dim_handle = get_dim_handle(os.path.basename(__file__))
|
|
dim_handle = get_dim_handle(os.path.basename(__file__))
|
|
@@ -131,9 +131,6 @@ async def open_ann_date(row_data: dict) -> dict:
|
|
@dim_handle.registry_row_func
|
|
@dim_handle.registry_row_func
|
|
async def party_unknown(row_data: dict) -> dict:
|
|
async def party_unknown(row_data: dict) -> dict:
|
|
# 过滤当事人名字异常,Z某某、xxx
|
|
# 过滤当事人名字异常,Z某某、xxx
|
|
- # row_data['plaintiff_info'] = remove_null_party(row_data['plaintiff_info'])
|
|
|
|
- # row_data['defendant_info'] = remove_null_party(row_data['defendant_info'])
|
|
|
|
- # row_data['litigant_info'] = remove_null_party(row_data['litigant_info'])
|
|
|
|
|
|
|
|
plaintiff_info = json_str_2_list(row_data['plaintiff_info'], "name")
|
|
plaintiff_info = json_str_2_list(row_data['plaintiff_info'], "name")
|
|
defendant_info = json_str_2_list(row_data['defendant_info'], "name")
|
|
defendant_info = json_str_2_list(row_data['defendant_info'], "name")
|
|
@@ -142,12 +139,40 @@ async def party_unknown(row_data: dict) -> dict:
|
|
if not flag:
|
|
if not flag:
|
|
result = await get_case_party(row_data['case_no'], source='open_court')
|
|
result = await get_case_party(row_data['case_no'], source='open_court')
|
|
if result:
|
|
if result:
|
|
- row_data['plaintiff_info'] = remove_null_party(result['plaintiff_info'])
|
|
|
|
- row_data['defendant_info'] = remove_null_party(result['defendant_info'])
|
|
|
|
- row_data['litigant_info'] = remove_null_party(result['litigant_info'])
|
|
|
|
- row_data['plaintiff'] = result['plaintiff']
|
|
|
|
- row_data['defendant'] = result['defendant']
|
|
|
|
- row_data['litigant'] = result['litigant']
|
|
|
|
|
|
+ rowkey = row_data['rowkey'] if 'rowkey' in row_data else None
|
|
|
|
+ tmp_plaintiff_info = remove_null_party(result['plaintiff_info'])
|
|
|
|
+ tmp_defendant_info = remove_null_party(result['defendant_info'])
|
|
|
|
+ tmp_litigant_info = remove_null_party(result['litigant_info'])
|
|
|
|
+ tmp_plaintiff = result['plaintiff']
|
|
|
|
+ tmp_defendant = result['defendant']
|
|
|
|
+ tmp_litigant = result['litigant']
|
|
|
|
+
|
|
|
|
+ await insert_one(mongo_table_prefix + 'info_cooa_party_set_value', {
|
|
|
|
+ "rowkey": rowkey,
|
|
|
|
+ "org_party": {
|
|
|
|
+ 'plaintiff_info': row_data['plaintiff_info'],
|
|
|
|
+ 'defendant_info': row_data['defendant_info'],
|
|
|
|
+ 'litigant_info': row_data['litigant_info'],
|
|
|
|
+ 'plaintiff': row_data['plaintiff'],
|
|
|
|
+ 'defendant': row_data['defendant'],
|
|
|
|
+ 'litigant': row_data['litigant'],
|
|
|
|
+ },
|
|
|
|
+ "new_party": {
|
|
|
|
+ 'plaintiff_info': tmp_plaintiff_info,
|
|
|
|
+ 'defendant_info': tmp_defendant_info,
|
|
|
|
+ 'litigant_info': tmp_litigant_info,
|
|
|
|
+ 'plaintiff': tmp_plaintiff,
|
|
|
|
+ 'defendant': tmp_defendant,
|
|
|
|
+ 'litigant': tmp_litigant,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ row_data['plaintiff_info'] = tmp_plaintiff_info
|
|
|
|
+ row_data['defendant_info'] = tmp_defendant_info
|
|
|
|
+ row_data['litigant_info'] = tmp_litigant_info
|
|
|
|
+ row_data['plaintiff'] = tmp_plaintiff
|
|
|
|
+ row_data['defendant'] = tmp_defendant
|
|
|
|
+ row_data['litigant'] = tmp_litigant
|
|
pass
|
|
pass
|
|
else:
|
|
else:
|
|
raise RulerValidationException("ccoa_003", "人名不符合规范:%s" % error_name)
|
|
raise RulerValidationException("ccoa_003", "人名不符合规范:%s" % error_name)
|
|
@@ -158,14 +183,17 @@ async def party_unknown(row_data: dict) -> dict:
|
|
|
|
|
|
async def test():
|
|
async def test():
|
|
res = await _get_max_establish_date(
|
|
res = await _get_max_establish_date(
|
|
- ['bc702f0f5202342a9c1c75fbf9be9aff', 'b79d862faef595f33b166562bb3c18b6', '24cb269450f9262051dfcaa3dc389844'])
|
|
|
|
|
|
+ ['b13955ebaa99b06456803041e73c3888', ])
|
|
print(res)
|
|
print(res)
|
|
|
|
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
- import asyncio
|
|
|
|
|
|
+ row_data = {"rowkey": "a"}
|
|
|
|
|
|
- asyncio.run(test())
|
|
|
|
|
|
+ rowkey = row_data['rowkey'] if 'rowkey' in row_data else None
|
|
|
|
+ print(rowkey)
|
|
|
|
+ # import asyncio
|
|
|
|
+ # asyncio.run(test())
|
|
pass
|
|
pass
|