Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop

This commit is contained in:
richboo111
2023-03-28 14:47:50 +08:00
9 changed files with 115 additions and 12 deletions

View File

@@ -427,7 +427,7 @@ func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
if err != nil {
return errors.New("此接口有执行顺序请先调用注册登录接口【第一步Login第二TiktokDecrypt】")
return errors.New("此接口有执行顺序请先调用注册登录接口【第一步Login第二TiktokDecrypt】")
}
authInfo.AuthBindInfo.UserID = user.UserID
//handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())

View File

@@ -2035,12 +2035,18 @@ func RrefreshMtwmVendorAct(ctx *jxcontext.Context) (err error) {
}
// 查询门店爆款商品,当门店存在爆款时,取消之前的力荐商品,将新的爆款设置为力荐商品
//if k == mtwmapi.RetailActTypeSecKill && len(actList) > 0 {
// allActivityList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
// activationActivityList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
// allActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
// activationActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
// loseActivitySkuIdList := 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))
// allActivitySkuIdList = append(allActivitySkuIdList, utils.Int64ToStr(ac.ItemID))
// // 已经生效的爆款活动
// if ac.Status == 1 && ac.SkuId != "" {
// activationActivitySkuIdList = append(activationActivitySkuIdList, utils.Int64ToStr(ac.ItemID))
// }
// // 已经失效的爆款活动
// if ac.Status == 0 && ac.SkuId != "" {
// loseActivitySkuIdList = append(loseActivitySkuIdList, ac.SkuId)
// }
// }
// // 取消当前力荐商品

View File

@@ -1149,7 +1149,13 @@ type aa struct {
// 根据名称获取商品分类[京东]
func getCategoryByName(name string) string {
handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDJD).(partner.IPurchasePlatformStoreSkuHandler)
vendorCategoryId, _ := handler.GetSkuCategoryIdByName("320406", name)
vendorOrgCode := ""
if beego.BConfig.RunMode == "jxgy" {
vendorOrgCode = "339032"
} else {
vendorOrgCode = "320406"
}
vendorCategoryId, _ := handler.GetSkuCategoryIdByName(vendorOrgCode, name)
return vendorCategoryId
}
@@ -1163,7 +1169,13 @@ func getCategoryByImg(img ...string) string {
imgs = append(imgs, v)
}
handler, _ := partner.GetPurchasePlatformFromVendorID(model.VendorIDDD).(partner.IPurchasePlatformStoreSkuHandler)
vendorCategoryId, _ := handler.GetSkuCategoryIdByName("57939570", strings.Join(imgs, "|"))
vendorOrgCode := ""
if beego.BConfig.RunMode == "jxgy" {
vendorOrgCode = "57939570"
} else {
vendorOrgCode = "57939570"
}
vendorCategoryId, _ := handler.GetSkuCategoryIdByName(vendorOrgCode, strings.Join(imgs, "|"))
return vendorCategoryId
}
@@ -1262,12 +1274,20 @@ func updateOrCreateSkuVendorCategoryMap(db *dao.DaoDB, ctx *jxcontext.Context, n
if payload["mtwmCategoryID"] != nil {
mtwmCategoryID = payload["mtwmCategoryID"].(string)
}
if payload["categoryID2"] != nil {
if payload["categoryID2"] != nil && !utils.IsNil(payload["categoryID2"]) {
jxCategoryIDNumber, err := payload["categoryID2"].(json.Number).Int64()
if err != nil {
return false
}
jxCategoryID = int(jxCategoryIDNumber)
} else if payload["categoryID"] != nil && !utils.IsNil(payload["categoryID"]) {
jxCategoryIDNumber, err := payload["categoryID"].(json.Number).Int64()
if err != nil {
return false
}
jxCategoryID = int(jxCategoryIDNumber)
} else {
jxCategoryID = 0
}
if jdCategoryId != "" {

View File

@@ -1762,6 +1762,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
panic(r)
}
}()
if isStoreMapNeedSync(vendorID, valid) { // 对于store vendor map只有Status改变才需要同步到厂商
num, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, storeMap, valid, userName, map[string]interface{}{
model.FieldStoreID: storeID,

View File

@@ -229,7 +229,7 @@ func RegisterUserWithMobile(ctx *jxcontext.Context, user *model.User, mobileVeri
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)
}
} else if dao.IsDuplicateError(err) {
if user.LastLoginType != "" && user.LastLoginType == alipay.AuthType {
if user.LastLoginType == alipay.AuthType {
if user2, _ := dao.GetUserByID(dao.GetDB(), "mobile", user.GetMobile()); user2 != nil {
user.UserID = user2.GetID()
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)