作者 yangfu

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

@@ -39,6 +39,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis @@ -39,6 +39,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
39 rsp.Statistics = protocol.DividendStatistics{ 39 rsp.Statistics = protocol.DividendStatistics{
40 Received: bonusAll.Received, 40 Received: bonusAll.Received,
41 Outstanding: bonusAll.Outstanding, 41 Outstanding: bonusAll.Outstanding,
  42 + Receivable: bonusAll.Receivable,
42 Quarters: bonusQuarters, 43 Quarters: bonusQuarters,
43 } 44 }
44 err = transactionContext.CommitTransaction() 45 err = transactionContext.CommitTransaction()
@@ -52,6 +53,7 @@ func AllBonusStatics(orders []*domain.OrderBase, action int) (bonus protocol.Bon @@ -52,6 +53,7 @@ func AllBonusStatics(orders []*domain.OrderBase, action int) (bonus protocol.Bon
52 o := orders[i] 53 o := orders[i]
53 bonus.Received = utils.Decimal(bonus.Received + o.OrderBonusReceive()) 54 bonus.Received = utils.Decimal(bonus.Received + o.OrderBonusReceive())
54 bonus.Outstanding = utils.Decimal(bonus.Outstanding + o.OrderBonusWait()) 55 bonus.Outstanding = utils.Decimal(bonus.Outstanding + o.OrderBonusWait())
  56 + bonus.Receivable = utils.Decimal(bonus.Receivable + o.PlanPartnerBonus)
55 } 57 }
56 return 58 return
57 } 59 }
@@ -188,8 +188,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r @@ -188,8 +188,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
188 //统计数据 188 //统计数据
189 if request.PageIndex == 0 { 189 if request.PageIndex == 0 {
190 var ( 190 var (
191 - partShipmentQuantity, allShipmentQuantity int  
192 - cumulativeQuantity int 191 + //partShipmentQuantity, allShipmentQuantity int
  192 + cumulativeQuantity int
193 ) 193 )
194 //部分发货的订单数量 194 //部分发货的订单数量
195 //partShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ 195 //partShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
@@ -200,13 +200,13 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r @@ -200,13 +200,13 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
200 // OrderStatus: domain.OrderStatusDeliverSome, 200 // OrderStatus: domain.OrderStatusDeliverSome,
201 //}) 201 //})
202 //全部发货的订单数量 202 //全部发货的订单数量
203 - allShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{  
204 - EndTime: request.EndTime,  
205 - BeginTime: request.StartTime,  
206 - OrderType: domain.OrderReal,  
207 - PartnerId: header.UserId,  
208 - //OrderStatus: domain.OrderStatusDeliverAll,  
209 - }) 203 + //allShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
  204 + // EndTime: request.EndTime,
  205 + // BeginTime: request.StartTime,
  206 + // OrderType: domain.OrderReal,
  207 + // PartnerId: header.UserId,
  208 + // //OrderStatus: domain.OrderStatusDeliverAll,
  209 + //})
210 //累计实发订单 210 //累计实发订单
211 cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ 211 cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{
212 EndTime: time.Now().Unix() * 1000, 212 EndTime: time.Now().Unix() * 1000,
@@ -224,8 +224,10 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r @@ -224,8 +224,10 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
224 //订单数量 224 //订单数量
225 //rsp.Statistics["partShipmentQuantity"] = partShipmentQuantity 225 //rsp.Statistics["partShipmentQuantity"] = partShipmentQuantity
226 //rsp.Statistics["allShipmentQuantity"] = allShipmentQuantity 226 //rsp.Statistics["allShipmentQuantity"] = allShipmentQuantity
227 - rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货  
228 - rsp.Statistics["cumulativeQuantity"] = cumulativeQuantity //实发订单 = 部分发货 + 全部发货 227 + //rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货
  228 + //rsp.Statistics["cumulativeQuantity"] = cumulativeQuantity
  229 + rsp.Total = cumulativeQuantity
  230 + //实发订单 = 部分发货 + 全部发货
229 //rsp.Statistics["intentionQuantity"] = intentionQuantity 231 //rsp.Statistics["intentionQuantity"] = intentionQuantity
230 232
231 } 233 }
@@ -19,6 +19,7 @@ type DividendStatisticsResponse struct { @@ -19,6 +19,7 @@ type DividendStatisticsResponse struct {
19 type DividendStatistics struct { 19 type DividendStatistics struct {
20 Received float64 `json:"received"` //总已收分红 20 Received float64 `json:"received"` //总已收分红
21 Outstanding float64 `json:"outstanding"` //总未收分红/分红支出 21 Outstanding float64 `json:"outstanding"` //总未收分红/分红支出
  22 + Receivable float64 `json:"receivable"` //总应收分红
22 Quarters []Bonus `json:"quarters"` 23 Quarters []Bonus `json:"quarters"`
23 } 24 }
24 25
@@ -66,7 +66,8 @@ type OrderListRequest struct { @@ -66,7 +66,8 @@ type OrderListRequest struct {
66 } 66 }
67 type OrderListResponse struct { 67 type OrderListResponse struct {
68 List []*OrderListItem `json:"list"` 68 List []*OrderListItem `json:"list"`
69 - Statistics map[string]interface{} `json:"statistics"` 69 + Statistics map[string]interface{} `json:"-"`
  70 + Total int `json:"total"`
70 } 71 }
71 72
72 type OrderListItem struct { 73 type OrderListItem struct {