Commit 3c05f0a9 by mushishixian

修复代码

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