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
8ce9c84e
authored
May 27, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
914a481b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
5 deletions
cmd/cmd.exe~
internal/logic/bom_item.go
internal/logic/export.go
internal/logic/goods.go
internal/logic/match.go
main.go
cmd/cmd.exe~
View file @
8ce9c84e
The file could not be displayed because it is too large.
internal/logic/bom_item.go
View file @
8ce9c84e
...
...
@@ -15,6 +15,9 @@ func GetBomItems(bomId int) (bomItems []model.BomItem) {
//更新没有匹配的到bom详情
func
UpdateNoMatchBomItem
(
bomItems
[]
model
.
BomItem
)
(
err
error
)
{
if
len
(
bomItems
)
==
0
{
return
nil
}
var
updateIdList
[]
int
var
bomIdStr
string
for
_
,
bomItem
:=
range
bomItems
{
...
...
internal/logic/export.go
0 → 100644
View file @
8ce9c84e
package
logic
internal/logic/goods.go
View file @
8ce9c84e
...
...
@@ -4,7 +4,6 @@ import (
"bom_server/configs"
"bom_server/internal/model"
"encoding/json"
"fmt"
"github.com/imroc/req"
"reflect"
"strconv"
...
...
@@ -109,9 +108,7 @@ func UpdateGoodsData(goodsMapList []GoodsMap) (err error) {
}
}
}
start
:=
time
.
Now
()
err
=
BatchSaveMatchings
(
bomId
,
bomMatchingList
)
fmt
.
Println
(
time
.
Now
()
.
Sub
(
start
))
if
err
!=
nil
{
return
}
...
...
internal/logic/match.go
View file @
8ce9c84e
...
...
@@ -30,7 +30,7 @@ func MatchGoods(bomId int) (err error) {
return
errors
.
New
(
"没有商品的bom单"
)
}
bomItems
:=
bom
.
BomItems
perGoDealNumber
:=
20
0
perGoDealNumber
:=
5
0
//开启协程处理搜索.每50个开启一个协程
var
wg
sync
.
WaitGroup
//判断是否有余数
...
...
@@ -139,7 +139,6 @@ func getUpdateGoodsData(bomId int, bomItems []model.BomItem, client *es.Client,
}
res
,
err
:=
search
.
Do
(
context
.
Background
())
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
if
len
(
res
.
Responses
)
==
0
{
...
...
main.go
View file @
8ce9c84e
...
...
@@ -9,6 +9,10 @@ func hello(name string) string {
return
"Hello "
+
name
+
"!"
}
func
export
(
bomId
int
)
{
}
func
main
()
{
service
:=
rpc
.
NewHTTPService
()
service
.
AddFunction
(
"hello"
,
hello
,
rpc
.
Options
{})
...
...
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