From a5032c13c6994b97c3624756090976cbb8b4f3c8 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 9 Feb 2022 16:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E9=94=AE=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/pln/HondaCalloffErrorLst.service.go | 19 +++++++++++++++++++ .../HondaCalloffErrorLst.service.impl.go | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) 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