|
@@ -5,7 +5,6 @@ import (
|
|
biapprove "eta_gn/eta_api/models/bi_approve"
|
|
biapprove "eta_gn/eta_api/models/bi_approve"
|
|
"eta_gn/eta_api/models/data_manage/data_manage_permission"
|
|
"eta_gn/eta_api/models/data_manage/data_manage_permission"
|
|
"eta_gn/eta_api/models/knowledge_approve"
|
|
"eta_gn/eta_api/models/knowledge_approve"
|
|
- "eta_gn/eta_api/models/report_approve"
|
|
|
|
"fmt"
|
|
"fmt"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -39,24 +38,40 @@ func (c *MessageController) UnReadMessageNum() {
|
|
|
|
|
|
var unReadReportNum, unReadDataPermissionNum, unReadBiNum, unReadKnowledgeNum int
|
|
var unReadReportNum, unReadDataPermissionNum, unReadBiNum, unReadKnowledgeNum int
|
|
|
|
|
|
- // 获取报告审批消息
|
|
|
|
- {
|
|
|
|
- cond := fmt.Sprintf(` AND %s = ?`, report_approve.ReportApproveMessageCols.ReceiveUserId)
|
|
|
|
- pars := make([]interface{}, 0)
|
|
|
|
- pars = append(pars, sysUser.AdminId)
|
|
|
|
-
|
|
|
|
- messageOb := new(report_approve.ReportApproveMessage)
|
|
|
|
|
|
+ // 获取报告审批消息(废弃)
|
|
|
|
+ //{
|
|
|
|
+ // cond := fmt.Sprintf(` AND %s = ?`, report_approve.ReportApproveMessageCols.ReceiveUserId)
|
|
|
|
+ // pars := make([]interface{}, 0)
|
|
|
|
+ // pars = append(pars, sysUser.AdminId)
|
|
|
|
+ //
|
|
|
|
+ // messageOb := new(report_approve.ReportApproveMessage)
|
|
|
|
+ //
|
|
|
|
+ // // 未读消息数
|
|
|
|
+ // cond += fmt.Sprintf(` AND %s = ?`, report_approve.ReportApproveMessageCols.IsRead)
|
|
|
|
+ // pars = append(pars, 0)
|
|
|
|
+ // unreadTotal, e := messageOb.GetCountByCondition(cond, pars)
|
|
|
|
+ // if e != nil {
|
|
|
|
+ // br.Msg = "获取失败"
|
|
|
|
+ // br.ErrMsg = "获取审批消息列表总数失败, Err: " + e.Error()
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // unReadReportNum = unreadTotal
|
|
|
|
+ //}
|
|
|
|
|
|
|
|
+ // 报告通知消息
|
|
|
|
+ {
|
|
// 未读消息数
|
|
// 未读消息数
|
|
- cond += fmt.Sprintf(` AND %s = ?`, report_approve.ReportApproveMessageCols.IsRead)
|
|
|
|
- pars = append(pars, 0)
|
|
|
|
- unreadTotal, e := messageOb.GetCountByCondition(cond, pars)
|
|
|
|
|
|
+ messageOb := new(models.ReportMessage)
|
|
|
|
+ cond := fmt.Sprintf(` AND %s = ? AND %s = ?`, models.ReportMessageCols.ReceiveUserId, models.ReportMessageCols.IsRead)
|
|
|
|
+ pars := make([]interface{}, 0)
|
|
|
|
+ pars = append(pars, sysUser.AdminId, 0)
|
|
|
|
+ total, e := messageOb.GetCountByCondition(cond, pars)
|
|
if e != nil {
|
|
if e != nil {
|
|
br.Msg = "获取失败"
|
|
br.Msg = "获取失败"
|
|
- br.ErrMsg = "获取审批消息列表总数失败, Err: " + e.Error()
|
|
|
|
|
|
+ br.ErrMsg = "获取报告通知列表总数失败, Err: " + e.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- unReadReportNum = unreadTotal
|
|
|
|
|
|
+ unReadReportNum = total
|
|
}
|
|
}
|
|
|
|
|
|
// 获取资产消息
|
|
// 获取资产消息
|