|
|
|
@ -92,17 +92,19 @@ func (s *Rpc) AddBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg)
|
|
|
|
|
var reply BaseTeacherProto.Reply
|
|
|
|
|
//==========================================
|
|
|
|
|
//检查身份证的有效性
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "01" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "身份证号在不符合检查要求!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
//是不是重复
|
|
|
|
|
if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, "") {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
if len(in.Sfzjh) > 0 {
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "01" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "身份证号在不符合检查要求!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
//是不是重复
|
|
|
|
|
if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, "") {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//==========================================
|
|
|
|
|
//如果是手机号,是不是合法
|
|
|
|
@ -260,17 +262,19 @@ func (s *Rpc) UpdateBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelA
|
|
|
|
|
var reply BaseTeacherProto.Reply
|
|
|
|
|
|
|
|
|
|
//检查身份证的有效性
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "1" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "身份证号在不符合检查要求!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
//是不是重复
|
|
|
|
|
if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, in.PersonId) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
if len(in.Sfzjh) > 0 {
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "1" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "身份证号在不符合检查要求!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
//是不是重复
|
|
|
|
|
if !SysLoginpersonDao.IsValidIdCardNo(in.Sfzjh, in.PersonId) {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//如果是手机号,是不是合法
|
|
|
|
@ -540,7 +544,7 @@ func (s *Rpc) DeleteTeacherMultipleBureau(ctx context.Context, in *BaseTeacherPr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//设置主单位
|
|
|
|
|
func (s *Rpc) SettingMainOrg (ctx context.Context, in *BaseTeacherProto.SettingMainOrgArg) (*BaseTeacherProto.Reply, error){
|
|
|
|
|
func (s *Rpc) SettingMainOrg(ctx context.Context, in *BaseTeacherProto.SettingMainOrgArg) (*BaseTeacherProto.Reply, error) {
|
|
|
|
|
//异常处理
|
|
|
|
|
defer func() {
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
@ -560,4 +564,4 @@ func (s *Rpc) SettingMainOrg (ctx context.Context, in *BaseTeacherProto.Setting
|
|
|
|
|
reply.Success = success
|
|
|
|
|
reply.Message = message
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|