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
14c3bbef
authored
Jun 12, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Plain Diff
fix
parents
1d2aef5b
2435485f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
cmd/queue/bom.go
internal/logic/attr.go
internal/logic/match.go
internal/mapping/search_keyword.go
cmd/queue/bom.go
View file @
14c3bbef
...
...
@@ -14,16 +14,18 @@ type RecvPro struct {
}
func
init
()
{
//queueExchange := rabbitmq.QueueExchange{
// "bom_match",
// "bom_match",
// "bom",
// "direct",
// "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
//}
//
//str := `{"bom_id":408,"delivery_type":1,"sort":2}`
//rabbitmq.Send(queueExchange, str)
if
configs
.
ApiSetting
.
Mode
==
"debug"
{
queueExchange
:=
rabbitmq
.
QueueExchange
{
"bom_match"
,
"bom_match"
,
"bom"
,
"direct"
,
"amqp://huntadmin:jy2y2900@192.168.1.237:5672/"
,
}
str
:=
`{"bom_id":408,"delivery_type":1,"sort":2}`
rabbitmq
.
Send
(
queueExchange
,
str
)
}
}
func
(
t
*
RecvPro
)
Consumer
(
dataByte
[]
byte
)
(
err
error
)
{
...
...
internal/logic/attr.go
View file @
14c3bbef
...
...
@@ -232,7 +232,7 @@ func getQuery(attrs []string) (query *es.BoolQuery) {
nestedQuery
=
es
.
NewNestedQuery
(
"attrs"
,
subQuery
)
query
.
Should
(
nestedQuery
)
}
query
.
MinimumNumberShouldMatch
(
1
)
query
.
MinimumNumberShouldMatch
(
2
)
}
return
query
...
...
internal/logic/match.go
View file @
14c3bbef
...
...
@@ -329,7 +329,9 @@ func getTermQuery(goodsName, brandName string, number int, flag bool) (query *es
}
//query = query.Filter(es.NewRangeQuery("single_price").Gt(0))
//query = query.Filter(es.NewRangeQuery("stock").Gt(0))
if
configs
.
ApiSetting
.
Mode
!=
"debug"
{
query
=
query
.
Filter
(
es
.
NewTermQuery
(
"status"
,
1
))
}
//query = query.Filter(es.NewRangeQuery("single_price").Gt(0))
//src, err := query.Source()
//if err != nil {
...
...
internal/mapping/search_keyword.go
View file @
14c3bbef
...
...
@@ -4,7 +4,7 @@ var KeywordRegular = map[string]string{
//`^(.* )?([\d\.]+)(欧|欧姆|R|r)( .*)?$`: `$1$2Ω$4`,
//`^(.* )?([\d\.]+)(U|u|μ)(.?)( .*)?$`: `$1$2Μ$4$5`,
"COG"
:
"C0G"
,
"NPO
"
:
"NP0
"
,
"NPO
|NP0|nPO|npO|npo|nP0|np0"
:
"C0G
"
,
"华科|华新科技|华新科"
:
"华新"
,
`(欧姆|欧|O|o|R|r)`
:
"Ω"
,
...
...
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