作者 yangfu

1.订单修改

... ... @@ -4,6 +4,7 @@ import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
"time"
)
... ... @@ -39,6 +40,7 @@ func OrderDetail(header *protocol.RequestHeader, request *protocol.OrderDetailRe
}
defer func() {
if err != nil {
log.Error(err)
transactionContext.RollbackTransaction()
}
}()
... ... @@ -82,6 +84,7 @@ func OrderStatistics(header *protocol.RequestHeader, request *protocol.OrderStat
}
defer func() {
if err != nil {
log.Error(err)
transactionContext.RollbackTransaction()
}
}()
... ... @@ -131,16 +134,22 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques
}
defer func() {
if err != nil {
log.Error(err)
transactionContext.RollbackTransaction()
}
}()
queryOption := &domain.OrderQueryOption{
PartnerId: header.UserId,
OrderType: request.OrderAction,
OrderStatus: request.OrderAction + 1,
Limit: request.PageSize,
Offset: request.PageSize * request.PageIndex,
SortByUpdateTime: domain.DESC,
}
if request.OrderAction == 1 {
queryOption.OrderStatus = domain.OrderStatusDeliverSome
} else if request.OrderAction == 2 {
queryOption.OrderStatus = domain.OrderStatusDeliverAll
}
if request.StartTime > 0 {
queryOption.BeginTime = time.Unix(request.StartTime/1000, 0)
}
... ...
... ... @@ -135,6 +135,7 @@ func (m *Order) IsRead() int {
type OrderQueryOption struct {
PartnerId int64 `json:"partnerId,omitempty"`
OrderType int `json:"orderType,omitempty"`
OrderStatus int `json:"orderStatus,omitempty"`
BeginTime time.Time `json:"beginTime,omitempty"`
EndTime time.Time `json:"endTime,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
... ...
... ... @@ -66,7 +66,7 @@ func (this *OrderController) OrderList() {
msg = m
return
}
request.OrderAction = domain.OrderReal
request.OrderType = domain.OrderReal
header := this.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(order.OrderList(header, request))
}
... ... @@ -87,7 +87,7 @@ func (this *OrderController) Intentions() {
return
}
request.EndTime = time.Now().Unix() * 1000
request.OrderAction = domain.OrderIntention
request.OrderType = domain.OrderIntention
header := this.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(order.OrderList(header, request))
}
... ...
... ... @@ -46,9 +46,10 @@ type OrderStatics struct {
type OrderListRequest struct {
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
OrderAction int `json:"orderAction"`
OrderAction int `json:"orderAction"` //订单Action(0全部订单、1部分发货、2全部发货)
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize" valid:"Required"`
OrderType int `json:"-"`
}
type OrderListResponse struct {
List []*OrderListItem `json:"list"`
... ...