ai-engineering-init 1.16.3 → 1.17.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/.claude/commands/init-config.md +154 -0
- package/.claude/skills/{leniu-java-amount-handling/SKILL.md → leniu-report-scenario/references/amount-handling.md} +0 -13
- package/.claude/skills/{leniu-java-export/SKILL.md → leniu-report-scenario/references/export.md} +0 -17
- package/{.cursor/skills/leniu-mealtime/SKILL.md → .claude/skills/leniu-report-scenario/references/mealtime.md} +0 -18
- package/{.codex/skills/leniu-java-report-query-param/SKILL.md → .claude/skills/leniu-report-scenario/references/query-param.md} +0 -17
- package/.claude/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/{.codex/skills/leniu-java-total-line/SKILL.md → .claude/skills/leniu-report-scenario/references/total-line.md} +0 -17
- package/.claude/templates/env-config.md +27 -0
- package/.codex/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.codex/skills/{leniu-java-export/SKILL.md → leniu-report-scenario/references/export.md} +0 -17
- package/{.claude/skills/leniu-mealtime/SKILL.md → .codex/skills/leniu-report-scenario/references/mealtime.md} +0 -18
- package/{.cursor/skills/leniu-java-report-query-param/SKILL.md → .codex/skills/leniu-report-scenario/references/query-param.md} +0 -17
- package/.codex/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/{.cursor/skills/leniu-java-total-line/SKILL.md → .codex/skills/leniu-report-scenario/references/total-line.md} +0 -17
- package/.cursor/skills/leniu-report-scenario/references/amount-handling.md +448 -0
- package/.cursor/skills/{leniu-java-export/SKILL.md → leniu-report-scenario/references/export.md} +0 -17
- package/{.codex/skills/leniu-mealtime/SKILL.md → .cursor/skills/leniu-report-scenario/references/mealtime.md} +0 -18
- package/{.claude/skills/leniu-java-report-query-param/SKILL.md → .cursor/skills/leniu-report-scenario/references/query-param.md} +0 -17
- package/.cursor/skills/leniu-report-scenario/references/standard-customization.md +112 -0
- package/{.claude/skills/leniu-java-total-line/SKILL.md → .cursor/skills/leniu-report-scenario/references/total-line.md} +0 -17
- package/.cursor/templates/env-config.md +27 -0
- package/bin/index.js +235 -1
- package/package.json +1 -1
- package/.claude/skills/leniu-marketing-price-rule-customizer/SKILL.md +0 -301
- package/.claude/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +0 -285
- package/.claude/skills/leniu-report-customization/SKILL.md +0 -415
- package/.claude/skills/leniu-report-standard-customization/SKILL.md +0 -391
- package/.codex/skills/leniu-marketing-price-rule-customizer/SKILL.md +0 -301
- package/.codex/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +0 -285
- package/.codex/skills/leniu-report-customization/SKILL.md +0 -415
- package/.codex/skills/leniu-report-standard-customization/SKILL.md +0 -391
- package/.cursor/skills/leniu-marketing-price-rule-customizer/SKILL.md +0 -301
- package/.cursor/skills/leniu-marketing-recharge-rule-customizer/SKILL.md +0 -285
- package/.cursor/skills/leniu-report-customization/SKILL.md +0 -415
- package/.cursor/skills/leniu-report-standard-customization/SKILL.md +0 -391
- /package/.claude/skills/{leniu-report-standard-customization → leniu-report-scenario}/references/analysis-module.md +0 -0
- /package/.claude/skills/{leniu-report-customization/references/table-fields.md → leniu-report-scenario/references/customization-table-fields.md} +0 -0
- /package/.claude/skills/{leniu-report-standard-customization/references/table-fields.md → leniu-report-scenario/references/standard-table-fields.md} +0 -0
- /package/.codex/skills/{leniu-report-standard-customization → leniu-report-scenario}/references/analysis-module.md +0 -0
- /package/.codex/skills/{leniu-report-customization/references/table-fields.md → leniu-report-scenario/references/customization-table-fields.md} +0 -0
- /package/.codex/skills/{leniu-report-standard-customization/references/table-fields.md → leniu-report-scenario/references/standard-table-fields.md} +0 -0
- /package/.cursor/skills/{leniu-report-standard-customization → leniu-report-scenario}/references/analysis-module.md +0 -0
- /package/.cursor/skills/{leniu-report-customization/references/table-fields.md → leniu-report-scenario/references/customization-table-fields.md} +0 -0
- /package/.cursor/skills/{leniu-report-standard-customization/references/table-fields.md → leniu-report-scenario/references/standard-table-fields.md} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# /init-config - 从 Markdown 一键初始化环境配置
|
|
2
|
+
|
|
3
|
+
从用户提供的 Markdown 文件中解析 MySQL 数据库连接和 Loki 日志查询配置,一键写入配置文件。
|
|
4
|
+
|
|
5
|
+
## 使用方式
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/init-config <md文件路径> [--scope global|local]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- `/init-config env-config.md` — 解析 md 文件,写入全局配置(默认)
|
|
12
|
+
- `/init-config env-config.md --scope local` — 写入当前项目本地配置
|
|
13
|
+
- `/init-config` — 无参数时,使用模板文件 `.claude/templates/env-config.md`
|
|
14
|
+
|
|
15
|
+
## 参数
|
|
16
|
+
|
|
17
|
+
- `$ARGUMENTS` 的第一个词为文件路径,可以是相对路径或绝对路径
|
|
18
|
+
- `--scope global`(默认)写入 `~/.claude/` + `~/.cursor/`
|
|
19
|
+
- `--scope local` 写入当前项目 `.claude/`
|
|
20
|
+
|
|
21
|
+
## Markdown 文件格式
|
|
22
|
+
|
|
23
|
+
文件中必须包含以下两个段落(任一即可):
|
|
24
|
+
|
|
25
|
+
### MySQL 数据库连接(标题含"MySQL"或"数据库")
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
## MySQL 数据库连接
|
|
29
|
+
|
|
30
|
+
| 环境 | host | port | user | password | range | 描述 |
|
|
31
|
+
|------|------|------|------|----------|-------|------|
|
|
32
|
+
| local | 127.0.0.1 | 3306 | root | xxx | | 本地环境 |
|
|
33
|
+
| dev | dev-db.com | 3306 | dev_user | xxx | 1~15 | 开发环境 |
|
|
34
|
+
|
|
35
|
+
默认环境: local
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Loki 日志查询(标题含"Loki"或"日志")
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## Loki 日志查询
|
|
42
|
+
|
|
43
|
+
| 环境 | 名称 | URL | Token | 别名 | range |
|
|
44
|
+
|------|------|-----|-------|------|-------|
|
|
45
|
+
| monitor-dev | Monitor开发 | https://grafana.example.com | glsa_xxx | mdev,dev | dev1~15 |
|
|
46
|
+
|
|
47
|
+
默认环境: monitor-dev
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 注意事项
|
|
51
|
+
|
|
52
|
+
- host/URL 为 `YOUR_*` 占位符的行会被跳过
|
|
53
|
+
- Token 为 `YOUR_*` 的行会写入空 Token(稍后可用 `config --type loki` 补充)
|
|
54
|
+
- range 字段会自动展开为 projects 列表(如 `dev1~15` → `["dev01","dev02",...,"dev15"]`)
|
|
55
|
+
|
|
56
|
+
## 执行流程
|
|
57
|
+
|
|
58
|
+
### 第一步:确定文件路径和范围
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 解析参数
|
|
62
|
+
FILE_PATH="${ARGUMENTS%% --*}" # 第一个参数为文件路径
|
|
63
|
+
SCOPE="global" # 默认全局
|
|
64
|
+
[[ "$ARGUMENTS" == *"--scope local"* ]] && SCOPE="local"
|
|
65
|
+
|
|
66
|
+
# 如果没指定文件,检查模板
|
|
67
|
+
if [ -z "$FILE_PATH" ]; then
|
|
68
|
+
FILE_PATH=".claude/templates/env-config.md"
|
|
69
|
+
fi
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
确认文件存在,不存在则提示用户创建。
|
|
73
|
+
|
|
74
|
+
### 第二步:读取并解析 Markdown
|
|
75
|
+
|
|
76
|
+
读取文件内容,按标题(`## MySQL`/`## Loki`)分割为两个段落。
|
|
77
|
+
|
|
78
|
+
解析每个段落中的 Markdown 表格:
|
|
79
|
+
1. 找到表头行(含 `|` 且下一行为 `|---|`)
|
|
80
|
+
2. 提取表头列名
|
|
81
|
+
3. 逐行解析数据行
|
|
82
|
+
4. 跳过 `YOUR_*` 占位符
|
|
83
|
+
5. 提取"默认环境: xxx"
|
|
84
|
+
|
|
85
|
+
### 第三步:生成配置 JSON
|
|
86
|
+
|
|
87
|
+
**MySQL 配置**(mysql-config.json):
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"environments": {
|
|
91
|
+
"local": { "host": "127.0.0.1", "port": 3306, "user": "root", "password": "xxx", "_desc": "本地环境" },
|
|
92
|
+
"dev": { "host": "dev-db.com", "port": 3306, "user": "dev_user", "password": "xxx", "range": "1~15", "_desc": "开发环境" }
|
|
93
|
+
},
|
|
94
|
+
"default": "local"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Loki 配置**(loki-config.json):
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"active": "monitor-dev",
|
|
102
|
+
"environments": {
|
|
103
|
+
"monitor-dev": {
|
|
104
|
+
"name": "Monitor开发",
|
|
105
|
+
"url": "https://grafana.example.com",
|
|
106
|
+
"token": "glsa_xxx",
|
|
107
|
+
"aliases": ["mdev", "dev"],
|
|
108
|
+
"range": "dev1~15",
|
|
109
|
+
"projects": ["dev01", "dev02", "...", "dev15"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 第四步:写入配置文件
|
|
116
|
+
|
|
117
|
+
根据 scope 决定写入位置:
|
|
118
|
+
|
|
119
|
+
| scope | MySQL 路径 | Loki 路径 |
|
|
120
|
+
|-------|-----------|----------|
|
|
121
|
+
| global | `~/.claude/mysql-config.json` + `~/.cursor/mysql-config.json` | `~/.claude/loki-config.json` + `~/.cursor/loki-config.json` |
|
|
122
|
+
| local | `.claude/mysql-config.json` | `.claude/loki-config.json` |
|
|
123
|
+
|
|
124
|
+
写入后输出:
|
|
125
|
+
```
|
|
126
|
+
✔ MySQL 配置(N 个环境)→ 路径
|
|
127
|
+
✔ Loki 配置(N 个环境)→ 路径
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 第五步:确保 .gitignore(仅 local scope)
|
|
131
|
+
|
|
132
|
+
如果是本地配置,确保 `.gitignore` 包含:
|
|
133
|
+
```
|
|
134
|
+
**/mysql-config.json
|
|
135
|
+
**/loki-config.json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 模板文件
|
|
139
|
+
|
|
140
|
+
如果用户没有配置文件,输出模板路径:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
提示:请先创建配置文件,参考模板:
|
|
144
|
+
.claude/templates/env-config.md
|
|
145
|
+
|
|
146
|
+
填写后运行:
|
|
147
|
+
/init-config .claude/templates/env-config.md
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 安全规则
|
|
151
|
+
|
|
152
|
+
- 不要在输出中显示完整的 password 和 Token(用 `***` 脱敏)
|
|
153
|
+
- local scope 时自动更新 .gitignore
|
|
154
|
+
- 覆盖已有配置前先展示将要写入的环境列表,让用户确认
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leniu-java-amount-handling
|
|
3
|
-
description: |
|
|
4
|
-
leniu-tengyun-core 项目金额处理规范。金融系统中金额以分(Long 类型)存储,展示时转换为元。
|
|
5
|
-
|
|
6
|
-
触发场景:
|
|
7
|
-
- VO/Entity 类含金额字段(amountFen/amountYuan)
|
|
8
|
-
- MyBatis XML 查询含金额字段
|
|
9
|
-
- Excel 导出含金额列,需分转元
|
|
10
|
-
- 报表合计查询含金额汇总
|
|
11
|
-
|
|
12
|
-
触发词:金额处理、分转元、元转分、Long金额、money、fen、BigDecimal金额、金额字段
|
|
13
|
-
---
|
|
14
1
|
|
|
15
2
|
# leniu-tengyun-core 金额处理规范
|
|
16
3
|
|
package/.claude/skills/{leniu-java-export/SKILL.md → leniu-report-scenario/references/export.md}
RENAMED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leniu-java-export
|
|
3
|
-
description: |
|
|
4
|
-
leniu-tengyun-core / leniu-yunshitang 项目数据导出规范。当实现数据导出功能时使用此skill,包括Excel异步导出和分页导出方案。
|
|
5
|
-
|
|
6
|
-
触发场景:
|
|
7
|
-
- 实现Excel数据导出(exportApi.startExcelExportTaskByPage)
|
|
8
|
-
- 实现异步导出(数据量大时)
|
|
9
|
-
- 实现分页导出(防内存溢出)
|
|
10
|
-
- 导出API接口设计(@PostMapping("/export"))
|
|
11
|
-
|
|
12
|
-
适用项目:
|
|
13
|
-
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
14
|
-
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
15
|
-
|
|
16
|
-
触发词:导出、Excel导出、异步导出、分页导出、@ExcelProperty、exportApi、数据导出
|
|
17
|
-
---
|
|
18
1
|
|
|
19
2
|
# leniu-tengyun-core 数据导出规范
|
|
20
3
|
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leniu-mealtime
|
|
3
|
-
description: |
|
|
4
|
-
leniu-tengyun-core 项目餐次处理规范。当编写涉及餐次(早餐/午餐/下午茶/晚餐/夜宵)的报表或查询代码时使用。
|
|
5
|
-
|
|
6
|
-
触发场景:
|
|
7
|
-
- 在 Param 查询参数类中添加餐次筛选字段(mealtimeTypes)
|
|
8
|
-
- 在 VO 返回类中定义餐次字段和 MealtimeTypeConverter 转换器
|
|
9
|
-
- 编写 MyBatis XML 中的餐次 IN 查询条件
|
|
10
|
-
- 处理餐次枚举转换(AllocMealtimeTypeEnum)
|
|
11
|
-
- 区分正餐(早/午/晚)与非正餐(下午茶/夜宵)
|
|
12
|
-
|
|
13
|
-
适用项目:
|
|
14
|
-
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
15
|
-
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
16
|
-
|
|
17
|
-
触发词:餐次、mealtime、mealtimeType、早餐、午餐、晚餐、下午茶、夜宵、AllocMealtimeTypeEnum
|
|
18
|
-
---
|
|
19
1
|
|
|
20
2
|
# leniu-tengyun-core 餐次处理规范
|
|
21
3
|
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leniu-java-report-query-param
|
|
3
|
-
description: |
|
|
4
|
-
leniu-tengyun-core / leniu-yunshitang 项目报表查询入参规范。当创建报表Controller接口的查询入参Param类时使用此skill。
|
|
5
|
-
|
|
6
|
-
触发场景:
|
|
7
|
-
- 创建报表查询入参Param类(分页、时间范围、组织筛选)
|
|
8
|
-
- 设计报表接口的基类继承结构
|
|
9
|
-
- 配置导出列开关(exportColumns)
|
|
10
|
-
- 报表查询参数标准化
|
|
11
|
-
|
|
12
|
-
适用项目:
|
|
13
|
-
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
14
|
-
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
15
|
-
|
|
16
|
-
触发词:报表查询入参、Param类、分页参数、时间范围查询、ReportBaseParam、exportCols
|
|
17
|
-
---
|
|
18
1
|
|
|
19
2
|
# leniu-tengyun-core 报表查询入参规范
|
|
20
3
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
|
|
2
|
+
# leniu 标准版定制报表开发指南
|
|
3
|
+
|
|
4
|
+
> 详细字段说明见 `references/table-fields.md`,经营分析详情见 `references/analysis-module.md`
|
|
5
|
+
|
|
6
|
+
## 版本识别(必读)
|
|
7
|
+
|
|
8
|
+
**本 skill 仅适用于标准版(core-report 独立模块)**。
|
|
9
|
+
|
|
10
|
+
| 判断方式 | 标准版(本指南) | v5.29 版本 |
|
|
11
|
+
|---------|--------------|-----------|
|
|
12
|
+
| 目录结构 | `core-report/` 独立模块 | `sys-canteen/` 内嵌 |
|
|
13
|
+
| 退款存储 | 独立 `report_refund` 表(**正数**) | 合并入 `report_order_info`(`consumeType=2`,**负数**) |
|
|
14
|
+
| 第二阶段 | `fix()` 按日重算 | `batchConsume()` 增量累加 |
|
|
15
|
+
| consumeType | **无此字段** | 1=消费,2=退款 |
|
|
16
|
+
|
|
17
|
+
> v5.29 报表请使用 `leniu-report-customization`。钱包/交易类型枚举同 v5.29,参见该 skill。
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## 二、核心基础表概要
|
|
21
|
+
|
|
22
|
+
### 2.1 report_order_info(仅存正向订单,无 consumeType)
|
|
23
|
+
|
|
24
|
+
关键字段:`orderId`(主键), `canteenId/stallId`, `mealtimeType`, `orderType`, `payableAmount/realAmount/refundAmount`(分), `accPayAmount/outPayAmount`, `payTime/orderDate`, `orderRefundState`(1未退/2全退/3部分退), `status`(0未消费/1已消费), `nuClearMode`, `psnType`, `ageType/holidayType`
|
|
25
|
+
|
|
26
|
+
### 2.2 report_order_detail(菜品明细)
|
|
27
|
+
|
|
28
|
+
关键字段:`detailId`, `orderId`, `goodsDishesId/goodsDishesName`, `price/totalAmount/realAmount`(分), `quantity`, `salesMode`(1按份/2称重), `detailState`(1正常/2全退/3部分退), `goodsRefundNum`, `refundAmount`, `detailType`
|
|
29
|
+
|
|
30
|
+
### 2.3 report_refund / report_refund_detail(标准版特有,退款为正数)
|
|
31
|
+
|
|
32
|
+
**report_refund**:`orderRefundId`(主键), `orderId`(原订单), `realRefundAmount`(**正数**), `applyType`(1退单/2纠错), `checkTime`
|
|
33
|
+
|
|
34
|
+
**report_refund_detail**:`orderRefundId`, `detailId`, `realQuantity`, `realRefundAmount`(**正数**)
|
|
35
|
+
|
|
36
|
+
### 2.4 其他基础表
|
|
37
|
+
|
|
38
|
+
- **report_order_pay**:`orderId`, `payType/payChannel`, `payAmount/refundAmount`
|
|
39
|
+
- **report_order_discount**:`orderId`, `changeAmount`, `changeType`(1上浮/2优惠), `changeDetailType`
|
|
40
|
+
- **report_order_info_snapshot**:订单交易快照
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## 四、账户流水报表
|
|
44
|
+
|
|
45
|
+
### 4.1 report_account_flow(流水主表)
|
|
46
|
+
|
|
47
|
+
核心字段:`flowId`, `custId/orgId`, `payTime`, `flowType`(AccTradeTypeEnum), `flowRealAmount/flowAmount`, `manageCost`, `accTotalBal/accAllBal`, `status`
|
|
48
|
+
|
|
49
|
+
### 4.2 report_account_summary(用户账户日结表)
|
|
50
|
+
|
|
51
|
+
联合主键:`statisticDate` + `custId`。期末余额 = 期初 + 充值 - 撤销充值 + 补贴 - 撤销补贴 + 红包 + 赠送 - 消费 - 补扣 + 退款 - 提现 - 清空 - 管理费
|
|
52
|
+
|
|
53
|
+
### 4.3 AccountConsumeService 实现
|
|
54
|
+
|
|
55
|
+
| ORDER | 类 | 汇总表 |
|
|
56
|
+
|-------|---|-------|
|
|
57
|
+
| 1/2 | Flow/FlowDetail | 基础表 |
|
|
58
|
+
| 13 | AccountSummary | 日结 |
|
|
59
|
+
| 14 | AccountOperator | 操作员 |
|
|
60
|
+
| 15-17 | ConsumeSummary/Org/Type | 消费维度 |
|
|
61
|
+
| 18 | WalletConsume | 钱包 |
|
|
62
|
+
| 19 | SumRechargeMer | 商户充值 |
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## 六、汇总模型速查
|
|
66
|
+
|
|
67
|
+
| 表 | 维度 | 金额 |
|
|
68
|
+
|----|------|------|
|
|
69
|
+
| report_sum_mealtime | date/canteen/stall/org/age/mealtime/psn/machine/source | custNum/consumeNum/realAmount/refundAmount |
|
|
70
|
+
| report_sum_pay | date/mealtime/canteen/stall/org/age/payChannel/payType | payNum/realAmount/refundAmount |
|
|
71
|
+
| report_sum_dishes | date/area/canteen/stall/reportOrderType/mealtime/cook/device/dishes/salesMode/detailType | quantity/realAmount |
|
|
72
|
+
| report_sum_pay_mer | tenantId/date/payChannel/payType | custNum/payNum/realAmount/refundAmount |
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## 八、公共模块
|
|
76
|
+
|
|
77
|
+
- **报表错误日志**(report_error_log):`reportErrorType`(1账户/2订单), `reportErrorState`(1已创建/2已处理)。定时任务 `@XxlJob("reportExceptionHandle")` 自动修复。
|
|
78
|
+
- **金额范围设置**:`POST /report/alloc/amount-scope/save`
|
|
79
|
+
- **数据修复**:`POST /summary/fix/order|account`(限31天,Redisson 锁 120 分钟)
|
|
80
|
+
|
|
81
|
+
### 核心枚举
|
|
82
|
+
|
|
83
|
+
| 枚举 | 值 |
|
|
84
|
+
|------|---|
|
|
85
|
+
| ReportClassifyEnum | 1组织/2类别/3食堂/4设备/5收入/6渠道/7餐次 |
|
|
86
|
+
| ReportPayTypeEnum | 1微信/2支付宝/3系统账户/9现金/20其他 |
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 十、开发检查清单
|
|
90
|
+
|
|
91
|
+
### 建表
|
|
92
|
+
- [ ] 分组维度 + 金额汇总 + 审计字段(crby/crtime/upby/uptime/del_flag),无 tenant_id
|
|
93
|
+
|
|
94
|
+
### 实现
|
|
95
|
+
- [ ] 实现 `ReportOrderConsumeService`,设 `getOrder()`
|
|
96
|
+
- [ ] `fix()` 先删后插(**标准版核心模式**),`consume()` 留空
|
|
97
|
+
|
|
98
|
+
### 退款(标准版特有)
|
|
99
|
+
- [ ] 退款在独立 `report_refund` 表(**正数金额**)
|
|
100
|
+
- [ ] 净消费 = `real_amount - IFNULL(refund_amount, 0)`
|
|
101
|
+
- [ ] **不要使用 consumeType 字段**
|
|
102
|
+
|
|
103
|
+
### 查询
|
|
104
|
+
- [ ] ReportBaseTotalVO + CompletableFuture 并行 + MgrUserAuthPO 权限
|
|
105
|
+
- [ ] GROUP BY / ORDER BY 表达式与 SELECT 完全一致(only_full_group_by)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## 注意
|
|
109
|
+
|
|
110
|
+
- 标准版退款为独立表(正数金额),**不要使用 consumeType 字段**
|
|
111
|
+
- 标准版第二阶段用 `fix()` 按日重算,**不要使用 batchConsume() 增量模式**
|
|
112
|
+
- CRUD 用 `leniu-crud-development`,MyBatis 用 `leniu-java-mybatis`,入参用 `leniu-java-report-query-param`,合计行用 `leniu-java-total-line`,餐次用 `leniu-mealtime`
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leniu-java-total-line
|
|
3
|
-
description: |
|
|
4
|
-
leniu-tengyun-core / leniu-yunshitang 项目合计行查询规范。当实现报表分页查询需要合计行功能时使用此skill。
|
|
5
|
-
|
|
6
|
-
触发场景:
|
|
7
|
-
- 实现报表分页查询合计行(Service层合计查询)
|
|
8
|
-
- 编写Mapper XML合计SQL(只返回数值字段)
|
|
9
|
-
- Controller层合计行数据组装
|
|
10
|
-
- 合计查询开关控制
|
|
11
|
-
|
|
12
|
-
适用项目:
|
|
13
|
-
- leniu-tengyun-core:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun-core
|
|
14
|
-
- leniu-yunshitang:/Users/xujiajun/Developer/gongsi_proj/leniu-api/leniu-tengyun/leniu-yunshitang
|
|
15
|
-
|
|
16
|
-
触发词:合计行、totalLine、报表合计、SUM合计、ReportBaseTotalVO、合计查询
|
|
17
|
-
---
|
|
18
1
|
|
|
19
2
|
# leniu-tengyun-core 合计行(Total Line)规范
|
|
20
3
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 环境配置模板
|
|
2
|
+
|
|
3
|
+
> 填写后运行 `npx ai-engineering-init config --from .claude/templates/env-config.md --scope global`
|
|
4
|
+
> 一键初始化 MySQL 数据库连接和 Loki 日志查询配置。
|
|
5
|
+
|
|
6
|
+
## MySQL 数据库连接
|
|
7
|
+
|
|
8
|
+
| 环境 | host | port | user | password | range | 描述 |
|
|
9
|
+
|------|------|------|------|----------|-------|------|
|
|
10
|
+
| local | 127.0.0.1 | 3306 | root | do@u.can | | 本地环境 |
|
|
11
|
+
| dev | YOUR_DEV_HOST | 3306 | YOUR_USER | YOUR_PASSWORD | 1~15 | 开发环境(dev1~dev15) |
|
|
12
|
+
| test | YOUR_TEST_HOST | 3306 | YOUR_USER | YOUR_PASSWORD | 1~30 | 测试环境(test1~test30) |
|
|
13
|
+
| prod | YOUR_PROD_HOST | 3306 | readonly | YOUR_PASSWORD | | 生产环境(只读) |
|
|
14
|
+
|
|
15
|
+
默认环境: local
|
|
16
|
+
|
|
17
|
+
## Loki 日志查询
|
|
18
|
+
|
|
19
|
+
| 环境 | 名称 | URL | Token | 别名 | range |
|
|
20
|
+
|------|------|-----|-------|------|-------|
|
|
21
|
+
| test13 | 测试13 | https://test13.xnzn.net/grafana | YOUR_TOKEN | test13,13 | |
|
|
22
|
+
| monitor-test | Monitor测试 | https://monitor-test.xnzn.net/grafana | YOUR_TOKEN | mtest | test1~12 |
|
|
23
|
+
| monitor-dev | Monitor开发 | https://monitor-dev.xnzn.net/grafana | YOUR_TOKEN | mdev,dev | dev1~15 |
|
|
24
|
+
| monitor02-dev | Monitor02开发 | https://monitor02-dev.xnzn.net/grafana | YOUR_TOKEN | m02,monitor02 | dev16~42 |
|
|
25
|
+
| monitor-tyy-dev | 体验园开发 | https://monitor-tyy-dev.xnzn.net/grafana | YOUR_TOKEN | tyy,体验园 | dev44~58 |
|
|
26
|
+
|
|
27
|
+
默认环境: test13
|