|
|
|
@ -55,6 +55,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg)
|
|
|
|
|
var reply BaseStudentProto.Reply
|
|
|
|
|
//==========================================
|
|
|
|
|
//检查身份证的有效性
|
|
|
|
|
if len(in.Sfzjh) > 0 {
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "01" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
@ -67,6 +68,7 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg)
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//==========================================
|
|
|
|
|
//调用dao
|
|
|
|
|
model := new(models.TBaseStudent)
|
|
|
|
@ -261,6 +263,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA
|
|
|
|
|
|
|
|
|
|
//==========================================
|
|
|
|
|
//检查身份证的有效性
|
|
|
|
|
if len(in.Sfzjh) > 0 {
|
|
|
|
|
IdCardNo := []byte(in.Sfzjh)
|
|
|
|
|
if in.Sfzjlxm == "1" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) {
|
|
|
|
|
reply.Success = false
|
|
|
|
@ -273,6 +276,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA
|
|
|
|
|
reply.Message = "证件号在系统中已存在,无法创建!"
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//==========================================
|
|
|
|
|
model := new(models.TBaseStudent)
|
|
|
|
|
//身份证件号
|
|
|
|
|