feat(score): 引入积分基线存储与刚性扣分对账体系
- 参考 dygou_go 新增 internal/score/baseline.go:维护 scores.json 并支持原子写盘 - 查询积分时自动保存各账号基线余额;抢购后提供 ReconcileAccounts 刚性比对扣分差值 - App.go 与前端增加 ReconcileScores 绑定与【刚性对账】按钮,解决超时暗中成功漏单痛点 - 补充 BaselineStore 读写、落盘重载与 ReconcileAccounts 完整单测并通过前端编译
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
} from 'antd'
|
||||
import type { ColumnsType } from 'antd/es/table'
|
||||
import {
|
||||
CheckCircle2,
|
||||
ClipboardList,
|
||||
ClipboardPaste,
|
||||
Copy,
|
||||
@@ -52,6 +53,7 @@ import {
|
||||
OpenLogDir,
|
||||
PreviewAccounts,
|
||||
QueryScores,
|
||||
ReconcileScores,
|
||||
SetLogLevel,
|
||||
StartMonitor,
|
||||
StopMonitor,
|
||||
@@ -2285,6 +2287,25 @@ export default function Dashboard() {
|
||||
>
|
||||
兑换记录
|
||||
</Button>
|
||||
<Button
|
||||
icon={<CheckCircle2 size={16} />}
|
||||
loading={loading === 'reconcile'}
|
||||
disabled={selectedAccountCount === 0}
|
||||
onClick={() => {
|
||||
const values = config()
|
||||
if (values.selectedAccountLines.length === 0) {
|
||||
message.warning('请先选择账号')
|
||||
return
|
||||
}
|
||||
runAction('reconcile', () => ReconcileScores(values), (data) => {
|
||||
const list = (data || []) as any[]
|
||||
const confirmed = list.filter((item: any) => item.confirmed).length
|
||||
message.success(`对账完成:${list.length} 个账号,刚性确认扣分成功 ${confirmed} 个`)
|
||||
})
|
||||
}}
|
||||
>
|
||||
刚性对账
|
||||
</Button>
|
||||
<Button
|
||||
icon={<Square size={16} />}
|
||||
disabled={!running}
|
||||
|
||||
Vendored
+2
@@ -31,6 +31,8 @@ export function PreviewAccounts(arg1:string):Promise<Array<gui.AccountPreview>>;
|
||||
|
||||
export function QueryScores(arg1:gui.Config):Promise<Array<gui.ScoreResult>>;
|
||||
|
||||
export function ReconcileScores(arg1:gui.Config):Promise<Array<any>>;
|
||||
|
||||
export function SetLogLevel(arg1:string):Promise<string>;
|
||||
|
||||
export function StartMonitor(arg1:gui.Config):Promise<void>;
|
||||
|
||||
@@ -58,6 +58,10 @@ export function QueryScores(arg1) {
|
||||
return window['go']['gui']['App']['QueryScores'](arg1);
|
||||
}
|
||||
|
||||
export function ReconcileScores(arg1) {
|
||||
return window['go']['gui']['App']['ReconcileScores'](arg1);
|
||||
}
|
||||
|
||||
export function SetLogLevel(arg1) {
|
||||
return window['go']['gui']['App']['SetLogLevel'](arg1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user