Commit 9793c198 by hcy001

bom4

parent c049e3e8
......@@ -21,7 +21,7 @@ func PrintDebug(str ...interface{}) {
if flag == 0 {
return
}
temp := "-------";
temp := "---"+strconv.FormatInt(php2go.Time(),10);
for _,jsonStr := range str {
if v, p := jsonStr.(string); p {
temp = temp +"---"+ v
......
package logic
import (
"bom_server/internal/common"
"bom_server/internal/model"
"github.com/prometheus/common/log"
"math"
......@@ -68,7 +69,9 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching,status .
err = model.Db.Table("lie_bom_item_"+tableEnd).Where("bom_item_id = ?", matching.BomItemID).
Updates(map[string]interface{}{"item_status": itemStatus, "update_time": now, "is_select": 1}).Error
if err != nil {
common.PrintDebug(err)
return
}
//更新商品价格和库存的队列
......
......@@ -104,7 +104,7 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
var fuzzyBomItems []model.BomItem
for _, bomItem := range needDealBomItems {
//不在精确匹配结果里面的,同时商品名称不能为空的
if !checkInGoodsMap(bomItem, exactList) && bomItem.GoodsName != "" {
if !checkInGoodsMap(bomItem, exactList) {
fuzzyBomItems = append(fuzzyBomItems, bomItem)
}
}
......@@ -121,7 +121,7 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
var fuzzyBomItems2 []model.BomItem
for _, bomItem := range fuzzyBomItems {
//不在精确匹配结果里面的,同时商品名称不能为空的
if !checkInGoodsMap(bomItem, AlikeGoodsMapList) && bomItem.GoodsName != "" {
if !checkInGoodsMap(bomItem, AlikeGoodsMapList) {
fuzzyBomItems2 = append(fuzzyBomItems2, bomItem)
}
}
......@@ -142,6 +142,8 @@ func SearchGoods(bomId int, bomItems []model.BomItem, deliveryType, sort int, wg
}
}
common.PrintDebug("没有匹配到的bom 明细",notMatchBomItems)
//先去处理没有匹配到的数据
err = UpdateNoMatchBomItem(notMatchBomItems, true)
if err != nil {
......
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