作者 陈志颖

feat:订单详情增加销售日期

... ... @@ -38,6 +38,7 @@ func Detail(header *protocol.RequestHeader, request *protocol.OrderDetailRequest
OrderStatus: orderStatus(order),
CreateTime: order.CreateTime.Unix() * 1000,
UpdateTime: order.UpdateTime.Unix() * 1000,
SalesTime: order.SaleDate.Unix() * 1000,
OrderDistrict: map[string]interface{}{"id": order.RegionInfo.RegionId, "name": order.RegionInfo.RegionName},
Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo},
Products: orderProducts(order),
... ... @@ -195,8 +196,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
// 查询订单列表
queryOption := &domain.OrderQueryOption{
Limit: request.PageSize,
Offset: request.PageSize * request.PageIndex,
Limit: request.PageSize,
Offset: request.PageSize * request.PageIndex,
//SortByUpdateTime: domain.DESC,
SortByCreateTime: domain.DESC,
PartnerId: request.PartnerId,
... ... @@ -234,6 +235,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
PartnerCategoryId: request.JoinWay,
})
rsp.Total = cumulativeQuantity
rsp.Timestamp = time.Now().Unix() * 1000
}
//【特殊处理2】 今天累计数量特殊处理 当前查询时间段内所有订单总数(复用rsp.Total字段)
if request.StartTime > 0 && request.EndTime > 0 {
... ... @@ -249,17 +251,18 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
func DomainOrderToOrderListItem(order *domain.OrderBase) *protocol.OrderListItem {
bonusStatic := order.OrderBonusStatic()
return &protocol.OrderListItem{
Id: order.Id,
OrderType: order.OrderType,
OrderNo: order.OrderCode,
DeliveryNo: order.DeliveryCode,
OrderDistrict: map[string]interface{}{
"id": order.RegionInfo.RegionId,
Id: order.Id,
OrderType: order.OrderType,
OrderNo: order.OrderCode,
DeliveryNo: order.DeliveryCode,
OrderDistrict: map[string]interface{}{
"id": order.RegionInfo.RegionId,
"name": order.RegionInfo.RegionName,
},
OrderAmount: order.PlanOrderAmount,
UpdateTime: order.UpdateTime.Unix() * 1000,
MyDividend: bonusStatic.OrderTotalReceivable(),
IsRead: order.IsRead(),
OrderAmount: order.PlanOrderAmount,
UpdateTime: order.UpdateTime.Unix() * 1000,
SalesTime: order.SaleDate.Unix() * 1000,
MyDividend: bonusStatic.OrderTotalReceivable(),
IsRead: order.IsRead(),
}
}
... ...
... ... @@ -2,9 +2,9 @@ package constant
import "os"
var REDIS_HOST = "192.168.100.6"
var REDIS_HOST = "127.0.0.1"
var REDIS_PORT = "6379"
var REDIS_AUTH = "1993618@jack"
var REDIS_AUTH = "" // 1993618@jack
func init() {
if os.Getenv("REDIS_HOST") != "" {
... ...
... ... @@ -42,6 +42,8 @@ type OrderBase struct {
DeliveryTime time.Time
//更新时间
UpdateTime time.Time
//销售日期
SaleDate time.Time
//上一次查看时间 已读情况
LastViewTime time.Time
//合伙人应收分红
... ... @@ -163,19 +165,19 @@ type OrderQueryOption struct {
}
type DividendOrdersQueryOption struct {
PartnerId int64 `json:"partnerId"`
OrderType int `json:"orderType"` //订单类型
OrderTypes []int `json:"orderTypes,omitempty"`
DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细)
DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出)
IsDisable string `json:"isDisable,omitempty"`
StartTime int64 `json:"startTime" `
EndTime int64 `json:"endTime"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
SortByUpdateTime string `json:"sortByUpdateTime,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型
PartnerId int64 `json:"partnerId"`
OrderType int `json:"orderType"` //订单类型
OrderTypes []int `json:"orderTypes,omitempty"`
DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细)
DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出)
IsDisable string `json:"isDisable,omitempty"`
StartTime int64 `json:"startTime" `
EndTime int64 `json:"endTime"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
SortByUpdateTime string `json:"sortByUpdateTime,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型
}
//买家
... ...
... ... @@ -42,6 +42,8 @@ type OrderBase struct {
DeliveryTime time.Time
//更新时间
UpdateTime time.Time
//销售日期
SaleDate time.Time
//上一次查看时间 已读情况
LastViewTime time.Time
//合伙人应收分红
... ...
... ... @@ -32,6 +32,7 @@ type OrderDetail struct {
OrderStatus int `json:"orderStatus"` //订单状态 1.待支付 2.已支付 3.已支付退货 4待支付退货
CreateTime int64 `json:"createTime"`
UpdateTime int64 `json:"updateTime"`
SalesTime int64 `json:"salesTime"` // 销售日期
OrderDistrict interface{} `json:"orderDistrict"`
Customer Customer `json:"customer"`
Products interface{} `json:"products"`
... ... @@ -95,6 +96,7 @@ type OrderListResponse struct {
List []*OrderListItem `json:"list"`
Statistics map[string]interface{} `json:"-"`
Total int `json:"total"`
Timestamp int64 `json:"timestamp"`
}
type OrderListItem struct {
... ... @@ -117,7 +119,9 @@ type OrderListItem struct {
//订单金额
OrderAmount float64 `json:"orderAmount"`
// 订单更新时间
UpdateTime int64 `json:"updateTime"`
UpdateTime int64 `json:"updateTime"`
//销售时间
SalesTime int64 `json:"salesTime"`
//我的分红
MyDividend float64 `json:"dividendReceivable"`
//是否已读(0未读,1已读)
... ...