From a08bac91b6abfc496155ab3af8c836787a47fe48 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 26 Aug 2026 14:54:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=93=81=E5=8C=96):=20=E8=A1=A5?= =?UTF-8?q?=205=20=E4=B8=AA=E6=A8=A1=E5=9D=97=E9=9B=86=E6=88=90=20+=20?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E4=B8=A4=E4=B8=AA=E8=B5=84=E6=BA=90=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=20+=20accounting=20=E8=8F=9C=E5=8D=95(=E5=8F=82?= =?UTF-8?q?=E8=80=83=20sage)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关键修复:accounting/pricing/discount/unipay 的表和前端早已就位, 但 app/pipeline_app.py 从未 load 它们 —— 相关页面一点即 NameError 500。 - 入口补 load_pricing/accounting/discount/unipay + load_account_resource/storage_resource 顺序:pricing 先于 accounting 与资源模块(资源计费依赖 pricing_program_charging) - build.sh 四处列表 + 8b DDL 循环加 account_resource/storage_resource - wwwroot/index.ui 加「账务管理」菜单 11 子项(参考 sage menu.ui 的配置账务结构) 按 pipeline-app 实际存在的页面取项:sage 菜单里的 open_account.ui 本模块不存在,已剔除, 另补上 sage 未列但存在的 我的账户/余额/明细/账单/信用额度/币种/汇率/记账日志 - i18n 四语言补「账务管理」 --- app/pipeline_app.py | 33 ++++++++++++++++++++++++ build.sh | 12 +++++---- i18n/en/msg.txt | 1 + i18n/jp/msg.txt | 1 + i18n/ko/msg.txt | 1 + i18n/zh/msg.txt | 1 + wwwroot/index.ui | 62 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 106 insertions(+), 5 deletions(-) diff --git a/app/pipeline_app.py b/app/pipeline_app.py index 752532d..9f0c04a 100644 --- a/app/pipeline_app.py +++ b/app/pipeline_app.py @@ -60,6 +60,32 @@ def init(): from dingdingflow.init import load_dingdingflow except ImportError: def load_dingdingflow(): pass + # ── 商品化:定价/账务/折扣/支付(模块与表早已就位,此前一直没 load,页面点了即 500)── + try: + from pricing.init import load_pricing + except ImportError: + def load_pricing(): pass + try: + from accounting.init import load_accounting + except ImportError: + def load_accounting(): pass + try: + from discount.init import load_discount + except ImportError: + def load_discount(): pass + try: + from unipay.init import load_unipay + except ImportError: + def load_unipay(): pass + # ── 资源模块:各自决定 ppid 挂法,统一暴露 resolve_ppid 给产品层 ── + try: + from account_resource.init import load_account_resource + except ImportError: + def load_account_resource(): pass + try: + from storage_resource.init import load_storage_resource + except ImportError: + def load_storage_resource(): pass set_globalvariable() ServerEnv().get_module_dbname = get_module_dbname @@ -70,6 +96,13 @@ def init(): load_pipeline_ops() load_pipeline_dist() load_dingdingflow() # 先于 pipeline_service:其钉钉审批适配器依赖 register_biz_handler + # 商品化链路:pricing 必须先于资源模块(资源计费要调 pricing_program_charging) + load_pricing() + load_accounting() + load_discount() + load_unipay() + load_account_resource() + load_storage_resource() load_pipeline_service() load_sdlc_adapter() load_app_audit() diff --git a/build.sh b/build.sh index 0feae7f..12cdf36 100644 --- a/build.sh +++ b/build.sh @@ -53,7 +53,7 @@ for mod in pipeline_core pipeline_ops pipeline_dist; do done # 5. Install business modules (clone external, local already in pkgs) -for mod in pipeline-sdlc showcase evaluate pipeline-service pipeline-task tenant app_audit product_management discount pricing unipay smssend accounting uapi rag dingdingflow; do +for mod in pipeline-sdlc showcase evaluate pipeline-service pipeline-task tenant app_audit product_management discount pricing unipay smssend accounting uapi rag dingdingflow account_resource storage_resource; do cd "$cdir/pkgs" if [ ! -d "$mod" ]; then git clone https://git.opencomputing.cn/yumoqing/$mod || echo "SKIP: $mod" @@ -62,7 +62,7 @@ for mod in pipeline-sdlc showcase evaluate pipeline-service pipeline-task tenant done # 6. pip install all modules from pkgs/(pipeline-service 是普通 install 非 editable,部署必 pull+pip install 都做) -for mod in pipeline_core pipeline_ops pipeline_dist pipeline-sdlc showcase pipeline-service tenant app_audit product_management discount pricing unipay smssend accounting uapi rag dingdingflow; do +for mod in pipeline_core pipeline_ops pipeline_dist pipeline-sdlc showcase pipeline-service tenant app_audit product_management discount pricing unipay smssend accounting uapi rag dingdingflow account_resource storage_resource; do if [ -d "pkgs/$mod" ]; then "$cdir/py3/bin/pip" install "pkgs/$mod/" 2>&1 | tail -1 fi @@ -89,7 +89,7 @@ if [ -d "pkgs/pipeline_core/skills_library" ]; then fi # 7. Regenerate CRUD from json for all pipeline modules -for mod in appbase pipeline_core pipeline_ops pipeline_dist pipeline-sdlc rbac dapi accounting uapi rag dingdingflow; do +for mod in appbase pipeline_core pipeline_ops pipeline_dist pipeline-sdlc rbac dapi accounting uapi rag dingdingflow account_resource storage_resource; do json_dir="pkgs/$mod/json" models_dir="pkgs/$mod/models" wwwroot_dir="pkgs/$mod/wwwroot" @@ -102,7 +102,7 @@ done # 8. Link module wwwroot directories (symlinks from pkgs/) -for mod in pipeline-sdlc showcase tenant pipeline_core pipeline_ops pipeline_dist appbase app_audit product_management discount pricing unipay rbac dapi accounting uapi rag dingdingflow; do +for mod in pipeline-sdlc showcase tenant pipeline_core pipeline_ops pipeline_dist appbase app_audit product_management discount pricing unipay rbac dapi accounting uapi rag dingdingflow account_resource storage_resource; do src="pkgs/$mod/wwwroot" dst="wwwroot/$mod" if [ -d "$src" ]; then @@ -117,7 +117,7 @@ mkdir -p wwwroot/pipeline_task # 8b. uapi + rag 模块建表 + 导入外部服务配置种子 # uapi 表(upapp/uapi/uapiio...)必须先建,rag 的 uapi_seed.sql 才有表可插 # rag 表统一 rag_ 前缀,与产线业务表隔离;数据独立于 ragserver(同代码不同宿主,各自的数据) -for m in uapi rag dingdingflow; do +for m in uapi rag dingdingflow account_resource storage_resource; do if [ -d "pkgs/$m/models" ] && ls pkgs/$m/models/*.json >/dev/null 2>&1; then cd "$cdir/pkgs/$m/models" "$cdir/py3/bin/json2ddl" mysql . > "/tmp/pipeline_${m}_ddl.sql" || { @@ -141,6 +141,8 @@ pwd = aes_decode_b64(cfg.password_key, kw.password) # 顺序关键:uapi 建表 → rag 建表 → rag 的 uapi 配置种子 for sqlfile in ['/tmp/pipeline_uapi_ddl.sql', '/tmp/pipeline_rag_ddl.sql', '/tmp/pipeline_dingdingflow_ddl.sql', + '/tmp/pipeline_account_resource_ddl.sql', + '/tmp/pipeline_storage_resource_ddl.sql', 'pkgs/rag/init/uapi_seed.sql']: if not os.path.exists(sqlfile): print(' SKIP (missing): %s' % sqlfile) diff --git a/i18n/en/msg.txt b/i18n/en/msg.txt index 690fe11..0ff16f8 100644 --- a/i18n/en/msg.txt +++ b/i18n/en/msg.txt @@ -22,3 +22,4 @@ Submit: Submit 多媒体(图文音视): Multimedia (image/audio/video) 文本(文档检索): Text (document retrieval) 钉钉审批: DingTalk Approval +账务管理: Accounting diff --git a/i18n/jp/msg.txt b/i18n/jp/msg.txt index 62b7bc0..c970d20 100644 --- a/i18n/jp/msg.txt +++ b/i18n/jp/msg.txt @@ -22,3 +22,4 @@ Submit: 送信 多媒体(图文音视): マルチメディア(画像・音声・動画) 文本(文档检索): テキスト(文書検索) 钉钉审批: DingTalk承認 +账务管理: 会計管理 diff --git a/i18n/ko/msg.txt b/i18n/ko/msg.txt index 5b491bc..47c5141 100644 --- a/i18n/ko/msg.txt +++ b/i18n/ko/msg.txt @@ -22,3 +22,4 @@ Submit: 제출 多媒体(图文音视): 멀티미디어(이미지/음성/영상) 文本(文档检索): 텍스트(문서 검색) 钉钉审批: 딩톡 결재 +账务管理: 회계 관리 diff --git a/i18n/zh/msg.txt b/i18n/zh/msg.txt index f00ffa9..dec54eb 100644 --- a/i18n/zh/msg.txt +++ b/i18n/zh/msg.txt @@ -22,3 +22,4 @@ Submit: Submit 多媒体(图文音视): 多媒体(图文音视) 文本(文档检索): 文本(文档检索) 钉钉审批: 钉钉审批 +账务管理: 账务管理 diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 08dc7dd..f4f9a2f 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -165,6 +165,68 @@ "icon": "{{entire_url('/imgs/mic.svg')}}", "script": "this.open_tab({name:'pipeline_ktv',label:'KTV产线',url:'/pipeline_task/task_submit.ui',removable:true})" }, + { + "name": "accounting", + "label": "账务管理", + "icon": "{{entire_url('/imgs/database.svg')}}", + "items": [ + { + "name": "acc_myaccounts", + "label": "我的账户", + "script": "this.open_tab({name:'acc_myaccounts',label:'我的账户',url:'/accounting/myaccounts.ui',removable:true})" + }, + { + "name": "acc_balance", + "label": "账户余额", + "script": "this.open_tab({name:'acc_balance',label:'账户余额',url:'/accounting/acc_balance/index.ui',removable:true})" + }, + { + "name": "acc_detail", + "label": "账务明细", + "script": "this.open_tab({name:'acc_detail',label:'账务明细',url:'/accounting/accdetail.ui',removable:true})" + }, + { + "name": "acc_billing", + "label": "账单", + "script": "this.open_tab({name:'acc_billing',label:'账单',url:'/accounting/billing.ui',removable:true})" + }, + { + "name": "acc_subject", + "label": "科目配置", + "script": "this.open_tab({name:'acc_subject',label:'科目配置',url:'/accounting/subject/index.ui',removable:true})" + }, + { + "name": "acc_account_config", + "label": "参与方科目配置", + "script": "this.open_tab({name:'acc_account_config',label:'参与方科目配置',url:'/accounting/account_config/index.ui',removable:true})" + }, + { + "name": "acc_accounting_config", + "label": "会计分录配置", + "script": "this.open_tab({name:'acc_accounting_config',label:'会计分录配置',url:'/accounting/accounting_config/index.ui',removable:true})" + }, + { + "name": "acc_credit_limit", + "label": "信用额度", + "script": "this.open_tab({name:'acc_credit_limit',label:'信用额度',url:'/accounting/credit_limit/index.ui',removable:true})" + }, + { + "name": "acc_currency", + "label": "币种", + "script": "this.open_tab({name:'acc_currency',label:'币种',url:'/accounting/currency/index.ui',removable:true})" + }, + { + "name": "acc_exchange_rate", + "label": "汇率", + "script": "this.open_tab({name:'acc_exchange_rate',label:'汇率',url:'/accounting/exchange_rate/index.ui',removable:true})" + }, + { + "name": "acc_log", + "label": "记账日志", + "script": "this.open_tab({name:'acc_log',label:'记账日志',url:'/accounting/accounting_log/index.ui',removable:true})" + } + ] + }, { "name": "dda_approval", "label": "钉钉审批",