- debug output in createWaybillOn3rdProviders
- disable ELM in CreateWaybillOnProviders.
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package basesch
|
package basesch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -14,6 +16,9 @@ import (
|
|||||||
|
|
||||||
func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, vendorOrderID string, vendorID int, userName string) (bills []*model.Waybill, err error) {
|
func (c *BaseScheduler) CreateWaybillOnProviders(ctx *jxcontext.Context, vendorOrderID string, vendorID int, userName string) (bills []*model.Waybill, err error) {
|
||||||
globals.SugarLogger.Infof("CreateWaybillOnProviders orderID:%s userName:%s", vendorOrderID, userName)
|
globals.SugarLogger.Infof("CreateWaybillOnProviders orderID:%s userName:%s", vendorOrderID, userName)
|
||||||
|
if vendorID == model.VendorIDELM {
|
||||||
|
return nil, fmt.Errorf("不要直接使用饿了么订单号,请使用相应的饿百订单号")
|
||||||
|
}
|
||||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, vendorID)
|
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, vendorID)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if order.LockStatus != model.OrderStatusLocked && order.Status >= model.OrderStatusFinishedPickup && order.Status < model.OrderStatusEndBegin {
|
if order.LockStatus != model.OrderStatusLocked && order.Status >= model.OrderStatusFinishedPickup && order.Status < model.OrderStatusEndBegin {
|
||||||
|
|||||||
@@ -523,6 +523,8 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
|
|||||||
return nil
|
return nil
|
||||||
}); err == nil {
|
}); err == nil {
|
||||||
successCount++
|
successCount++
|
||||||
|
} else {
|
||||||
|
globals.SugarLogger.Infof("CreateWaybill orderID:%s failed with error:%v", order.VendorOrderID, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
business/jxstore/cms/message.go
Normal file
33
business/jxstore/cms/message.go
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package cms
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
|
)
|
||||||
|
|
||||||
|
func SendStoreMessage(ctx *jxcontext.Context, title, content string, storeIDs []int, isAsync, isContinueWhenError bool) (err error) {
|
||||||
|
db := dao.GetDB()
|
||||||
|
dao.Begin(db)
|
||||||
|
defer dao.Rollback(db)
|
||||||
|
msg := &model.Message{
|
||||||
|
Title: title,
|
||||||
|
Content: content,
|
||||||
|
Type: model.MessageTypeStore,
|
||||||
|
}
|
||||||
|
if err = dao.CreateEntity(db, msg); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, storeID := range storeIDs {
|
||||||
|
msgStatus := &model.MessageStatus{
|
||||||
|
MessageID: msg.ID,
|
||||||
|
StoreID: storeID,
|
||||||
|
Status: model.MessageStatusNew,
|
||||||
|
}
|
||||||
|
if err = dao.CreateEntity(db, msgStatus); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dao.Commit(db)
|
||||||
|
return err
|
||||||
|
}
|
||||||
27
business/model/message.go
Normal file
27
business/model/message.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
const (
|
||||||
|
MessageTypeStore = 1
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MessageStatusNew = 0
|
||||||
|
MessageStatusSendAllSuccess = 1
|
||||||
|
MessageStatusSendSuccess = 2
|
||||||
|
MessageStatusSendAllFailed = 3
|
||||||
|
MessageStatusRead = 4
|
||||||
|
)
|
||||||
|
|
||||||
|
type Message struct {
|
||||||
|
ModelIDCULD
|
||||||
|
Type int8
|
||||||
|
Title string
|
||||||
|
Content string
|
||||||
|
}
|
||||||
|
|
||||||
|
type MessageStatus struct {
|
||||||
|
ModelIDCULD
|
||||||
|
MessageID int
|
||||||
|
StoreID int
|
||||||
|
Status int8
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user