feat: 完善自动与手动派单流程

This commit is contained in:
richjohnrambo
2026-10-13 22:13:47 +08:00
parent 7eedbde4ab
commit dedacfcd9a
4 changed files with 128 additions and 29 deletions
+6 -2
View File
@@ -206,7 +206,7 @@ func (s *Service) Eligibility(ctx context.Context, tenantID, memberID, hallID in
result.reject("LEVEL_NOT_ELIGIBLE", "当前等级不能进入该任务大厅")
case row.WalletStatus != 1:
result.reject("ACCOUNT_RESTRICTED", "账户状态受限")
case row.AvailableAmount < policy.MinimumAmount:
case row.AutoDispatch == 1 && row.AvailableAmount < policy.MinimumAmount:
result.reject("INSUFFICIENT_BALANCE", "可用余额不足")
case row.DailyLimit > 0 && row.TodayCount >= row.DailyLimit:
result.reject("DAILY_LIMIT_REACHED", "已达当日领取上限")
@@ -443,7 +443,11 @@ func orderTimeline(row store.TaskOrder) []TimelineEntry {
func allowedActions(row store.TaskOrder) []string {
switch row.OrderStatus {
case 2:
return []string{"submit", "contact_support"}
var snapshot map[string]any
if json.Unmarshal(row.RuleSnapshot, &snapshot) == nil && snapshot["dispatch_mode"] == "manual" {
return []string{"submit", "contact_support"}
}
return []string{"contact_support"}
case 3, 5, 6, 8:
return []string{"contact_support"}
default: