|
|
|
@ -19,6 +19,7 @@ import (
|
|
|
|
|
"dsBaseRpc/Utils/PinYinUtil"
|
|
|
|
|
"dsBaseRpc/Utils/SqlKit"
|
|
|
|
|
"dsBaseRpc/models"
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -36,8 +37,9 @@ func (s *Rpc) GetBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg)
|
|
|
|
|
var reply BaseTeacherProto.Reply
|
|
|
|
|
//通用获取单条
|
|
|
|
|
list := SqlKit.QueryByIds([]string{in.PersonId}, "t_base_teacher")
|
|
|
|
|
//处理从教年月
|
|
|
|
|
|
|
|
|
|
if len(list) > 0 {
|
|
|
|
|
//处理从教年月
|
|
|
|
|
if list[0]["cjny"].(string)[0:4] == "1900" {
|
|
|
|
|
list[0]["cjny"] = ""
|
|
|
|
|
}
|
|
|
|
@ -50,6 +52,25 @@ func (s *Rpc) GetBaseTeacher(ctx context.Context, in *BaseTeacherProto.ModelArg)
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
list[0]["org_name"] = orgName
|
|
|
|
|
//人员所在单位,获取人员在此单位下的职务
|
|
|
|
|
if in.BureauId != "" {
|
|
|
|
|
positionArray, err := BaseTeacherDao.GetPositionInfoByPersonIdAndBureauId(in.PersonId, in.BureauId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.DataBaseActionError
|
|
|
|
|
LogUtil.Error(ErrorConst.SqlQueryError, "执行GetPositionInfoByPersonIdAndBureauId时发生严重错误:"+err.Error())
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
//转换数组为JSON数据格式
|
|
|
|
|
b, err := json.Marshal(positionArray)
|
|
|
|
|
if err != nil {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.DataBaseActionError
|
|
|
|
|
LogUtil.Error(ErrorConst.SqlQueryError, "执行positionArray转JSON时发生严重错误:"+err.Error())
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
list[0]["position_id_array"] = string(b)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//将结果序列化
|
|
|
|
|
reply.Success = true
|
|
|
|
|