log delete
This commit is contained in:
@@ -74,7 +74,6 @@ func TransferLegacyWeixins(mobile string) (err error) {
|
||||
if err = err2; err != nil {
|
||||
return err
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(user, false))
|
||||
if len(userList) == 0 {
|
||||
err = CreateUser(user, v.LastOperator)
|
||||
} else {
|
||||
|
||||
@@ -65,10 +65,9 @@ func GetStoreMessages(ctx *jxcontext.Context, msgIDs, storeIDs, types []int, fro
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
db := dao.GetDB()
|
||||
txDB , _ := dao.Begin(db)
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer dao.Commit(db, txDB)
|
||||
var msgList []*model.Message
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRowsTx(txDB, &msgList, sql, sqlParams...); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: dao.GetLastTotalRowCount2(db, txDB),
|
||||
@@ -124,11 +123,9 @@ func GetStoreMessageStatuses(ctx *jxcontext.Context, msgIDs, storeIDs, confirmSt
|
||||
sql += " LIMIT ? OFFSET ?"
|
||||
sqlParams = append(sqlParams, jxutils.FormalizePageSize(pageSize), offset)
|
||||
db := dao.GetDB()
|
||||
txDB , _ := dao.Begin(db)
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer dao.Commit(db, txDB)
|
||||
var msgStatusList []*MessageStatusExt
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
if err = dao.GetRowsTx(txDB, &msgStatusList, sql, sqlParams...); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: dao.GetLastTotalRowCount2(db, txDB),
|
||||
|
||||
@@ -108,7 +108,6 @@ func GetCategories(ctx *jxcontext.Context, parentID int, isExd bool) (catList []
|
||||
ids = append(ids, v.ID)
|
||||
}
|
||||
//thingMapMap, err2 := dao.GetThingMapMap(db, model.ThingTypeCategory, nil, ids)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(thingMapMap, false))
|
||||
//if err = err2; err == nil {
|
||||
for _, v := range cats {
|
||||
catList = append(catList, &dao.SkuCategoryWithVendor{
|
||||
@@ -787,7 +786,6 @@ func IsSensitiveWordInList(str string) (bool, string) {
|
||||
for index > 0 {
|
||||
index = strings.Index(keyWord, ",")
|
||||
keyWord = keyWord[:index-1]
|
||||
globals.SugarLogger.Debug("keyWord", keyWord)
|
||||
checkHas := strings.Contains(str, keyWord)
|
||||
if checkHas {
|
||||
return true, keyWord
|
||||
@@ -1337,7 +1335,6 @@ func UpdateSku(ctx *jxcontext.Context, skuID int, payload map[string]interface{}
|
||||
var beforSku = *sku
|
||||
valid := dao.StrictMakeMapByStructObject(payload, sku, userName)
|
||||
if len(valid) > 0 {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(valid, false))
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@@ -1846,7 +1843,6 @@ func SumExianDaDepot(ctx *jxcontext.Context, isAsync, isContinueWhenError bool)
|
||||
v := batchItemList[0].(*ebaiapi.ExianDaSkus)
|
||||
skus, err := api.EbaiAPI.GetExianDaSku(utils.Str2Int64(v.ElemeGoodsID))
|
||||
if err != nil || skus == nil {
|
||||
//globals.SugarLogger.Debugf("GetExianDaSku,[%v]", v.ElemeGoodsID)
|
||||
return result, err
|
||||
}
|
||||
// sku := &model.Sku{}
|
||||
@@ -2002,7 +1998,6 @@ func SendNoCatSkusToOperater(ctx *jxcontext.Context) (err error) {
|
||||
db = dao.GetDB()
|
||||
skuNames []*model.SkuName
|
||||
)
|
||||
globals.SugarLogger.Debugf("SendNoCatSkusToOperater")
|
||||
sql := `
|
||||
SELECT * FROM sku_name WHERE deleted_at = ? AND (category_id = ? OR img = ?) AND unit <> ?
|
||||
`
|
||||
@@ -2416,7 +2411,6 @@ func RefreshJdDepot(ctx *jxcontext.Context) (err error) {
|
||||
time.Sleep(time.Second * 1)
|
||||
_, err = api.JdAPI.UpdateSku2(param)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("RefreshJdDepot UpdateSku2", err.Error())
|
||||
continue
|
||||
}
|
||||
api.JdAPI.RefreshJdDepot(v.JdID)
|
||||
|
||||
@@ -628,8 +628,6 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
//mapLimit := false
|
||||
//globals.SugarLogger.Debug(sql)
|
||||
//globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
txDB, _ := dao.Begin(db)
|
||||
if err = dao.GetRowsTx(txDB, &storeList, sql, sqlParams...); err == nil {
|
||||
retVal.Stores = storeList
|
||||
@@ -773,7 +771,6 @@ func getMapCenter(storeList []*StoreExt) (lng, lat float64) {
|
||||
// for _, store := range storeList {
|
||||
// globals.SugarLogger.Debugf("store:%s, lng:%, lat:%f", store.Name, store.FloatLng, store.FloatLat)
|
||||
// }
|
||||
// globals.SugarLogger.Debugf("lng:%f, lat:%f", lng, lat)
|
||||
return lng, lat
|
||||
}
|
||||
return getMapCenter(newStoreList)
|
||||
@@ -868,7 +865,6 @@ func checkStoreDeliveryRange(deliveryRange string) (err error) {
|
||||
}
|
||||
|
||||
func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interface{}, userName string) (num int64, err error) {
|
||||
globals.SugarLogger.Debugf("UpdateStore storeID:%d, payload:%s", storeID, utils.Format4Output(payload, true))
|
||||
if err = checkBankBranch(utils.Interface2String(payload["payeeBankBranchName"])); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -915,7 +911,6 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
store.Name = valid["name"].(string)
|
||||
syncStatus |= model.SyncFlagStoreName
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(valid, false))
|
||||
printerVendorID := int(utils.Interface2Int64WithDefault(valid["printerVendorID"], 0))
|
||||
if printerVendorID == 0 {
|
||||
printerVendorID = store.PrinterVendorID
|
||||
@@ -980,7 +975,6 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
return 0, err
|
||||
}
|
||||
valid["linkStoreID"] = linkStoreID
|
||||
// globals.SugarLogger.Debug(linkStoreID)
|
||||
}
|
||||
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(valid, false))
|
||||
@@ -1074,7 +1068,6 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
}
|
||||
}
|
||||
|
||||
globals.SugarLogger.Debugf("UpdateStore track:%s, storeID:%d, valid:%s", ctx.GetTrackInfo(), storeID, utils.Format4Output(valid, true))
|
||||
if len(valid) > 0 {
|
||||
if globals.IsAddEvent {
|
||||
mapBefore := refutil.FindMapAndStructMixed(valid, beforStore)
|
||||
@@ -1098,7 +1091,6 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
}, model.FieldSyncStatus, syncStatus)
|
||||
if err = err2; err == nil {
|
||||
dao.Commit(db, txDB)
|
||||
globals.SugarLogger.Debugf("UpdateStore track:%s, before call SyncStore", ctx.GetTrackInfo())
|
||||
_, err = CurVendorSync.SyncStore(ctx, db, -1, store.ID, false, userName)
|
||||
if valid["tel1"] != nil || valid["tel2"] != nil {
|
||||
TryAddStoreBossRole4StoreByMobile(ctx, store.ID, []string{utils.Interface2String(valid["tel1"]), utils.Interface2String(valid["tel2"])})
|
||||
@@ -1208,7 +1200,6 @@ func checkStoreHaveLinkedStore(storeID, linkStoreID int) (err error) {
|
||||
|
||||
// 创建京西门店,同时生成专送门店。
|
||||
func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (id int, err error) {
|
||||
globals.SugarLogger.Debugf("CreateStore storeExt:%s", utils.Format4Output(storeExt, false))
|
||||
if err = checkBankBranch(storeExt.PayeeBankBranchName); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1316,7 +1307,6 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
||||
|
||||
// 创建京西门店,不在生成专送门店!
|
||||
func CreateStore2JX(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (id int, err error) {
|
||||
globals.SugarLogger.Debugf("CreateStore storeExt:%s", utils.Format4Output(storeExt, false))
|
||||
if err = checkBankBranch(storeExt.PayeeBankBranchName); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1674,7 +1664,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
|
||||
}
|
||||
@@ -1744,8 +1733,6 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
|
||||
dao.Rollback(db, txDB)
|
||||
return 0, err
|
||||
}
|
||||
globals.SugarLogger.Debug("==============num", num)
|
||||
|
||||
if num > 0 {
|
||||
if globals.IsAddEvent {
|
||||
mapBefore := refutil.FindMapAndStructMixed(valid, beforeStoreMap)
|
||||
@@ -1796,7 +1783,6 @@ func DeleteStore(ctx *jxcontext.Context, storeID int) (num int64, err error) {
|
||||
if err = dao.GetRow(db, &ct, sql, storeID, utils.DefaultTimeValue, storeID, utils.DefaultTimeValue); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("DeleteStore storeID:%d, ct=%d", storeID, ct)
|
||||
if ct > 0 {
|
||||
return 0, fmt.Errorf("删除京西门店前必须将所有门店解绑且门店处于关店状态")
|
||||
}
|
||||
@@ -1919,8 +1905,6 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI
|
||||
defer func() {
|
||||
dao.Rollback(db, txDB)
|
||||
}()
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
if err = dao.GetRowsTx(txDB, &commentList, sql, sqlParams...); err == nil {
|
||||
retVal = map[string]interface{}{
|
||||
"total": dao.GetLastTotalRowCount2(db, txDB),
|
||||
@@ -1945,8 +1929,6 @@ func GetStoreCourierMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, ven
|
||||
cond[model.FieldVendorID] = vendorID
|
||||
}
|
||||
err = dao.GetEntitiesByKV(db, &storeCourierMaps, cond, false)
|
||||
globals.SugarLogger.Debug("之前的storeCourierMaps")
|
||||
globals.SugarLogger.Debug(utils.Format4Output(storeCourierMaps, false))
|
||||
if len(storeCourierMaps) != 0 {
|
||||
//同步美团配送与否状态及美团门店是否存在
|
||||
for _, v := range storeCourierMaps {
|
||||
@@ -1954,8 +1936,6 @@ func GetStoreCourierMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, ven
|
||||
continue
|
||||
} else {
|
||||
SetMTPSStatus(jxcontext.AdminCtx, v.StoreID, v.Status)
|
||||
globals.SugarLogger.Debug("之后的storeCourierMaps")
|
||||
globals.SugarLogger.Debug(v)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -1982,7 +1962,6 @@ func addStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID
|
||||
storeCourierMap.StoreID = storeID
|
||||
storeCourierMap.VendorID = vendorID
|
||||
storeCourierMap.VendorStatus = storeCourierMap.Status
|
||||
globals.SugarLogger.Debugf("addStoreCourierMap %s, storeCourierMap:%s, isNeedUpdateRemote:%t", model.VendorChineseNames[vendorID], utils.Format4Output(storeCourierMap, true), isNeedUpdateRemote)
|
||||
|
||||
if handler := partner.GetDeliveryPlatformFromVendorID(vendorID); handler != nil {
|
||||
if db == nil {
|
||||
@@ -2076,8 +2055,6 @@ func UpdateStoreCourierMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendo
|
||||
}
|
||||
|
||||
func updateCourierStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (err error) {
|
||||
globals.SugarLogger.Debugf("updateCourierStore %s, storeID:%d, vendorStoreID:%s", model.VendorChineseNames[storeDetail.VendorID], storeDetail.ID, storeDetail.VendorStoreID)
|
||||
|
||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(storeDetail.VendorID); handlerInfo != nil && handlerInfo.Use4CreateWaybill {
|
||||
if updateHandler, ok := handlerInfo.Handler.(partner.IDeliveryUpdateStoreHandler); ok {
|
||||
err = updateHandler.UpdateStore(ctx, formalizeStore4Courier(storeDetail))
|
||||
@@ -2093,8 +2070,6 @@ func updateCourierStore(ctx *jxcontext.Context, storeDetail *dao.StoreDetail2) (
|
||||
//VendorIDMTPS = 102 // 美团配送
|
||||
//VendorIDFengNiao = 103 // 蜂鸟配送
|
||||
func updateCourierStores(ctx *jxcontext.Context, storeID int) (err error) {
|
||||
globals.SugarLogger.Debugf("updateCourierStores storeID:%d", storeID)
|
||||
|
||||
db := dao.GetDB()
|
||||
errList := errlist.New()
|
||||
for k, v := range partner.DeliveryPlatformHandlers {
|
||||
@@ -2139,7 +2114,6 @@ func updateOrCreateCourierStore(ctx *jxcontext.Context, storeDetail *dao.StoreDe
|
||||
remoteStoreDetail, err2 := handlerInfo.Handler.GetStore(ctx, 0, storeDetail.VendorStoreID)
|
||||
if err = err2; err != nil {
|
||||
if handlerInfo.Handler.IsErrStoreNotExist(err) {
|
||||
globals.SugarLogger.Debugf("创建门店的三种方式")
|
||||
// 本地门店同步第三方平台
|
||||
storeDetail.VendorStoreID, storeDetail.AuditStatus, err = handlerInfo.Handler.CreateStore(ctx, storeDetail)
|
||||
if err == nil {
|
||||
@@ -2166,15 +2140,12 @@ func updateOrCreateCourierStore(ctx *jxcontext.Context, storeDetail *dao.StoreDe
|
||||
}
|
||||
if err != nil {
|
||||
err = fmt.Errorf("门店ID:%d,门店名:%s,错误描述:%s", storeDetail.Store.ID, storeDetail.Name, err.Error())
|
||||
globals.SugarLogger.Debugf("updateOrCreateCourierStore storeID:%d failed with error:%v", storeDetail.ID, err)
|
||||
}
|
||||
}
|
||||
return isCreated, err
|
||||
}
|
||||
|
||||
func UpdateOrCreateCourierStores(ctx *jxcontext.Context, storeID int, isForceUpdate, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("UpdateOrCreateCourierStores storeID:%d", storeID)
|
||||
|
||||
var storeIDs []int
|
||||
if storeID != 0 {
|
||||
storeIDs = []int{storeID}
|
||||
@@ -2876,7 +2847,6 @@ func SyncStoresCourierInfo(ctx *jxcontext.Context, storeIDs []int, isAsync, isCo
|
||||
"VendorID": vendorID,
|
||||
})
|
||||
if distance > 0.2 {
|
||||
globals.SugarLogger.Infof("SyncStoresCourierInfo [运营2]门店:%s-%d的%s配送门店坐标不一致,京西:%d,%d,平台:%d,%d,距离:%f公里", store.Name, store.ID, model.VendorChineseNames[vendorID], store.Lng, store.Lat, storeCourier.Lng, storeCourier.Lat, distance)
|
||||
retVal = [][]interface{}{
|
||||
[]interface{}{
|
||||
store,
|
||||
@@ -3235,7 +3205,6 @@ func CreateStorePriceScore(ctx *jxcontext.Context) (err error) {
|
||||
}
|
||||
}
|
||||
dao.Commit(db, txDB)
|
||||
globals.SugarLogger.Debugf("CreateStorePriceScore")
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -3372,7 +3341,6 @@ func UpdateJdStoreNameAll(ctx *jxcontext.Context) (err error) {
|
||||
_, storeParams.CloseStatus = jd.JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus))
|
||||
}
|
||||
// fillOpTimeParams(storeParams, store.GetOpTimeList())
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(storeParams, false))
|
||||
errList := errlist.New()
|
||||
if globals.EnableJdStoreWrite {
|
||||
errList.AddErr(a.UpdateStoreInfo4Open2(storeParams, modifyCloseStatus))
|
||||
@@ -4419,13 +4387,14 @@ func RefreshTiktokShopToken(ctx *jxcontext.Context) (err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
if time.Now().YearDay()%2 != 0 {
|
||||
if time.Now().YearDay()%5 != 0 {
|
||||
return
|
||||
}
|
||||
//token是三天,两天刷新一次token
|
||||
codes, _ := dao.GetVendorOrgCode(db, model.VendorIDDD, "", "platform")
|
||||
for _, v := range codes {
|
||||
if v.Token != "" {
|
||||
api.TiktokStore.SetRefreshToken(v.Token)
|
||||
if result, err := api.TiktokStore.RefreshToken(); err == nil {
|
||||
token, _ := json.Marshal(result)
|
||||
v.Token = string(token)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -88,7 +87,6 @@ func InsertStoreAcctExpend(ctx *jxcontext.Context, storeID, price, acctType int,
|
||||
storeAcctExpend.ExpID = expendID
|
||||
}
|
||||
err = dao.CreateEntity(db, storeAcctExpend)
|
||||
globals.SugarLogger.Debugf("InsertStoreAcctExpend orderID: [%v] , price :[%v] , type :[%v]", vendorOrderID, price, acctType)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -96,7 +94,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
|
||||
}
|
||||
@@ -120,7 +117,6 @@ func (s *StoreAcctManager) UpdateStoreAcctBalance(ctx *jxcontext.Context, storeI
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("UpdateStoreAcctBalance1 storeID: [%v] , balance :[%v] ,", storeID, storeAcct.AccountBalance)
|
||||
if isIncome {
|
||||
storeAcct.AccountBalance += price
|
||||
} else {
|
||||
@@ -130,7 +126,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
|
||||
@@ -161,7 +156,6 @@ func (s *StoreAcctManager) CheckStoreAcctExpendExist(vendorOrderID string) (isEq
|
||||
expends, incomes int
|
||||
db = dao.GetDB()
|
||||
)
|
||||
globals.SugarLogger.Debugf("CheckStoreAcctExpendExist orderID:[%v]", vendorOrderID)
|
||||
// 发单扣除的临时运费
|
||||
expends, err = dao.GetStoreAcctExpendTotal(db, 0, []int{partner.StoreAcctTypeExpendCreateWaybillEx, partner.StoreAcctTypeRealFeeExpend}, vendorOrderID, utils.ZeroTimeValue, utils.ZeroTimeValue)
|
||||
// 真实运费 < 临时运费, 临时运费-真实运费的值
|
||||
@@ -196,7 +190,6 @@ func (s *StoreAcctManager) InsertBrandBill(ctx *jxcontext.Context, brandID, pric
|
||||
db = dao.GetDB()
|
||||
)
|
||||
if price == 0 {
|
||||
globals.SugarLogger.Debugf("InsertBrandBill failed price is 0, brandID: %d, vendorOrderID: %s", brandID, vendorOrderID)
|
||||
return
|
||||
}
|
||||
brandBill := &model.BrandBill{
|
||||
|
||||
@@ -3,7 +3,6 @@ package cms
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -12,7 +11,6 @@ func UpdateStoreOperatorConfig() {
|
||||
db := dao.GetDB()
|
||||
store, err := dao.GetStoreList(db, nil, nil, []int{-1, 0, 1}, nil, nil, "")
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("定时任务,获取所有门店信息错误")
|
||||
return
|
||||
}
|
||||
userData := make(map[string][][]interface{}, 0)
|
||||
@@ -23,7 +21,6 @@ func UpdateStoreOperatorConfig() {
|
||||
for _, v := range store {
|
||||
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), v.ID, 0, "")
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("定时任务,更新门店负责人,美团负责人.....错误", v.ID)
|
||||
return
|
||||
}
|
||||
if storeDetail.MarketManPhone != "" { // 平台负责人jx
|
||||
@@ -46,11 +43,9 @@ func UpdateStoreOperatorConfig() {
|
||||
// 写入配置
|
||||
byteData, err := json.Marshal(userData)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("Marshal err :", err)
|
||||
return
|
||||
}
|
||||
if err := dao.UpdateOperatorConfig(string(byteData)); err != nil {
|
||||
globals.SugarLogger.Debug("update new_config err :", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
|
||||
@@ -1111,12 +1111,10 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
sqlParams2 := append([]interface{}{}, sqlParams...)
|
||||
sqlParams2 = append(sqlParams2, sqlParamsPage)
|
||||
var storeNameList []*tStoreNameBind
|
||||
beginTime := time.Now()
|
||||
if err = dao.GetRowsTx(txDB, &storeNameList, sql2, sqlParams2...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("GetStoresSkusNew get result1:%v", time.Now().Sub(beginTime))
|
||||
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||
sql += " AND (1 = 0"
|
||||
for _, v := range storeNameList {
|
||||
@@ -1154,7 +1152,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
sql += " , t4.unit_price DESC LIMIT 99"
|
||||
}
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
beginTime := time.Now()
|
||||
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
@@ -1163,7 +1160,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||
}
|
||||
dao.Commit(db, txDB)
|
||||
globals.SugarLogger.Debugf("GetStoresSkusNew get result2:%v", time.Now().Sub(beginTime))
|
||||
storeNameMap := make(map[int64]*dao.StoreSkuNameExt)
|
||||
for _, v := range tmpList {
|
||||
var storeName *dao.StoreSkuNameExt
|
||||
@@ -1207,7 +1203,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
err = updateUnitPrice4StoreSkuNameNew(db, skuNamesInfo)
|
||||
}
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(skuNamesInfo, false))
|
||||
return skuNamesInfo, err
|
||||
}
|
||||
|
||||
@@ -1284,12 +1279,10 @@ func GetStoresSkusNew2(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []st
|
||||
sqlParams2 := append([]interface{}{}, sqlParams...)
|
||||
sqlParams2 = append(sqlParams2, sqlParamsPage)
|
||||
var storeNameList []*tStoreNameBind
|
||||
beginTime := time.Now()
|
||||
if err = dao.GetRowsTx(txDB, &storeNameList, sql2, sqlParams2...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("GetStoresSkusNew get result1:%v", time.Now().Sub(beginTime))
|
||||
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||
sql += " AND (1 = 0"
|
||||
for _, v := range storeNameList {
|
||||
@@ -1327,7 +1320,6 @@ func GetStoresSkusNew2(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []st
|
||||
sql += " , t4.unit_price DESC LIMIT 99"
|
||||
}
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
beginTime := time.Now()
|
||||
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
@@ -1336,7 +1328,6 @@ func GetStoresSkusNew2(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []st
|
||||
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||
}
|
||||
dao.Commit(db, txDB)
|
||||
globals.SugarLogger.Debugf("GetStoresSkusNew get result2:%v", time.Now().Sub(beginTime))
|
||||
storeNameMap := make(map[int64]*dao.StoreSkuNameExt)
|
||||
for _, v := range tmpList {
|
||||
var storeName *dao.StoreSkuNameExt
|
||||
@@ -1380,7 +1371,6 @@ func GetStoresSkusNew2(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []st
|
||||
err = updateUnitPrice4StoreSkuNameNew(db, skuNamesInfo)
|
||||
}
|
||||
}
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(skuNamesInfo, false))
|
||||
return skuNamesInfo, err
|
||||
}
|
||||
|
||||
@@ -1554,8 +1544,6 @@ func GetStoreAbnormalSkuCount(ctx *jxcontext.Context, storeID, syncStatus int, i
|
||||
}
|
||||
|
||||
func GetStoresSkusSaleInfo(ctx *jxcontext.Context, storeIDs []int, skuIDs []int, fromTime, toTime time.Time, fromCount, toCount int) (saleInfoList []*SkuSaleInfo, err error) {
|
||||
globals.SugarLogger.Debugf("GetStoresSkusSaleInfo storeIDs:%v, fromTime:%v, toTime:%v, fromCount:%d, toCount:%d", storeIDs, fromTime, toTime, fromCount, toCount)
|
||||
|
||||
db := dao.GetDB()
|
||||
sql := `
|
||||
SELECT IF(t2.jx_store_id <> 0, jx_store_id, store_id) store_id, t1.sku_id, COUNT(*) times, SUM(count) count
|
||||
@@ -1588,7 +1576,6 @@ func GetStoresSkusSaleInfo(ctx *jxcontext.Context, storeIDs []int, skuIDs []int,
|
||||
`
|
||||
sqlParams = append(sqlParams, fromCount, toCount)
|
||||
if err = dao.GetRows(db, &saleInfoList, sql, sqlParams...); err == nil {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(saleInfoList, false))
|
||||
return saleInfoList, nil
|
||||
}
|
||||
return nil, err
|
||||
@@ -1718,7 +1705,6 @@ func UpdateStoreSkus(ctx *jxcontext.Context, causeFlag, storeID int, skuBindInfo
|
||||
}
|
||||
|
||||
func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, skuBindInfos []*StoreSkuBindInfo, isScale, isRefreshHigh, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("UpdateStoresSkus:%s, storeIDs:%v, skuBindInfos:%s", ctx.GetTrackInfo(), storeIDs, utils.Format4Output(skuBindInfos, true))
|
||||
if beego.BConfig.RunMode == "jxgy" {
|
||||
doStoreSkuAuditForGy(ctx, storeIDs, skuBindInfos)
|
||||
var num int64
|
||||
@@ -1891,7 +1877,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
skuBindInfos = uniqueStoreNameBind(skuBindInfos)
|
||||
|
||||
sort.Ints(storeIDs)
|
||||
// globals.SugarLogger.Debugf("updateStoresSkusWithoutSync, storeIDs:%v, skuBindInfos:%s", storeIDs, utils.Format4Output(skuBindInfos, false))
|
||||
if db == nil {
|
||||
db = dao.GetDB()
|
||||
}
|
||||
@@ -1989,7 +1974,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
if err = dao.GetRows(db, &allBinds, sql, sqlParams...); err == nil {
|
||||
if len(allBinds) > 0 {
|
||||
globals.SugarLogger.Debug(utils.Format4Output(allBinds, true))
|
||||
inSkuBinsMap := make(map[int]*StoreSkuBindSkuInfo, len(inSkuBinds))
|
||||
for _, v := range inSkuBinds {
|
||||
inSkuBinsMap[v.SkuID] = v
|
||||
@@ -2650,7 +2634,6 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID int, toStoreIDs []int, co
|
||||
}
|
||||
sqlDelete += sqlCatAndSku
|
||||
sqlDeleteParams = append(sqlDeleteParams, sqlCatAndSkuParams)
|
||||
// globals.SugarLogger.Debug(sqlDelete)
|
||||
num2, err2 := dao.ExecuteSQL(db, sqlDelete, sqlDeleteParams)
|
||||
if err = err2; err != nil {
|
||||
errList.AddErr(err)
|
||||
@@ -2658,7 +2641,6 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID int, toStoreIDs []int, co
|
||||
break
|
||||
}
|
||||
num += num2
|
||||
globals.SugarLogger.Debugf("CopyStoreSkus fromStoreID:%d, toStoreID:%d, trackInfo:%s num1:%d", fromStoreID, toStoreID, ctx.GetTrackInfo(), num2)
|
||||
}
|
||||
isModifyStatus := 1
|
||||
syncStatus := model.SyncFlagStoreSkuOnlyMask
|
||||
@@ -2723,9 +2705,7 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID int, toStoreIDs []int, co
|
||||
}
|
||||
sql += sqlCatAndSku
|
||||
sqlParams = append(sqlParams, sqlCatAndSkuParams)
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
num2, err2 := dao.ExecuteSQL(db, sql, sqlParams)
|
||||
globals.SugarLogger.Debugf("CopyStoreSkus fromStoreID:%d, toStoreID:%d, trackInfo:%s num2:%d", fromStoreID, toStoreID, ctx.GetTrackInfo(), num2)
|
||||
if err = err2; err != nil {
|
||||
errList.AddErr(err)
|
||||
dao.Rollback(db, txDB)
|
||||
@@ -2805,7 +2785,6 @@ func CopyStoreSkus(ctx *jxcontext.Context, fromStoreID int, toStoreIDs []int, co
|
||||
dao.Rollback(db, txDB)
|
||||
break
|
||||
}
|
||||
globals.SugarLogger.Debugf("CopyStoreSkus fromStoreID:%d, toStoreID:%d, trackInfo:%s num3:%d", fromStoreID, toStoreID, ctx.GetTrackInfo(), num2)
|
||||
dao.Commit(db, txDB)
|
||||
|
||||
//同一商品若源门店的规格少于要复制到的门店,则在复制的门店里的其他规格的unitprice不会变,
|
||||
@@ -2872,7 +2851,6 @@ func shouldPendingStorePriceChange(ctx *jxcontext.Context, storeID int, skuBindI
|
||||
}
|
||||
|
||||
func filterStorePriceChange(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo) (filteredStoreIDs []int, filteredSkuBindInfos []*StoreSkuBindInfo, err error) {
|
||||
globals.SugarLogger.Debug("filterStorePriceChange")
|
||||
if globals.EnablePendingChange {
|
||||
db := dao.GetDB()
|
||||
txDB, _ := dao.Begin(db)
|
||||
@@ -3115,8 +3093,6 @@ func GetStoreOpRequests(ctx *jxcontext.Context, fromTime, toTime time.Time, keyw
|
||||
sqlPageSize := pageSize
|
||||
sqlParams = append(sqlParams, sqlPageSize, sqlOffset)
|
||||
db := dao.GetDB()
|
||||
// globals.SugarLogger.Debug(sql)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(sqlParams, false))
|
||||
var requestList []*StoreOpRequestInfo
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer dao.Commit(db, txDB)
|
||||
@@ -3169,7 +3145,6 @@ func getStoreOpRequestsInfo(reqIDs []int) (infoMap map[int]*StoreOpRequestInfo,
|
||||
}
|
||||
|
||||
func changeStoreOpStatus(ctx *jxcontext.Context, reqIDs []int, status int8, rejectReason string) (err error) {
|
||||
globals.SugarLogger.Debugf("changeStoreOpStatus, reqIDs:%v", reqIDs)
|
||||
if globals.EnablePendingChange {
|
||||
if len(reqIDs) > 0 {
|
||||
infoMap, err2 := getStoreOpRequestsInfo(reqIDs)
|
||||
@@ -3189,7 +3164,6 @@ func changeStoreOpStatus(ctx *jxcontext.Context, reqIDs []int, status int8, reje
|
||||
dao.WrapUpdateULEntity(op, ctx.GetUserName())
|
||||
op.DeletedAt = time.Now()
|
||||
op.ID = reqID
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(op, false))
|
||||
if _, err = dao.UpdateEntity(db, op, "IntParam0", "Remark", "Status", "DeletedAt", "LastOperator", "UpdatedAt"); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -3356,7 +3330,6 @@ func RefreshStoresSkuByVendor(ctx *jxcontext.Context, storeIDs []int, vendorID i
|
||||
}
|
||||
|
||||
func GetVendorStoreSkusInfo(ctx *jxcontext.Context, storeID int, vendorIDs, skuIDs []int, isContinueWhenError bool) (skuVendorMap map[int][]*partner.StoreSkuInfo, err error) {
|
||||
globals.SugarLogger.Debugf("GetVendorStoreSkusInfo, storeID:%d, vendorIDs:%v, skuID:%v", storeID, vendorIDs, skuIDs)
|
||||
db := dao.GetDB()
|
||||
var locker sync.RWMutex
|
||||
skuVendorMap = make(map[int][]*partner.StoreSkuInfo)
|
||||
@@ -3447,7 +3420,6 @@ func GetVendorStoreSkusToStruct(ctx *jxcontext.Context, storeID, vendorID int) (
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug(err)
|
||||
} else {
|
||||
globals.SugarLogger.Debug(len(tmpList))
|
||||
if len(tmpList) == 0 { //数据库中无匹配项 直接将第三方数据进行导出
|
||||
goto creatExec
|
||||
} else { //进行比较
|
||||
@@ -3539,7 +3511,6 @@ func ComPareLocalWithVendors(localSku []*tGetStoresSkusInfoContainCategoryName,
|
||||
}
|
||||
localStoreSkus = append(localStoreSkus, skus)
|
||||
}
|
||||
globals.SugarLogger.Debug(localStoreSkus, vendorSkus)
|
||||
// 由于go语言中无法子定义struct比较规则 因此需要把数据提取出来进行处理
|
||||
// 进行比较处理 对两个slice 进行遍历 放到map中 以 skuID slice的形式进行存储 如果不存在则直接进行put操作 如果存在则进行比较类别,价格,以及上下架状态
|
||||
compareMap := make(map[int]*VendorStoreSkus)
|
||||
@@ -3584,7 +3555,6 @@ func ComPareLocalWithVendors(localSku []*tGetStoresSkusInfoContainCategoryName,
|
||||
for _, v := range compareMap {
|
||||
updateStoreSkus = append(updateStoreSkus, v)
|
||||
}
|
||||
globals.SugarLogger.Debug(updateStoreSkus)
|
||||
return updateStoreSkus
|
||||
}
|
||||
|
||||
@@ -5012,7 +4982,6 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
||||
if user != nil && err == nil {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "警告!门店爆品数量异常!", v)
|
||||
}
|
||||
globals.SugarLogger.Debugf("SendSeckillSkusCountMsg: [%v]", v)
|
||||
}
|
||||
for k, v := range marketMap {
|
||||
if operaterMap[k] != "" {
|
||||
@@ -5022,7 +4991,6 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
||||
if user != nil && err == nil {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "警告!门店爆品数量异常!", v)
|
||||
}
|
||||
globals.SugarLogger.Debugf("SendSeckillSkusCountMsg: [%v]", v)
|
||||
}
|
||||
}
|
||||
return result, err
|
||||
@@ -5908,7 +5876,6 @@ func GetStoreSkuAudit(ctx *jxcontext.Context, storeIDs, nameIDs, skuIDs, statuss
|
||||
}
|
||||
|
||||
func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo) (isAudit bool, err error) {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit storeIDs: %v", storeIDs)
|
||||
time.Sleep(time.Second / 5)
|
||||
db := dao.GetDB()
|
||||
for _, storeID := range storeIDs {
|
||||
@@ -5916,7 +5883,6 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
//扣点的门店改价不进审核
|
||||
if len(stores) > 0 {
|
||||
if stores[0].PayPercentage <= 50 || stores[0].StoreLevel == "E" || stores[0].StoreLevel == "D" {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return0 storeID : %v", storeID)
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
@@ -5925,12 +5891,10 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
storeAudits, err := dao.GetStoreSkuAuditLight(db, []int{storeID}, []int{skuBindInfo.NameID}, model.StoreAuditStatusOnline)
|
||||
//取消关注,可售排除
|
||||
if skuBindInfo.IsFocus == -1 || skuBindInfo.IsSale != 0 || skuBindInfo.UnitPrice == 0 {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return1 storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if ctx.GetLoginType() != weixin.AuthTypeMP && ctx.GetLoginType() != weixin.AuthTypeMini && ctx.GetLoginType() != weixin.AuthTypeWxApp && ctx.GetLoginType() != auth2.AuthTypeMobile {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return3 storeID : %v loginType: %v", storeID, ctx.GetLoginType())
|
||||
authInfo, err := ctx.GetV2AuthInfo()
|
||||
if err == nil && authInfo != nil && (ctx.GetFullUser().Type&model.UserTypeOperator) != 0 {
|
||||
if len(storeAudits) > 0 {
|
||||
@@ -5943,7 +5907,6 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
// }
|
||||
// }
|
||||
}
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return3 storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
@@ -5976,7 +5939,6 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
storeAudits[0].DeletedAt = time.Now()
|
||||
dao.UpdateEntity(db, storeAudits[0], "DeletedAt")
|
||||
}
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit cover storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
}
|
||||
} else {
|
||||
return false, fmt.Errorf("未查询到该门店商品价,storeID: %v, nameID: %v", storeID, skuBindInfo.NameID)
|
||||
@@ -5992,7 +5954,6 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
}
|
||||
|
||||
func doStoreSkuAuditForGy(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo) (isAudit bool, err error) {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAuditForGy storeIDs: %v", storeIDs)
|
||||
time.Sleep(time.Second / 5)
|
||||
db := dao.GetDB()
|
||||
for _, storeID := range storeIDs {
|
||||
@@ -6005,16 +5966,13 @@ func doStoreSkuAuditForGy(ctx *jxcontext.Context, storeIDs []int, skuBindInfos [
|
||||
// }
|
||||
// }
|
||||
for _, skuBindInfo := range skuBindInfos {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit storeID: %v , nameID: %v", storeID, skuBindInfo.NameID)
|
||||
storeAudits, err := dao.GetStoreSkuAuditLight(db, []int{storeID}, []int{skuBindInfo.NameID}, model.StoreAuditStatusOnline)
|
||||
//取消关注,可售排除
|
||||
if skuBindInfo.IsFocus == -1 || skuBindInfo.IsSale != 0 || skuBindInfo.UnitPrice == 0 {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return1 storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if ctx.GetLoginType() != weixin.AuthTypeMP && ctx.GetLoginType() != weixin.AuthTypeMini && ctx.GetLoginType() != weixin.AuthTypeWxApp && ctx.GetLoginType() != auth2.AuthTypeMobile {
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return3 storeID : %v loginType: %v", storeID, ctx.GetLoginType())
|
||||
authInfo, err := ctx.GetV2AuthInfo()
|
||||
if err == nil && authInfo != nil && (ctx.GetFullUser().Type&model.UserTypeOperator) != 0 {
|
||||
if len(storeAudits) > 0 {
|
||||
@@ -6045,7 +6003,6 @@ func doStoreSkuAuditForGy(ctx *jxcontext.Context, storeIDs []int, skuBindInfos [
|
||||
storeAudits[0].DeletedAt = time.Now()
|
||||
dao.UpdateEntity(db, storeAudits[0], "DeletedAt")
|
||||
}
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit cover storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
} else {
|
||||
return false, fmt.Errorf("未查询到该门店商品价,storeID: %v, nameID: %v", storeID, skuBindInfo.NameID)
|
||||
}
|
||||
|
||||
@@ -628,7 +628,6 @@ func CompareJxAndMultiVenderDepot(ctx *jxcontext.Context, vendorMap map[int]bool
|
||||
|
||||
func StoreOpenAll(ctx *jxcontext.Context) {
|
||||
AutoFocusStoreSkusForTopSkus(ctx, true, true)
|
||||
//globals.SugarLogger.Debug("StoreOpenAll skuID is start")
|
||||
///*获取美团门店信息*/
|
||||
//StoreInfoList, _ := api.MtpsAPI.GetStoreStatusAll()
|
||||
//StoreInfoList2 := make(map[string]string)
|
||||
@@ -913,8 +912,6 @@ func StoreOpenAll(ctx *jxcontext.Context) {
|
||||
// Map.DeliveryFeeDeductionFee = 0
|
||||
// Map.IsOrder = 0
|
||||
// if _, err := AddStoreVendorMap(ctx, db, 9, "", StoreList.ID, Map); err != nil {
|
||||
// globals.SugarLogger.Debugf("AddStoreVendorMap调用出错,StoreID是" + strconv.Itoa(StoreList.ID))
|
||||
// globals.SugarLogger.Debugf(err.Error())
|
||||
// }
|
||||
// }
|
||||
// /*改配送范围*/
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
type StoreManager struct {
|
||||
@@ -26,7 +25,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 {
|
||||
@@ -79,7 +77,6 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
||||
}
|
||||
}()
|
||||
if storeKV != nil {
|
||||
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeKV:%s", vendorStoreID, utils.Format4Output(storeKV, true))
|
||||
store := &model.Store{}
|
||||
store.ID = storeDetail.Store.ID
|
||||
if err = utils.CallFuncLogError(func() error {
|
||||
@@ -90,7 +87,6 @@ func (s *StoreManager) OnStoreStatusChanged(vendorStoreID string, vendorID int,
|
||||
}
|
||||
}
|
||||
if storeMapKV != nil {
|
||||
globals.SugarLogger.Debugf("OnStoreStatusChanged venvendorStoreID:%s, storeMapKV:%s", vendorStoreID, utils.Format4Output(storeMapKV, true))
|
||||
if err = utils.CallFuncLogError(func() error {
|
||||
_, err = dao.UpdateEntityLogically(db, &model.StoreMap{}, storeMapKV, model.AdminName, map[string]interface{}{
|
||||
model.FieldStoreID: storeDetail.Store.ID,
|
||||
@@ -146,6 +142,5 @@ func (s *StoreManager) OnCourierStoreStatusChanged(ctx *jxcontext.Context, vendo
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("OnCourierStoreStatusChanged vendorStoreID:%s, auditStatus:%d, err:%v", vendorStoreID, auditStatus, err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -608,7 +608,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)
|
||||
@@ -633,7 +632,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)
|
||||
@@ -656,7 +654,6 @@ func (v *VendorSync) AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, vendorID
|
||||
}
|
||||
|
||||
func (v *VendorSync) AmendAndPruneStoreStuff(ctx *jxcontext.Context, vendorIDs []int, storeIDs []int, isAsync, isContinueWhenError bool, optType int, isForceUpdate bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debug("AmendAndPruneStoreStuff")
|
||||
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)
|
||||
@@ -1219,7 +1216,6 @@ func SyncJdsStoreStock(ctx *jxcontext.Context, isAsync, isContinueWhenError bool
|
||||
}
|
||||
|
||||
func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
|
||||
globals.SugarLogger.Debugf("syncJdsStoresSkus")
|
||||
var (
|
||||
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
@@ -1347,8 +1343,6 @@ func SyncSkuExperfixAndWatermark(ctx *jxcontext.Context) (err error) {
|
||||
}
|
||||
|
||||
func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
globals.SugarLogger.Debug("SetMTPSStatus is start ")
|
||||
globals.SugarLogger.Debug("StoreId", "CourierStatus", storeId, courierStatus)
|
||||
/*获取美团门店信息*/
|
||||
//&& CourierStatus != 0
|
||||
if storeId != 0 {
|
||||
@@ -1432,7 +1426,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
{
|
||||
sl := make(map[string]interface{})
|
||||
sl["vendorStatus"] = 0
|
||||
globals.SugarLogger.Debug("因为没找到被修改配送状态的VendorStoreID是", ShopName, storeId)
|
||||
UpdateStoreCourierMap(ctx, nil, storeId, model.VendorIDMTPS, sl, ctx.GetUserName())
|
||||
return
|
||||
}
|
||||
@@ -1496,7 +1489,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
diff := false
|
||||
StoreLists, _ := dao.GetStoreList(db, []int{StoreCourierList1.StoreID}, nil, nil, nil, nil, "")
|
||||
if StoreLists == nil {
|
||||
globals.SugarLogger.Debugf("StoreID为:%s,在store表未找到", StoreCourierList1.StoreID)
|
||||
continue
|
||||
}
|
||||
if StoreCourierList1.VendorID != model.VendorIDMTPS || StoreCourierList1.VendorStoreID == "" {
|
||||
@@ -1511,7 +1503,6 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
MTPSInfo := new(mtpsapi.ShopInfo)
|
||||
MTPSInfo, _ = api.MtpsAPI.ShopQuery(StoreCourierList1.VendorStoreID)
|
||||
if MTPSInfo == nil {
|
||||
globals.SugarLogger.Debug("美团未找到该门店," + StoreLists[0].Name + strconv.Itoa(StoreCourierList1.StoreID) + " 被解绑,关联的ID为:" + StoreCourierList1.VendorStoreID)
|
||||
diff = true
|
||||
}
|
||||
if MTPSInfo != nil && MTPSInfo.ShopName == "" {
|
||||
@@ -1519,23 +1510,19 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
|
||||
}
|
||||
if MTPSInfo != nil && MTPSInfo.ShopLng != StoreCourierList1.Lng && MTPSInfo.ShopLat == StoreCourierList1.Lat {
|
||||
/*平台上但是坐标不同,解绑*/
|
||||
globals.SugarLogger.Debug("商店与美团配送上的坐标不同," + StoreLists[0].Name + strconv.Itoa(StoreCourierList1.StoreID) + " 被解绑,关联的ID为:" + StoreCourierList1.VendorStoreID)
|
||||
if _, err := DeleteStoreCourierMap(ctx, db, StoreCourierList1.StoreID, StoreCourierList1.VendorID, ctx.GetUserName()); err != nil {
|
||||
globals.SugarLogger.Debug(err.Error())
|
||||
return
|
||||
}
|
||||
diff = true
|
||||
}
|
||||
if diff {
|
||||
if _, err := DeleteStoreCourierMap(ctx, db, StoreCourierList1.StoreID, StoreCourierList1.VendorID, ctx.GetUserName()); err != nil {
|
||||
globals.SugarLogger.Debug(err.Error())
|
||||
return
|
||||
}
|
||||
//break test
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debug("SetMTPSStatus is Complete")
|
||||
}
|
||||
|
||||
func SetMTPSStatus2(storeID int) {
|
||||
|
||||
@@ -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)
|
||||
if err == nil && len(catList) > 0 {
|
||||
@@ -103,8 +102,6 @@ func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs
|
||||
needSyncParentIDs = append(needSyncParentIDs, cat.ParentID)
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("needSyncParentIDs needSyncParentIDsLen:%v", needSyncParentIDs)
|
||||
|
||||
if len(needSyncParentIDs) > 0 {
|
||||
task := tasksch.NewSeqTask(fmt.Sprintf("同步分类1:%v", catIDs), ctx,
|
||||
func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||
@@ -439,7 +436,6 @@ func SkuVendor2ThingMap(sku *dao.StoreSkuSyncInfo) (thingMap *model.ThingMap) {
|
||||
}
|
||||
|
||||
func OnThingSync(ctx *jxcontext.Context, db *dao.DaoDB, thingMap *model.ThingMap, syncErr error) (err error) {
|
||||
globals.SugarLogger.Debugf("OnThingSync thingMap:%s", utils.Format4Output(thingMap, true))
|
||||
if syncErr != nil {
|
||||
err = syncErr
|
||||
thingMap.Remark = utils.LimitUTF8StringLen(err.Error(), 255)
|
||||
|
||||
@@ -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() {
|
||||
@@ -70,7 +69,6 @@ func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int
|
||||
}
|
||||
|
||||
func SyncStoreCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
globals.SugarLogger.Debugf("SyncStoreCategories %s storeID:%d, %s, userName:%s", model.VendorChineseNames[vendorID], storeID, vendorStoreID, ctx.GetUserName())
|
||||
handler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
num := 0
|
||||
db := dao.GetDB()
|
||||
@@ -388,12 +386,6 @@ func sku2Update(vendorID int, sku *dao.StoreSkuSyncInfo, syncStatus int8) (item
|
||||
|
||||
func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyncInfo, syncStatus int8) (num int64, err error) {
|
||||
if len(storeSkuList) > 0 {
|
||||
// defer func() {
|
||||
// if r := recover(); r != nil {
|
||||
// globals.SugarLogger.Debugf("updateStoreSku panic, vendorID:%d, len:%d, storeID0:%d, skuID0:%d, syncStatus:%d", vendorID, len(storeSkuList), storeSkuList[0].StoreID, storeSkuList[0].SkuID, syncStatus)
|
||||
// panic(r)
|
||||
// }
|
||||
// }()
|
||||
if vendorID == model.VendorIDJDShop {
|
||||
if syncStatus != model.SyncFlagPriceMask && syncStatus != model.SyncFlagSaleMask && syncStatus != model.SyncFlagStockMask {
|
||||
for _, v := range storeSkuList {
|
||||
@@ -441,7 +433,6 @@ func isSkuLockTimeValid(sku *dao.StoreSkuSyncInfo) bool {
|
||||
}
|
||||
|
||||
func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag int, isFull bool, vendorID, storeID int, vendorOrgCode string, nameIDs, skuIDs, excludeSkuIDs []int, useVendorPriceDirectly, isContinueWhenError bool) (err error) {
|
||||
globals.SugarLogger.Debugf("syncStoreSkuNew causeFlag:%d ,vendorOrgCode:%s", causeFlag, vendorOrgCode)
|
||||
db := dao.GetDB()
|
||||
storeDetail, err := dao.GetStoreDetail(db, storeID, vendorID, vendorOrgCode)
|
||||
if err != nil {
|
||||
@@ -562,7 +553,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
// 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改
|
||||
if (model.IsSyncStatusUpdate(sku.SkuSyncStatus) || (model.IsSyncStatusSeq(sku.SkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil {
|
||||
if dao.IsVendorThingIDEmpty(sku.VendorCatID) && !strings.Contains(sku.StoreName, model.ExdStoreName) && vendorID != model.VendorIDYB {
|
||||
// globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d,但没有平台分类ID", storeID, sku.SkuID)
|
||||
} else {
|
||||
isAdded2Update = true
|
||||
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||
@@ -1113,8 +1104,6 @@ func AddCreateFlagForJxStoreSku(ctx *jxcontext.Context, parentTask tasksch.ITask
|
||||
}
|
||||
|
||||
func ClearRemoteStoreStuffAndSetNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID, storeID int, vendorStoreID string, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
userName := ctx.GetUserName()
|
||||
globals.SugarLogger.Debugf("ClearRemoteStoreStuffAndSetNew storeID:%d, isContinueWhenError:%t, userName:%s", storeID, isContinueWhenError, userName)
|
||||
handler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
if handler == nil {
|
||||
return "", fmt.Errorf("平台:%s不支持此操作", model.VendorChineseNames[vendorID])
|
||||
@@ -1272,7 +1261,6 @@ func parseStoreSkuActList(isCreateAct bool, storeSkuList []*partner.StoreSkuInfo
|
||||
}
|
||||
|
||||
func createStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo, isChangePrice bool) (err error) {
|
||||
globals.SugarLogger.Debugf("createStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
|
||||
skuIDs := putils.StoreSkuList2IDs(storeSkuList)
|
||||
db := dao.GetDB()
|
||||
storeSkuActList, err := dao.GetStoresSkusAct(db, 0, false, []int{storeID}, skuIDs, []int{vendorID}, false, 1, 0)
|
||||
@@ -1286,7 +1274,6 @@ func createStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendor
|
||||
}
|
||||
|
||||
func cancelStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo, isChangePrice bool) (err error) {
|
||||
globals.SugarLogger.Debugf("cancelStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
|
||||
skuIDs := putils.StoreSkuList2IDs(storeSkuList)
|
||||
db := dao.GetDB()
|
||||
storeSkuActList, err := dao.GetStoresSkusAct(db, 0, false, []int{storeID}, skuIDs, []int{vendorID}, true, 0, 0)
|
||||
@@ -1301,7 +1288,6 @@ func cancelStoreSkuActs(ctx *jxcontext.Context, parentTask tasksch.ITask, vendor
|
||||
|
||||
func createStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string,
|
||||
storeSkuList []*partner.StoreSkuInfo, storeSkuActList []*model.StoreSkuAct) (err error) {
|
||||
globals.SugarLogger.Debugf("createStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
|
||||
storeSkuList2, storeSkuActMap := parseStoreSkuActList(true, storeSkuList, storeSkuActList)
|
||||
if len(storeSkuList2) > 0 {
|
||||
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
|
||||
@@ -1323,7 +1309,6 @@ func createStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
|
||||
|
||||
func cancelStoreSkuActs2(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorID int, vendorOrgCode string, storeID int, vendorStoreID string,
|
||||
storeSkuList []*partner.StoreSkuInfo, storeSkuActList []*model.StoreSkuAct) (err error) {
|
||||
globals.SugarLogger.Debugf("cancelStoreSkuActs vendorID:%d, storeID:%d, storeSkuList:%s", vendorID, storeID, utils.Format4Output(storeSkuList, true))
|
||||
storeSkuList2, storeSkuActMap := parseStoreSkuActList(false, storeSkuList, storeSkuActList)
|
||||
if len(storeSkuList2) > 0 {
|
||||
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
|
||||
|
||||
@@ -159,7 +159,6 @@ func SyncStoreSku4FakeJD(ctx *jxcontext.Context, parentTask tasksch.ITask, store
|
||||
task := tasksch.NewParallelTask("SyncStoreSku4FakeJD", 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("step:%d", step)
|
||||
switch step {
|
||||
case 0:
|
||||
for k, list := range [][]*partner.StoreSkuInfo{stockList /*, onlineList*/} {
|
||||
@@ -299,7 +298,7 @@ func UploadFakeJdThingMap(ctx *jxcontext.Context, reader io.Reader, isSyncNow, i
|
||||
}
|
||||
|
||||
db := dao.GetDB()
|
||||
txDB , _ := dao.Begin(db)
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
|
||||
@@ -18,7 +18,6 @@ package cms
|
||||
// WHERE t1.parentid = -1 AND t1.jxstoreid = ?
|
||||
// GROUP BY 1,2,3,4,5,6,7;
|
||||
// `
|
||||
// // globals.SugarLogger.Debug(sql)
|
||||
// if err = dao.GetRows(nil, &storeUserInfos, sql, storeID); err == nil {
|
||||
// for _, storeUserInfo := range storeUserInfos {
|
||||
// if storeUserInfo.MembersStr != "" {
|
||||
@@ -45,7 +44,6 @@ package cms
|
||||
// return nil, auth.ErrIllegalLoginType
|
||||
// }
|
||||
// storeUserInfo, err = dao.GetUserStoreInfo(dao.GetDB(), fieldName, loginInfo.GetAuthID())
|
||||
// globals.SugarLogger.Debugf("GetSelfInfo:%s, token:%s, storeUserInfo:%s, err:%v", ctx.GetTrackInfo(), ctx.GetToken(), utils.Format4Output(storeUserInfo, true), err)
|
||||
// return storeUserInfo, err
|
||||
// }
|
||||
|
||||
@@ -116,7 +114,6 @@ package cms
|
||||
// parentUser.Tel = parentMobile
|
||||
// if err = dao.GetEntity(db, parentUser, "Tel"); err == nil {
|
||||
// if parentUser.ParentID == -1 {
|
||||
// globals.SugarLogger.Debug(parentUser)
|
||||
// if err = verifyMobileHasNoMembers(db, mobile); err == nil {
|
||||
// user, err2 := verifyMobileIsBlank(db, mobile)
|
||||
// if err = err2; err == nil || err == orm.ErrNoRows {
|
||||
|
||||
@@ -193,7 +193,6 @@ func RegisterUserWithMobile(ctx *jxcontext.Context, user *model.User, mobileVeri
|
||||
|
||||
// auth2.RemoveUserInfo(mobileAuth.Token)
|
||||
// if newAuthInfo, err := auth2.BindUser(mobileAuth, user); err == nil {
|
||||
// globals.SugarLogger.Debugf("testRegisterUserWithMobile", utils.Format4Output(mobileAuth, false), utils.Format4Output(newAuthInfo, false))
|
||||
// return nil, jsonerr.New(newAuthInfo, model.ErrCodeJsonUserAlreadyExist)
|
||||
// } else {
|
||||
// return nil, err
|
||||
|
||||
Reference in New Issue
Block a user