|
@@ -13,6 +13,7 @@ import (
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -363,7 +364,21 @@ func (this *YanxuanSpecialController) List() {
|
|
|
br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ listAuthor, tmpErr := cygx.GetYanxuanSpecialAuthorList("", pars, 0, 999)
|
|
|
+ if tmpErr != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ mapUserId := make(map[int]int)
|
|
|
+ for _, v := range listAuthor {
|
|
|
+ mapUserId[v.UserId] = v.Id
|
|
|
+ }
|
|
|
+
|
|
|
for _, v := range list {
|
|
|
+ v.SpecialAuthorId = mapUserId[v.UserId]
|
|
|
hasImg, err := utils.ArticleHasImgUrl(v.Content)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -591,5 +606,108 @@ func (this *YanxuanSpecialController) ListPv() {
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "导出成功"
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 审批记录
|
|
|
+// @Description 审批记录接口
|
|
|
+// @Param PageSize query int true "每页数据条数"
|
|
|
+// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
+// @Success 200 {object} models.CygxYanxuanSpecialApprovalLogListResp
|
|
|
+// @router /yanxuan_special/approval_log_list [get]
|
|
|
+func (this *YanxuanSpecialController) ApprovalLogList() {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 a.approval_status = 2 `
|
|
|
+ total, err := cygx.GetCygxYanxuanSpecialApprovalLogCount(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, tmpErr := cygx.GetCygxYanxuanSpecialApprovalLogList(condition, pars, startSize, pageSize)
|
|
|
+ if tmpErr != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ resp := new(cygx.CygxYanxuanSpecialApprovalLogListResp)
|
|
|
+ page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
+
|
|
|
+ resp.List = list
|
|
|
+ resp.Paging = page
|
|
|
+ br.Data = resp
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+}
|
|
|
+
|
|
|
+// @Title 按钮是否展示接口
|
|
|
+// @Description 按钮是否展示接口
|
|
|
+// @Success 200 {object} models.AddEnglishReportResp
|
|
|
+// @router /yanxuan_special/show_button [get]
|
|
|
+func (this *YanxuanSpecialController) ShowButton() {
|
|
|
+ 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
|
|
|
+ }
|
|
|
|
|
|
+ resp := new(cygx.CygxYanxuanSpecialShowButton)
|
|
|
+ configCode := utils.TPL_MSG_NEI_RONG_ZU
|
|
|
+ cnfNeiRong, err := cygx.GetConfigByCode(configCode)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //汪洋王芳手机号
|
|
|
+ configCode = utils.TPL_MSG_WANG_FANG_WANG_YANG
|
|
|
+ cnfWang, err := cygx.GetConfigByCode(configCode)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //作者管理栏,只有内容组、汪洋、王芳、超管可见
|
|
|
+ if strings.Contains(cnfNeiRong.ConfigValue, sysUser.Mobile) || strings.Contains(cnfWang.ConfigValue, sysUser.Mobile) || sysUser.Role == utils.ROLE_TYPE_CODE_ADMIN {
|
|
|
+ resp.IsShowSpecialAuthor = true
|
|
|
+ }
|
|
|
+ br.Data = resp
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
}
|