...
|
...
|
@@ -46,6 +46,7 @@ func messageTaskStageAnomaly() ([]*domain.MessagePersonal, error) { |
|
|
continue
|
|
|
}
|
|
|
//通知相关人员
|
|
|
// 【您关注的【%s】里程碑未按时完成,请知晓。】
|
|
|
|
|
|
//通知负责人
|
|
|
for _, val2 := range userList {
|
...
|
...
|
@@ -54,16 +55,16 @@ func messageTaskStageAnomaly() ([]*domain.MessagePersonal, error) { |
|
|
content = fmt.Sprintf("【您负责的项目【%s】里程碑未按时完成,请重点关注,积极寻找上级辅导。】", val.TaskName)
|
|
|
} else if val2.Level == 2 {
|
|
|
content = fmt.Sprintf("【您下级%s负责的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.TaskName)
|
|
|
} else if val2.Level == 3 {
|
|
|
} else if val2.Level >= 3 {
|
|
|
content = fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.TaskName)
|
|
|
}
|
|
|
if content == "" {
|
|
|
continue
|
|
|
}
|
|
|
payload := map[string]string{
|
|
|
"task_id": strconv.Itoa(val.TaskId),
|
|
|
"task_alias": val.TaskAlias,
|
|
|
"task_name": val.TaskName,
|
|
|
"taskId": strconv.Itoa(val.TaskId),
|
|
|
"taskAlias": val.TaskAlias,
|
|
|
"taskName": val.TaskName,
|
|
|
}
|
|
|
payloadStr, _ := json.Marshal(payload)
|
|
|
newMessage := domain.MessagePersonal{
|
...
|
...
|
@@ -88,16 +89,16 @@ func messageTaskStageAnomaly() ([]*domain.MessagePersonal, error) { |
|
|
|
|
|
// messageTaskRecordAnomaly 反馈异常
|
|
|
func messageTaskRecordAnomaly() ([]*domain.MessagePersonal, error) {
|
|
|
// transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
// }
|
|
|
// if err := transactionContext.StartTransaction(); err != nil {
|
|
|
// return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
// }
|
|
|
// defer func() {
|
|
|
// _ = transactionContext.RollbackTransaction()
|
|
|
// }()
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
// taskDao := dao.NewTaskDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// userDao := dao.NewUserDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// taskData, err := taskDao.TaskRecordAnomalyAll()
|
...
|
...
|
@@ -152,9 +153,9 @@ func messageTaskRecordAnomaly() ([]*domain.MessagePersonal, error) { |
|
|
// allMessage = append(allMessage, &newMessage)
|
|
|
// }
|
|
|
// }
|
|
|
// if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
// return nil, err
|
|
|
// }
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
// return allMessage, nil
|
|
|
return nil, nil
|
|
|
}
|
...
|
...
|
|