本文整理汇总了Golang中go2o/src/core/domain/interface/partner.IShop类的典型用法代码示例。如果您正苦于以下问题:Golang IShop类的具体用法?Golang IShop怎么用?Golang IShop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IShop类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SmartConfirmOrder
func (this *Shopping) SmartConfirmOrder(order shopping.IOrder) error {
var err error
v := order.GetValue()
log.Printf("[ AUTO][OrderSetup]:%s - Confirm \n", v.OrderNo)
var shop partner.IShop
if biShops == nil {
biShops = this._partner.GetBusinessInShops()
}
if len(biShops) == 1 {
shop = biShops[0]
} else {
shop, err = this.SmartChoiceShop(v.DeliverAddress)
if err != nil {
log.Println(err)
order.Suspend("智能分配门店失败!原因:" + err.Error())
return err
}
}
if shop != nil {
sv := shop.GetValue()
order.SetShop(shop.GetDomainId())
err = order.Confirm()
//err = order.Process()
order.AppendLog(enum.ORDER_LOG_SETUP, false, fmt.Sprintf(
"自动分配门店:%s,电话:%s", sv.Name, sv.Phone))
}
return err
}
示例2: SaveShop
func (this *partnerService) SaveShop(partnerId int, v *partner.ValueShop) (int, error) {
pt, err := this._partnerRep.GetPartner(partnerId)
if err != nil {
log.PrintErr(err)
return 0, err
}
var shop partner.IShop
if v.Id > 0 {
shop = pt.GetShop(v.Id)
if shop == nil {
return 0, errors.New("门店不存在")
}
} else {
shop = pt.CreateShop(v)
}
err = shop.SetValue(v)
if err != nil {
return 0, err
}
return shop.Save()
}