fix(mining-admin): 修正Excel列索引

Excel实际格式是:
- 索引0: 序号
- 索引1: 注册ID
- 索引2: 认种量(棵)
- 索引3: 挖矿开始时间
- 索引4: 批次
- 索引5: 授权提前挖的天数
- 索引6: 备注

之前代码从索引0读取用户ID是错误的,现在修正为从索引1开始读取。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-21 19:58:17 -08:00
parent ca5de3add1
commit 16daa7403c
2 changed files with 12 additions and 6 deletions

View File

@ -794,7 +794,10 @@
"Bash(ssh -J ceshi@103.39.231.231 ceshi@192.168.1.111 \"curl -s ''http://localhost:3000/api/price/klines?period=1h&limit=5'' | head -500\")",
"Bash(dir /b /ad \"c:\\\\Users\\\\dong\\\\Desktop\\\\rwadurian\\\\backend\")",
"Bash(timeout 30 cat:*)",
"Bash(npm run lint)"
"Bash(npm run lint)",
"Bash(ssh -o ProxyCommand=\"ssh -W %h:%p ceshi@103.39.231.231\" -o StrictHostKeyChecking=no ceshi@192.168.1.111 \"cat /home/ceshi/rwadurian/backend/services/mining-service/src/application/services/batch-mining.service.ts | head -250\")",
"Bash(ssh -o ProxyCommand=\"ssh -W %h:%p ceshi@103.39.231.231\" -o StrictHostKeyChecking=no ceshi@192.168.1.111 \"docker logs rwa-mining-admin-service --tail 50 2>&1 | grep ''第一条数据\\\\|最后一条数据''\")",
"Bash(npx xlsx-cli 挖矿.xlsx)"
],
"deny": [],
"ask": []

View File

@ -283,16 +283,19 @@ export class BatchMiningService {
continue;
}
// 获取用户ID (第一列索引0)
let accountSequence = String(row[0]).trim();
// Excel 格式:序号 | 注册ID | 认种量(棵)| 挖矿开始时间 | 批次 | 授权提前挖的天数 | 备注
// 索引: 0 1 2 3 4 5 6
// 获取用户ID (第二列索引1)
let accountSequence = String(row[1]).trim();
if (!accountSequence.startsWith('D')) {
accountSequence = 'D' + accountSequence;
}
// 获取认种量 (第二列索引1)
const treeCount = parseInt(row[1], 10);
// 获取认种量 (第三列索引2)
const treeCount = parseInt(row[2], 10);
if (isNaN(treeCount) || treeCount <= 0) {
this.logger.debug(`[parseExcelData] 跳过行 ${i + 1}: 认种量无效 (${row[1]})`);
this.logger.debug(`[parseExcelData] 跳过行 ${i + 1}: 认种量无效 (${row[2]})`);
continue;
}