删除日志

This commit is contained in:
邹宗楠
2022-10-24 11:22:38 +08:00
parent 5a47102894
commit 5d6a5a3226
139 changed files with 17 additions and 787 deletions

View File

@@ -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
@@ -738,7 +736,6 @@ func filterStoreByOrderInfo(db *dao.DaoDB, inStores []*StoreExt, orderTimeFrom,
}
func getMapCenter(storeList []*StoreExt) (lng, lat float64) {
globals.SugarLogger.Debugf("getMapCenter len(storeList):%d", len(storeList))
if len(storeList) == 0 {
return 0, 0
}
@@ -774,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)
@@ -869,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
}
@@ -916,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
@@ -981,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))
@@ -1075,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)
@@ -1099,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"])})
@@ -1209,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
}
@@ -1317,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
}
@@ -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))