operation.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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. OpsUserId int `json:"opsUserId"`
  56. OpsUserName string `json:"opsUserName"`
  57. PlanStartTime string `json:"planStartTime"`
  58. PlanEndTime string `json:"planEndTime"`
  59. TaskStatus string `json:"taskStatus"`
  60. }
  61. // OpsOperationEventRecordSearchReq 运维事件处理记录搜索请求
  62. type OpsOperationEventRecordSearchReq struct {
  63. EventId int `json:"eventId" v:"min:1#事件ID不能为空"` // 事件ID
  64. request.PageReq
  65. }
  66. // OpsOperationEventRecordWithAttachments 带附件的处理记录
  67. type OpsOperationEventRecordWithAttachments struct {
  68. OpsOperationEventRecord
  69. Attachments []*OpsOperationEventAttachment `json:"attachments"` // 附件列表
  70. }
  71. // OpsOperationEventAttachmentReq 附件上传请求
  72. type OpsOperationEventAttachmentReq struct {
  73. EventId int64 `json:"eventId" v:"min:1#事件ID不能为空"` // 事件ID
  74. EventRecordId int64 `json:"eventRecordId"` // 事件记录ID
  75. FileName string `json:"fileName" v:"required#文件名不能为空"` // 文件名
  76. FileUrl string `json:"fileUrl" v:"required#文件地址不能为空"` // 文件地址
  77. FileType string `json:"fileType"` // 文件类型
  78. Remark string `json:"remark"` // 备注
  79. }
  80. const (
  81. EventStatusPending = "10" // 待处理
  82. EventStatusProcessing = "20" // 处理中(重点)
  83. EventStatusProcessingNormal = "30" // 处理中(普通)
  84. EventStatusTransfer = "40" // 转研发
  85. EventStatusSuspended = "70" // 挂起
  86. EventStatusClosed = "80" // 已关闭
  87. )
  88. const (
  89. HandleResultResolved = "10" // 已解决
  90. HandleResultPartially = "20" // 部分解决
  91. HandleResultUnresolved = "30" // 未解决
  92. )
  93. const (
  94. OperateTypeProcess = "20" // 处理
  95. OperateTypeResume = "25" // 转处理(恢复)
  96. OperateTypeTransfer = "40" // 转研发
  97. OperateTypeSuspend = "70" // 挂起
  98. OperateTypeClose = "80" // 关闭
  99. )
  100. // OpsOperationEventKanbanSearchReq 看板搜索请求
  101. type OpsOperationEventKanbanSearchReq struct {
  102. KeyWords string `json:"keyWords"` // 关键字搜索(事件编号/标题)
  103. SearchType string `json:"searchType"` // 搜索字段: title/custName/feedbackReporter/eventNo
  104. EventType string `json:"eventType"` // 事件类型
  105. PriorityLevel string `json:"priorityLevel"` // 优先级
  106. SortBy string `json:"sortBy"` // 排序字段: feedbackDateDesc/feedbackDateAsc/custName
  107. }
  108. // AssignOpsUserReq 接收/分配运维人员请求
  109. type AssignOpsUserReq struct {
  110. Id int64 `json:"id" v:"min:1#事件ID不能为空"`
  111. OpsUserId int `json:"opsUserId"`
  112. OpsUserName string `json:"opsUserName"`
  113. }
  114. // AttachmentReq 附件请求
  115. type AttachmentReq struct {
  116. FileName string `json:"fileName"` // 附件名称
  117. FileUrl string `json:"fileUrl"` // 附件URL
  118. FileType string `json:"fileType"` // 附件类型
  119. }
  120. // AddRecordReq 添加处理记录请求
  121. type AddRecordReq struct {
  122. EventId int64 `json:"eventId" v:"min:1#事件ID不能为空"`
  123. HandleContent string `json:"handleContent" v:"required#处理内容不能为空"`
  124. HandleResult string `json:"handleResult"` // 处理结果
  125. Attachments []AttachmentReq `json:"attachments"` // 附件列表
  126. }
  127. // OpsOperationEventHistorySearchReq 运维历史搜索请求
  128. type OpsOperationEventHistorySearchReq struct {
  129. ScopeType string `json:"scopeType"` // 范围: my-本人处理, all-全部
  130. IncludeClosed bool `json:"includeClosed"` // 是否包含未关闭事件
  131. EventTitle string `json:"eventTitle"` // 事件标题(模糊搜索)
  132. CustName string `json:"custName"` // 客户名称(模糊搜索)
  133. FeedbackReporter string `json:"feedbackReporter"` // 反馈人(模糊搜索)
  134. OpsUserName string `json:"opsUserName"` // 处理人(模糊搜索)
  135. BeginTime string `json:"beginTime"` // 反馈开始时间
  136. EndTime string `json:"endTime"` // 反馈结束时间
  137. ContractId string `json:"contractId"` // 合同ID
  138. request.PageReq
  139. }
  140. // OpsOperationEventHistoryExport 运维历史导出参数
  141. type OpsOperationEventHistoryExport struct {
  142. OpsOperationEventHistorySearchReq
  143. Columns []string `json:"columns"` // 导出列
  144. }
  145. // OpsOperationEventHistoryExportData 运维历史导出数据
  146. type OpsOperationEventHistoryExportData struct {
  147. EventNo string `json:"eventNo" export:"事件编号"`
  148. EventTitle string `json:"eventTitle" export:"事件标题"`
  149. EventStatus string `json:"eventStatus" export:"事件状态"`
  150. EventType string `json:"eventType" export:"事件类型"`
  151. CustName string `json:"custName" export:"客户名称"`
  152. OpsUserName string `json:"opsUserName" export:"处理人员"`
  153. FeedbackDate string `json:"feedbackDate" export:"反馈时间"`
  154. PriorityLevel string `json:"priorityLevel" export:"优先级"`
  155. HandleProcess string `json:"handleProcess" export:"处理过程"`
  156. ClosedTime string `json:"closedTime" export:"关闭时间"`
  157. }
  158. // OpsOperationEventHistoryExportContent 运维历史导出内容
  159. type OpsOperationEventHistoryExportContent struct {
  160. Content string `json:"content"` // 导出内容(base64编码)
  161. }
  162. // OpsOperationWorkHourListReq 查询工时登记列表请求
  163. type OpsOperationWorkHourListReq struct {
  164. EventId int `json:"eventId" v:"required#事件ID不能为空"` // 事件ID
  165. }
  166. // OpsOperationWorkHourListRsp 工时登记响应
  167. type OpsOperationWorkHourListRsp struct {
  168. Id int `json:"id"` // ID
  169. WorkDate string `json:"workDate"` // 工作日期
  170. WorkHour float64 `json:"workHour"` // 工作时长
  171. Remark string `json:"remark"` // 工作说明
  172. CreatedName string `json:"createdName"` // 登记人
  173. CreatedTime string `json:"createdTime"` // 登记时间
  174. }
  175. type OpsOperationEventExport struct {
  176. Columns []string `json:"columns"`
  177. }
  178. type OpsOperationEventExportData struct {
  179. EventNo string `json:"eventNo" export:"事件编号"`
  180. EventTitle string `json:"eventTitle" export:"事件标题"`
  181. EventStatus string `json:"eventStatus" export:"事件状态"`
  182. EventType string `json:"eventType" export:"事件类型"`
  183. CustName string `json:"custName" export:"客户名称"`
  184. OpsUserName string `json:"opsUserName" export:"处理人员"`
  185. FeedbackDate string `json:"feedbackDate" export:"反馈时间"`
  186. PriorityLevel string `json:"priorityLevel" export:"优先级"`
  187. HandleProcess string `json:"handleProcess" export:"处理过程"`
  188. }
  189. // OpsOperationWorkHourAddReq 添加工时记录请求
  190. type OpsOperationWorkHourAddReq struct {
  191. EventId int `json:"eventId" v:"min:1#事件ID不能为空"`
  192. WorkDate string `json:"workDate" v:"required#工作日期不能为空"`
  193. WorkHour float64 `json:"workHour" v:"min:0.5#工作时长不能小于0.5小时"`
  194. Remark string `json:"remark"`
  195. }