From 2936b32eca3b8f4a1c306eab63358369e0d3b767 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Wed, 26 May 2021 15:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E5=88=86=E9=85=8D=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dao/base/implments/ArticleAtcodLst.dao.impl.go | 11 +++++++++-- models/base/base.go | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dao/base/implments/ArticleAtcodLst.dao.impl.go b/dao/base/implments/ArticleAtcodLst.dao.impl.go index b23065b..97d38dd 100644 --- a/dao/base/implments/ArticleAtcodLst.dao.impl.go +++ b/dao/base/implments/ArticleAtcodLst.dao.impl.go @@ -309,14 +309,21 @@ func (impl *ArticleAtcodLstDAOImplement) UpdateWhere(predicates []grmi.Predicate ******************************************************************************/ func (impl *ArticleAtcodLstDAOImplement) SelectAllot(artId string) ([]model.Attribute, error) { - data := make([]model.Attribute, 0) + 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) err := session.Find(&data) + for _,v := range data{ + one := model.Attribute{} + one = v.Attribute + one.AttrValue = v.ArticleAtcodLst.AttrValue + datalist = append(datalist,one) + } if err != nil { return nil, grmi.NewDataBaseError(err) } - return data, nil + return datalist, nil } /****************************************************************************** diff --git a/models/base/base.go b/models/base/base.go index 7fd5818..da6dc23 100644 --- a/models/base/base.go +++ b/models/base/base.go @@ -72,3 +72,20 @@ type WorkLineData struct { EndDate string `json:"endDate"` WorkLineid string `json:"workLineId"` } + +/****************************************************************************** + * + * @Struct Name : ArtData + *----------------------------------------------------------------------------- + * + * @Description : 物料分配属性 + * + * @Author : 娄文智 + * + * @Date : 2021-05-26 + * + ******************************************************************************/ +type ArtData struct { + Attribute `xorm:"extends"` + ArticleAtcodLst `xorm:"extends"` +}