36 Commits

Author SHA1 Message Date
2c5320bb4a feat: product_query_price.dspy替代platformbiz版本 2026-07-24 15:49:09 +08:00
8e2c701e23 fix: get_product.dspy清除ns.org_id防止覆盖product_org_auth子查询; JSON修复editable嵌套 2026-07-13 16:39:26 +08:00
9ea13564ef fix: 导入接受id参数(fallback),错误消息显示category_id 2026-07-13 16:21:24 +08:00
876e4581b7 fix: dspy f-string不能含反斜杠,改用%格式化 2026-07-13 16:15:23 +08:00
f8717ca9a8 debug: import_category_products加参数日志 2026-07-13 16:12:32 +08:00
cfa9b321c4 fix: 导入去除冗余org_id过滤 + 添加providerid回填dspy
- import_category_products: 移除org_id条件(树控件已做过滤)
- backfill_providerid: 从llm.providerid回填product.providerid
2026-07-13 15:36:31 +08:00
5f277949ae feat: product_org_auth model; product_list queries authorized products via product_org_auth 2026-07-10 15:38:29 +08:00
ed32a8556c fix: CRUD endpoint return format - remove json.dumps, use widgettype format 2026-07-03 14:50:49 +08:00
7b69bb4eb2 chore: remove .swp file, add to gitignore 2026-06-29 16:05:26 +08:00
d33072ab21 debug: product_category_create.dspy 加追踪日志定位 WHERE None 错误
添加4处 debug:
- START: 记录完整 params_kw
- fields组装后: 记录 keys + id
- sor.C 前后: 定位崩溃在 INSERT 还是后续 SELECT
- EXCEPTION: 记录完整堆栈
2026-06-29 16:05:18 +08:00
5d77e6e20a fix: product_category create/update/delete去除json.dumps和import; create补充resource_module 2026-06-29 14:40:09 +08:00
e998e2a4b2 bugfix 2026-06-26 14:00:55 +08:00
339fccf6d2 fix: 产品类别创建使用fields过滤确保列数匹配 2026-06-25 15:35:35 +08:00
84f1453856 fix: 修复产品类别创建时INSERT列数不匹配问题 2026-06-25 15:34:22 +08:00
Hermes Agent
47f7e8e5c1 fix: 树控件创建节点后返回user_data,修复新增子项不显示 2026-06-24 22:13:38 +08:00
Hermes Agent
1438de9d58 refactor: 删除 product_type_config(运营商产品类型配置)功能
- 删除 models/product_type_config.json
- 删除 json/product_type_config_list.json (CRUD定义)
- 删除 wwwroot/product_type_config_manage.ui 和 product_type_config_list/ 目录
- 删除 wwwroot/api/product_type_config_{create,update,delete}.dspy
- core.py: 移除 get_operator_config/set_operator_config 方法
- core.py: get_product_detail 不再查询 operator_config
- __init__.py: 移除 wrapper 函数和 env 注册
- product_detail.dspy: 移除 operator_config 查询逻辑
- scripts/load_path.py: 移除所有 product_type_config 权限路径
- menu.ui: 移除"运营商配置"菜单项
- index.ui: 移除"运营商配置"卡片,更新标题描述
- README.md: 移除相关文档
2026-06-24 10:34:48 +08:00
Hermes Agent
6dae1676ef feat: 新增商家产品商城页面(storefront)
- 左侧可收缩产品分类树
- 右侧产品列表(卡片式)和产品详情
- 未登录可浏览,登录后显示购买按钮
- 页面和API注册到load_path.py
2026-06-23 18:19:42 +08:00
Hermes Agent
c78be834d0 refactor: import engine calls resource module's load_product_category_product
- core.py: import_categories_and_products() now takes resource_module as first arg,
  uses importlib to load {resource_module}.init, calls load_product_category_product(parent_category_id)
- Resource module owns the full import logic (read source + write product_management)
- __init__.py: updated wrapper signature
- import_category_products.dspy: updated call
2026-06-23 14:47:12 +08:00
Hermes Agent
0f321b8185 feat: add resource_module field and import sub-categories/products tool
- Add resource_module field to product_category model (stores module name like 'llmage')
- Add resource_module appcode with llmage/supplychain entries to init/data.json
- Add '添加子产品类和产品导入' toolbar tool to tree CRUD (json + generated index.ui)
- Create import_category_products.dspy API endpoint
- Add import_categories_and_products() generic import engine to core.py
- Register import function on ServerEnv
- Update load_path.py with new API endpoint
2026-06-23 13:47:05 +08:00
Hermes Agent
e8f836ba2d 移除临时文件,添加/更新.gitignore 2026-06-22 15:00:30 +08:00
Hermes Agent
f05eea19e5 fix: remove parent_id default '0' from product_category model - Root nodes should have parent_id=NULL, not '0' - Tree query already checks 'parent_id IS NULL' - Revert direct edits to generated dspy files 2026-06-22 14:03:41 +08:00
Hermes Agent
f13651e830 fix: product_category tree root node query + parent_id normalization - get_product_category: accept NULL/empty/'0' as root (parent_id IS NULL OR '' OR '0') - new_product_category: normalize empty/0 parent_id to NULL 2026-06-22 13:59:18 +08:00
Hermes Agent
24605f88e8 fix: datetime->timestamp for audit fields + fix sor.U/sor.I misuse in core.py and API dspy
- All 7 models: created_at/updated_at changed from datetime to timestamp type
  (DDL template auto-generates DEFAULT CURRENT_TIMESTAMP for timestamp type)
- core.py: fix all sor.U() calls passing 3 args (id must be in data dict)
- core.py: fix sor.I() misuse for INSERT (should be sor.C())
- API dspy updates: fix sor.U() 3-arg bug in category/product/type_config/resource/subscription/supplier
- product_resource_supplier_update.dspy: add missing updated_at field
2026-06-22 11:04:46 +08:00
Hermes Agent
26d374919c feat: 菜单增加新增功能入口
- 产品资源绑定管理
- 资源供应商关联管理
- 客户订购管理
- 产品消费记录查询
2026-06-21 11:44:59 +08:00
Hermes Agent
0e79ddc939 fix: CRUD JSON合规格式(tblname+params) + CRUD create/update/delete dspy + load_path更新
- 5个CRUD JSON从自定义格式重写为规范格式(tblname/alias/params)
- 13个新CRUD dspy文件(create/update/delete + noop)
- product_resource_delete含级联删除product_resource_supplier
- product_subscription CRUD含完整校验
- product_usage_log只读(noop dspy)
- load_path.py注册所有新增API和CRUD路径
2026-06-21 11:40:33 +08:00
Hermes Agent
e8860401bc feat: 产品模块完整功能实现 — 资源绑定/多供应商路由/包月订购/消耗引擎/成本计算
新增模型: product_resource, product_resource_supplier, product_subscription, product_usage_log
新增API: 15个.dspy端点(资源绑定/供应商管理/订购/超额/消耗/统计)
新增UI: 4个管理界面(资源绑定/供应商关联/订购管理/消费记录)
核心逻辑: ProductManager新增 bind/unbind/subscribe/product_use/check_quota 等完整业务方法
设计文档: DESIGN.md 完整架构规范
2026-06-20 12:10:32 +08:00
Hermes Agent
bbaa51fcef fix: 补充CRUD自动生成端点的created_at/updated_at时间戳 2026-06-17 17:57:22 +08:00
Hermes Agent
6bf45a2dfc fix: remove imports and use pre-loaded timestampstr/getID in create dspy files
- product_category_create.dspy: removed import json/time/getID, replaced time.strftime with timestampstr(), removed field filter, pass data directly to sor.C()
- product_create.dspy: removed imports, replaced time.strftime with timestampstr()
- product_type_config_create.dspy: removed imports, replaced time.strftime with timestampstr()
2026-06-17 17:49:47 +08:00
Hermes Agent
014d6e593d fix: 产品类别树排除product_type_title编辑,移除冗余alters(框架自动从codes生成) 2026-06-17 17:21:08 +08:00
Hermes Agent
8fda537caa fix: menu and index.ui point directly to CRUD lists instead of iframe wrappers 2026-06-17 16:14:50 +08:00
82b494ecd9 fix: wrap Tabular in VBox with cheight for proper scrolling 2026-05-29 22:09:54 +08:00
235412c9f7 fix: remove hardcoded dark theme colors for light theme support 2026-05-28 16:16:05 +08:00
5d6538b7d3 refactor: dark theme 3-part layout with filler scrollable content 2026-05-26 14:07:11 +08:00
43787a63a4 fix: spec compliance pass - ServerEnv removal in .dspy, core.py DBPools singleton, scripts/load_path.py
- All .dspy files: replace ServerEnv() org_id access with await get_userorgid()
  (get_userorgid is registered as global in ahserver processorResource)
- core.py: simplify _get_db to use DBPools() singleton directly (DBPools is @SingletonDecorator)
  remove unnecessary db.databases = config.databases assignment
- core.py: add MODULE_NAME constant, use env.get_module_dbname(MODULE_NAME) pattern
- Create scripts/load_path.py with all RBAC paths per module-development-spec
  Covers: entry pages, feature .ui files, CRUD directories, all API .dspy endpoints
- .gitignore: add __pycache__/ exclusion
- All models/*.json and json/*.json pass spec validation checks
2026-05-25 17:03:08 +08:00
4fd136bf53 refactor: reseller org_id isolation for product_management module
- product_category: org_id scoped tree, product_table_name -> product_type
- product: org_id scoped, added extra_json for custom attributes, product_type field
- product_type_config: org_id + operator_id dual isolation, unique key on (org_id, operator_id, category_id, config_name)
- All 18 API endpoints enforce org_id filtering via ServerEnv
- core.py: all methods accept optional org_id, default to current user's org
- CRUD definitions: logined_userorgid set to org_id on all lists
- init/data.json: removed hardcoded global categories (managed per reseller)
- Rebuilt mysql.ddl.sql and all CRUD UI files
2026-05-25 17:03:08 +08:00
d1ceed9cb9 feat: initial product_management module - category tree, product registry, operator config, standardized API 2026-05-25 17:03:08 +08:00