- 订单相关的基础操作,忽略LockStatus本地检查
This commit is contained in:
@@ -19,7 +19,7 @@ type BaseScheduler struct {
|
|||||||
|
|
||||||
func (c *BaseScheduler) AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error) {
|
func (c *BaseScheduler) AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("AcceptOrRefuseOrder orderID:%s, isAcceptIt:%t", order.VendorOrderID, isAcceptIt)
|
globals.SugarLogger.Infof("AcceptOrRefuseOrder orderID:%s, isAcceptIt:%t", order.VendorOrderID, isAcceptIt)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusNew {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusNew {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogErrorWithInfo(func() error {
|
err = utils.CallFuncLogErrorWithInfo(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).AcceptOrRefuseOrder(order, isAcceptIt, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).AcceptOrRefuseOrder(order, isAcceptIt, userName)
|
||||||
@@ -34,7 +34,7 @@ func (c *BaseScheduler) AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt
|
|||||||
|
|
||||||
func (c *BaseScheduler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error) {
|
func (c *BaseScheduler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("PickupGoods orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("PickupGoods orderID:%s", order.VendorOrderID)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusAccepted {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusAccepted {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogErrorWithInfo(func() error {
|
err = utils.CallFuncLogErrorWithInfo(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).PickupGoods(order, isSelfDelivery, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).PickupGoods(order, isSelfDelivery, userName)
|
||||||
@@ -54,7 +54,7 @@ func (c *BaseScheduler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bool
|
|||||||
|
|
||||||
func (c *BaseScheduler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (c *BaseScheduler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusFinishedPickup {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusFinishedPickup {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogErrorWithInfo(func() error {
|
err = utils.CallFuncLogErrorWithInfo(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).Swtich2SelfDeliver(order, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).Swtich2SelfDeliver(order, userName)
|
||||||
@@ -78,7 +78,7 @@ func (c *BaseScheduler) Swtich2SelfDeliver(order *model.GoodsOrder, userName str
|
|||||||
|
|
||||||
func (c *BaseScheduler) Swtich2SelfDelivered(order *model.GoodsOrder, userName string) (err error) {
|
func (c *BaseScheduler) Swtich2SelfDelivered(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("Swtich2SelfDelivered orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("Swtich2SelfDelivered orderID:%s", order.VendorOrderID)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusDelivering {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusDelivering {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogError(func() error {
|
err = utils.CallFuncLogError(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).Swtich2SelfDelivered(order, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).Swtich2SelfDelivered(order, userName)
|
||||||
@@ -98,7 +98,7 @@ func (c *BaseScheduler) Swtich2SelfDelivered(order *model.GoodsOrder, userName s
|
|||||||
|
|
||||||
func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error) {
|
func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("SelfDeliverDelivering orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("SelfDeliverDelivering orderID:%s", order.VendorOrderID)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusFinishedPickup {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusFinishedPickup {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogError(func() error {
|
err = utils.CallFuncLogError(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName)
|
||||||
@@ -121,7 +121,7 @@ func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName
|
|||||||
|
|
||||||
func (c *BaseScheduler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
func (c *BaseScheduler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Infof("SelfDeliverDelivered orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Infof("SelfDeliverDelivered orderID:%s", order.VendorOrderID)
|
||||||
if order.LockStatus == model.OrderStatusUnknown && order.Status == model.OrderStatusDelivering {
|
if /*order.LockStatus == model.OrderStatusUnknown && */ order.Status == model.OrderStatusDelivering {
|
||||||
if c.IsReallyCallPlatformAPI {
|
if c.IsReallyCallPlatformAPI {
|
||||||
err = utils.CallFuncLogError(func() error {
|
err = utils.CallFuncLogError(func() error {
|
||||||
return partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivered(order, userName)
|
return partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivered(order, userName)
|
||||||
|
|||||||
Reference in New Issue
Block a user