瀏覽代碼

Merge branch 'cygx_12.7' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 1 年之前
父節點
當前提交
43c9ac6380
共有 4 個文件被更改,包括 75 次插入14 次删除
  1. 18 14
      controllers/activity_special.go
  2. 1 0
      models/micro_roadshow.go
  3. 42 0
      services/micro_roadshow.go
  4. 14 0
      services/user.go

+ 18 - 14
controllers/activity_special.go

@@ -121,12 +121,14 @@ func (this *ActivitySpecialController) SpecialDetail() {
 		br.ErrMsg = "活动ID错误,Err:" + "activityId:" + strconv.Itoa(activityId)
 		return
 	}
-	havePower, err := services.GetSpecialDetailUserPower(user, activityInfo)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		return
-	}
+	//havePower, err := services.GetSpecialDetailUserPower(user, activityInfo)
+	//if err != nil {
+	//	br.Msg = "获取信息失败"
+	//	br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
+	//	return
+	//}
+	var havePower bool
+	havePower = true
 	//判断有没有对应的权限,如果没有则给出对应的状态码
 	if havePower {
 		resp.HasPermission = 1
@@ -342,12 +344,12 @@ func (this *ActivitySpecialController) SpecialTripAdd() {
 				return
 			}
 			if userType == 2 {
-				tripRemaining = tripRemaining+itemBill.BillDetailed
+				tripRemaining = tripRemaining + itemBill.BillDetailed
 				itemBill.Total = strconv.Itoa(tripRemaining) + "次"
 			} else {
 				for k, num := range mapChartName {
 					if activityInfo.ChartPermissionName == k {
-						num = num+ itemBill.BillDetailed
+						num = num + itemBill.BillDetailed
 					}
 					itemBill.Total += k + strconv.Itoa(num) + "次+"
 				}
@@ -524,12 +526,14 @@ func (this *ActivitySpecialController) SpecialSignupAdd() {
 		br.ErrMsg = "操作失败,Err:" + errInfo.Error()
 		return
 	}
-	havePower, err := services.GetSpecialDetailUserPower(user, activityInfo)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
-		return
-	}
+	//havePower, err := services.GetSpecialDetailUserPower(user, activityInfo)
+	//if err != nil {
+	//	br.Msg = "获取信息失败"
+	//	br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
+	//	return
+	//}
+	var havePower bool
+	havePower = true
 	//判断有没有对应的权限,如果没有则给出对应的状态码
 	if havePower {
 		resp.HasPermission = 1

+ 1 - 0
models/micro_roadshow.go

@@ -40,6 +40,7 @@ type MicroRoadShowPageList struct {
 	Title                  string    `description:"标题"`
 	ResourceUrl            string    `description:"链接"`
 	Type                   int       `description:"类型: 1-音频; 2-活动视频; 3-产业视频 、 4-系列问答视频"`
+	LabelType              int       `description:"标签类型: 1-路演回放; 2-调研反馈; 3-产业视频; 4-问答系列"`
 	PublishTime            string    `description:"发布时间"`
 	BackgroundImg          string    `description:"背景图"`
 	ShareImg               string    `description:"分享封面图"`

+ 42 - 0
services/micro_roadshow.go

@@ -420,6 +420,20 @@ func GetMicroRoadShowPageListV12(pageSize, currentIndex, sourceId, tableType int
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		return
 	}
+	var activiiTyIds []int
+	for _, v := range videoList {
+		v.LabelType = v.Type
+		if v.Type == 1 || v.Type == 2 {
+			v.LabelType = 2 // 先将路演回放设置为调研反馈类型,再做处理
+			activiiTyIds = append(activiiTyIds, v.SourceId)
+		}
+	}
+	mapactiviiTyIds := GetActivityLYHFMapByActivityIds(activiiTyIds)
+	for _, v := range videoList {
+		if v.Type == 1 && mapactiviiTyIds[v.SourceId] {
+			v.LabelType = 1 // 处理路演回放
+		}
+	}
 	respList = videoList
 	return
 }
@@ -844,3 +858,31 @@ func AddAllCygxVoiceAndVideoHistory(user *models.WxUserItem, sourceId, sourceTyp
 	}
 	return
 }
+
+// 获取满足路演回放的活动类型
+func GetActivityLYHFMapByActivityIds(activityIds []int) (mapResp map[int]bool) {
+	var err error
+	defer func() {
+		if err != nil {
+			go utils.SendAlarmMsg("获取满足路演回放的活动类型 GetActivityLYHFMapByActivityIds,失败,活动ID:"+fmt.Sprint(activityIds)+err.Error(), 2)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+	lenArr := len(activityIds)
+	if lenArr == 0 {
+		return
+	}
+	condition = ` AND activity_id IN (` + utils.GetOrmInReplace(lenArr) + `)  `
+	pars = append(pars, activityIds)
+	list, e := models.GetCygxActivityList(condition, pars, 0, lenArr)
+	if e != nil {
+		err = errors.New("GetIndustrialManagementNewList, Err: " + e.Error())
+		return
+	}
+	mapResp = make(map[int]bool, 0)
+	for _, v := range list {
+		mapResp[v.ActivityId] = true
+	}
+	return
+}

+ 14 - 0
services/user.go

@@ -638,6 +638,20 @@ func GetMicroRoadShowMycollectV12(pageSize, currentIndex int, audioIds, activity
 			}
 		}
 	}
+	var activiiTyIds []int
+	for _, v := range videoList {
+		v.LabelType = v.Type
+		if v.Type == 1 || v.Type == 2 {
+			v.LabelType = 2 // 先将路演回放设置为调研反馈类型,再做处理
+			activiiTyIds = append(activiiTyIds, v.SourceId)
+		}
+	}
+	mapactiviiTyIds := GetActivityLYHFMapByActivityIds(activiiTyIds)
+	for _, v := range videoList {
+		if v.Type == 1 && mapactiviiTyIds[v.SourceId] {
+			v.LabelType = 1 // 处理路演回放
+		}
+	}
 	respList = videoList
 	return
 }