1
This commit is contained in:
@@ -22,7 +22,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *QRCodeAuther) VerifySecret(dummy, code string) (*auth2.AuthBindEx, error) {
|
func (a *QRCodeAuther) VerifySecret(dummy, code string) (*auth2.AuthBindEx, error) {
|
||||||
globals.SugarLogger.Debugf("dingding qrcode VerifySecret code:%s", code)
|
|
||||||
userQRInfo, err := api.DingDingQRCodeAPI.GetUserInfoByCode(code)
|
userQRInfo, err := api.DingDingQRCodeAPI.GetUserInfoByCode(code)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -23,7 +22,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *StaffAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *StaffAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
globals.SugarLogger.Debugf("dingding staff VerifySecret code:%s", code)
|
|
||||||
|
|
||||||
userID, err := api.DingDingAPI.GetUserID(code)
|
userID, err := api.DingDingAPI.GetUserID(code)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ func (a *Auther) SendVerifyCode(mobileNumber string) (verifyCode string, err err
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auther) VerifySecret(mobileNumber, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *Auther) VerifySecret(mobileNumber, code string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
globals.SugarLogger.Debugf("VerifySecret mobileNumber:%s, code:%s", mobileNumber, code)
|
|
||||||
|
|
||||||
err = ErrVerifyCodeIsWrong
|
err = ErrVerifyCodeIsWrong
|
||||||
if (code == auth2.InternalAuthSecret ||
|
if (code == auth2.InternalAuthSecret ||
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -35,7 +34,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auther) VerifySecret(userID, passMD5 string) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *Auther) VerifySecret(userID, passMD5 string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
globals.SugarLogger.Debugf("localpass VerifySecret userID:%s", userID)
|
|
||||||
var authBind *model.AuthBind
|
var authBind *model.AuthBind
|
||||||
if authBind, err = dao.GetAuthBind(dao.GetDB(), model.AuthBindTypeAuth, AuthType, userID); err == nil {
|
if authBind, err = dao.GetAuthBind(dao.GetDB(), model.AuthBindTypeAuth, AuthType, userID); err == nil {
|
||||||
if err = a.checkPassword(authBind, passMD5); err == nil {
|
if err = a.checkPassword(authBind, passMD5); err == nil {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -57,7 +56,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
globals.SugarLogger.Debugf("weixin VerifySecret id:%s secret:%s", id, secret)
|
|
||||||
var openID, accessToken string
|
var openID, accessToken string
|
||||||
_, jsCode := SplitJsCode(secret)
|
_, jsCode := SplitJsCode(secret)
|
||||||
if a.authType != AuthTypeWXNative {
|
if a.authType != AuthTypeWXNative {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthBindEx, err error) {
|
func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthBindEx, err error) {
|
||||||
globals.SugarLogger.Debugf("weixin mini VerifySecret jsCode:%s", jsCode)
|
|
||||||
|
|
||||||
appID, jsCode := SplitJsCode(jsCode)
|
appID, jsCode := SplitJsCode(jsCode)
|
||||||
sessionInfo, err := getWxApp(appID).SNSCode2Session(jsCode)
|
sessionInfo, err := getWxApp(appID).SNSCode2Session(jsCode)
|
||||||
@@ -50,7 +49,6 @@ func (a *MiniAuther) VerifySecret(dummy, jsCode string) (authBindEx *auth2.AuthB
|
|||||||
|
|
||||||
// 特殊接口
|
// 特殊接口
|
||||||
func (a *MiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData, iv string) (decryptedDataBase64 string, err error) {
|
func (a *MiniAuther) DecryptData(authInfo *auth2.AuthInfo, jsCode, encryptedData, iv string) (decryptedDataBase64 string, err error) {
|
||||||
globals.SugarLogger.Debugf("weixin mini DecryptData jsCode:%s, encryptedData:%s, iv:%s", jsCode, encryptedData, iv)
|
|
||||||
var sessionKey string
|
var sessionKey string
|
||||||
appID, jsCode := SplitJsCode(jsCode)
|
appID, jsCode := SplitJsCode(jsCode)
|
||||||
if jsCode != "" {
|
if jsCode != "" {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package casbinauth
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
jxmodel "git.rosy.net.cn/jx-callback/business/model"
|
jxmodel "git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"github.com/astaxie/beego/client/orm"
|
"github.com/astaxie/beego/client/orm"
|
||||||
"github.com/casbin/casbin/model"
|
"github.com/casbin/casbin/model"
|
||||||
"github.com/casbin/casbin/persist"
|
"github.com/casbin/casbin/persist"
|
||||||
@@ -93,7 +92,6 @@ func (a *Adapter) clearAll(o orm.Ormer) (err error) {
|
|||||||
|
|
||||||
// SavePolicy saves policy to database.
|
// SavePolicy saves policy to database.
|
||||||
func (a *Adapter) SavePolicy(model model.Model) error {
|
func (a *Adapter) SavePolicy(model model.Model) error {
|
||||||
globals.SugarLogger.Debugf("SavePolicy")
|
|
||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
|
|
||||||
a.clearAll(o)
|
a.clearAll(o)
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import (
|
|||||||
// todo 是否需要将Store.MarketManPhone与OperatorPhone成角色?
|
// todo 是否需要将Store.MarketManPhone与OperatorPhone成角色?
|
||||||
|
|
||||||
func TransferLegacyWeixins(mobile string) (err error) {
|
func TransferLegacyWeixins(mobile string) (err error) {
|
||||||
globals.SugarLogger.Debugf("TransferLegacyWeixins mobile:%s", mobile)
|
|
||||||
if !globals.EnableWXAuth2 || globals.DisableWXAuth1 {
|
if !globals.EnableWXAuth2 || globals.DisableWXAuth1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1846,7 +1846,7 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
|||||||
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
|
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
|
||||||
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
|
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
|
||||||
if err != nil || skus == nil {
|
if err != nil || skus == nil {
|
||||||
globals.SugarLogger.Debugf("GetExianDaSku,[%v]", v.ElemeGoodsID)
|
//globals.SugarLogger.Debugf("GetExianDaSku,[%v]", v.ElemeGoodsID)
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
// sku := &model.Sku{}
|
// sku := &model.Sku{}
|
||||||
|
|||||||
@@ -738,7 +738,6 @@ func filterStoreByOrderInfo(db *dao.DaoDB, inStores []*StoreExt, orderTimeFrom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getMapCenter(storeList []*StoreExt) (lng, lat float64) {
|
func getMapCenter(storeList []*StoreExt) (lng, lat float64) {
|
||||||
globals.SugarLogger.Debugf("getMapCenter len(storeList):%d", len(storeList))
|
|
||||||
if len(storeList) == 0 {
|
if len(storeList) == 0 {
|
||||||
return 0, 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -554,12 +554,9 @@ func (v *VendorSync) SyncStoresSkus(ctx *jxcontext.Context, parentTask tasksch.I
|
|||||||
|
|
||||||
//执行比较店铺与运营商的sku差异
|
//执行比较店铺与运营商的sku差异
|
||||||
func (c *ComparePlatform) CompareStoreWithOperator(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func (c *ComparePlatform) CompareStoreWithOperator(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
globals.SugarLogger.Debug("开始执行CompareStoreWithOperator")
|
|
||||||
return hint, makeSyncError(err)
|
return hint, makeSyncError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) FullSyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func (v *VendorSync) FullSyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, syncDisabled bool, excludeSkuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
globals.SugarLogger.Debug("FullSyncStoresSkus")
|
|
||||||
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("初始化门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("初始化门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||||
@@ -588,7 +585,6 @@ func (v *VendorSync) FullSyncStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, v
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *VendorSync) DeleteRemoteStoreSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
func (v *VendorSync) DeleteRemoteStoreSkus(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
globals.SugarLogger.Debug("DeleteRemoteStoreSkus")
|
|
||||||
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("删除远程门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("删除远程门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
|
||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||||
@@ -688,7 +684,6 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I
|
|||||||
if storeMapList, err = dao.GetStoresMapList2(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "", "", mustDirty); err != nil {
|
if storeMapList, err = dao.GetStoresMapList2(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "", "", mustDirty); err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("===============len(storeMapList)", len(storeMapList))
|
|
||||||
if len(storeMapList) == 0 {
|
if len(storeMapList) == 0 {
|
||||||
return nil, "", nil
|
return nil, "", nil
|
||||||
}
|
}
|
||||||
@@ -705,13 +700,10 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I
|
|||||||
}
|
}
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("===============len(storeMapList)1111111111", vendorStoreMap)
|
|
||||||
|
|
||||||
if len(loopInfoList) == 1 {
|
if len(loopInfoList) == 1 {
|
||||||
globals.SugarLogger.Debug("===============len(storeMapList)22222")
|
|
||||||
taskName = fmt.Sprintf("%s,处理平台%s", taskName, model.VendorChineseNames[loopInfoList[0].VendorID])
|
taskName = fmt.Sprintf("%s,处理平台%s", taskName, model.VendorChineseNames[loopInfoList[0].VendorID])
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("===============len(storeMapList)3333")
|
|
||||||
|
|
||||||
task = tasksch.NewParallelTask(taskName, tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, handler, loopInfoList)
|
task = tasksch.NewParallelTask(taskName, tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, handler, loopInfoList)
|
||||||
if isAsync {
|
if isAsync {
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs
|
|||||||
globals.SugarLogger.Debugf("SyncCategories vendorIDs:%v, appOrgCodes:%v, catIDs:%v", vendorIDs, appOrgCodes, catIDs)
|
globals.SugarLogger.Debugf("SyncCategories vendorIDs:%v, appOrgCodes:%v, catIDs:%v", vendorIDs, appOrgCodes, catIDs)
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
|
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
|
||||||
globals.SugarLogger.Debugf("SyncCategories catListLenght:%v", len(catList))
|
|
||||||
if err == nil && len(catList) > 0 {
|
if err == nil && len(catList) > 0 {
|
||||||
//TODO 同一平台不同账号会有影响needSyncParentIDs,暂不处理
|
//TODO 同一平台不同账号会有影响needSyncParentIDs,暂不处理
|
||||||
var needSyncParentIDs []int
|
var needSyncParentIDs []int
|
||||||
@@ -112,7 +111,6 @@ func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs
|
|||||||
switch step {
|
switch step {
|
||||||
case 0:
|
case 0:
|
||||||
catList2, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, needSyncParentIDs, true)
|
catList2, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, needSyncParentIDs, true)
|
||||||
globals.SugarLogger.Debugf("GetSkuCategoryWithVendor catList2:%v", catList2)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, err = syncCategories(ctx, db, task, catList2, false)
|
_, err = syncCategories(ctx, db, task, catList2, false)
|
||||||
}
|
}
|
||||||
@@ -228,7 +226,6 @@ func SyncSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs []int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SyncReorderCategories(ctx *jxcontext.Context, parentCatID int, isAsync bool) (hint string, err error) {
|
func SyncReorderCategories(ctx *jxcontext.Context, parentCatID int, isAsync bool) (hint string, err error) {
|
||||||
globals.SugarLogger.Debugf("SyncReorderCategories parentCatID:%d", parentCatID)
|
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
hint, err = CurVendorSync.LoopMultiStoresVendors(ctx, db, fmt.Sprintf("分类重排序:%d", parentCatID), isAsync, false,
|
hint, err = CurVendorSync.LoopMultiStoresVendors(ctx, db, fmt.Sprintf("分类重排序:%d", parentCatID), isAsync, false,
|
||||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
@@ -273,7 +270,6 @@ func SyncReorderCategories(ctx *jxcontext.Context, parentCatID int, isAsync bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SyncReorderCategories2(ctx *jxcontext.Context, parentCatID, vendorID int, vendorOrgCode string) (err error) {
|
func SyncReorderCategories2(ctx *jxcontext.Context, parentCatID, vendorID int, vendorOrgCode string) (err error) {
|
||||||
globals.SugarLogger.Debugf("SyncReorderCategories parentCatID:%d", parentCatID)
|
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
multiStoresHandler := CurVendorSync.GetMultiStoreHandler(vendorID)
|
multiStoresHandler := CurVendorSync.GetMultiStoreHandler(vendorID)
|
||||||
if multiStoresHandler != nil {
|
if multiStoresHandler != nil {
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
|||||||
rootTask := tasksch.NewSeqTask(fmt.Sprintf("%s SyncStoreCategory step1", model.VendorChineseNames[vendorID]), ctx,
|
rootTask := tasksch.NewSeqTask(fmt.Sprintf("%s SyncStoreCategory step1", model.VendorChineseNames[vendorID]), ctx,
|
||||||
func(rootTask *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
func(rootTask *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||||
level := step + 1
|
level := step + 1
|
||||||
//todo 这里好像有点问题
|
|
||||||
catList, err := dao.GetDirtyStoreCategories(db, vendorID, storeID, level, skuIDs)
|
catList, err := dao.GetDirtyStoreCategories(db, vendorID, storeID, level, skuIDs)
|
||||||
if len(catList) > 0 {
|
if len(catList) > 0 {
|
||||||
num += len(catList)
|
num += len(catList)
|
||||||
@@ -188,6 +187,7 @@ func SyncStoreSkuNew2(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFla
|
|||||||
case 0:
|
case 0:
|
||||||
if singleStoreHandler != nil {
|
if singleStoreHandler != nil {
|
||||||
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
_, err = SyncStoreCategories(ctx, task, vendorID, storeID, vendorStoreID, nameIDs, skuIDs, false, isContinueWhenError)
|
||||||
|
globals.SugarLogger.Debug("SyncStoreCategories in SyncStoreSkuNew2 err on:%v", err)
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
err = syncStoreSkuNew(ctx, task, causeFlag, false, vendorID, storeID, vendorOrgCode, nameIDs, skuIDs, excludeSkuIDs, useVendorPriceDirectly, isContinueWhenError)
|
||||||
@@ -504,7 +504,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
var bareSku *partner.StoreSkuInfo
|
var bareSku *partner.StoreSkuInfo
|
||||||
isNeedReorder := false
|
isNeedReorder := false
|
||||||
if isStoreSkuSyncNeedDelete(sku) {
|
if isStoreSkuSyncNeedDelete(sku) {
|
||||||
globals.SugarLogger.Debug("1.进入isStoreSkuSyncNeedDelete")
|
|
||||||
if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||||
bareSku = storeSkuSyncInfo2Bare(sku)
|
bareSku = storeSkuSyncInfo2Bare(sku)
|
||||||
if singleStoreHandler == nil {
|
if singleStoreHandler == nil {
|
||||||
@@ -513,16 +512,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
} else {
|
} else {
|
||||||
deleteList = append(deleteList, bareSku)
|
deleteList = append(deleteList, bareSku)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("2.stockList,deleteList==============", stockList, deleteList)
|
|
||||||
} else {
|
} else {
|
||||||
updateItems = append(updateItems, sku2Update(vendorID, sku, model.SyncFlagDeletedMask))
|
updateItems = append(updateItems, sku2Update(vendorID, sku, model.SyncFlagDeletedMask))
|
||||||
globals.SugarLogger.Debug("3.updateItems==============", updateItems)
|
|
||||||
}
|
}
|
||||||
} else if model.IsSyncStatusNew(sku.SkuSyncStatus) {
|
} else if model.IsSyncStatusNew(sku.SkuSyncStatus) {
|
||||||
globals.SugarLogger.Debug("4.进入model.IsSyncStatusNew(sku.SkuSyncStatus)")
|
|
||||||
calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))
|
calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))
|
||||||
if singleStoreHandler == nil {
|
if singleStoreHandler == nil {
|
||||||
globals.SugarLogger.Debug("5.进入singleStoreHandler == nil")
|
|
||||||
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
|
||||||
// todo 多平台商品库没有正常创建,直接跳过
|
// todo 多平台商品库没有正常创建,直接跳过
|
||||||
} else {
|
} else {
|
||||||
@@ -535,11 +530,9 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
} else {
|
} else {
|
||||||
offlineList = append(offlineList, bareSku)
|
offlineList = append(offlineList, bareSku)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("6.stockList,priceList,onlineList||offlineList ==============", stockList, priceList, onlineList, offlineList)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if sku.MergedStatus == model.SkuStatusNormal {
|
if sku.MergedStatus == model.SkuStatusNormal {
|
||||||
globals.SugarLogger.Debug("7.进入sku.MergedStatus == model.SkuStatusNormal")
|
|
||||||
if vendorID == model.VendorIDDD {
|
if vendorID == model.VendorIDDD {
|
||||||
createList = append(createList, sku)
|
createList = append(createList, sku)
|
||||||
} else if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDJDShop {
|
} else if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB && vendorID != model.VendorIDJDShop {
|
||||||
@@ -550,13 +543,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
createList = append(createList, sku)
|
createList = append(createList, sku)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("8.createList=======", createList)
|
|
||||||
}
|
}
|
||||||
isNeedReorder = true
|
isNeedReorder = true
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debug("9.进入not isStoreSkuSyncNeedDelete IsSyncStatusNew")
|
|
||||||
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) && vendorID != model.VendorIDJDShop {
|
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) && vendorID != model.VendorIDJDShop {
|
||||||
globals.SugarLogger.Debug("10.进入vendorID != model.VendorIDJDShop")
|
|
||||||
// err = fmt.Errorf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID)
|
// err = fmt.Errorf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID)
|
||||||
if vendorID != model.VendorIDJDShop || (vendorID == model.VendorIDJDShop && storeID == model.JdShopMainStoreID && sku.StoreSkuStatus != model.SkuStatusDontSale) {
|
if vendorID != model.VendorIDJDShop || (vendorID == model.VendorIDJDShop && storeID == model.JdShopMainStoreID && sku.StoreSkuStatus != model.SkuStatusDontSale) {
|
||||||
err = utils.NewErrorCode(fmt.Sprintf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID), "-1", 0)
|
err = utils.NewErrorCode(fmt.Sprintf("门店:%d,修改没有创建的商品:%d", storeID, sku.SkuID), "-1", 0)
|
||||||
@@ -567,9 +557,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
parentTask.AddBatchErr(err)
|
parentTask.AddBatchErr(err)
|
||||||
parentTask.AddFailedList(failedList)
|
parentTask.AddFailedList(failedList)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("11.failedList======", failedList)
|
|
||||||
} else {
|
} else {
|
||||||
globals.SugarLogger.Debug("12.进入vendorID == model.VendorIDJDShop")
|
|
||||||
isAdded2Update := false
|
isAdded2Update := false
|
||||||
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
||||||
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
||||||
@@ -579,15 +567,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
isAdded2Update = true
|
isAdded2Update = true
|
||||||
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("13.updateList================", updateList)
|
|
||||||
}
|
}
|
||||||
if model.IsSyncStatusPrice(sku.SkuSyncStatus) {
|
if model.IsSyncStatusPrice(sku.SkuSyncStatus) {
|
||||||
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||||
priceList = append(priceList, bareSku)
|
priceList = append(priceList, bareSku)
|
||||||
globals.SugarLogger.Debug("14. priceList=====================", priceList)
|
|
||||||
}
|
}
|
||||||
if !isAdded2Update {
|
if !isAdded2Update {
|
||||||
globals.SugarLogger.Debug("15.进入!isAdded2Update")
|
|
||||||
if model.IsSyncStatusUpdate(sku.SkuSyncStatus) && singleStoreHandler == nil { // 正常就不应该进到这里
|
if model.IsSyncStatusUpdate(sku.SkuSyncStatus) && singleStoreHandler == nil { // 正常就不应该进到这里
|
||||||
// if bareSku == nil {
|
// if bareSku == nil {
|
||||||
// bareSku = storeSkuSyncInfo2Bare(sku)
|
// bareSku = storeSkuSyncInfo2Bare(sku)
|
||||||
@@ -608,7 +593,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
// stockList = append(stockList, bareSku)
|
// stockList = append(stockList, bareSku)
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("16.onlineList,stockList,offlineList===========", onlineList, stockList, offlineList)
|
|
||||||
}
|
}
|
||||||
//if model.IsSyncStatusStock(sku.SkuSyncStatus) {
|
//if model.IsSyncStatusStock(sku.SkuSyncStatus) {
|
||||||
// if bareSku == nil {
|
// if bareSku == nil {
|
||||||
@@ -696,7 +680,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
task := tasksch.NewParallelTask("syncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError2), ctx,
|
task := tasksch.NewParallelTask("syncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError2), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
step := batchItemList[0].(int)
|
step := batchItemList[0].(int)
|
||||||
globals.SugarLogger.Debugf("17.deleteList,createList,updateList,stockList===============", deleteList, createList, updateList, stockList)
|
|
||||||
switch step {
|
switch step {
|
||||||
case 0:
|
case 0:
|
||||||
if len(deleteList) > 0 {
|
if len(deleteList) > 0 {
|
||||||
@@ -728,7 +711,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
var failedList []*partner.StoreSkuInfoWithErr
|
var failedList []*partner.StoreSkuInfoWithErr
|
||||||
if failedList, err = singleStoreHandler.CreateStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList); singleStoreHandler.IsErrSkuExist(err) {
|
if failedList, err = singleStoreHandler.CreateStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList); singleStoreHandler.IsErrSkuExist(err) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debug("30.sth wrong on singleStoreHandler.CreateStoreSkus: %v", err)
|
|
||||||
}
|
}
|
||||||
if skuNameList, err2 := singleStoreHandler.GetStoreSkusFullInfo(ctx, task, storeID, vendorStoreID, []*partner.StoreSkuInfo{
|
if skuNameList, err2 := singleStoreHandler.GetStoreSkusFullInfo(ctx, task, storeID, vendorStoreID, []*partner.StoreSkuInfo{
|
||||||
&partner.StoreSkuInfo{
|
&partner.StoreSkuInfo{
|
||||||
@@ -744,13 +726,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
err = nil
|
err = nil
|
||||||
failedList = nil // 因为batchSize为1,可以这样处理
|
failedList = nil // 因为batchSize为1,可以这样处理
|
||||||
} else if err2 != nil {
|
} else if err2 != nil {
|
||||||
globals.SugarLogger.Debug("31.sth wrong on err2: %v", err2)
|
|
||||||
failedList = append(failedList, putils.GetErrMsg2FailedSingleList(batchedStoreSkuList, err2, storeID, model.VendorChineseNames[vendorID], "查询是否有该商品")...)
|
failedList = append(failedList, putils.GetErrMsg2FailedSingleList(batchedStoreSkuList, err2, storeID, model.VendorChineseNames[vendorID], "查询是否有该商品")...)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("33.updateList|| failedList=============", updateList, failedList)
|
|
||||||
}
|
}
|
||||||
failedList, err = buildFailedListAndErr(failedList, err, nil, batchedStoreSkuList, storeID, vendorID, "创建门店商品")
|
failedList, err = buildFailedListAndErr(failedList, err, nil, batchedStoreSkuList, storeID, vendorID, "创建门店商品")
|
||||||
globals.SugarLogger.Debug("18.updateList,failedList=========================", updateList, failedList)
|
|
||||||
if len(failedList) > 0 {
|
if len(failedList) > 0 {
|
||||||
task.AddFailedList(failedList)
|
task.AddFailedList(failedList)
|
||||||
}
|
}
|
||||||
@@ -766,7 +745,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
}
|
}
|
||||||
successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList))
|
successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList))
|
||||||
if len(successList) > 0 {
|
if len(successList) > 0 {
|
||||||
globals.SugarLogger.Debug("19.len(successList) > 0 ,successList=========", successList)
|
|
||||||
_, err := updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagNewMask)
|
_, err := updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagNewMask)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debugf("20.sth wrong on updateStoreSku: %v", err)
|
globals.SugarLogger.Debugf("20.sth wrong on updateStoreSku: %v", err)
|
||||||
@@ -784,24 +762,13 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
_, err = putils.FreeBatchStoreSkuSyncInfo("更新门店商品基础信息", func(task tasksch.ITask, batchedStoreSkuList []*dao.StoreSkuSyncInfo) (result interface{}, successCount int, err error) {
|
_, err = putils.FreeBatchStoreSkuSyncInfo("更新门店商品基础信息", func(task tasksch.ITask, batchedStoreSkuList []*dao.StoreSkuSyncInfo) (result interface{}, successCount int, err error) {
|
||||||
var failedList []*partner.StoreSkuInfoWithErr
|
var failedList []*partner.StoreSkuInfoWithErr
|
||||||
failedList, err = singleStoreHandler.UpdateStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList)
|
failedList, err = singleStoreHandler.UpdateStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList)
|
||||||
if err != nil {
|
|
||||||
globals.SugarLogger.Debugf("21.sth wrong on singleStoreHandler.UpdateStoreSkus: %v", err)
|
|
||||||
}
|
|
||||||
failedList, err = buildFailedListAndErr(failedList, err, nil, batchedStoreSkuList, storeID, vendorID, "更新门店商品基础信息")
|
failedList, err = buildFailedListAndErr(failedList, err, nil, batchedStoreSkuList, storeID, vendorID, "更新门店商品基础信息")
|
||||||
if err != nil {
|
|
||||||
globals.SugarLogger.Debugf("22.sth wrong on buildFailedListAndErr: %v", err)
|
|
||||||
}
|
|
||||||
if len(failedList) > 0 {
|
if len(failedList) > 0 {
|
||||||
task.AddFailedList(failedList)
|
task.AddFailedList(failedList)
|
||||||
}
|
}
|
||||||
successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList))
|
successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList))
|
||||||
globals.SugarLogger.Debug("23.failedList,successList============", failedList, successList)
|
|
||||||
if len(successList) > 0 {
|
if len(successList) > 0 {
|
||||||
_, err := updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagModifiedMask)
|
_, err = updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagModifiedMask)
|
||||||
if err != nil {
|
|
||||||
globals.SugarLogger.Debugf("24.sth wrong on updateStoreSku: %v", err)
|
|
||||||
//return nil, 0, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil, len(successList), err
|
return nil, len(successList), err
|
||||||
}, ctx, task, updateList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkus), isContinueWhenError2)
|
}, ctx, task, updateList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkus), isContinueWhenError2)
|
||||||
@@ -812,7 +779,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品库存", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品库存", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
||||||
var failedList []*partner.StoreSkuInfoWithErr
|
var failedList []*partner.StoreSkuInfoWithErr
|
||||||
failedList, err = storeSkuHandler.UpdateStoreSkusStock(ctx, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList)
|
failedList, err = storeSkuHandler.UpdateStoreSkusStock(ctx, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList)
|
||||||
globals.SugarLogger.Debugf("failedList===========%s", utils.Format4Output(failedList, true))
|
|
||||||
failedList, err = buildFailedListAndErr(failedList, err, batchedStoreSkuList, nil, storeID, vendorID, "更新门店商品库存")
|
failedList, err = buildFailedListAndErr(failedList, err, batchedStoreSkuList, nil, storeID, vendorID, "更新门店商品库存")
|
||||||
if len(failedList) > 0 {
|
if len(failedList) > 0 {
|
||||||
task.AddFailedList(failedList)
|
task.AddFailedList(failedList)
|
||||||
@@ -851,7 +817,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
}
|
}
|
||||||
case 6:
|
case 6:
|
||||||
if len(priceList) > 0 {
|
if len(priceList) > 0 {
|
||||||
globals.SugarLogger.Debugf("================更新门店商品价格%s", utils.Format4Output(priceList, true))
|
|
||||||
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品价格", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
_, err = putils.FreeBatchStoreSkuInfo("更新门店商品价格", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
|
||||||
if isNeedHandleAct(causeFlag) {
|
if isNeedHandleAct(causeFlag) {
|
||||||
cancelStoreSkuActs(ctx, task, vendorID, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList, true)
|
cancelStoreSkuActs(ctx, task, vendorID, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList, true)
|
||||||
@@ -878,7 +843,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
for vendorCatID := range reorderSkuMap {
|
for vendorCatID := range reorderSkuMap {
|
||||||
vendorCatIDs = append(vendorCatIDs, vendorCatID)
|
vendorCatIDs = append(vendorCatIDs, vendorCatID)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("================门店商品排序%s", utils.Format4Output(reorderSkuMap, true))
|
|
||||||
reorderTask := tasksch.NewParallelTask("门店商品排序", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError2), ctx,
|
reorderTask := tasksch.NewParallelTask("门店商品排序", tasksch.NewParallelConfig().SetIsContinueWhenError(isContinueWhenError2), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
vendorCatID := batchItemList[0].(string)
|
vendorCatID := batchItemList[0].(string)
|
||||||
|
|||||||
@@ -684,7 +684,6 @@ func ScheduleTimerFuncOnce(name string, handler func(interface{}), timeStr strin
|
|||||||
duration := nextTime.Sub(now) + 1*time.Second
|
duration := nextTime.Sub(now) + 1*time.Second
|
||||||
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce, func:%s, duration:%v", name, duration)
|
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce, func:%s, duration:%v", name, duration)
|
||||||
utils.AfterFuncWithRecover(duration, func() {
|
utils.AfterFuncWithRecover(duration, func() {
|
||||||
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce func:%s", name)
|
|
||||||
handler(param)
|
handler(param)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ func RefreshQywxToken() (err error) {
|
|||||||
}
|
}
|
||||||
return token, expireTimeStr, ""
|
return token, expireTimeStr, ""
|
||||||
}, func(value, v2 string) {
|
}, func(value, v2 string) {
|
||||||
globals.SugarLogger.Debugf("RefreshQywxToken setter value:%s", value)
|
|
||||||
api.QywxAPI.SetToken(value)
|
api.QywxAPI.SetToken(value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package controllers
|
|||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -29,9 +28,7 @@ func (t *TiktokController) CallbackTiktokOrderMsg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2.参数解析
|
// 2.参数解析
|
||||||
globals.SugarLogger.Debug("抖音订单回调数据参数打印===========", string(byteList))
|
|
||||||
orderStatus, resp := api.TiktokStore.CreateOrderCallback(byteList)
|
orderStatus, resp := api.TiktokStore.CreateOrderCallback(byteList)
|
||||||
globals.SugarLogger.Debug("抖音订单回调数据打印测试===========", orderStatus)
|
|
||||||
if resp.Code != 0 {
|
if resp.Code != 0 {
|
||||||
t.Data["json"] = resp
|
t.Data["json"] = resp
|
||||||
t.ServeJSON()
|
t.ServeJSON()
|
||||||
|
|||||||
Reference in New Issue
Block a user