1
This commit is contained in:
@@ -104,6 +104,7 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
|
||||
InvoiceTaxerID: "",
|
||||
InvoiceEmail: "",
|
||||
VendorOrgCode: vendorOrgCode,
|
||||
TotalShopMoney: utils.Float64TwoInt64(float64(result.PayAmount) * 0.95), // 抖音平台扣点金额0.05
|
||||
}
|
||||
// 本地获取订单记录
|
||||
orderSeq, _ := dao.GetVendorOrderNumber(dao.GetDB(), model.VendorIDDD, order.VendorStoreID)
|
||||
|
||||
@@ -3,13 +3,10 @@ package tiktok_store
|
||||
import (
|
||||
"fmt"
|
||||
tiktokShop "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -140,17 +137,19 @@ func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.G
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetOrderAfsInfo(ctx *jxcontext.Context, vendorOrderID, afsOrderID string) (orderAfsInfo *partner.OrderAfsInfo, err error) {
|
||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDDD)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list, err := getAPI(order.VendorOrgCode, 0, "").QueryAfsOrderDetail(afsOrderID, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
orderAfsInfo = &partner.OrderAfsInfo{}
|
||||
var afsTotalShopMoney int64
|
||||
if list, err := api.MtwmAPI.GetOrderRefundDetail(utils.Str2Int64(vendorOrderID), 0); err == nil {
|
||||
for _, v := range list {
|
||||
if v.RefundPartialEstimateCharge.SettleAmount != "" {
|
||||
afsTotalShopMoney += jxutils.StandardPrice2Int(utils.Str2Float64(v.RefundPartialEstimateCharge.SettleAmount))
|
||||
}
|
||||
}
|
||||
}
|
||||
if order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDMTWM); err == nil {
|
||||
orderAfsInfo.AfsTotalShopMoney = order.TotalShopMoney + afsTotalShopMoney
|
||||
}
|
||||
orderAfsInfo.VendorOrderID = order.VendorOrderID
|
||||
orderAfsInfo.AfsOrderID = afsOrderID
|
||||
orderAfsInfo.AfsTotalShopMoney = order.TotalShopMoney - list.Data.ProcessInfo.AfterSaleInfo.RealRefundAmount
|
||||
return orderAfsInfo, err
|
||||
}
|
||||
|
||||
@@ -191,7 +191,6 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debug("CreateStore2 return storeIDs, storeDetail.Store.ID==========", storeIDs, storeDetail.Store.ID)
|
||||
FreightTemplate.StoreID = storeDetail.Store.ID
|
||||
FreightTemplate.VendorStoreID = storeIDs
|
||||
FreightTemplate.DeletedAt = utils.DefaultTimeValue
|
||||
@@ -261,8 +260,6 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
}
|
||||
//修改店铺状态
|
||||
if storeInfo.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
||||
globals.SugarLogger.Debug("================1", 1)
|
||||
globals.SugarLogger.Debug("================mergedStoreStatus", mergedStoreStatus)
|
||||
errList.AddErr(P.UpdateStoreStatus(jxcontext.AdminCtx, storeInfo.VendorOrgCode, storeID, storeInfo.VendorStoreID, mergedStoreStatus))
|
||||
}
|
||||
_, err3 := api.EditStore(params)
|
||||
|
||||
@@ -249,8 +249,6 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
// p.createOrUpdateStoreSkus(ctx, storeID, vendorStoreID, duplicateStoreSkuList(storeSkuList, i+1), true)
|
||||
// }
|
||||
//}
|
||||
globals.SugarLogger.Debugf("============CreateStoreSkus===============%s", utils.Format4Output(failedList, false))
|
||||
globals.SugarLogger.Debugf("============CreateStoreSkus===============%s", err)
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
@@ -317,13 +315,10 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, 0, storeSku)
|
||||
// ProductFormatNew 获取商品属性
|
||||
productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
||||
globals.SugarLogger.Debug("创建=============productFormatNew", productFormatNew)
|
||||
globals.SugarLogger.Debug("创建=============productFormatNew err", err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param.ProductFormatNew = productFormatNew
|
||||
globals.SugarLogger.Debug("创建=============param", utils.Format4Output(param, false))
|
||||
|
||||
// 获取品牌
|
||||
param.StandardBrandId, err = api.GetSkuBrand(param.CategoryLeafId)
|
||||
@@ -428,13 +423,10 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, utils.Str2Int64(storeSku.VendorSkuID), storeSku)
|
||||
// ProductFormatNew 获取商品属性
|
||||
productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
||||
globals.SugarLogger.Debug("更新=============productFormatNew", productFormatNew)
|
||||
globals.SugarLogger.Debug("更新=============productFormatNew err", err)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param.ProductFormatNew = productFormatNew
|
||||
globals.SugarLogger.Debug("更新=============param", utils.Format4Output(param, false))
|
||||
|
||||
// 获取品牌
|
||||
//brandID, err := api.GetSkuBrand(param.CategoryLeafId)
|
||||
@@ -485,7 +477,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
func CreateSaleTemp(storeId int64, api *tiktokShop.API) (int64, error) {
|
||||
// 获取限售模板
|
||||
saleLimitId, _ := api.StoreQuerySaleLimitTemp(storeId)
|
||||
globals.SugarLogger.Debug("==========saleLimitId1", saleLimitId)
|
||||
if saleLimitId != 0 {
|
||||
return saleLimitId, nil
|
||||
}
|
||||
@@ -510,8 +501,6 @@ func CreateSaleTemp(storeId int64, api *tiktokShop.API) (int64, error) {
|
||||
}
|
||||
tradeLimitRuleRequestList = append(tradeLimitRuleRequestList, tradeLimitRuleRequest)
|
||||
result, err := api.CreateTradeLimitTemplate(param)
|
||||
globals.SugarLogger.Debug("==========err2222", err)
|
||||
globals.SugarLogger.Debug("==========result222", utils.Format4Output(result, false))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"math/rand"
|
||||
"strings"
|
||||
)
|
||||
@@ -55,7 +54,6 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao
|
||||
// GetProductFormatNew 获取物品属性
|
||||
func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (string, error) {
|
||||
category, err := getAPI(vendorOrgCode, 0, "").GetCatePropertyV2(categoryLeftId)
|
||||
globals.SugarLogger.Debug("========productFormatNewDATA==============", utils.Format4Output(category, false))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -84,7 +82,6 @@ func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (string, er
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
globals.SugarLogger.Debug("========productFormatNew==============", string(productFormatNew))
|
||||
return string(productFormatNew), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user