diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go index 54af258c..7dbef4d9 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go @@ -51,7 +51,7 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto //1、检查非空 if len(in.OrgCode) == 0 { reply.Success = false - reply.Message = "OrgCode代码为空,不能创建!" + reply.Message = "编码代码为空,不能创建!" return &reply, nil } //2、检查AreaCode是否存在,不存在需要提示 @@ -64,7 +64,7 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto } if !exist { reply.Success = false - reply.Message = "AreaCode代码不存在,不能创建!" + reply.Message = "区域代码不存在,不能创建!" return &reply, nil } } @@ -81,7 +81,7 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto } if exist { reply.Success = false - reply.Message = "org_code已存在,无法创建!" + reply.Message = "编码已存在,无法创建!" return &reply, err } @@ -95,7 +95,7 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto } if exist { reply.Success = false - reply.Message = "org_name已存在,不能创建!" + reply.Message = "单位/部门名称已存在,不能创建!" return &reply, err } //5、调用dao @@ -247,7 +247,7 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if count > 0 { reply.Success = false - reply.Message = "单位/部门:" + in.Ids[i] + "下存在教工数据,无法删除!" + reply.Message = "单位/部门下存在教工数据,无法删除!" return &reply, err } //判断部门下是不是有可用的子部门 @@ -260,7 +260,7 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if count > 0 { reply.Success = false - reply.Message = "单位/部门:" + in.Ids[i] + "下存在子部门,无法删除!" + reply.Message = "单位/部门下存在子部门,无法删除!" return &reply, err } //判断是不是有可用的班级 @@ -277,7 +277,7 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if count > 0 { reply.Success = false - reply.Message = "单位/部门:" + in.Ids[i] + "下存在班级数据,无法删除!" + reply.Message = "单位/部门下存在班级数据,无法删除!" return &reply, err } } @@ -341,7 +341,7 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if exist { reply.Success = false - reply.Message = "org_code已存在,无法修改!" + reply.Message = "编码已存在,无法修改!" return &reply, err } //2、检查机构名称是否存在,否则在导入人员时,不知道向哪个单位下进行导入 @@ -354,7 +354,7 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr } if exist { reply.Success = false - reply.Message = "org_name已存在,无法修改!" + reply.Message = "单位/部门名称已存在,无法修改!" return &reply, err } //3、修改 @@ -479,7 +479,7 @@ func (s *Rpc) PageBaseOrganization(ctx context.Context, in *BaseOrganizationProt } if !exist { reply.Success = false - reply.Message = "传入的area_code不存在!" + reply.Message = "传入的区域代码不存在!" return &reply, nil } list, count, err := BaseOrganizationDao.PageBaseOrganization(in) diff --git a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go index 62849b4b..b51dab0f 100644 --- a/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go +++ b/dsBaseRpc/RpcService/BaseStudent/BaseStudentService/BaseStudentService.go @@ -71,6 +71,13 @@ func (s *Rpc) AddBaseStudent(ctx context.Context, in *BaseStudentProto.ModelArg) model.Sfzjlxm = in.Sfzjlxm //如果是身份证 if model.Sfzjlxm == "1" { + //如果是身份证 + by := []byte(in.Sfzjh) + if !IdCardUtil.IsValidIdCardNo(&by) { + reply.Success = false + reply.Message = "身份证号不合法!" + return &reply, nil + } //根据身份证号,提取男女,出生日期 _, birthday, xbm := IdCardUtil.GetIdCardNoInfo(in.Sfzjh) model.Csrq = DateUtil.ConvertDateTime(birthday) @@ -231,7 +238,7 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA //========================================== //检查身份证的有效性 IdCardNo := []byte(in.Sfzjh) - if in.Sfzjlxm == "01" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) { + if in.Sfzjlxm == "1" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) { reply.Success = false reply.Message = "身份证号在不符合检查要求!" return &reply, nil @@ -249,6 +256,13 @@ func (s *Rpc) UpdateBaseStudent(ctx context.Context, in *BaseStudentProto.ModelA model.Sfzjlxm = in.Sfzjlxm //如果是身份证 if model.Sfzjlxm == "1" { + //如果是身份证 + by := []byte(in.Sfzjh) + if !IdCardUtil.IsValidIdCardNo(&by) { + reply.Success = false + reply.Message = "身份证号不合法!" + return &reply, nil + } //根据身份证号,提取男女,出生日期 _, birthday, xbm := IdCardUtil.GetIdCardNoInfo(in.Sfzjh) model.Csrq = DateUtil.ConvertDateTime(birthday) diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go index f568ed2b..223eda1f 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherService/BaseTeacherService.go @@ -93,14 +93,14 @@ func (s *Rpc) AddBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg) model.Cym = in.Cym model.Sfzjlxm = in.Sfzjlxm model.Sfzjh = in.Sfzjh - //如果是身份证 - by := []byte(in.Sfzjh) - if !IdCardUtil.IsValidIdCardNo(&by) { - reply.Success = false - reply.Message = "身份证号不合法!" - return &reply, nil - } if model.Sfzjlxm == "1" { + //如果是身份证 + by := []byte(in.Sfzjh) + if !IdCardUtil.IsValidIdCardNo(&by) { + reply.Success = false + reply.Message = "身份证号不合法!" + return &reply, nil + } //根据身份证号,提取男女,出生日期 _, birthday, xbm := IdCardUtil.GetIdCardNoInfo(in.Sfzjh) model.Csrq = DateUtil.ConvertDateTime(birthday) @@ -230,7 +230,7 @@ func (s *Rpc) UpdateBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelA //检查身份证的有效性 IdCardNo := []byte(in.Sfzjh) - if in.Sfzjlxm == "01" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) { + if in.Sfzjlxm == "1" && !IdCardUtil.IsValidIdCardNo(&IdCardNo) { reply.Success = false reply.Message = "身份证号在不符合检查要求!" return &reply, nil diff --git a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go index c969e793..d6250a01 100644 --- a/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go +++ b/dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao/SysLoginpersonDao.go @@ -117,7 +117,7 @@ func PageSysLoginPerson(in *SysLoginpersonProto.QueryArg) ([]map[string]interfac //接收传入参数 var limit = int(in.Limit) var offset = int((in.Page - 1) * in.Limit) - var myBuilder = builder.Dialect(builder.MYSQL).Select("t1.*").From("t_sys_loginperson as t1"). + var myBuilder = builder.Dialect(builder.MYSQL).Select("t1.*,t3.org_name").From("t_sys_loginperson as t1"). InnerJoin("t_base_role_person as t2", "t1.person_id=t2.person_id"). InnerJoin("t_base_organization as t3", "t2.rule_id=t3.bureau_id"). Where(builder.Eq{"t3.area_code": in.AreaCode}).