|
|
|
@ -85,7 +85,11 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto
|
|
|
|
|
}
|
|
|
|
|
if exist {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "代码已存在,无法创建!"
|
|
|
|
|
if isBuMen {
|
|
|
|
|
reply.Message = "部门代码已存在,无法创建!"
|
|
|
|
|
} else {
|
|
|
|
|
reply.Message = "单位代码已存在,无法创建!"
|
|
|
|
|
}
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -256,9 +260,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
if count > 0 {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
//判断是单位还是部门
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) {
|
|
|
|
|
reply.Message = "部门下存在教工数据,无法删除!"
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
reply.Message = "单位下存在教工数据,无法删除!"
|
|
|
|
|
}
|
|
|
|
|
return &reply, err
|
|
|
|
@ -274,9 +278,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
if count > 0 {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
//判断是单位还是部门
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) {
|
|
|
|
|
reply.Message = "部门下存在子部门,无法删除!"
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
reply.Message = "单位下存在子部门,无法删除!"
|
|
|
|
|
}
|
|
|
|
|
return &reply, err
|
|
|
|
@ -296,9 +300,9 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
if count > 0 {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
//判断是单位还是部门
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId){
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) {
|
|
|
|
|
reply.Message = "部门下存在班级,无法删除!"
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
reply.Message = "单位下存在班级,无法删除!"
|
|
|
|
|
}
|
|
|
|
|
return &reply, err
|
|
|
|
@ -373,7 +377,12 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
|
|
|
|
|
if exist {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = "代码已存在,无法修改!"
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(in.OrgId){
|
|
|
|
|
reply.Message = "部门代码已存在,无法修改!"
|
|
|
|
|
}else{
|
|
|
|
|
reply.Message = "部门代码已存在,无法修改!"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
//2、检查机构名称是否存在,否则在导入人员时,不知道向哪个单位下进行导入
|
|
|
|
@ -386,9 +395,9 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
}
|
|
|
|
|
if exist {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(in.OrgId){
|
|
|
|
|
if BaseOrganizationDao.IsBuMen(in.OrgId) {
|
|
|
|
|
reply.Message = "部门名称已存在,无法修改!"
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
reply.Message = "单位名称已存在,无法修改!"
|
|
|
|
|
}
|
|
|
|
|
return &reply, err
|
|
|
|
|