- RefreshMissingDadaStores
- auto acreate dada store when link jd store
This commit is contained in:
@@ -219,7 +219,7 @@ func (p *PurchaseHandler) arrangeSaleStore(order *model.GoodsOrder, cityName, pr
|
||||
userLng := jxutils.IntCoordinate2Standard(order.ConsigneeLng)
|
||||
userLat := jxutils.IntCoordinate2Standard(order.ConsigneeLat)
|
||||
for k, store := range storeList {
|
||||
// 展示门店自身不参与排单
|
||||
// 展示门店自身不参与派单
|
||||
if store.VendorStoreID != order.VendorStoreID {
|
||||
sortItem := &utils.SortItem{
|
||||
CompareValue: int64(jxutils.EarthDistance(userLng, userLat, jxutils.IntCoordinate2Standard(store.Lng), jxutils.IntCoordinate2Standard(store.Lat)) * 1000),
|
||||
|
||||
@@ -254,7 +254,29 @@ func (p *PurchaseHandler) RefreshStoresAllSkusID(ctx *jxcontext.Context, parentT
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) FullSyncStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
return hint, err
|
||||
userName := ctx.GetUserName()
|
||||
globals.SugarLogger.Debugf("wsc FullSyncStoreSkus storeID:%d, isContinueWhenError:%t, userName:%s", storeID, isContinueWhenError, userName)
|
||||
|
||||
db := dao.GetDB()
|
||||
rootTask := tasksch.NewSeqTask("微盟微商城FullSyncStoreSkus", userName, func(rootTask *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
switch step {
|
||||
case 0:
|
||||
case 1:
|
||||
_, err = dao.SetStoreSkuSyncStatus(db, model.VendorIDWSC, storeID, nil, model.SyncFlagNewMask)
|
||||
case 2:
|
||||
_, err = p.SyncLocalStoreCategory(ctx, db, storeID, false)
|
||||
case 3:
|
||||
_, err = p.SyncStoreCategory(ctx, rootTask, storeID, false)
|
||||
case 4:
|
||||
_, err = p.SyncStoreSkus(ctx, rootTask, storeID, nil, true, isContinueWhenError)
|
||||
}
|
||||
return nil, err
|
||||
}, 5)
|
||||
tasksch.AddChild(parentTask, rootTask).Run()
|
||||
if !isAsync {
|
||||
_, err = rootTask.GetResult(0)
|
||||
}
|
||||
return rootTask.ID, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) DeleteRemoteStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user