Browse Source

no message

zhangchuanxing 5 months ago
parent
commit
277cd1f917

+ 59 - 0
controllers/cygx/industrial_subject.go

@@ -628,3 +628,62 @@ func (this *IndustrialSubjectController) CountDetail() {
 	br.Msg = "获取成功"
 	br.Data = resp
 }
+
+// @Title 通过行业获取关联标的列表
+// @Description 通过行业获取关联标的列表接口
+// @Param   KeyWord   query   string  false       "搜索关键词"
+// @Param   ChartPermissionId   query   int  true       "分类ID"
+// @Success Ret=200  {object} cygx.CygxIndustrialSubjectList
+// @router /industrialAndSubject/search [get]
+func (this *IndustrialSubjectController) IndustrialAndSubjectSearch() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+	var condition string
+	keyWord := this.GetString("KeyWord")
+	chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	if keyWord != "" {
+		condition = ` AND s.subject_name LIKE '%` + keyWord + `%'  `
+	}
+	if chartPermissionId > 0 {
+		condition += ` AND m.chart_permission_id = ` + strconv.Itoa(chartPermissionId)
+	}
+	listSubject, err := cygx.GetIndustrialSubjectListNameByChartId(condition)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	condition = ` AND industry_name LIKE '%` + keyWord + `%'  AND  chart_permission_id = ` + strconv.Itoa(chartPermissionId)
+	listIndustrial, err := cygx.GetIndustrialManagement(condition)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	listResp := make([]*cygx.CygxIndustrialSubjectListRep, 0)
+	for _, v := range listIndustrial {
+		item := new(cygx.CygxIndustrialSubjectListRep)
+		item.IndustryName = v.IndustryName
+		item.IndustrialManagementId = v.IndustrialManagementId
+		listResp = append(listResp, item)
+	}
+	for _, v := range listSubject {
+		listResp = append(listResp, v)
+	}
+	resp := new(cygx.CygxIndustrialSubjectList)
+	resp.List = listResp
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 1 - 0
controllers/cygx/report_selection.go

@@ -123,6 +123,7 @@ func (this *ReportSelectionController) PreserveAndPublish() {
 		item.IndustrialSubjectId = v.IndustrialSubjectId
 		item.SubjectName = v.IndustrialSubjectName
 		item.IndustrialManagementId = v.IndustrialManagementId
+		item.IndustrialManagementNames = v.IndustrialManagementName
 		item.OverviewArticleId = v.OverviewArticleId
 		item.IsNew = v.IsNew
 		item.IsShowOverviewArticle = v.IsShowOverviewArticle

+ 13 - 12
models/cygx/report_selection_log.go

@@ -6,18 +6,19 @@ import (
 )
 
 type CygxReportSelectionLog struct {
-	ArticleSunId           int       `orm:"column(article_sun_id);pk"description:"子级报告id"`
-	ArticleId              int       `description:"父级报告Id"`
-	ChartPermissionId      int       `description:"行业ID"`
-	CreateTime             time.Time `description:"创建时间"`
-	Body                   string    `description:"内容"`
-	IndustrialSubjectId    string    `description:"标的ID"`
-	SubjectName            string    `description:"标的名称"`
-	IndustrialManagementId string    `description:"产业资源包Id  多个用 , 隔开"`
-	CompanyLabel           string    `description:"公司标签多个用{|}隔开"`
-	OverviewArticleId      int       `description:"关联的综述报告ID"`
-	IsNew                  int       `description:"是否为New标签"`
-	IsShowOverviewArticle  int       `description:"是否展示综述报告 1展示,0隐藏"`
+	ArticleSunId              int       `orm:"column(article_sun_id);pk"description:"子级报告id"`
+	ArticleId                 int       `description:"父级报告Id"`
+	ChartPermissionId         int       `description:"行业ID"`
+	CreateTime                time.Time `description:"创建时间"`
+	Body                      string    `description:"内容"`
+	IndustrialSubjectId       string    `description:"标的ID"`
+	SubjectName               string    `description:"标的名称"`
+	IndustrialManagementId    string    `description:"产业资源包Id  多个用 , 隔开"`
+	IndustrialManagementNames string    `description:"产业资源包名称  多个用 , 隔开"`
+	CompanyLabel              string    `description:"公司标签多个用{|}隔开"`
+	OverviewArticleId         int       `description:"关联的综述报告ID"`
+	IsNew                     int       `description:"是否为New标签"`
+	IsShowOverviewArticle     int       `description:"是否展示综述报告 1展示,0隐藏"`
 }
 
 type CygxReportSelectionLogRep struct {

+ 9 - 0
routers/commentsRouter.go

@@ -1708,6 +1708,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:IndustrialSubjectController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:IndustrialSubjectController"],
+        beego.ControllerComments{
+            Method: "IndustrialAndSubjectSearch",
+            Router: `/industrialAndSubject/search`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:IndustrialSubjectController"] = append(beego.GlobalControllerRouter["hongze/hz_crm_api/controllers/cygx:IndustrialSubjectController"],
         beego.ControllerComments{
             Method: "IndustrialSubjectAdd",