소스 검색

no message

xingzai 1 년 전
부모
커밋
af638e18f4
2개의 변경된 파일45개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      controllers/cygx/user.go
  2. 40 0
      services/cygx/user_remind.go

+ 5 - 0
controllers/cygx/user.go

@@ -397,6 +397,7 @@ func (this *UserController) List() {
 		return
 	}
 	var userIds string
+	var userIdArr []int
 	if list != nil {
 		for k, v := range list {
 			if v.RegisterTime != "" {
@@ -426,6 +427,7 @@ func (this *UserController) List() {
 				}
 			}
 			userIds += strconv.Itoa(int(v.UserId)) + ","
+			userIdArr = append(userIdArr, int(v.UserId))
 		}
 		userIds = strings.TrimRight(userIds, ",")
 		splitList, err := cygx.GetCygxCompanyUserListSplit(userIds)
@@ -448,6 +450,8 @@ func (this *UserController) List() {
 			}
 		}
 
+		UserRemindListMap := cygxService.GetCygxUserRemindListMap(userIdArr)
+
 		for k, v := range list {
 			for _, vsplit := range splitList {
 				if vsplit.UserId == v.UserId {
@@ -468,6 +472,7 @@ func (this *UserController) List() {
 			if mapUserRemarks[int(v.UserId)] != "" {
 				list[k].Content = mapUserRemarks[int(v.UserId)]
 			}
+			list[k].IsRemind = UserRemindListMap[int(v.UserId)]
 		}
 		for k := range list {
 			list[k].InteractionNum = list[k].HistoryNum + list[k].CountNum + list[k].IndustryFllowNum + list[k].DepartmentFollowNum + list[k].KeyWordNum + list[k].OnLineNum + list[k].OfficeNum + list[k].ChartNum + list[k].TripNum + list[k].RoadshowVideoNum + list[k].ActivityVideoNum + list[k].ActivityVoiceNum

+ 40 - 0
services/cygx/user_remind.go

@@ -0,0 +1,40 @@
+package cygx
+
+import (
+	"errors"
+	"fmt"
+	"hongze/hz_crm_api/models/cygx"
+	"hongze/hz_crm_api/services/alarm_msg"
+	"hongze/hz_crm_api/utils"
+)
+
+// 根据用户ID获取那些用户设置了互动提醒
+func GetCygxUserRemindListMap(userIds []int) (mapResp map[int]bool) {
+	lenArr := len(userIds)
+	if lenArr == 0 {
+		return
+	}
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go alarm_msg.SendAlarmMsg("根据用户ID获取那些用户设置了互动提醒,信息失败,GetCygxUserRemindListMap Err:"+err.Error(), 3)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+
+	condition = ` AND  user_id IN (` + utils.GetOrmInReplace(lenArr) + `)`
+	pars = append(pars, userIds)
+	//获取分类名称
+	userRemindList, e := cygx.GetCygxUserRemindList(condition, pars, 0, 0)
+	if e != nil {
+		err = errors.New("GetCygxUserRemindList, Err: " + e.Error())
+		return
+	}
+	mapResp = make(map[int]bool, 0)
+	for _, v := range userRemindList {
+		mapResp[v.UserId] = true
+	}
+	return
+}