|
|
@ -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 { |
|
|
|