Files
BLD_sync/config/file_sources.py
Misaka_Company f6580b4994 refactor: remove Excel migration pipeline; keep Access-only sync
Drop the Excel (.xlsm) production-execution-card pipeline now that the
project only synchronizes Access databases to SQL Server.

- Delete excel_sync_to_sql.py, migration.py, config/field_mappings.py
- Remove Excel-only config symbols (EXCEL_CONFIGS, MIGRATION_TASKS,
  EXECUTION_CARD_FIELDS, CONTRACT_DATA_*, CACHE_DIR, TEMP_DIR,
  EXCEL_SYNC_* settings) from the config package
- Drop now-unused deps from requirements.txt: pandas, sqlalchemy, openpyxl
- Update .env.example, CLAUDE.md, and the uptime_kuma_utils docstring
- Fix the tube-bending workshop Access table mapping in SYNC_MAPPING
  (source table renamed; old name no longer exists)

The three Excel-sourced tables in warehouseOutbound (executionCardData,
contractData, customerProductType) and their data are left untouched.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 13:09:36 +08:00

323 lines
11 KiB
Python

# config/file_sources.py
# 文件路径配置 - 从原 config.py 和 update_config.py 抽离
# ================= Access 同步映射配置 =================
# 从原 config.py 抽取
# 结构: { "Access文件绝对路径": { "Access表名": { SQL目标配置 } } }
SYNC_MAPPING = {
# 第一个 Access 文件
r"\\192.168.110.114\生产进度表\2025年数据\生产合同数据.accdb": {
"26年压力表合同数据": {
"target_schema": "productionContractData",
"target_table": "26年压力表合同数据",
"pk_col": "ID"
},
"26年温度计合同数据": {
"target_schema": "productionContractData",
"target_table": "26年温度计合同数据",
"pk_col": "ID"
},
"25年压力表合同数据": {
"target_schema": "productionContractData",
"target_table": "25年压力表合同数据",
"pk_col": "ID"
},
"25年温度计合同数据": {
"target_schema": "productionContractData",
"target_table": "25年温度计合同数据",
"pk_col": "ID"
},
"25年变送器合同数据": {
"target_schema": "productionContractData",
"target_table": "25年变送器合同数据",
"pk_col": "ID"
},
"26年变送器合同数据": {
"target_schema": "productionContractData",
"target_table": "26年变送器合同数据",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\成品入库.accdb": {
"成品交检记录": {
"target_schema": "productWarehousing",
"target_table": "成品交检记录_YEAR2026",
"pk_col": "ID"
},
"成品入库记录": {
"target_schema": "productWarehousing",
"target_table": "成品入库记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\一车间.accdb": {
"一车间记录": {
"target_schema": "workshopOne",
"target_table": "一车间记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\二车间.accdb": {
"二车间记录": {
"target_schema": "workshopTwo",
"target_table": "二车间记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\三车间.accdb": {
"三车间记录": {
"target_schema": "workshopThree",
"target_table": "三车间记录_YEAR2026",
"pk_col": "ID"
},
"温度计调校记录": {
"target_schema": "workshopThree",
"target_table": "温度计调校记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\机加工.accdb": {
"隔膜机加接收": {
"target_schema": "machining",
"target_table": "隔膜机加接收_YEAR2026",
"pk_col": "ID"
},
"膜片焊接": {
"target_schema": "machining",
"target_table": "膜片焊接_YEAR2026",
"pk_col": "ID"
},
"膜片接收": {
"target_schema": "machining",
"target_table": "膜片接收_YEAR2026",
"pk_col": "ID"
},
"喷涂寄出": {
"target_schema": "machining",
"target_table": "喷涂寄出_YEAR2026",
"pk_col": "ID"
},
"车波纹": {
"target_schema": "machining",
"target_table": "车波纹_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\计划.accdb": {
"报警器接单记录": {
"target_schema": "contractPlanning",
"target_table": "报警器接单记录_YEAR2026",
"pk_col": "ID"
},
"二车间接单记录": {
"target_schema": "contractPlanning",
"target_table": "二车间接单记录_YEAR2026",
"pk_col": "ID"
},
"隔膜接单记录": {
"target_schema": "contractPlanning",
"target_table": "隔膜接单记录_YEAR2026",
"pk_col": "ID"
},
"过压保护器接单记录": {
"target_schema": "contractPlanning",
"target_table": "过压保护器接单记录_YEAR2026",
"pk_col": "ID"
},
"精密表部件接收记录": {
"target_schema": "contractPlanning",
"target_table": "精密表部件接收记录_YEAR2026",
"pk_col": "ID"
},
"精密表接单记录": {
"target_schema": "contractPlanning",
"target_table": "精密表接单记录_YEAR2026",
"pk_col": "ID"
},
"库房接单记录": {
"target_schema": "contractPlanning",
"target_table": "库房接单记录_YEAR2026",
"pk_col": "ID"
},
"软管接单记录": {
"target_schema": "contractPlanning",
"target_table": "软管接单记录_YEAR2026",
"pk_col": "ID"
},
"氩弧焊接单记录": {
"target_schema": "contractPlanning",
"target_table": "氩弧焊接单记录_YEAR2026",
"pk_col": "ID"
},
"一车间接单记录": {
"target_schema": "contractPlanning",
"target_table": "一车间接单记录_YEAR2026",
"pk_col": "ID"
},
"阻尼器接单记录": {
"target_schema": "contractPlanning",
"target_table": "阻尼器接单记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\检验记录数据库.accdb": {
"检验合格记录表": {
"target_schema": "inspectionRecords",
"target_table": "检验合格记录表_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\零件库.accdb": {
"表盘缺件记录": {
"target_schema": "partsWarehouse",
"target_table": "表盘缺件记录_YEAR2026",
"pk_col": "ID"
},
"表盘入库记录": {
"target_schema": "partsWarehouse",
"target_table": "表盘入库记录_YEAR2026",
"pk_col": "ID"
},
"部件发放记录": {
"target_schema": "partsWarehouse",
"target_table": "部件发放记录_YEAR2026",
"pk_col": "ID"
},
"出库单发出记录": {
"target_schema": "partsWarehouse",
"target_table": "出库单发出记录_YEAR2026",
"pk_col": "ID"
},
"出库单记录": {
"target_schema": "partsWarehouse",
"target_table": "出库单记录_YEAR2026",
"pk_col": "ID"
},
"法兰缺件记录": {
"target_schema": "partsWarehouse",
"target_table": "法兰缺件记录_YEAR2026",
"pk_col": "ID"
},
"法兰入库记录": {
"target_schema": "partsWarehouse",
"target_table": "法兰入库记录_YEAR2026",
"pk_col": "ID"
},
"卡到库房记录": {
"target_schema": "partsWarehouse",
"target_table": "卡到库房记录_YEAR2026",
"pk_col": "ID"
},
"喷涂到厂": {
"target_schema": "partsWarehouse",
"target_table": "喷涂到厂_YEAR2026",
"pk_col": "ID"
},
"缺件记录": {
"target_schema": "partsWarehouse",
"target_table": "缺件记录_YEAR2026",
"pk_col": "ID"
},
"温度计法兰缺件记录": {
"target_schema": "partsWarehouse",
"target_table": "温度计法兰缺件记录_YEAR2026",
"pk_col": "ID"
},
"温度计法兰入库记录": {
"target_schema": "partsWarehouse",
"target_table": "温度计法兰入库记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\温度计记录.accdb": {
"采 技 机记录": {
"target_schema": "thermometerRecord",
"target_table": "采 技 机记录_YEAR2026",
"pk_col": "ID"
},
"温度计调校记录": {
"target_schema": "thermometerRecord",
"target_table": "温度计调校记录_YEAR2026",
"pk_col": "ID"
},
"温度计检验记录": {
"target_schema": "thermometerRecord",
"target_table": "温度计检验记录_YEAR2026",
"pk_col": "ID"
},
"温度计组装记录": {
"target_schema": "thermometerRecord",
"target_table": "温度计组装记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\锡焊数据.accdb": {
"操作者1完成记录": {
"target_schema": "solderingData",
"target_table": "操作者1完成记录_YEAR2026",
"pk_col": "ID"
},
"操作者2完成记录": {
"target_schema": "solderingData",
"target_table": "操作者2完成记录_YEAR2026",
"pk_col": "ID"
},
"零件到车间记录": {
"target_schema": "solderingData",
"target_table": "零件到车间记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\氩弧焊.accdb": {
"表壳焊接记录": {
"target_schema": "TIGWelding",
"target_table": "表壳焊接记录_YEAR2026",
"pk_col": "ID"
},
"超压": {
"target_schema": "TIGWelding",
"target_table": "超压_YEAR2026",
"pk_col": "ID"
},
"氦测": {
"target_schema": "TIGWelding",
"target_table": "氦测_YEAR2026",
"pk_col": "ID"
},
"接收": {
"target_schema": "TIGWelding",
"target_table": "接收_YEAR2026",
"pk_col": "ID"
},
"退火": {
"target_schema": "TIGWelding",
"target_table": "退火_YEAR2026",
"pk_col": "ID"
},
"氩弧焊记录": {
"target_schema": "TIGWelding",
"target_table": "氩弧焊记录_YEAR2026",
"pk_col": "ID"
},
"氩弧焊领料": {
"target_schema": "TIGWelding",
"target_table": "氩弧焊领料_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\执行卡下发记录.accdb": {
"执行卡下发记录": {
"target_schema": "executionCardIssuanceRecord",
"target_table": "执行卡下发记录_YEAR2026",
"pk_col": "ID"
}
},
r"\\192.168.110.114\生产进度表\2026年数据\弯管车间.accdb": {
"烘洗": {
"target_schema": "tubeBending",
"target_table": "烘洗_YEAR2026",
"pk_col": "ID"
}
}
}