|
@@ -8,6 +8,7 @@ import ( |
|
@@ -8,6 +8,7 @@ import ( |
8
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
11
|
+ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
11
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
12
|
)
|
13
|
)
|
13
|
|
14
|
|
|
@@ -179,9 +180,8 @@ func sendSummaryEvaluation(project *domain.EvaluationProject, |
|
@@ -179,9 +180,8 @@ func sendSummaryEvaluation(project *domain.EvaluationProject, |
179
|
}
|
180
|
}
|
180
|
}
|
181
|
}
|
181
|
//回填 项目的状态
|
182
|
//回填 项目的状态
|
182
|
- evaluationProjectRepo := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
183
|
- project.SummaryState = domain.ProjectSummaryStateYes
|
|
|
184
|
- _, err = evaluationProjectRepo.Insert(project)
|
183
|
+ projectDao := dao.NewEvaluationProjectDao(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
184
|
+ err = projectDao.UpdateSummaryState(project.Id, domain.ProjectSummaryStateYes)
|
185
|
if err != nil {
|
185
|
if err != nil {
|
186
|
return nil, err
|
186
|
return nil, err
|
187
|
}
|
187
|
}
|
|
@@ -275,55 +275,10 @@ func TaskSendSummaryEvaluation() error { |
|
@@ -275,55 +275,10 @@ func TaskSendSummaryEvaluation() error { |
275
|
return err
|
275
|
return err
|
276
|
}
|
276
|
}
|
277
|
|
277
|
|
278
|
-// 发送短信通知
|
278
|
+// 添加待发送的短信通知
|
279
|
func sendSmsEvalation(param []domain.SummaryEvaluation) error {
|
279
|
func sendSmsEvalation(param []domain.SummaryEvaluation) error {
|
280
|
for i := range param {
|
280
|
for i := range param {
|
281
|
notify.AddNotifySummaryEvaluation(¶m[i])
|
281
|
notify.AddNotifySummaryEvaluation(¶m[i])
|
282
|
}
|
282
|
}
|
283
|
-
|
|
|
284
|
- //处理短信发送
|
|
|
285
|
- //过滤去重 处理需要发送改执行人的消息 执行人id=>domain.LogSms
|
|
|
286
|
- // noticeMap := map[string]*domain.LogSms{}
|
|
|
287
|
- // for _, v := range param {
|
|
|
288
|
- // phone := v.Executor.Account
|
|
|
289
|
- // name := v.Executor.UserName
|
|
|
290
|
- // if _, ok := noticeMap[phone]; ok {
|
|
|
291
|
- // continue
|
|
|
292
|
- // }
|
|
|
293
|
- // if phone == "" {
|
|
|
294
|
- // continue
|
|
|
295
|
- // }
|
|
|
296
|
- // smsMessage := domain.LogSms{}
|
|
|
297
|
- // smsMessage.SummaryEvaluationMessage(phone, name)
|
|
|
298
|
- // noticeMap[phone] = &smsMessage
|
|
|
299
|
- // }
|
|
|
300
|
-
|
|
|
301
|
- // sms := serviceGateway.SmsService{}
|
|
|
302
|
- // for _, v := range noticeMap {
|
|
|
303
|
- // err := sms.SendNoticeSms(v.Phone, v.TemplateId, v.Value)
|
|
|
304
|
- // if err != nil {
|
|
|
305
|
- // v.Result = err.Error()
|
|
|
306
|
- // }
|
|
|
307
|
- // }
|
|
|
308
|
- // transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
309
|
- // if err != nil {
|
|
|
310
|
- // return err
|
|
|
311
|
- // }
|
|
|
312
|
- // if err := transactionContext.StartTransaction(); err != nil {
|
|
|
313
|
- // return err
|
|
|
314
|
- // }
|
|
|
315
|
- // defer func() {
|
|
|
316
|
- // _ = transactionContext.RollbackTransaction()
|
|
|
317
|
- // }()
|
|
|
318
|
- // logSmsRepo := factory.CreateLogSmsRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
319
|
- // for _, v := range noticeMap {
|
|
|
320
|
- // err = logSmsRepo.Insert(v)
|
|
|
321
|
- // if err != nil {
|
|
|
322
|
- // log.Logger.Error("TaskSendSummaryEvaluation 发送短信通知:" + err.Error())
|
|
|
323
|
- // }
|
|
|
324
|
- // }
|
|
|
325
|
- // if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
326
|
- // return err
|
|
|
327
|
- // }
|
|
|
328
|
return nil
|
283
|
return nil
|
329
|
} |
284
|
} |