Ver Fonte

no message

xingzai há 1 ano atrás
pai
commit
98cf2ca612

+ 11 - 3
controllers/activity.go

@@ -30,6 +30,7 @@ type ActivityNoLoginController struct {
 
 // @Title 活动类型列表
 // @Description活动类型列表接口
+// @Param   IsResearch   query   bool  true       "是否为研选"
 // @Success 200 {object} models.ActivityTypeListResp
 // @router /activityTypelist [get]
 func (this *ActivityCoAntroller) List() {
@@ -46,7 +47,14 @@ func (this *ActivityCoAntroller) List() {
 		return
 	}
 	resp := new(models.ActivityTypeListResp)
-	list, err := models.GetActivityTypeList()
+	isResearch, _ := this.GetBool("IsResearch", false)
+	var condition string
+
+	//是否仅展示研选下的活动类型
+	if isResearch {
+		condition = " AND source_type IN (0,2) "
+	}
+	list, err := models.GetActivityTypeList(condition)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
@@ -1055,7 +1063,7 @@ func (this *ActivityCoAntroller) GetUserSearchContent() {
 		detail = detailSeearch
 	}
 	isShowJurisdiction, _ := this.GetInt("IsShowJurisdiction")
-	listActivityType, errActivityType := models.GetActivityTypeList()
+	listActivityType, errActivityType := models.GetActivityTypeList("")
 	if errActivityType != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取数据失败,Err:" + errActivityType.Error()
@@ -1935,7 +1943,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	}
 	//未开始进行中默认按照时间正序
 	if activeState == "1" || activeState == "1,2" || activeState == "" {
-		conditionOrder = ` ORDER BY art.activity_time ASC  `
+		conditionOrder = ` ORDER BY  art.top_time DESC , art.activity_time ASC  `
 	}
 	//conditionActivityKey += condition + conditionOrder
 	condition += conditionOrder

+ 32 - 0
controllers/chart_permission.go

@@ -321,3 +321,35 @@ func (this *ChartPermissionAuthController) ReportDetailV7() {
 	br.Msg = "获取成功"
 	br.Data = resp
 }
+
+// @Title 获取报告医药、消费、科技、智造、策略权限列表(没有买方研选)
+// @Description 获取报告医药、消费、科技、智造、策略权限列表(没有买方研选)
+// @Success 200 {object} models.ChartPermissionResp
+// @router /noyx [get]
+func (this *ChartPermissionAuthController) Noyx() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	var condition string
+	condition += ` AND permission_name IN ('医药','消费','科技','智造','策略') `
+	list, err := models.GetChartPermissionReportAll(condition)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+	resp := new(models.ChartPermissionResp)
+	resp.List = list
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 3 - 3
models/activity_type.go

@@ -6,7 +6,7 @@ import (
 
 type ActivityType struct {
 	ActivityTypeId   int    `description:"活动类型id"`
-	ActivityTypeName string `description:"活动名称"`
+	ActivityTypeName string `description:"活动类型名称"`
 	//TemplateP        string `description:"活动模板,带P标签"`
 	//Template         string `description:"活动模板"`
 	ShowType  string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
@@ -19,9 +19,9 @@ type ActivityTypeListResp struct {
 }
 
 // 列表
-func GetActivityTypeList() (items []*ActivityType, err error) {
+func GetActivityTypeList(condition string) (items []*ActivityType, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
+	sql := `SELECT * FROM cygx_activity_type WHERE 1= 1  ` + condition + `  ORDER BY sort DESC`
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }

+ 1 - 0
models/db.go

@@ -179,6 +179,7 @@ func init() {
 		new(CygxYanxuanSpecialCompany),
 		new(CygxQuestionnaireVote),
 		new(CygxQuestionnaireVoteOtherTheme),
+		new(CygxMorningMeetingReviewChapterHistory),
 	)
 	// 记录ORM查询日志
 	orm.Debug = true

+ 18 - 0
routers/commentsRouter.go

@@ -655,6 +655,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ChartPermissionAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ChartPermissionAuthController"],
+        beego.ControllerComments{
+            Method: "Noyx",
+            Router: `/noyx`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ChartPermissionAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ChartPermissionAuthController"],
         beego.ControllerComments{
             Method: "ReportDetail",
@@ -889,6 +898,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:MorningMeetingController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:MorningMeetingController"],
+        beego.ControllerComments{
+            Method: "SpecialMsg",
+            Router: `/history/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ProductInteriorController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ProductInteriorController"],
         beego.ControllerComments{
             Method: "Detail",

+ 11 - 4
services/morning_meeting.go

@@ -2,6 +2,7 @@ package services
 
 import (
 	"context"
+	"errors"
 	"fmt"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
@@ -76,7 +77,7 @@ func MakeMorningMeetingReviews(cont context.Context) (err error) {
 func AddCygxMorningMeetingReviewChapterHistory(user *models.WxUserItem, articleId int, sourcePage string) (err error) {
 	defer func() {
 		if err != nil {
-			go utils.SendAlarmMsg(fmt.Sprint("产品内测用户浏览信息记录失败"+err.Error(), "id:", articleId, "sourcePage:", sourcePage, "userid:", user.UserId), 2)
+			go utils.SendAlarmMsg(fmt.Sprint("添加晨会点评点击记录失败 ,AddCygxMorningMeetingReviewChapterHistory err"+err.Error(), "id:", articleId, "sourcePage:", sourcePage, "userid:", user.UserId), 2)
 		}
 	}()
 	historyRecord := new(models.CygxMorningMeetingReviewChapterHistory)
@@ -88,14 +89,20 @@ func AddCygxMorningMeetingReviewChapterHistory(user *models.WxUserItem, articleI
 	historyRecord.Email = user.Email
 	historyRecord.CompanyId = user.CompanyId
 	historyRecord.CompanyName = user.CompanyName
-	sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
-	if err != nil && err.Error() != utils.ErrNoRow() {
+	historyRecord.RegisterPlatform = utils.REGISTER_PLATFORM
+	sellerItem, e := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetSellerByCompanyIdCheckFicc, Err: " + e.Error())
 		return
 	}
 	historyRecord.RealName = user.RealName
 	if sellerItem != nil {
 		historyRecord.SellerName = sellerItem.RealName
 	}
-	_, err = models.AddCygxMorningMeetingReviewChapterHistory(historyRecord)
+	_, e = models.AddCygxMorningMeetingReviewChapterHistory(historyRecord)
+	if e != nil {
+		err = errors.New("AddCygxMorningMeetingReviewChapterHistorymodels, Err: " + e.Error())
+		return
+	}
 	return
 }