|
@@ -102,7 +102,7 @@ func (noticePersonalService *NoticePersonalService) AgreeJoinCreationProject(agr |
|
@@ -102,7 +102,7 @@ func (noticePersonalService *NoticePersonalService) AgreeJoinCreationProject(agr |
102
|
if err := transactionContext.CommitTransaction(); err != nil {
|
102
|
if err := transactionContext.CommitTransaction(); err != nil {
|
103
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
103
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
104
|
}
|
104
|
}
|
105
|
- return nil, nil
|
105
|
+ return noticePersonal, nil
|
106
|
}
|
106
|
}
|
107
|
|
107
|
|
108
|
// 获取消息列表
|
108
|
// 获取消息列表
|
|
@@ -160,12 +160,10 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
|
@@ -160,12 +160,10 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
160
|
}
|
160
|
}
|
161
|
if len(settings) == 0 {
|
161
|
if len(settings) == 0 {
|
162
|
//未设置消息模板
|
162
|
//未设置消息模板
|
163
|
- return nil, nil
|
163
|
+ return "未设置对应的消息模板", nil
|
164
|
}
|
164
|
}
|
165
|
- noticeContent := settings[0].Content
|
|
|
166
|
- tpl, err := template.New("AgreeJoinCreationProject").Parse(noticeContent)
|
|
|
167
|
- if err != nil {
|
|
|
168
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
165
|
+ if settings[0].IsPush == domain.NoticeSettingIsNotPush {
|
|
|
166
|
+ return "消息是否推送已设为否", nil
|
169
|
}
|
167
|
}
|
170
|
// Param01_04_01 = "param01_04_01" //分红预算消息-共创项目编号
|
168
|
// Param01_04_01 = "param01_04_01" //分红预算消息-共创项目编号
|
171
|
// Param01_04_02 = "param01_04_02" //分红预算消息-共创项目名称
|
169
|
// Param01_04_02 = "param01_04_02" //分红预算消息-共创项目名称
|
|
@@ -182,6 +180,11 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
|
@@ -182,6 +180,11 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
182
|
domain.Param01_04_05: strings.Join(informExpectedDividendsCommand.ProductName, ","),
|
180
|
domain.Param01_04_05: strings.Join(informExpectedDividendsCommand.ProductName, ","),
|
183
|
domain.Param01_04_06: informExpectedDividendsCommand.DividendsAmount,
|
181
|
domain.Param01_04_06: informExpectedDividendsCommand.DividendsAmount,
|
184
|
}
|
182
|
}
|
|
|
183
|
+ noticeContent := settings[0].Content
|
|
|
184
|
+ tpl, err := template.New("InformExpectedDividends").Parse(noticeContent)
|
|
|
185
|
+ if err != nil {
|
|
|
186
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
|
|
187
|
+ }
|
185
|
tplResult := bytes.Buffer{}
|
188
|
tplResult := bytes.Buffer{}
|
186
|
err = tpl.Execute(&tplResult, data)
|
189
|
err = tpl.Execute(&tplResult, data)
|
187
|
if err != nil {
|
190
|
if err != nil {
|
|
@@ -221,7 +224,7 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
|
@@ -221,7 +224,7 @@ func (noticePersonalService *NoticePersonalService) InformExpectedDividends(info |
221
|
if err := transactionContext.CommitTransaction(); err != nil {
|
224
|
if err := transactionContext.CommitTransaction(); err != nil {
|
222
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
225
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
223
|
}
|
226
|
}
|
224
|
- return nil, nil
|
227
|
+ return noticePersonal, nil
|
225
|
}
|
228
|
}
|
226
|
|
229
|
|
227
|
// 设置消息:共创确认
|
230
|
// 设置消息:共创确认
|
|
@@ -240,7 +243,6 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
|
@@ -240,7 +243,6 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
240
|
transactionContext.RollbackTransaction()
|
243
|
transactionContext.RollbackTransaction()
|
241
|
}()
|
244
|
}()
|
242
|
|
245
|
|
243
|
- //TODO
|
|
|
244
|
var noticeSettingRepository domain.NoticeSettingRepository
|
246
|
var noticeSettingRepository domain.NoticeSettingRepository
|
245
|
if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
247
|
if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
246
|
"transactionContext": transactionContext,
|
248
|
"transactionContext": transactionContext,
|
|
@@ -258,10 +260,13 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
|
@@ -258,10 +260,13 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
258
|
}
|
260
|
}
|
259
|
if len(settings) == 0 {
|
261
|
if len(settings) == 0 {
|
260
|
//未设置消息模板
|
262
|
//未设置消息模板
|
261
|
- return nil, nil
|
263
|
+ return "未设置对应的消息模板", nil
|
|
|
264
|
+ }
|
|
|
265
|
+ if settings[0].IsPush == domain.NoticeSettingIsNotPush {
|
|
|
266
|
+ return "消息是否推送已设为否", nil
|
262
|
}
|
267
|
}
|
263
|
noticeContent := settings[0].Content
|
268
|
noticeContent := settings[0].Content
|
264
|
- tpl, err := template.New("AgreeJoinCreationProject").Parse(noticeContent)
|
269
|
+ tpl, err := template.New("InformJoinCreationContract").Parse(noticeContent)
|
265
|
if err != nil {
|
270
|
if err != nil {
|
266
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
271
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
267
|
}
|
272
|
}
|
|
@@ -312,7 +317,7 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
|
@@ -312,7 +317,7 @@ func (noticePersonalService *NoticePersonalService) InformJoinCreationContract(i |
312
|
if err := transactionContext.CommitTransaction(); err != nil {
|
317
|
if err := transactionContext.CommitTransaction(); err != nil {
|
313
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
318
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
314
|
}
|
319
|
}
|
315
|
- return nil, nil
|
320
|
+ return noticePersonal, nil
|
316
|
}
|
321
|
}
|
317
|
|
322
|
|
318
|
// 设置消息:共创申请审核拒绝
|
323
|
// 设置消息:共创申请审核拒绝
|
|
@@ -331,12 +336,266 @@ func (noticePersonalService *NoticePersonalService) RefuseJoinCreationProject(re |
|
@@ -331,12 +336,266 @@ func (noticePersonalService *NoticePersonalService) RefuseJoinCreationProject(re |
331
|
transactionContext.RollbackTransaction()
|
336
|
transactionContext.RollbackTransaction()
|
332
|
}()
|
337
|
}()
|
333
|
|
338
|
|
334
|
- //TODO
|
339
|
+ var noticeSettingRepository domain.NoticeSettingRepository
|
|
|
340
|
+ if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
|
|
341
|
+ "transactionContext": transactionContext,
|
|
|
342
|
+ }); err != nil {
|
|
|
343
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
344
|
+ } else {
|
|
|
345
|
+ noticeSettingRepository = value
|
|
|
346
|
+ }
|
|
|
347
|
+ _, settings, err := noticeSettingRepository.Find(map[string]interface{}{
|
|
|
348
|
+ "orgId": refuseJoinCreationProjectCommand.OrgId,
|
|
|
349
|
+ "moduleAction": domain.Action01_02,
|
|
|
350
|
+ })
|
|
|
351
|
+ if err != nil {
|
|
|
352
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
353
|
+ }
|
|
|
354
|
+ if len(settings) == 0 {
|
|
|
355
|
+ //未设置消息模板
|
|
|
356
|
+ return "未设置对应的消息模板", nil
|
|
|
357
|
+ }
|
|
|
358
|
+ if settings[0].IsPush == domain.NoticeSettingIsNotPush {
|
|
|
359
|
+ return "消息是否推送已设为否", nil
|
|
|
360
|
+ }
|
|
|
361
|
+ // Param01_02_01 = "param01_02_01" //共创申请拒绝-共创项目编号
|
|
|
362
|
+ // Param01_02_02 = "param01_02_02" //共创申请拒绝-共创项目名称
|
|
|
363
|
+ //数据字段映射
|
|
|
364
|
+ data := map[string]string{
|
|
|
365
|
+ domain.Param01_02_01: refuseJoinCreationProjectCommand.CreationProjectNumber,
|
|
|
366
|
+ domain.Param01_02_02: refuseJoinCreationProjectCommand.CreationProjectName,
|
|
|
367
|
+ }
|
|
|
368
|
+ noticeContent := settings[0].Content
|
|
|
369
|
+ tpl, err := template.New("RefuseJoinCreationProject").Parse(noticeContent)
|
|
|
370
|
+ if err != nil {
|
|
|
371
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
|
|
372
|
+ }
|
|
|
373
|
+ tplResult := bytes.Buffer{}
|
|
|
374
|
+ err = tpl.Execute(&tplResult, data)
|
|
|
375
|
+ if err != nil {
|
|
|
376
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息体生成失败"+err.Error())
|
|
|
377
|
+ }
|
|
|
378
|
+ extendData := map[string]interface{}{
|
|
|
379
|
+ "creationProjectId": refuseJoinCreationProjectCommand.CreationProjectId,
|
|
|
380
|
+ }
|
|
|
381
|
+ extendStr, _ := json.Marshal(extendData)
|
|
|
382
|
+ noticePersonal := domain.NoticePersonal{
|
|
|
383
|
+ CreatedAt: time.Now(),
|
|
|
384
|
+ UpdatedAt: time.Now(),
|
|
|
385
|
+ Extend: string(extendStr),
|
|
|
386
|
+ CompanyId: refuseJoinCreationProjectCommand.CompanyId,
|
|
|
387
|
+ Content: tplResult.String(),
|
|
|
388
|
+ IsRead: domain.NoticePersonalIsNotRead,
|
|
|
389
|
+ Module: domain.Action01_01,
|
|
|
390
|
+ ModuleAction: domain.Action01_01,
|
|
|
391
|
+ UserBaseId: refuseJoinCreationProjectCommand.UserBaseId,
|
|
|
392
|
+ OrgId: refuseJoinCreationProjectCommand.OrgId,
|
|
|
393
|
+ UserId: refuseJoinCreationProjectCommand.UserId,
|
|
|
394
|
+ }
|
|
|
395
|
+ var noticePersonalRepository domain.NoticePersonalRepository
|
|
|
396
|
+ if value, err := factory.CreateNoticePersonalRepository(map[string]interface{}{
|
|
|
397
|
+ "transactionContext": transactionContext,
|
|
|
398
|
+ }); err != nil {
|
|
|
399
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
400
|
+ } else {
|
|
|
401
|
+ noticePersonalRepository = value
|
|
|
402
|
+ }
|
|
|
403
|
+ _, err = noticePersonalRepository.Save(¬icePersonal)
|
|
|
404
|
+ if err != nil {
|
|
|
405
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
406
|
+ }
|
335
|
|
407
|
|
336
|
if err := transactionContext.CommitTransaction(); err != nil {
|
408
|
if err := transactionContext.CommitTransaction(); err != nil {
|
337
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
409
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
338
|
}
|
410
|
}
|
339
|
- return nil, nil
|
411
|
+ return noticePersonal, nil
|
|
|
412
|
+}
|
|
|
413
|
+
|
|
|
414
|
+// 设置消息:账期结算消息-分红预算
|
|
|
415
|
+func (noticePersonalService *NoticePersonalService) CreditAccountEstimate(creditAccountEstimateCommand *command.CreditAccountEstimateCommand) (interface{}, error) {
|
|
|
416
|
+ if err := creditAccountEstimateCommand.ValidateCommand(); err != nil {
|
|
|
417
|
+ return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
418
|
+ }
|
|
|
419
|
+ transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
420
|
+ if err != nil {
|
|
|
421
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
422
|
+ }
|
|
|
423
|
+ if err := transactionContext.StartTransaction(); err != nil {
|
|
|
424
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
425
|
+ }
|
|
|
426
|
+ defer func() {
|
|
|
427
|
+ transactionContext.RollbackTransaction()
|
|
|
428
|
+ }()
|
|
|
429
|
+
|
|
|
430
|
+ var noticeSettingRepository domain.NoticeSettingRepository
|
|
|
431
|
+ if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
|
|
432
|
+ "transactionContext": transactionContext,
|
|
|
433
|
+ }); err != nil {
|
|
|
434
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
435
|
+ } else {
|
|
|
436
|
+ noticeSettingRepository = value
|
|
|
437
|
+ }
|
|
|
438
|
+ _, settings, err := noticeSettingRepository.Find(map[string]interface{}{
|
|
|
439
|
+ "orgId": creditAccountEstimateCommand.OrgId,
|
|
|
440
|
+ "moduleAction": domain.Action01_05,
|
|
|
441
|
+ })
|
|
|
442
|
+ if err != nil {
|
|
|
443
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
444
|
+ }
|
|
|
445
|
+ if len(settings) == 0 {
|
|
|
446
|
+ //未设置消息模板
|
|
|
447
|
+ return "未找到对应的消息模板", nil
|
|
|
448
|
+ }
|
|
|
449
|
+ if settings[0].IsPush == domain.NoticeSettingIsNotPush {
|
|
|
450
|
+ return "消息是否推送已设为否", nil
|
|
|
451
|
+ }
|
|
|
452
|
+ // Param01_05_01 = "param01_05_01" //账期结算消息-账期结算单号
|
|
|
453
|
+ // Param01_05_02 = "param01_05_02" //账期结算消息-结算金额
|
|
|
454
|
+ // Param01_05_03 = "param01_05_03" //账期结算消息-分红预算单号
|
|
|
455
|
+ //数据字段映射
|
|
|
456
|
+ data := map[string]string{
|
|
|
457
|
+ domain.Param01_05_01: creditAccountEstimateCommand.CreditAccountOrderNum,
|
|
|
458
|
+ domain.Param01_05_02: creditAccountEstimateCommand.SettlementAmount,
|
|
|
459
|
+ domain.Param01_05_03: creditAccountEstimateCommand.DividendsEstimateOrderNumber,
|
|
|
460
|
+ }
|
|
|
461
|
+ noticeContent := settings[0].Content
|
|
|
462
|
+ tpl, err := template.New("CreditAccountEstimate").Parse(noticeContent)
|
|
|
463
|
+ if err != nil {
|
|
|
464
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
|
|
465
|
+ }
|
|
|
466
|
+ tplResult := bytes.Buffer{}
|
|
|
467
|
+ err = tpl.Execute(&tplResult, data)
|
|
|
468
|
+ if err != nil {
|
|
|
469
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息体生成失败"+err.Error())
|
|
|
470
|
+ }
|
|
|
471
|
+ extendData := map[string]interface{}{
|
|
|
472
|
+ "creditAccountId": creditAccountEstimateCommand.CreditAccountId,
|
|
|
473
|
+ "dividendsEstimateId": creditAccountEstimateCommand.DividendsEstimateId,
|
|
|
474
|
+ }
|
|
|
475
|
+ extendStr, _ := json.Marshal(extendData)
|
|
|
476
|
+ noticePersonal := domain.NoticePersonal{
|
|
|
477
|
+ CreatedAt: time.Now(),
|
|
|
478
|
+ UpdatedAt: time.Now(),
|
|
|
479
|
+ Extend: string(extendStr),
|
|
|
480
|
+ CompanyId: creditAccountEstimateCommand.CompanyId,
|
|
|
481
|
+ Content: tplResult.String(),
|
|
|
482
|
+ IsRead: domain.NoticePersonalIsNotRead,
|
|
|
483
|
+ Module: domain.Action01_01,
|
|
|
484
|
+ ModuleAction: domain.Action01_01,
|
|
|
485
|
+ UserBaseId: creditAccountEstimateCommand.UserBaseId,
|
|
|
486
|
+ OrgId: creditAccountEstimateCommand.OrgId,
|
|
|
487
|
+ UserId: creditAccountEstimateCommand.UserId,
|
|
|
488
|
+ }
|
|
|
489
|
+ var noticePersonalRepository domain.NoticePersonalRepository
|
|
|
490
|
+ if value, err := factory.CreateNoticePersonalRepository(map[string]interface{}{
|
|
|
491
|
+ "transactionContext": transactionContext,
|
|
|
492
|
+ }); err != nil {
|
|
|
493
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
494
|
+ } else {
|
|
|
495
|
+ noticePersonalRepository = value
|
|
|
496
|
+ }
|
|
|
497
|
+ _, err = noticePersonalRepository.Save(¬icePersonal)
|
|
|
498
|
+ if err != nil {
|
|
|
499
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
500
|
+ }
|
|
|
501
|
+
|
|
|
502
|
+ if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
503
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
504
|
+ }
|
|
|
505
|
+ return noticePersonal, nil
|
|
|
506
|
+}
|
|
|
507
|
+
|
|
|
508
|
+// 设置消息:账期结算消息-分红预算
|
|
|
509
|
+func (noticePersonalService *NoticePersonalService) CreditAccountPayment(creditAccountPaymentCommand *command.CreditAccountPaymentCommand) (interface{}, error) {
|
|
|
510
|
+ if err := creditAccountPaymentCommand.ValidateCommand(); err != nil {
|
|
|
511
|
+ return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
512
|
+ }
|
|
|
513
|
+ transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
514
|
+ if err != nil {
|
|
|
515
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
516
|
+ }
|
|
|
517
|
+ if err := transactionContext.StartTransaction(); err != nil {
|
|
|
518
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
519
|
+ }
|
|
|
520
|
+ defer func() {
|
|
|
521
|
+ transactionContext.RollbackTransaction()
|
|
|
522
|
+ }()
|
|
|
523
|
+
|
|
|
524
|
+ var noticeSettingRepository domain.NoticeSettingRepository
|
|
|
525
|
+ if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
|
|
526
|
+ "transactionContext": transactionContext,
|
|
|
527
|
+ }); err != nil {
|
|
|
528
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
529
|
+ } else {
|
|
|
530
|
+ noticeSettingRepository = value
|
|
|
531
|
+ }
|
|
|
532
|
+ _, settings, err := noticeSettingRepository.Find(map[string]interface{}{
|
|
|
533
|
+ "orgId": creditAccountPaymentCommand.OrgId,
|
|
|
534
|
+ "moduleAction": domain.Action01_05,
|
|
|
535
|
+ })
|
|
|
536
|
+ if err != nil {
|
|
|
537
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
538
|
+ }
|
|
|
539
|
+ if len(settings) == 0 {
|
|
|
540
|
+ //未设置消息模板
|
|
|
541
|
+ return "未找到对应的消息模板", nil
|
|
|
542
|
+ }
|
|
|
543
|
+ if settings[0].IsPush == domain.NoticeSettingIsNotPush {
|
|
|
544
|
+ return "消息是否推送已设为否", nil
|
|
|
545
|
+ }
|
|
|
546
|
+ // Param01_06_01 = "param01_06_01" //支付消息-账期结算单号
|
|
|
547
|
+ // Param01_06_02 = "param01_06_02" //支付消息-结算金额
|
|
|
548
|
+ // Param01_06_03 = "param01_06_03" //支付消息-实付金额
|
|
|
549
|
+ //数据字段映射
|
|
|
550
|
+ data := map[string]string{
|
|
|
551
|
+ domain.Param01_06_01: creditAccountPaymentCommand.CreditAccountOrderNum,
|
|
|
552
|
+ domain.Param01_06_02: creditAccountPaymentCommand.SettlementAmount,
|
|
|
553
|
+ domain.Param01_06_03: creditAccountPaymentCommand.ActuallyPaidAmount,
|
|
|
554
|
+ }
|
|
|
555
|
+ noticeContent := settings[0].Content
|
|
|
556
|
+ tpl, err := template.New("CreditAccountPayment").Parse(noticeContent)
|
|
|
557
|
+ if err != nil {
|
|
|
558
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息模板解析失败"+err.Error())
|
|
|
559
|
+ }
|
|
|
560
|
+ tplResult := bytes.Buffer{}
|
|
|
561
|
+ err = tpl.Execute(&tplResult, data)
|
|
|
562
|
+ if err != nil {
|
|
|
563
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "消息体生成失败"+err.Error())
|
|
|
564
|
+ }
|
|
|
565
|
+ extendData := map[string]interface{}{
|
|
|
566
|
+ "creditAccountId": creditAccountPaymentCommand.CreditAccountId,
|
|
|
567
|
+ }
|
|
|
568
|
+ extendStr, _ := json.Marshal(extendData)
|
|
|
569
|
+ noticePersonal := domain.NoticePersonal{
|
|
|
570
|
+ CreatedAt: time.Now(),
|
|
|
571
|
+ UpdatedAt: time.Now(),
|
|
|
572
|
+ Extend: string(extendStr),
|
|
|
573
|
+ CompanyId: creditAccountPaymentCommand.CompanyId,
|
|
|
574
|
+ Content: tplResult.String(),
|
|
|
575
|
+ IsRead: domain.NoticePersonalIsNotRead,
|
|
|
576
|
+ Module: domain.Action01_01,
|
|
|
577
|
+ ModuleAction: domain.Action01_01,
|
|
|
578
|
+ UserBaseId: creditAccountPaymentCommand.UserBaseId,
|
|
|
579
|
+ OrgId: creditAccountPaymentCommand.OrgId,
|
|
|
580
|
+ UserId: creditAccountPaymentCommand.UserId,
|
|
|
581
|
+ }
|
|
|
582
|
+ var noticePersonalRepository domain.NoticePersonalRepository
|
|
|
583
|
+ if value, err := factory.CreateNoticePersonalRepository(map[string]interface{}{
|
|
|
584
|
+ "transactionContext": transactionContext,
|
|
|
585
|
+ }); err != nil {
|
|
|
586
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
587
|
+ } else {
|
|
|
588
|
+ noticePersonalRepository = value
|
|
|
589
|
+ }
|
|
|
590
|
+ _, err = noticePersonalRepository.Save(¬icePersonal)
|
|
|
591
|
+ if err != nil {
|
|
|
592
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
593
|
+ }
|
|
|
594
|
+
|
|
|
595
|
+ if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
596
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
597
|
+ }
|
|
|
598
|
+ return noticePersonal, nil
|
340
|
}
|
599
|
}
|
341
|
|
600
|
|
342
|
func NewNoticePersonalService(options map[string]interface{}) *NoticePersonalService {
|
601
|
func NewNoticePersonalService(options map[string]interface{}) *NoticePersonalService {
|