12345678910111213141516171819202122232425262728293031 |
- package data_approve
- import (
- "encoding/json"
- DataApprove "eta_gn/eta_api/models/data_manage/data_approve"
- "eta_gn/eta_api/models/data_manage/data_approve/response"
- "fmt"
- )
- // FormatDataApproveNode2Item 格式化报告审批节点信息
- func FormatDataApproveNode2Item(origin *DataApprove.DataApproveNode) (item *response.DataApproveNodeItem, err error) {
- if origin == nil {
- return
- }
- item = new(response.DataApproveNodeItem)
- item.DataApproveNodeId = origin.DataApproveNodeId
- item.DataApproveFlowId = origin.DataApproveFlowId
- item.PrevNodeId = origin.PrevNodeId
- item.NextNodeId = origin.NextNodeId
- item.NodeType = origin.NodeType
- item.ApproveType = origin.ApproveType
- item.Users = make([]*response.DataApproveNodeUser, 0)
- if origin.Users != "" {
- e := json.Unmarshal([]byte(origin.Users), &item.Users)
- if e != nil {
- err = fmt.Errorf("node users unmarshal err: %s", e.Error())
- return
- }
- }
- return
- }
|