Browse Source

查研观向7.1

xingzai 2 years ago
parent
commit
f24b2eea42

+ 66 - 257
controllers/activity.go

@@ -371,8 +371,12 @@ func (this *ActivityCoAntroller) ActivityList() {
 			go services.AddUserSearchLog(user, keyWordSearch, 6)
 		}
 	}
-	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := new(models.GetCygxActivityListRep)
+	//处理列表的标签是否展示逻辑
+	for _, v := range list {
+		resp.List = append(resp.List, services.ActivityButtonShow(v))
+	}
+	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp.List = list
 	resp.Paging = page
 	br.Ret = 200
@@ -429,7 +433,7 @@ func (this *ActivityCoAntroller) ScheduleList() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	var list []*models.CygxActivityList
+	var list []*models.ActivityDetail
 	//全部都是进行中的活动
 	if totalCount > currentIndex*pageSize {
 		condition += ` AND art.active_state IN(2) `
@@ -552,9 +556,11 @@ func (this *ActivityCoAntroller) ScheduleList() {
 	item.CompanyName = user.CompanyName
 	item.PageType = "MySchedule"
 	go models.AddCygxPageHistoryRecord(item)
-
 	resp := new(models.GetCygxActivityListRep)
-	resp.List = list
+	//处理列表的标签是否展示逻辑
+	for _, v := range list {
+		resp.List = append(resp.List, services.ActivityButtonShow(v))
+	}
 	resp.Paging = page
 	br.Ret = 200
 	br.Success = true
@@ -786,13 +792,6 @@ func (this *ActivityCoAntroller) Detail() {
 				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
 				resp.MsgType = "Type"
 			} else {
-				//if strings.Contains("医药,消费,科技,智造", activityInfo.ChartPermissionName) {
-				//	if activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3 || activityInfo.ActivityTypeId == 5 || activityInfo.ActivityTypeId == 6 {
-				//		activityInfo.ChartPermissionName += "(主观)"
-				//	} else {
-				//		activityInfo.ChartPermissionName += "(客观)"
-				//	}
-				//}
 				resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
 				resp.MsgType = "Industry"
 			}
@@ -804,7 +803,6 @@ func (this *ActivityCoAntroller) Detail() {
 			} else {
 				hasPermission = 5
 			}
-
 		}
 	} else { //潜在客户
 		if applyCount > 0 {
@@ -859,7 +857,54 @@ func (this *ActivityCoAntroller) Detail() {
 			activityInfo.ArticleList = make([]*models.ActivityArticleResp, 0)
 		}
 		activityInfo.ActivityTypeName = strings.Replace(activityInfo.ActivityTypeName, "(C类)", "", -1)
-		resp.Detail = activityInfo
+
+		//处理活动关联的产业
+		industrialList, err := models.GetIndustrialActivityGroupManagementList(activityId)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取活动关联的产业列表信息失败,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
+			return
+		}
+		if activityInfo.TemporaryLabel != "" {
+			industrialList = make([]*models.IndustrialManagementRep, 0)
+			item := new(models.IndustrialManagementRep)
+			item.IndustryName = activityInfo.Label
+			industrialList = append(industrialList, item)
+		} else {
+			var industrialManagementId string
+			for k, v := range industrialList {
+				if v.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+					industrialList[k].IsResearch = true
+				}
+				industrialManagementId += strconv.Itoa(v.IndustrialManagementId) + ","
+			}
+			//判断产业下是否有关联的报告,并处理是否跳转
+			industrialManagementId = strings.TrimRight(industrialManagementId, ",")
+			if industrialManagementId != "" {
+				var condition string
+				condition = ` AND m.industrial_management_id IN (` + industrialManagementId + `)`
+				listIndustrialGrop, err := models.GetSearchResourceList(condition)
+				if err != nil && err.Error() != utils.ErrNoRow() {
+					br.Msg = "获取信息失败"
+					br.ErrMsg = "GetSearchResourceList,Err:" + err.Error() + "activityId:" + strconv.Itoa(activityId)
+					return
+				}
+				mapIndustrial := make(map[int]int)
+				if len(listIndustrialGrop) > 0 {
+					for _, v := range listIndustrialGrop {
+						mapIndustrial[v.IndustrialManagementId] = v.IndustrialManagementId
+					}
+				}
+				for k, v := range industrialList {
+					if mapIndustrial[v.IndustrialManagementId] > 0 {
+						industrialList[k].IsJump = true
+					}
+				}
+			}
+		}
+		activityInfo.Listndustrial = industrialList
+		//处理按钮是否展示问题
+		resp.Detail = services.ActivityButtonShow(activityInfo)
 	}
 	resp.HasPermission = hasPermission
 	br.Ret = 200
@@ -1891,7 +1936,7 @@ func (this *ActivityABaseController) FastSearch() {
 // @Param   WhichDay   query   string  false       "哪一天 今天:1、明天:2,多个用 , 隔开"
 // @Param   Label   query   string  false       "搜索主题 多个用 , 隔开 (空为活动主题,非空为更多主题)"
 // @Success 200 {object} models.GetCygxActivityLabelListRep
-// @router /labelList [get]
+// @router /labelList_deltest [get]
 func (this *ActivityCoAntroller) LabelList() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
@@ -2244,7 +2289,7 @@ func (this *ActivityCoAntroller) AskAdd() {
 // @Param   WhichDay   query   string  false       "哪一天 今天:1、明天:2,多个用 , 隔开"
 // @Param   IsPower   query   int  false       "是否选择有权限行业 ,1是 0 否 默认0"
 // @Success 200 {object} models.ActivityTypeListHomeResp
-// @router /labelTypeList [get]
+// @router /labelTypeList_deltest [get]
 func (this *ActivityCoAntroller) LabelTypeList() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
@@ -2658,104 +2703,12 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	var condition string
 	var pars []interface{}
 	//活动可见限制
-	//var sqlExport string
-	//slicePer := strings.Split(permissionStr, ",")
-	//var permissionSqlStr string
-	//for _, v := range slicePer {
-	//	if userType == 1 {
-	//		//if v != "研选" {
-	//		if !strings.Contains(v, "研选") {
-	//			permissionSqlStr += "'" + v + "',"
-	//		}
-	//	} else {
-	//		permissionSqlStr += "'" + v + "',"
-	//	}
-	//}
-	//permissionSqlStr = strings.TrimRight(permissionSqlStr, ",")
-	//permissionSqlStr = strings.Replace(permissionSqlStr, "(主观)", "", -1)
-	//permissionSqlStr = strings.Replace(permissionSqlStr, "(客观)", "", -1)
-	//permissionSqlStr = ` AND art.chart_permission_name  IN (` + permissionSqlStr + `)`
-	//sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
-	//if userType == 2 {
-	//	sqlExport += ` OR  art.customer_type_ids LIKE '%3%' `
-	//}
-	//if (userType == 2 || userType == 3) && strings.Contains(permissionStr, "专家") {
-	//	sqlExport += ` OR  art.customer_type_ids LIKE '%4%' `
-	//}
-	//sqlExport += `) `
-	//
-	////主题
-	//if label != "" {
-	//	condition = ` AND art.label  LIKE '%` + label + `%' `
-	//}
-	//if whichDay != "" {
-	//	var startDate string
-	//	var endDate string
-	//	if whichDay == "1" {
-	//		startDate = time.Now().Format(utils.FormatDate)
-	//		endDate = startDate
-	//	} else if whichDay == "2" {
-	//		startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-	//		endDate = startDate
-	//	} else {
-	//		startDate = time.Now().Format(utils.FormatDate)
-	//		endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-	//	}
-	//	condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
-	//	condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
-	//}
-	////行业名称
-	//if len(chartPermissionIds) > 0 {
-	//	condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
-	//}
-	//if activeState != "" {
-	//	if activeState == "1" {
-	//		condition += ` AND art.active_state  IN (1,2)`
-	//	} else {
-	//		condition += ` AND art.active_state  IN (` + activeState + `)`
-	//	}
-	//} else {
-	//	condition += ` AND art.active_state  IN (1)`
-	//}
-	//if activityTypeId != "" {
-	//	condition += ` AND art.activity_type_id  IN (` + activityTypeId + `)`
-	//}
-	//
-	//condition += ` AND art.publish_status = 1 `
-	//var conditionOr string
-	//// 有专家权限的这几种用户,不做行业权限校验
-	//if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
-	//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%4%'	 ` + condition + `) `
-	//}
-	//if (userType == 5) && strings.Contains(permissionStr, "专家") {
-	//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%5%'	 ` + condition + `) `
-	//}
-	//if userType == 1 {
-	//	conditionOr += `	OR ( art.is_limit_people = 0 	  ` + condition + permissionSqlStr + `) `
-	//} else {
-	//	conditionOr += `	OR ( art.is_limit_people = 0 	  ` + condition + `) `
-	//}
-	////判断客户规模是否属于可见范围的活动
-	//companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
-	//if err != nil && err.Error() != utils.ErrNoRow() {
-	//	br.Msg = "获取信息失败"
-	//	br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
-	//	return
-	//}
-	//if companyProduct != nil {
-	//	if companyProduct.Scale != "" {
-	//		conditionOr += ` OR (  art.scale LIKE '%` + companyProduct.Scale + `%'	 ` + condition + `) `
-	//	}
-	//}
-
 	conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 		return
 	}
-
-	//condition += ` AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
 	condition += ` AND art.is_limit_people = 1 ` + conditionActivity
 	total, err := models.GetActivityCount(condition, pars)
 	if err != nil {
@@ -2862,7 +2815,10 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 			resp.Label = detail.ActivityTypeName
 		}
 	}
-	resp.List = list
+	//处理列表的标签是否展示逻辑
+	for _, v := range list {
+		resp.List = append(resp.List, services.ActivityButtonShow(v))
+	}
 	resp.Paging = page
 	br.Ret = 200
 	br.Success = true
@@ -2878,7 +2834,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 // @Param   WhichDay   query   string  false       "哪一天 今天:1、明天:2,多个用 , 隔开"
 // @Param   IsPower   query   int  false       "是否选择有权限行业 ,1是 0 否 默认0"
 // @Success 200 {object} models.ActivityTypeListHomeRespPc
-// @router /labelTypeListPc [get]
+// @router /labelTypeListPc_deltest [get]
 func (this *ActivityCoAntroller) LabelTypeListPc() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
@@ -3341,91 +3297,12 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 			continue
 		}
 		var condition string
-		//var conditionAdmin string
-		//permissionSqlStr = ` AND art.chart_permission_name  IN (` + permissionNameStr + `)`
-		//sqlExport = ` AND (art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
-		//if userType == 2 {
-		//	sqlExport += ` OR  art.customer_type_ids LIKE '%3%' `
-		//}
-		//if (userType == 2 || userType == 3) && strings.Contains(permissionStr, "专家") {
-		//	sqlExport += ` OR  art.customer_type_ids LIKE '%4%' `
-		//}
-		//sqlExport += `) `
-		//if v.ActivityTypeId == utils.ANALYST_TELL_ACTIVITY_TYPE_ID {
-		//	condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id IN (` + strconv.Itoa(v.ActivityTypeId) + "," + strconv.Itoa(utils.C_CLASS_ACTIVITY_TYPE_ID) + `)`
-		//} else {
-		//	condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id = ` + strconv.Itoa(v.ActivityTypeId)
-		//}
-		////活动仅决策人可见
-		//if isMaker == 0 {
-		//	condition += ` AND art.is_maker_show = 0  `
-		//}
-		//
-		//if isPower == 1 {
-		//	condition += permissionSqlStr
-		//}
-		////行业名称
-		//if len(chartPermissionIds) > 0 {
-		//	condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
-		//}
-		//var conditionOr string
-		//if whichDay != "" {
-		//	var startDate string
-		//	var endDate string
-		//	if whichDay == "1" {
-		//		startDate = time.Now().Format(utils.FormatDate)
-		//		endDate = startDate
-		//	} else if whichDay == "2" {
-		//		startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-		//		endDate = startDate
-		//	} else {
-		//		startDate = time.Now().Format(utils.FormatDate)
-		//		endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-		//	}
-		//	condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
-		//	condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
-		//}
-		//if activeState != "" {
-		//	// 默认查看未开始跟进行中
-		//	if activeState == "1" {
-		//		condition += ` AND art.active_state  IN (1,2)`
-		//	} else {
-		//		condition += ` AND art.active_state  IN (` + activeState + `)`
-		//	}
-		//} else {
-		//	condition += ` AND art.active_state  IN (1,2)`
-		//}
-		//conditionAdmin = condition
-		////查询全部可见的数据(是否全部客户可见)
-		//condition += ` AND art.visible_range != 1  `
-		//
-		//if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
-		//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%4%'	 ` + condition + `) `
-		//}
-		//if (userType == 5) && strings.Contains(permissionStr, "专家") {
-		//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%5%'	 ` + condition + `) `
-		//}
-		//if userType == 1 {
-		//	conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + permissionSqlStr + `) `
-		//} else {
-		//	conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
-		//}
-		//if companyProduct != nil {
-		//	if companyProduct.Scale != "" {
-		//		conditionOr += ` OR (  art.scale LIKE '%` + companyProduct.Scale + `%'	 ` + condition + `) `
-		//	}
-		//}
-		//if adminIds != "" {
-		//	conditionOr += ` OR ( art.admin_id IN (` + adminIds + `) ` + conditionAdmin + `) `
-		//}
-
 		conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 			return
 		}
-		//fmt.Println(conditionActivity)
 		condition += `AND art.is_limit_people = 1 ` + conditionActivity
 		sortTime = ` mintimesort ASC `
 		labelList, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
@@ -4406,75 +4283,7 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
 			continue
 		}
 		var condition string
-		//var conditionAdmin string
-		//permissionSqlStr = ` AND art.chart_permission_name  IN (` + permissionNameStr + `)`
-		//if v.ActivityTypeId == utils.ANALYST_TELL_ACTIVITY_TYPE_ID {
-		//	condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id IN (` + strconv.Itoa(v.ActivityTypeId) + "," + strconv.Itoa(utils.C_CLASS_ACTIVITY_TYPE_ID) + `)`
-		//} else {
-		//	condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id = ` + strconv.Itoa(v.ActivityTypeId)
-		//}
-		////活动仅决策人可见
-		//if isMaker == 0 {
-		//	condition += ` AND art.is_maker_show = 0  `
-		//}
-		//
-		////condition = ` AND art.publish_status = 1  AND art.label != ''  AND art.activity_type_id = ` + strconv.Itoa(v.ActivityTypeId)
-		//if isPower == 1 {
-		//	condition += permissionSqlStr
-		//}
-		////行业名称
-		//if len(chartPermissionIds) > 0 {
-		//	condition += ` AND art.chart_permission_id  IN (` + chartPermissionIds + `)`
-		//}
-		//var conditionOr string
-		//if whichDay != "" {
-		//	var startDate string
-		//	var endDate string
-		//	if whichDay == "1" {
-		//		startDate = time.Now().Format(utils.FormatDate)
-		//		endDate = startDate
-		//	} else if whichDay == "2" {
-		//		startDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-		//		endDate = startDate
-		//	} else {
-		//		startDate = time.Now().Format(utils.FormatDate)
-		//		endDate = time.Now().AddDate(0, 0, +1).Format(utils.FormatDate)
-		//	}
-		//	condition += ` AND art.activity_time >= ` + "'" + startDate + " 00:00:00'"
-		//	condition += ` AND art.activity_time <= ` + "'" + endDate + " 23:59:59'"
-		//}
-		//
-		//if activeState != "" {
-		//	condition += ` AND art.active_state  IN (` + activeState + `)`
-		//} else {
-		//	condition += ` AND art.active_state  IN (1,2)`
-		//}
-		//
-		//conditionAdmin = condition
-		////查询全部可见的数据(是否全部客户可见)
-		//condition += ` AND art.visible_range != 1  `
-		//
-		//if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
-		//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%4%'	 ` + condition + `) `
-		//}
-		//if (userType == 5) && strings.Contains(permissionStr, "专家") {
-		//	conditionOr += ` OR (  art.is_limit_people = 1 AND art.customer_type_ids LIKE '%5%'	 ` + condition + `) `
-		//}
-		//if userType == 1 {
-		//	conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + permissionSqlStr + `) `
-		//} else {
-		//	conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
-		//}
-		//
-		//if companyProduct != nil {
-		//	if companyProduct.Scale != "" {
-		//		conditionOr += ` OR (  art.scale LIKE '%` + companyProduct.Scale + `%'	 ` + condition + `) `
-		//	}
-		//}
-		//
-		//if adminIds != "" {
-		//	conditionOr += ` OR ( art.admin_id IN (` + adminIds + `) ` + conditionAdmin + `) `
-		//}
+
 		conditionActivity, err := services.GetActivityonditionList(user, strconv.Itoa(v.ActivityTypeId), chartPermissionIds, whichDay, activeState, "", isPower)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取失败"

+ 1 - 1
controllers/report.go

@@ -1139,9 +1139,9 @@ func (this *ReportController) IsShow() {
 	}
 	total, _ := models.GetUserIsAdminCount(mobile)
 	if total > 0 {
-		resp.IsShow = true
 		resp.IsShowList = true
 	}
+	resp.IsShow = true
 	br.Ret = 200
 	br.Success = true
 	br.Data = resp

+ 85 - 54
models/activity.go

@@ -60,56 +60,69 @@ type ActivityArticleResp struct {
 
 //活动详情
 type ActivityDetail struct {
-	ActivityId              int    `orm:"column(activity_id);pk";description:"活动ID "`
-	ActivityTypeId          int    `description:"活动类型id"`
-	ActivityTypeName        string `description:"活动类型名称"`
-	ChartPermissionId       int    `description:"行业id"`
-	ChartPermissionName     string `description:"行业名称"`
-	ChartPermissionNames    string `description:"行业名称辅助字段,区分研选子分类"`
-	Body                    string `description:"内容"`
-	CreateTime              string `description:"创建时间"`
-	IsLimitPeople           int    `description:"是否限制人数 1是,0否"`
-	LimitPeopleNum          int    `description:"限制的人数数量"`
-	LastUpdatedTime         string `description:"更新时间"`
-	ActivityTime            string `description:"活动时间"`
-	ActivityTimeText        string `description:"活动时间带文字"`
-	DistinguishedGuest      string `description:"嘉宾"`
-	Host                    string `description:"主持人"`
-	Speaker                 string `description:"主讲人"`
-	MainlandTell            string `description:"大陆拨入号"`
-	HongKongTell            string `description:"香港拨入号"`
-	TaiwanTell              string `description:"台湾拨入号"`
-	AmericaTell             string `description:"美国拨入号"`
-	ParticipationCode       string `description:"参会密码"`
-	Theme                   string `description:"主题"`
-	Expert                  string `description:"专家"`
-	ActivityName            string `description:"活动名称"`
-	OnlineParticipation     string `description:"网络参会"`
-	ReportLink              string `description:"报告链接"`
-	City                    string `description:"城市"`
-	Address                 string `description:"活动地址"`
-	Highlights              string `description:"活动亮点"`
-	Remarks                 string `description:"备注"`
-	ShowType                string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
-	IsSignup                int    `description:"是否已报名 1是 ,0 否"`
-	IsAppointment           int    `description:"是否已预约纪要 1是 ,0 否"`
-	SignupNum               int    `description:"已报名人数"`
-	SignupType              int    `description:"报名方式,1预约外呼,2自主拨入,3我要报名"`
-	ActiveState             string `description:"活动进行状态 未开始:1、进行中2、已结束3"`
-	IsCancelMeetingReminder int    `description:"是否取消会议提醒 1展示取消会议提醒 ,0展示会议提醒"`
-	ArticleId               int    `description:"报告id(报告链接跳转使用)"`
-	CustomerTypeIds         string `description:"活动可见的客户类型,多个ID用 , 隔开"`
-	IsShowSustainable       bool   `description:"是否展示限免标签"`
-	Description             string `description:"研选内容说明"`
-	IsResearch              bool   `description:"是否属于研选"`
-	LinkParticipants        string `description:"链接参会"`
-	AppAttendance           string `description:"App参会"`
-	ConferencePassword      string `description:"会议密码"`
-	Scale                   string `description:"管理规模,空不填,1::50亿以下,2:50~100亿,3:100亿以上。多个用, 隔开"`
-	IsShowAppointment       bool   `description:"是否展示预约纪要"`
-	IsHideAppointment       int    `description:"是否隐藏预约纪要按钮  1是,0 否"`
-	IsCClassMeeting         bool   `description:"是否是c类电话会"`
-	ArticleList             []*ActivityArticleResp
+	ActivityId              int                        `orm:"column(activity_id);pk";description:"活动ID "`
+	ActivityTypeId          int                        `description:"活动类型id"`
+	ActivityTypeName        string                     `description:"活动类型名称"`
+	ChartPermissionId       int                        `description:"行业id"`
+	ChartPermissionName     string                     `description:"行业名称"`
+	ChartPermissionNames    string                     `description:"行业名称辅助字段,区分研选子分类"`
+	Body                    string                     `description:"内容"`
+	CreateTime              string                     `description:"创建时间"`
+	IsLimitPeople           int                        `description:"是否限制人数 1是,0否"`
+	LimitPeopleNum          int                        `description:"限制的人数数量"`
+	LastUpdatedTime         string                     `description:"更新时间"`
+	ActivityTime            string                     `description:"活动时间"`
+	ActivityTimeText        string                     `description:"活动时间带文字"`
+	DistinguishedGuest      string                     `description:"嘉宾"`
+	Host                    string                     `description:"主持人"`
+	Speaker                 string                     `description:"主讲人"`
+	MainlandTell            string                     `description:"大陆拨入号"`
+	HongKongTell            string                     `description:"香港拨入号"`
+	TaiwanTell              string                     `description:"台湾拨入号"`
+	AmericaTell             string                     `description:"美国拨入号"`
+	ParticipationCode       string                     `description:"参会密码"`
+	Theme                   string                     `description:"主题"`
+	Expert                  string                     `description:"专家"`
+	ActivityName            string                     `description:"活动名称"`
+	OnlineParticipation     string                     `description:"网络参会"`
+	ReportLink              string                     `description:"报告链接"`
+	City                    string                     `description:"城市"`
+	Address                 string                     `description:"活动地址"`
+	Highlights              string                     `description:"活动亮点"`
+	Remarks                 string                     `description:"备注"`
+	ShowType                string                     `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
+	IsSignup                int                        `description:"是否已报名 1是 ,0 否"`
+	IsAppointment           int                        `description:"是否已预约纪要 1是 ,0 否"`
+	SignupNum               int                        `description:"已报名人数"`
+	SignupType              int                        `description:"报名方式,1预约外呼,2自主拨入,3我要报名"`
+	ActiveState             string                     `description:"活动进行状态 未开始:1、进行中2、已结束3"`
+	IsCancelMeetingReminder int                        `description:"是否取消会议提醒 1展示取消会议提醒 ,0展示会议提醒"`
+	ArticleId               int                        `description:"报告id(报告链接跳转使用)"`
+	CustomerTypeIds         string                     `description:"活动可见的客户类型,多个ID用 , 隔开"`
+	IsShowSustainable       bool                       `description:"是否展示限免标签"`
+	Description             string                     `description:"研选内容说明"`
+	IsResearch              bool                       `description:"是否属于研选"`
+	LinkParticipants        string                     `description:"链接参会"`
+	AppAttendance           string                     `description:"App参会"`
+	ConferencePassword      string                     `description:"会议密码"`
+	Scale                   string                     `description:"管理规模,空不填,1::50亿以下,2:50~100亿,3:100亿以上。多个用, 隔开"`
+	IsShowAppointment       bool                       `description:"是否展示预约纪要"`
+	IsHideAppointment       int                        `description:"是否隐藏预约纪要按钮  1是,0 否"`
+	IsCClassMeeting         bool                       `description:"是否是c类电话会"`
+	ArticleList             []*ActivityArticleResp     // 下面是列表添加的部分结构体
+	IsBrackets              int                        `description:"是否有方括号 1是 ,0 否"`
+	Label                   string                     `description:"主题标签"`
+	ImgUrl                  string                     `description:"图片链接"`
+	ImgUrlText              string                     `description:"图片链接文字"`
+	ActivityType            int                        `description:"活动线上线下类型 1线上,0 线下"`
+	JmcjRoadshowTitle       string                     `description:"进门财经手动匹配的活动名称"`
+	Listndustrial           []*IndustrialManagementRep `description:"活动关联的产业信息"`
+	IsShowOutboundCall      bool                       `description:"是否展示预约外呼"`
+	IsShowMeetingReminder   bool                       `description:"是否展示会议提醒"`
+	IsShowHelpSsk           bool                       `description:"是否展示帮我带问"`
+	IsShowSignup            bool                       `description:"是否展示我要报名"`
+	TemporaryLabel          string                     `description:"临时标签"`
+	IsCanAppointmentMinutes int                        `description:"是否可预约纪要 1是 ,0 否 默认0 "`
 }
 
 type CygxActivityResp struct {
@@ -151,7 +164,7 @@ func GetAddActivityInfoByIdShow(uid, ActivityId int) (item *ActivityDetail, err
 	return
 }
 
-//活动详情
+//活动列表
 type CygxActivityList struct {
 	ActivityId              int    `orm:"column(activity_id);pk";description:"活动ID 等于0新增活动,大于0修改活动"`
 	ActivityTypeId          int    `description:"活动类型id"`
@@ -188,13 +201,13 @@ type CygxActivityList struct {
 
 type GetCygxActivityListRep struct {
 	Paging *paging.PagingItem `description:"分页数据"`
-	List   []*CygxActivityList
+	List   []*ActivityDetail
 	Label  string `description:"主题"`
 	ImgUrl string `description:"图片路径"`
 }
 
 //列表
-func GetActivityListAll(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*CygxActivityList, err error) {
+func GetActivityListAll(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*ActivityDetail, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT art.* ,t.activity_type,t.img_url_text,c.image_url as  img_url,
 		( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id AND s.user_id = ?   AND s.is_cancel = 0  AND s.do_fail_type = 0) AS is_signup,
@@ -253,7 +266,7 @@ func GetScheduleCount(condition string, uid int) (count int, err error) {
 }
 
 //我的日程列表
-func GetScheduleList(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*CygxActivityList, err error) {
+func GetScheduleList(condition string, pars []interface{}, uid, startSize, pageSize int) (items []*ActivityDetail, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT art.*,t.activity_type,t.img_url_text,c.image_url as  img_url,
 			( SELECT COUNT( 1 ) FROM cygx_activity_signup AS s WHERE s.activity_id = art.activity_id AND s.user_id = ? AND s.is_cancel = 0 AND s.do_fail_type = 0) AS is_signup,
@@ -758,3 +771,21 @@ func GetActivityWeekPermission() (permission string, err error) {
 	err = o.Raw(sql).QueryRow(&permission)
 	return
 }
+
+//列表
+func GetIndustrialActivityGroupManagementList(activityId int) (items []*IndustrialManagementRep, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT
+			p.permission_name,
+			p.chart_permission_id,
+			m.industrial_management_id,
+			m.industry_name 
+			FROM
+			cygx_industrial_activity_group_management AS am
+			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = am.industrial_management_id
+			INNER JOIN chart_permission AS p ON p.chart_permission_id = m.chart_permission_id 
+			WHERE
+			am.activity_id = ? AND am.source = 1`
+	_, err = o.Raw(sql, activityId).QueryRows(&items)
+	return
+}

+ 2 - 0
models/industrial_management.go

@@ -16,6 +16,8 @@ type IndustrialManagementRep struct {
 	RecommendedIndex       int    `description:"推荐指数"`
 	LayoutTime             string `description:"布局时间"`
 	ArticleReadNum         int    `description:"文章阅读数量"`
+	IsResearch             bool   `description:"是否属于研选"`
+	IsJump                 bool   `description:"是否跳转"`
 }
 
 type IndustrialManagementCount struct {

+ 1 - 1
models/report.go

@@ -203,7 +203,7 @@ func GetWhichDepartmentCount(condition string) (count int, err error) {
 }
 
 type IsShow struct {
-	IsShow          bool   `description:"是否展示"`
+	IsShow          bool   `description:"绝密内参按钮是否展示"`
 	IsShowResearch  bool   `description:"研选是否展示限免"`
 	IsShowChart     bool   `description:"图表是否展示限免"`
 	IsShowList      bool   `description:"榜单是否展示"`

+ 9 - 9
routers/commentsRouter.go

@@ -82,7 +82,7 @@ func init() {
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"],
         beego.ControllerComments{
             Method: "LabelList",
-            Router: `/labelList`,
+            Router: `/labelList_deltest`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,
@@ -99,8 +99,8 @@ func init() {
 
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"],
         beego.ControllerComments{
-            Method: "LabelTypeList",
-            Router: `/labelTypeList`,
+            Method: "LabelTypeListPc",
+            Router: `/labelTypeListPc_deltest`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,
@@ -108,8 +108,8 @@ func init() {
 
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"],
         beego.ControllerComments{
-            Method: "LabelTypeListPc",
-            Router: `/labelTypeListPc`,
+            Method: "LabelTypeListV5",
+            Router: `/labelTypeListV5`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,
@@ -117,8 +117,8 @@ func init() {
 
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"],
         beego.ControllerComments{
-            Method: "LabelTypeListV5",
-            Router: `/labelTypeListV5`,
+            Method: "LabelTypeListV6Pc",
+            Router: `/labelTypeListV6Pc`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,
@@ -126,8 +126,8 @@ func init() {
 
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ActivityCoAntroller"],
         beego.ControllerComments{
-            Method: "LabelTypeListV6Pc",
-            Router: `/labelTypeListV6Pc`,
+            Method: "LabelTypeList",
+            Router: `/labelTypeList_deltest`,
             AllowHTTPMethods: []string{"get"},
             MethodParams: param.Make(),
             Filters: nil,

+ 85 - 0
services/activity.go

@@ -1125,6 +1125,21 @@ func IsShowAppointment(activityTypeId int, chartPermissionName string) (isShowAp
 	return
 }
 
+//判断预约纪要按钮是否显示
+func IsShowAppointmentByactivityInfo(item *models.ActivityDetail, chartPermissionName string) (isShowAppointment bool) {
+	activityTypeId := item.ActivityTypeId
+	if activityTypeId == 1 || activityTypeId == 3 || activityTypeId == 4 {
+		isShowAppointment = true
+	}
+	if activityTypeId == 5 && chartPermissionName == "医药" {
+		isShowAppointment = true
+	}
+	if activityTypeId == 2 && item.IsLimitPeople == 0 {
+		isShowAppointment = true
+	}
+	return
+}
+
 //用户报告操作行为,模板消息推送 (先放在活动模块下,避免代码冲突)
 func ArticleUserRemind(user *models.WxUserItem, articleDetail *models.ArticleDetail, source int) (err error) {
 	defer func() {
@@ -1284,3 +1299,73 @@ func DoActivityOnenIdWxTemplateMsg(cont context.Context) (err error) {
 	SendActivityOnenIdWxTemplateMsg(first, keyword1, keyword2, keyword3, keyword4, openidPowerList)
 	return
 }
+
+func ActivityButtonShow(item *models.ActivityDetail) (articleDetail *models.ActivityDetail) {
+	articleDetail = item
+	//IsShowAppointment       bool                       `description:"是否展示预约纪要"`
+	//IsShowOutboundCall      bool                       `description:"是否展示预约外呼"`
+	//IsShowMeetingReminder   bool                       `description:"是否展示会议提醒"`
+	//IsShowHelpSsk           bool                       `description:"是否展示帮我带问"`
+	//IsShowSignup            bool                       `description:"是否展示我要报名"`
+
+	//如果后台在添加活的时候,关联的报告类型不隐藏预约纪要按钮,而且满足以下展示预约纪要按钮类型就展示
+	//if articleDetail.IsHideAppointment == 0 {
+	//	articleDetail.IsShowAppointment = IsShowAppointmentByactivityInfo(articleDetail, articleDetail.ChartPermissionName)
+	//}
+
+	//新的是否展示规则
+	if articleDetail.IsCanAppointmentMinutes == 1 {
+		articleDetail.IsShowAppointment = true
+	} else {
+		articleDetail.IsShowAppointment = false
+	}
+
+	//专家电话会 1
+	if articleDetail.ActivityTypeId == 1 {
+		articleDetail.IsShowOutboundCall = true
+		if articleDetail.LimitPeopleNum == 0 {
+			articleDetail.IsShowMeetingReminder = true
+			articleDetail.IsShowHelpSsk = true
+		}
+	}
+
+	//分析师电话会 2
+	if articleDetail.ActivityTypeId == 2 {
+		articleDetail.IsShowOutboundCall = true
+		if articleDetail.LimitPeopleNum == 0 {
+			articleDetail.IsShowMeetingReminder = true
+		}
+	}
+
+	//公司调研电话会 3
+	if articleDetail.ActivityTypeId == 3 {
+		if articleDetail.LimitPeopleNum == 0 {
+			articleDetail.IsShowMeetingReminder = true
+			articleDetail.IsShowOutboundCall = true
+		} else {
+			articleDetail.IsShowSignup = true
+		}
+	}
+
+	//公司线下调研 4
+	if articleDetail.ActivityTypeId == 4 {
+		articleDetail.IsShowSignup = true
+	}
+
+	//专家线下沙龙 5
+	if articleDetail.ActivityTypeId == 5 {
+		articleDetail.IsShowSignup = true
+	}
+
+	//分析师线下沙龙 6
+	if articleDetail.ActivityTypeId == 6 {
+		articleDetail.IsShowSignup = true
+	}
+
+	//分析师电话会(C类) 7
+	if articleDetail.ActivityTypeId == 7 {
+		articleDetail.IsShowSignup = true
+	}
+
+	return
+}