|
@@ -108,6 +108,8 @@ def data_process():
|
|
|
def get_area_no(x):
|
|
|
second_unit = x['资产所属单位(二级)']
|
|
|
third_unit = x['资产所属单位(三级)']
|
|
|
+ if '河北' == second_unit:
|
|
|
+ return '-12'
|
|
|
if '长途通信传输局' == second_unit:
|
|
|
return '-11'
|
|
|
if '保定' in second_unit and ('雄县' in third_unit or '容城' in third_unit or '安新' in third_unit):
|
|
@@ -117,7 +119,7 @@ def data_process():
|
|
|
area_no = second_org['id']
|
|
|
if area_name in second_unit:
|
|
|
return area_no
|
|
|
- return '-12'
|
|
|
+ raise RuntimeError(f'二级组织机构编码匹配失败: {second_unit}')
|
|
|
|
|
|
# 应用 get_area_no 函数,生成二级组织机构编码列
|
|
|
df['二级组织机构编码'] = df.apply(get_area_no, axis=1)
|