|
|
|
@ -3,6 +3,7 @@ package BaseRolePersonDao
|
|
|
|
|
import (
|
|
|
|
|
"dsBaseRpc/Const"
|
|
|
|
|
"dsBaseRpc/RpcService/BaseRolePerson/BaseRolePersonProto"
|
|
|
|
|
"dsBaseRpc/RpcService/SysLoginperson/SysLoginpersonDao"
|
|
|
|
|
"dsBaseRpc/Utils/CommonUtil"
|
|
|
|
|
"dsBaseRpc/Utils/DbUtil"
|
|
|
|
|
"dsBaseRpc/Utils/RedisUtil"
|
|
|
|
@ -57,6 +58,33 @@ func PageBaseRolePerson(in *BaseRolePersonProto.QueryArg) ([]map[string]interfac
|
|
|
|
|
//分页
|
|
|
|
|
myBuilder.Limit(limit, offset)
|
|
|
|
|
list, count, err := SqlKit.QueryForPk(sql)
|
|
|
|
|
|
|
|
|
|
//判断人员的身份, 增加老师和学生的默认角色ID
|
|
|
|
|
identityId := SysLoginpersonDao.GetIdentityIdByPersonId(in.PersonId)
|
|
|
|
|
if identityId == 2 {
|
|
|
|
|
var _map = make(map[string]interface{})
|
|
|
|
|
_map["id"] = CommonUtil.GetUUID()
|
|
|
|
|
_map["id_int"] = -1
|
|
|
|
|
_map["role_id"] = "22222222-2222-2222-2222-222222222222"
|
|
|
|
|
_map["identity_id"] = 2
|
|
|
|
|
_map["person_id"] = in.PersonId
|
|
|
|
|
_map["rule_id"] = -1
|
|
|
|
|
_map["b_use"] = 1
|
|
|
|
|
_map["last_updated_time"] = CommonUtil.GetCurrentTimestamp()
|
|
|
|
|
list = append(list, _map)
|
|
|
|
|
}
|
|
|
|
|
if identityId == 3 {
|
|
|
|
|
var _map = make(map[string]interface{})
|
|
|
|
|
_map["id"] = CommonUtil.GetUUID()
|
|
|
|
|
_map["id_int"] = -1
|
|
|
|
|
_map["role_id"] = "33333333-3333-3333-3333-333333333333"
|
|
|
|
|
_map["identity_id"] = 2
|
|
|
|
|
_map["person_id"] = in.PersonId
|
|
|
|
|
_map["rule_id"] = -1
|
|
|
|
|
_map["b_use"] = 1
|
|
|
|
|
_map["last_updated_time"] = CommonUtil.GetCurrentTimestamp()
|
|
|
|
|
list = append(list, _map)
|
|
|
|
|
}
|
|
|
|
|
return list, count, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|