Commit 3032c9b1 by hcy001

bom4

parent 4f665965
......@@ -2,6 +2,7 @@ package logic
import (
"bom_server/configs"
"bom_server/internal/common"
"bom_server/internal/model"
"encoding/json"
"errors"
......@@ -94,14 +95,17 @@ func UpdateBomItem(bomId, bomItemId int) (err error) {
bomItems = GetStandardAttrs(bomItems)
//第一次去精确匹配,没有再去模糊匹配
var goodsMapList []GoodsMap
itemsStatus := 0
itemsStatus := 2
goodsMapList, err = getUpdateGoodsData(bomId, bomItems, where.DeliveryType, where.Sort, client, true,false)
common.PrintDebug("精确匹配:",goodsMapList)
if len(goodsMapList) == 0 {
//替代型号匹配
goodsMapList, err = getUpdateGoodsData(bomId, bomItems, where.DeliveryType, where.Sort, client, false,true)
common.PrintDebug("替代型号匹配:",goodsMapList)
itemsStatus = 5; //替代物料匹配
if len(goodsMapList) == 0 {
goodsMapList, err = getUpdateGoodsData(bomId, bomItems, where.DeliveryType, where.Sort, client, false,false)
common.PrintDebug("模糊匹配:",goodsMapList)
if len(goodsMapList) != 0 {
itemsStatus = 6; //模糊匹配
}
......
......@@ -61,15 +61,11 @@ func BatchSaveMatchings(bomId int, matchingList []model.BomItemMatching,status .
is_select := 1;
if len(status) > 0 { //todo 增加类型: 5 替代型号匹配 6 模糊匹配
itemStatus = status[0]
if itemStatus == 4 || itemStatus == 6 {
if itemStatus == 4 || itemStatus == 5 || itemStatus == 6 {
is_select = 0
}
}
if match.Status == 5 && match.Status == 6 { //当bom状态是
itemStatus = match.Status;
}
//查询需求数量 跟 当前库存比较
var bomInfo model.BomItem
model.Db.Table("lie_bom_item_"+ tableEnd).Where("bom_item_id = ?", matching.BomItemID).First(&bomInfo)
......
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