Browse Source

属性组判断修正

pull/114/head
娄文智 3 years ago
parent
commit
413c90e0e0
2 changed files with 5 additions and 1 deletions
  1. +1
    -1
      dao/base/implments/AttributeGroupValst.dao.impl.go
  2. +4
    -0
      services/base/implments/AttributeGroup.service.impl.go

+ 1
- 1
dao/base/implments/AttributeGroupValst.dao.impl.go View File

@ -309,7 +309,7 @@ func (impl *AttributeGroupValstDAOImplement) UpdateWhere(predicates []grmi.Predi
func (impl *AttributeGroupValstDAOImplement) SelectAllot(attrGrpCode int) ([]model.Attribute, error) { func (impl *AttributeGroupValstDAOImplement) SelectAllot(attrGrpCode int) ([]model.Attribute, error) {
data := make([]model.Attribute, 0) 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) err := session.Find(&data)
if err != nil { if err != nil {


+ 4
- 0
services/base/implments/AttributeGroup.service.impl.go View File

@ -8,6 +8,7 @@ import (
"LAPP_GAAS_GFrame_BACKEND/grmi" "LAPP_GAAS_GFrame_BACKEND/grmi"
meta "LAPP_GAAS_GFrame_BACKEND/meta/base" meta "LAPP_GAAS_GFrame_BACKEND/meta/base"
model "LAPP_GAAS_GFrame_BACKEND/models/base" model "LAPP_GAAS_GFrame_BACKEND/models/base"
"LAPP_GAAS_GFrame_BACKEND/utils"
"LAPP_GAAS_GFrame_BACKEND/web/models" "LAPP_GAAS_GFrame_BACKEND/web/models"
) )
@ -196,6 +197,9 @@ func (impl *AttributeGroupServiceImplement) SelectOne(user *models.Usertab, attr
if err != nil { if err != nil {
return nil, err return nil, err
} }
if utils.ValueIsEmpty(result){
return nil, err
}
//获取已分配的属性集合 //获取已分配的属性集合
var attrCodes []int var attrCodes []int
for _,v := range list{ for _,v := range list{


Loading…
Cancel
Save