作者 yangfu

修改:订单详情,订单列表统计

... ... @@ -39,6 +39,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
rsp.Statistics = protocol.DividendStatistics{
Received: bonusAll.Received,
Outstanding: bonusAll.Outstanding,
Receivable: bonusAll.Receivable,
Quarters: bonusQuarters,
}
err = transactionContext.CommitTransaction()
... ... @@ -52,6 +53,7 @@ func AllBonusStatics(orders []*domain.OrderBase, action int) (bonus protocol.Bon
o := orders[i]
bonus.Received = utils.Decimal(bonus.Received + o.OrderBonusReceive())
bonus.Outstanding = utils.Decimal(bonus.Outstanding + o.OrderBonusWait())
bonus.Receivable = utils.Decimal(bonus.Receivable + o.PlanPartnerBonus)
}
return
}
... ...
... ... @@ -188,8 +188,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
//统计数据
if request.PageIndex == 0 {
var (
partShipmentQuantity, allShipmentQuantity int
cumulativeQuantity int
//partShipmentQuantity, allShipmentQuantity int
cumulativeQuantity int
)
//部分发货的订单数量
//partShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
... ... @@ -200,13 +200,13 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
// OrderStatus: domain.OrderStatusDeliverSome,
//})
//全部发货的订单数量
allShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
EndTime: request.EndTime,
BeginTime: request.StartTime,
OrderType: domain.OrderReal,
PartnerId: header.UserId,
//OrderStatus: domain.OrderStatusDeliverAll,
})
//allShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
// EndTime: request.EndTime,
// BeginTime: request.StartTime,
// OrderType: domain.OrderReal,
// PartnerId: header.UserId,
// //OrderStatus: domain.OrderStatusDeliverAll,
//})
//累计实发订单
cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
EndTime: time.Now().Unix() * 1000,
... ... @@ -224,8 +224,10 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
//订单数量
//rsp.Statistics["partShipmentQuantity"] = partShipmentQuantity
//rsp.Statistics["allShipmentQuantity"] = allShipmentQuantity
rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货
rsp.Statistics["cumulativeQuantity"] = cumulativeQuantity //实发订单 = 部分发货 + 全部发货
//rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货
//rsp.Statistics["cumulativeQuantity"] = cumulativeQuantity
rsp.Total = cumulativeQuantity
//实发订单 = 部分发货 + 全部发货
//rsp.Statistics["intentionQuantity"] = intentionQuantity
}
... ...
... ... @@ -19,6 +19,7 @@ type DividendStatisticsResponse struct {
type DividendStatistics struct {
Received float64 `json:"received"` //总已收分红
Outstanding float64 `json:"outstanding"` //总未收分红/分红支出
Receivable float64 `json:"receivable"` //总应收分红
Quarters []Bonus `json:"quarters"`
}
... ...
... ... @@ -66,7 +66,8 @@ type OrderListRequest struct {
}
type OrderListResponse struct {
List []*OrderListItem `json:"list"`
Statistics map[string]interface{} `json:"statistics"`
Statistics map[string]interface{} `json:"-"`
Total int `json:"total"`
}
type OrderListItem struct {
... ...