Commit 19462d7e by mushishixian

bom修改匹配

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