From e804a54e5d81e7d493908b8a8b5228d6d67113d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 11:08:55 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BA=AC=E8=A5=BF?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=8F=91=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E9=85=8D=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/scheduler/defsch/defsch.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index 1a3df3005..dbe6d9e5a 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -717,9 +717,10 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf if savedOrderInfo.retryCount <= maxWaybillRetryCount { savedOrderInfo.isNeedCreate3rdWaybill = true excludeVendorIDs := savedOrderInfo.GetWaybillVendorIDs() - if order.VendorID == model.VendorIDJX { - excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS) - } + //TODO 取消京西不自动发美团 2020-06-02 + // if order.VendorID == model.VendorIDJX { + // excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS) + // } if _, err = s.CreateWaybillOnProviders4SavedOrder(jxcontext.AdminCtx, savedOrderInfo, nil, excludeVendorIDs, false, maxDeliveryFee); err == nil { savedOrderInfo.retryCount++ } From a76b9a0795b1da2fad404bb5da8f6372c6c8c49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 11:35:05 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jd/order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index 4185d3501..93dbfad9a 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -73,7 +73,7 @@ func (c *PurchaseHandler) updateOrderFinancialInfo(a *jdapi.API, orderID string) if err == nil { if orderSettlement != nil { updateOrderBySettleMent(order, orderSettlement) - globals.SugarLogger.Debugf("updateOrderBySettleMent", order.NewEarningPrice) + globals.SugarLogger.Debugf("updateOrderBySettleMent: %v", order.NewEarningPrice) err = partner.CurOrderManager.UpdateOrderFields(order, []string{ /*"WaybillTipMoney", */ "TotalShopMoney", "PmSubsidyMoney", "NewEarningPrice"}) } } From eecde679758816759f6a6f41813f09350a3f5b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 11:35:20 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jd/order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/jd/order.go b/business/partner/purchase/jd/order.go index 93dbfad9a..273479a04 100644 --- a/business/partner/purchase/jd/order.go +++ b/business/partner/purchase/jd/order.go @@ -73,7 +73,7 @@ func (c *PurchaseHandler) updateOrderFinancialInfo(a *jdapi.API, orderID string) if err == nil { if orderSettlement != nil { updateOrderBySettleMent(order, orderSettlement) - globals.SugarLogger.Debugf("updateOrderBySettleMent: %v", order.NewEarningPrice) + globals.SugarLogger.Debugf("updateOrderBySettleMent: %v , %v", order.NewEarningPrice, order.TotalShopMoney) err = partner.CurOrderManager.UpdateOrderFields(order, []string{ /*"WaybillTipMoney", */ "TotalShopMoney", "PmSubsidyMoney", "NewEarningPrice"}) } } From 249353f0cce7b76082f2489ed66686f5313d675a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 11:41:57 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=BA=97=E5=86=85=E5=88=86=E7=B1=BB=E5=88=9B=E5=BB=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index dd87cb8e7..5ac62d7fc 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -309,6 +309,9 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in if status == -1 { return fmt.Errorf("京东商城店内分类创建失败!") } + if err != nil { + return err + } time.Sleep(time.Second * 2) // flag := false // for { @@ -323,6 +326,9 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in break } } + if storeCat.VendorCatID == "" { + return fmt.Errorf("京东商城店内分类创建可能失败了!storeID: %v", storeID) + } // if flag { // break // } From bea20643c2266cd5a02684571e5ac5530ef33d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 14:00:05 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=95=86=E5=93=81=E9=80=8F=E5=9B=BE=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index 5ac62d7fc..4df250a4e 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -76,20 +76,15 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v if img != "" { suffix := img[strings.LastIndex(img, "."):] if suffix != ".png" { - if resBinary, _, err := jxutils.DownloadFileByURL(img + model.SkuNameImgToPng); err == nil { - downloadURL, err2 := jxutils.UploadExportContent(resBinary, utils.Int64ToStr(time.Now().Unix())) - err = err2 - imageURL, err = uploadImg(downloadURL, name, "tou") + if resBinary, _, _ := jxutils.DownloadFileByURL(img + model.SkuNameImgToPng); err == nil { + downloadURL, _ := jxutils.UploadExportContent(resBinary, utils.Int64ToStr(time.Now().Unix())) + imageURL, _ = uploadImg(downloadURL, name, "tou") } } else { - imageURL, err = uploadImg(img, name, "tou") + imageURL, _ = uploadImg(img, name, "tou") } } - err2 := api.JdShopAPI.TransparentImageAdd(createSkuResult.WareID, imageURL) - if err2 != nil { - failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDJDShop], "创建商品") - return failedList, err - } + api.JdShopAPI.TransparentImageAdd(createSkuResult.WareID, imageURL) } var paramAttrs = make(map[string]*jdshopapi.CreateSkuParamSkus) var resultAttrs = make(map[string]int64) From 9b77c7df9efc4b8232fada437755a6d1141b15b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 14:08:38 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=89=9B=E8=82=89=E5=88=86=E7=B1=BB=E5=88=9B=E5=BB=BA=E5=95=86?= =?UTF-8?q?=E5=93=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index 4df250a4e..e9f6e1c74 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -481,6 +481,10 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j createSkuParamWare.PromiseID = jdshopapi.JdsPromiseID } + if storeSku.VendorVendorCatID == jdshopapi.JdsBeefCatID { + createSkuParamWare.MultiCategoryID = jdshopapi.JdsBeefLastCatID + } + //上传京东图片 //规则,有两张就传两张,没有就重复传一张 pic1, err := uploadImg(storeSku.Img, name, "1") From 4ff1bac2e7340a1c7dfedc96cacb9cdd7608e051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 14:24:32 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=89=9B=E8=82=89=E5=88=86=E7=B1=BB=E7=83=AD=E5=8D=96=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index e9f6e1c74..221377bb8 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -532,6 +532,7 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j gcjkValueID int64 //国产,进口的id lbValueID int64 //类别的ID bcztValueID int64 //保存状态ID + rmsjValueID int64 //热卖时间ID attrsProp []*jdshopapi.CreateSkuParamAttrs ) attrs, err := api.JdShopAPI.FindAttrs(int(storeSku.VendorVendorCatID)) @@ -550,6 +551,8 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j attrIDs[v.Name] = v.ID } else if v.Name == "保存状态" { attrIDs[v.Name] = v.ID + } else if v.Name == "热卖时间" { + attrIDs[v.Name] = v.ID } } values, _, err := api.JdShopAPI.FindValuesByAttrId(attrIDs["贮存条件"]) @@ -586,6 +589,20 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j } attrsProp = append(attrsProp, attrbczt) } + if attrIDs["热卖时间"] != 0 { + values2, _, err2 := api.JdShopAPI.FindValuesByAttrId(attrIDs["热卖时间"]) + err = err2 + for _, v := range values2 { + if v.Name == "6月" { + rmsjValueID = v.ID + } + } + attrrmsj := &jdshopapi.CreateSkuParamAttrs{ + AttrID: utils.Int2Str(attrIDs["热卖时间"]), + AttrValues: []string{utils.Int64ToStr(rmsjValueID)}, + } + attrsProp = append(attrsProp, attrrmsj) + } attrZctj := &jdshopapi.CreateSkuParamAttrs{ AttrID: utils.Int2Str(attrIDs["贮存条件"]), AttrValues: []string{utils.Int64ToStr(zctjValueID)}, From 5a60d813eef5b6953fcf9b09dbc3b4e64540c4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 2 Jun 2020 14:33:04 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E7=89=9B=E8=82=89=E5=88=86=E7=B1=BB=E7=83=AD=E5=8D=96=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jdshop/store_sku.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/jdshop/store_sku.go b/business/partner/purchase/jdshop/store_sku.go index 221377bb8..415e99382 100644 --- a/business/partner/purchase/jdshop/store_sku.go +++ b/business/partner/purchase/jdshop/store_sku.go @@ -593,7 +593,7 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j values2, _, err2 := api.JdShopAPI.FindValuesByAttrId(attrIDs["热卖时间"]) err = err2 for _, v := range values2 { - if v.Name == "6月" { + if v.Name == "12月" { rmsjValueID = v.ID } } @@ -603,6 +603,21 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j } attrsProp = append(attrsProp, attrrmsj) } + if storeSku.VendorVendorCatID == jdshopapi.JdsBeefCatID { + var exValueID int64 + values2, _, err2 := api.JdShopAPI.FindValuesByAttrId(150390) + err = err2 + for _, v := range values2 { + if v.Name == "其他" { + exValueID = v.ID + } + } + attrex := &jdshopapi.CreateSkuParamAttrs{ + AttrID: utils.Int2Str(150390), + AttrValues: []string{utils.Int64ToStr(exValueID)}, + } + attrsProp = append(attrsProp, attrex) + } attrZctj := &jdshopapi.CreateSkuParamAttrs{ AttrID: utils.Int2Str(attrIDs["贮存条件"]), AttrValues: []string{utils.Int64ToStr(zctjValueID)},