|
|
|
@ -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)
|
|
|
|
|