Ver código fonte

晨会精华

xingzai 1 ano atrás
pai
commit
fe471e9798

+ 181 - 0
controllers/morning_meeting.go

@@ -0,0 +1,181 @@
+package controllers
+
+import (
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/services"
+	"hongze/hongze_clpt/utils"
+	"strconv"
+	"strings"
+)
+
+// 晨会精华
+type MorningMeetingController struct {
+	BaseAuthController
+}
+
+// @Title 晨会精华汇总列表
+// @Description 晨会精华汇总列表接口
+// @Param   PageSize   query   int  true       "每页数据条数"
+// @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Success Ret=200 {object} cygx.GetCygxTacticsTimeLineResp
+// @router /gather/list [get]
+func (this *MorningMeetingController) GatherList() {
+	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
+	}
+	resp := new(models.CygxMorningMeetingGatherListResp)
+	pageSize, _ := this.GetInt("PageSize")
+	currentIndex, _ := this.GetInt("CurrentIndex")
+
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = utils.StartIndex(currentIndex, pageSize)
+	var condition string
+	var pars []interface{}
+	condition += ` AND status = 1 `
+	total, err := models.GetCygxMorningMeetingGatherCount(condition, pars)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	condition += "	ORDER BY publish_time DESC ,id  DESC "
+	list, err := models.GetCygxMorningMeetingGatherList(condition, pars, startSize, pageSize)
+	if err != nil {
+		br.Msg = "获取失败"
+		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
+	br.Ret = 200
+	br.Success = true
+	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()
+		}
+		detailResp.List = listMeet
+	} 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
+}

+ 90 - 0
models/cygx_morning_meeting_gather.go

@@ -0,0 +1,90 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"time"
+)
+
+type CygxMorningMeetingGather struct {
+	Id          int       `orm:"column(id);pk"`
+	MeetingIds  string    `description:"主表ID多个用 , 隔开"`
+	PublishTime string    `description:"发布日期"`
+	CreateTime  time.Time `description:"创建时间"`
+	ModifyTime  time.Time `description:"更新时间"`
+	Title       string    `description:"标题"`
+	Status      int       `description:"0:未发布,1:已发布"`
+}
+
+// 添加
+func AddCygxMorningMeetingGather(item *CygxMorningMeetingGather) (err error) {
+	o := orm.NewOrm()
+	_, err = o.Insert(item)
+	return
+}
+
+func GetCygxMorningMeetingGatherCount(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT COUNT(1) AS count FROM cygx_morning_meeting_gather WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	err = o.Raw(sql, pars).QueryRow(&count)
+	return
+}
+
+type CygxMorningMeetingGatherResp struct {
+	Id           int    `description:"ID"`
+	Title        string `description:"标题"`
+	IndustryName string `description:"多个产业名称"`
+}
+
+type CygxMorningMeetingGatherListResp struct {
+	Paging *paging.PagingItem `description:"分页数据"`
+	List   []*CygxMorningMeetingGatherResp
+}
+
+// 列表
+func GetCygxMorningMeetingGatherList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxMorningMeetingGather, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_morning_meeting_gather WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` LIMIT ?,? `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+func GetCygxMorningMeetingGatherById(condition string, pars []interface{}) (item *CygxMorningMeetingGather, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_morning_meeting_gather WHERE  1= 1`
+	if condition != "" {
+		sql += condition
+	}
+	err = o.Raw(sql, pars).QueryRow(&item)
+	return
+}
+
+type CygxMorningMeetingGatherDetailListResp struct {
+	Id                  int    `description:"ID"`
+	IndustryId          int    `description:"产业id"` // 产业id
+	IndustryName        string `description:"产业名称"` // 产业名称
+	ChartPermissionName string `description:"行业名称"` // 行业名称
+	ChartPermissionId   int    `description:"行业id"` // 行业id
+	MeetingId           int    `description:"主表id"` // 主表id
+	Content             string `description:"内容"`   // 内容
+}
+
+type CygxMorningMeetingGatherDetailResp struct {
+	HasPermission int `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
+	Detail        *CygxMorningMeetingGatherDetail
+}
+
+type CygxMorningMeetingGatherDetail struct {
+	Id          int    `description:"ID"`
+	Title       string `description:"标题"`
+	PublishTime string `description:"发布日期"`
+	Department  string `description:"作者"`
+	List        []*CygxMorningMeetingGatherDetailListResp
+}

+ 8 - 71
models/cygx_morning_meeting_review_chapter.go

@@ -20,36 +20,16 @@ type CygxMorningMeetingReviewChapter struct {
 	Content              string    `json:"content"`             // 内容
 }
 
-type AddMorningMeetingReviewItem struct {
-	ChapterId            int
-	Content              string
-	ChartPermissionId    int
-	ChartPermissionName  string
-	IndustryId           int
-	IndustryName         string
-	IndustrialSubjectIds string
-}
-
-type AddMorningMeetingReviewsReq struct {
-	List        []*AddMorningMeetingReviewItem
-	MeetingId   int
-	MeetingTime string
-	PublishTime string
-	DoType      int `description:"操作类型 0,保存 、1,发布"`
-}
-
-// 添加晨报点评章节
-func AddCygxMorningMeetingReviewChapter(item *CygxMorningMeetingReviewChapter) (err error) {
-	o := orm.NewOrm()
-	_, err = o.Insert(item)
-	return
-}
-
 // 列表
-func GetCygxMorningMeetingReviewsListById(meetingId int) (items []*CygxMorningMeetingReviewChapter, err error) {
+func GetCygxMorningMeetingReviewChapterList(condition string, pars []interface{}) (items []*CygxMorningMeetingGatherDetailListResp, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_morning_meeting_review_chapter WHERE meeting_id = ? `
-	_, err = o.Raw(sql, meetingId).QueryRows(&items)
+	sql := `SELECT c.*
+			FROM cygx_morning_meeting_review_chapter  as  c 
+			INNER JOIN cygx_morning_meeting_reviews as r ON  r.id = c.meeting_id   WHERE 1 = 1  AND r.status = 1 `
+	if condition != "" {
+		sql += condition
+	}
+	_, err = o.Raw(sql, pars).QueryRows(&items)
 	return
 }
 
@@ -78,49 +58,6 @@ type CygxMorningMeetingReviewChapterResp struct {
 	List        []*CygxMorningMeetingReviewChapterRespItem
 }
 
-// 删除晨会点评章节
-func DeleteMorningMeetingChapter(reviewId int) (err error) {
-	o := orm.NewOrm()
-	sql := ` DELETE FROM cygx_morning_meeting_review_chapter WHERE meeting_id =? `
-	_, err = o.Raw(sql, reviewId).Exec()
-	return
-}
-
-// 更新晨报点评章节
-func UpdateCygxMorningMeetingReviewChapter(item *CygxMorningMeetingReviewChapter) (err error) {
-	o := orm.NewOrm()
-	sql := `UPDATE cygx_morning_meeting_review_chapter
-			SET
-			  meeting_time =?,
-			  modify_time = ?,
-			  industry_id = ?,
-			  industry_name = ?,
-			  chart_permission_id = ?,
-			  chart_permission_name = ?,
-			  industrial_subject_ids = ?,
-			  content = ? 
-			WHERE id = ? `
-	_, err = o.Raw(sql, item.MeetingTime, item.ModifyTime, item.IndustryId, item.IndustryName,
-		item.ChartPermissionId, item.ChartPermissionName, item.IndustrialSubjectIds, item.Content, item.Id).Exec()
-
-	return
-}
-
-func GetCygxMorningMeetingReviewsListByIdAndIndustryId(meetingId, industryId int) (item *CygxMorningMeetingReviewChapter, err error) {
-	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_morning_meeting_review_chapter WHERE meeting_id = ? AND industry_id = ? `
-	err = o.Raw(sql, meetingId, industryId).QueryRow(&item)
-	return
-}
-
-// 删除晨会点评章节
-func DeleteMorningMeetingChapterById(chapterId int) (err error) {
-	o := orm.NewOrm()
-	sql := ` DELETE FROM cygx_morning_meeting_review_chapter WHERE id =? `
-	_, err = o.Raw(sql, chapterId).Exec()
-	return
-}
-
 func GetCygxMorningMeetingReviewsListByIndustrialIds(industrialIds string) (items []*CygxMorningMeetingReviewChapter, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_morning_meeting_review_chapter WHERE industry_id IN (` + industrialIds + `)  `

+ 76 - 0
models/cygx_morning_meeting_reviews.go

@@ -0,0 +1,76 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"time"
+)
+
+// CygxMorningMeetingReviews [...]
+type CygxMorningMeetingReviews struct {
+	Id            int       `orm:"column(id);pk"`
+	MeetingTime   time.Time `json:"meetingTime"` // 晨会日期
+	PublishTime   time.Time `json:"publishTime"` // 发布日期
+	CreateTime    time.Time `json:"createTime"`
+	ModifyTime    time.Time `json:"modifyTime"`
+	Status        int       `json:"status"`       // 0:未发布,1:已发布
+	PartNums      int       `json:"partNums"`     // 段落数
+	IndustryNames string    `json:"industryName"` // 产业名称
+}
+
+// 列表
+func GetCygxMorningMeetingReviewsList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxMorningMeetingReviews, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_morning_meeting_reviews WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	sql += ` LIMIT ?,? `
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+func GetCygxMorningMeetingReviewsListCount(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT COUNT(1) AS count FROM cygx_morning_meeting_reviews WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	err = o.Raw(sql, pars).QueryRow(&count)
+	return
+}
+
+type CygxMorningMeetingReviewItem struct {
+	Id            int    `orm:"column(id);pk"`
+	MeetingTime   string `json:"meetingTime"` // 晨会日期
+	PublishTime   string `json:"publishTime"` // 发布日期
+	CreateTime    string `json:"createTime"`
+	ModifyTime    string `json:"modifyTime"`
+	Status        int    `json:"status"`       // 0:未发布,1:已发布
+	PartNums      int    `json:"partNums"`     // 段落数
+	IndustryNames string `json:"industryName"` // 产业名称
+}
+
+type CygxMorningMeetingReviewsList struct {
+	List   []*CygxMorningMeetingReviewItem
+	Paging *paging.PagingItem `description:"分页数据"`
+}
+
+func GetMorningMeetingReviewById(reviewId int) (item *CygxMorningMeetingReviews, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_morning_meeting_reviews WHERE id=?`
+	err = o.Raw(sql, reviewId).QueryRow(&item)
+	return
+}
+
+type MorningReviewPublishReq struct {
+	ReviewIds string `description:"晨会id,多个用英文逗号隔开"`
+}
+
+type MorningReviewPublishCancelReq struct {
+	ReviewId int `description:"晨会id"`
+}
+
+type MorningReviewDeleteReq struct {
+	ReviewId int `description:"晨会id"`
+}

+ 18 - 0
routers/commentsRouter.go

@@ -511,6 +511,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MorningMeetingController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MorningMeetingController"],
+        beego.ControllerComments{
+            Method: "GatherDetail",
+            Router: `/gather/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MorningMeetingController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:MorningMeetingController"],
+        beego.ControllerComments{
+            Method: "GatherList",
+            Router: `/gather/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ReportCommonController"],
         beego.ControllerComments{
             Method: "CompanyList",

+ 5 - 0
routers/router.go

@@ -111,6 +111,11 @@ func init() {
 				&controllers.ReportSelectionController{},
 			),
 		),
+		web.NSNamespace("/morning_meeting",
+			web.NSInclude(
+				&controllers.MorningMeetingController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }

+ 36 - 23
utils/common.go

@@ -20,7 +20,7 @@ import (
 	"time"
 )
 
-//随机数种子
+// 随机数种子
 var rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
 
 func GetRandString(size int) string {
@@ -57,13 +57,13 @@ func StringsToJSON(str string) string {
 	return jsons
 }
 
-//序列化
+// 序列化
 func ToString(v interface{}) string {
 	data, _ := json.Marshal(v)
 	return string(data)
 }
 
-//md5加密
+// md5加密
 func MD5(data string) string {
 	m := md5.Sum([]byte(data))
 	return hex.EncodeToString(m[:])
@@ -91,7 +91,7 @@ func GetToday(format string) string {
 	return today
 }
 
-//获取今天剩余秒数
+// 获取今天剩余秒数
 func GetTodayLastSecond() time.Duration {
 	today := GetToday(FormatDate) + " 23:59:59"
 	end, _ := time.ParseInLocation(FormatDateTime, today, time.Local)
@@ -113,7 +113,7 @@ func GetBrithDate(idcard string) string {
 	return GetToday(FormatDate)
 }
 
-//处理性别
+// 处理性别
 func WhichSexByIdcard(idcard string) string {
 	var sexs = [2]string{"女", "男"}
 	length := len(idcard)
@@ -127,7 +127,7 @@ func WhichSexByIdcard(idcard string) string {
 	return "男"
 }
 
-//截取小数点后几位
+// 截取小数点后几位
 func SubFloatToString(f float64, m int) string {
 	n := strconv.FormatFloat(f, 'f', -1, 64)
 	if n == "" {
@@ -146,14 +146,14 @@ func SubFloatToString(f float64, m int) string {
 	return newn[0] + "." + newn[1][:m]
 }
 
-//截取小数点后几位
+// 截取小数点后几位
 func SubFloatToFloat(f float64, m int) float64 {
 	newn := SubFloatToString(f, m)
 	newf, _ := strconv.ParseFloat(newn, 64)
 	return newf
 }
 
-//获取相差时间-年
+// 获取相差时间-年
 func GetYearDiffer(start_time, end_time string) int {
 	t1, _ := time.ParseInLocation("2006-01-02", start_time, time.Local)
 	t2, _ := time.ParseInLocation("2006-01-02", end_time, time.Local)
@@ -164,7 +164,7 @@ func GetYearDiffer(start_time, end_time string) int {
 	return age
 }
 
-//获取相差时间-秒
+// 获取相差时间-秒
 func GetSecondDifferByTime(start_time, end_time time.Time) int64 {
 	diff := end_time.Unix() - start_time.Unix()
 	return diff
@@ -191,7 +191,7 @@ func StrListToString(strList []string) (str string) {
 	return ""
 }
 
-//Token
+// Token
 func GetToken() string {
 	randStr := GetRandString(64)
 	token := MD5(randStr + Md5Key)
@@ -199,36 +199,36 @@ func GetToken() string {
 	return strings.ToUpper(token + GetRandString(tokenLen))
 }
 
-//数据没有记录
+// 数据没有记录
 func ErrNoRow() string {
 	return "<QuerySeter> no row found"
 }
 
-//校验邮箱格式
+// 校验邮箱格式
 func ValidateEmailFormatat(email string) bool {
 	reg := regexp.MustCompile(RegularEmail)
 	return reg.MatchString(email)
 }
 
-//验证是否是手机号
+// 验证是否是手机号
 func ValidateMobileFormatat(mobileNum string) bool {
 	reg := regexp.MustCompile(RegularMobile)
 	return reg.MatchString(mobileNum)
 }
 
-//验证是否是固定电话
+// 验证是否是固定电话
 func ValidateFixedTelephoneFormatat(mobileNum string) bool {
 	reg := regexp.MustCompile(RegularFixedTelephone)
 	return reg.MatchString(mobileNum)
 }
 
-//判断文件是否存在
+// 判断文件是否存在
 func FileIsExist(filePath string) bool {
 	_, err := os.Stat(filePath)
 	return err == nil || os.IsExist(err)
 }
 
-//获取图片扩展名
+// 获取图片扩展名
 func GetImgExt(file string) (ext string, err error) {
 	var headerByte []byte
 	headerByte = make([]byte, 8)
@@ -271,7 +271,7 @@ func GetImgExt(file string) (ext string, err error) {
 	return ext, nil
 }
 
-//保存图片
+// 保存图片
 func SaveImage(path string, img image.Image) (err error) {
 	//需要保持的文件
 	imgfile, err := os.Create(path)
@@ -281,7 +281,7 @@ func SaveImage(path string, img image.Image) (err error) {
 	return err
 }
 
-//保存base64数据为文件
+// 保存base64数据为文件
 func SaveBase64ToFile(content, path string) error {
 	data, err := base64.StdEncoding.DecodeString(content)
 	if err != nil {
@@ -411,7 +411,7 @@ func GetWilsonScore(p, n float64) float64 {
 	return toFixed(((p+1.9208)/(p+n)-1.96*math.Sqrt(p*n/(p+n)+0.9604)/(p+n))/(1+3.8416/(p+n)), 2)
 }
 
-//将中文数字转化成数字,比如 第三百四十五章,返回第345章 不支持一亿及以上
+// 将中文数字转化成数字,比如 第三百四十五章,返回第345章 不支持一亿及以上
 func ChangeWordsToNum(str string) (numStr string) {
 	words := ([]rune)(str)
 	num := 0
@@ -558,7 +558,7 @@ func ConvertToFormatDay(excelDaysString string) string {
 	return resultTime
 }
 
-//字符串转换为time
+// 字符串转换为time
 func StrTimeToTime(strTime string) time.Time {
 	timeLayout := "2006-01-02 15:04:05"  //转化所需模板
 	loc, _ := time.LoadLocation("Local") //重要:获取时区
@@ -566,7 +566,7 @@ func StrTimeToTime(strTime string) time.Time {
 	return resultTime
 }
 
-//时间格式去掉时分秒
+// 时间格式去掉时分秒
 func TimeRemoveHms(strTime string) string {
 	var Ymd string
 	var resultTime = StrTimeToTime(strTime)
@@ -581,7 +581,7 @@ func TimeRemoveHms(strTime string) string {
 	return Ymd
 }
 
-//判断时间是当年的第几周
+// 判断时间是当年的第几周
 func WeekByDate(t time.Time) string {
 	var resultSAtr string
 	t = t.AddDate(0, 0, -8) // 减少八天跟老数据标题统一
@@ -732,7 +732,7 @@ func GetLastMonthLastDay() time.Time {
 	return nowMonthLastDay
 }
 
-//时间格式去掉时分秒
+// 时间格式去掉时分秒
 func TimeRemoveHms2(strTime string) string {
 	var Ymd string
 	var resultTime = StrTimeToTime(strTime)
@@ -746,3 +746,16 @@ func TimeRemoveHms2(strTime string) string {
 	}
 	return Ymd
 }
+
+// 时间格式去掉年
+func GetTimeDateRemoveYear(strTime string) (dataStr string) {
+	slicePublishTime := strings.Split(strTime, "-")
+	for k, v := range slicePublishTime {
+		if k == 0 {
+			continue
+		}
+		dataStr += v + "-"
+	}
+	dataStr = strings.TrimRight(dataStr, "-")
+	return dataStr
+}