|
@@ -36,21 +36,29 @@ func SaveCentralKitchenForSchoolUserIdentity(c *gin.Context) { |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
now := time.Now() |
|
|
|
|
|
if isHasUserIdentity == nil { |
|
|
|
|
|
centralKitchenForSchoolSetDb := db.CentralKitchenForSchoolSetDb{} |
|
|
|
|
|
centralKitchenForSchoolSetDb.Set(req.EnterpriseId) |
|
|
|
|
|
set, err := centralKitchenForSchoolSetDb.GetCentralKitchenForSchoolSet() |
|
|
|
|
|
|
|
|
if isHasUserIdentity == nil && identity == enum.UserIdentityForCentralKitchenForTeacher { |
|
|
|
|
|
isHasUserIdentity, err = userIdentityDb.UserIdentityExist(req.EnterpriseId, req.IdNo, 1) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if identity != enum.UserIdentityForCentralKitchenForStudent && set.IsOpenLimitTeacherRegister == 1 { |
|
|
|
|
|
e.OutErr(c, e.ERR_NO_DATA, "当前身份信息不存在") |
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
if isHasUserIdentity == nil { |
|
|
|
|
|
centralKitchenForSchoolSetDb := db.CentralKitchenForSchoolSetDb{} |
|
|
|
|
|
centralKitchenForSchoolSetDb.Set(req.EnterpriseId) |
|
|
|
|
|
set, err := centralKitchenForSchoolSetDb.GetCentralKitchenForSchoolSet() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if set.IsOpenLimitTeacherRegister == 1 { |
|
|
|
|
|
e.OutErr(c, e.ERR_NO_DATA, "当前身份信息不存在") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
now := time.Now() |
|
|
|
|
|
if isHasUserIdentity == nil { |
|
|
//2、新增身份信息 |
|
|
//2、新增身份信息 |
|
|
userIdentity := &model.UserIdentity{ |
|
|
userIdentity := &model.UserIdentity{ |
|
|
Uid: user.Id, |
|
|
Uid: user.Id, |
|
|