feat(pickup): 增加第三方单号补录功能并优化列表提号备注展示
- 后端支持补录/修改第三方单号接口 PUT /api/v1/admin/pickups/:id/third-party-order-no,记录流转事件与审计日志 - 前端线下提号主列表在第三方单号列后展示提号备注列 - 前端列表操作列及提号详情页增加补录/修改第三方单号操作入口与弹窗 - 通过 scripts/check.sh 全量门禁校验
This commit is contained in:
@@ -112,6 +112,30 @@ func (h *Handler) UpdateProfit(c *gin.Context) {
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
// UpdateThirdPartyOrderNo 补录或修改第三方单号(管理员)
|
||||
func (h *Handler) UpdateThirdPartyOrderNo(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
if !ok {
|
||||
response.Unauthorized(c, "缺少管理员上下文")
|
||||
return
|
||||
}
|
||||
id, ok := parseID(c)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
var req UpdateThirdPartyOrderNoRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
response.BadRequest(c, "第三方单号不能为空且长度不能超过128位")
|
||||
return
|
||||
}
|
||||
item, err := h.service.UpdateThirdPartyOrderNo(c.Request.Context(), id, req, adminID, auditMeta(c))
|
||||
if err != nil {
|
||||
writePickupError(c, err)
|
||||
return
|
||||
}
|
||||
response.OK(c, item)
|
||||
}
|
||||
|
||||
// CreateFinancialAdjustment 为已完成提号创建利润或打款调整。
|
||||
func (h *Handler) CreateFinancialAdjustment(c *gin.Context) {
|
||||
adminID, ok := currentAdminID(c)
|
||||
@@ -305,6 +329,10 @@ func writePickupError(c *gin.Context, err error) {
|
||||
response.Error(c, http.StatusNotFound, "pickup_shop_not_found", "店铺不存在")
|
||||
case errors.Is(err, ErrPickupShopNameExists):
|
||||
response.Error(c, http.StatusConflict, "pickup_shop_name_exists", "店铺名称已存在")
|
||||
case errors.Is(err, ErrPickupCancelled):
|
||||
response.BadRequest(c, "提号订单已取消,不能补录单号")
|
||||
case errors.Is(err, ErrInvalidThirdPartyOrderNo):
|
||||
response.BadRequest(c, "第三方单号不能为空且长度不能超过128位")
|
||||
default:
|
||||
response.Error(c, http.StatusInternalServerError, "pickup_error", err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user