diff --git a/dsBaseRpc/Config/Config.ini b/dsBaseRpc/Config/Config.ini index e260b497..05c75446 100644 --- a/dsBaseRpc/Config/Config.ini +++ b/dsBaseRpc/Config/Config.ini @@ -30,7 +30,7 @@ project_name = dsBaseRpc # 数据汇集的地址 [dataExchange] #host = http://10.10.14.186:9009 -host = http://10.10.14.239:9009 +host = http://10.10.14.213:9009 exchangeUrl = /v1/dataex/DataexSet SystemAuthUrl = /v1/dataex/SystemAuth SystemId = BASE_GO diff --git a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go index 6a5f65ed..876e7fd8 100644 --- a/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go +++ b/dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonService/BaseRolePersonService.go @@ -6,6 +6,7 @@ import ( "dsBaseRpc/Const/ErrorConst" "dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonDao" "dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonProto" + "dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao" "dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao" "dsBaseRpc/Utils/CommonUtil" "dsBaseRpc/Utils/LogUtil" @@ -308,7 +309,7 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch if list[i]["rule_id"].(string)[len(list[i]["rule_id"].(string))-2:] == "00" && list[i]["rule_id"].(string)[0:4] == areaCodes[j][0:4] { found = true break - } else if list[i]["rule_id"].(string) == areaCodes[j] {//如果是本级 + } else if list[i]["rule_id"].(string) == areaCodes[j] { //如果是本级 found = true break } @@ -389,11 +390,18 @@ func (s *Rpc) CheckDataPrivilege(ctx context.Context, in *BaseRolePersonProto.Ch return &reply, err } found = true + //l3:因人员与单位部门关系扩展为一对多的关系,所以,这里需要检查人员所在哪些单位,一旦有一个单位符合条件,即标识可以进行操作。 + l3, _, err := BaseTeacherDao.GetPersonAllBureauXZQH(in.PersonId[0]) + if err != nil { + reply.Success = false + reply.Message = "查询人员所在的单位信息(行政区划)失败!" + return &reply, err + } for i := range list { - for j := range l2 { - if l2[j]["city_code"].(string) != list[i]["rule_id"].(string) && - l2[j]["district_code"].(string) != list[i]["rule_id"].(string) && - l2[j]["bureau_id"].(string) != list[i]["rule_id"].(string) { + for j := range l3 { + if l3[j]["city_code"].(string) != list[i]["rule_id"].(string) && + l3[j]["district_code"].(string) != list[i]["rule_id"].(string) && + l3[j]["bureau_id"].(string) != list[i]["rule_id"].(string) { found = false break } diff --git a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go index 770e2e10..5dc61c7a 100644 --- a/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go +++ b/dsBaseRpc/RpcService/BaseTeacher/BaseTeacherDao/BaseTeacherDao.go @@ -1323,6 +1323,13 @@ func PageTeacherMultipleBureau(in *BaseTeacherProto.PageMultipleBureauArg) ([]ma return list, int32(len(list)), nil } +//获取指定人员所在单位的行政区划列表 +func GetPersonAllBureauXZQH(personId string) ([]map[string]interface{}, int32, error) { + sql := `select bureau_id,province_code,city_code,district_code from t_base_teacher_org where person_id=?` + list, err := db.SQL(sql, personId).Query().List() + return list, int32(len(list)), err +} + //设置主单位 func SettingMainOrg(in *BaseTeacherProto.SettingMainOrgArg) (bool, string, error) { //将旧的设置为删除状态