|
@@ -3,7 +3,10 @@ package controllers
|
|
|
import (
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
+ "hongze/hongze_cygx/services"
|
|
|
"hongze/hongze_cygx/utils"
|
|
|
+ "strconv"
|
|
|
+ "strings"
|
|
|
)
|
|
|
|
|
|
// 晨会精华
|
|
@@ -17,7 +20,7 @@ type MorningMeetingController struct {
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Success Ret=200 {object} cygx.GetCygxTacticsTimeLineResp
|
|
|
// @router /gather/list [get]
|
|
|
-func (this *MorningMeetingController) List() {
|
|
|
+func (this *MorningMeetingController) GatherList() {
|
|
|
br := new(models.BaseResponse).Init()
|
|
|
defer func() {
|
|
|
this.Data["json"] = br
|
|
@@ -58,11 +61,38 @@ func (this *MorningMeetingController) List() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ var meetids string
|
|
|
+ for _, v := range list {
|
|
|
+ meetids += v.MeetingIds + ","
|
|
|
+ }
|
|
|
+ meetids = strings.TrimRight(meetids, ",")
|
|
|
+ mapMeetName := make(map[string]string)
|
|
|
+ if meetids != "" {
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = ` AND id IN(` + meetids + `) `
|
|
|
+ listMeet, err := models.GetCygxMorningMeetingReviewsList(condition, pars, 0, 10000)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ }
|
|
|
+ for _, v := range listMeet {
|
|
|
+ mapMeetName[strconv.Itoa(v.Id)] = v.IndustryNames
|
|
|
+ }
|
|
|
+ }
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
for _, v := range list {
|
|
|
item := new(models.CygxMorningMeetingGatherResp)
|
|
|
item.Id = v.Id
|
|
|
item.Title = v.Title
|
|
|
+ sliceMeetingIds := strings.Split(v.MeetingIds, ",")
|
|
|
+ for _, vM := range sliceMeetingIds {
|
|
|
+ if mapMeetName[vM] != "" {
|
|
|
+ item.IndustryName += mapMeetName[vM] + ","
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item.IndustryName = strings.TrimRight(item.IndustryName, ",")
|
|
|
+ item.IndustryName = strings.Replace(item.IndustryName, ",", "】,【", -1)
|
|
|
+ item.IndustryName = "【" + item.IndustryName + "】"
|
|
|
resp.List = append(resp.List, item)
|
|
|
}
|
|
|
resp.Paging = page
|
|
@@ -71,3 +101,91 @@ func (this *MorningMeetingController) List() {
|
|
|
br.Msg = "获取成功"
|
|
|
br.Data = resp
|
|
|
}
|
|
|
+
|
|
|
+// @Title 晨会精华汇总详情
|
|
|
+// @Description 晨会精华汇总详情接口
|
|
|
+// @Param Id query int true "Id"
|
|
|
+// @Success Ret=200 {object} cygx.GetCygxTacticsTimeLineResp
|
|
|
+// @router /gather/detail [get]
|
|
|
+func (this *MorningMeetingController) GatherDetail() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ user := this.User
|
|
|
+ if user == nil {
|
|
|
+ br.Msg = "请登录"
|
|
|
+ br.ErrMsg = "请登录,用户信息为空"
|
|
|
+ br.Ret = 408
|
|
|
+ return
|
|
|
+ }
|
|
|
+ id, _ := this.GetInt("Id")
|
|
|
+ resp := new(models.CygxMorningMeetingGatherDetailResp)
|
|
|
+ hasPermission, err := services.GetUserhasPermission(user)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户权限信息失败,Err:" + err.Error()
|
|
|
+ }
|
|
|
+ if hasPermission != 1 {
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ condition += ` AND status = 1 AND id = ? `
|
|
|
+ pars = append(pars, id)
|
|
|
+ total, err := models.GetCygxMorningMeetingGatherCount(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if total == 0 {
|
|
|
+ br.Msg = "内容不存在,或未发布"
|
|
|
+ }
|
|
|
+ detail, err := models.GetCygxMorningMeetingGatherById(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var meetids string
|
|
|
+ meetids = detail.MeetingIds
|
|
|
+ detailResp := new(models.CygxMorningMeetingGatherDetail)
|
|
|
+ if meetids != "" {
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = ` AND meeting_id IN(` + meetids + `) `
|
|
|
+ listMeet, err := models.GetCygxMorningMeetingReviewChapterList(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ }
|
|
|
+ for _, v := range listMeet {
|
|
|
+ detailResp.List = append(detailResp.List, &models.CygxMorningMeetingGatherDetailListResp{
|
|
|
+ Id: v.Id,
|
|
|
+ IndustryId: v.IndustryId,
|
|
|
+ IndustryName: v.IndustryName,
|
|
|
+ ChartPermissionName: v.ChartPermissionName,
|
|
|
+ ChartPermissionId: v.ChartPermissionId,
|
|
|
+ MeetingId: int(v.MeetingId),
|
|
|
+ Content: v.Content,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ detailResp.List = make([]*models.CygxMorningMeetingGatherDetailListResp, 0)
|
|
|
+ }
|
|
|
+ detailResp.Id = detail.Id
|
|
|
+ detailResp.Title = detail.Title
|
|
|
+ detailResp.PublishTime = utils.GetTimeDateRemoveYear(detail.PublishTime)
|
|
|
+ detailResp.Department = "弘则产品组"
|
|
|
+ resp.Detail = detailResp
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+}
|