Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
bom_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f56d4a94
authored
Apr 20, 2023
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
配合修改完成
parent
5e7012e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
internal/logic/goods.go
internal/model/goods.go
internal/logic/goods.go
View file @
f56d4a94
...
...
@@ -5,11 +5,12 @@ import (
"bom_server/internal/common"
"bom_server/internal/model"
"encoding/json"
"strings"
"time"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/imroc/req"
"github.com/tidwall/gjson"
"strings"
"time"
)
type
GoodsMap
struct
{
...
...
@@ -142,6 +143,7 @@ func GetGoodsInfo(goodsIdsStr string) (goodsList []model.ApiGoods, err error) {
PriceUs
:
price
.
Get
(
"price_us"
)
.
Float
(),
PriceCn
:
price
.
Get
(
"price_cn"
)
.
Float
(),
PriceAc
:
price
.
Get
(
"price_ac"
)
.
Float
(),
PriceAcUs
:
price
.
Get
(
"price_ac_us"
)
.
Float
(),
}
ladderPrice
=
append
(
ladderPrice
,
ladder
)
}
...
...
@@ -247,7 +249,11 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
bomMatching
.
Price
=
ladder
.
PriceCn
}
}
else
{
bomMatching
.
Price
=
ladder
.
PriceUs
if
ladder
.
PriceAcUs
!=
0
{
bomMatching
.
Price
=
ladder
.
PriceAcUs
}
else
{
bomMatching
.
Price
=
ladder
.
PriceUs
}
}
}
return
...
...
internal/model/goods.go
View file @
f56d4a94
...
...
@@ -72,4 +72,5 @@ type LadderPrice struct {
PriceUs
float64
`json:"price_us"`
PriceCn
float64
`json:"price_cn"`
PriceAc
float64
`json:"price_ac"`
PriceAcUs
float64
`json:"price_ac_us"`
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment