This commit is contained in:
邹宗楠
2023-04-03 09:22:09 +08:00
parent b18fca48fa
commit afcee6fe38
18 changed files with 2 additions and 32 deletions

View File

@@ -5,7 +5,6 @@ import (
"encoding/base64"
"encoding/json"
"errors"
"git.rosy.net.cn/jx-callback/globals"
"regexp"
"strings"
"time"
@@ -286,7 +285,6 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
//如果是小程序
if authType == AuthTypeWXMini { // || authType == AuthTypeWXApp 此处AuthTypeWXApp没用上
appID := strings.Split(authSecret, ",")[0]
globals.SugarLogger.Debugf("authSecret=%s,appID=%s", authSecret, appID)
// 菜市商家 // // // 京西商城
if appID == model.JXC4BusinessAppId || appID == "wx2d6949f724b2541d" || appID == "wx18111a41fd17f24f" || appID == model.JXC4AppId { //菜市或者果园
if authInfo.AuthBindInfo.UserID != "" {

View File

@@ -148,7 +148,6 @@ func AutoSettingFakeDelivery() {
break
}
for riderName, riderPhone := range riderListInfo[riderKey][randTime] {
globals.SugarLogger.Debugf("SelfDeliveringAndUpdateStatus : %s", v.VendorOrderID)
if err := defsch.FixedScheduler.SelfDeliveringAndUpdateStatus(jxcontext.AdminCtx, v.VendorOrderID, v.VendorID, jxcontext.AdminCtx.GetUserName(), riderName, riderPhone); err != nil {
globals.SugarLogger.Errorf("自动发货错误:[%v]", err)
break

View File

@@ -66,7 +66,6 @@ func notifyWxNewFakeJdOrder(order *model.GoodsOrder, storeID int) (err error) {
}
title := fmt.Sprintf("你有到家菜市新订单%d", order.OrderSeq)
content := sb.String()
// globals.SugarLogger.Debugf("notifyWxNewFakeJdOrder, orderID:%s, content:%s", order.VendorOrderID, content)
_, err = weixinmsg.SendStoreMessage(jxcontext.AdminCtx, title, content, []int{storeID}, nil, "", model.MessageTypeStore, true, true)
return err
}

View File

@@ -99,7 +99,7 @@ func (c *BaseScheduler) PickupGoodsAndUpdateStatus(ctx *jxcontext.Context, vendo
err = c.PickupGoods(order, flag, userName)
if err == nil {
order.Status = model.OrderStatusFinishedPickup
if err = partner.CurOrderManager.UpdateOrderStatusAndDeliveryFlag(order); err == nil {
if err = partner.CurOrderManager.UpdateOrderStatusAndDeliveryFlag(order); err != nil {
return err
}
}

View File

@@ -943,7 +943,6 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
} else {
sqlWhere += " AND IF(t1.jx_store_id != 0, t1.jx_store_id, t1.store_id) IN (" + GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
//globals.SugarLogger.Debugf("sqlParams storeIDs========%d", storeIDs)
}
}
}

View File

@@ -152,7 +152,6 @@ func GetMsg(ctx *jxcontext.Context, storeID int, lastOrderTime time.Time, lastOr
}
close(chan2Listen)
} else {
globals.SugarLogger.Debugf("GetMsg vendorOrderIDs:%s", utils.Format4Output(vendorOrderIDs, true))
msg.MsgData = len(vendorOrderIDs)
}
storeMap, _ := permission.GetUserStoresResultMap(ctx.GetUserID())
@@ -215,7 +214,6 @@ func OnNewWait4ApproveAfsOrder(order *model.AfsOrder) {
}
func OnKeyAfsOrderStatusChanged(order *model.AfsOrder) {
globals.SugarLogger.Debugf("msghub OnKeyAfsOrderStatusChanged, order:%s", utils.Format4Output(order, true))
utils.CallFuncAsync(func() {
msgChan <- &ServerMsg{
Type: ServerMsgKeyAfsOrderStatusChanged,

View File

@@ -199,7 +199,6 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
}
}()
for _, v := range shopList {
globals.SugarLogger.Debugf("GetAndStoreCitiesShops cityCode:%d, 平台:%s, shopID:%s, districtCode:%d", cityCode, model.VendorChineseNames[v.VendorID], v.VendorStoreID, v.DistrictCode)
if v.DistrictCode > 0 {
tmpShop := *v
dao.DeleteEntity(db, &tmpShop, model.FieldVendorStoreID, model.FieldVendorID)

View File

@@ -29,7 +29,6 @@ func CallCreateWaybillPolicy(deliveryFee, maxDeliveryFee int64, order *model.Goo
if deliveryFee > maxDeliveryFee {
errStr := fmt.Sprintf("超最高限价, 所需运费:%s, 最高限价:%s", jxutils.IntPrice2StandardCurrencyString(deliveryFee), jxutils.IntPrice2StandardCurrencyString(maxDeliveryFee))
err = fmt.Errorf(errStr)
globals.SugarLogger.Debugf("CallCreateWaybillPolicy orderID:%s, 平台:%s运单创建出错:%s", order.VendorOrderID, model.VendorChineseNames[waybillVendorID], errStr)
}
return err
}

View File

@@ -34,7 +34,6 @@ func (c *PrinterHandler) GetVendorID() int {
func (c *PrinterHandler) PrintMsg(ctx *jxcontext.Context, sn, copies, voiceType, msgContent string) (printerStatus *partner.PrinterStatus, err error) {
if sn != "" {
if globals.EnableStoreWrite {
globals.SugarLogger.Debugf("printMsg voiceType====%s", voiceType)
printOrderID, err1 := api.XpyunAPI.Print(&xpyunapi.PrintRequest{
Sn: sn,
Content: msgContent,
@@ -100,9 +99,7 @@ func (c *PrinterHandler) RebindPrinter(ctx *jxcontext.Context, lastBindResult *p
}
func (c *PrinterHandler) PrintOrder(ctx *jxcontext.Context, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder, printType string, asfOrder *model.AfsOrder) (printerStatus *partner.PrinterStatus, err error) {
globals.SugarLogger.Debugf("打印order参数%s", utils.Format4Output(order, false))
if len(order.Skus) == 0 {
globals.SugarLogger.Debugf("order.sku为空")
return
}
content := ""
@@ -143,7 +140,6 @@ func (c *PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printT
} else {
content = c.getCancelOrRefundOrderContentBig(order, printType, storeDetail)
}
globals.SugarLogger.Debugf("PrintCancelOrRefundOrder content=====%s", content)
if content == "" {
return nil, nil
}

View File

@@ -270,7 +270,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
if err == nil {
if shopID > 0 {
err = p.UpdateStoreCustomID(jxcontext.AdminCtx, "", store.VendorStoreID, int64(shopID))
globals.SugarLogger.Debugf("UpdateStore store.VendorStoreID====%s,shopID====%s", store.VendorStoreID, shopID)
} else if shopID == 0 {
// todo remove out shop id
}
@@ -346,7 +345,6 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
fBaiduIDs, fShopIDs, err1 := FilterStoreRel(baiduShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID FilterStoreRel fBaiduIDs====%d fShopIDs====%d err====%v", fBaiduIDs, fShopIDs, err1)
err = api.EbaiAPI.ShopIDBatchUpdate(fBaiduIDs, fShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID baiduShopIDs====%s,shopIDs====%s", baiduShopIDs, shopIDs)
}
return nil, err
}, stores)
@@ -373,7 +371,6 @@ func FilterStoreRel(baiduShopIDs []string) (fBaiduShopIDs []string, fShopIDs []s
return nil, nil, err
}
localRel, err := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), k, model.VendorIDEBAI, "")
globals.SugarLogger.Debugf("get localRel err===%v", err)
if remoteRel.ShopID != utils.Int2Str(localRel.ID) {
fBaiduShopIDs = append(fBaiduShopIDs, k)
fShopIDs = append(fShopIDs, utils.Int2Str(localRel.ID))
@@ -673,7 +670,6 @@ func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgC
if err1 != nil {
globals.SugarLogger.Debugf("UpdateStoreCustomID err1====%v", err1)
}
globals.SugarLogger.Debugf("UpdateStoreCustomID fBaiduIDs====%s fShopIDs====%d err1", fBaiduIDs, fShopIDs)
err = api.EbaiAPI.ShopIDBatchUpdate(fBaiduIDs, fShopIDs)
//err = api.EbaiAPI.ShopIDBatchUpdate([]string{vendorStoreID}, []string{utils.Int64ToStr(storeID)})
}

View File

@@ -108,10 +108,6 @@ func (p *PurchaseHandler) DeleteCategory2(ctx *jxcontext.Context, vendorOrgCode,
func (p *PurchaseHandler) ReorderCategories2(ctx *jxcontext.Context, vendorOrgCode, vendorParentCatID string, vendorCatIDList []string) (err error) {
if globals.EnableJdStoreWrite {
err = getAPI(vendorOrgCode).ChangeShopCategoryOrder(utils.Str2Int64WithDefault(vendorParentCatID, 0), utils.StringSlice2Int64(vendorCatIDList))
globals.SugarLogger.Debugf("vendorInfo.vendorOrgCode=== %s", vendorOrgCode)
globals.SugarLogger.Debugf("vendorInfo.vendorParentCatID=== %s", vendorParentCatID)
globals.SugarLogger.Debugf("vendorInfo.vendorCatIDList=== %s", vendorCatIDList)
globals.SugarLogger.Debugf("ReorderCategories2 === %v", err)
}
return err
}

View File

@@ -297,7 +297,6 @@ func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, v
}
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
globals.SugarLogger.Debugf("是不是正儿八经的京东商城%s", "UpdateStoreSkus")
if globals.EnableJdShopWrite && vendorStoreID == model.JdShopMainVendorStoreID {
if vendorStoreID == model.JdShopMainVendorStoreID {
for _, v := range storeSkuList {

View File

@@ -252,7 +252,6 @@ func CreateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64,
outJxOrder.OrderID = jxutils.GenOrderNo()
}
order, err2 := jxOrder2GoodsOrder(ctx, outJxOrder, deliveryAddress, "", IsDeliverySelf, couponIDs)
globals.SugarLogger.Debugf("order order %s", utils.Format4Output(order, false))
if err = err2; err == nil {
order.AddressID = addressID
@@ -839,7 +838,7 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
if jxOrder.OrderType != model.OrderTypeMatter || (jxOrder.OrderType == model.OrderTypeMatter && fromStoreID == -1) {
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice
} else { //以下else为物料订单袋子金额和数量处理
} else { //以下else为物料订单袋子金额和数量处理
if !result.Flag { //只要flag是false就按原价申请是true再按订单量
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice

View File

@@ -28,7 +28,6 @@ const (
func OnOrderMsg(msgId string, msg interface{}) (response *tiktokShop.CallbackResponse) {
if CurPurchaseHandler != nil {
orderId, shopId, _ := api.TiktokStore.GetCallbackOrderId(msgId, msg)
globals.SugarLogger.Debugf("order_id %s,%d", orderId, shopId)
orderDetail, err := GetTiktokApi(utils.Int64ToStr(shopId), 0, "").GetTiktokOrderDetail(orderId)
if err != nil {
return tiktokShop.Err2CallbackResponse(err, "")
@@ -78,7 +77,6 @@ func HttpToGuoYuan(param map[string]interface{}, requestType string) (*http.Resp
}
}
body := strings.NewReader(string(paramData))
globals.SugarLogger.Debugf("HttpToGuoYuan paramData====%s", utils.Format4Output(paramData, false))
url := ""
switch requestType {
case CaiShiPushGyTagOrder: // 订单相关

View File

@@ -192,7 +192,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
// 预订单还是快速达
localStore, err := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreIdRelly, model.VendorIDDD, vendorOrgCode)
if err != nil || localStore == nil || localStore.ID == 0 {
globals.SugarLogger.Debugf("平台门店未绑定到京西系统 %s", err.Error())
return nil, nil, err
}

View File

@@ -494,7 +494,6 @@ func CreateFreightTemplate(storeCode, deliveryFeeDeductionSill int) (int64, erro
//},
//}
}
globals.SugarLogger.Debugf("CreateFreightTemplate 直辖市code====%d", param.Template.ProductCity)
if deliveryFeeDeductionSill != 0 {
param.Template.TemplateName += "满减包邮模板"
param.Columns = []freightTemplate_create_request.ColumnsItem{{
@@ -601,7 +600,6 @@ func CreateBindFreeShipTemplate(vendorOrgCode string, storeID int, shipFee int64
} else {
param.Template.ProductCity = int64(storeDetail.CityCode)
}
globals.SugarLogger.Debugf("CreateBindFreeShipTemplate 直辖市code=%d", param.Template.ProductCity)
if resp, err := getAPI(vendorOrgCode, 0, "").FreightTemplateCreate(param); err != nil {
return errors.New(fmt.Sprintf("平台门店(%s) 京西门店(%d) 创建包邮模板失败:%v,根据提示处理", storeDetail.VendorStoreID, storeID, err))
} else {

View File

@@ -498,7 +498,6 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
}
func getTiktokBrandId(api *tiktokShop.API, db *dao.DaoDB, upc, upcBrandName, upcTiktokBrandId string, categoryLeafId int64) (int64, error) {
globals.SugarLogger.Debugf("upc:%s,upcBrandName:%s,upcTiktokBrandId:%s,categoryLeafId:%d", upc, upcBrandName, upcTiktokBrandId, categoryLeafId)
if upc == "" { // 默认品牌京西菜市 596120136
return 596120136, nil
} else if upc != "" && upcBrandName != "" && upcTiktokBrandId != "" {

View File

@@ -275,7 +275,6 @@ func (p *PurchaseHandler) setStoreOrderSeq(order *model.GoodsOrder) {
db := dao.GetDB()
if err := dao.GetRow(db, &count, sql, order.StoreID, dateBegin, model.VendorIDWSC); err == nil {
order.OrderSeq = count + 1
globals.SugarLogger.Debugf("setStoreOrderSeq orderID:%s, dateBegin:%s, orderSeq:%d", order.VendorOrderID, utils.Time2Str(dateBegin), order.OrderSeq)
} else {
globals.SugarLogger.Errorf("setStoreOrderSeq orderID:%s failed with error:%v", order.VendorOrderID, err)
}