删除日志
This commit is contained in:
@@ -154,7 +154,6 @@ func getActStoreSkuFromTaskResult(taskReslt []interface{}) (list []*model.ActSto
|
||||
}
|
||||
|
||||
func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (createdList []*model.ActStoreSku2, err error) {
|
||||
globals.SugarLogger.Debugf("mtwm createSkuAct")
|
||||
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
||||
task := tasksch.NewParallelTask("mtwm createSkuAct", nil, ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
@@ -181,7 +180,6 @@ func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.A
|
||||
}
|
||||
|
||||
func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (canceledList []*model.ActStoreSku2, err error) {
|
||||
globals.SugarLogger.Debugf("mtwm cancelSkuAct")
|
||||
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
||||
task := tasksch.NewParallelTask("mtwm cancelSkuAct", nil, ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
@@ -197,7 +195,6 @@ func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.A
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actOrderRules []*model.ActOrderRule, actStoreSkuList []*model.ActStoreSku2) (err error) {
|
||||
globals.SugarLogger.Debugf("mtwm SyncAct, actID:%d", act.ID)
|
||||
var actStoreSkuList4Create, actStoreSkuList4Delete []*model.ActStoreSku2
|
||||
var updateItems []*dao.KVUpdateItem
|
||||
|
||||
@@ -225,7 +222,6 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
|
||||
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagNewMask))
|
||||
}
|
||||
} else if model.IsSyncStatusUpdate(act.SyncStatus) {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(updateItems, false))
|
||||
if len(actStoreSkuList4Create) > 0 {
|
||||
addedList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
|
||||
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, addedList, model.SyncFlagNewMask)...)
|
||||
|
||||
@@ -27,11 +27,9 @@ func OnFinancialMsg(msg *mtwmapi.CallbackMsg) (err error) {
|
||||
if msg.Cmd == mtwmapi.MsgTypeOrderRefund { // todo 全额退款处理
|
||||
orderData := msg.FormData
|
||||
if orderData.Get("notify_type") == mtwmapi.NotifyTypeSuccess {
|
||||
globals.SugarLogger.Debug(orderData.Get("order_id")) // 获得退款订单ID,去本地数据库拿?饿百消息推送只给了订单号,也没有通过订单号查询退款信息的接口
|
||||
afsOrderID := orderData.Get("order_id")
|
||||
orderFinancial, err := partner.CurOrderManager.LoadOrderFinancial(afsOrderID, model.VendorIDMTWM)
|
||||
if err == nil {
|
||||
globals.SugarLogger.Debug(utils.Format4Output(orderFinancial, false))
|
||||
err = partner.CurOrderManager.SaveAfsOrderFinancialInfo(CurPurchaseHandler.OrderFinancialDetail2Refund(orderFinancial, orderData))
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("mtwm OnFinancialMsg, afsOrderID:%s is not found from partner.CurOrderManager.LoadOrderFinancial", afsOrderID)
|
||||
@@ -54,13 +52,11 @@ func (p *PurchaseHandler) OrderFinancialDetail2Refund(orderFinancial *model.Orde
|
||||
PmSubsidyMoney: orderFinancial.PmSubsidyMoney,
|
||||
}
|
||||
order, err := partner.CurOrderManager.LoadOrder(afsOrder.VendorOrderID, afsOrder.VendorID)
|
||||
globals.SugarLogger.Debug(utils.Format4Output(order, false))
|
||||
if err == nil {
|
||||
afsOrder.JxStoreID = order.JxStoreID
|
||||
afsOrder.VendorStoreID = order.VendorStoreID
|
||||
afsOrder.StoreID = order.StoreID
|
||||
} else {
|
||||
globals.SugarLogger.Warnf("mtwm AfsOrderDetail2Financial, afsOrderID:%s is not found from partner.CurOrderManager.LoadOrder", afsOrder.VendorOrderID)
|
||||
err = nil
|
||||
}
|
||||
for _, sku := range orderFinancial.Skus {
|
||||
@@ -99,7 +95,6 @@ func (p *PurchaseHandler) AfsOrderDetail2Financial(orderData url.Values) (afsOrd
|
||||
// if orderData.Get("timestamp") != "" {
|
||||
// afsOrder.AfsCreateAt = utils.Timestamp2Time(utils.Str2Int64(orderData.Get("timestamp")))
|
||||
// } else {
|
||||
// globals.SugarLogger.Warnf("ebai OrderFinancialDetail2Refund timestamp is not found in afsOrder:%s", afsOrder.AfsOrderID)
|
||||
// afsOrder.AfsCreateAt = time.Now()
|
||||
// }
|
||||
order, err := partner.CurOrderManager.LoadOrder(afsOrder.VendorOrderID, afsOrder.VendorID)
|
||||
|
||||
@@ -166,7 +166,6 @@ func skuStatusJX2Tiktok(status int) int {
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) UploadImg(ctx *jxcontext.Context, vendorOrgCode, imgURL string, imgData []byte, imgName string, imgType int) (imgHint string, err error) {
|
||||
globals.SugarLogger.Debugf("mtwm UploadImg imgURL:%s, imgName:%s", imgURL, imgName)
|
||||
poiCode4UploadImg := p.getUploadImgPoiCode()
|
||||
if poiCode4UploadImg == "" {
|
||||
return "", fmt.Errorf("找不到一个美团门店来上传图片")
|
||||
|
||||
@@ -82,7 +82,6 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode, vendorOrderID, vendorStoreID s
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("======orderDetail:%s", utils.Format4Output(result, false))
|
||||
orderMap = result
|
||||
order = &model.GoodsOrder{
|
||||
VendorOrderID: result.OrderId,
|
||||
@@ -268,7 +267,6 @@ func (c *PurchaseHandler) onOrderMsg(msgId, orderId string, msg interface{}) (re
|
||||
// if _, err := partner.CurOrderManager.LoadOrder(orderId, model.VendorIDDD); err != nil && strings.Contains(err.Error(), "找不到相应订单") {
|
||||
// return tiktokShop.Err2CallbackResponse(nil, "")
|
||||
// } else {
|
||||
// globals.SugarLogger.Debugf("Cancel Order Err : %s", err)
|
||||
// return tiktokShop.Err2CallbackResponse(err, "")
|
||||
// }
|
||||
//}
|
||||
@@ -286,10 +284,6 @@ func (c *PurchaseHandler) onOrderMsg(msgId, orderId string, msg interface{}) (re
|
||||
if err != nil {
|
||||
return tiktokShop.Err2CallbackResponse(err, "")
|
||||
}
|
||||
globals.SugarLogger.Debugf("回调创建新订单=order==%s", utils.Format4Output(order, false))
|
||||
globals.SugarLogger.Debugf("回调创建新订单=status==%s", utils.Format4Output(status, false))
|
||||
|
||||
//status2, _ := c.callbackMsg2Status(msgId, orderId, msg)
|
||||
if err := partner.CurOrderManager.OnOrderNew(order, status); err != nil {
|
||||
return tiktokShop.Err2CallbackResponse(err, "")
|
||||
}
|
||||
@@ -609,7 +603,6 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
|
||||
|
||||
// SelfDeliverDelivered 自配搜完成(暂无)
|
||||
func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
||||
//globals.SugarLogger.Debugf("mtwm SelfDeliverDelivered orderID:%s", order.VendorOrderID)
|
||||
//if globals.EnableMtwmStoreWrite {
|
||||
// err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").OrderArrived(utils.Str2Int64(order.VendorOrderID))
|
||||
//}
|
||||
|
||||
@@ -7,7 +7,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"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -68,7 +67,6 @@ func (c *PurchaseHandler) onAfsOrderMsg(msgId string, msg interface{}) (retVal *
|
||||
// 查询售后订单详情
|
||||
tiktokAfsOrderDetail, err := getAPI(utils.Int2Str(venderOrgCode), 0, "").QueryAfsOrderDetail(orderStatus.VendorOrderID, false)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("tic-tok get AfsOrder err :", err)
|
||||
return tiktokShop.Err2CallbackResponse(err, "")
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,6 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
}
|
||||
storeIDs = utils.Int64ToStr(v.Store.StoreId)
|
||||
}
|
||||
globals.SugarLogger.Debug("Success createStore and return storeID=====", resp.ResultList[0].Store.StoreId, utils.Str2Int(storeIDs))
|
||||
if utils.Str2Int(storeIDs) == 0 {
|
||||
return "", errors.New(fmt.Sprintf("创建店铺失败,storeIDs = 0:%v,%v", err, resp.ResultList[0].Msg))
|
||||
}
|
||||
@@ -197,14 +196,12 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
if err = dao.CreateEntity(db, FreightTemplate); err != nil {
|
||||
errList.AddErr(fmt.Errorf("db update storeID,vendorStoreID defeat on :%v", err))
|
||||
}
|
||||
globals.SugarLogger.Debugf("CreateStore last step success..................but errList====%s", utils.Format4Output(errList, true))
|
||||
return storeIDs, errors.New(fmt.Sprintf("%s", utils.Format4Output(errList, true)))
|
||||
}
|
||||
}
|
||||
|
||||
// shop/editStore 编辑门店信息 正向推送平台
|
||||
func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName string) (err error) {
|
||||
globals.SugarLogger.Debugf("doudian Update storeID:%d, userName:%s", storeID, userName)
|
||||
var (
|
||||
storeInfo *dao.StoreDetail
|
||||
name string
|
||||
|
||||
@@ -155,7 +155,6 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in
|
||||
//}
|
||||
//catName = utils.FilterEmoji(catName)
|
||||
//subCatName = utils.FilterEmoji(subCatName)
|
||||
//globals.SugarLogger.Debugf("mtwm CreateStoreCategory vendorStoreID:%s, originName:%s, catCode:%d, catName:%s, subCatCode:%d, subCatName:%s, seq:%d",
|
||||
// vendorStoreID, originName, catCode, catName, subCatCode, subCatName, storeCat.Seq)
|
||||
//if globals.EnableMtwmStoreWrite {
|
||||
// // err = api.MtwmAPI.RetailCatUpdate2(vendorStoreID, tryCatName2Code(originName), originName, catCode2Str(catCode), catName, catCode2Str(subCatCode), subCatName, storeCat.Seq)
|
||||
@@ -373,8 +372,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
|
||||
param.StoreId = utils.Str2Int64(vendorStoreID)
|
||||
// 抖店创建子商品
|
||||
globals.SugarLogger.Debugf("本地子商品详情============%s,", utils.Format4Output(param, false))
|
||||
|
||||
tiktokResultChildren, err := api.CreateStoreCommodity(param)
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
@@ -445,7 +442,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
// storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
||||
// continue
|
||||
//}
|
||||
//globals.SugarLogger.Debugf("tiktokResult main ===%s", utils.Format4Output(tiktokResult, false))
|
||||
|
||||
// 创建子商品
|
||||
//param.FreightId = freightId
|
||||
@@ -453,7 +449,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
//param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, tiktokResult.ProductId, storeSku)
|
||||
// 获取门店限售模板
|
||||
//saleLimitId, err := CreateSaleTemp(utils.Str2Int64(vendorStoreID), api)
|
||||
//globals.SugarLogger.Debug("==22213123131231231", saleLimitId)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
@@ -673,7 +668,6 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
|
||||
|
||||
func vendorSku2Jx(tiktokSku *product_detail_response.ProductDetailData) (skuName *partner.SkuNameInfo) {
|
||||
if len(tiktokSku.SpecPrices) == 0 {
|
||||
globals.SugarLogger.Warnf("vendorSku2Jx, strange tiktokSku:%s", utils.Format4Output(tiktokSku, true))
|
||||
return nil
|
||||
}
|
||||
prefix, name, comment, specUnit, unit, specQuality := jxutils.SplitSkuName(tiktokSku.Name)
|
||||
|
||||
Reference in New Issue
Block a user