Commit 3c05f0a9 by mushishixian

修复代码

parent 36f58f51
...@@ -5,8 +5,9 @@ import ( ...@@ -5,8 +5,9 @@ import (
"bom_server/internal/model" "bom_server/internal/model"
"encoding/json" "encoding/json"
"errors" "errors"
es "gopkg.in/olivere/elastic.v5"
"strconv" "strconv"
es "gopkg.in/olivere/elastic.v5"
) )
//根据bom_id查出bom表信息 //根据bom_id查出bom表信息
......
...@@ -7,12 +7,13 @@ import ( ...@@ -7,12 +7,13 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/prometheus/common/log"
es "gopkg.in/olivere/elastic.v5"
"math" "math"
"regexp" "regexp"
"strings" "strings"
"sync" "sync"
"github.com/prometheus/common/log"
es "gopkg.in/olivere/elastic.v5"
) )
/** /**
...@@ -60,7 +61,6 @@ func MatchGoods(message model.BomMessage) (err error) { ...@@ -60,7 +61,6 @@ func MatchGoods(message model.BomMessage) (err error) {
wg.Wait() wg.Wait()
//全部处理完以后要去修改主表的同步状态 //全部处理完以后要去修改主表的同步状态
return UpdateBomMatchStatus(bomId) return UpdateBomMatchStatus(bomId)
//return SearchGoods(bomId, bomItems)
} }
//去es搜索商品,得到对应的商品对应关系 //去es搜索商品,得到对应的商品对应关系
...@@ -105,7 +105,6 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg ...@@ -105,7 +105,6 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
if err != nil { if err != nil {
return return
} }
//fmt.Println(len(append(goodsMapList, fuzzyGoodsMapList...)))
err = UpdateGoodsData(append(goodsMapList, fuzzyGoodsMapList...)) err = UpdateGoodsData(append(goodsMapList, fuzzyGoodsMapList...))
if err != nil { if err != nil {
return return
......
package mapping
//属性单位对应属性
var UnitAttrMapping = map[string]string{
"r ": "阻值(欧姆)",
"Ω ": "阻值(欧姆)",
"mh": "电感",
"w": "功率",
"Ω/r ": "内阻",
"% ": "精度",
}
//封装列表
var PackingList = []string{
"0402",
"0603",
}
//介质列表
var MediaList = []string{
"X5U",
"X7R",
}
...@@ -11,6 +11,7 @@ type BomItem struct { ...@@ -11,6 +11,7 @@ type BomItem struct {
BrandName string `json:"brand_name"` BrandName string `json:"brand_name"`
// Number 需求数量 // Number 需求数量
Number int `json:"number"` Number int `json:"number"`
Attrs string `json:"attrs"`
// ItemStatus 匹配状态 1:等待匹配 2:可购现货 3:待询价 4:需要修正 // ItemStatus 匹配状态 1:等待匹配 2:可购现货 3:待询价 4:需要修正
ItemStatus int `json:"item_status"` ItemStatus int `json:"item_status"`
// DelStatus 删除状态 1:正常 2:删除 // DelStatus 删除状态 1:正常 2:删除
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment