diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 5633091d7..63994b51d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -4702,11 +4702,13 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o order.VendorStoreID = storeMaps[0].VendorStoreID } } else { - // storeList, err := GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false) - // if err != nil { - // globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error()) - // continue - // } + storeList, err := GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false) + if err != nil { + globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error()) + continue + } + order.StoreID = storeList[0].ID + order.StoreName = storeList[0].Name } //如果是暂停,表示是预订单 if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusPause { diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 8f0c88389..76473e3bb 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1618,7 +1618,7 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { return err } -func RefreshJXPriceChange(ctx *jxcontext.Context) (hint string, err error) { +func RefreshJXPriceChange(ctx *jxcontext.Context, storeID int) (hint string, err error) { db := dao.GetDB() var ( stores []*model.Store @@ -1630,9 +1630,12 @@ func RefreshJXPriceChange(ctx *jxcontext.Context) (hint string, err error) { SELECT * FROM store WHERE deleted_at = ? AND status <> ? - AND id in (?,?,?) ` - sqlParams := []interface{}{utils.DefaultTimeValue, model.StoreStatusDisabled, 100118, 100205, 100274} + sqlParams := []interface{}{utils.DefaultTimeValue, model.StoreStatusDisabled} + if storeID != 0 { + sql += " AND id = ?" + sqlParams = append(sqlParams, storeID) + } err = dao.GetRows(db, &stores, sql, sqlParams) task := tasksch.NewParallelTask("刷新门店价格", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { @@ -1672,6 +1675,8 @@ func RefreshJXPriceChange(ctx *jxcontext.Context) (hint string, err error) { skuBindInfos = append(skuBindInfos, skuBindInfo) } cms.UpdateStoresSkusByBind(ctx, task, skuBindInfos, isAsync, isContinueWhenError, false) + store.PayPercentage = 100 + dao.UpdateEntity(db, store, "PayPercentage") return retVal, err }, stores) tasksch.HandleTask(task, nil, true).Run() diff --git a/controllers/temp_op.go b/controllers/temp_op.go index 90b7f1791..21dc1f573 100644 --- a/controllers/temp_op.go +++ b/controllers/temp_op.go @@ -385,12 +385,13 @@ func (c *TempOpController) UploadJdsImage() { // @Title 京西刷新调价包和门店价格 // @Description 京西刷新调价包和门店价格 // @Param token header string true "认证token" +// @Param storeID formData int false "门店ID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /RefreshJXPriceChange [post] func (c *TempOpController) RefreshJXPriceChange() { c.callRefreshJXPriceChange(func(params *tTempopRefreshJXPriceChangeParams) (retVal interface{}, errCode string, err error) { - retVal, err = tempop.RefreshJXPriceChange(params.Ctx) + retVal, err = tempop.RefreshJXPriceChange(params.Ctx, params.StoreID) return retVal, "", err }) }