Browse Source

修复更新物料时更新绑定属性没有关联projectId的bug

pull/147/head
zhangxin 3 years ago
parent
commit
562577f10d
2 changed files with 4 additions and 3 deletions
  1. +2
    -2
      dao/base/implments/ArticleAtcodLst.dao.impl.go
  2. +2
    -1
      services/base/implments/Article.service.impl.go

+ 2
- 2
dao/base/implments/ArticleAtcodLst.dao.impl.go View File

@ -308,11 +308,11 @@ func (impl *ArticleAtcodLstDAOImplement) UpdateWhere(predicates []grmi.Predicate
* @Reference LAPP_ACURA_MOM_BACKEND/dao/base/ArticleAtcodLstDAO.SelectAllot
*
******************************************************************************/
func (impl *ArticleAtcodLstDAOImplement) SelectAllot(artId string) ([]model.Attribute, error) {
func (impl *ArticleAtcodLstDAOImplement) SelectAllot(artId string, projectId string) ([]model.Attribute, error) {
data := make([]model.ArtData, 0)
datalist := make([]model.Attribute, 0)
session := impl.session.Table(meta.Attribute.TableName).Join("LEFT", meta.ArticleAtcodLst.TableName, "ArticleAtcodLst.PlantNr = Attribute.PlantNr and ArticleAtcodLst.AttrCode = Attribute.AttrCode").Where("ArticleAtcodLst.PlantNr = ? and ArticleAtcodLst.ArtId = ?", impl.plantNr, artId)
session := impl.session.Table(meta.Attribute.TableName).Join("LEFT", meta.ArticleAtcodLst.TableName, "ArticleAtcodLst.PlantNr = Attribute.PlantNr and ArticleAtcodLst.AttrCode = Attribute.AttrCode").Where("ArticleAtcodLst.PlantNr = ? and ArticleAtcodLst.ArtId = ? and ArticleAtcodLst.ProjectId = ?", impl.plantNr, artId, projectId)
err := session.Find(&data)
for _, v := range data {


+ 2
- 1
services/base/implments/Article.service.impl.go View File

@ -255,7 +255,7 @@ func (impl *ArticleServiceImplement) SelectOne(user *global.User, artId string,
return nil, err
}
lstdao := dal.NewArticleAtcodLstDAO(session, user.PlantNr, user.UserId)
list, err := lstdao.SelectAllot(artId)
list, err := lstdao.SelectAllot(artId, projectId)
if err != nil {
return nil, err
}
@ -326,6 +326,7 @@ func (impl *ArticleServiceImplement) UpdateOne(user *global.User, entity *model.
lstdao := dal.NewArticleAtcodLstDAO(session, user.PlantNr, user.UserId)
err = lstdao.DeleteWhere([]grmi.Predicate{
meta.ArticleAtcodLst_ArtId.NewPredicate(grmi.Equal, entity.ArtId),
meta.ArticleAtcodLst_ProjectId.NewPredicate(grmi.Equal, entity.ProjectId),
})
if err != nil {
_ = session.Rollback()


Loading…
Cancel
Save