From c4eecaffefd6cd9ff66991068131a1d20ce9a9ea Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Mon, 7 Jun 2021 14:31:43 +0800 Subject: [PATCH] aa --- business/jxcallback/orderman/order.go | 8 +++---- business/jxstore/cms/sync_store_sku.go | 20 ++++++++--------- business/jxstore/tempop/tempop.go | 31 -------------------------- 3 files changed, 14 insertions(+), 45 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index e6bbd7a1a..a1210a991 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -227,7 +227,7 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m } else if orderStatus.Status == model.OrderStatusCanceled { //如果取消订单则要把库存加回去 if order, err2 := c.LoadOrder(orderStatus.VendorOrderID, orderStatus.VendorID); err2 == nil { - ModifyOrderSkusStock(db, order, true) + //ModifyOrderSkusStock(db, order, true) //门店发单的订单,取消后要退回配送费 resetCreateWaybillFee(db, order) } @@ -357,9 +357,9 @@ func (c *OrderManager) SaveOrder(order *model.GoodsOrder, isAdjust bool, db *dao //globals.SugarLogger.Warnf("saveOrder create order:%v, error:%v", order, err) } //修改商品库存 - if err == nil { - err = ModifyOrderSkusStock(db, order, false) - } + //if err == nil { + // err = ModifyOrderSkusStock(db, order, false) + //} if err == nil { dao.Commit(db, txDB) } diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index f2f753db9..0dfbbf1fb 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -264,9 +264,9 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk Stock: inSku.Stock, VendorOrgCode: inSku.VendorOrgCode, } - // if !isStoreSkuSyncNeedDelete(inSku) { - // outSku.Stock = model.MaxStoreSkuStockQty - // } + if !isStoreSkuSyncNeedDelete(inSku) { + outSku.Stock = model.MaxStoreSkuStockQty + } return outSku } @@ -561,7 +561,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag } if sku.MergedStatus == model.SkuStatusNormal { onlineList = append(onlineList, bareSku) - // stockList = append(stockList, bareSku) + stockList = append(stockList, bareSku) } else { offlineList = append(offlineList, bareSku) // 因为京东平台以是否有库存表示是否关注,所以不论是否可售,都要设置库存 @@ -570,12 +570,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag // } } } - if model.IsSyncStatusStock(sku.SkuSyncStatus) { - if bareSku == nil { - bareSku = storeSkuSyncInfo2Bare(sku) - } - stockList = append(stockList, bareSku) - } + //if model.IsSyncStatusStock(sku.SkuSyncStatus) { + // if bareSku == nil { + // bareSku = storeSkuSyncInfo2Bare(sku) + // } + // stockList = append(stockList, bareSku) + //} } isNeedReorder = model.IsSyncStatusSeq(sku.SkuSyncStatus) } diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 6f529e275..874235764 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "git.rosy.net.cn/baseapi/platformapi/mtpsapi" "regexp" "strings" "time" @@ -1924,36 +1923,6 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // dao.UpdateEntity(db, v, "ConsigneeMobile2") // } //} - var ( - db = dao.GetDB() - ) - courierStoreList, _ := dao.GetStoreCourierList(db, nil, []int{model.VendorIDMTPS}, model.StoreStatusAll, model.StoreAuditStatusAll) - task := tasksch.NewParallelTask("uuuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, - func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { - courierStore := batchItemList[0].(*model.StoreCourierMap) - storeDetail, _ := dao.GetStoreDetail(db, courierStore.StoreID, model.VendorIDJX, "") - result, _ := api.MtpsAPI.GetStoreInfoByID(utils.Str2Int(courierStore.VendorStoreID)) - name := fmt.Sprintf("%s-%s-%s", globals.StoreName, storeDetail.CityName, storeDetail.Name) - if result != nil { - if result.PoiName != name { - shopInfo := &mtpsapi.ShopInfo{ - ShopID: utils.Int2Str(storeDetail.ID), - ShopName: name, - } - api.MtpsAPI.ShopUpdate(shopInfo) - } - if result.OpenType != courierStore.VendorStatus { - courierStore.VendorStatus = result.OpenType - dao.UpdateEntity(db, courierStore, "VendorStatus") - } - } else { - courierStore.VendorStatus = 0 - dao.UpdateEntity(db, courierStore, "VendorStatus") - } - return retVal, err - }, courierStoreList) - tasksch.HandleTask(task, nil, true).Run() - task.GetID() return err }