...
|
...
|
@@ -74,6 +74,11 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe |
|
|
if msg.IsRead == 1 {
|
|
|
return
|
|
|
}
|
|
|
//if msg.SourceType==protocol.SourceTypeBulletin{//公告已读
|
|
|
// if !checkBulletinCanRead(msg.SourceId){
|
|
|
// return
|
|
|
// }
|
|
|
//}
|
|
|
err = models.UpdateUserMsgSetRead(header.UserId, header.CompanyId, request.MsgType, request.MsgId)
|
|
|
if err != nil {
|
|
|
log.Error(err)
|
...
|
...
|
@@ -81,6 +86,20 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe |
|
|
return
|
|
|
}
|
|
|
|
|
|
//检查公告可否可以读
|
|
|
func checkBulletinCanRead(sourceId int64) bool {
|
|
|
var bulletin *models.Bulletin
|
|
|
var err error
|
|
|
if bulletin, err = models.GetBulletinById(int(sourceId)); err != nil {
|
|
|
log.Error(sourceId, err)
|
|
|
return false
|
|
|
}
|
|
|
if bulletin.AllowClose == 0 {
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
//标记全部已读
|
|
|
func MsgCenterAllRead(header *protocol.RequestHeader, request *protocol.MsgCenterAllReadRequest) (rsp *protocol.MsgCenterAllReadResponse, err error) {
|
|
|
var ()
|
...
|
...
|
@@ -355,14 +374,14 @@ func MsgChanceSubmit(header *protocol.RequestHeader, request *protocol.MsgChance |
|
|
commItem.Chance = item
|
|
|
}
|
|
|
|
|
|
if chance.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
var approveData *protocol.ApproveData
|
|
|
utils.JsonUnmarshal(chance.ApproveData, &approveData)
|
|
|
if approveData != nil {
|
|
|
commItem.Score = approveData.Score
|
|
|
}
|
|
|
}
|
|
|
if len(chance.Data) > 0 { //获取评分 && chance.ReviewStatus == protocol.ReviewStatusPass
|
|
|
//if chance.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
// var approveData *protocol.ApproveData
|
|
|
// utils.JsonUnmarshal(chance.ApproveData, &approveData)
|
|
|
// if approveData != nil {
|
|
|
// commItem.Score = approveData.Score
|
|
|
// }
|
|
|
//}
|
|
|
if len(chance.Data) > 0 && chance.ReviewStatus != protocol.ReviewStatusReturn { //获取评分 && chance.ReviewStatus == protocol.ReviewStatusPass
|
|
|
var msgData *protocol.MsgData
|
|
|
utils.JsonUnmarshal(chance.Data, &msgData)
|
|
|
commItem.Score = msgData.Score
|
...
|
...
|
|