京东商城取订单

This commit is contained in:
苏尹岚
2020-06-02 17:16:40 +08:00
parent c7a6fdc083
commit 73139f2860
14 changed files with 121 additions and 104 deletions

View File

@@ -426,7 +426,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
}
@@ -1194,7 +1194,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 {
@@ -1806,7 +1806,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
}
@@ -1924,7 +1924,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.StoreIsSyncYes, "")
storeMapList, err := dao.GetStoresMapList(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "")
if err != nil {
return nil, err
}
@@ -1971,7 +1971,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
}
@@ -2482,9 +2482,8 @@ func SyncStoresQualify(ctx *jxcontext.Context, storeIDs []int, isAsync, isContin
return hint, err
}
func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDistance bool) (storeList []*Store4User, err error) {
func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius int, needWalkDistance bool) (storeList []*Store4User, err error) {
const (
maxRadius = 20000
maxStoreCount4User = 5
)
@@ -2583,7 +2582,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 {
@@ -2849,7 +2848,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() {
@@ -3036,7 +3035,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 {
@@ -3121,7 +3120,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")