作者 yangfu

公告修改

... ... @@ -133,7 +133,7 @@ type TemplateItem struct {
type VisibleObject struct {
Id int `json:"id"`
Name string `json:"name,omitempty"`
Name string `json:"name"`
Type int `json:"type"` //0:指定人员 1:部门
}
... ...
... ... @@ -7,7 +7,6 @@ import (
"oppmg/common/log"
"oppmg/models"
"oppmg/protocol"
"oppmg/services/agg"
"oppmg/utils"
"oppmg/utils/exceltool"
"strconv"
... ... @@ -189,14 +188,14 @@ func BulletinList(uid, companyId int64, request *protocol.BulletinListRequest) (
Status: int8(bulletin.Status),
CreateAt: bulletin.CreateAt.Format("2006-01-02 15:04:05"),
}
//if e:=json.Unmarshal([]byte(bulletin.Receiver),&item.Receiver);e!=nil{
// log.Error(e.Error())
// return
//}
if item.Receiver, err = agg.GetVisibleObject(bulletin.Receiver); err != nil {
log.Error(bulletin.Receiver, err.Error())
continue
if e := json.Unmarshal([]byte(bulletin.Receiver), &item.Receiver); e != nil {
log.Error(e.Error())
return
}
//if item.Receiver, err = agg.GetVisibleObject(bulletin.Receiver); err != nil {
// log.Error(bulletin.Receiver, err.Error())
// continue
//}
rsp.List = append(rsp.List, item)
}
... ... @@ -274,10 +273,14 @@ func GetBulletin(id int, companyId int64, request *protocol.GetBulletinRequest)
return
}
}
if rsp.Receiver, err = agg.GetVisibleObject(bulletin.Receiver); err != nil {
log.Error(err.Error())
if e := json.Unmarshal([]byte(bulletin.Receiver), &rsp.Receiver); e != nil {
log.Error(e.Error())
return
}
//if rsp.Receiver, err = agg.GetVisibleObject(bulletin.Receiver); err != nil {
// log.Error(err.Error())
// return
//}
return
}
... ...