|
@@ -4,7 +4,6 @@ import (
|
|
|
"eta_gn/eta_api/models"
|
|
|
biapprove "eta_gn/eta_api/models/bi_approve"
|
|
|
"eta_gn/eta_api/models/data_manage/data_manage_permission"
|
|
|
- "eta_gn/eta_api/models/report_approve"
|
|
|
"fmt"
|
|
|
)
|
|
|
|
|
@@ -38,24 +37,40 @@ func (c *MessageController) UnReadMessageNum() {
|
|
|
|
|
|
var unReadReportNum, unReadDataPermissionNum, unReadBiNum 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 {
|
|
|
br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取审批消息列表总数失败, Err: " + e.Error()
|
|
|
+ br.ErrMsg = "获取报告通知列表总数失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- unReadReportNum = unreadTotal
|
|
|
+ unReadReportNum = total
|
|
|
}
|
|
|
|
|
|
// 获取资产消息
|