|
@@ -127,6 +127,8 @@ func (this *ReportSelectionController) PreserveAndPublish() {
|
|
|
if v.IndustrialManagementNames != "" {
|
|
|
item.IndustrialManagementNames = v.IndustrialManagementNames
|
|
|
}
|
|
|
+ item.ThirdId = v.ThirdId
|
|
|
+ item.ThirdName = v.ThirdName
|
|
|
item.OverviewArticleId = v.OverviewArticleId
|
|
|
item.IsNew = v.IsNew
|
|
|
item.IsShowOverviewArticle = v.IsShowOverviewArticle
|
|
@@ -422,7 +424,9 @@ func (this *ReportSelectionController) Detail() {
|
|
|
listSon[kIndustrial].IsNew = 0
|
|
|
}
|
|
|
|
|
|
- if vIndustrial.SubjectName == "" {
|
|
|
+ if vIndustrial.ThirdName != "" {
|
|
|
+ listSon[kIndustrial].ShowName = vIndustrial.ThirdName
|
|
|
+ } else if vIndustrial.SubjectName == "" {
|
|
|
listSon[kIndustrial].ShowName = vIndustrial.IndustrialManagementNames
|
|
|
} else {
|
|
|
listSon[kIndustrial].ShowName = vIndustrial.SubjectName
|
|
@@ -670,6 +674,8 @@ func (this *ReportSelectionController) ListPeriods() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ condition += ` GROUP BY periods `
|
|
|
list, err := cygx.GetReportSelectionListPeriods(condition, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
@@ -1026,7 +1032,11 @@ func (this *ReportSelectionController) History() {
|
|
|
}
|
|
|
mapSubjectHistory := make(map[string]int) // 标的点击数量
|
|
|
mapIndustrialHistory := make(map[string]int) // 产业点击数量
|
|
|
+ mapThirdIdHistory := make(map[int]int) // 三方产业点击数量
|
|
|
for _, v := range listSelectionSubjectHistory {
|
|
|
+ if v.ThirdId > 0 {
|
|
|
+ mapThirdIdHistory[v.ThirdId]++
|
|
|
+ }
|
|
|
mapSubjectHistory[v.IndustrialSubjectId]++
|
|
|
if v.IndustrialSubjectId == "0" && v.IndustrialManagementId > 0 {
|
|
|
mapIndustrialHistory[strconv.Itoa(v.IndustrialManagementId)]++
|
|
@@ -1040,7 +1050,10 @@ func (this *ReportSelectionController) History() {
|
|
|
for _, v2 := range listSelectionLog {
|
|
|
if v.ChartPermissionName == v2.PermissionName {
|
|
|
item := new(cygx.HistoryReportSelectionLogResp)
|
|
|
- if (v2.IndustrialSubjectId == "" || v2.IndustrialSubjectId == "0") && v2.IndustrialManagementId != "" {
|
|
|
+ if v2.ThirdId > 0 {
|
|
|
+ item.SubjectName = v2.ThirdName
|
|
|
+ item.Count = mapThirdIdHistory[v2.ThirdId]
|
|
|
+ } else if (v2.IndustrialSubjectId == "" || v2.IndustrialSubjectId == "0") && v2.IndustrialManagementId != "" {
|
|
|
item.SubjectName = v2.IndustrialManagementNames
|
|
|
item.Count = mapIndustrialHistory[v2.IndustrialManagementId]
|
|
|
} else {
|
|
@@ -1100,3 +1113,66 @@ func (this *ReportSelectionController) RarryList() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 添加三方名称
|
|
|
+// @Description 添加三方名称接口
|
|
|
+// @Param request body cygx.AddReportSelectionThirdNameReq true "type json string"
|
|
|
+// @Success Ret=200 {object} cygx.AddReportSelectionThirdNameResp
|
|
|
+// @router /reportSelection/add/third_name [post]
|
|
|
+func (this *ReportSelectionController) AddThirdName() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ AdminUser := this.SysUser
|
|
|
+ if AdminUser == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var req cygx.AddReportSelectionThirdNameReq
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ thirdName := req.ThirdName
|
|
|
+ chartPermissionId := req.ChartPermissionId
|
|
|
+ if thirdName == "" {
|
|
|
+ br.Msg = "名称不能为空"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 品种信息
|
|
|
+ chartPermission, err := models.GetChartPermissionById(chartPermissionId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "品种信息有误"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ item := new(cygx.CygxReportSelectionThirdName)
|
|
|
+ item.ThirdName = thirdName
|
|
|
+ item.ChartPermissionId = chartPermissionId
|
|
|
+ item.ChartPermissionName = chartPermission.ChartPermissionName
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+
|
|
|
+ newId, err := cygx.AddCygxReportSelectionThirdName(item)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := new(cygx.AddReportSelectionThirdNameResp)
|
|
|
+ resp.ThirdName = thirdName
|
|
|
+ resp.ThirdId = fmt.Sprint(newId)
|
|
|
+ br.Ret = 200
|
|
|
+ br.Data = resp
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "操作成功"
|
|
|
+ br.IsAddLog = true
|
|
|
+}
|