|
|
|
@ -20,6 +20,7 @@ import (
|
|
|
|
|
"dsBaseRpc/Utils/PinYinUtil"
|
|
|
|
|
"dsBaseRpc/Utils/SqlKit"
|
|
|
|
|
"dsBaseRpc/models"
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
@ -38,7 +39,25 @@ func (s *Rpc) GetBaseOrganization(ctx context.Context, in *BaseOrganizationProto
|
|
|
|
|
var reply BaseOrganizationProto.Reply
|
|
|
|
|
//使用通用方法获取单条记录
|
|
|
|
|
list := SqlKit.QueryByIds([]string{in.OrgId}, "t_base_organization")
|
|
|
|
|
|
|
|
|
|
if len(list) > 0 {
|
|
|
|
|
//扩展一下附设班信息
|
|
|
|
|
fsbArray, err := BaseOrganizationDao.GetFsb(in.BureauId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.DataBaseActionError
|
|
|
|
|
LogUtil.Error(ErrorConst.SqlQueryError, "执行GetFsb时发生严重错误:"+err.Error())
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
//转换数组为JSON数据格式
|
|
|
|
|
b, err := json.Marshal(fsbArray)
|
|
|
|
|
if err != nil {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.DataBaseActionError
|
|
|
|
|
LogUtil.Error(ErrorConst.SqlQueryError, "执行fsbArray转JSON时发生严重错误:"+err.Error())
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
list[0]["fsb"] = string(b)
|
|
|
|
|
}
|
|
|
|
|
//将结果序列化
|
|
|
|
|
reply.Success = true
|
|
|
|
|
reply.Count = 1
|
|
|
|
@ -213,7 +232,7 @@ func (s *Rpc) AddBaseOrganization(ctx context.Context, in *BaseOrganizationProto
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
//保存附设班信息
|
|
|
|
|
BaseOrganizationDao.ModifyFsb(model.BureauId, in.FsbIds)
|
|
|
|
|
BaseOrganizationDao.UpdateFsb(model.BureauId, in.FsbIds)
|
|
|
|
|
// *********************************************************************//
|
|
|
|
|
// 组织机构类型 1:教育局 2:学校 3:部门 4:院 5:系 6:专业 7:教辅单位,8:大学区
|
|
|
|
|
// 如果是学校,教辅单位,大学区的话,需要生成管理员账号
|
|
|
|
@ -494,8 +513,8 @@ func (s *Rpc) UpdateBaseOrganization(ctx context.Context, in *BaseOrganizationPr
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
//保存附设班信息
|
|
|
|
|
BaseOrganizationDao.ModifyFsb(model.BureauId, in.FsbIds)
|
|
|
|
|
|
|
|
|
|
BaseOrganizationDao.UpdateFsb(model.BureauId, in.FsbIds)
|
|
|
|
|
|
|
|
|
|
//是否传递了部门管理员 ,黄海添加于2020-06-04
|
|
|
|
|
if len(in.OrgManagerIds) > 0 && len(in.OrgManagerIds[0]) > 0 {
|
|
|
|
|
err = BaseOrganizationManagerDao.UpdateOrgManager(model.OrgId, in.OrgManagerIds)
|
|
|
|
|