Browse Source

缺陷采集保存修改

pull/275/head
娄文智 3 years ago
parent
commit
56a14dcaa7
2 changed files with 10 additions and 5 deletions
  1. +1
    -1
      models/qm/DefectRecord.model.go
  2. +9
    -4
      services/qm/implments/DefectRecord.service.impl.go

+ 1
- 1
models/qm/DefectRecord.model.go View File

@ -66,7 +66,7 @@ type DefectRecord struct {
LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"QM_DefectRecord-LastModify"`
LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"QM_DefectRecord-LastUser"`
CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"QM_DefectRecord-CreateTime"`
ArtId string `xorm:"-" json:"QM_DefectRecord-ArtId"`
OrderId string `xorm:"-" json:"QM_DefectRecord-OrderId"`
}
/******************************************************************************


+ 9
- 4
services/qm/implments/DefectRecord.service.impl.go View File

@ -12,6 +12,7 @@ import (
"LAPP_GAAS_GFrame_BACKEND/web/models"
"fmt"
"strconv"
"strings"
"time"
)
@ -248,8 +249,12 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
defer session.Close()
dao := dal.NewDefectRecordDAO(session, user.Pid, user.Userid)
artID := (*entities)[0].ArtId
orderId := (*entities)[0].OrderId
orderIds := strings.Split(orderId,"GAAS")
if len(orderIds) < 2{
return grmi.NewBusinessError("序列订单错误!")
}
artID := orderIds[0]
records, err := dao.Select([]grmi.Predicate{meta.DefectRecord_SerialOrderId.NewPredicate(grmi.Equal, artID)}, nil)
if err != nil {
return err
@ -301,12 +306,12 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
if area == nil {
return grmi.NewBusinessError(fmt.Sprintf("没有找到缺陷原因:%s#%d!", entity.ViewId, entity.AreaId))
}
artView, err := articleViewDAO.SelectOne(entity.ArtId, entity.ViewId)
artView, err := articleViewDAO.SelectOne(artID, entity.ViewId)
if err != nil {
return err
}
if artView == nil {
return grmi.NewBusinessError(fmt.Sprintf("没有找到Article(%s)和视图(%s)的关联!", entity.ArtId, entity.ViewId))
return grmi.NewBusinessError(fmt.Sprintf("没有找到Article(%s)和视图(%s)的关联!", artID, entity.ViewId))
}
viewGroup, err := viewGroupDAO.SelectOne(entity.ViewId, entity.DefectGrpId)
if err != nil {


Loading…
Cancel
Save