Browse Source

添加一键修复功能

pull/134/head
zhangxin 3 years ago
parent
commit
a5032c13c6
2 changed files with 38 additions and 0 deletions
  1. +19
    -0
      services/pln/HondaCalloffErrorLst.service.go
  2. +19
    -0
      services/pln/implments/HondaCalloffErrorLst.service.impl.go

+ 19
- 0
services/pln/HondaCalloffErrorLst.service.go View File

@ -220,6 +220,25 @@ type HondaCalloffErrorLstService interface {
* *
******************************************************************************/ ******************************************************************************/
RepairError(user *global.User, calloffId string, pos int) error 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
} }
/****************************************************************************** /******************************************************************************


+ 19
- 0
services/pln/implments/HondaCalloffErrorLst.service.impl.go View File

@ -350,4 +350,23 @@ func (impl *HondaCalloffErrorLstServiceImplement) RepairError(user *global.User,
return grmi.NewBusinessError("更新错误项数据失败, error:" + err.Error()) return grmi.NewBusinessError("更新错误项数据失败, error:" + err.Error())
} }
return nil 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
} }

Loading…
Cancel
Save