Browse Source

no message

zhangchuanxing 1 month ago
parent
commit
69475ddc4b
2 changed files with 31 additions and 0 deletions
  1. 18 0
      models/cygx/activity_ask_email.go
  2. 13 0
      services/roadshow/report.go

+ 18 - 0
models/cygx/activity_ask_email.go

@@ -0,0 +1,18 @@
+package cygx
+
+import "github.com/beego/beego/v2/client/orm"
+
+type AskEmailRep struct {
+	Name                string `description:"姓名"`
+	Email               string `description:"邮箱"`
+	Mobile              string `description:"手机号"`
+	ChartPermissionName string `description:"权限名称"`
+	AdminId             int
+}
+
+func GetAskEmail() (item []*AskEmailRep, err error) {
+	o := orm.NewOrmUsingDB("hz_cygx")
+	sql := `SELECT * FROM cygx_activity_ask_email`
+	_, err = o.Raw(sql).QueryRows(&item)
+	return
+}

+ 13 - 0
services/roadshow/report.go

@@ -5,6 +5,7 @@ import (
 	"errors"
 	"fmt"
 	"hongze/hongze_task/models"
+	"hongze/hongze_task/models/cygx"
 	"hongze/hongze_task/models/roadshow"
 	"hongze/hongze_task/utils"
 	"strconv"
@@ -31,6 +32,15 @@ func AddReportRecord(cont context.Context) (err error) {
 		}
 	}
 
+	listEmail, err := cygx.GetAskEmail() //权益研究员姓名
+	if err != nil {
+		return
+	}
+	mapResearcherNameRai := make(map[string]bool)
+	for _, v := range listEmail {
+		mapResearcherNameRai[v.Name] = true
+	}
+
 	companyList, err := roadshow.RsCompanyList()
 	if err != nil {
 		return
@@ -157,6 +167,9 @@ func AddReportRecord(cont context.Context) (err error) {
 
 	mapRsReportRecordPermission := make(map[string]bool) // 一个公司的一场路演,添加了多个研究员只记录一次
 	for _, v := range list {
+		if mapResearcherNameRai[v.ResearcherName] && v.CompanyName == "" {
+			continue // 如果权益研究员的而且公司名称为空,就不做记录
+		}
 		company := new(roadshow.CompanySearchView)
 		if v.CompanyId > 0 {
 			if mapRaiSllerId[v.SysUserId] {