kcode-pi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +358 -0
- package/dist/cli/kcode.d.ts +15 -0
- package/dist/cli/kcode.js +153 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +7 -0
- package/docs/KCODE_DISTRIBUTION.md +91 -0
- package/extensions/kingdee-harness.ts +180 -0
- package/extensions/kingdee-header.ts +122 -0
- package/extensions/kingdee-tools.ts +379 -0
- package/knowledge/.backup/v1.0.0/version.json +10 -0
- package/knowledge/cangqiong/product-notes.md +15 -0
- package/knowledge/common/business-flows.md +115 -0
- package/knowledge/common/config-guides.md +110 -0
- package/knowledge/common/error-patterns.md +170 -0
- package/knowledge/common/implementation.md +144 -0
- package/knowledge/cosmic/hard-constraints.md +38 -0
- package/knowledge/cosmic/ksql-datafix.md +34 -0
- package/knowledge/cosmic/platform-baseline.md +32 -0
- package/knowledge/cosmic/plugin-decision-matrix.md +40 -0
- package/knowledge/cosmic/review-checklist.md +40 -0
- package/knowledge/cosmic/unittest.md +35 -0
- package/knowledge/enterprise/api-reference.md +186 -0
- package/knowledge/enterprise/code-patterns.md +217 -0
- package/knowledge/enterprise/plugin-lifecycle.md +188 -0
- package/knowledge/enterprise/tables.json +159 -0
- package/knowledge/flagship/api-reference.md +237 -0
- package/knowledge/flagship/code-patterns.md +246 -0
- package/knowledge/flagship/cosmic-platform-note.md +15 -0
- package/knowledge/flagship/plugin-lifecycle.md +248 -0
- package/knowledge/flagship/tables.json +159 -0
- package/knowledge/version.json +10 -0
- package/knowledge/xinghan/product-notes.md +15 -0
- package/package.json +71 -0
- package/prompts/kd-discuss.md +11 -0
- package/prompts/kd-execute.md +12 -0
- package/prompts/kd-plan.md +12 -0
- package/prompts/kd-ship.md +12 -0
- package/prompts/kd-spec.md +12 -0
- package/prompts/kd-verify.md +12 -0
- package/skills/kd-check/SKILL.md +26 -0
- package/skills/kd-cosmic-dev/SKILL.md +82 -0
- package/skills/kd-cosmic-review/SKILL.md +90 -0
- package/skills/kd-cosmic-unittest/SKILL.md +92 -0
- package/skills/kd-debug/SKILL.md +30 -0
- package/skills/kd-discuss/SKILL.md +24 -0
- package/skills/kd-execute/SKILL.md +22 -0
- package/skills/kd-gen/SKILL.md +34 -0
- package/skills/kd-ksql/SKILL.md +86 -0
- package/skills/kd-plan/SKILL.md +24 -0
- package/skills/kd-ship/SKILL.md +22 -0
- package/skills/kd-spec/SKILL.md +24 -0
- package/skills/kd-verify/SKILL.md +22 -0
- package/themes/kcode-dark.json +81 -0
- package/vendor/kingdee-skills/cosmic-unittest/SKILL.md +788 -0
- package/vendor/kingdee-skills/cosmic-unittest/author-cache.json +5 -0
- package/vendor/kingdee-skills/cosmic-unittest/cosmic-unittest-skill-overview.html +746 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/business-test.md +205 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/common-test.md +257 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/formplugin-test.md +560 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/op-plugin-test.md +231 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/validator-test.md +232 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/business-helper.md +184 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/common-module.md +355 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/convert-plugin.md +130 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/formplugin.md +235 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/op-plugin.md +226 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/validator.md +206 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/SKILL.md +674 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/advanced-scenario-checklist.md +307 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/algox-performance-checklist.md +129 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/coding-standard-checklist.md +491 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/cosmic-api-checklist.md +285 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/data-access-checklist.md +261 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/data-transaction-checklist.md +390 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/domain-logic-checklist.md +295 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/form-plugin-checklist.md +508 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/infra-checklist.md +254 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/ksql-checklist.md +305 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/lifecycle-checklist.md +298 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/operation-plugin-checklist.md +442 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/test-mock-checklist.md +120 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/ui-performance-checklist.md +320 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/scripts/pattern-matcher.py +336 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/scripts/review-score-calculator.py +121 -0
- package/vendor/kingdee-skills/ok-cosmic/CHANGELOG.md +295 -0
- package/vendor/kingdee-skills/ok-cosmic/README.md +460 -0
- package/vendor/kingdee-skills/ok-cosmic/SKILL.md +287 -0
- package/vendor/kingdee-skills/ok-cosmic/agents/openai.yaml +17 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/BatchImportPluginTemplate.java +93 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/BillPlugInTemplate.java +156 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ConvertPlugInTemplate.java +255 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/FormPluginTemplate.java +597 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/IWorkflowPluginTemplate.java +91 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ListPluginTemplate.java +194 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/OpPluginTemplate.java +201 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/OpenApiControllerTemplate.java +103 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/PrintPluginTemplate.java +95 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ReportFormPluginTemplate.java +257 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ReportListDataPluginTemplate.java +70 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/StandardTreeListPluginTemplate.java +130 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/TaskTemplate.java +80 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/TreeListPluginTemplate.java +152 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/WriteBackPlugInTemplate.java +286 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/attachment/AttachmentUploadBindSample.java +93 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/botp/BotpTracePushSample.java +168 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/botp/SampleConvertPlugin.java +223 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/cache/SampleCacheUsage.java +218 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/concurrent/SampleThreadPoolBatch.java +156 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/data/DynamicObjectCrudSample.java +205 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/data/DynamicObjectOpsSample.java +100 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/BeforeOperationConfirmSample.java +217 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ConfirmDialogSample.java +131 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/EntryRowCalculateSample.java +116 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/F7FilterSample.java +134 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/GetAndSetValueSample.java +176 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/HyperlinkJumpSample.java +124 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/OpenBillModalSample.java +253 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ReturnParentDataSample.java +295 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/TreeControlSample.java +140 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ViewControlOpsSample.java +132 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/list/ListPluginBasicSample.java +170 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/list/ListPreOpenFilterSample.java +68 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/message/MessageNotifySample.java +95 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/mq/SampleMQConsumer.java +198 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/mq/sample_mq.xml +15 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/operation/OpAddValidatorsSample.java +137 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/operation/OperationOptionBridgeSample.java +228 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/package-info.java +19 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/BaseDataQuerySample.java +194 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/BatchQuerySample.java +368 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/DataSetQueryStatSample.java +131 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/report/SampleReportFormPlugin.java +179 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/report/SampleReportListDataPlugin.java +616 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/snippets-guide.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/task/ScheduleTaskSample.java +160 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/workflow/SampleWorkflowPlugin.java +302 -0
- package/vendor/kingdee-skills/ok-cosmic/manifest.json +78 -0
- package/vendor/kingdee-skills/ok-cosmic/ok-cosmic-intro.html +903 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/attachment-api.md +114 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/botp-convert.md +98 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/dynamic-object.md +113 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/entity-metadata.md +123 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/event-lifecycle.md +184 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/flex-prop.md +114 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/form-utils.md +133 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/operate-chain.md +159 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/plugin-base.md +218 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/query-dataset.md +149 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/request-context.md +88 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/view-handler.md +157 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-bill.md +76 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-botp.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-form.md +165 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-import.md +69 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-list.md +227 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-openapi.md +112 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-operation.md +135 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-print.md +65 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-report-data.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-report-form.md +90 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-task.md +62 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-tree-list.md +71 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-workflow.md +82 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-writeback.md +71 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-algo.md +67 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-cache.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-dynamic-model-svc.md +82 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-dynamic-object.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-entity-model.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-exception.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-file.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-id.md +47 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-lock.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-log.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-network-control.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-orm-access.md +78 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-request-context.md +62 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-threadpool.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-tx.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-utils.md +67 -0
- package/vendor/kingdee-skills/ok-cosmic/requirements.txt +2 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/a-layer-rules.json +24 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/anti-patterns.md +48 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/cheat-sheet.md +256 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/coding-preferences.md +140 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/constraints.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/decision-matrix.md +222 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/intent-routing.md +94 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/platform-baseline.md +69 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/post-check.md +109 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/config_loader.py +204 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-api-knowledge.py +910 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-basedata-query.py +359 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-config-check.py +181 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-extpoints-query.py +389 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-form-metadata.py +856 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-post-check.py +262 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-post-lint.py +293 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/__init__.py +2 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/base.py +393 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/resource_check.py +176 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/scene_check.py +375 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/style_check.py +434 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/verify_check.py +36 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/route_client.py +186 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/script_utils.py +40 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/sqlite_cache.py +142 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/cuslib/kd-cd-cosmic-commons.jar +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/cuslib/kd-cd-cosmic-features.jar +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/ok-cosmic-docs.db +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/ok-cosmic.json +13 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup-mac.sh +18 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup-windows.bat +53 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup.jar +0 -0
- package/vendor/kingdee-skills/ok-ksql/SKILL.md +81 -0
- package/vendor/kingdee-skills/ok-ksql/agents/openai.yaml +7 -0
- package/vendor/kingdee-skills/ok-ksql/manifest.json +14 -0
- package/vendor/kingdee-skills/ok-ksql/references/ksql-datafix.md +452 -0
- package/vendor/kingdee-skills/ok-ksql/scripts/ksql_lint.py +363 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# 金蝶云星空旗舰版插件生命周期
|
|
2
|
+
|
|
3
|
+
## 表单插件生命周期 (AbstractBillPlugIn)
|
|
4
|
+
|
|
5
|
+
### 生命周期顺序
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
表单打开
|
|
9
|
+
↓
|
|
10
|
+
afterLoadData() - 加载数据后
|
|
11
|
+
↓
|
|
12
|
+
afterCreateNewDataEntity() - 新建数据实体后
|
|
13
|
+
↓
|
|
14
|
+
用户操作
|
|
15
|
+
↓
|
|
16
|
+
afterPropertyChanged() - 字段值变更后
|
|
17
|
+
↓
|
|
18
|
+
beforeSave() - 保存前
|
|
19
|
+
↓
|
|
20
|
+
afterSave() - 保存后
|
|
21
|
+
↓
|
|
22
|
+
beforeSubmit() - 提交前
|
|
23
|
+
↓
|
|
24
|
+
afterSubmit() - 提交后
|
|
25
|
+
↓
|
|
26
|
+
beforeAudit() - 审核前
|
|
27
|
+
↓
|
|
28
|
+
afterAudit() - 审核后
|
|
29
|
+
↓
|
|
30
|
+
表单关闭
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 关键事件详解
|
|
34
|
+
|
|
35
|
+
#### afterLoadData - 数据加载后
|
|
36
|
+
|
|
37
|
+
**触发时机:** 表单数据从数据库加载完成后
|
|
38
|
+
|
|
39
|
+
**用途:**
|
|
40
|
+
- 初始化界面控件
|
|
41
|
+
- 计算派生字段
|
|
42
|
+
- 设置字段可见性
|
|
43
|
+
|
|
44
|
+
**示例:**
|
|
45
|
+
```java
|
|
46
|
+
@Override
|
|
47
|
+
public void afterLoadData(EventObject e) {
|
|
48
|
+
super.afterLoadData(e);
|
|
49
|
+
|
|
50
|
+
// 获取数据实体
|
|
51
|
+
DynamicObject dataEntity = this.getModel().getDataEntity();
|
|
52
|
+
|
|
53
|
+
// 初始化界面
|
|
54
|
+
this.getView().setVisible(true, "field1");
|
|
55
|
+
this.getView().setEnable(false, "field2");
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### afterPropertyChanged - 字段值变更后
|
|
60
|
+
|
|
61
|
+
**触发时机:** 用户修改字段值后
|
|
62
|
+
|
|
63
|
+
**用途:**
|
|
64
|
+
- 联动计算
|
|
65
|
+
- 数据验证
|
|
66
|
+
- 界面刷新
|
|
67
|
+
|
|
68
|
+
**示例:**
|
|
69
|
+
```java
|
|
70
|
+
@Override
|
|
71
|
+
public void afterPropertyChanged(PropertyChangedArgs e) {
|
|
72
|
+
String fieldKey = e.getProperty().getName();
|
|
73
|
+
|
|
74
|
+
if ("qty".equals(fieldKey)) {
|
|
75
|
+
// 数量变更后计算金额
|
|
76
|
+
BigDecimal qty = (BigDecimal) e.getNewValue();
|
|
77
|
+
BigDecimal price = this.getModel().getValue("price");
|
|
78
|
+
BigDecimal amount = qty.multiply(price);
|
|
79
|
+
this.getModel().setValue("amount", amount);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### beforeSave - 保存前
|
|
85
|
+
|
|
86
|
+
**触发时机:** 用户点击保存按钮后,数据保存到数据库前
|
|
87
|
+
|
|
88
|
+
**用途:**
|
|
89
|
+
- 数据校验
|
|
90
|
+
- 自动生成编号
|
|
91
|
+
- 设置默认值
|
|
92
|
+
|
|
93
|
+
**示例:**
|
|
94
|
+
```java
|
|
95
|
+
@Override
|
|
96
|
+
public void beforeSave(BeforeSaveEventArgs e) {
|
|
97
|
+
// 校验必填字段
|
|
98
|
+
DynamicObject dataEntity = this.getModel().getDataEntity();
|
|
99
|
+
String billNo = dataEntity.getString("billno");
|
|
100
|
+
|
|
101
|
+
if (StringUtils.isEmpty(billNo)) {
|
|
102
|
+
e.setCancel(true);
|
|
103
|
+
this.getView().showErrorNotification("单据编号不能为空");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 自动生成编号
|
|
108
|
+
if ("AUTO".equals(billNo)) {
|
|
109
|
+
String newBillNo = generateBillNo();
|
|
110
|
+
dataEntity.set("billno", newBillNo);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 操作插件生命周期 (AbstractOperatePlugin)
|
|
118
|
+
|
|
119
|
+
### 生命周期顺序
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
操作触发
|
|
123
|
+
↓
|
|
124
|
+
onGetValidateRules() - 获取校验规则
|
|
125
|
+
↓
|
|
126
|
+
beforeExecuteOperationTransaction() - 操作执行前
|
|
127
|
+
↓
|
|
128
|
+
executeOperationTransaction() - 执行操作(事务内)
|
|
129
|
+
↓
|
|
130
|
+
afterExecuteOperationTransaction() - 操作执行后
|
|
131
|
+
↓
|
|
132
|
+
操作完成
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 关键事件详解
|
|
136
|
+
|
|
137
|
+
#### beforeExecuteOperationTransaction - 操作执行前
|
|
138
|
+
|
|
139
|
+
**触发时机:** 操作事务开始前
|
|
140
|
+
|
|
141
|
+
**用途:**
|
|
142
|
+
- 业务规则校验
|
|
143
|
+
- 数据预处理
|
|
144
|
+
- 权限检查
|
|
145
|
+
|
|
146
|
+
**示例:**
|
|
147
|
+
```java
|
|
148
|
+
@Override
|
|
149
|
+
public void beforeExecuteOperationTransaction(BeforeExecuteOperationTransactionArgs e) {
|
|
150
|
+
String operateKey = e.getOperateKey();
|
|
151
|
+
|
|
152
|
+
if ("submit".equals(operateKey)) {
|
|
153
|
+
// 提交前校验
|
|
154
|
+
DynamicObject[] dataEntities = e.getDataEntities();
|
|
155
|
+
for (DynamicObject entity : dataEntities) {
|
|
156
|
+
BigDecimal amount = entity.getBigDecimal("amount");
|
|
157
|
+
if (amount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
158
|
+
e.setCancel(true);
|
|
159
|
+
throw new KDException("", "金额必须大于零");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### afterExecuteOperationTransaction - 操作执行后
|
|
167
|
+
|
|
168
|
+
**触发时机:** 操作事务提交后
|
|
169
|
+
|
|
170
|
+
**用途:**
|
|
171
|
+
- 触发下游业务
|
|
172
|
+
- 发送通知
|
|
173
|
+
- 记录日志
|
|
174
|
+
|
|
175
|
+
**示例:**
|
|
176
|
+
```java
|
|
177
|
+
@Override
|
|
178
|
+
public void afterExecuteOperationTransaction(AfterExecuteOperationTransactionArgs e) {
|
|
179
|
+
String operateKey = e.getOperateKey();
|
|
180
|
+
|
|
181
|
+
if ("audit".equals(operateKey)) {
|
|
182
|
+
// 审核后触发下游业务
|
|
183
|
+
DynamicObject[] dataEntities = e.getDataEntities();
|
|
184
|
+
for (DynamicObject entity : dataEntities) {
|
|
185
|
+
triggerDownstreamBusiness(entity);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 校验插件生命周期 (AbstractValidatePlugin)
|
|
194
|
+
|
|
195
|
+
### 生命周期顺序
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
数据提交
|
|
199
|
+
↓
|
|
200
|
+
onGetValidateRules() - 获取校验规则
|
|
201
|
+
↓
|
|
202
|
+
validate() - 执行校验
|
|
203
|
+
↓
|
|
204
|
+
校验结果
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 示例
|
|
208
|
+
|
|
209
|
+
```java
|
|
210
|
+
public class AmountValidatePlugin extends AbstractValidatePlugin {
|
|
211
|
+
|
|
212
|
+
@Override
|
|
213
|
+
public void onGetValidateRules(GetValidateRulesEventArgs e) {
|
|
214
|
+
// 添加校验规则
|
|
215
|
+
e.addValidateRule("amount", "金额必须大于零");
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@Override
|
|
219
|
+
public void validate(ValidateEventArgs e) {
|
|
220
|
+
DynamicObject dataEntity = e.getDataEntity();
|
|
221
|
+
BigDecimal amount = dataEntity.getBigDecimal("amount");
|
|
222
|
+
|
|
223
|
+
if (amount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
224
|
+
e.addError("amount", "金额必须大于零");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 列表插件生命周期 (AbstractListPlugin)
|
|
233
|
+
|
|
234
|
+
### 常用事件
|
|
235
|
+
|
|
236
|
+
```java
|
|
237
|
+
// 列表加载后
|
|
238
|
+
public void afterLoadData(EventObject e)
|
|
239
|
+
|
|
240
|
+
// 行选中后
|
|
241
|
+
public void afterRowClick(AfterRowClickEventArgs e)
|
|
242
|
+
|
|
243
|
+
// 列表操作前
|
|
244
|
+
public void beforeDoOperation(BeforeDoOperationEventArgs e)
|
|
245
|
+
|
|
246
|
+
// 列表操作后
|
|
247
|
+
public void afterDoOperation(AfterDoOperationEventArgs e)
|
|
248
|
+
```
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"T_PUR_POORDER": {
|
|
3
|
+
"name": "采购订单表",
|
|
4
|
+
"module": "采购管理",
|
|
5
|
+
"description": "采购订单主表,记录采购订单的基本信息",
|
|
6
|
+
"fields": [
|
|
7
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
8
|
+
{ "name": "FBILLNO", "type": "varchar(50)", "nullable": false, "description": "单据编号" },
|
|
9
|
+
{ "name": "FDATE", "type": "datetime", "nullable": false, "description": "单据日期" },
|
|
10
|
+
{ "name": "FDOCUMENTSTATUS", "type": "char(1)", "nullable": false, "description": "单据状态:A=暂存,B=已提交,C=已审核" },
|
|
11
|
+
{ "name": "FCANCELSTATUS", "type": "char(1)", "nullable": false, "description": "作废状态:A=正常,B=已作废" },
|
|
12
|
+
{ "name": "FSUPPLIERID", "type": "bigint", "nullable": false, "description": "供应商ID" },
|
|
13
|
+
{ "name": "FPURCHASEORGID", "type": "bigint", "nullable": false, "description": "采购组织ID" },
|
|
14
|
+
{ "name": "FPURCHASEDEPTID", "type": "bigint", "nullable": true, "description": "采购部门ID" },
|
|
15
|
+
{ "name": "FPURCHASERID", "type": "bigint", "nullable": true, "description": "采购员ID" },
|
|
16
|
+
{ "name": "FCURRENCYID", "type": "bigint", "nullable": false, "description": "币种ID" },
|
|
17
|
+
{ "name": "FEXCHANGERATE", "type": "decimal(18,6)", "nullable": false, "description": "汇率" },
|
|
18
|
+
{ "name": "FTOTALAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "价税合计" },
|
|
19
|
+
{ "name": "FTOTALTAXAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "税额" },
|
|
20
|
+
{ "name": "FDESCRIPTION", "type": "varchar(500)", "nullable": true, "description": "备注" },
|
|
21
|
+
{ "name": "FCREATORID", "type": "bigint", "nullable": false, "description": "创建人ID" },
|
|
22
|
+
{ "name": "FCREATETIME", "type": "datetime", "nullable": false, "description": "创建时间" },
|
|
23
|
+
{ "name": "FMODIFIERID", "type": "bigint", "nullable": true, "description": "修改人ID" },
|
|
24
|
+
{ "name": "FMODIFYTIME", "type": "datetime", "nullable": true, "description": "修改时间" },
|
|
25
|
+
{ "name": "FAUDITORID", "type": "bigint", "nullable": true, "description": "审核人ID" },
|
|
26
|
+
{ "name": "FAUDITDATE", "type": "datetime", "nullable": true, "description": "审核日期" }
|
|
27
|
+
],
|
|
28
|
+
"relatedTables": [
|
|
29
|
+
{ "table": "T_PUR_POORDERENTRY", "relation": "FID", "description": "采购订单明细" },
|
|
30
|
+
{ "table": "T_PUR_POORDERFIN", "relation": "FID", "description": "采购订单财务信息" }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"T_PUR_POORDERENTRY": {
|
|
34
|
+
"name": "采购订单明细表",
|
|
35
|
+
"module": "采购管理",
|
|
36
|
+
"description": "采购订单明细表,记录采购订单的物料明细",
|
|
37
|
+
"fields": [
|
|
38
|
+
{ "name": "FENTRYID", "type": "bigint", "nullable": false, "description": "明细ID" },
|
|
39
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主表ID" },
|
|
40
|
+
{ "name": "FSEQ", "type": "int", "nullable": false, "description": "行号" },
|
|
41
|
+
{ "name": "FMATERIALID", "type": "bigint", "nullable": false, "description": "物料ID" },
|
|
42
|
+
{ "name": "FUNITID", "type": "bigint", "nullable": false, "description": "单位ID" },
|
|
43
|
+
{ "name": "FQTY", "type": "decimal(18,6)", "nullable": false, "description": "数量" },
|
|
44
|
+
{ "name": "FPRICE", "type": "decimal(18,6)", "nullable": false, "description": "单价" },
|
|
45
|
+
{ "name": "FAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "金额" },
|
|
46
|
+
{ "name": "FTAXPRICE", "type": "decimal(18,6)", "nullable": false, "description": "含税单价" },
|
|
47
|
+
{ "name": "FTAXAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "价税合计" },
|
|
48
|
+
{ "name": "FTAXRATE", "type": "decimal(18,2)", "nullable": false, "description": "税率" },
|
|
49
|
+
{ "name": "FDELIVERYDATE", "type": "datetime", "nullable": true, "description": "交货日期" },
|
|
50
|
+
{ "name": "FWAREHOUSEID", "type": "bigint", "nullable": true, "description": "收货仓库ID" },
|
|
51
|
+
{ "name": "FDESCRIPTION", "type": "varchar(500)", "nullable": true, "description": "备注" }
|
|
52
|
+
],
|
|
53
|
+
"relatedTables": [
|
|
54
|
+
{ "table": "T_PUR_POORDER", "relation": "FID", "description": "采购订单主表" },
|
|
55
|
+
{ "table": "T_BD_MATERIAL", "relation": "FMATERIALID", "description": "物料表" }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"T_SAL_ORDER": {
|
|
59
|
+
"name": "销售订单表",
|
|
60
|
+
"module": "销售管理",
|
|
61
|
+
"description": "销售订单主表,记录销售订单的基本信息",
|
|
62
|
+
"fields": [
|
|
63
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
64
|
+
{ "name": "FBILLNO", "type": "varchar(50)", "nullable": false, "description": "单据编号" },
|
|
65
|
+
{ "name": "FDATE", "type": "datetime", "nullable": false, "description": "单据日期" },
|
|
66
|
+
{ "name": "FDOCUMENTSTATUS", "type": "char(1)", "nullable": false, "description": "单据状态:A=暂存,B=已提交,C=已审核" },
|
|
67
|
+
{ "name": "FCUSTID", "type": "bigint", "nullable": false, "description": "客户ID" },
|
|
68
|
+
{ "name": "FSALEORGID", "type": "bigint", "nullable": false, "description": "销售组织ID" },
|
|
69
|
+
{ "name": "FSALEDEPTID", "type": "bigint", "nullable": true, "description": "销售部门ID" },
|
|
70
|
+
{ "name": "FSALEERID", "type": "bigint", "nullable": true, "description": "销售员ID" },
|
|
71
|
+
{ "name": "FCURRENCYID", "type": "bigint", "nullable": false, "description": "币种ID" },
|
|
72
|
+
{ "name": "FEXCHANGERATE", "type": "decimal(18,6)", "nullable": false, "description": "汇率" },
|
|
73
|
+
{ "name": "FTOTALAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "价税合计" },
|
|
74
|
+
{ "name": "FDESCRIPTION", "type": "varchar(500)", "nullable": true, "description": "备注" }
|
|
75
|
+
],
|
|
76
|
+
"relatedTables": [
|
|
77
|
+
{ "table": "T_SAL_ORDERENTRY", "relation": "FID", "description": "销售订单明细" }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"T_STK_INVENTORY": {
|
|
81
|
+
"name": "库存余额表",
|
|
82
|
+
"module": "库存管理",
|
|
83
|
+
"description": "库存余额表,记录各仓库的物料库存数量",
|
|
84
|
+
"fields": [
|
|
85
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
86
|
+
{ "name": "FSTOCKID", "type": "bigint", "nullable": false, "description": "仓库ID" },
|
|
87
|
+
{ "name": "FMATERIALID", "type": "bigint", "nullable": false, "description": "物料ID" },
|
|
88
|
+
{ "name": "FLOT", "type": "varchar(50)", "nullable": true, "description": "批号" },
|
|
89
|
+
{ "name": "FQTY", "type": "decimal(18,6)", "nullable": false, "description": "库存数量" },
|
|
90
|
+
{ "name": "FBASEQTY", "type": "decimal(18,6)", "nullable": false, "description": "基本单位数量" },
|
|
91
|
+
{ "name": "FSECQTY", "type": "decimal(18,6)", "nullable": true, "description": "辅助单位数量" },
|
|
92
|
+
{ "name": "FAMOUNT", "type": "decimal(18,2)", "nullable": false, "description": "库存金额" },
|
|
93
|
+
{ "name": "FPRICE", "type": "decimal(18,6)", "nullable": false, "description": "库存单价" }
|
|
94
|
+
],
|
|
95
|
+
"relatedTables": [
|
|
96
|
+
{ "table": "T_BD_MATERIAL", "relation": "FMATERIALID", "description": "物料表" },
|
|
97
|
+
{ "table": "T_BD_STOCK", "relation": "FSTOCKID", "description": "仓库表" }
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"T_BD_MATERIAL": {
|
|
101
|
+
"name": "物料表",
|
|
102
|
+
"module": "基础资料",
|
|
103
|
+
"description": "物料主数据,记录物料的基本信息",
|
|
104
|
+
"fields": [
|
|
105
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
106
|
+
{ "name": "FNUMBER", "type": "varchar(50)", "nullable": false, "description": "物料编码" },
|
|
107
|
+
{ "name": "FNAME", "type": "varchar(200)", "nullable": false, "description": "物料名称" },
|
|
108
|
+
{ "name": "FSPECIFICATION", "type": "varchar(500)", "nullable": true, "description": "规格型号" },
|
|
109
|
+
{ "name": "FBASEUNITID", "type": "bigint", "nullable": false, "description": "基本单位ID" },
|
|
110
|
+
{ "name": "FGROUPID", "type": "bigint", "nullable": false, "description": "物料分组ID" },
|
|
111
|
+
{ "name": "FENABLESTATUS", "type": "char(1)", "nullable": false, "description": "启用状态:A=启用,B=禁用" },
|
|
112
|
+
{ "name": "FDESCRIPTION", "type": "varchar(500)", "nullable": true, "description": "备注" }
|
|
113
|
+
],
|
|
114
|
+
"relatedTables": [
|
|
115
|
+
{ "table": "T_BD_UNIT", "relation": "FBASEUNITID", "description": "计量单位表" }
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"T_BD_SUPPLIER": {
|
|
119
|
+
"name": "供应商表",
|
|
120
|
+
"module": "基础资料",
|
|
121
|
+
"description": "供应商主数据,记录供应商的基本信息",
|
|
122
|
+
"fields": [
|
|
123
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
124
|
+
{ "name": "FNUMBER", "type": "varchar(50)", "nullable": false, "description": "供应商编码" },
|
|
125
|
+
{ "name": "FNAME", "type": "varchar(200)", "nullable": false, "description": "供应商名称" },
|
|
126
|
+
{ "name": "FSHORTNAME", "type": "varchar(100)", "nullable": true, "description": "简称" },
|
|
127
|
+
{ "name": "FTYPE", "type": "char(1)", "nullable": false, "description": "类型:1=普通供应商,2=内部供应商" },
|
|
128
|
+
{ "name": "FENABLESTATUS", "type": "char(1)", "nullable": false, "description": "启用状态:A=启用,B=禁用" }
|
|
129
|
+
],
|
|
130
|
+
"relatedTables": []
|
|
131
|
+
},
|
|
132
|
+
"T_BD_CUSTOMER": {
|
|
133
|
+
"name": "客户表",
|
|
134
|
+
"module": "基础资料",
|
|
135
|
+
"description": "客户主数据,记录客户的基本信息",
|
|
136
|
+
"fields": [
|
|
137
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
138
|
+
{ "name": "FNUMBER", "type": "varchar(50)", "nullable": false, "description": "客户编码" },
|
|
139
|
+
{ "name": "FNAME", "type": "varchar(200)", "nullable": false, "description": "客户名称" },
|
|
140
|
+
{ "name": "FSHORTNAME", "type": "varchar(100)", "nullable": true, "description": "简称" },
|
|
141
|
+
{ "name": "FTYPE", "type": "char(1)", "nullable": false, "description": "类型:1=普通客户,2=内部客户" },
|
|
142
|
+
{ "name": "FENABLESTATUS", "type": "char(1)", "nullable": false, "description": "启用状态:A=启用,B=禁用" }
|
|
143
|
+
],
|
|
144
|
+
"relatedTables": []
|
|
145
|
+
},
|
|
146
|
+
"T_BD_STOCK": {
|
|
147
|
+
"name": "仓库表",
|
|
148
|
+
"module": "基础资料",
|
|
149
|
+
"description": "仓库主数据,记录仓库的基本信息",
|
|
150
|
+
"fields": [
|
|
151
|
+
{ "name": "FID", "type": "bigint", "nullable": false, "description": "主键ID" },
|
|
152
|
+
{ "name": "FNUMBER", "type": "varchar(50)", "nullable": false, "description": "仓库编码" },
|
|
153
|
+
{ "name": "FNAME", "type": "varchar(200)", "nullable": false, "description": "仓库名称" },
|
|
154
|
+
{ "name": "FSTOCKORGID", "type": "bigint", "nullable": false, "description": "库存组织ID" },
|
|
155
|
+
{ "name": "FENABLESTATUS", "type": "char(1)", "nullable": false, "description": "启用状态:A=启用,B=禁用" }
|
|
156
|
+
],
|
|
157
|
+
"relatedTables": []
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Xinghan Product Notes
|
|
2
|
+
|
|
3
|
+
Xinghan is a Cosmic-family product. Load Cosmic platform knowledge first, then apply Xinghan-specific product or version rules.
|
|
4
|
+
|
|
5
|
+
## Default Stack
|
|
6
|
+
|
|
7
|
+
- Platform: Cosmic.
|
|
8
|
+
- Language: Java.
|
|
9
|
+
- Main concerns: plugin lifecycle, metadata verification, SDK signature verification, transaction boundaries, performance review.
|
|
10
|
+
|
|
11
|
+
## Harness Rules
|
|
12
|
+
|
|
13
|
+
- Do not use enterprise C# namespaces or lifecycle assumptions.
|
|
14
|
+
- Do not treat Xinghan as the old enterprise C# product line.
|
|
15
|
+
- Use Cosmic review and unit-test rules unless a Xinghan-specific standard overrides them.
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kcode-pi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Kingdee-specific package and harness for Pi Coding Agent",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"bin": {
|
|
8
|
+
"kcode": "./dist/cli/main.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/cli/kcode.js",
|
|
11
|
+
"types": "./dist/cli/kcode.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"extensions",
|
|
15
|
+
"skills",
|
|
16
|
+
"prompts",
|
|
17
|
+
"themes",
|
|
18
|
+
"knowledge",
|
|
19
|
+
"vendor",
|
|
20
|
+
"docs/KCODE_DISTRIBUTION.md",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"pi-package",
|
|
25
|
+
"kingdee",
|
|
26
|
+
"cosmos",
|
|
27
|
+
"coding-agent",
|
|
28
|
+
"harness"
|
|
29
|
+
],
|
|
30
|
+
"pi": {
|
|
31
|
+
"extensions": [
|
|
32
|
+
"./extensions/kingdee-header.ts",
|
|
33
|
+
"./extensions/kingdee-harness.ts",
|
|
34
|
+
"./extensions/kingdee-tools.ts"
|
|
35
|
+
],
|
|
36
|
+
"skills": [
|
|
37
|
+
"./skills"
|
|
38
|
+
],
|
|
39
|
+
"prompts": [
|
|
40
|
+
"./prompts"
|
|
41
|
+
],
|
|
42
|
+
"themes": [
|
|
43
|
+
"./themes/kcode-dark.json"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@earendil-works/pi-ai": "^0.78.1",
|
|
48
|
+
"@earendil-works/pi-coding-agent": "^0.78.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^25.9.2",
|
|
52
|
+
"tsx": "^4.22.4",
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build:cli": "tsc -p tsconfig.cli.json",
|
|
57
|
+
"check": "tsc --noEmit",
|
|
58
|
+
"smoke:knowledge": "tsx scripts/smoke-knowledge.ts",
|
|
59
|
+
"smoke:checker": "tsx scripts/smoke-checker.ts",
|
|
60
|
+
"smoke:harness": "tsx scripts/smoke-harness.ts",
|
|
61
|
+
"smoke:official": "tsx scripts/smoke-official-tools.ts",
|
|
62
|
+
"smoke:build-debug": "tsx scripts/smoke-build-debug.ts",
|
|
63
|
+
"smoke:package": "tsx scripts/smoke-package.ts",
|
|
64
|
+
"smoke:kcode-cli": "tsx scripts/smoke-kcode-cli.ts",
|
|
65
|
+
"kcode": "tsx scripts/kcode.ts",
|
|
66
|
+
"prepack": "npm run build:cli && npm run smoke:package"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=22.19.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start or refine the Kingdee Harness Engineering discussion phase.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-discuss` skill.
|
|
6
|
+
|
|
7
|
+
Start or update the active Kingdee harness run for this request:
|
|
8
|
+
|
|
9
|
+
{{args}}
|
|
10
|
+
|
|
11
|
+
Capture business goal, Kingdee product/version, tech stack, plugin type, target object, out-of-scope items, and open questions in `CONTEXT.md`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute the active Kingdee plan under Harness Engineering gates.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-execute` skill.
|
|
6
|
+
|
|
7
|
+
Before editing code, check the active run with `kd_plan_status`. If `PLAN.md` is missing or the gate is blocked, stop and explain the missing artifact. Otherwise implement only the approved plan and update `EXECUTION.md`.
|
|
8
|
+
|
|
9
|
+
Extra user guidance:
|
|
10
|
+
|
|
11
|
+
{{args}}
|
|
12
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Draft the Kingdee implementation plan artifact for the active harness run.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-plan` skill.
|
|
6
|
+
|
|
7
|
+
Read `CONTEXT.md` and `SPEC.md`, then draft or update `PLAN.md`. Include files to inspect, files likely to edit, required Kingdee lookups, validation commands, and rollback notes.
|
|
8
|
+
|
|
9
|
+
Extra user guidance:
|
|
10
|
+
|
|
11
|
+
{{args}}
|
|
12
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Prepare Kingdee delivery summary after verification.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-ship` skill.
|
|
6
|
+
|
|
7
|
+
Read the active run artifacts and produce `SHIP.md` with changed behavior, verification evidence, residual risks, and follow-up tasks. Do not ship if `VERIFY.md` is missing.
|
|
8
|
+
|
|
9
|
+
Extra user guidance:
|
|
10
|
+
|
|
11
|
+
{{args}}
|
|
12
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Draft the Kingdee specification artifact for the active harness run.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-spec` skill.
|
|
6
|
+
|
|
7
|
+
Read the active Kingdee run context and draft or update `SPEC.md`. Include acceptance criteria, lifecycle hooks, data objects, exception behavior, performance constraints, assumptions, and risks.
|
|
8
|
+
|
|
9
|
+
Extra user guidance:
|
|
10
|
+
|
|
11
|
+
{{args}}
|
|
12
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Verify the active Kingdee implementation and collect evidence.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `kd-verify` skill.
|
|
6
|
+
|
|
7
|
+
Run the planned validation commands, collect evidence, run available checks, and update `VERIFY.md`. If anything cannot run, record the exact blocker and residual risk.
|
|
8
|
+
|
|
9
|
+
Extra user guidance:
|
|
10
|
+
|
|
11
|
+
{{args}}
|
|
12
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-check
|
|
3
|
+
description: Review Kingdee Java/C# plugin code against SDK, lifecycle, performance, exception, and maintainability rules.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Code Check
|
|
7
|
+
|
|
8
|
+
Use this skill when reviewing Kingdee code.
|
|
9
|
+
|
|
10
|
+
Checklist:
|
|
11
|
+
|
|
12
|
+
- Magic values: status codes, operation names, field keys, table names, numbers, and business strings.
|
|
13
|
+
- Naming: Java/C# naming conventions and project-local naming.
|
|
14
|
+
- Lifecycle: correct plugin base class and lifecycle method for the target behavior.
|
|
15
|
+
- SDK usage: no invented API names; uncertain APIs must be verified through `kd_search`.
|
|
16
|
+
- Database access: no DB query or save operation inside loops unless explicitly justified.
|
|
17
|
+
- Exception handling: no empty catch blocks; errors should be logged or converted to business exceptions as appropriate.
|
|
18
|
+
- Resource cleanup: close or dispose resources where the SDK requires it.
|
|
19
|
+
- Thread safety: no unsafe static mutable state in plugin classes.
|
|
20
|
+
|
|
21
|
+
Output expectations:
|
|
22
|
+
|
|
23
|
+
- Lead with concrete findings and file/line references when reviewing code.
|
|
24
|
+
- Separate errors, warnings, and improvement suggestions.
|
|
25
|
+
- State which checks were not possible because context or tools were missing.
|
|
26
|
+
|