Browse Source

零件分配属性

pull/279/head
娄文智 3 years ago
parent
commit
2936b32eca
2 changed files with 26 additions and 2 deletions
  1. +9
    -2
      dao/base/implments/ArticleAtcodLst.dao.impl.go
  2. +17
    -0
      models/base/base.go

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

@ -309,14 +309,21 @@ func (impl *ArticleAtcodLstDAOImplement) UpdateWhere(predicates []grmi.Predicate
******************************************************************************/ ******************************************************************************/
func (impl *ArticleAtcodLstDAOImplement) SelectAllot(artId string) ([]model.Attribute, error) { 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) 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) 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 { if err != nil {
return nil, grmi.NewDataBaseError(err) return nil, grmi.NewDataBaseError(err)
} }
return data, nil
return datalist, nil
} }
/****************************************************************************** /******************************************************************************


+ 17
- 0
models/base/base.go View File

@ -72,3 +72,20 @@ type WorkLineData struct {
EndDate string `json:"endDate"` EndDate string `json:"endDate"`
WorkLineid string `json:"workLineId"` WorkLineid string `json:"workLineId"`
} }
/******************************************************************************
*
* @Struct Name : ArtData
*-----------------------------------------------------------------------------
*
* @Description : 物料分配属性
*
* @Author : 娄文智
*
* @Date : 2021-05-26
*
******************************************************************************/
type ArtData struct {
Attribute `xorm:"extends"`
ArticleAtcodLst `xorm:"extends"`
}

Loading…
Cancel
Save