2 Commits 41bca614eb ... 8f46510765

Autor SHA1 Mensaje Fecha
  weijianghai 8f46510765 init hace 3 semanas
  weijianghai 41bca614eb init hace 3 semanas

+ 3 - 3
car/car-chao-bao/car_chao-bao.py

@@ -15,7 +15,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/car/chao-bao/'
 # 数据库连接信息
@@ -213,7 +213,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 根据单位名称中的关键词返回对应的一级单位
-        if "机动通信局" in unit or "机动局" in unit:
+        if "机动通信局" in unit or "机动局" in unit or "传输局" in unit or "线路维护中心" in unit:
             return "机动局"
         if "雄安基地建设部" in unit:
             return "雄安基地建设部"
@@ -301,7 +301,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 如果单位包含特定关键词(如“机动通信局”等),返回固定编码"-11"
-        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局"]):
+        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局", "线路维护中心"]):
             return "-11"
         # 如果单位包含特定关键词(如“省公司本部”等),返回固定编码"-12"
         if any(keyword in unit for keyword in ["省公司本部", "雄安基地建设部", "华北基地建设部"]):

+ 3 - 3
car/car-guo-jian/car_guo_jian.py

@@ -15,7 +15,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/car/guo-jian/'
 # 数据库连接信息
@@ -213,7 +213,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 根据单位名称中的关键词返回对应的一级单位
-        if "机动通信局" in unit or "机动局" in unit:
+        if "机动通信局" in unit or "机动局" in unit or "传输局" in unit or "线路维护中心" in unit:
             return "机动局"
         if "雄安基地建设部" in unit:
             return "雄安基地建设部"
@@ -301,7 +301,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 如果单位包含特定关键词(如“机动通信局”等),返回固定编码"-11"
-        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局"]):
+        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局", "线路维护中心"]):
             return "-11"
         # 如果单位包含特定关键词(如“省公司本部”等),返回固定编码"-12"
         if any(keyword in unit for keyword in ["省公司本部", "雄安基地建设部", "华北基地建设部"]):

+ 3 - 3
car/car-wei-zhang/car_wei_zhang.py

@@ -15,7 +15,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/car/wei-zhang/'
 # 数据库连接信息
@@ -211,7 +211,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 根据单位名称中的关键词返回对应的一级单位
-        if "机动通信局" in unit or "机动局" in unit:
+        if "机动通信局" in unit or "机动局" in unit or "传输局" in unit or "线路维护中心" in unit:
             return "机动局"
         if "雄安基地建设部" in unit:
             return "雄安基地建设部"
@@ -299,7 +299,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 如果单位包含特定关键词(如“机动通信局”等),返回固定编码"-11"
-        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局"]):
+        if any(keyword in unit for keyword in ["机动通信局", "机动局", "传输局", "线路维护中心"]):
             return "-11"
         # 如果单位包含特定关键词(如“省公司本部”等),返回固定编码"-12"
         if any(keyword in unit for keyword in ["省公司本部", "雄安基地建设部", "华北基地建设部"]):

+ 2 - 2
car/car-zu-lin/car_zu_lin.py

@@ -14,7 +14,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/car/zu-lin/'
 # 数据库连接信息
@@ -123,7 +123,7 @@ def data_process():
         if pd.isna(unit) or not unit or not unit.strip():
             return ""
         # 根据单位名称中的关键词返回对应的一级单位
-        if "机动通信局" in unit or "机动局" in unit:
+        if "机动通信局" in unit or "机动局" in unit or "传输局" in unit or "线路维护中心" in unit:
             return "机动局"
         if "雄安基地建设部" in unit:
             return "雄安基地建设部"

+ 3 - 3
house/house-abnormal-data/house_abnormal_data.py

@@ -17,7 +17,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/abnormal-data/'
 # 数据库连接信息
@@ -110,7 +110,7 @@ def data_process():
         ny = t.replace('.xlsx', '').split('_')[0]  # 提取年月信息
         ds = t.replace('.xlsx', '').split('_')[1]  # 提取地市信息
         tmp = pd.read_excel(output_dir + t, skiprows=8, header=None)  # 读取Excel文件内容
-        if '省本部' in ds:
+        if '省本部' in ds or '省公司' in ds:
             tmp = pd.read_excel(output_dir + t, skiprows=8, header=None, nrows=1)  # 特殊处理省本部文件
         tmp['年月'] = ny  # 添加年月列
         tmp['地市'] = ds  # 添加地市列
@@ -138,7 +138,7 @@ def data_process():
     def get_area_no(x):
         second_unit = x['second_unit']
         third_unit = x['third_unit']
-        if '长途局' in second_unit or '长途通信传输局' in second_unit or '机动局' in second_unit:
+        if '长途局' in second_unit or '长途通信传输局' in second_unit or '机动局' in second_unit or '传输局' in second_unit:
             return '-11'
         if '保定' in second_unit and ('雄县' in third_unit or '容城' in third_unit or '安新' in third_unit):
             return '782'

+ 1 - 1
house/house-building/house_building.py

@@ -18,7 +18,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/building/'
 # 数据库连接信息

+ 88 - 4
house/house-fang-jian/house_fang_jian.py

@@ -15,7 +15,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/room/'
 # 数据库连接信息
@@ -137,7 +137,6 @@ def data_process():
         third_unit = x['资产所属单位(三级)']
         area_name = x['二级组织机构名称']
         area_no = x['二级组织机构编码']
-        # 根据特定规则匹配城市编码
         if area_name == '石家庄':
             if '矿区' in third_unit:
                 return 'D0130185'
@@ -148,7 +147,76 @@ def data_process():
                 return 'D0130185'
             if '北戴河' in third_unit:
                 return 'D0130304'
-        # 其他规则省略...
+        if area_name == '唐山':
+            if '滦县' in third_unit:
+                return 'D0130223'
+            if '高新技术开发区' in third_unit:
+                return 'D0130205'
+        if area_name == '邢台':
+            if '内丘' in third_unit:
+                return 'D0130523'
+            if '任泽' in third_unit:
+                return 'D0130526'
+        if area_name == '邯郸':
+            if '峰峰' in third_unit:
+                return 'D0130406'
+        if area_name == '省机动局':
+            if '沧州' in third_unit:
+                return 'HECS180'
+            if '唐山' in third_unit:
+                return 'HECS181'
+            if '秦皇岛' in third_unit:
+                return 'HECS182'
+            if '廊坊' in third_unit:
+                return 'HECS183'
+            if '张家口' in third_unit:
+                return 'HECS184'
+            if '邢台' in third_unit:
+                return 'HECS185'
+            if '邯郸' in third_unit:
+                return 'HECS186'
+            if '保定' in third_unit:
+                return 'HECS187'
+            if '石家庄' in third_unit:
+                return 'HECS188'
+            if '承德' in third_unit:
+                return 'HECS189'
+            if '衡水' in third_unit:
+                return 'HECS720'
+            if '雄安' in third_unit:
+                return 'HECS728'
+            return 'HECS018'
+        if '雄安' == area_name:
+            third_unit = third_unit.replace('雄安新区', '')
+        third_org_list = third_org_list_map[area_no]
+        for third_org in third_org_list:
+            city_name = third_org['name']
+            if city_name in third_unit:
+                return third_org['id']
+        if '沧州' == area_name:
+            return 'D0130911'
+        if '唐山' == area_name:
+            return 'D0130202'
+        if '秦皇岛' == area_name:
+            return 'D0130302'
+        if '廊坊' == area_name:
+            return 'D0131000'
+        if '张家口' == area_name:
+            return 'D0130701'
+        if '邢台' == area_name:
+            return 'D0130502'
+        if '邯郸' == area_name:
+            return 'D0130402'
+        if '保定' == area_name:
+            return 'D0130601'
+        if '石家庄' == area_name:
+            return 'D0130186'
+        if '承德' == area_name:
+            return 'D0130801'
+        if '衡水' == area_name:
+            return 'D0133001'
+        if '雄安' == area_name:
+            return 'D0130830'
         return 'HE001'
 
     # 应用 get_city_no 函数,生成三级组织机构编码列
@@ -205,7 +273,23 @@ def data_process():
                 return '130107'
             if '井陉' in address:
                 return '130121'
-        # 其他规则省略...
+        if city == '唐山':
+            if '滦县' in address:
+                return '130284'
+        if city == '邢台':
+            if '内邱' in address:
+                return '130523'
+            if '任县' in address:
+                return '130505'
+        if city == '雄安':
+            address = address.replace('雄安新区', '')
+        districts = districts_list_map.get(city_id)
+        if not districts:
+            return ''
+        for district in districts:
+            district_name = district['short_name']
+            if district_name in address:
+                return district['area_id']
         return ''
 
     # 应用 get_district_id 函数,生成区县 ID 列

+ 1 - 1
house/house-land/house_land.py

@@ -16,7 +16,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/land/'
 # 数据库连接信息

+ 1 - 1
house/house-site/house_site.py

@@ -15,7 +15,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/site/'
 # 数据库连接信息

+ 14 - 14
house/house-zu-ru-he-tong/house_zu_ru_he_tong.py

@@ -16,7 +16,7 @@ logger.add(sink='a.log')
 ssh_hostname = '172.16.107.4'  # 定义远程主机地址
 ssh_port = 22  # 定义SSH服务的端口号
 ssh_username = 'app'  # 定义登录远程主机的用户名
-ssh_password = 'Hebei_123.'  # 定义登录远程主机的密码
+ssh_password = '(l4w0ST_'  # 定义登录远程主机的密码
 # 服务器文件夹路径
 remote_dir_path = '/data/history/house/zu-ru-he-tong/'
 # 数据库连接信息
@@ -275,19 +275,19 @@ def data_process():
     df['unit_price2'] = df.apply(get_unit_price2, axis=1)
 
 
-    # def remove_extra_dots(s):
-    #     if pd.isna(s) or not s:
-    #         return None
-    #     match = re.search(r'\.', s)
-    #     if match:
-    #         first_dot_index = match.start()
-    #         return s[:first_dot_index + 1] + s[first_dot_index + 1:].replace('.', '')
-    #     else:
-    #         return s
-    #
-    #
-    # df['地址经度坐标'] = df['地址经度坐标'].map(remove_extra_dots)
-    # df['地址纬度坐标'] = df['地址纬度坐标'].map(remove_extra_dots)
+    def remove_extra_dots(s):
+        if pd.isna(s) or not s:
+            return None
+        match = re.search(r'\.', s)
+        if match:
+            first_dot_index = match.start()
+            return s[:first_dot_index + 1] + s[first_dot_index + 1:].replace('.', '')
+        else:
+            return s
+
+
+    df['地址经度坐标'] = df['地址经度坐标'].map(remove_extra_dots)
+    df['地址纬度坐标'] = df['地址纬度坐标'].map(remove_extra_dots)
     df.insert(0, '年月', year_month)  # 在数据框的第一列插入年月字段
     # 打印数据框的基本信息
     print(df.info())