作者 yangfu

1.订单修改

@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory" 4 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
5 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain" 5 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
6 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" 6 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
  7 + "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
7 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol" 8 "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
8 "time" 9 "time"
9 ) 10 )
@@ -39,6 +40,7 @@ func OrderDetail(header *protocol.RequestHeader, request *protocol.OrderDetailRe @@ -39,6 +40,7 @@ func OrderDetail(header *protocol.RequestHeader, request *protocol.OrderDetailRe
39 } 40 }
40 defer func() { 41 defer func() {
41 if err != nil { 42 if err != nil {
  43 + log.Error(err)
42 transactionContext.RollbackTransaction() 44 transactionContext.RollbackTransaction()
43 } 45 }
44 }() 46 }()
@@ -82,6 +84,7 @@ func OrderStatistics(header *protocol.RequestHeader, request *protocol.OrderStat @@ -82,6 +84,7 @@ func OrderStatistics(header *protocol.RequestHeader, request *protocol.OrderStat
82 } 84 }
83 defer func() { 85 defer func() {
84 if err != nil { 86 if err != nil {
  87 + log.Error(err)
85 transactionContext.RollbackTransaction() 88 transactionContext.RollbackTransaction()
86 } 89 }
87 }() 90 }()
@@ -131,16 +134,22 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques @@ -131,16 +134,22 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques
131 } 134 }
132 defer func() { 135 defer func() {
133 if err != nil { 136 if err != nil {
  137 + log.Error(err)
134 transactionContext.RollbackTransaction() 138 transactionContext.RollbackTransaction()
135 } 139 }
136 }() 140 }()
137 queryOption := &domain.OrderQueryOption{ 141 queryOption := &domain.OrderQueryOption{
138 PartnerId: header.UserId, 142 PartnerId: header.UserId,
139 - OrderType: request.OrderAction, 143 + OrderStatus: request.OrderAction + 1,
140 Limit: request.PageSize, 144 Limit: request.PageSize,
141 Offset: request.PageSize * request.PageIndex, 145 Offset: request.PageSize * request.PageIndex,
142 SortByUpdateTime: domain.DESC, 146 SortByUpdateTime: domain.DESC,
143 } 147 }
  148 + if request.OrderAction == 1 {
  149 + queryOption.OrderStatus = domain.OrderStatusDeliverSome
  150 + } else if request.OrderAction == 2 {
  151 + queryOption.OrderStatus = domain.OrderStatusDeliverAll
  152 + }
144 if request.StartTime > 0 { 153 if request.StartTime > 0 {
145 queryOption.BeginTime = time.Unix(request.StartTime/1000, 0) 154 queryOption.BeginTime = time.Unix(request.StartTime/1000, 0)
146 } 155 }
@@ -135,6 +135,7 @@ func (m *Order) IsRead() int { @@ -135,6 +135,7 @@ func (m *Order) IsRead() int {
135 type OrderQueryOption struct { 135 type OrderQueryOption struct {
136 PartnerId int64 `json:"partnerId,omitempty"` 136 PartnerId int64 `json:"partnerId,omitempty"`
137 OrderType int `json:"orderType,omitempty"` 137 OrderType int `json:"orderType,omitempty"`
  138 + OrderStatus int `json:"orderStatus,omitempty"`
138 BeginTime time.Time `json:"beginTime,omitempty"` 139 BeginTime time.Time `json:"beginTime,omitempty"`
139 EndTime time.Time `json:"endTime,omitempty"` 140 EndTime time.Time `json:"endTime,omitempty"`
140 SortByCreateTime string `json:"sortByCreateTime,omitempty"` 141 SortByCreateTime string `json:"sortByCreateTime,omitempty"`
@@ -66,7 +66,7 @@ func (this *OrderController) OrderList() { @@ -66,7 +66,7 @@ func (this *OrderController) OrderList() {
66 msg = m 66 msg = m
67 return 67 return
68 } 68 }
69 - request.OrderAction = domain.OrderReal 69 + request.OrderType = domain.OrderReal
70 header := this.GetRequestHeader(this.Ctx) 70 header := this.GetRequestHeader(this.Ctx)
71 msg = protocol.NewReturnResponse(order.OrderList(header, request)) 71 msg = protocol.NewReturnResponse(order.OrderList(header, request))
72 } 72 }
@@ -87,7 +87,7 @@ func (this *OrderController) Intentions() { @@ -87,7 +87,7 @@ func (this *OrderController) Intentions() {
87 return 87 return
88 } 88 }
89 request.EndTime = time.Now().Unix() * 1000 89 request.EndTime = time.Now().Unix() * 1000
90 - request.OrderAction = domain.OrderIntention 90 + request.OrderType = domain.OrderIntention
91 header := this.GetRequestHeader(this.Ctx) 91 header := this.GetRequestHeader(this.Ctx)
92 msg = protocol.NewReturnResponse(order.OrderList(header, request)) 92 msg = protocol.NewReturnResponse(order.OrderList(header, request))
93 } 93 }
@@ -46,9 +46,10 @@ type OrderStatics struct { @@ -46,9 +46,10 @@ type OrderStatics struct {
46 type OrderListRequest struct { 46 type OrderListRequest struct {
47 StartTime int64 `json:"startTime"` 47 StartTime int64 `json:"startTime"`
48 EndTime int64 `json:"endTime"` 48 EndTime int64 `json:"endTime"`
49 - OrderAction int `json:"orderAction"` 49 + OrderAction int `json:"orderAction"` //订单Action(0全部订单、1部分发货、2全部发货)
50 PageIndex int `json:"pageIndex"` 50 PageIndex int `json:"pageIndex"`
51 PageSize int `json:"pageSize" valid:"Required"` 51 PageSize int `json:"pageSize" valid:"Required"`
  52 + OrderType int `json:"-"`
52 } 53 }
53 type OrderListResponse struct { 54 type OrderListResponse struct {
54 List []*OrderListItem `json:"list"` 55 List []*OrderListItem `json:"list"`