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
3032c9b1
authored
Apr 29, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bom4
parent
4f665965
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
internal/logic/bom_item.go
internal/logic/bom_matching.go
internal/logic/bom_item.go
View file @
3032c9b1
...
...
@@ -2,6 +2,7 @@ package logic
import
(
"bom_server/configs"
"bom_server/internal/common"
"bom_server/internal/model"
"encoding/json"
"errors"
...
...
@@ -94,14 +95,17 @@ func UpdateBomItem(bomId, bomItemId int) (err error) {
bomItems
=
GetStandardAttrs
(
bomItems
)
//第一次去精确匹配,没有再去模糊匹配
var
goodsMapList
[]
GoodsMap
itemsStatus
:=
0
itemsStatus
:=
2
goodsMapList
,
err
=
getUpdateGoodsData
(
bomId
,
bomItems
,
where
.
DeliveryType
,
where
.
Sort
,
client
,
true
,
false
)
common
.
PrintDebug
(
"精确匹配:"
,
goodsMapList
)
if
len
(
goodsMapList
)
==
0
{
//替代型号匹配
goodsMapList
,
err
=
getUpdateGoodsData
(
bomId
,
bomItems
,
where
.
DeliveryType
,
where
.
Sort
,
client
,
false
,
true
)
common
.
PrintDebug
(
"替代型号匹配:"
,
goodsMapList
)
itemsStatus
=
5
;
//替代物料匹配
if
len
(
goodsMapList
)
==
0
{
goodsMapList
,
err
=
getUpdateGoodsData
(
bomId
,
bomItems
,
where
.
DeliveryType
,
where
.
Sort
,
client
,
false
,
false
)
common
.
PrintDebug
(
"模糊匹配:"
,
goodsMapList
)
if
len
(
goodsMapList
)
!=
0
{
itemsStatus
=
6
;
//模糊匹配
}
...
...
internal/logic/bom_matching.go
View file @
3032c9b1
...
...
@@ -61,15 +61,11 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching,status .
is_select
:=
1
;
if
len
(
status
)
>
0
{
//todo 增加类型: 5 替代型号匹配 6 模糊匹配
itemStatus
=
status
[
0
]
if
itemStatus
==
4
||
itemStatus
==
6
{
if
itemStatus
==
4
||
itemStatus
==
5
||
itemStatus
==
6
{
is_select
=
0
}
}
if
match
.
Status
==
5
&&
match
.
Status
==
6
{
//当bom状态是
itemStatus
=
match
.
Status
;
}
//查询需求数量 跟 当前库存比较
var
bomInfo
model
.
BomItem
model
.
Db
.
Table
(
"lie_bom_item_"
+
tableEnd
)
.
Where
(
"bom_item_id = ?"
,
matching
.
BomItemID
)
.
First
(
&
bomInfo
)
...
...
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