Browse Source

买方研选权限说明

xingzai 1 year ago
parent
commit
5ec3460bbc

+ 98 - 387
controllers/activity.go

@@ -332,6 +332,10 @@ func (this *ActivityCoAntroller) Detail() {
 		br.ErrMsg = "活动ID错误,Err:" + "activityId:" + strconv.Itoa(activityId)
 		return
 	}
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
+	}
 
 	signupCount, err := models.GetActivitySignupSuccessByUserCountNoHz(activityId)
 	if err != nil {
@@ -652,14 +656,11 @@ func (this *ActivityCoAntroller) SignupAdd() {
 	}
 	item := new(models.CygxActivitySignup)
 
-	//1专家电话会、2分析师电话会、3公司调研电话会、4公司线下调研、5专家线下沙龙、6分析师线下沙龙
-	//OperationMode     string `description:"操作方式 Apply:立即申请、Call:拨号 为空则为有权限"`
-	//havePower, err := services.GetHavePower(activityInfo, permissionStr, companyDetailStatus, userType)
-	//if err != nil {
-	//	br.Msg = "获取信息失败!"
-	//	br.ErrMsg = "获取失败,Err:" + err.Error()
-	//	return
-	//}
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
+	}
+
 	havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -861,8 +862,13 @@ func (this *ActivityCoAntroller) SignupAdd() {
 		resp.HasPermission = hasPermission
 		resp.SellerName = sellerName
 		resp.SellerMobile = sellerMobile
+	}
 
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
 	}
+
 	//公司线下调研活动客户报名后给建会人,所属销售推送模板信息
 	if signupStatus == "Success" {
 		go services.SendResearchActivitiesTemplateMsg(user, activityInfo)
@@ -1167,34 +1173,17 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
 	item := new(models.CygxActivityMeetingReminder)
 	resp := new(models.SignupStatus)
 	hasPermission := 0
-	companyDetail, err := models.GetCompanyDetailById(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取客户详情失败,Err:" + err.Error()
-		return
-	}
-	if companyDetail == nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "客户不存在,uid:" + strconv.Itoa(user.UserId) + "CompanyId:" + strconv.Itoa(user.CompanyId)
-		return
-	}
-	var userType int
-	userType, _, err = services.GetUserType(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取失败,Err:" + err.Error()
-		return
-	}
-	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
-		br.Msg = "您暂无查看该活动权限"
-		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
-		return
-	}
 	resultTime := utils.StrTimeToTime(activityInfo.ActivityTime) //时间字符串格式转时间格式
 	if time.Now().After(resultTime.Add(-time.Minute * 15)) {
 		br.Msg = "活动开始前15分钟无法设置会议提醒"
 		return
 	}
+
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
+	}
+
 	havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -1244,6 +1233,12 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
 		resp.SellerName = sellerName
 		resp.SellerMobile = sellerMobile
 	}
+
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
+	}
+
 	resp.SignupStatus = signupStatus
 	resp.ActivityId = activityId
 	var total int
@@ -2067,8 +2062,7 @@ func (this *ActivityCoAntroller) CheckAsk() {
 		br.Ret = 408
 		return
 	}
-	uid := user.UserId
-	signupStatus := "Success"
+	var signupStatus string
 	var req models.ActivityIdRep
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
 	if err != nil {
@@ -2088,177 +2082,37 @@ func (this *ActivityCoAntroller) CheckAsk() {
 		br.ErrMsg = "操作失败,Err:" + errInfo.Error()
 		return
 	}
-	//判断是否已经申请过
-	applyCount, err := models.GetApplyRecordCount(uid)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		return
-	}
-	//获取销售信息
-	sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		br.Msg = "申请失败"
-		br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-		return
-	}
 	resp := new(models.SignupStatus)
-
-	//处理冻结客户,流失客户的弹窗提示
-	if user.CompanyId > 1 {
-		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			br.Msg = "获取信息失败"
-			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-			return
-		}
-		if sellerMobile != "" {
-			resp.HasPermission = 2
-			resp.SellerMobile = sellerMobile
-			resp.SellerName = sellerRealName
-			br.Ret = 200
-			br.Success = true
-			br.Msg = "获取成功"
-			br.Data = resp
-			return
-		}
-	}
 	hasPermission := 0
-	companyPermission, err := models.GetCompanyPermission(user.CompanyId)
+	havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
 	if err != nil {
 		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取客户详情失败,Err:" + err.Error()
+		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		return
 	}
-	if companyPermission == "" {
-		if applyCount > 0 {
-			hasPermission = 4
-		} else {
-			if sellerItem != nil {
-				hasPermission = 5
-			} else {
-				//获取权益销售信息 如果是FICC的客户类型,则默认他申请过
-				sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
-				if err != nil && err.Error() != utils.ErrNoRow() {
-					br.Msg = "获取信息失败"
-					br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-					return
-				}
-				if sellerItemQy != nil {
-					hasPermission = 2
-					resp.SellerMobile = sellerItemQy.Mobile
-					resp.SellerName = sellerItemQy.RealName
-				} else {
-					hasPermission = 3
-				}
-			}
-		}
-		resp.ActivityId = activityId
+	if havePower {
+		hasPermission = 1
+		signupStatus = "Success"
+		resp.HaqveJurisdiction = true
 		resp.HasPermission = hasPermission
-		resp.OperationMode = "Apply"
-		resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
-		br.Ret = 200
-		br.Success = true
-		br.Msg = "获取成功"
-		br.Data = resp
-		return
-	}
-	companyDetail, err := models.GetCompanyDetailById(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取客户详情失败,Err:" + err.Error()
-		return
-	}
-	if companyDetail == nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "客户不存在,uid:" + strconv.Itoa(user.UserId) + "CompanyId:" + strconv.Itoa(user.CompanyId)
-		return
-	}
-	var userType int
-	var permissionStr string
-	userType, permissionStr, err = services.GetUserType(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取失败,Err:" + err.Error()
-		return
-	}
-	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
-		br.Msg = "您暂无查看该活动权限"
-		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
-		return
-	}
-	if user.CompanyId > 1 {
-		companyItem, err := models.GetCompanyDetailById(user.CompanyId)
-		//冻结客户
-		if err != nil {
-			if err.Error() == utils.ErrNoRow() {
-				if applyCount > 0 {
-					hasPermission = 4
-				} else {
-					if sellerItem != nil {
-						hasPermission = 5
-					} else {
-						hasPermission = 3
-					}
-				}
-				resp.ActivityId = activityId
-				resp.HasPermission = hasPermission
-				resp.OperationMode = "Apply"
-				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
-				br.Ret = 200
-				br.Success = true
-				br.Msg = "获取成功"
-				br.Data = resp
-				return
-			} else {
-				br.Msg = "获取信息失败"
-				br.ErrMsg = "获取客户公司信息失败,Err:" + err.Error()
-				return
-			}
-		}
-		havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
+		resp.SignupStatus = signupStatus
+	} else {
+		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermissionActivity(user, activityInfo)
 		if err != nil {
 			br.Msg = "获取信息失败"
-			br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
+			br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
 			return
 		}
-		if havePower {
-			hasPermission = 1
-			signupStatus = "Success"
-			resp.HaqveJurisdiction = true
-		} else {
-			if companyItem.ProductId == 2 {
-				hasPermission = 2
-				resp.SellerMobile = companyItem.Mobile
-				resp.SellerName = companyItem.SellerName
-				resp.MsgType = "Type"
-				resp.OperationMode = "Call"
-				if permissionStr == "专家" {
-					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-					resp.MsgType = "Type"
-				} else {
-					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-					resp.MsgType = "Industry"
-				}
-			} else {
-				hasPermission = 5
-			}
-		}
-	} else { //潜在客户
-		if applyCount > 0 {
-			hasPermission = 4
-		} else {
-			if sellerItem != nil {
-				hasPermission = 5
-			} else {
-				hasPermission = 3
-			}
-		}
-		resp.OperationMode = "Apply"
-		resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+		resp.PopupMsg = popupMsg
+		resp.HasPermission = hasPermission
+		resp.SellerName = sellerName
+		resp.SellerMobile = sellerMobile
 	}
-	resp.HasPermission = hasPermission
-	resp.SignupStatus = signupStatus
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
+	}
+
 	resp.ActivityId = activityId
 	br.Ret = 200
 	br.Success = true
@@ -3421,218 +3275,75 @@ func (this *ActivityCoAntroller) ActivityAppointmentAdd() {
 		return
 	}
 
-	//判断是否已经申请过
-	applyCount, err := models.GetApplyRecordCount(uid)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		return
-	}
-
-	//获取销售信息
-	sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 1)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		br.Msg = "申请失败"
-		br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-		return
-	}
-
 	//SignupStatus string `description:"报名状态:人数已满:FullStarffed、单机构超过两人:TwoPeople、爽约次数过多:BreakPromise、超时:Overtime 、成功:Success"`
 	item := new(models.CygxActivityAppointment)
 	resp := new(models.SignupStatus)
-	//处理冻结客户,流失客户的弹窗提示
-	if user.CompanyId > 1 {
-		sellerMobile, sellerRealName, err := services.CheckActivityUserPermission(user)
-		if err != nil && err.Error() != utils.ErrNoRow() {
-			br.Msg = "获取信息失败"
-			br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-			return
-		}
-		if sellerMobile != "" {
-			resp.HasPermission = 2
-			resp.SellerMobile = sellerMobile
-			resp.SellerName = sellerRealName
-			br.Ret = 200
-			br.Success = true
-			br.Msg = "获取成功"
-			br.Data = resp
-			return
-		}
-	}
 	hasPermission := 0
-
-	companyPermission, err := models.GetCompanyPermission(user.CompanyId)
+	havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
 	if err != nil {
 		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取客户详情失败,Err:" + err.Error()
+		br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
 		return
 	}
-	if companyPermission == "" {
-		if applyCount > 0 {
-			hasPermission = 4
-		} else {
-			if sellerItem != nil {
-				hasPermission = 5
-			} else {
-				//获取权益销售信息 如果是FICC的客户类型,则默认他申请过
-				sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
-				if err != nil && err.Error() != utils.ErrNoRow() {
-					br.Msg = "获取信息失败"
-					br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
-					return
-				}
-				if sellerItemQy != nil {
-					hasPermission = 2
-					resp.SellerMobile = sellerItemQy.Mobile
-					resp.SellerName = sellerItemQy.RealName
-				} else {
-					hasPermission = 3
-				}
-			}
+
+	if havePower {
+		hasPermission = 1
+		signupStatus = "Success"
+		totalMeeting, errMeeting := models.GetUserCygxActivityAppointmentCount(uid, activityId)
+		if errMeeting != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取失败,Err:" + errMeeting.Error()
+			return
 		}
-		resp.ActivityId = activityId
-		resp.HasPermission = hasPermission
-		resp.OperationMode = "Apply"
-		resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
-		br.Ret = 200
-		br.Success = true
-		br.Msg = "获取成功"
-		br.Data = resp
-		return
-	}
-	companyDetail, err := models.GetCompanyDetailById(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取客户详情失败,Err:" + err.Error()
-		return
-	}
-	if companyDetail == nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "客户不存在,uid:" + strconv.Itoa(user.UserId) + "CompanyId:" + strconv.Itoa(user.CompanyId)
-		return
-	}
-	var userType int
-	var permissionStr string
-	userType, permissionStr, err = services.GetUserType(user.CompanyId)
-	if err != nil {
-		br.Msg = "获取信息失败!"
-		br.ErrMsg = "获取失败,Err:" + err.Error()
-		return
-	}
-	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
-		br.Msg = "您暂无查看该活动权限"
-		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
-		return
-	}
-	if user.CompanyId > 1 {
-		companyItem, err := models.GetCompanyDetailById(user.CompanyId)
-		//冻结客户
+		if totalMeeting > 0 {
+			br.Msg = "您已预约,请勿重复预约"
+			return
+		}
+		var sellerName string
+		sellerName, err = models.GetCompanySellerName(user.CompanyId)
 		if err != nil {
-			if err.Error() == utils.ErrNoRow() {
-				//如果是FICC的客户类型,则默认他申请过
-				if applyCount > 0 {
-					hasPermission = 4
-				} else {
-					if sellerItem != nil {
-						hasPermission = 5
-					} else {
-						hasPermission = 3
-					}
-				}
-				resp.ActivityId = activityId
-				resp.HasPermission = hasPermission
-				resp.OperationMode = "Apply"
-				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
-				br.Ret = 200
-				br.Success = true
-				br.Msg = "获取成功"
-				br.Data = resp
-				return
-			} else {
-				br.Msg = "获取信息失败"
-				br.ErrMsg = "获取客户公司信息失败,Err:" + err.Error()
-				return
-			}
+			br.Msg = "报名失败!"
+			br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
+			return
 		}
-
-		havePower, err := services.GetActivityDetailUserPower(user, activityInfo)
+		item.UserId = uid
+		item.ActivityId = activityId
+		item.CreateTime = time.Now()
+		item.Mobile = user.Mobile
+		item.Email = user.Email
+		item.CompanyId = user.CompanyId
+		item.CompanyName = user.CompanyName
+		item.SellerName = sellerName
+		item.RealName = user.RealName
+		err = models.AddCygxActivityAppointment(item)
+		if err != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "操作失败,Err:" + err.Error()
+			return
+		}
+		resp.HaqveJurisdiction = true
+		//1:预约外呼 、2:设置会议提醒 、 3:预约纪要 、4:活动报名
+		go services.ActivityUserRemind(user, activityInfo, 3)
+		resp.HasPermission = hasPermission
+		resp.SignupStatus = signupStatus
+	} else {
+		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermissionActivity(user, activityInfo)
 		if err != nil {
 			br.Msg = "获取信息失败"
-			br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
+			br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
 			return
 		}
-		if havePower {
-			hasPermission = 1
-			signupStatus = "Success"
-			totalMeeting, errMeeting := models.GetUserCygxActivityAppointmentCount(uid, activityId)
-			if errMeeting != nil {
-				br.Msg = "获取失败"
-				br.ErrMsg = "获取失败,Err:" + errMeeting.Error()
-				return
-			}
-			if totalMeeting > 0 {
-				br.Msg = "您已预约,请勿重复预约"
-				return
-			}
-			var sellerName string
-			sellerName, err = models.GetCompanySellerName(user.CompanyId)
-			if err != nil {
-				br.Msg = "报名失败!"
-				br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
-				return
-			}
-			item.UserId = uid
-			item.ActivityId = activityId
-			item.CreateTime = time.Now()
-			item.Mobile = user.Mobile
-			item.Email = user.Email
-			item.CompanyId = user.CompanyId
-			item.CompanyName = user.CompanyName
-			item.SellerName = sellerName
-			item.RealName = user.RealName
-			err = models.AddCygxActivityAppointment(item)
-			if err != nil {
-				br.Msg = "操作失败"
-				br.ErrMsg = "操作失败,Err:" + err.Error()
-				return
-			}
-			resp.HaqveJurisdiction = true
-			//1:预约外呼 、2:设置会议提醒 、 3:预约纪要 、4:活动报名
-			go services.ActivityUserRemind(user, activityInfo, 3)
+		resp.PopupMsg = popupMsg
+		resp.HasPermission = hasPermission
+		resp.SellerName = sellerName
+		resp.SellerMobile = sellerMobile
+	}
 
-		} else {
-			if companyItem.ProductId == 2 {
-				hasPermission = 2
-				resp.SellerMobile = companyItem.Mobile
-				resp.SellerName = companyItem.SellerName
-				resp.MsgType = "Type"
-				resp.OperationMode = "Call"
-				if permissionStr == "专家" {
-					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-					resp.MsgType = "Type"
-				} else {
-					resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-					resp.MsgType = "Industry"
-				}
-			} else {
-				hasPermission = 5
-			}
-		}
-	} else { //潜在客户
-		if applyCount > 0 {
-			hasPermission = 4
-		} else {
-			if sellerItem != nil {
-				hasPermission = 5
-			} else {
-				hasPermission = 3
-			}
-		}
-		resp.OperationMode = "Apply"
-		resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+	// 判断是否属于研选类型的活动
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		resp.IsResearch = true
 	}
-	resp.HasPermission = hasPermission
-	resp.SignupStatus = signupStatus
+
 	resp.ActivityId = activityId
 	var total int
 	total, err = models.GetUserCygxActivityAppointmentCountByUid(user.UserId)

+ 4 - 1
controllers/article.go

@@ -86,7 +86,10 @@ func (this *ArticleController) Detail() {
 	if _, ok := lyjhTypeMap[detail.CategoryId]; ok {
 		detail.IsRoadShow = true
 	}
-
+	// 判断是否属于研选类型的报告
+	if strings.Contains(detail.CategoryName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		detail.IsResearch = true
+	}
 	// 高毅资产的联系人,有权限的行业也不能查看报告详情页。提示无权限页面
 	if detail.ArticleTypeId == 0 && user.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
 		_, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermissionArticle(user)

+ 97 - 0
controllers/config.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
+	"strings"
 	"time"
 )
 
@@ -238,3 +239,99 @@ func (this *ConfigController) AboutUsAdd() {
 	br.Success = true
 	br.Msg = "操作成功!"
 }
+
+// @Title 买方研选产品介绍(无需token)
+// @Description 买方研选产品介绍接口(无需token)
+// @Success 200 {object} models.ConfigImgListResp
+// @router /research/introduce [get]
+func (this *BaseConfigController) ResearchIntroduce() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	conf, err := models.GetConfigByCode("research_introduce_img_url")
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "买方研选产品介绍信息失败,Err:" + err.Error()
+		return
+	}
+	if conf.ConfigValue == "" {
+		br.Msg = "获取失败"
+		br.ErrMsg = "买方研选产品介绍信息失败"
+		return
+	}
+	list := new(*models.ConfigImgListResp)
+	if err = json.Unmarshal([]byte(conf.ConfigValue), &list); err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "买方研选产品介绍信配置值解析失败, Err: " + err.Error()
+		return
+	}
+	br.Msg = "获取成功!"
+	br.Ret = 200
+	br.Success = true
+	br.Data = list
+}
+
+// @Title 买方研选报价单(无需token)
+// @Description 买方研选报价单(无需token)
+// @Success 200 {object} models.ConfigImgListResp
+// @router /research/quotation [get]
+func (this *BaseConfigController) ResearchQuotation() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	conf, err := models.GetConfigByCode("research_quotation_img_url")
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "买方研选产品介绍信息失败,Err:" + err.Error()
+		return
+	}
+	if conf.ConfigValue == "" {
+		br.Msg = "获取失败"
+		br.ErrMsg = "买方研选产品介绍信息失败"
+		return
+	}
+	list := new(*models.ConfigImgListResp)
+	if err = json.Unmarshal([]byte(conf.ConfigValue), &list); err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "买方研选产品介绍信配置值解析失败, Err: " + err.Error()
+		return
+	}
+	br.Msg = "获取成功!"
+	br.Ret = 200
+	br.Success = true
+	br.Data = list
+}
+
+// @Title 买方研选升级新资源海报(无需token)
+// @Description 买方研选升级新资源海报(无需token)
+// @Success 200 {object} models.ConfigImgListResp
+// @router /research/hb [get]
+func (this *BaseConfigController) ResearchHb() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	detail, err := models.GetConfigByCode("research_hb_img_url")
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "买方研选升级新资源海报信息失败,Err:" + err.Error()
+		return
+	}
+	resp := new(models.ConfigImgHbResp)
+	list := strings.Split(detail.ConfigValue, "{|}")
+	if len(list) == 0 {
+		list = make([]string, 0)
+	}
+	resp.HbImg = list[0]
+	resp.ButtonImg = list[len(list)-1]
+	br.Msg = "获取成功!"
+	br.Ret = 200
+	br.Success = true
+	br.Data = resp
+}

+ 1 - 0
models/activity.go

@@ -221,6 +221,7 @@ type CygxActivityResp struct {
 	MsgType           string `description:"Type : 类型 , Industry : 行业"`
 	SellerMobile      string `description:"销售电话"`
 	SellerName        string `description:"销售姓名"`
+	IsResearch        bool   `description:"是否属于研选"`
 	Detail            *ActivityDetail
 }
 

+ 1 - 0
models/activity_signup.go

@@ -40,6 +40,7 @@ type SignupStatus struct {
 	CountryCode       string `description:"外呼手机号区号"`
 	GoOutboundMobile  bool   `description:"是否去绑定手机号"`
 	GoBindEmail       bool   `description:"是否去绑定邮箱"`
+	IsResearch        bool   `description:"是否属于研选"`
 }
 
 // 我的日程

+ 1 - 0
models/article.go

@@ -236,6 +236,7 @@ type ArticleDetailResp struct {
 	SellerMobile     string `description:"销售电话"`
 	SellerName       string `description:"销售姓名"`
 	IsSpecialArticle bool   `description:"是否属于专项调研报告"`
+	IsResearch       bool   `description:"是否属于研选"`
 }
 
 type ArticleDetailHtgjResp struct {

+ 16 - 2
models/config.go

@@ -30,7 +30,7 @@ func GetConfigByCode(configCode string) (item *CygxConfig, err error) {
 	return
 }
 
-//更改配置信息
+// 更改配置信息
 func UpdateConfigByCode(configValue, countryCode string) (err error) {
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_config SET  config_value= ? WHERE config_code=? `
@@ -44,7 +44,21 @@ type ConfigResp struct {
 	ListHot []*KeyWord `description:"热搜关键词"`
 }
 
-//获取是否展示限免标签
+type ConfigImgListResp struct {
+	List []*ConfigImgResp
+}
+
+type ConfigImgResp struct {
+	Img    string `description:"图片"`
+	Height string `description:"高度"`
+}
+
+type ConfigImgHbResp struct {
+	HbImg     string `description:"海报"`
+	ButtonImg string `description:"按钮图片"`
+}
+
+// 获取是否展示限免标签
 func GetShowSustainable() (count int, err error) {
 	o := orm.NewOrm()
 	sqlCount := ` SELECT COUNT(1) FROM cygx_config WHERE config_code= 'is_show_sustainable' AND config_value = 1 `

+ 27 - 0
routers/commentsRouter.go

@@ -421,6 +421,33 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"],
+        beego.ControllerComments{
+            Method: "ResearchHb",
+            Router: `/research/hb`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"],
+        beego.ControllerComments{
+            Method: "ResearchIntroduce",
+            Router: `/research/introduce`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseConfigController"],
+        beego.ControllerComments{
+            Method: "ResearchQuotation",
+            Router: `/research/quotation`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseHomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:BaseHomeController"],
         beego.ControllerComments{
             Method: "ListHomePublic",

+ 19 - 6
services/company_permission.go

@@ -149,7 +149,11 @@ func GetUserHasPermissionActivity(user *models.WxUserItem, activityInfo *models.
 		err = errors.New("GetApplyRecordCount, Err: " + e.Error())
 		return
 	}
-	popupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+	if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+		popupMsg = "暂无<b>买方研选</b>权限<br/>您可申请开通试用"
+	} else {
+		popupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+	}
 	if user.CompanyId == 1 {
 		if applyCount > 0 {
 			hasPermission = 4
@@ -177,7 +181,12 @@ func GetUserHasPermissionActivity(user *models.WxUserItem, activityInfo *models.
 				}
 			}
 			hasPermission = hasPermission
-			popupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+			if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+				popupMsg = "暂无<b>买方研选</b>权限<br/>您可申请开通试用"
+			} else {
+				popupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
+			}
+
 			return
 		} else {
 			return
@@ -192,11 +201,15 @@ func GetUserHasPermissionActivity(user *models.WxUserItem, activityInfo *models.
 			err = errors.New("GetCompanyPermission, Err: " + e.Error())
 			return
 		}
-		if companyPermission == "专家" {
-			popupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
-
+		if strings.Contains(activityInfo.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
+			popupMsg = "暂无<b>买方研选</b>权限<br/>点击提交申请,提醒对口销售为你开通试用"
 		} else {
-			popupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+			if companyPermission == "专家" {
+				popupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+
+			} else {
+				popupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
+			}
 		}
 	} else {
 		hasPermission = 5