Browse Source

添加查询包装单子项时 搜索物料描述

pull/107/head
zhangxin 3 years ago
parent
commit
fbed75b416
2 changed files with 17 additions and 0 deletions
  1. +1
    -0
      models/jit/PackOrderItemLst.model.go
  2. +16
    -0
      services/jit/implments/PackOrder.service.impl.go

+ 1
- 0
models/jit/PackOrderItemLst.model.go View File

@ -34,6 +34,7 @@ type PackOrderItemLst struct {
LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"JIT_PackOrderItemLst-LastModify"`
LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"JIT_PackOrderItemLst-LastUser"`
CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"JIT_PackOrderItemLst-CreateTime"`
ArtDesc string `xorm:"-" json:"JIT_PackOrderItemLst-ArtDesc"`
}
/******************************************************************************


+ 16
- 0
services/jit/implments/PackOrder.service.impl.go View File

@ -10,6 +10,7 @@ import (
"LAPP_ACURA_MOM_BACKEND/db"
"LAPP_ACURA_MOM_BACKEND/global"
"LAPP_ACURA_MOM_BACKEND/grmi"
baseMeta "LAPP_ACURA_MOM_BACKEND/meta/base"
meta "LAPP_ACURA_MOM_BACKEND/meta/jit"
omMeta "LAPP_ACURA_MOM_BACKEND/meta/om"
baseModel "LAPP_ACURA_MOM_BACKEND/models/base"
@ -182,6 +183,21 @@ func (impl *PackOrderServiceImplement) SelectOne(user *global.User, packOrderId
if err != nil {
return nil, grmi.NewBusinessError("查询包装单子项数据失败, error:" + err.Error())
}
artIdLi := make([]interface{}, 0, len(itemLi))
for _, item := range itemLi {
artIdLi = append(artIdLi, item.PartId)
}
articleDao := baseDal.NewArticleDAO(session, user.PlantNr, user.UserId)
articleLi, err := articleDao.Select([]grmi.Predicate{baseMeta.Article_ProjectId.NewPredicate(grmi.Equal, result.ProjectId), baseMeta.Article_ArtId.NewPredicate(grmi.Include, artIdLi...)}, nil)
if err != nil {
return nil, grmi.NewBusinessError("查询物料数据失败, error:" + err.Error())
}
artMap := make(map[string]string, len(articleLi))
for index, item := range itemLi {
artDesc := artMap[item.PartId]
item.ArtDesc = artDesc
itemLi[index] = item
}
result.PackOrderItemLstLi = itemLi
return result, nil
}


Loading…
Cancel
Save