diff --git a/dao/base/implments/AttributeGroupValst.dao.impl.go b/dao/base/implments/AttributeGroupValst.dao.impl.go index 1a7330d..d71019e 100644 --- a/dao/base/implments/AttributeGroupValst.dao.impl.go +++ b/dao/base/implments/AttributeGroupValst.dao.impl.go @@ -309,7 +309,7 @@ func (impl *AttributeGroupValstDAOImplement) UpdateWhere(predicates []grmi.Predi func (impl *AttributeGroupValstDAOImplement) SelectAllot(attrGrpCode int) ([]model.Attribute, error) { data := make([]model.Attribute, 0) - session := impl.session.Table(meta.Attribute.TableName).Join("LEFT",meta.AttributeGroupValst.TableName,"AttributeGroupValst.AttrCode = Attribute.AttrCode").Where("Attribute.PlantNr = ? and AttributeGroupValst.AttrCode = ?", impl.plantNr, attrGrpCode) + session := impl.session.Table(meta.Attribute.TableName).Join("LEFT",meta.AttributeGroupValst.TableName,"AttributeGroupValst.PlantNr = Attribute.PlantNr and AttributeGroupValst.AttrCode = Attribute.AttrCode").Where("AttributeGroupValst.PlantNr = ? and AttributeGroupValst.AttrGrpCode = ?", impl.plantNr, attrGrpCode) err := session.Find(&data) if err != nil { diff --git a/services/base/implments/AttributeGroup.service.impl.go b/services/base/implments/AttributeGroup.service.impl.go index 25d1af9..6ff257f 100644 --- a/services/base/implments/AttributeGroup.service.impl.go +++ b/services/base/implments/AttributeGroup.service.impl.go @@ -8,6 +8,7 @@ import ( "LAPP_GAAS_GFrame_BACKEND/grmi" meta "LAPP_GAAS_GFrame_BACKEND/meta/base" model "LAPP_GAAS_GFrame_BACKEND/models/base" + "LAPP_GAAS_GFrame_BACKEND/utils" "LAPP_GAAS_GFrame_BACKEND/web/models" ) @@ -196,6 +197,9 @@ func (impl *AttributeGroupServiceImplement) SelectOne(user *models.Usertab, attr if err != nil { return nil, err } + if utils.ValueIsEmpty(result){ + return nil, err + } //获取已分配的属性集合 var attrCodes []int for _,v := range list{