From 413c90e0e0498dc0b98cd0365d040ddc54fcb161 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Fri, 16 Apr 2021 13:14:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=BB=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/base/implments/AttributeGroupValst.dao.impl.go | 2 +- services/base/implments/AttributeGroup.service.impl.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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{