作者 tangxvhui

日常保存

@@ -36,6 +36,9 @@ func (srv TaskService) listTaskAnomaly2(param *command.ListTaskAnomalyCommand) ( @@ -36,6 +36,9 @@ func (srv TaskService) listTaskAnomaly2(param *command.ListTaskAnomalyCommand) (
36 }) 36 })
37 limit := 500 37 limit := 500
38 offset := 0 38 offset := 0
  39 + if param.SubLevel < 2 {
  40 + param.SubLevel = 2
  41 + }
39 cnt, anomalyList, err := taskAnomalyDao.List2(param.UserId, param.CompanyId, param.TaskName, param.Category, param.LeaderId, param.DayTime, param.SubLevel, limit, offset) 42 cnt, anomalyList, err := taskAnomalyDao.List2(param.UserId, param.CompanyId, param.TaskName, param.Category, param.LeaderId, param.DayTime, param.SubLevel, limit, offset)
40 if err != nil { 43 if err != nil {
41 return 0, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 44 return 0, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -340,6 +343,7 @@ func (srv TaskService) listTaskAnomaly3(param *command.ListTaskAnomalyCommand) ( @@ -340,6 +343,7 @@ func (srv TaskService) listTaskAnomaly3(param *command.ListTaskAnomalyCommand) (
340 return int64(cnt), listData, nil 343 return int64(cnt), listData, nil
341 } 344 }
342 345
  346 +// 与我有关的任务,异常列表
343 func (srv TaskService) ListTaskAnomaly3(param *command.ListTaskAnomalyCommand) (map[string]interface{}, error) { 347 func (srv TaskService) ListTaskAnomaly3(param *command.ListTaskAnomalyCommand) (map[string]interface{}, error) {
344 cnt, listData, err := srv.listTaskAnomaly3(param) 348 cnt, listData, err := srv.listTaskAnomaly3(param)
345 if err != nil { 349 if err != nil {
@@ -349,6 +353,7 @@ func (srv TaskService) ListTaskAnomaly3(param *command.ListTaskAnomalyCommand) ( @@ -349,6 +353,7 @@ func (srv TaskService) ListTaskAnomaly3(param *command.ListTaskAnomalyCommand) (
349 return result, nil 353 return result, nil
350 } 354 }
351 355
  356 +// 人员选择列表
352 func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.UserItem { 357 func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.UserItem {
353 transactionContext, err := factory.CreateTransactionContext(nil) 358 transactionContext, err := factory.CreateTransactionContext(nil)
354 if err != nil { 359 if err != nil {
@@ -403,7 +408,6 @@ func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.Us @@ -403,7 +408,6 @@ func (srv TaskService) UserSelect(param *command.UserSelectCommand) []adapter.Us
403 } 408 }
404 409
405 // 我负责的任务,异常列表 410 // 我负责的任务,异常列表
406 -  
407 func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (map[string]interface{}, error) { 411 func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (map[string]interface{}, error) {
408 transactionContext, err := factory.CreateTransactionContext(nil) 412 transactionContext, err := factory.CreateTransactionContext(nil)
409 if err != nil { 413 if err != nil {
@@ -560,7 +564,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) ( @@ -560,7 +564,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (
560 return result, nil 564 return result, nil
561 } 565 }
562 566
563 -// 对异常记录的操作标记 567 +// 在 异常中心 对异常记录的操作标记
564 func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (map[string]interface{}, error) { 568 func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (map[string]interface{}, error) {
565 transactionContext, err := factory.CreateTransactionContext(nil) 569 transactionContext, err := factory.CreateTransactionContext(nil)
566 if err != nil { 570 if err != nil {
@@ -945,3 +949,22 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a @@ -945,3 +949,22 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a
945 } 949 }
946 return result, nil 950 return result, nil
947 } 951 }
  952 +
  953 +// 任务列表中,对异常记录的操作标记
  954 +// 按照任务id 实则操作标记
  955 +func (srv TaskService) MarkTaskAnomalyByTask(param command.MarkTaskAnomalyCommand) (map[string]interface{}, error) {
  956 + transactionContext, err := factory.CreateTransactionContext(nil)
  957 + if err != nil {
  958 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  959 + }
  960 + if err := transactionContext.StartTransaction(); err != nil {
  961 + return map[string]interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  962 + }
  963 + defer func() {
  964 + _ = transactionContext.RollbackTransaction()
  965 + }()
  966 + if err := transactionContext.CommitTransaction(); err != nil {
  967 + return map[string]interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  968 + }
  969 + return nil, nil
  970 +}
1 -//go:build !local  
2 -// +build !local  
3 -  
4 package constant 1 package constant
5 2
6 import "os" 3 import "os"