This commit is contained in:
苏尹岚
2020-12-01 17:22:03 +08:00
parent 43186f5b12
commit 303a638aca
14 changed files with 41 additions and 37 deletions

View File

@@ -414,7 +414,7 @@ func getStoresSql(ctx *jxcontext.Context, keyword string, params map[string]inte
}
func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresInfo, storeIDs []int, briefLevel int) (err error) {
storeMapList, err := dao.GetStoresMapList(db, nil, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMapList, err := dao.GetStoresMapList(db, nil, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if err != nil {
return err
}
@@ -1200,7 +1200,7 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
}
}
}
storeMapList, err := dao.GetStoresMapList2(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", true)
storeMapList, err := dao.GetStoresMapList2(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "", true)
if len(storeMapList) > 0 {
_, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName)
} else {
@@ -1850,7 +1850,7 @@ type EbaiStoreHealthy struct {
func ExportShopsHealthInfo(ctx *jxcontext.Context, vendorIDs, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
db := dao.GetDB()
vendorID := model.VendorIDEBAI
storeMapList, err := dao.GetStoresMapList(db, []int{vendorID}, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "")
storeMapList, err := dao.GetStoresMapList(db, []int{vendorID}, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "", "")
if err != nil {
return "", err
}
@@ -1968,7 +1968,7 @@ func GetCorporationInfo(ctx *jxcontext.Context, licenceCode string) (corporation
func GetStoresVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs, storeIDs []int) (vendorStoreSnapshotList []*model.VendorStoreSnapshot, err error) {
db := dao.GetDB()
storeMapList, err := dao.GetStoresMapList(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMapList, err := dao.GetStoresMapList(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if err != nil {
return nil, err
}
@@ -2015,7 +2015,7 @@ func getCurrentSnapshotAt(now time.Time) (snapshotAt time.Time) {
}
func updateVendorStoreStatusBySnapshot(db *dao.DaoDB, curSnapshotList []*model.VendorStoreSnapshot) (err error) {
storeMapList, err := dao.GetStoresMapList(db, nil, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMapList, err := dao.GetStoresMapList(db, nil, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if err != nil {
return err
}
@@ -2535,7 +2535,7 @@ func JdStoreInfoCoordinateRecover(ctx *jxcontext.Context, vendorOrgCode string,
defer file1.Close()
db := dao.GetDB()
storeList, err := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "")
storeList, err := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "", "")
if err == nil {
var validStoreList []*dao.StoreDetail
for _, v := range storeList {
@@ -2801,7 +2801,7 @@ func CreateStorePriceScore(ctx *jxcontext.Context) (err error) {
func RefreshJdLevel(ctx *jxcontext.Context) (err error) {
db := dao.GetDB()
storeMapList, err := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusOpened, -1, "", "")
storeMapList, err := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusOpened, -1, "", "", "")
if len(storeMapList) > 0 {
dao.Begin(db)
defer func() {
@@ -2988,7 +2988,7 @@ func checkYbParams(db *dao.DaoDB, storeMap *model.StoreMap, storeID int) (err er
}
}
}
storeMaps, err := dao.GetStoresMapList2(db, []int{model.VendorIDYB}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", false)
storeMaps, err := dao.GetStoresMapList2(db, []int{model.VendorIDYB}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "", false)
if len(storeMaps) > 0 {
for _, v := range storeMaps {
if v.YbAppID == appID {
@@ -3349,7 +3349,7 @@ func DisabledStoreWithoutVendor(ctx *jxcontext.Context, isContinueWhenError, isA
task := tasksch.NewParallelTask("DisabledStoreWithoutVendor", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
store := batchItemList[0].(*model.Store)
storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDYB, model.VendorIDJD, model.VendorIDJX, model.VendorIDEBAI, model.VendorIDMTWM}, []int{store.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDYB, model.VendorIDJD, model.VendorIDJX, model.VendorIDEBAI, model.VendorIDMTWM}, []int{store.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if len(storeMaps) == 0 {
store.Status = model.StoreStatusDisabled
dao.UpdateEntity(db, store, "Status")
@@ -3451,7 +3451,7 @@ func UpdateStorePricePack(ctx *jxcontext.Context, storeID, vendorID int, pricePa
dao.Rollback(db)
return err
}
storeMapList, err := dao.GetStoresMapList(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMapList, err := dao.GetStoresMapList(db, []int{vendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
if err != nil {
dao.Rollback(db)
return err
@@ -3462,7 +3462,7 @@ func UpdateStorePricePack(ctx *jxcontext.Context, storeID, vendorID int, pricePa
}
}
dao.Commit(db)
storeMapList, err := dao.GetStoresMapList(db, nil, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, pricePack, "")
storeMapList, err := dao.GetStoresMapList(db, nil, nil, nil, model.StoreStatusAll, model.StoreIsSyncYes, pricePack, "", "")
if err != nil {
dao.Rollback(db)
return err
@@ -3500,7 +3500,7 @@ func GetJdDeliveryArea(ctx *jxcontext.Context, storeIDs []int) (err error) {
specialtyStoreSkus []*SpecialtyStoreSkus
downloadURL, fileName string
)
storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJD}, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJD}, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
for _, v := range storeMaps {
time.Sleep(time.Second / 3)
station, err := jd.GetAPI("320406").GetDeliveryRangeByStationNo2(v.VendorStoreID)