Example #1
0
File: order.go Project: zoe527/go2o
// 取消商品
func (this *Order) cancelGoods() error {
	for _, v := range this._value.Items {
		snapshot := this._saleRep.GetGoodsSnapshot(v.SnapshotId)
		if snapshot == nil {
			return sale.ErrNoSuchSnapshot
		}
		var goods sale.IGoods = this._saleRep.GetSale(this._value.PartnerId).
			GetGoods(snapshot.GoodsId)
		if goods != nil {
			goods.CancelSale(v.Quantity, this.GetOrderNo())
		}
	}
	return nil
}