Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -2004,7 +2004,9 @@ func RrefreshMtwmVendorAct(ctx *jxcontext.Context) (err error) {
|
||||
storeMap := batchItemList[0].(*model.StoreMap)
|
||||
mtapi := mtwm.GetAPI(storeMap.VendorOrgCode, storeMap.StoreID, "")
|
||||
for k, v := range actTypeMap {
|
||||
if actList, _ := mtapi.RetailDiscountList(storeMap.VendorStoreID, k); len(actList) > 0 {
|
||||
// 查询所有美团门店的折扣和爆款商品
|
||||
actList, _ := mtapi.RetailDiscountList(storeMap.VendorStoreID, k)
|
||||
if len(actList) > 0 {
|
||||
for _, act := range actList {
|
||||
if act.Status > 0 {
|
||||
if checkActStoreSkuExist(db, storeMap.StoreID, utils.Str2Int(act.AppFoodCode), model.VendorIDMTWM, utils.Timestamp2Time(act.StartTime), utils.Timestamp2Time(act.EndTime)) {
|
||||
@@ -2031,6 +2033,26 @@ func RrefreshMtwmVendorAct(ctx *jxcontext.Context) (err error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 查询门店爆款商品,当门店存在爆款时,取消之前的力荐商品,将新的爆款设置为力荐商品
|
||||
//if k == mtwmapi.RetailActTypeSecKill && len(actList) > 0 {
|
||||
// allActivityList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
|
||||
// activationActivityList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
|
||||
// for _, ac := range actList {
|
||||
// allActivityList = append(allActivityList, utils.Int64ToStr(ac.ItemID))
|
||||
// if ac.Status == 1 {
|
||||
// activationActivityList = append(activationActivityList, utils.Int64ToStr(ac.ItemID))
|
||||
// }
|
||||
// }
|
||||
// // 取消当前力荐商品
|
||||
// mtapi.RetailDiscountDelete2(storeMap.VendorStoreID, k)
|
||||
// // 重新推荐力荐商品
|
||||
// partner.GetPurchasePlatformFromVendorID(storeMap.VendorID).(partner.ISingleStoreStoreSkuHandler).UpdateStoreSkus()
|
||||
//}
|
||||
//
|
||||
//// 门店爆款活动商品为0,则取消真在力荐的商品
|
||||
//if k == mtwmapi.RetailActTypeSecKill && len(actList) == 0 {
|
||||
//
|
||||
//}
|
||||
}
|
||||
return retVal, err
|
||||
}, storeMaps)
|
||||
|
||||
@@ -1168,10 +1168,10 @@ func getCategoryByImg(img ...string) string {
|
||||
}
|
||||
|
||||
// 根据平台返回的分类id,获取本地绑定的映射分类id
|
||||
func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID string) (string, string, string) {
|
||||
func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID string, jxCategoryId int) (string, string, string, int) {
|
||||
cats, err := dao.GetCategoriesByName(dao.GetDB(), "", jdCategoryId)
|
||||
if len(cats) == 0 || err != nil {
|
||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID
|
||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, 0
|
||||
} else {
|
||||
if jdsCategoryID == "" && cats[0].JdsCategoryID != 0 {
|
||||
jdsCategoryID = utils.Int64ToStr(cats[0].JdsCategoryID)
|
||||
@@ -1182,8 +1182,11 @@ func getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCa
|
||||
if mtwmCategoryID == "" && cats[0].MtwmCategoryID != 0 {
|
||||
mtwmCategoryID = utils.Int64ToStr(cats[0].MtwmCategoryID)
|
||||
}
|
||||
if jxCategoryId == 0 {
|
||||
jxCategoryId = cats[0].ID
|
||||
}
|
||||
}
|
||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID
|
||||
return jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryId
|
||||
}
|
||||
|
||||
func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, nameID int, payload map[string]interface{}, skuNameExt *model.SkuNameExt, isDelete bool) (flag bool) {
|
||||
@@ -1220,6 +1223,7 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
||||
ebaiCategoryID := ""
|
||||
mtwmCategoryID := ""
|
||||
ddCategoryID := ""
|
||||
jxCategoryID := 0
|
||||
if skuNameExt != nil {
|
||||
if skuNameExt.JdCategoryID != "" {
|
||||
jdCategoryId = skuNameExt.JdCategoryID
|
||||
@@ -1228,11 +1232,12 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
||||
}
|
||||
|
||||
if jdCategoryId != "" && jdCategoryId != "0" {
|
||||
jdsCategoryID, ebaiCategoryID, mtwmCategoryID = getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, skuNameExt.JdsCategoryID, skuNameExt.EbaiCategoryID, skuNameExt.MtwmCategoryID)
|
||||
jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryID = getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, skuNameExt.JdsCategoryID, skuNameExt.EbaiCategoryID, skuNameExt.MtwmCategoryID, skuNameExt.CategoryID)
|
||||
} else {
|
||||
jdsCategoryID = skuNameExt.JdsCategoryID
|
||||
ebaiCategoryID = skuNameExt.EbaiCategoryID
|
||||
mtwmCategoryID = skuNameExt.MtwmCategoryID
|
||||
jxCategoryID = skuNameExt.CategoryID
|
||||
}
|
||||
|
||||
if skuNameExt.DdCategoryID != "" {
|
||||
@@ -1257,9 +1262,16 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
|
||||
if payload["mtwmCategoryID"] != nil {
|
||||
mtwmCategoryID = payload["mtwmCategoryID"].(string)
|
||||
}
|
||||
if payload["categoryID2"] != nil {
|
||||
jxCategoryIDNumber, err := payload["categoryID2"].(json.Number).Int64()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
jxCategoryID = int(jxCategoryIDNumber)
|
||||
}
|
||||
|
||||
if jdCategoryId != "" {
|
||||
jdsCategoryID, ebaiCategoryID, mtwmCategoryID = getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID)
|
||||
jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryID = getJDCategoryLoadingLocalCategoryReflex(jdCategoryId, jdsCategoryID, ebaiCategoryID, mtwmCategoryID, jxCategoryID)
|
||||
}
|
||||
|
||||
if payload["ddCategoryID"] != nil {
|
||||
|
||||
@@ -50,6 +50,11 @@ func (p *PurchaseHandler) onFinancialMsg(msg *ebaiapi.CallbackMsg) (response *eb
|
||||
if err == nil {
|
||||
err = CurPurchaseHandler.OnOrderDetail(orderMap, partner.UpdatedPeration)
|
||||
}
|
||||
// 部分订单在隐私条约的保护下会隐藏用户收货地址,转自送成功自后才可以获取到正确的地址.
|
||||
userMap := orderMap["user"].(map[string]interface{})
|
||||
order, _ := partner.CurOrderManager.LoadOrder(vendorOrderID, model.VendorIDEBAI)
|
||||
order.ConsigneeAddress = utils.Interface2String(userMap["address"])
|
||||
partner.CurOrderManager.UpdateOrderFields(order, []string{"ConsigneeMobile"})
|
||||
}
|
||||
}
|
||||
return api.EbaiAPI.Err2CallbackResponse(msg.Cmd, err, msg.Cmd)
|
||||
|
||||
@@ -204,6 +204,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
}
|
||||
storeParams.StoreNotice = store.PromoteInfo
|
||||
modifyCloseStatus := false
|
||||
//storeParams.CloseStatus = store.JdStoreStatus
|
||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 {
|
||||
modifyCloseStatus = true
|
||||
_, storeParams.CloseStatus = JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) // 1storeParams.CloseStatus
|
||||
|
||||
Reference in New Issue
Block a user