- ActStoreSkuParam2Model中当有wrongSkuList时,不覆盖OriginalPrice
This commit is contained in:
@@ -148,7 +148,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err2 := checkDiscountValidation(act.Type, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice)); err2 != nil {
|
if err2 := checkDiscountValidation(act.Type, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice)); err2 != nil {
|
||||||
v.ErrMsg = fmt.Sprintf("err:%s, actPrice:%d, vendorPrice:%d, discount:%d", err2.Error(), actSkuMap.ActualActPrice, actSkuMap.VendorPrice, int(actSkuMap.ActualActPrice*100/actSkuMap.VendorPrice))
|
v.ErrMsg = err2.Error()
|
||||||
wrongSkuList = append(wrongSkuList, v)
|
wrongSkuList = append(wrongSkuList, v)
|
||||||
} else {
|
} else {
|
||||||
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
|
dao.WrapAddIDCULDEntity(actSkuMap, ctx.GetUserName())
|
||||||
@@ -163,6 +163,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(wrongSkuList) == 0 {
|
||||||
for _, v := range oneStoreSkuParam {
|
for _, v := range oneStoreSkuParam {
|
||||||
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
|
if validSkuMap[v.SkuID] == 1 { // todo 这里是否需要判断
|
||||||
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
|
if storeSkuInfo := storeSkuMap[jxutils.Combine2Int(v.StoreID, v.SkuID)]; storeSkuInfo != nil {
|
||||||
@@ -175,6 +176,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if len(wrongSkuList) > 0 {
|
if len(wrongSkuList) > 0 {
|
||||||
return nil, nil, nil, jsonerr.New(wrongSkuList, model.ErrCodeJsonActPriceTooLarger)
|
return nil, nil, nil, jsonerr.New(wrongSkuList, model.ErrCodeJsonActPriceTooLarger)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user