正在显示
1 个修改的文件
包含
97 行增加
和
0 行删除
@@ -183,19 +183,68 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | @@ -183,19 +183,68 @@ func (srv *MessagePersonalService) TodayMessageTaskStageAnomaly(param *command.G | ||
183 | msgList = append(msgList, adapter.MessageListAdapter{ | 183 | msgList = append(msgList, adapter.MessageListAdapter{ |
184 | Content: s, | 184 | Content: s, |
185 | }) | 185 | }) |
186 | + payload := map[string]string{ | ||
187 | + "id": strconv.Itoa(val.Id), | ||
188 | + } | ||
189 | + payloadStr, _ := json.Marshal(payload) | ||
190 | + newMessage := domain.MessagePersonal{ | ||
191 | + Id: 0, | ||
192 | + Types: domain.MessageTypesOther, | ||
193 | + TargetUserId: param.UserId, | ||
194 | + ReadFlag: domain.MessageIsRead, | ||
195 | + Title: s, | ||
196 | + Content: s, | ||
197 | + CreatedAt: time.Time{}, | ||
198 | + UpdatedAt: time.Time{}, | ||
199 | + Payload: string(payloadStr), | ||
200 | + } | ||
201 | + messageRepo.Save(&newMessage) | ||
186 | } | 202 | } |
187 | for _, val := range taskStageList2 { | 203 | for _, val := range taskStageList2 { |
188 | s := fmt.Sprintf("您下级%s负责的项目【%s】里程碑未按时完成,请前往辅导。", val.LeaderName, val.Name) | 204 | s := fmt.Sprintf("您下级%s负责的项目【%s】里程碑未按时完成,请前往辅导。", val.LeaderName, val.Name) |
189 | msgList = append(msgList, adapter.MessageListAdapter{ | 205 | msgList = append(msgList, adapter.MessageListAdapter{ |
190 | Content: s, | 206 | Content: s, |
191 | }) | 207 | }) |
208 | + payload := map[string]string{ | ||
209 | + "id": strconv.Itoa(val.Id), | ||
210 | + } | ||
211 | + payloadStr, _ := json.Marshal(payload) | ||
212 | + newMessage := domain.MessagePersonal{ | ||
213 | + Id: 0, | ||
214 | + Types: domain.MessageTypesOther, | ||
215 | + TargetUserId: param.UserId, | ||
216 | + ReadFlag: domain.MessageIsRead, | ||
217 | + Title: s, | ||
218 | + Content: s, | ||
219 | + CreatedAt: time.Time{}, | ||
220 | + UpdatedAt: time.Time{}, | ||
221 | + Payload: string(payloadStr), | ||
222 | + } | ||
223 | + messageRepo.Save(&newMessage) | ||
192 | } | 224 | } |
193 | for _, val := range taskStageList3 { | 225 | for _, val := range taskStageList3 { |
194 | s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.Name) | 226 | s := fmt.Sprintf("【您下级%s关注的项目【%s】里程碑未按时完成,请前往辅导。】", val.LeaderName, val.Name) |
195 | msgList = append(msgList, adapter.MessageListAdapter{ | 227 | msgList = append(msgList, adapter.MessageListAdapter{ |
196 | Content: s, | 228 | Content: s, |
197 | }) | 229 | }) |
230 | + payload := map[string]string{ | ||
231 | + "id": strconv.Itoa(val.Id), | ||
232 | + } | ||
233 | + payloadStr, _ := json.Marshal(payload) | ||
234 | + newMessage := domain.MessagePersonal{ | ||
235 | + Id: 0, | ||
236 | + Types: domain.MessageTypesOther, | ||
237 | + TargetUserId: param.UserId, | ||
238 | + ReadFlag: domain.MessageIsRead, | ||
239 | + Title: s, | ||
240 | + Content: s, | ||
241 | + CreatedAt: time.Time{}, | ||
242 | + UpdatedAt: time.Time{}, | ||
243 | + Payload: string(payloadStr), | ||
244 | + } | ||
245 | + messageRepo.Save(&newMessage) | ||
198 | } | 246 | } |
247 | + | ||
199 | if err := transactionContext.CommitTransaction(); err != nil { | 248 | if err := transactionContext.CommitTransaction(); err != nil { |
200 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 249 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
201 | } | 250 | } |
@@ -292,18 +341,66 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. | @@ -292,18 +341,66 @@ func (srv *MessagePersonalService) TodayMessageTaskRecordAnomaly(param *command. | ||
292 | msgList = append(msgList, adapter.MessageListAdapter{ | 341 | msgList = append(msgList, adapter.MessageListAdapter{ |
293 | Content: s, | 342 | Content: s, |
294 | }) | 343 | }) |
344 | + payload := map[string]string{ | ||
345 | + "id": strconv.Itoa(val.Id), | ||
346 | + } | ||
347 | + payloadStr, _ := json.Marshal(payload) | ||
348 | + newMessage := domain.MessagePersonal{ | ||
349 | + Id: 0, | ||
350 | + Types: domain.MessageTypesOther, | ||
351 | + TargetUserId: param.UserId, | ||
352 | + ReadFlag: domain.MessageIsRead, | ||
353 | + Title: s, | ||
354 | + Content: s, | ||
355 | + CreatedAt: time.Time{}, | ||
356 | + UpdatedAt: time.Time{}, | ||
357 | + Payload: string(payloadStr), | ||
358 | + } | ||
359 | + messageRepo.Save(&newMessage) | ||
295 | } | 360 | } |
296 | for _, val := range taskStageList2 { | 361 | for _, val := range taskStageList2 { |
297 | s := fmt.Sprintf("【您下级%s负责的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) | 362 | s := fmt.Sprintf("【您下级%s负责的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) |
298 | msgList = append(msgList, adapter.MessageListAdapter{ | 363 | msgList = append(msgList, adapter.MessageListAdapter{ |
299 | Content: s, | 364 | Content: s, |
300 | }) | 365 | }) |
366 | + payload := map[string]string{ | ||
367 | + "id": strconv.Itoa(val.Id), | ||
368 | + } | ||
369 | + payloadStr, _ := json.Marshal(payload) | ||
370 | + newMessage := domain.MessagePersonal{ | ||
371 | + Id: 0, | ||
372 | + Types: domain.MessageTypesOther, | ||
373 | + TargetUserId: param.UserId, | ||
374 | + ReadFlag: domain.MessageIsRead, | ||
375 | + Title: s, | ||
376 | + Content: s, | ||
377 | + CreatedAt: time.Time{}, | ||
378 | + UpdatedAt: time.Time{}, | ||
379 | + Payload: string(payloadStr), | ||
380 | + } | ||
381 | + messageRepo.Save(&newMessage) | ||
301 | } | 382 | } |
302 | for _, val := range taskStageList3 { | 383 | for _, val := range taskStageList3 { |
303 | s := fmt.Sprintf("【您下级%s关注的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) | 384 | s := fmt.Sprintf("【您下级%s关注的项目【%s】已超过N日未反馈进度,请前往辅导。】", val.LeaderName, val.Name) |
304 | msgList = append(msgList, adapter.MessageListAdapter{ | 385 | msgList = append(msgList, adapter.MessageListAdapter{ |
305 | Content: s, | 386 | Content: s, |
306 | }) | 387 | }) |
388 | + payload := map[string]string{ | ||
389 | + "id": strconv.Itoa(val.Id), | ||
390 | + } | ||
391 | + payloadStr, _ := json.Marshal(payload) | ||
392 | + newMessage := domain.MessagePersonal{ | ||
393 | + Id: 0, | ||
394 | + Types: domain.MessageTypesOther, | ||
395 | + TargetUserId: param.UserId, | ||
396 | + ReadFlag: domain.MessageIsRead, | ||
397 | + Title: s, | ||
398 | + Content: s, | ||
399 | + CreatedAt: time.Time{}, | ||
400 | + UpdatedAt: time.Time{}, | ||
401 | + Payload: string(payloadStr), | ||
402 | + } | ||
403 | + messageRepo.Save(&newMessage) | ||
307 | } | 404 | } |
308 | if err := transactionContext.CommitTransaction(); err != nil { | 405 | if err := transactionContext.CommitTransaction(); err != nil { |
309 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 406 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
-
请 注册 或 登录 后发表评论