蜂鸟修改预下单

This commit is contained in:
邹宗楠
2022-03-30 13:39:31 +08:00
parent 0de43fb815
commit b07cc39afd
4 changed files with 8 additions and 12 deletions

View File

@@ -478,6 +478,7 @@ func GetStoreSkus(ctx *jxcontext.Context, storeID int, skuIDs []int, isFocus boo
}
func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []string, isFocus bool, keyword string, isBySku, isAct, isHighPrice bool, priceType int, actVendorID int, params map[string]interface{}) (sql string, sqlParams []interface{}, err error) {
// 查看指定商店,对应的商品数据和商品价格等参数说明
sql = `
FROM sku_name t1
JOIN sku t2 FORCE INDEX(PRIMARY) ON t1.id = t2.name_id AND t2.deleted_at = ?/* AND t2.status = ?*/
@@ -495,7 +496,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
model.ThingTypeSku, utils.DefaultTimeValue,
}
if isFocus {
if isAct {
if isAct { // 查看活动
sql += `
JOIN (
SELECT t2.store_id, t2.sku_id,
@@ -735,12 +736,10 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
}
func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
fmt.Println("用户入参storeIDs", storeIDs)
//权限 管理员/未登录人员不进入,商城不进入
fmt.Println("用户权限", permission.IsRoled(ctx))
// 管理员进入
if permission.IsRoled(ctx) {
// 获取管理员绑定门店
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
fmt.Println("用户权限门店", storeIDsMap)
var storeIDs2 []int
if len(storeIDs) > 0 {
for _, v := range storeIDs {
@@ -749,7 +748,7 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string
}
}
if len(storeIDs2) == 0 {
storeIDs2 = append(storeIDs2, storeIDs...)
storeIDs2 = append(storeIDs2, -1)
}
} else {
for k, _ := range storeIDsMap {
@@ -760,7 +759,6 @@ func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string
storeIDs = storeIDs2
}
}
fmt.Println("用户出参storeIDs", storeIDs)
return GetStoresSkusNew(ctx, storeIDs, skuIDs, upcs, isFocus, isHighPrice, priceType, keyword, isBySku, isAct, params, offset, pageSize)
}

View File

@@ -419,7 +419,6 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
func IsRoled(ctx *jxcontext.Context) bool {
if ctx.GetUserName() != "jxadmin" {
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", ctx.GetUserID()); err == nil {
fmt.Println("用户type", user.Type)
if user.Type&model.UserTypeRole != 0 {
return true
}

View File

@@ -197,7 +197,10 @@ func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInf
})
}
preCreateOrder.GoodsItemList = goodsList
deliveryFeeInfo = &partner.WaybillFeeInfo{}
deliveryFeeInfo.RefDeliveryFee, deliveryFeeInfo.RefAddFee, err = api.FnAPI.PreCreateByShopFn(preCreateOrder)
deliveryFeeInfo.DeliveryFee = deliveryFeeInfo.RefDeliveryFee
return deliveryFeeInfo, err
}

View File

@@ -1,7 +1,6 @@
package controllers
import (
"fmt"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
@@ -100,11 +99,8 @@ func (c *StoreSkuController) GetStoresSkus() {
var storeIDs, skuIDs []int
var upcs []string
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.SkuIDs, &skuIDs, params.Upcs, &upcs); err == nil {
fmt.Println("params.StoreIDs:=", params.StoreIDs)
fmt.Println("storeIDs:=", storeIDs)
retVal, err = cms.GetStoresSkus(params.Ctx, storeIDs, skuIDs, upcs, params.IsFocus, params.IsHighPrice, params.PriceType, params.Keyword, params.IsBySku, params.IsAct, params.MapData, params.Offset, params.PageSize)
}
fmt.Println("==================", retVal)
return retVal, "", err
})
}