DengBiao 11 місяці тому
джерело
коміт
d0e7e0c5f1
1 змінених файлів з 37 додано та 4 видалено
  1. +37
    -4
      app/admin/svc/enterprise_manage/svc_self_support_for_school.go

+ 37
- 4
app/admin/svc/enterprise_manage/svc_self_support_for_school.go Переглянути файл

@@ -412,11 +412,44 @@ func SelfSupportForSchoolStudentUpdate(req md.SelfSupportForSchoolStudentUpdateR
_ = session.Rollback()
return
}
info.CollectFaceType = req.CollectFaceType
_, err = selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoUpdate(info, "collect_face_type")
if err != nil {
_ = session.Rollback()
if info == nil {
now := time.Now()
selfSupportForSchoolInfoDb := db.SelfSupportForSchoolInfoDb{}
selfSupportForSchoolInfoDb.Set(req.EnterpriseId)
selfSupportForSchoolInfo, err := selfSupportForSchoolInfoDb.GetSelfSupportForSchoolInfo()
if err != nil {
return
}
if selfSupportForSchoolInfo == nil {
return errors.New("当前学校暂未完成《一脸通行入驻》")
}
info = &model.SelfSupportForUserFaceInfo{
EnterpriseId: req.EnterpriseId,
UserIdentityId: req.UserIdentityId,
CollectFaceType: req.CollectFaceType,
SchoolCode: selfSupportForSchoolInfo.SchoolCode,
SchoolStdCode: selfSupportForSchoolInfo.SchoolStdCode,
ParentUserId: "",
ParentLogonId: "",
UserId: "",
SchoolFacePassStatus: "CLOSE",
SchoolFacePaymentStatus: "CLOSE",
ConcentrateSchoolFacePassStatus: 1,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err1 := selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoInsert(info)
if err1 != nil {
return err1
}
} else {
info.CollectFaceType = req.CollectFaceType
_, err = selfSupportForUserFaceInfoDb.SelfSupportForUserFaceInfoUpdate(info, "collect_face_type")
if err != nil {
_ = session.Rollback()
}
}

return session.Commit()
}



Завантаження…
Відмінити
Зберегти