ソースを参照

Merge remote-tracking branch 'origin/eta/1.7.6' into debug

Roc 1 年間 前
コミット
b344241471

+ 3 - 3
controllers/base_auth.go

@@ -57,7 +57,7 @@ func (c *BaseAuthController) Prepare() {
 	fmt.Println("enter prepare")
 	method := c.Ctx.Input.Method()
 	uri := c.Ctx.Input.URI()
-	fmt.Println("Url:", uri)
+	//fmt.Println("Url:", uri)
 	if method != "HEAD" {
 		if method == "POST" || method == "GET" {
 			authorization := c.Ctx.Input.Header("authorization")
@@ -206,7 +206,7 @@ func (c *BaseAuthController) Prepare() {
 			uri = strings.Replace(uri, "/adminapi", "", 1)
 			uris := strings.Split(uri, "?")
 			uri = uris[0]
-			fmt.Println("uri:", uri)
+			//fmt.Println("uri:", uri)
 			apis := strings.Split(api, "&")
 			apiMap := make(map[string]bool, 0)
 			for _, s := range apis {
@@ -398,7 +398,7 @@ func (c *BaseAuthController) logUri(respContent []byte, requestBody, ip string)
 	authorization := ""
 	method := c.Ctx.Input.Method()
 	uri := c.Ctx.Input.URI()
-	fmt.Println("Url:", uri)
+	//fmt.Println("Url:", uri)
 	if method != "HEAD" {
 		if method == "POST" || method == "GET" {
 			authorization = c.Ctx.Input.Header("authorization")

+ 1 - 1
controllers/base_common.go

@@ -123,7 +123,7 @@ func (c *BaseCommonController) logUri(respContent []byte, requestBody, ip string
 	authorization := ""
 	method := c.Ctx.Input.Method()
 	uri := c.Ctx.Input.URI()
-	fmt.Println("Url:", uri)
+	//fmt.Println("Url:", uri)
 	if method != "HEAD" {
 		if method == "POST" || method == "GET" {
 			authorization = c.Ctx.Input.Header("authorization")

+ 6 - 6
controllers/data_manage/data_manage_permission/data_move.go

@@ -17,13 +17,13 @@ import (
 // @Param   SubSource   query   int  false       "子来源 :ETA表格中的各种表格类型,以及图表的来源(这个是后续的扩展方向)"
 // @Success 200 {object} data_manage.ChartListResp
 // @router /edb_chart/classify [get]
-func (this *DataMangePermissionController) EdbChartClassifyList() {
+func (c *DataMangePermissionController) EdbChartClassifyList() {
 	br := new(models.BaseResponse).Init()
 	defer func() {
-		this.Data["json"] = br
-		this.ServeJSON()
+		c.Data["json"] = br
+		c.ServeJSON()
 	}()
-	sysUser := this.SysUser
+	sysUser := c.SysUser
 	if sysUser == nil {
 		br.Msg = "请登录"
 		br.ErrMsg = "请登录,SysUser Is Empty"
@@ -31,7 +31,7 @@ func (this *DataMangePermissionController) EdbChartClassifyList() {
 		return
 	}
 
-	source, _ := this.GetInt("Source")
+	source, _ := c.GetInt("Source")
 	if source <= 0 || source > 6 {
 		br.Msg = "错误的来源"
 		br.IsSendEmail = false
@@ -39,7 +39,7 @@ func (this *DataMangePermissionController) EdbChartClassifyList() {
 	}
 
 	// 子来源(目前作用于ETA表格,2024-3-26 14:12:09)
-	subSource, _ := this.GetInt("SubSource")
+	subSource, _ := c.GetInt("SubSource")
 	if source == 6 && (subSource <= utils.EXCEL_DEFAULT || subSource > utils.CUSTOM_ANALYSIS_TABLE) {
 		br.Msg = "错误的子来源"
 		br.IsSendEmail = false

+ 224 - 0
controllers/data_manage/data_manage_permission/message.go

@@ -0,0 +1,224 @@
+package data_manage_permission
+
+import (
+	"encoding/json"
+	"eta/eta_api/models"
+	"eta/eta_api/models/data_manage/data_manage_permission"
+	data_manage_permissionServ "eta/eta_api/services/data/data_manage_permission"
+	"eta/eta_api/utils"
+	"fmt"
+	"github.com/rdlucklib/rdluck_tools/paging"
+	"time"
+)
+
+// MessageList
+// @Title 资产消息列表
+// @Description 资产消息列表
+// @Param   PageSize			query	int		true	"每页数据条数"
+// @Param   CurrentIndex		query	int		true	"当前页页码"
+// @Success 200 {object} data_manage_permission.DataPermissionMessageListResp
+// @router /message/list [get]
+func (c *DataMangePermissionController) MessageList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		c.Data["json"] = br
+		c.ServeJSON()
+	}()
+	sysUser := c.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+
+	// 分页
+	pageSize, _ := c.GetInt("PageSize")
+	currentIndex, _ := c.GetInt("CurrentIndex")
+
+	var startSize int
+	if pageSize <= 0 {
+		pageSize = utils.PageSize20
+	}
+	if currentIndex <= 0 {
+		currentIndex = 1
+	}
+	startSize = paging.StartIndex(currentIndex, pageSize)
+
+	resp := new(data_manage_permission.DataPermissionMessageListResp)
+	resp.List = make([]*data_manage_permission.DataPermissionMessageItem, 0)
+	cond := fmt.Sprintf(` AND %s = ?`, data_manage_permission.DataPermissionMessageCols.ReceiveUserId)
+	pars := make([]interface{}, 0)
+	pars = append(pars, sysUser.AdminId)
+	order := fmt.Sprintf(`%s ASC, %s DESC`, data_manage_permission.DataPermissionMessageCols.IsRead, data_manage_permission.DataPermissionMessageCols.CreateTime)
+
+	messageOb := new(data_manage_permission.DataPermissionMessage)
+	total, e := messageOb.GetCountByCondition(cond, pars)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取资产消息列表总数失败, Err: " + e.Error()
+		return
+	}
+	list, e := messageOb.GetPageItemsByCondition(cond, pars, []string{}, order, startSize, pageSize)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取资产消息列表失败, Err: " + e.Error()
+		return
+	}
+	for _, v := range list {
+		t := data_manage_permission.FormatDataPermissionMessage2Item(v)
+		resp.List = append(resp.List, t)
+	}
+
+	// 未读消息数
+	cond += fmt.Sprintf(` AND %s = ?`, data_manage_permission.DataPermissionMessageCols.IsRead)
+	pars = append(pars, 0)
+	unreadTotal, e := messageOb.GetCountByCondition(cond, pars)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取资产消息列表总数失败, Err: " + e.Error()
+		return
+	}
+	resp.UnreadTotal = unreadTotal
+
+	page := paging.GetPaging(currentIndex, pageSize, total)
+	resp.Paging = page
+	br.Data = resp
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+}
+
+// MessageRead
+// @Title 消息已读
+// @Description 消息已读
+// @Param	request	body data_manage_permission.DataPermissionMessageReadReq true "type json string"
+// @Success 200 string "操作成功"
+// @router /message/read [post]
+func (c *DataMangePermissionController) MessageRead() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		c.Data["json"] = br
+		c.ServeJSON()
+	}()
+	sysUser := c.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+	var req data_manage_permission.DataPermissionMessageReadReq
+	if e := json.Unmarshal(c.Ctx.Input.RequestBody, &req); e != nil {
+		br.Msg = "参数有误"
+		br.ErrMsg = "参数解析失败, Err: " + e.Error()
+		return
+	}
+	if req.MessageId <= 0 {
+		br.Msg = "参数有误"
+		br.ErrMsg = fmt.Sprintf("参数有误, MessageId: %d", req.MessageId)
+		return
+	}
+
+	messageOb := new(data_manage_permission.DataPermissionMessage)
+	messageItem, e := messageOb.GetItemById(req.MessageId)
+	if e != nil {
+		if e.Error() == utils.ErrNoRow() {
+			br.Msg = "消息不存在, 请刷新页面"
+			return
+		}
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取审批消息失败, Err: " + e.Error()
+		return
+	}
+
+	// 不等于0的时候,说明已经操作过了,就不重复操作了
+	if messageItem.IsRead != 0 {
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "操作成功"
+		return
+	}
+
+	if messageItem.ReceiveUserId != int32(sysUser.AdminId) {
+		br.Msg = "标记已读失败,不是本人消息"
+		br.ErrMsg = "标记已读失败,不是本人消息 "
+		br.IsSendEmail = false
+		return
+	}
+	messageItem.IsRead = 1
+	messageItem.ModifyTime = time.Now().Local()
+	cols := []string{"IsRead", "ModifyTime"}
+	if e = messageItem.Update(cols); e != nil {
+		br.Msg = "操作失败"
+		br.ErrMsg = "更新消息已读失败, Err: " + e.Error()
+		return
+	}
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "操作成功"
+}
+
+// MessageDetail
+// @Title 资产消息详情
+// @Description 资产消息详情
+// @Param   MessageId			query	int		true	"消息ID"
+// @Success 200 {object} report_approve.ReportApproveMessageListResp
+// @router /message/detail [get]
+func (c *DataMangePermissionController) MessageDetail() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		c.Data["json"] = br
+		c.ServeJSON()
+	}()
+	sysUser := c.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+	messageId, _ := c.GetInt("MessageId", 0)
+	if messageId <= 0 {
+		br.Msg = "请选择消息"
+		br.ErrMsg = "请选择消息"
+		br.IsSendEmail = false
+		return
+	}
+
+	messageOb := new(data_manage_permission.DataPermissionMessage)
+	messageItem, e := messageOb.GetItemById(messageId)
+	if e != nil {
+		if e.Error() == utils.ErrNoRow() {
+			br.Msg = "消息不存在, 请刷新页面"
+			return
+		}
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取审批消息失败, Err: " + e.Error()
+		return
+	}
+
+	resp, err := data_manage_permissionServ.GetMessageDetail(messageItem)
+	if err != nil {
+		//br.Success = true
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.IsAddLog = false
+	br.Data = resp
+}

+ 127 - 1
models/data_manage/data_manage_permission/message.go

@@ -1,6 +1,12 @@
 package data_manage_permission
 
-import "time"
+import (
+	"eta/eta_api/utils"
+	"fmt"
+	"github.com/beego/beego/v2/client/orm"
+	"strings"
+	"time"
+)
 
 // DataPermissionMessage
 // @Description: 数据权限变更消息表
@@ -16,3 +22,123 @@ type DataPermissionMessage struct {
 	CreateTime              time.Time `json:"create_time"`     // 创建时间
 	ModifyTime              time.Time `json:"modify_time"`     // 修改时间
 }
+
+var DataPermissionMessageCols = struct {
+	DataPermissionMessageId string
+	SendUserId              string
+	ReceiveUserId           string
+	Content                 string
+	Remark                  string
+	OpType                  string
+	OpUniqueCode            string
+	IsRead                  string
+	CreateTime              string
+	ModifyTime              string
+}{
+	DataPermissionMessageId: "data_permission_message_id",
+	SendUserId:              "send_user_id",
+	ReceiveUserId:           "receive_user_id",
+	Content:                 "content",
+	Remark:                  "remark",
+	OpType:                  "op_type",
+	OpUniqueCode:            "op_unique_code",
+	IsRead:                  "is_read",
+	CreateTime:              "create_time",
+	ModifyTime:              "modify_time",
+}
+
+func (m *DataPermissionMessage) TableName() string {
+	return "data_permission_message"
+}
+
+func (m *DataPermissionMessage) PrimaryId() string {
+	return DataPermissionMessageCols.DataPermissionMessageId
+}
+
+func (m *DataPermissionMessage) Create() (err error) {
+	o := orm.NewOrmUsingDB("data")
+	id, err := o.Insert(m)
+	if err != nil {
+		return
+	}
+	m.DataPermissionMessageId = id
+	return
+}
+
+func (m *DataPermissionMessage) CreateMulti(items []*DataPermissionMessage) (err error) {
+	if len(items) == 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("data")
+	_, err = o.InsertMulti(500, items)
+	return
+}
+
+func (m *DataPermissionMessage) Update(cols []string) (err error) {
+	o := orm.NewOrmUsingDB("data")
+	_, err = o.Update(m, cols...)
+	return
+}
+
+func (m *DataPermissionMessage) Del() (err error) {
+	o := orm.NewOrmUsingDB("data")
+	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s = ? LIMIT 1`, m.TableName(), m.PrimaryId())
+	_, err = o.Raw(sql, m.DataPermissionMessageId).Exec()
+	return
+}
+
+func (m *DataPermissionMessage) MultiDel(menuIds []int) (err error) {
+	if len(menuIds) == 0 {
+		return
+	}
+	o := orm.NewOrmUsingDB("data")
+	sql := fmt.Sprintf(`DELETE FROM %s WHERE %s IN (%s)`, m.TableName(), m.PrimaryId(), utils.GetOrmInReplace(len(menuIds)))
+	_, err = o.Raw(sql, menuIds).Exec()
+	return
+}
+
+func (m *DataPermissionMessage) GetItemById(id int) (item *DataPermissionMessage, err error) {
+	o := orm.NewOrmUsingDB("data")
+	sql := fmt.Sprintf(`SELECT * FROM %s WHERE %s = ? LIMIT 1`, m.TableName(), m.PrimaryId())
+	err = o.Raw(sql, id).QueryRow(&item)
+	return
+}
+
+func (m *DataPermissionMessage) GetCountByCondition(condition string, pars []interface{}) (count int, err error) {
+	o := orm.NewOrmUsingDB("data")
+	sql := fmt.Sprintf(`SELECT COUNT(1) FROM %s WHERE 1=1 %s`, m.TableName(), condition)
+	err = o.Raw(sql, pars).QueryRow(&count)
+	return
+}
+
+func (m *DataPermissionMessage) GetPageItemsByCondition(condition string, pars []interface{}, fieldArr []string, orderRule string, startSize, pageSize int) (items []*DataPermissionMessage, err error) {
+	o := orm.NewOrmUsingDB("data")
+	fields := strings.Join(fieldArr, ",")
+	if len(fieldArr) == 0 {
+		fields = `*`
+	}
+	order := `ORDER BY create_time DESC`
+	if orderRule != "" {
+		order = ` ORDER BY ` + orderRule
+	}
+	sql := fmt.Sprintf(`SELECT %s FROM %s WHERE 1=1 %s %s LIMIT ?,?`, fields, m.TableName(), condition, order)
+	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+	return
+}
+
+// FormatDataPermissionMessage2Item 格式化消息
+func FormatDataPermissionMessage2Item(origin *DataPermissionMessage) (item *DataPermissionMessageItem) {
+	item = &DataPermissionMessageItem{
+		DataPermissionMessageId: origin.DataPermissionMessageId,
+		SendUserId:              origin.SendUserId,
+		ReceiveUserId:           origin.ReceiveUserId,
+		Content:                 origin.Content,
+		Remark:                  origin.Remark,
+		OpType:                  origin.OpType,
+		OpUniqueCode:            origin.OpUniqueCode,
+		IsRead:                  origin.IsRead,
+		CreateTime:              utils.TimeTransferString(utils.FormatDateTime, origin.CreateTime),
+		ModifyTime:              utils.TimeTransferString(utils.FormatDateTime, origin.ModifyTime),
+	}
+	return
+}

+ 16 - 0
models/data_manage/data_manage_permission/move_record.go

@@ -55,3 +55,19 @@ func AddDataPermissionMoveRecord(dataPermissionMoveRecordList []*DataPermissionM
 
 	return
 }
+
+// GetListByOpUniqueCode
+// @Description: 根据操作唯一编码获取操作记录
+// @param opUniqueCode
+// @return items
+// @return err
+func GetListByOpUniqueCode(opUniqueCode string) (items []*DataPermissionMoveRecord, err error) {
+	o := orm.NewOrmUsingDB("data")
+	sql := `SELECT * FROM data_permission_move_record WHERE op_unique_code = ? ORDER BY data_permission_move_record_id desc`
+	_, err = o.Raw(sql, opUniqueCode).QueryRows(&items)
+	if err != nil {
+		return
+	}
+
+	return
+}

+ 29 - 0
models/data_manage/data_manage_permission/req_and_resp.go

@@ -1,5 +1,7 @@
 package data_manage_permission
 
+import "github.com/rdlucklib/rdluck_tools/paging"
+
 // MoveEdbChartReq 转移指标/图表的请求
 type MoveEdbChartReq struct {
 	Source       int      `description:"来源id"`
@@ -50,3 +52,30 @@ type SetEdbChartClassifyPermissionReq struct {
 	UserList       []int `description:"赋权用户id列表,如果为空,说明要给这些数据分类移除权限管控"`
 	ClassifyIdList []int `description:"指标/图表/表格分类唯一id列表"`
 }
+
+// DataPermissionMessageItem
+// @Description: 数据权限变更消息结构体
+type DataPermissionMessageItem struct {
+	DataPermissionMessageId int64  `json:"data_permission_message_id" orm:"column(data_permission_message_id);pk"`
+	SendUserId              int32  `json:"send_user_id"`    // 发送人ID
+	ReceiveUserId           int32  `json:"receive_user_id"` // 接收者ID
+	Content                 string `json:"content"`         // 消息内容
+	Remark                  string `json:"remark"`          // 备注信息
+	OpType                  int32  `json:"op_type"`         // 操作类型,1:单个资产转移,2:资产模块转移,3:资产授权,4:资产分类授权
+	OpUniqueCode            string `json:"op_unique_code"`  // 操作编码
+	IsRead                  int32  `json:"is_read"`         // 是否已读:0-未读;1-已读
+	CreateTime              string `json:"create_time"`     // 创建时间
+	ModifyTime              string `json:"modify_time"`     // 修改时间
+}
+
+// DataPermissionMessageListResp 资产数据列表响应体
+type DataPermissionMessageListResp struct {
+	List        []*DataPermissionMessageItem
+	Paging      *paging.PagingItem `description:"分页数据"`
+	UnreadTotal int                `description:"消息未读数"`
+}
+
+// DataPermissionMessageReadReq 资产数据消息已读请求体
+type DataPermissionMessageReadReq struct {
+	MessageId int `description:"资产数据消息ID"`
+}

+ 27 - 0
routers/commentsRouter.go

@@ -601,6 +601,33 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"],
+        beego.ControllerComments{
+            Method: "MessageDetail",
+            Router: `/message/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"],
+        beego.ControllerComments{
+            Method: "MessageList",
+            Router: `/message/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/data_manage_permission:DataMangePermissionController"],
+        beego.ControllerComments{
+            Method: "MessageRead",
+            Router: `/message/read`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/excel:CustomAnalysisController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers/data_manage/excel:CustomAnalysisController"],
         beego.ControllerComments{
             Method: "Add",

+ 72 - 0
services/data/data_manage_permission/message.go

@@ -0,0 +1,72 @@
+package data_manage_permission
+
+import (
+	"eta/eta_api/models/data_manage/data_manage_permission"
+	"eta/eta_api/utils"
+)
+
+type MessageDetailItem struct {
+	DataPermissionMoveRecordId int64  `json:"data_permission_move_record_id" orm:"column(data_permission_move_record_id);pk"` // 数据操作记录id
+	Source                     int32  `json:"source"`                                                                         // 数据来源,1:手工数据指标 2:钢联化工数据库 3:ETA指标库 4:ETA预测指标 5:图库 6:ETA表格
+	SubSource                  int32  `json:"sub_source"`                                                                     // 子来源 :ETA表格中的各种表格类型,以及图表的来源(这个是后续的扩展方向)
+	OpUniqueCode               string `json:"op_unique_code"`                                                                 // 操作的唯一编码,主要是记录统一操作的日志
+	DataId                     string `json:"data_id"`                                                                        // 资产id(指标、图表、表格)
+	DataCode                   string `json:"data_code"`                                                                      // 资产code(指标、图表、表格)
+	DataName                   string `json:"data_name"`                                                                      // 资产名称(指标、图表、表格)
+	OriginalUserId             int32  `json:"original_user_id"`                                                               // 原创建人id
+	OriginalUserName           string `json:"original_user_name"`                                                             // 原创建人名称
+	NewUserId                  int32  `json:"new_user_id"`                                                                    // 新创建人id
+	NewUserName                string `json:"new_user_name"`                                                                  // 新创建人名称
+	CreateTime                 string `json:"create_time"`
+}
+
+// GetMoveEdbChartList 获取待转移的指标/图表列表
+// @param source 来源 :1:手工数据指标 2:钢联化工数据库 3:ETA指标库 4:ETA预测指标 5:图库 6:ETA表格
+func GetMessageDetail(messageInfo *data_manage_permission.DataPermissionMessage) (resp interface{}, err error) {
+	switch messageInfo.OpType {
+	// 操作类型,1:单个资产转移,2:资产模块转移,3:资产授权,4:资产分类授权
+	case 1, 2:
+		list, tmpErr := data_manage_permission.GetListByOpUniqueCode(messageInfo.OpUniqueCode)
+		if tmpErr != nil {
+			err = tmpErr
+			return
+		}
+		resp, err = formatMessageDetailItem(list)
+
+	}
+
+	return
+}
+
+func formatMessageDetailItem(items []*data_manage_permission.DataPermissionMoveRecord) (resp map[int32]map[int32][]*MessageDetailItem, err error) {
+	resp = make(map[int32]map[int32][]*MessageDetailItem)
+	for _, v := range items {
+		// 大的渠道
+		tmpSourceResp, ok := resp[v.Source]
+		if !ok {
+			tmpSourceResp = make(map[int32][]*MessageDetailItem)
+		}
+		// 渠道下的不同类型
+		tmpSubSourceResp, ok2 := tmpSourceResp[v.SubSource]
+		if !ok2 {
+			tmpSubSourceResp = make([]*MessageDetailItem, 0)
+		}
+		tmpSourceResp[v.SubSource] = append(tmpSubSourceResp, &MessageDetailItem{
+			DataPermissionMoveRecordId: v.DataPermissionMoveRecordId,
+			Source:                     v.Source,
+			SubSource:                  v.SubSource,
+			OpUniqueCode:               v.OpUniqueCode,
+			DataId:                     v.DataId,
+			DataCode:                   v.DataCode,
+			DataName:                   v.DataName,
+			OriginalUserId:             v.OriginalUserId,
+			OriginalUserName:           v.OriginalUserName,
+			NewUserId:                  v.NewUserId,
+			NewUserName:                v.NewUserName,
+			CreateTime:                 utils.TimeTransferString(utils.FormatDateTime, v.CreateTime),
+		})
+		resp[v.Source] = tmpSourceResp
+	}
+
+	return
+}