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
9793c198
authored
Apr 21, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bom4
parent
c049e3e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
internal/common/common.go
internal/logic/bom_matching.go
internal/logic/match.go
internal/common/common.go
View file @
9793c198
...
...
@@ -21,7 +21,7 @@ func PrintDebug(str ...interface{}) {
if
flag
==
0
{
return
}
temp
:=
"---
----"
;
temp
:=
"---
"
+
strconv
.
FormatInt
(
php2go
.
Time
(),
10
)
;
for
_
,
jsonStr
:=
range
str
{
if
v
,
p
:=
jsonStr
.
(
string
);
p
{
temp
=
temp
+
"---"
+
v
...
...
internal/logic/bom_matching.go
View file @
9793c198
package
logic
import
(
"bom_server/internal/common"
"bom_server/internal/model"
"github.com/prometheus/common/log"
"math"
...
...
@@ -68,7 +69,9 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching,status .
err
=
model
.
Db
.
Table
(
"lie_bom_item_"
+
tableEnd
)
.
Where
(
"bom_item_id = ?"
,
matching
.
BomItemID
)
.
Updates
(
map
[
string
]
interface
{}{
"item_status"
:
itemStatus
,
"update_time"
:
now
,
"is_select"
:
1
})
.
Error
if
err
!=
nil
{
common
.
PrintDebug
(
err
)
return
}
//更新商品价格和库存的队列
...
...
internal/logic/match.go
View file @
9793c198
...
...
@@ -104,7 +104,7 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
var
fuzzyBomItems
[]
model
.
BomItem
for
_
,
bomItem
:=
range
needDealBomItems
{
//不在精确匹配结果里面的,同时商品名称不能为空的
if
!
checkInGoodsMap
(
bomItem
,
exactList
)
&&
bomItem
.
GoodsName
!=
""
{
if
!
checkInGoodsMap
(
bomItem
,
exactList
)
{
fuzzyBomItems
=
append
(
fuzzyBomItems
,
bomItem
)
}
}
...
...
@@ -121,7 +121,7 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
var
fuzzyBomItems2
[]
model
.
BomItem
for
_
,
bomItem
:=
range
fuzzyBomItems
{
//不在精确匹配结果里面的,同时商品名称不能为空的
if
!
checkInGoodsMap
(
bomItem
,
AlikeGoodsMapList
)
&&
bomItem
.
GoodsName
!=
""
{
if
!
checkInGoodsMap
(
bomItem
,
AlikeGoodsMapList
)
{
fuzzyBomItems2
=
append
(
fuzzyBomItems2
,
bomItem
)
}
}
...
...
@@ -142,6 +142,8 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
}
}
common
.
PrintDebug
(
"没有匹配到的bom 明细"
,
notMatchBomItems
)
//先去处理没有匹配到的数据
err
=
UpdateNoMatchBomItem
(
notMatchBomItems
,
true
)
if
err
!=
nil
{
...
...
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