Commit 19462d7e by mushishixian

bom修改匹配

parent a794ff74
...@@ -35,7 +35,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) { ...@@ -35,7 +35,6 @@ func (t *RecvPro) Consumer(dataByte []byte) (err error) {
if err != nil { if err != nil {
log.Error(err) log.Error(err)
} }
err = logic.MatchGoods(message) err = logic.MatchGoods(message)
if err != nil { if err != nil {
log.Error(err) log.Error(err)
......
...@@ -14,7 +14,8 @@ import ( ...@@ -14,7 +14,8 @@ import (
func GetBomItems(bomId int) (bomItems []model.BomItem) { func GetBomItems(bomId int) (bomItems []model.BomItem) {
bomIdStr := strconv.FormatInt(int64(bomId), 10) bomIdStr := strconv.FormatInt(int64(bomId), 10)
tableEnd := string(bomIdStr[len(bomIdStr)-1]) tableEnd := string(bomIdStr[len(bomIdStr)-1])
model.Db.Table("lie_bom_item_"+tableEnd).Where("del_status = ?", 1).Where("bom_id = ?", bomId).Find(&bomItems) model.Db.Table("lie_bom_item_"+tableEnd).Where("del_status = ?", 1).
Where("bom_id = ?", bomId).Find(&bomItems)
return bomItems return bomItems
} }
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"bom_server/internal/model" "bom_server/internal/model"
"context" "context"
"encoding/json" "encoding/json"
"errors"
"math" "math"
"regexp" "regexp"
"strings" "strings"
...@@ -28,7 +27,7 @@ func MatchGoods(message model.BomMessage) (err error) { ...@@ -28,7 +27,7 @@ func MatchGoods(message model.BomMessage) (err error) {
bomId := message.BomId bomId := message.BomId
bom := GetBomInfoWithItems(bomId) bom := GetBomInfoWithItems(bomId)
if len(bom.BomItems) == 0 { if len(bom.BomItems) == 0 {
return errors.New("没有商品的bom单") return nil
} }
bomItems := bom.BomItems bomItems := bom.BomItems
var perGoDealNumber int var perGoDealNumber int
...@@ -251,7 +250,6 @@ func search(index string, bomId int, bomItems []model.BomItem, deliveryType, sor ...@@ -251,7 +250,6 @@ func search(index string, bomId int, bomItems []model.BomItem, deliveryType, sor
searchFlag = true searchFlag = true
search.Add(searchRequest) search.Add(searchRequest)
} }
//没有搜索条件的话,直接返回空值即可 //没有搜索条件的话,直接返回空值即可
if !searchFlag { if !searchFlag {
return nil, err return nil, err
......
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