project-context.md 3.9 KB

项目上下文(Codex 侧)

来源:基于仓库现状与 .cursor/ 配置整理。 约束:只读取 .cursor,不修改 .cursor

1. 项目整体结构

  • 泰额版/Food Labeling Management Platform/
    • React 18 + TypeScript + Vite 6
    • 模块更完整,包含 Dashboard、Labels、Training、Alerts、Products、People、Reports、Locations、Devices、Invoices、QR Codes,以及 Tasks / Sensors / Food Waste / E-Label / API 等入口
  • 美国版/Food Labeling Management Platform/
    • React 18 + TypeScript + Vite 6
    • 模块较泰额版少,主要包含 Dashboard、Labels、Training、Alerts、Products、People、Reports、Locations
  • 美国版/Food Labeling Management App UniApp/
    • uni-app + Vue 3 + TypeScript
    • 页面包含登录、门店选择、标签打印、蓝牙打印、打印日志、语言、支持等
  • 美国版/Food Labeling Management Code/Yi.Abp.Net8/
    • .NET 8 / Yi.Abp / SqlSugar 后端工程
    • 分层包含 ApplicationApplication.ContractsDomainDomain.SharedSqlSugarCoreWeb
  • 打印机SDK/uniapp/
    • 打印相关 uni-app SDK 与原生插件资源
  • 项目相关文档/
    • 标签模板相关 Excel 文档

2. 当前仓库技术判断

前端现状

  • Web 管理端实际是 React + TypeScript + Vite,不是传统 Vue 2 管理后台。
  • 移动端实际是 uni-app + Vue 3
  • 因此 .cursor/rules/project_rules.mdc 中关于 Vue 2.6 + Element UI + Webpack 的描述,更像是历史/迁移前规则,不能覆盖当前真实代码结构。

后端现状

  • .cursor 中关于 ASP.NET Core、SqlSugar、分层架构、XML 注释、SQL 验证等规则,与 美国版/Food Labeling Management Code 的目录结构基本一致,可继续参考。

3. 从 .cursor 迁移过来的可用资料

  • 角色参考:.codex/agents/*.md
  • 技能参考:.codex/skills/*/SKILL.md
  • 原始来源仍然在 .cursor/,若需核对,以 .cursor/ 为准,但不要修改 .cursor

4. 使用建议

  1. 处理后端 API、数据库、SqlSugar:优先参考 .codex/agents/backend-developer.md
  2. 处理 Web UI:参考 .codex/agents/frontend-developer.md,但实现时要以 React 代码风格为准
  3. 做接口测试:参考 .codex/skills/api-interface-testing/SKILL.md
  4. 写或核对统计 SQL:参考 .codex/skills/mcp-mysql-and-sql-validation/SKILL.md
  5. 遇到人员/门店归属历史表:参考 .codex/skills/deprecated-tables-context/SKILL.md

5. 重要冲突处理原则

.cursor 规则与当前仓库事实冲突时,按以下优先级处理:

  1. 当前代码与目录事实优先
  2. 用户明确要求优先
  3. .cursor 中与当前模块仍然匹配的规则再落地执行

例如:

  • 做 React 页面时,不应强行按 Vue 2 / Element UI 规则编写
  • 做 .NET + SqlSugar 后端时,可以继续沿用 .cursor 里的后端约束

6. 工作区注意事项

当前仓库已经存在未提交改动,主要在:

  • .cursor/mcp.json
  • 美国版/Food Labeling Management App UniApp/ 下多个文件
  • 打印机SDK/nativeplugins/scripts/unpackage/ 等目录

后续修改时应避免误覆盖这些现有变更。

7. 美国版业务字段命名(固定映射)

开发与文档中统一使用下列对应关系,不要location 表再新增名为 Region 的列:

界面 / 接口英文 中文 主数据表 门店表 location 字段
Company / Partner 公司 fl_partner Partner(公司名称字符串)
Region / Group 区域 / 组织 fl_groupGroupName GroupName
Location 门店 location LocationCode / LocationName

硬性规则Region 对应 location.GroupName(与 fl_group.GroupName 通过 Partner + 名称匹配)。列表/API 出参字段名可用 region,落库与查询一律用 GroupName