Commit 2e500d1a by mushishixian

修复

parent 3ea7aee3
Showing with 2 additions and 3 deletions
...@@ -22,7 +22,7 @@ func init() { ...@@ -22,7 +22,7 @@ func init() {
// "amqp://huntadmin:jy2y2900@192.168.1.237:5672/", // "amqp://huntadmin:jy2y2900@192.168.1.237:5672/",
//} //}
// //
//str := `{"bom_id":530,"delivery_type":1,"sort":1}` //str := `{"bom_id":568,"delivery_type":1,"sort":1}`
//rabbitmq.Send(queueExchange, str) //rabbitmq.Send(queueExchange, str)
} }
......
...@@ -30,7 +30,7 @@ func MatchGoodsNameByAttrs(bomItems []model.BomItem) (result []model.BomItem, er ...@@ -30,7 +30,7 @@ func MatchGoodsNameByAttrs(bomItems []model.BomItem) (result []model.BomItem, er
//先根据参数去构建批量查询条件 //先根据参数去构建批量查询条件
for _, item := range bomItems { for _, item := range bomItems {
//如果有型号,但是型号有可能是参数,所以先去匹配下参数,有的话转成对应的型号 //如果有型号,但是型号有可能是参数,所以先去匹配下参数,有的话转成对应的型号
if item.GoodsName != "" { if item.GoodsName != "" && item.Attrs == "" {
search = searchAttr(item.GoodsName, item.BrandName, item.Encap, search) search = searchAttr(item.GoodsName, item.BrandName, item.Encap, search)
searchFlag = true searchFlag = true
} }
...@@ -56,7 +56,6 @@ func MatchGoodsNameByAttrs(bomItems []model.BomItem) (result []model.BomItem, er ...@@ -56,7 +56,6 @@ func MatchGoodsNameByAttrs(bomItems []model.BomItem) (result []model.BomItem, er
if responses.Hits != nil { if responses.Hits != nil {
for _, hit := range responses.Hits.Hits { for _, hit := range responses.Hits.Hits {
res, _ := hit.Source.MarshalJSON() res, _ := hit.Source.MarshalJSON()
//还要去判断至少符合特定数量参数匹配的结果,比如最小匹配参数为2,那就是要有两个参数匹配到才正确
bomItems[key].GoodsName = gjson.Get(string(res), "goods_name").String() bomItems[key].GoodsName = gjson.Get(string(res), "goods_name").String()
} }
} }
......
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