Browse Source

Merge branch 'BI_Dashboard' of eta_gn_server/eta_api into dm

鲍自强 6 months ago
parent
commit
b94bc3da19
1 changed files with 19 additions and 2 deletions
  1. 19 2
      controllers/message.go

+ 19 - 2
controllers/message.go

@@ -2,6 +2,7 @@ package controllers
 
 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"
@@ -35,7 +36,7 @@ func (c *MessageController) UnReadMessageNum() {
 		return
 	}
 
-	var unReadReportNum, unReadDataPermissionNum int
+	var unReadReportNum, unReadDataPermissionNum, unReadBiNum int
 
 	// 获取报告审批消息
 	{
@@ -76,8 +77,24 @@ func (c *MessageController) UnReadMessageNum() {
 		unReadDataPermissionNum = unreadTotal
 	}
 
+	// 获得看板消息
+	{
+		messageOb := new(biapprove.BiApproveMessage)
+		pars := make([]interface{}, 0)
+		cond := fmt.Sprintf(` AND %s = ? AND %s = ?`, biapprove.BiApproveMessageCols.ReceiveUserId, biapprove.BiApproveMessageCols.IsRead)
+		pars = append(pars, sysUser.AdminId, 0)
+		// 未读消息数
+		unreadTotal, e := messageOb.GetCountByCondition(cond, pars)
+		if e != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取看板消息列表总数失败, Err: " + e.Error()
+			return
+		}
+		unReadBiNum = unreadTotal
+	}
+
 	// 汇总数
-	num := unReadReportNum + unReadDataPermissionNum
+	num := unReadReportNum + unReadDataPermissionNum + unReadBiNum
 
 	br.Data = num
 	br.Ret = 200