operation.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. package opsdev
  2. import (
  3. "dashoo.cn/opms_libary/request"
  4. )
  5. // OpsOperationEventSearchReq 运维事件搜索请求
  6. type OpsOperationEventSearchReq struct {
  7. EventNo string `json:"eventNo"` // 事件编号
  8. EventTitle string `json:"eventTitle"` // 事件标题(模糊搜索)
  9. EventStatus string `json:"eventStatus"` // 事件状态
  10. EventType string `json:"eventType"` // 事件类型
  11. PriorityLevel string `json:"priorityLevel"` // 优先级
  12. IsBig string `json:"isBig"` // 是否重大事件
  13. IsOps string `json:"isOps"` // 是否运维事件
  14. CustName string `json:"custName"` // 客户名称(模糊搜索)
  15. OpsUserName string `json:"opsUserName"` // 运维人员名称
  16. ContractName string `json:"contractName"` // 合同名称
  17. ProductLine string `json:"productLine"` // 产品线
  18. request.PageReq
  19. }
  20. // OpsOperationEventReq 运维事件创建/更新请求
  21. type OpsOperationEventReq struct {
  22. EventTitle string `json:"eventTitle" v:"required#事件标题不能为空"` // 事件标题
  23. EventDesc string `json:"eventDesc"` // 事件描述
  24. EventType string `json:"eventType"` // 事件类型
  25. EventStatus string `json:"eventStatus"` // 事件状态
  26. ContractId int `json:"contractId"` // 合同ID
  27. ContractName string `json:"contractName"` // 合同名称
  28. CustId int `json:"custId"` // 客户ID
  29. CustName string `json:"custName"` // 客户名称
  30. ProductLine string `json:"productLine"` // 产品线
  31. IsBig string `json:"isBig"` // 是否重大事件
  32. IsOps string `json:"isOps"` // 是否运维事件
  33. PriorityLevel string `json:"priorityLevel"` // 优先级
  34. FeedbackSource string `json:"feedbackSource"` // 反馈来源
  35. FeedbackReporter string `json:"feedbackReporter"` // 反馈报告人
  36. FeedbackDate string `json:"feedbackDate"` // 反馈日期
  37. OpsUserId int `json:"opsUserId"` // 运维人员ID
  38. OpsUserName string `json:"opsUserName"` // 运维人员名称
  39. Remark string `json:"remark"` // 备注
  40. Attachments []AttachmentReq `json:"attachments"` // 附件列表
  41. }
  42. // UpdateOpsOperationEventReq 运维事件更新请求
  43. type UpdateOpsOperationEventReq struct {
  44. Id int64 `json:"id" v:"min:1#ID不能为空"` // 主键
  45. OpsOperationEventReq
  46. }
  47. // OpsOperationEventProcessReq 运维事件处理请求
  48. type OpsOperationEventProcessReq struct {
  49. Id int64 `json:"id" v:"min:1#任务ID不能为空"`
  50. HandleContent string `json:"handleContent" v:"required#处理内容不能为空"`
  51. HandleResult string `json:"handleResult"`
  52. OperateType string `json:"operateType" v:"required#操作类型不能为空"`
  53. AdjustWorkHour float64 `json:"adjustWorkHour"` // 关单时调整累计工时(可选,仅 operateType=80 时生效)
  54. }
  55. // OpsOperationEventRecordSearchReq 运维事件处理记录搜索请求
  56. type OpsOperationEventRecordSearchReq struct {
  57. EventId int `json:"eventId" v:"min:1#事件ID不能为空"` // 事件ID
  58. request.PageReq
  59. }
  60. // OpsOperationEventRecordWithAttachments 带附件的处理记录
  61. type OpsOperationEventRecordWithAttachments struct {
  62. OpsOperationEventRecord
  63. Attachments []*OpsOperationEventAttachment `json:"attachments"` // 附件列表
  64. }
  65. // OpsOperationEventAttachmentReq 附件上传请求
  66. type OpsOperationEventAttachmentReq struct {
  67. EventId int64 `json:"eventId" v:"min:1#事件ID不能为空"` // 事件ID
  68. EventRecordId int64 `json:"eventRecordId"` // 事件记录ID
  69. FileName string `json:"fileName" v:"required#文件名不能为空"` // 文件名
  70. FileUrl string `json:"fileUrl" v:"required#文件地址不能为空"` // 文件地址
  71. FileType string `json:"fileType"` // 文件类型
  72. Remark string `json:"remark"` // 备注
  73. }
  74. const (
  75. EventStatusPending = "10" // 待处理
  76. EventStatusProcessing = "20" // 处理中(重点)
  77. EventStatusProcessingNormal = "30" // 处理中(普通)
  78. EventStatusTransfer = "40" // 转研发
  79. EventStatusSuspended = "70" // 挂起
  80. EventStatusClosed = "80" // 已关闭
  81. )
  82. const (
  83. HandleResultResolved = "10" // 已解决
  84. HandleResultPartially = "20" // 部分解决
  85. HandleResultUnresolved = "30" // 未解决
  86. )
  87. const (
  88. OperateTypeProcess = "20" // 处理
  89. OperateTypeResume = "25" // 转处理(恢复)
  90. OperateTypeTransfer = "40" // 转研发
  91. OperateTypeSuspend = "70" // 挂起
  92. OperateTypeClose = "80" // 关闭
  93. )
  94. // OpsOperationEventKanbanSearchReq 看板搜索请求
  95. type OpsOperationEventKanbanSearchReq struct {
  96. KeyWords string `json:"keyWords"` // 关键字搜索(事件编号/标题)
  97. SearchType string `json:"searchType"` // 搜索字段: title/custName/feedbackReporter/eventNo
  98. EventType string `json:"eventType"` // 事件类型
  99. PriorityLevel string `json:"priorityLevel"` // 优先级
  100. SortBy string `json:"sortBy"` // 排序字段: feedbackDateDesc/feedbackDateAsc/custName
  101. }
  102. // AssignOpsUserReq 接收/分配运维人员请求
  103. type AssignOpsUserReq struct {
  104. Id int64 `json:"id" v:"min:1#事件ID不能为空"`
  105. OpsUserId int `json:"opsUserId"`
  106. OpsUserName string `json:"opsUserName"`
  107. }
  108. // AttachmentReq 附件请求
  109. type AttachmentReq struct {
  110. FileName string `json:"fileName"` // 附件名称
  111. FileUrl string `json:"fileUrl"` // 附件URL
  112. FileType string `json:"fileType"` // 附件类型
  113. }
  114. // AddRecordReq 添加处理记录请求
  115. type AddRecordReq struct {
  116. EventId int64 `json:"eventId" v:"min:1#事件ID不能为空"`
  117. HandleContent string `json:"handleContent" v:"required#处理内容不能为空"`
  118. HandleResult string `json:"handleResult"` // 处理结果
  119. Attachments []AttachmentReq `json:"attachments"` // 附件列表
  120. }
  121. // OpsOperationEventHistorySearchReq 运维历史搜索请求
  122. type OpsOperationEventHistorySearchReq struct {
  123. ScopeType string `json:"scopeType"` // 范围: my-本人处理, all-全部
  124. IncludeClosed bool `json:"includeClosed"` // 是否包含未关闭事件
  125. EventTitle string `json:"eventTitle"` // 事件标题(模糊搜索)
  126. CustName string `json:"custName"` // 客户名称(模糊搜索)
  127. FeedbackReporter string `json:"feedbackReporter"` // 反馈人(模糊搜索)
  128. OpsUserName string `json:"opsUserName"` // 处理人(模糊搜索)
  129. BeginTime string `json:"beginTime"` // 反馈开始时间
  130. EndTime string `json:"endTime"` // 反馈结束时间
  131. request.PageReq
  132. }
  133. // OpsOperationEventHistoryExport 运维历史导出参数
  134. type OpsOperationEventHistoryExport struct {
  135. OpsOperationEventHistorySearchReq
  136. Columns []string `json:"columns"` // 导出列
  137. }
  138. // OpsOperationEventHistoryExportData 运维历史导出数据
  139. type OpsOperationEventHistoryExportData struct {
  140. EventNo string `json:"eventNo" export:"事件编号"`
  141. EventTitle string `json:"eventTitle" export:"事件标题"`
  142. EventStatus string `json:"eventStatus" export:"事件状态"`
  143. EventType string `json:"eventType" export:"事件类型"`
  144. CustName string `json:"custName" export:"客户名称"`
  145. OpsUserName string `json:"opsUserName" export:"处理人员"`
  146. FeedbackDate string `json:"feedbackDate" export:"反馈时间"`
  147. PriorityLevel string `json:"priorityLevel" export:"优先级"`
  148. HandleProcess string `json:"handleProcess" export:"处理过程"`
  149. ClosedTime string `json:"closedTime" export:"关闭时间"`
  150. }
  151. // OpsOperationEventHistoryExportContent 运维历史导出内容
  152. type OpsOperationEventHistoryExportContent struct {
  153. Content string `json:"content"` // 导出内容(base64编码)
  154. }
  155. // OpsOperationWorkHourListReq 查询工时登记列表请求
  156. type OpsOperationWorkHourListReq struct {
  157. EventId int `json:"eventId" v:"required#事件ID不能为空"` // 事件ID
  158. }
  159. // OpsOperationWorkHourListRsp 工时登记响应
  160. type OpsOperationWorkHourListRsp struct {
  161. Id int `json:"id"` // ID
  162. WorkDate string `json:"workDate"` // 工作日期
  163. WorkHour float64 `json:"workHour"` // 工作时长
  164. Remark string `json:"remark"` // 工作说明
  165. CreatedName string `json:"createdName"` // 登记人
  166. CreatedTime string `json:"createdTime"` // 登记时间
  167. }
  168. type OpsOperationEventExport struct {
  169. Columns []string `json:"columns"`
  170. }
  171. type OpsOperationEventExportData struct {
  172. EventNo string `json:"eventNo" export:"事件编号"`
  173. EventTitle string `json:"eventTitle" export:"事件标题"`
  174. EventStatus string `json:"eventStatus" export:"事件状态"`
  175. EventType string `json:"eventType" export:"事件类型"`
  176. CustName string `json:"custName" export:"客户名称"`
  177. OpsUserName string `json:"opsUserName" export:"处理人员"`
  178. FeedbackDate string `json:"feedbackDate" export:"反馈时间"`
  179. PriorityLevel string `json:"priorityLevel" export:"优先级"`
  180. HandleProcess string `json:"handleProcess" export:"处理过程"`
  181. }
  182. // OpsOperationWorkHourAddReq 添加工时记录请求
  183. type OpsOperationWorkHourAddReq struct {
  184. EventId int `json:"eventId" v:"min:1#事件ID不能为空"`
  185. WorkDate string `json:"workDate" v:"required#工作日期不能为空"`
  186. WorkHour float64 `json:"workHour" v:"min:0.5#工作时长不能小于0.5小时"`
  187. Remark string `json:"remark"`
  188. }