Browse Source

添加复制时projectId的校验

pull/105/head
zhangxin 3 years ago
parent
commit
481156ce3a
2 changed files with 16 additions and 0 deletions
  1. +8
    -0
      services/base/implments/Article.service.impl.go
  2. +8
    -0
      services/me/implments/Product.service.impl.go

+ 8
- 0
services/base/implments/Article.service.impl.go View File

@ -684,6 +684,7 @@ func (impl *ArticleServiceImplement) Copy(user *global.User, articleId, projectI
articleAtcodLstDao := dal.NewArticleAtcodLstDAO(session, user.PlantNr, user.UserId)
artQtyAllocateDao := dal.NewArtQtyAllocateDAO(session, user.PlantNr, user.UserId)
artCheckRuleDao := dal.NewArtCheckRuleDAO(session, user.PlantNr, user.UserId)
projectDao := meDal.NewProjectDAO(session, user.PlantNr, user.UserId)
article, err := articleDao.SelectOne(articleId, projectId)
if err != nil {
return grmi.NewBusinessError("查询物料数据失败, error:" + err.Error())
@ -694,6 +695,13 @@ func (impl *ArticleServiceImplement) Copy(user *global.User, articleId, projectI
if article.ArtSpec1 == model.ART_TYPE_FINISHED {
return grmi.NewBusinessError("总成复制请在派生管理页面进行操作")
}
project, err := projectDao.SelectOne(targetProjectId)
if err != nil {
return grmi.NewBusinessError("查询车型项目数据失败, error:" + err.Error())
}
if project == nil {
return grmi.NewBusinessError("车型项目ID不存在")
}
targetArticle, err := articleDao.SelectOne(articleId, targetProjectId)
if err != nil {
return grmi.NewBusinessError("查询物料数据失败, error:" + err.Error())


+ 8
- 0
services/me/implments/Product.service.impl.go View File

@ -516,6 +516,7 @@ func (impl *ProductServiceImplement) Copy(user *global.User, productId, projectI
articleAtcodLstDao := baseDal.NewArticleAtcodLstDAO(session, user.PlantNr, user.UserId)
artQtyAllocateDao := baseDal.NewArtQtyAllocateDAO(session, user.PlantNr, user.UserId)
artCheckRuleDao := baseDal.NewArtCheckRuleDAO(session, user.PlantNr, user.UserId)
projectDao := dal.NewProjectDAO(session, user.PlantNr, user.UserId)
product, err := productDao.SelectOne(productId, projectId)
if err != nil {
return grmi.NewBusinessError("查询总成产品数据失败, error:" + err.Error())
@ -530,6 +531,13 @@ func (impl *ProductServiceImplement) Copy(user *global.User, productId, projectI
if targetProduct != nil {
return grmi.NewBusinessError("要复制的总成产品已存在")
}
project, err := projectDao.SelectOne(targetProjectId)
if err != nil {
return grmi.NewBusinessError("查询车型项目数据失败, error:" + err.Error())
}
if project == nil {
return grmi.NewBusinessError("车型项目ID不存在")
}
article, err := articleDao.SelectOne(productId, projectId)
if err != nil {
return grmi.NewBusinessError("查询物料数据失败, error:" + err.Error())


Loading…
Cancel
Save