统一订单单状态模型

This commit is contained in:
yml2213
2026-07-31 17:02:19 +08:00
parent 677bdbbc1c
commit 04130e5ec8
19 changed files with 300 additions and 345 deletions
+11 -11
View File
@@ -126,7 +126,7 @@ func (h *MerchantHandler) UpdateProduct(c *gin.Context) {
func (h *MerchantHandler) ListOrders(c *gin.Context) {
page, size := pageParams(c)
list, total, err := h.fulfillmentSvc.ListOrders(middleware.GetMerchantID(c), page, size, c.Query("fulfillment_status"))
list, total, err := h.fulfillmentSvc.ListOrders(middleware.GetMerchantID(c), page, size, c.Query("order_status"))
if err != nil {
response.ServerError(c, err.Error())
return
@@ -135,10 +135,10 @@ func (h *MerchantHandler) ListOrders(c *gin.Context) {
}
type merchantTestOrderReq struct {
SKU string `json:"sku" binding:"required"`
BuyerReference string `json:"buyer_reference"`
Note string `json:"note"`
FulfillmentStatus string `json:"fulfillment_status"`
SKU string `json:"sku" binding:"required"`
BuyerReference string `json:"buyer_reference"`
Note string `json:"note"`
OrderStatus string `json:"order_status"`
}
func (h *MerchantHandler) CreateTestOrder(c *gin.Context) {
@@ -148,12 +148,12 @@ func (h *MerchantHandler) CreateTestOrder(c *gin.Context) {
return
}
order, err := h.fulfillmentSvc.CreateTestOrder(service.CreateTestOrderInput{
MerchantID: middleware.GetMerchantID(c),
ActorUserID: middleware.GetUserID(c),
SKU: req.SKU,
BuyerReference: req.BuyerReference,
Note: req.Note,
FulfillmentStatus: req.FulfillmentStatus,
MerchantID: middleware.GetMerchantID(c),
ActorUserID: middleware.GetUserID(c),
SKU: req.SKU,
BuyerReference: req.BuyerReference,
Note: req.Note,
OrderStatus: req.OrderStatus,
})
if err != nil {
response.BadRequest(c, err.Error())
+3 -4
View File
@@ -110,8 +110,8 @@ func (h *OpenV1Handler) QueryOrder(c *gin.Context) {
response.ServerError(c, err.Error())
return
}
openlog.Info(c, "query_order ok order_no=%s status=%s payment=%s",
order.OrderNo, order.FulfillmentStatus, order.PaymentStatus)
openlog.Info(c, "query_order ok order_no=%s status=%s",
order.OrderNo, order.OrderStatus)
response.OK(c, buildOpenOrderResponse(order))
}
@@ -259,8 +259,7 @@ func buildOpenOrderResponse(order *model.FulfillmentOrder) gin.H {
data := gin.H{
"order_no": order.OrderNo,
"client_order_no": order.ClientOrderNo,
"payment_status": order.PaymentStatus,
"fulfillment_status": order.FulfillmentStatus,
"order_status": order.OrderStatus,
"can_fulfill": canFulfill,
"cannot_fulfill_reason": reason,
"product": gin.H{