feat(pickup): 新增管理员线下提号功能

- 新建 admin_pickups 表独立于 rental_orders,不污染订单状态机与财务统计口径
- 提号中/已完成/已取消三态:创建锁定账号,完成时给卖家钱包加可用余额并下架 listing,取消解锁账号
- 完成时 listing 置 completed,复用现有 listingLockedForOwnerMutation 拦截再上架
- 管理端提号管理页(列表/创建/完成/取消/可提号账号搜索)+ 卖家端提号记录页
- 财务仪表盘新增线下提号独立统计块,与正常订单口径分离
- 钱包流水 label、状态标签、菜单入口同步补齐
- 优化卖家服务悬浮菜单为一行四个,尺寸与配色对齐买家服务
This commit is contained in:
yml2213
2026-07-03 19:04:35 +08:00
parent f5a1630a27
commit 9ef0843eb0
22 changed files with 1649 additions and 13 deletions
+22
View File
@@ -29,6 +29,7 @@ import (
"hfb_sys/backend/internal/modules/payment"
"hfb_sys/backend/internal/modules/paymentaccount"
"hfb_sys/backend/internal/modules/paymentconfig"
"hfb_sys/backend/internal/modules/pickup"
"hfb_sys/backend/internal/modules/realname"
"hfb_sys/backend/internal/modules/supportgroup"
"hfb_sys/backend/internal/modules/systemconfig"
@@ -209,6 +210,12 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
}
walletService := wallet.NewService(walletRepo)
walletHandler := wallet.NewHandler(walletService)
var pickupRepo *pickup.Repository
if deps.DB != nil {
pickupRepo = pickup.NewRepository(deps.DB)
}
pickupService := pickup.NewService(pickupRepo)
pickupHandler := pickup.NewHandler(pickupService)
var paymentAccountRepo *paymentaccount.Repository
if deps.DB != nil {
paymentAccountRepo = paymentaccount.NewRepository(deps.DB, fieldEncryptor)
@@ -401,6 +408,12 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
sellerRoutes.GET("/listings/:id", listingHandler.FindMine)
}
// 卖家提号记录:仅 requireAuth,不强制 requireRealname,避免撤销实名后看不到自己被提号的记录
sellerPickupRoutes := api.Group("/seller/pickups", requireAuth)
{
sellerPickupRoutes.GET("", pickupHandler.ListForSeller)
}
orderRoutes := api.Group("/orders", requireAuth)
{
orderRoutes.POST("", requireRealname, orderHandler.Create)
@@ -531,6 +544,15 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
adminRoutes.POST("/orders/:id/refund/approve", requirePerm("order:close"), orderHandler.AdminApproveRefund)
adminRoutes.POST("/orders/:id/refund/reject", requirePerm("order:close"), orderHandler.AdminRejectRefund)
adminRoutes.GET("/orders/refund-pending", requirePerm("order:close"), orderHandler.ListPendingRefund)
// 管理员线下提号(独立于正常订单流程)
adminRoutes.POST("/pickups", requirePerm("order:pickup"), pickupHandler.Create)
adminRoutes.GET("/pickups", requirePerm("order:pickup"), pickupHandler.List)
adminRoutes.GET("/pickups/available-listings", requirePerm("order:pickup"), pickupHandler.AvailableListings)
adminRoutes.GET("/pickups/:id", requirePerm("order:pickup"), pickupHandler.Detail)
adminRoutes.POST("/pickups/:id/complete", requirePerm("order:pickup"), pickupHandler.Complete)
adminRoutes.POST("/pickups/:id/cancel", requirePerm("order:pickup"), pickupHandler.Cancel)
adminRoutes.GET("/listings", requirePerm("listing:view"), listingHandler.ListAdmin)
adminRoutes.GET("/listings/pending", requirePerm("listing:approve"), listingHandler.ListPendingReview)
adminRoutes.GET("/listings/:id", requirePerm("listing:view"), listingHandler.FindAdmin)