This commit is contained in:
邹宗楠
2025-07-30 15:04:25 +08:00
parent 5b512fcada
commit e0b9a18696
3 changed files with 4 additions and 24 deletions

View File

@@ -98,18 +98,12 @@ func (p *PurchaseHandler) IsErrSkuNotExist(err error) (isNotExist bool) {
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
failedList, err = p.createOrUpdateStoreSkus(ctx, storeID, vendorStoreID, storeSkuList, false)
if storeID == 669044 {
globals.SugarLogger.Debugf("------storeSkuList- UpdateStoreSkus := %s", utils.Format4Output(storeSkuList, false))
}
return failedList, err
}
// CreateStoreSkus 门店创建商品
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
failedList, err = p.createOrUpdateStoreSkus(ctx, storeID, vendorStoreID, storeSkuList, true)
if storeID == 669044 {
globals.SugarLogger.Debugf("------storeSkuList- UpdateStoreSkus := %s", utils.Format4Output(storeSkuList, false))
}
return failedList, err
}

View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response"
"git.rosy.net.cn/jx-callback/globals"
beego "github.com/astaxie/beego/server/web"
"strings"
"time"
@@ -131,10 +130,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
db := dao.GetDB()
storeDetail, _ := dao.GetStoreDetail(db, storeID, model.VendorIDDD, "")
api := getAPI(storeDetail.VendorOrgCode, storeID, vendorStoreID)
if storeID == 669044 {
globals.SugarLogger.Debugf("-----storeSkuList %s", utils.Format4Output(storeSkuList, false))
globals.SugarLogger.Debugf("-----isCreate %s", utils.Format4Output(isCreate, false))
}
if isCreate {
syncType = "创建商品"
for _, storeSku := range storeSkuList { // 创建商品
@@ -262,10 +257,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
case model.ThingTypeSyncSuccess:
// 主商品存在,直接同步子商品
childrenProductId, sonSkuId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID))
if storeID == 669044 {
globals.SugarLogger.Debugf("---childrenProductId- :%d", childrenProductId)
globals.SugarLogger.Debugf("---childrenProductId- :%s", sonSkuId)
}
if err != nil && strings.Contains(err.Error(), "2010004") { // 2010004:主商品非在线审核通过状态,不允许绑定子商品
// 线上本地都存在,但是线上审核不成功,就去更新主商品
mainOrderDetail = loadMainProductId(api, storeSku, localThing[0].VendorThingID)
@@ -456,15 +447,14 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
//param.FreightId, _ = api.GetStoreBindTemp(utils.Str2Int64(vendorStoreID))
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, mainIdInt, storeSku)
err = api.EditStoreCommodity(param)
globals.SugarLogger.Debugf("-------2err := %v", err)
if err != nil && !strings.Contains(err.Error(), "您上传的商品主图存在重复") {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
//storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
} else {
} /* else {
// todo 暂时关闭之后解开
skuId, _ := upDateChildrenPriceStockLaunch(api, storeSku, utils.Str2Int64(storeSku.VendorSkuID), vendorStoreID, syncType)
storeSku.VendorSonSkuID = utils.Int64ToStr(skuId) // 品库修改 售卖状态待同步 价格待同步
}
}*/
//storeSku.SkuSyncStatus = model.SyncFlagStoreSkuModifiedMask // 品库修改 售卖状态待同步 价格待同步
storeSku.SkuSyncStatus = 0 // 品库修改 售卖状态待同步 价格待同步
}
@@ -691,10 +681,6 @@ func checkNameLenght(name string) string {
}
func upDateChildrenPriceStockLaunch(api *tiktokShop.API, storeSku *dao.StoreSkuSyncInfo, childrenProductId int64, vendorStoreID, syncType string) (skuID int64, failedList []*partner.StoreSkuInfoWithErr) {
skuId, failed := getProductSkuID(api, storeSku, syncType, childrenProductId)
if storeSku.StoreID == 669044 {
globals.SugarLogger.Debugf("-------skuid := %d", skuId)
globals.SugarLogger.Debugf("-------storeSku := %s", utils.Format4Output(storeSku, false))
}
if skuId == 0 || len(failed) > 0 {
return 0, failed
}

View File

@@ -997,8 +997,8 @@ func (c *LaKaLaController) QueryAuthentication() {
// @Description 开户状态查询
// @Param token header string true "认证token"
// @Param tradeMode query string true "支付类型交易钱包类型[ALIPAYWECHAT]"
// @Param subMerchantId query string true "子商户号 "
// @Param merchantNo query string true "商户号 "
// @Param subMerchantId query string true "子商户号"
// @Param merchantNo query string true "商户号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /AccountStatusQuery [get]