diff --git a/services/pln/HondaCalloffErrorLst.service.go b/services/pln/HondaCalloffErrorLst.service.go index aec9d83..17f1313 100644 --- a/services/pln/HondaCalloffErrorLst.service.go +++ b/services/pln/HondaCalloffErrorLst.service.go @@ -220,6 +220,25 @@ type HondaCalloffErrorLstService interface { * ******************************************************************************/ RepairError(user *global.User, calloffId string, pos int) error + /****************************************************************************** + * + * @Function Name : RepairAllError + *----------------------------------------------------------------------------- + * + * @Description : 修复所有错误 + * + * @Function Parameters : 当前访问人员信息 + * + * @Function Parameters : callOffId string + * + * @Return Value : 执行时发生的错误 + * + * @Author : zhangxin + * + * @Date : 2022-02-09 + * + ******************************************************************************/ + RepairAllError(user *global.User, calloffId string) error } /****************************************************************************** diff --git a/services/pln/implments/HondaCalloffErrorLst.service.impl.go b/services/pln/implments/HondaCalloffErrorLst.service.impl.go index dd45a5d..604f050 100644 --- a/services/pln/implments/HondaCalloffErrorLst.service.impl.go +++ b/services/pln/implments/HondaCalloffErrorLst.service.impl.go @@ -350,4 +350,23 @@ func (impl *HondaCalloffErrorLstServiceImplement) RepairError(user *global.User, return grmi.NewBusinessError("更新错误项数据失败, error:" + err.Error()) } return nil +} + + +// RepairAllError 修复所有错误项数据 +func (impl *HondaCalloffErrorLstServiceImplement) RepairAllError(user *global.User, calloffId string) error { + grmi.Log(user, "/services/pln/implments/HondaCalloffErrorLst.service.impl.go", "RepairAllError", "修复所有错误项数据") + + engine := db.Eloquent.Master() + session := engine.NewSession() + defer session.Close() + dao := dal.NewHondaCalloffErrorLstDAO(session, user.PlantNr, user.UserId) + updateData := model.HondaCalloffErrorLst{ + ErrorStatus: model.ERROR_STATUS_OFF, + } + err := dao.UpdateWhere([]grmi.Predicate{meta.HondaCalloffErrorLst_CalloffId.NewPredicate(grmi.Equal, calloffId)}, &updateData, meta.HondaCalloffErrorLst_ErrorStatus.Name) + if err != nil { + return grmi.NewBusinessError("更新错误项状态失败, error:" + err.Error()) + } + return nil } \ No newline at end of file