Commit f56d4a94 by mushishixian

配合修改完成

parent 5e7012e7
...@@ -5,11 +5,12 @@ import ( ...@@ -5,11 +5,12 @@ import (
"bom_server/internal/common" "bom_server/internal/common"
"bom_server/internal/model" "bom_server/internal/model"
"encoding/json" "encoding/json"
"strings"
"time"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq" "github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/imroc/req" "github.com/imroc/req"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"strings"
"time"
) )
type GoodsMap struct { type GoodsMap struct {
...@@ -142,6 +143,7 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []model.ApiGoods, err error) { ...@@ -142,6 +143,7 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []model.ApiGoods, err error) {
PriceUs: price.Get("price_us").Float(), PriceUs: price.Get("price_us").Float(),
PriceCn: price.Get("price_cn").Float(), PriceCn: price.Get("price_cn").Float(),
PriceAc: price.Get("price_ac").Float(), PriceAc: price.Get("price_ac").Float(),
PriceAcUs: price.Get("price_ac_us").Float(),
} }
ladderPrice = append(ladderPrice, ladder) ladderPrice = append(ladderPrice, ladder)
} }
...@@ -247,7 +249,11 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model. ...@@ -247,7 +249,11 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
bomMatching.Price = ladder.PriceCn bomMatching.Price = ladder.PriceCn
} }
} else { } else {
bomMatching.Price = ladder.PriceUs if ladder.PriceAcUs != 0 {
bomMatching.Price = ladder.PriceAcUs
} else {
bomMatching.Price = ladder.PriceUs
}
} }
} }
return return
......
...@@ -72,4 +72,5 @@ type LadderPrice struct { ...@@ -72,4 +72,5 @@ type LadderPrice struct {
PriceUs float64 `json:"price_us"` PriceUs float64 `json:"price_us"`
PriceCn float64 `json:"price_cn"` PriceCn float64 `json:"price_cn"`
PriceAc float64 `json:"price_ac"` PriceAc float64 `json:"price_ac"`
PriceAcUs float64 `json:"price_ac_us"`
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment