作者 tangxvhui

暂存

  1 +package adapter
  2 +
  3 +type MessageListAdapter struct {
  4 + Content string `json:"content"`
  5 +}
@@ -102,3 +102,16 @@ func (srv *MessagePersonalService) TodayMessageSummaryEvaluationSelf(param *comm @@ -102,3 +102,16 @@ func (srv *MessagePersonalService) TodayMessageSummaryEvaluationSelf(param *comm
102 } 102 }
103 return resp, nil 103 return resp, nil
104 } 104 }
  105 +
  106 +// 获取关于任务里程碑异常的消息
  107 +// 每日一次
  108 +func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.GetUserMessageCommand) (map[string]interface{}, error) {
  109 +
  110 + return nil, nil
  111 +}
  112 +
  113 +// 获取关于任务反馈碑异常的消息
  114 +// 每日一次
  115 +func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command.GetUserMessageCommand) (map[string]interface{}, error) {
  116 + return nil, nil
  117 +}
@@ -236,6 +236,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] @@ -236,6 +236,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string]
236 if err != nil { 236 if err != nil {
237 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请填写里程碑完成时间") 237 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "请填写里程碑完成时间")
238 } 238 }
  239 + t = dayEndTime(t)
239 if i > 0 { 240 if i > 0 {
240 if lastPlanCompletedAt.After(t) { 241 if lastPlanCompletedAt.After(t) {
241 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "里程碑["+val2.Name+"]完成时间填写错误") 242 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "里程碑["+val2.Name+"]完成时间填写错误")
@@ -261,7 +262,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] @@ -261,7 +262,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string]
261 oldStage.DeletedAt = nil 262 oldStage.DeletedAt = nil
262 oldStage.SortBy = i + 1 263 oldStage.SortBy = i + 1
263 oldStage.Name = val2.Name 264 oldStage.Name = val2.Name
264 - oldStage.PlanCompletedAt = t.Unix() 265 + oldStage.PlanCompleted(t)
265 //TODO 修改里程碑计划完成时间,特殊处理 266 //TODO 修改里程碑计划完成时间,特殊处理
266 } 267 }
267 stageList = append(stageList, newStageList...) 268 stageList = append(stageList, newStageList...)
@@ -827,3 +828,5 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction @@ -827,3 +828,5 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction
827 } 828 }
828 return nil 829 return nil
829 } 830 }
  831 +
  832 +// func (srv TaskService)
@@ -52,3 +52,13 @@ func (t TaskStage) StatusDescription() string { @@ -52,3 +52,13 @@ func (t TaskStage) StatusDescription() string {
52 } 52 }
53 return str 53 return str
54 } 54 }
  55 +
  56 +func (t *TaskStage) PlanCompleted(now time.Time) {
  57 + t.PlanCompletedAt = t.dayEndTime(now).Unix()
  58 +}
  59 +
  60 +func (t TaskStage) dayEndTime(now time.Time) time.Time {
  61 + yyyy, m, d := now.Local().Date()
  62 + endTime := time.Date(yyyy, m, d, 23, 59, 59, 0, time.Local)
  63 + return endTime
  64 +}