刷新物料哦订单状态判断
This commit is contained in:
@@ -418,6 +418,8 @@ func doDailyWork2() {
|
|||||||
cms.CurVendorSync.SyncJdsStoresSkus(jxcontext.AdminCtx, nil, true, true)
|
cms.CurVendorSync.SyncJdsStoresSkus(jxcontext.AdminCtx, nil, true, true)
|
||||||
//刷新京东商城的门店库存
|
//刷新京东商城的门店库存
|
||||||
cms.SyncJdsStoreStock(jxcontext.AdminCtx, true, true)
|
cms.SyncJdsStoreStock(jxcontext.AdminCtx, true, true)
|
||||||
|
//刷新京东商城订单结算价
|
||||||
|
orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -2).Format("20060102"), time.Now().Format("20060102"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func doDailyWork() {
|
func doDailyWork() {
|
||||||
@@ -451,8 +453,6 @@ func doDailyWork() {
|
|||||||
localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx)
|
localjx.RefreshAllMatterOrderStatus(jxcontext.AdminCtx)
|
||||||
//同步银豹到京西
|
//同步银豹到京西
|
||||||
// cms.CurVendorSync.SyncStoreSkusFromYb(jxcontext.AdminCtx, nil, true, true)
|
// cms.CurVendorSync.SyncStoreSkusFromYb(jxcontext.AdminCtx, nil, true, true)
|
||||||
//刷新京东商城订单结算价
|
|
||||||
orderman.RefreshJdShopOrdersEarningPrice(jxcontext.AdminCtx, time.Now().AddDate(0, 0, -2).Format("20060102"), time.Now().Format("20060102"))
|
|
||||||
//同步上架京东商城待售商品
|
//同步上架京东商城待售商品
|
||||||
cms.RefreshJdsSkusStatus(jxcontext.AdminCtx)
|
cms.RefreshJdsSkusStatus(jxcontext.AdminCtx)
|
||||||
//同步美团配送与否状态及美团门店是否存在
|
//同步美团配送与否状态及美团门店是否存在
|
||||||
|
|||||||
@@ -1642,26 +1642,28 @@ func RefreshAllMatterOrderStatus(ctx *jxcontext.Context) (err error) {
|
|||||||
cancelCount++
|
cancelCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Begin(db)
|
if len(goodsList2) > 0 {
|
||||||
defer func() {
|
dao.Begin(db)
|
||||||
if r := recover(); r != nil {
|
defer func() {
|
||||||
dao.Rollback(db)
|
if r := recover(); r != nil {
|
||||||
panic(r)
|
dao.Rollback(db)
|
||||||
|
panic(r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
if deliveringCount == 0 {
|
||||||
|
v.Status = model.OrderStatusFinished
|
||||||
|
} else {
|
||||||
|
if cancelCount == len(goodsList2) {
|
||||||
|
v.Status = model.OrderStatusCanceled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
if v.Status < model.OrderStatusDelivering {
|
||||||
if deliveringCount == 0 {
|
|
||||||
v.Status = model.OrderStatusFinished
|
|
||||||
} else {
|
|
||||||
if cancelCount == len(goodsList2) {
|
|
||||||
v.Status = model.OrderStatusCanceled
|
v.Status = model.OrderStatusCanceled
|
||||||
}
|
}
|
||||||
|
dao.UpdateEntity(db, v, "Status")
|
||||||
|
dao.Commit(db)
|
||||||
|
changeOrderStatus(v.VendorOrderID, v.Status, "")
|
||||||
}
|
}
|
||||||
if v.Status < model.OrderStatusDelivering {
|
|
||||||
v.Status = model.OrderStatusCanceled
|
|
||||||
}
|
|
||||||
dao.UpdateEntity(db, v, "Status")
|
|
||||||
dao.Commit(db)
|
|
||||||
changeOrderStatus(v.VendorOrderID, v.Status, "")
|
|
||||||
} else {
|
} else {
|
||||||
queryOrderStatus, _ := api.JdEclpAPI.QueryOrderStatus(v.EclpOutID)
|
queryOrderStatus, _ := api.JdEclpAPI.QueryOrderStatus(v.EclpOutID)
|
||||||
getTrackMessagePlusByOrderResult, _ := api.JdEclpAPI.GetTrackMessagePlusByOrder(v.VendorOrderID)
|
getTrackMessagePlusByOrderResult, _ := api.JdEclpAPI.GetTrackMessagePlusByOrder(v.VendorOrderID)
|
||||||
|
|||||||
Reference in New Issue
Block a user