|
|
@ -247,7 +247,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *global.User, entities mod |
|
|
|
workLinePlaceDao := baseDal.NewWorkLineWorkPlaceLstDAO(session, user.PlantNr, user.UserId) |
|
|
|
workLineDao := baseDal.NewWorkLineDAO(session, user.PlantNr, user.UserId) |
|
|
|
sdao := dal.NewSerialOrderRutingDAO(session, user.PlantNr, user.UserId) |
|
|
|
|
|
|
|
serialOrderPoDao := omdal.NewSerialOrderPOLstDAO(session, user.PlantNr, user.UserId) |
|
|
|
orderId := entities.SerialorderId |
|
|
|
|
|
|
|
//获取物料id
|
|
|
@ -297,6 +297,20 @@ func (impl *DefectRecordServiceImplement) Insert(user *global.User, entities mod |
|
|
|
return grmi.NewBusinessError(err.Error()) |
|
|
|
} |
|
|
|
|
|
|
|
poDataLi, err := serialOrderPoDao.SelectWithPO(orderId, result.UsedResourceId) |
|
|
|
if err != nil { |
|
|
|
return grmi.NewBusinessError("查询工单工序操作数据失败, error:" + err.Error()) |
|
|
|
} |
|
|
|
opResult := false |
|
|
|
for _, poData := range poDataLi { |
|
|
|
if poData.Status != common.WO_STATUS_FINISHED { |
|
|
|
opResult = true |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if opResult && count <= 0 { |
|
|
|
return grmi.NewBusinessError("前序工序未完成!,请打点缺陷!") |
|
|
|
} |
|
|
|
if count <= 0 { |
|
|
|
err = session.Begin() |
|
|
|
if err != nil { |
|
|
|