正在显示
6 个修改的文件
包含
38 行增加
和
28 行删除
| @@ -67,7 +67,7 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol. | @@ -67,7 +67,7 @@ func QuartersBonusStatics(orders []*domain.Order, action int) (bonus []protocol. | ||
| 67 | bonus = make([]protocol.Bonus, 4) | 67 | bonus = make([]protocol.Bonus, 4) |
| 68 | for i := range orders { | 68 | for i := range orders { |
| 69 | o := orders[i] | 69 | o := orders[i] |
| 70 | - quarter := o.CreateAt.Month() / 4 | 70 | + quarter := o.CreateAt.Month() / 3 |
| 71 | bonus[quarter].Received += o.OrderBonusReceive() | 71 | bonus[quarter].Received += o.OrderBonusReceive() |
| 72 | bonus[quarter].Outstanding += o.OrderBonusWait() | 72 | bonus[quarter].Outstanding += o.OrderBonusWait() |
| 73 | bonus[quarter].Expend += o.OrderBonusOutstanding() | 73 | bonus[quarter].Expend += o.OrderBonusOutstanding() |
| @@ -99,13 +99,14 @@ func DividendOrders(header *protocol.RequestHeader, request *protocol.DividendOr | @@ -99,13 +99,14 @@ func DividendOrders(header *protocol.RequestHeader, request *protocol.DividendOr | ||
| 99 | rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)} | 99 | rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)} |
| 100 | 100 | ||
| 101 | count, orders, err = OrderDao.DividendOrders(&domain.DividendOrdersQueryOption{ | 101 | count, orders, err = OrderDao.DividendOrders(&domain.DividendOrdersQueryOption{ |
| 102 | - PartnerId: header.UserId, | ||
| 103 | - DetailAction: request.DetailAction, | ||
| 104 | - DividendAction: request.DividendAction, | ||
| 105 | - StartTime: request.StartTime, | ||
| 106 | - EndTime: request.EndTime, | ||
| 107 | - Offset: request.PageIndex * request.PageSize, | ||
| 108 | - Limit: request.PageSize, | 102 | + PartnerId: header.UserId, |
| 103 | + DetailAction: request.DetailAction, | ||
| 104 | + DividendAction: request.DividendAction, | ||
| 105 | + StartTime: request.StartTime, | ||
| 106 | + EndTime: request.EndTime, | ||
| 107 | + Offset: request.PageIndex * request.PageSize, | ||
| 108 | + Limit: request.PageSize, | ||
| 109 | + SortByUpdateTime: domain.DESC, | ||
| 109 | }) | 110 | }) |
| 110 | if err != nil { | 111 | if err != nil { |
| 111 | return | 112 | return |
| @@ -53,6 +53,7 @@ func OrderDetail(header *protocol.RequestHeader, request *protocol.OrderDetailRe | @@ -53,6 +53,7 @@ func OrderDetail(header *protocol.RequestHeader, request *protocol.OrderDetailRe | ||
| 53 | OrderQuantity: order.OrderActualCount, | 53 | OrderQuantity: order.OrderActualCount, |
| 54 | OrderAmount: order.OrderActualAmount, | 54 | OrderAmount: order.OrderActualAmount, |
| 55 | OrderAmountCancel: order.OrderAmountCancel(), | 55 | OrderAmountCancel: order.OrderAmountCancel(), |
| 56 | + OrderUpdateReason: order.Reason, | ||
| 56 | OrderDistrict: map[string]interface{}{"id": order.OrderRegionInfo.RegionId, "name": order.OrderRegionInfo.RegionName}, | 57 | OrderDistrict: map[string]interface{}{"id": order.OrderRegionInfo.RegionId, "name": order.OrderRegionInfo.RegionName}, |
| 57 | Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo}, | 58 | Customer: protocol.Customer{Uname: order.Buyer.BuyerName, Phone: order.Buyer.ContactInfo}, |
| 58 | MyDividend: order.OrderTotalBonus(), | 59 | MyDividend: order.OrderTotalBonus(), |
| @@ -149,8 +150,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | @@ -149,8 +150,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | ||
| 149 | if request.PageIndex == 0 { | 150 | if request.PageIndex == 0 { |
| 150 | var ( | 151 | var ( |
| 151 | partShipmentQuantity, allShipmentQuantity int | 152 | partShipmentQuantity, allShipmentQuantity int |
| 152 | - //cumulativeQuantity, | ||
| 153 | - intentionQuantity int | 153 | + cumulativeQuantity, intentionQuantity int |
| 154 | ) | 154 | ) |
| 155 | //部分发货的订单数量 | 155 | //部分发货的订单数量 |
| 156 | partShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ | 156 | partShipmentQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ |
| @@ -169,24 +169,24 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | @@ -169,24 +169,24 @@ func OrderList(header *protocol.RequestHeader, request *protocol.OrderListReques | ||
| 169 | OrderStatus: domain.OrderStatusDeliverAll, | 169 | OrderStatus: domain.OrderStatusDeliverAll, |
| 170 | }) | 170 | }) |
| 171 | //累计实发订单 | 171 | //累计实发订单 |
| 172 | - //cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ | ||
| 173 | - // EndTime: request.EndTime, | ||
| 174 | - // BeginTime: request.StartTime, | ||
| 175 | - // OrderType: domain.OrderReal, | ||
| 176 | - // PartnerId: header.UserId, | ||
| 177 | - //}) | 172 | + cumulativeQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ |
| 173 | + EndTime: time.Now().Unix() * 1000, | ||
| 174 | + //BeginTime: request.StartTime, | ||
| 175 | + OrderType: domain.OrderReal, | ||
| 176 | + PartnerId: header.UserId, | ||
| 177 | + }) | ||
| 178 | //累计意向订单 | 178 | //累计意向订单 |
| 179 | intentionQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ | 179 | intentionQuantity, _, err = OrderDao.OrderStatics(&domain.OrderStaticQuery{ |
| 180 | - EndTime: request.EndTime, | ||
| 181 | - BeginTime: request.StartTime, | 180 | + EndTime: time.Now().Unix() * 1000, |
| 181 | + //BeginTime: request.StartTime, | ||
| 182 | OrderType: domain.OrderIntention, | 182 | OrderType: domain.OrderIntention, |
| 183 | PartnerId: header.UserId, | 183 | PartnerId: header.UserId, |
| 184 | }) | 184 | }) |
| 185 | //订单数量 | 185 | //订单数量 |
| 186 | rsp.Statistics["partShipmentQuantity"] = partShipmentQuantity | 186 | rsp.Statistics["partShipmentQuantity"] = partShipmentQuantity |
| 187 | rsp.Statistics["allShipmentQuantity"] = allShipmentQuantity | 187 | rsp.Statistics["allShipmentQuantity"] = allShipmentQuantity |
| 188 | - rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货 | ||
| 189 | - rsp.Statistics["cumulativeQuantity"] = partShipmentQuantity + allShipmentQuantity //实发订单 = 部分发货 + 全部发货 | 188 | + rsp.Statistics["orderQuantity"] = partShipmentQuantity + allShipmentQuantity //所有订单 = 部分发货 + 已经发货 |
| 189 | + rsp.Statistics["cumulativeQuantity"] = cumulativeQuantity //实发订单 = 部分发货 + 全部发货 | ||
| 190 | rsp.Statistics["intentionQuantity"] = intentionQuantity | 190 | rsp.Statistics["intentionQuantity"] = intentionQuantity |
| 191 | 191 | ||
| 192 | } | 192 | } |
| @@ -207,7 +207,7 @@ func DomainOrderToOrderListItem(order *domain.Order) *protocol.OrderListItem { | @@ -207,7 +207,7 @@ func DomainOrderToOrderListItem(order *domain.Order) *protocol.OrderListItem { | ||
| 207 | OrderType: order.OrderType, | 207 | OrderType: order.OrderType, |
| 208 | OrderNo: order.OrderCode, | 208 | OrderNo: order.OrderCode, |
| 209 | OrderName: order.OrderName, | 209 | OrderName: order.OrderName, |
| 210 | - OrderAmount: order.OrderAmount, | 210 | + OrderAmount: order.OrderActualAmount, |
| 211 | OrderActualCount: order.OrderActualCount, | 211 | OrderActualCount: order.OrderActualCount, |
| 212 | OrderStatus: order.OrderStatus, | 212 | OrderStatus: order.OrderStatus, |
| 213 | UpdateTime: order.UpdateAt.Unix() * 1000, | 213 | UpdateTime: order.UpdateAt.Unix() * 1000, |
| @@ -63,6 +63,8 @@ type Order struct { | @@ -63,6 +63,8 @@ type Order struct { | ||
| 63 | 63 | ||
| 64 | //上一次查看时间 已读情况 | 64 | //上一次查看时间 已读情况 |
| 65 | LastViewTime time.Time `json:"lastViewTime,omitempty"` | 65 | LastViewTime time.Time `json:"lastViewTime,omitempty"` |
| 66 | + //订单更新理由 | ||
| 67 | + Reason string `json:"reason,omitempty"` | ||
| 66 | } | 68 | } |
| 67 | 69 | ||
| 68 | func (m *Order) Identify() interface{} { | 70 | func (m *Order) Identify() interface{} { |
| @@ -149,13 +151,14 @@ type OrderQueryOption struct { | @@ -149,13 +151,14 @@ type OrderQueryOption struct { | ||
| 149 | } | 151 | } |
| 150 | 152 | ||
| 151 | type DividendOrdersQueryOption struct { | 153 | type DividendOrdersQueryOption struct { |
| 152 | - PartnerId int64 `json:"partnerId"` | ||
| 153 | - DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细) | ||
| 154 | - DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出) | ||
| 155 | - StartTime int64 `json:"startTime" ` | ||
| 156 | - EndTime int64 `json:"endTime"` | ||
| 157 | - Offset int `json:"offset,omitempty"` | ||
| 158 | - Limit int `json:"limit,omitempty"` | 154 | + PartnerId int64 `json:"partnerId"` |
| 155 | + DetailAction int `json:"detailAction"` //明细类型(0已收明细、1未收明细) | ||
| 156 | + DividendAction int `json:"dividendAction"` //分红类型(0累计分红、1分红支出) | ||
| 157 | + StartTime int64 `json:"startTime" ` | ||
| 158 | + EndTime int64 `json:"endTime"` | ||
| 159 | + Offset int `json:"offset,omitempty"` | ||
| 160 | + Limit int `json:"limit,omitempty"` | ||
| 161 | + SortByUpdateTime string `json:"sortByUpdateTime,omitempty"` | ||
| 159 | } | 162 | } |
| 160 | 163 | ||
| 161 | //买家 | 164 | //买家 |
| @@ -74,6 +74,9 @@ func (dao *OrderDao) DividendOrders(option *domain.DividendOrdersQueryOption) (c | @@ -74,6 +74,9 @@ func (dao *OrderDao) DividendOrders(option *domain.DividendOrdersQueryOption) (c | ||
| 74 | if option.Offset > 0 { | 74 | if option.Offset > 0 { |
| 75 | q.Offset(option.Offset) | 75 | q.Offset(option.Offset) |
| 76 | } | 76 | } |
| 77 | + if len(option.SortByUpdateTime) > 0 { | ||
| 78 | + q.Order(fmt.Sprintf("order.id %v", option.SortByUpdateTime)) | ||
| 79 | + } | ||
| 77 | count, err = q.Distinct().SelectAndCount() | 80 | count, err = q.Distinct().SelectAndCount() |
| 78 | return | 81 | return |
| 79 | } | 82 | } |
| @@ -17,6 +17,7 @@ type OrderDetail struct { | @@ -17,6 +17,7 @@ type OrderDetail struct { | ||
| 17 | OrderQuantity int `json:"orderQuantity"` | 17 | OrderQuantity int `json:"orderQuantity"` |
| 18 | OrderAmount float64 `json:"orderAmount"` | 18 | OrderAmount float64 `json:"orderAmount"` |
| 19 | OrderAmountCancel float64 `json:"orderAmountCancel"` | 19 | OrderAmountCancel float64 `json:"orderAmountCancel"` |
| 20 | + OrderUpdateReason string `json:"orderUpdateReason"` | ||
| 20 | OrderDistrict interface{} `json:"orderDistrict"` | 21 | OrderDistrict interface{} `json:"orderDistrict"` |
| 21 | Customer Customer `json:"customer"` | 22 | Customer Customer `json:"customer"` |
| 22 | MyDividend float64 `json:"myDividend"` | 23 | MyDividend float64 `json:"myDividend"` |
-
请 注册 或 登录 后发表评论