Commit Graph

12 Commits

Author SHA1 Message Date
root 40fbba9f61 feat: 添加最新的数据库导出文件
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 19:17:43 +08:00
root a88944b5e1 refactor: 删除 users 表中未使用的字段
- 删除 report_to(上级ID)字段
- 删除 position(职位)字段
- 更新 User 模型移除相关关联和类型转换
- 更新 BusinessTripService 移除 position 返回

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:56:51 +08:00
root fdbe2e837a refactor: 删除 users 表中的冗余飞书字段
- 删除 feishu_user_id, feishu_open_id, tenant_key 字段
- JWT token 改用 feishu_app_id 代替 feishu_user_id
- 删除废弃的 FeishuService::sendApprovalMessage() 方法
- 更新 User 模型移除废弃字段和 scope 方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:33:58 +08:00
root 0489da5e40 refactor: 重构多飞书应用绑定架构和数据库清理
- 新增 user_feishu_apps 表支持用户绑定多个飞书应用
- users 表添加唯一约束(公司内邮箱/手机唯一)
- 迁移现有飞书数据到 user_feishu_apps 表
- 清理冗余表(users_bak, user_feishu_binding)
- 废弃 users 表中的 feishu_user_id/feishu_open_id/tenant_key 字段
- 更新 FeishuNotificationService 使用新的数据获取方式
- User 模型新增 getFeishuUserId() 等便捷方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:27:33 +08:00
root 3968e94195 feat: 实现默认审批人和抄送人功能
- 后端新增 getDefaultApprovers 接口,从审批流程配置中获取默认审批人和抄送人
- 前端申请页面加载时自动获取并显示默认审批人和抄送人
- 添加默认审批流程配置:1个审批人(闫继光) + 2个抄送人(孟启、程丽敏)
- 移除后端 support 目录下的自定义 Db 和 Model 类,使用 Webman 官方实现
- 前端选择页面优化:优先从 sessionStorage 恢复,否则加载后端默认配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 18:54:38 +08:00
root 6e61d0adc7 feat: add complete database initialization script
- Add 008_complete_init.sql with all 10 tables
- Include approval workflow tables:
  - approval_flow (审批流程配置表)
  - approval_node (审批流程节点表)
  - approval_order (审批单表)
  - approval_record (审批记录表)
- Include business trip tables:
  - business_trip (出差申请表)
  - business_trip_itinerary (出差行程明细表)
- Include user_feishu_binding (用户飞书应用绑定表)

All tables use proper UTF-8 encoding with utf8mb4_unicode_ci collation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 21:27:49 +08:00
root be9ae8a0d9 fix: switch to xserver database with UTF-8 data
- Change default database from x_server_mobile to xserver
- Add 007_xserver_init.sql initialization script
- Companies data now correctly encoded in UTF-8:
  - 合塑 (hesu)
  - 新友合 (xinyouhe)
  - 派卡 (paika)
  - 斯玛特 (simate)
  - magic bridge Auto (mbaf)
- Company Feishu apps properly configured

The key fix is to execute SQL directly inside the MySQL container
using heredoc to avoid charset conversion issues during transfer.

Usage:
docker exec 1Panel-mysql-409s mysql -uroot -p'mysql_xEsdPa' --default-character-set=utf8mb4 xserver < 007_xserver_init.sql

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:56:52 +08:00
root 5d989dfd86 fix: add UTF-8 encoding fix migration
- Add 006_fix_encoding_utf8.sql migration script
- Properly sets UTF-8 charset for table creation
- Recreates companies and users tables with correct Chinese comments
- Imports company data with correct UTF-8 encoding

Usage:
docker exec -i 1Panel-mysql-409s mysql -uroot -p'mysql_xEsdPa' --default-character-set=utf8mb4 x_server_mobile < 006_fix_encoding_utf8.sql

Fixes encoding issues where Chinese text appears as garbled characters
due to MySQL client using latin1 charset instead of utf8mb4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:49:41 +08:00
root e748eba55b fix: add table structure migration with UTF-8 encoding
- Update .gitignore to allow backend database migrations
- Add 004_fix_table_structure.sql migration
- Rename tables to plural form (user->users, company->companies)
- Add missing fields to companies and users tables
- Create company_feishu_apps table for multi-app configuration
- Import company data and Feishu app configurations
- Set UTF-8 charset to fix encoding issues from MySQL 5.7 export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:44:40 +08:00
root 423a04a610 refactor: remove complex migration, keep simplified approach
- Remove 002_merge_old_data.sql (complex approach with temp tables)
- Keep 003_import_feishu_config.sql (simplified data import)

Follows principle: only import needed data, not full compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:16:53 +08:00
root 1f6d346f6a feat: add multi-company Feishu integration and data migration
- Add companies table enhancements (abbr, tenant_key, feishu_enabled)
- Add users table enhancements (feishu fields, sn, report_to, etc.)
- Create company_feishu_apps table for multi-app per company
- Create user_sn_pool table for user number management
- Update FeishuService to support multiple Feishu apps per company
- Add data migration script (002_merge_old_data.sql)
- Add import script (scripts/import_old_data.php)
- Update User and Company models with new scopes and relationships
- Add CompanyFeishuApp model
- Add Git workflow documentation (GIT_WORKFLOW.md)

This supports:
- Multi-company architecture with Feishu integration
- Multiple Feishu apps per company (X-Server, Ticket, CRM)
- User number assignment system
- Data migration from old project

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 18:12:18 +08:00
root 8d78e18267 Initial commit: X-Server Mobile enterprise tool system
- Frontend: React 18 + TypeScript + Vite + Ant Design Mobile
- Backend: PHP 8.5 + Webman 2.x + MySQL + Redis
- i18n support: Chinese, English, Russian, Spanish, French
- Approval workflow engine
- Docker development environment
- Feishu integration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:57:25 +08:00