This commit is contained in:
邹宗楠
2022-10-22 22:44:39 +08:00
parent 04f1190953
commit 5a47102894
37 changed files with 4 additions and 115 deletions

View File

@@ -11,7 +11,6 @@ import (
"git.rosy.net.cn/jx-callback/business/auth2"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
)
@@ -64,8 +63,6 @@ func (a *DefAuther) GetUserType() (userType int8) {
// 此函数用于联合通过unionID查找用户
func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAuthTypeList []string, openID, unionID string, authDetail interface{}) (authBindEx *auth2.AuthBindEx, err error) {
globals.SugarLogger.Debugf("UnionFindAuthBind curAuthType:%s, curAuthTypeID:%s, unionAuthTypeList:%v, openID:%s, unionID:%s, authDetail:%s",
curAuthType, curAuthTypeID, unionAuthTypeList, openID, unionID, utils.Format4Output(authDetail, true))
db := dao.GetDB()
var authBind *model.AuthBind
if authBind, err = dao.GetAuthBind(db, model.AuthBindTypeAuth, curAuthType, openID); err == nil { // 直接找到了
@@ -146,7 +143,6 @@ func (a *DefAuther) GenerateVerifyCode(keyID string) (verifyCode string) {
if verifyCode == "" {
verifyCode = fmt.Sprintf("%06d", rand.Intn(1000000))
}
globals.SugarLogger.Debugf("GenerateVerifyCode keyID:%s verifyCode:%s", keyID, verifyCode)
return verifyCode
}

View File

@@ -1675,7 +1675,6 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
var beforeStoreMap = *storeMap
syncStatus := model.SyncFlagModifiedMask
valid := dao.StrictMakeMapByStructObject(payload, storeMap, userName)
globals.SugarLogger.Debug("==============validvalidvalidvalidvalid", utils.Format4Output(valid, false))
if valid["status"] != nil {
syncStatus |= model.SyncFlagStoreStatus
}

View File

@@ -55,7 +55,6 @@ func InsertStoreAcctIncome(ctx *jxcontext.Context, storeID, price, acctType int,
storeAcctIncome.ExpID = expendID
}
err = dao.CreateEntity(db, storeAcctIncome)
globals.SugarLogger.Debugf("InsertStoreAcctIncome orderID: [%v] , price :[%v] , type :[%v]", vendorOrderID, price, acctType)
return err
}
@@ -96,7 +95,6 @@ func (s *StoreAcctManager) UpdateStoreAcctBalance(ctx *jxcontext.Context, storeI
var (
db = dao.GetDB()
)
globals.SugarLogger.Debugf("UpdateStoreAcctBalance storeID: [%v] , price :[%v] ,", storeID, price)
if ctx == nil {
ctx = jxcontext.AdminCtx
}
@@ -130,7 +128,6 @@ func (s *StoreAcctManager) UpdateStoreAcctBalance(ctx *jxcontext.Context, storeI
dao.Rollback(db, txDB)
return err
}
globals.SugarLogger.Debugf("UpdateStoreAcctBalance2 storeID: [%v] , balance :[%v] ,", storeID, storeAcct.AccountBalance)
}
dao.Commit(db, txDB)
return err

View File

@@ -26,7 +26,6 @@ func init() {
func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int, storeStatus int) (err error) {
//return err
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeStatus:%d", vendorStoreID, storeStatus)
db := dao.GetDB()
storeDetail, err := dao.GetStoreDetailByVendorStoreID(db, vendorStoreID, vendorID, "")
if err == nil {

View File

@@ -559,7 +559,6 @@ func (c *ComparePlatform) CompareStoreWithOperator(ctx *jxcontext.Context, db *d
}
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,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
@@ -588,7 +587,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) {
globals.SugarLogger.Debug("DeleteRemoteStoreSkus")
hint, err = v.LoopStoresMap(ctx, db, fmt.Sprintf("删除远程门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
@@ -612,7 +610,6 @@ func (v *VendorSync) DeleteRemoteStoreSkus(ctx *jxcontext.Context, db *dao.DaoDB
// 将平台有,但本地没有的门店商品清除
// todo京东到家也应该支持
func (v *VendorSync) PruneMissingStoreSkus(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
globals.SugarLogger.Debug("PruneMissingStoreSkus")
hint, err = v.LoopStoresMap(ctx, dao.GetDB(), fmt.Sprintf("删除远程无关联的门店商品信息:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
@@ -637,7 +634,6 @@ func (v *VendorSync) PruneMissingStoreSkus(ctx *jxcontext.Context, vendorIDs []i
// 把京西有,平台无且没有待创建标记的商品加上待创建标记
// todo京东到家也应该支持
func (v *VendorSync) AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
globals.SugarLogger.Debug("AddCreateFlagForJxStoreSku")
hint, err = v.LoopStoresMap(ctx, dao.GetDB(), fmt.Sprintf("处理京西有,平台无且没有待创建标记的商品加上待创建标记:%v", storeIDs), isAsync, true, vendorIDs, storeIDs,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
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 {
return nil, "", err
}
globals.SugarLogger.Debug("===============len(storeMapList)", len(storeMapList))
if len(storeMapList) == 0 {
return nil, "", nil
}
@@ -705,13 +700,10 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I
}
index++
}
globals.SugarLogger.Debug("===============len(storeMapList)1111111111", vendorStoreMap)
if len(loopInfoList) == 1 {
globals.SugarLogger.Debug("===============len(storeMapList)22222")
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)
if isAsync {

View File

@@ -92,7 +92,6 @@ func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.IT
}
func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs []int, appOrgCodes []string, catIDs []int, isAsync bool) (hint string, err error) {
globals.SugarLogger.Debugf("SyncCategories vendorIDs:%v, appOrgCodes:%v, catIDs:%v", vendorIDs, appOrgCodes, catIDs)
db := dao.GetDB()
catList, err := dao.GetSkuCategoryWithVendor(db, vendorIDs, appOrgCodes, -1, catIDs, true)
globals.SugarLogger.Debugf("SyncCategories catListLenght:%v", len(catList))

View File

@@ -38,7 +38,6 @@ var (
)
func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int) (err error) {
globals.SugarLogger.Debugf("CreateStoreCategoryByStoreSku vendorID:%d, storeID:%d", vendorID, storeID)
db := dao.GetDB()
txDB, _ := dao.Begin(db)
defer func() {
@@ -513,10 +512,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
} else {
deleteList = append(deleteList, bareSku)
}
globals.SugarLogger.Debug("2.stockListdeleteList==============", stockList, deleteList)
} else {
updateItems = append(updateItems, sku2Update(vendorID, sku, model.SyncFlagDeletedMask))
globals.SugarLogger.Debug("3.updateItems==============", updateItems)
}
} else if model.IsSyncStatusNew(sku.SkuSyncStatus) {
globals.SugarLogger.Debug("4.进入model.IsSyncStatusNew(sku.SkuSyncStatus)")
@@ -579,12 +576,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
isAdded2Update = true
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
}
globals.SugarLogger.Debug("13.updateList================", updateList)
}
if model.IsSyncStatusPrice(sku.SkuSyncStatus) {
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
priceList = append(priceList, bareSku)
globals.SugarLogger.Debug("14. priceList=====================", priceList)
}
if !isAdded2Update {
globals.SugarLogger.Debug("15.进入!isAdded2Update")
@@ -696,7 +691,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
task := tasksch.NewParallelTask("syncStoreSkuNew", tasksch.NewParallelConfig().SetParallelCount(1).SetIsContinueWhenError(isContinueWhenError2), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)
globals.SugarLogger.Debugf("17.deleteList,createList,updateList,stockList===============", deleteList, createList, updateList, stockList)
switch step {
case 0:
if len(deleteList) > 0 {
@@ -747,10 +741,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
globals.SugarLogger.Debug("31.sth wrong on err2: %v", err2)
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, "创建门店商品")
globals.SugarLogger.Debug("18.updateList,failedList=========================", updateList, failedList)
if len(failedList) > 0 {
task.AddFailedList(failedList)
}
@@ -851,7 +843,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
}
case 6:
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) {
if isNeedHandleAct(causeFlag) {
cancelStoreSkuActs(ctx, task, vendorID, storeDetail.VendorOrgCode, storeID, vendorStoreID, batchedStoreSkuList, true)

View File

@@ -682,7 +682,6 @@ func ScheduleTimerFuncOnce(name string, handler func(interface{}), timeStr strin
now := time.Now()
nextTime := jxutils.GetNextTimeFromList(now, []string{timeStr})
duration := nextTime.Sub(now) + 1*time.Second
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce, func:%s, duration:%v", name, duration)
utils.AfterFuncWithRecover(duration, func() {
globals.SugarLogger.Debugf("ScheduleTimerFuncOnce func:%s", name)
handler(param)
@@ -690,7 +689,6 @@ func ScheduleTimerFuncOnce(name string, handler func(interface{}), timeStr strin
}
func ScheduleTimerFuncByInterval(handler func(), delay, inerval time.Duration) {
globals.SugarLogger.Debugf("ScheduleTimerFuncByInterval, delay:%v, inerval:%v", delay, inerval)
utils.AfterFuncWithRecover(delay, func() {
beginTime := time.Now()
handler()

View File

@@ -136,7 +136,6 @@ func GetPossibleVendorIDFromVendorOrderID(vendorOrderID string) (vendorID int) {
vendorID = model.VendorIDUnknown
//if vendorOrderIDInt64 := utils.Str2Int64WithDefault(vendorOrderID, 0); vendorOrderIDInt64 > 0 {
orderIDLen := len(vendorOrderID)
globals.SugarLogger.Debugf("GetPossibleVendorIDFromVendorOrderID, orderIDLen: %v", orderIDLen)
// 5287873015048 13 wsc
// 15380342248732 14 old ebai order
// 800402581000221 15,16 jd order

View File

@@ -72,7 +72,6 @@ func getStore4Print(db *dao.DaoDB, storeID int) (store *model.Store, err error)
// PrintOrderByOrder4Store 打印订单信息
func PrintOrderByOrder4Store(ctx *jxcontext.Context, order *model.GoodsOrder, storeID int, printType string, afs *model.AfsOrder) (printResult *partner.PrinterStatus, err error) {
globals.SugarLogger.Debugf("PrintOrderByOrder4Store orderID:%s", order.VendorOrderID)
db := dao.GetDB()
store, err := getStore4Print(db, storeID)
if err == nil {
@@ -242,7 +241,6 @@ func RebindAllPrinters(ctx *jxcontext.Context, isForce, isAsync bool) (hint stri
store := batchItemList[0].(*model.Store)
if handler := partner.GetPrinterPlatformFromVendorID(store.PrinterVendorID); handler != nil {
bindResult, err2 := handler.RebindPrinter(ctx, bindResultMap[store.ID])
globals.SugarLogger.Debugf("RebindAllPrinters storeID:%d, result:%s, err:%v", store.ID, utils.Format4Output(bindResult, true), err2)
if err = err2; err == nil {
store.PrinterSN = bindResult.PrinterSN
store.PrinterKey = bindResult.PrinterKey

View File

@@ -64,13 +64,11 @@ func SendVoiceMsg(mobileList []string, templateCode string, templateParam map[st
TtsCode: tea.String(templateCode),
TtsParam: tea.String(string(utils.MustMarshal(templateParam))),
}
globals.SugarLogger.Debugf("SendVoiceMsg mobile: %s,template: %s ", mobileNum, templateCode)
res, _err := api.VoiceClient.SingleCallByTts(request)
if _err != nil {
errList.AddErr(err)
}
if *res.Body.Code != "OK" {
globals.SugarLogger.Debugf("SendVoiceMsg mobileNum:%s failed with response:%s", mobileNum, utils.Format4Output(res, true))
errList.AddErr(fmt.Errorf(*res.Body.Message))
} else {
globals.SugarLogger.Debugf("SendVoiceMsg mobileNum:%s success with response:%s", mobileNum, utils.Format4Output(res, true))
@@ -135,7 +133,6 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) {
}
balance, _ := partner.CurStoreAcctManager.GetBrandBalance(store.BrandID)
if order.NotifyType == 0 && store.SMSNotify != 0 && store.IsOrder == model.NO && store.ID != model.MatterStoreID && store.ID != model.JdShopMainStoreID && len(mobileList) > 0 {
globals.SugarLogger.Debugf("NotifyPickOrder orderID: %s , smsNotify :%d", order.VendorOrderID, store.SMSNotify)
switch store.SMSNotify {
case model.NotifyTypeSMS:
if store.BrandIsOpen&model.BrandOpenSMS != 0 && balance >= model.BrandBalanceLimit {

View File

@@ -4,7 +4,6 @@ import (
"fmt"
"time"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
)
@@ -14,7 +13,6 @@ const (
func LockJdStoreSku(jdStoreID string, jdSkuID int64, expire time.Time) {
return
globals.SugarLogger.Debug(expire, " ", time.Now())
duration := expire.Sub(time.Now())
if duration > 0 {
api.Cacher.Set(genCacheKey(jdStoreID, jdSkuID), 1, duration)

View File

@@ -140,7 +140,6 @@ func RefreshWeixinToken() (err error) {
func RefreshFnToken() (err error) {
if api.FnAPI != nil {
err = RefreshConfig("fn", fnTokenExpires, func() (token string, expireTimeStr string, refreshToken string) {
globals.SugarLogger.Debugf("RefreshFnToken RunMode:%s", beego.BConfig.RunMode)
//if globals.IsMainProductEnv() {
curConfig := &legacymodel.Config{
Thirdparty: "fn",
@@ -181,7 +180,6 @@ func RefreshFnToken() (err error) {
func RefreshQywxToken() (err error) {
if api.QywxAPI != nil {
err = RefreshConfig("qywx", weixinTokenExpires, func() (token string, expireTimeStr string, invalidParameter string) {
globals.SugarLogger.Debugf("RefreshQywxToken RunMode:%s", beego.BConfig.RunMode)
if globals.IsMainProductEnv() {
if tokenInfo, err := api.QywxAPI.GetToken(); err == nil {
token = tokenInfo
@@ -191,7 +189,6 @@ func RefreshQywxToken() (err error) {
}
return token, expireTimeStr, ""
}, func(value, v2 string) {
globals.SugarLogger.Debugf("RefreshQywxToken setter value:%s", value)
api.QywxAPI.SetToken(value)
})
}
@@ -204,7 +201,6 @@ func RefreshWeixin2Token() (err error) {
globals.SugarLogger.Debugf("RefreshWeixin2Token RunMode:%s", beego.BConfig.RunMode)
if globals.IsMainProductEnv() {
if tokenInfo, err := api.WeixinMiniAPI2.CBRetrieveToken(); err == nil {
globals.SugarLogger.Debugf("RefreshWeixin2Token tokenInfo:%s", utils.Format4Output(tokenInfo, true))
token = tokenInfo.AccessToken
} else {
globals.SugarLogger.Errorf("RefreshWeixin2Token RefreshToken failed with error:%v", err)
@@ -217,7 +213,6 @@ func RefreshWeixin2Token() (err error) {
}
return token, expireTimeStr, ""
}, func(value, v2 string) {
globals.SugarLogger.Debugf("RefreshWeixinToken setter value:%s", value)
syseventhub.SysEventHub.OnNewWX2Token(value)
api.WeixinMiniAPI2.CBSetToken(value)
})
@@ -228,7 +223,6 @@ func RefreshWeixin2Token() (err error) {
func RefreshPushToken() (err error) {
if api.PushAPI != nil {
err = RefreshConfig("push", pushTokenExpires, func() (token string, expireTimeStr string, invalidParameter string) {
globals.SugarLogger.Debugf("RefreshPushToken RunMode:%s", beego.BConfig.RunMode)
if globals.IsMainProductEnv() {
if tokenInfo, err := api.PushAPI.CBRetrieveToken(); err == nil {
globals.SugarLogger.Debugf("RefreshPushToken tokenInfo:%s", utils.Format4Output(tokenInfo, true))
@@ -244,7 +238,6 @@ func RefreshPushToken() (err error) {
}
return token, expireTimeStr, ""
}, func(value, v2 string) {
globals.SugarLogger.Debugf("RefreshPushToken setter value:%s", value)
syseventhub.SysEventHub.OnNewPushToken(value)
api.PushAPI.CBSetToken(value)
})
@@ -282,7 +275,6 @@ func RefreshWeixin3Token() (err error) {
func RefreshWeimobToken() (err error) {
if api.WeimobAPI != nil {
err = RefreshConfig("weimob", weimobTokenExpires, func() (token string, expireTimeStr string, invalidParameter string) {
globals.SugarLogger.Debugf("RefreshWeimobToken RunMode:%s", beego.BConfig.RunMode)
if globals.IsMainProductEnv() {
if tokenInfo, err := api.WeimobAPI.RefreshTokenByRefreshToken(); err == nil {
return string(utils.MustMarshal(tokenInfo)), utils.Time2Str(time.Now().Add((time.Duration(tokenInfo.ExpiresIn) - weimobTokenExpires/time.Second) * time.Second)), ""
@@ -315,7 +307,6 @@ func RefreshWeimobToken() (err error) {
func RefreshDingDingToken() (err error) {
api.DingDingAPI.RetrieveToken()
return RefreshConfig("dingding", dingdingTokenExpires, func() (string, string, string) {
globals.SugarLogger.Debugf("RefreshDingDingToken RunMode:%s", beego.BConfig.RunMode)
if true { //globals.IsProductEnv() {
if token, err := api.DingDingAPI.RetrieveToken(); err == nil {
globals.SugarLogger.Debugf("RefreshDingDingToken tokenInfo:%s", token)
@@ -343,7 +334,6 @@ func SaveWeimobToken(token *weimobapi.TokenInfo) (err error) {
func RefreshYilianyunToken() (err error) {
return RefreshConfig("yilianyun", yilianyunTokenExpires, func() (token string, expireTimeStr string, invalidParameter string) {
globals.SugarLogger.Debugf("RefreshYilianyunToken RunMode:%s", beego.BConfig.RunMode)
if globals.IsMainProductEnv() { // 只有京西菜市刷新易联云key
if tokenInfo, err := api.YilianyunAPI.RetrieveToken(); err == nil {
token = string(utils.MustMarshal(tokenInfo))
@@ -377,9 +367,7 @@ func PollingRemotEvent(remoteURL string, waitSecond int, params map[string]inter
"waitSecond": waitSecond,
})
for {
globals.SugarLogger.Debugf("PollingRemotEvent %s", remoteURL)
response, err := http.Get(utils.GenerateGetURL(remoteURL, "", params2))
globals.SugarLogger.Debugf("PollingRemotEvent2 %s error:%v", remoteURL, err)
if err == nil {
defer response.Body.Close()
if response.StatusCode == http.StatusOK {

View File

@@ -1076,8 +1076,6 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
sqlParams = append(sqlParams, pageSize, offset)
txDB, _ := Begin(db)
defer Commit(db, txDB)
globals.SugarLogger.Debugf("===orderEX==sql=%s", sql)
globals.SugarLogger.Debugf("===orderEX==param=%s", utils.Format4Output(sqlParams, false))
if err = GetRowsTx(txDB, &orders, sql, sqlParams...); err == nil {
totalCount = GetLastTotalRowCount2(db, txDB)
}

View File

@@ -3,7 +3,6 @@ package dao
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals"
"time"
)
@@ -57,7 +56,6 @@ func UpdateSensitiveWord(wordList *model.SensitiveWord, vendorID int, id int, us
wordList.VendorID = vendorID
wordList.UpdatedAt = time.Now()
wordList.LastOperator = userName
globals.SugarLogger.Debug("wordList:", wordList)
if id != 0 {
if _, err := UpdateEntity(nil, wordList, "id", "word", "vendor_id", "last_operator"); err != nil {
return nil, err

View File

@@ -686,8 +686,6 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
// }
sql = fmt.Sprintf(sql, fmtParams...)
sql += " ORDER BY t1.price"
globals.SugarLogger.Debug("sql======", sql)
globals.SugarLogger.Debug("sqlparam======", sqlParams)
if err = GetRows(db, &skus, sql, sqlParams...); err != nil {
return nil, err
@@ -702,7 +700,6 @@ func GetStoreSkus(db *DaoDB, vendorID, storeID int, skuIDs []int) (skus []*Store
// 以sku为基础来做全同步
// 多门店模式厂商适用
func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInfo, err error) {
globals.SugarLogger.Debugf("GetFullStoreSkus, storeID:%d, vendorID:%d", storeID, vendorID)
// 对于多门店平台商品库删除后不需要操作门店商品所以sku_name用JOIN, sku与sku_name也可以直接排除下架的
sql := `
@@ -833,8 +830,6 @@ func SetStoreSkuSyncStatus(db *DaoDB, vendorID int, storeIDs []int, skuIDs []int
}
func SetStoreCategorySyncStatus(db *DaoDB, vendorID int, storeIDs []int, catIDs []int, syncStatus int) (num int64, err error) {
globals.SugarLogger.Debugf("SetStoreCategorySyncStatus, storeIDs:%v, vendorID:%d", storeIDs, vendorID)
isSingleStorePF := model.MultiStoresVendorMap[vendorID] != 1
fieldPrefix := ConvertDBFieldPrefix(model.VendorNames[vendorID])
sql := `

View File

@@ -3,7 +3,6 @@ package dao
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals"
)
func GetThingMapList(db *DaoDB, thingType int, vendorIDs, thingIDs []int, vendorOrgCodes []string) (cats []*model.ThingMap, err error) {
@@ -75,7 +74,6 @@ func SetSkuNameSyncStatus(db *DaoDB, vendorIDs []int, vendorOrgCodes []string, n
}
func SetSkuSyncStatus(db *DaoDB, vendorID int, skuIDs []int, syncStatus int8) (num int64, err error) {
globals.SugarLogger.Debugf("SetSkuSyncStatus, vendorID:%d", vendorID)
num, err = SetThingMapSyncStatus(db, []int{vendorID}, nil, model.ThingTypeSku, skuIDs, syncStatus)
return num, err
}

View File

@@ -32,8 +32,6 @@ func TestCreateStore(t *testing.T) {
StoreList: storeLists,
}
resp, err := a.BatchCreateStore(param)
t.Fatal("err===========", err)
t.Fatalf("resp===========:%v", resp)
}
//

View File

@@ -41,7 +41,6 @@ func (c *PurchaseHandler) isAfsMsg(msg string) bool {
func (c *PurchaseHandler) OnAfsOrderMsg(msgId, orderId string, msg interface{}) (retVal *tiktokShop.CallbackResponse) {
//jxutils.CallMsgHandlerAsync(func() {
retVal = c.onAfsOrderMsg(msgId, msg)
globals.SugarLogger.Debugf("============%s===", utils.Format4Output(retVal, false))
//}, jxutils.ComposeUniversalOrderID(orderId, model.VendorIDDD))
return retVal
}

View File

@@ -650,7 +650,6 @@ func (P *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendo
if err != nil {
return nil, err
}
globals.SugarLogger.Debugf("AddAuthBind user================:%s", utils.Format4Output(vendorStore, true))
retVal := &dao.StoreDetail{
Store: model.Store{
Address: vendorStore.StoreDetail.Store.Address,

View File

@@ -270,7 +270,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
Supply7dayReturn: 0,
Mobile: storeDetail.Tel1,
Commit: true,
Specs: "净重|" + fmt.Sprintf("%f", storeSku.SpecQuality) + storeSku.SpecUnit,
Specs: "净重|" + utils.Float64ToStr(float64(storeSku.SpecQuality)) + storeSku.SpecUnit,
NeedRechargeMode: false,
SellChannel: []int64{0},
StartSaleType: 0,
@@ -313,11 +313,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
return nil, err
}
globals.SugarLogger.Debugf("本地商品详情============%s,", utils.Format4Output(param, false))
// 根据本地商品id获取线上商品是否存在,存在则只创建子商品
var tiktokResultProductId int64 = 0
skuMain, err := api.GetSkuDetailLocalID("", param.OuterProductId)
globals.SugarLogger.Debugf("线上商品详情(主)============%s,", utils.Format4Output(skuMain, false))
if err != nil { // 线上不存在创建
tiktokResult, err := api.CreateStoreCommodity(param) // 创建主商品
if err != nil {
@@ -462,7 +460,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
//param.SaleLimitId = saleLimitId
//param.StoreId = utils.Str2Int64(vendorStoreID)
// 抖店创建商品
globals.SugarLogger.Debugf("更新子商品=============%s", utils.Format4Output(param, false))
if err := api.EditStoreCommodity(param); err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)