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
19462d7e
authored
Aug 07, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bom修改匹配
parent
a794ff74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
cmd/queue/bom.go
internal/logic/bom_item.go
internal/logic/match.go
cmd/queue/bom.go
View file @
19462d7e
...
@@ -35,7 +35,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
...
@@ -35,7 +35,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
err
)
log
.
Error
(
err
)
}
}
err
=
logic
.
MatchGoods
(
message
)
err
=
logic
.
MatchGoods
(
message
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
err
)
log
.
Error
(
err
)
...
...
internal/logic/bom_item.go
View file @
19462d7e
...
@@ -14,7 +14,8 @@ import (
...
@@ -14,7 +14,8 @@ import (
func
GetBomItems
(
bomId
int
)
(
bomItems
[]
model
.
BomItem
)
{
func
GetBomItems
(
bomId
int
)
(
bomItems
[]
model
.
BomItem
)
{
bomIdStr
:=
strconv
.
FormatInt
(
int64
(
bomId
),
10
)
bomIdStr
:=
strconv
.
FormatInt
(
int64
(
bomId
),
10
)
tableEnd
:=
string
(
bomIdStr
[
len
(
bomIdStr
)
-
1
])
tableEnd
:=
string
(
bomIdStr
[
len
(
bomIdStr
)
-
1
])
model
.
Db
.
Table
(
"lie_bom_item_"
+
tableEnd
)
.
Where
(
"del_status = ?"
,
1
)
.
Where
(
"bom_id = ?"
,
bomId
)
.
Find
(
&
bomItems
)
model
.
Db
.
Table
(
"lie_bom_item_"
+
tableEnd
)
.
Where
(
"del_status = ?"
,
1
)
.
Where
(
"bom_id = ?"
,
bomId
)
.
Find
(
&
bomItems
)
return
bomItems
return
bomItems
}
}
...
...
internal/logic/match.go
View file @
19462d7e
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"bom_server/internal/model"
"bom_server/internal/model"
"context"
"context"
"encoding/json"
"encoding/json"
"errors"
"math"
"math"
"regexp"
"regexp"
"strings"
"strings"
...
@@ -28,7 +27,7 @@ func MatchGoods(message model.BomMessage) (err error) {
...
@@ -28,7 +27,7 @@ func MatchGoods(message model.BomMessage) (err error) {
bomId
:=
message
.
BomId
bomId
:=
message
.
BomId
bom
:=
GetBomInfoWithItems
(
bomId
)
bom
:=
GetBomInfoWithItems
(
bomId
)
if
len
(
bom
.
BomItems
)
==
0
{
if
len
(
bom
.
BomItems
)
==
0
{
return
errors
.
New
(
"没有商品的bom单"
)
return
nil
}
}
bomItems
:=
bom
.
BomItems
bomItems
:=
bom
.
BomItems
var
perGoDealNumber
int
var
perGoDealNumber
int
...
@@ -251,7 +250,6 @@ func search(index string, bomId int, bomItems []model.BomItem, deliveryType, sor
...
@@ -251,7 +250,6 @@ func search(index string, bomId int, bomItems []model.BomItem, deliveryType, sor
searchFlag
=
true
searchFlag
=
true
search
.
Add
(
searchRequest
)
search
.
Add
(
searchRequest
)
}
}
//没有搜索条件的话,直接返回空值即可
//没有搜索条件的话,直接返回空值即可
if
!
searchFlag
{
if
!
searchFlag
{
return
nil
,
err
return
nil
,
err
...
...
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