|
|
@ -8,6 +8,7 @@ import ( |
|
|
|
"LAPP_LF_MOM_BACKEND/db" |
|
|
|
"LAPP_LF_MOM_BACKEND/grmi" |
|
|
|
meta "LAPP_LF_MOM_BACKEND/meta/me" |
|
|
|
baseModel "LAPP_LF_MOM_BACKEND/models/base" |
|
|
|
model "LAPP_LF_MOM_BACKEND/models/me" |
|
|
|
"LAPP_LF_MOM_BACKEND/web/models" |
|
|
|
) |
|
|
@ -141,9 +142,9 @@ func (impl *BomLstServiceImplement) InsertOne(user *models.Usertab, entity *mode |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("不存在对应的物料数据") |
|
|
|
} |
|
|
|
if article.ArtSpec1 != "CarSet" { |
|
|
|
if article.ArtSpec1 != baseModel.ART_TYPE_FINISHED && article.ArtSpec1 != baseModel.ART_TYPE_VIRTUAL { |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("传递的物料不是CarSet物料ID") |
|
|
|
return grmi.NewBusinessError("传递的物料不是总成或虚拟物料ID,artId:" + article.ArtId) |
|
|
|
} |
|
|
|
|
|
|
|
article2, err := articleDao.SelectOne(entity.CmatNr) |
|
|
@ -155,11 +156,19 @@ func (impl *BomLstServiceImplement) InsertOne(user *models.Usertab, entity *mode |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("不存在对应的物料数据") |
|
|
|
} |
|
|
|
if article2.ArtSpec1 != "CarSet" { |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("传递的物料不是CarSet物料ID") |
|
|
|
if article.ArtSpec1 == baseModel.ART_TYPE_VIRTUAL{ |
|
|
|
if article2.ArtSpec1 != baseModel.ART_TYPE_FINISHED { |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("传递的子物料不是总成, artId:" + article2.ArtId) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if article2.ArtSpec1 == baseModel.ART_TYPE_FINISHED || article2.ArtSpec1 == baseModel.ART_TYPE_VIRTUAL { |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("传递的物料是总成或虚拟物料ID, artId:" + article2.ArtId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if entity.FmatNr == entity.CmatNr{ |
|
|
|
_ = session.Rollback() |
|
|
|
return grmi.NewBusinessError("上级和下级物料ID相同") |
|
|
|