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
3c05f0a9
authored
Jun 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复代码
parent
36f58f51
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
6 deletions
internal/logic/bom_item.go
internal/logic/match.go
internal/mapping/unit_attr.go
internal/model/bom_item.go
internal/logic/bom_item.go
View file @
3c05f0a9
...
...
@@ -5,8 +5,9 @@ import (
"bom_server/internal/model"
"encoding/json"
"errors"
es
"gopkg.in/olivere/elastic.v5"
"strconv"
es
"gopkg.in/olivere/elastic.v5"
)
//根据bom_id查出bom表信息
...
...
internal/logic/match.go
View file @
3c05f0a9
...
...
@@ -7,12 +7,13 @@ import (
"context"
"encoding/json"
"errors"
"github.com/prometheus/common/log"
es
"gopkg.in/olivere/elastic.v5"
"math"
"regexp"
"strings"
"sync"
"github.com/prometheus/common/log"
es
"gopkg.in/olivere/elastic.v5"
)
/**
...
...
@@ -60,7 +61,6 @@ func MatchGoods(message model.BomMessage) (err error) {
wg
.
Wait
()
//全部处理完以后要去修改主表的同步状态
return
UpdateBomMatchStatus
(
bomId
)
//return SearchGoods(bomId, bomItems)
}
//去es搜索商品,得到对应的商品对应关系
...
...
@@ -105,7 +105,6 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
if
err
!=
nil
{
return
}
//fmt.Println(len(append(goodsMapList, fuzzyGoodsMapList...)))
err
=
UpdateGoodsData
(
append
(
goodsMapList
,
fuzzyGoodsMapList
...
))
if
err
!=
nil
{
return
...
...
internal/mapping/unit_attr.go
0 → 100644
View file @
3c05f0a9
package
mapping
//属性单位对应属性
var
UnitAttrMapping
=
map
[
string
]
string
{
"r "
:
"阻值(欧姆)"
,
"Ω "
:
"阻值(欧姆)"
,
"mh"
:
"电感"
,
"w"
:
"功率"
,
"Ω/r "
:
"内阻"
,
"% "
:
"精度"
,
}
//封装列表
var
PackingList
=
[]
string
{
"0402"
,
"0603"
,
}
//介质列表
var
MediaList
=
[]
string
{
"X5U"
,
"X7R"
,
}
internal/model/bom_item.go
View file @
3c05f0a9
...
...
@@ -10,7 +10,8 @@ type BomItem struct {
// BrandName 品牌
BrandName
string
`json:"brand_name"`
// Number 需求数量
Number
int
`json:"number"`
Number
int
`json:"number"`
Attrs
string
`json:"attrs"`
// ItemStatus 匹配状态 1:等待匹配 2:可购现货 3:待询价 4:需要修正
ItemStatus
int
`json:"item_status"`
// DelStatus 删除状态 1:正常 2:删除
...
...
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