作者 陈志颖

refactor:优化确认业绩分红

@@ -351,6 +351,16 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco @@ -351,6 +351,16 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco
351 creditAccountRepository = value 351 creditAccountRepository = value
352 } 352 }
353 353
  354 + // 分红预算单仓储初始化
  355 + var dividendsEstimateRepository domain.DividendsEstimateRepository
  356 + if value, err2 := factory.CreateDividendsEstimateRepository(map[string]interface{}{
  357 + "transactionContext": transactionContext,
  358 + }); err2 != nil {
  359 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err2.Error())
  360 + } else {
  361 + dividendsEstimateRepository = value
  362 + }
  363 +
354 // 获取待支付的账期结算单 364 // 获取待支付的账期结算单
355 creditAccount, err := creditAccountRepository.FindOne(map[string]interface{}{ 365 creditAccount, err := creditAccountRepository.FindOne(map[string]interface{}{
356 "creditAccountId": creditAccountId, 366 "creditAccountId": creditAccountId,
@@ -372,6 +382,27 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco @@ -372,6 +382,27 @@ func (creditAccountService *CreditAccountService) PayCreditAccount(payCreditAcco
372 if creditAccountSaved, err4 := creditAccountRepository.Save(creditAccount); err4 != nil { 382 if creditAccountSaved, err4 := creditAccountRepository.Save(creditAccount); err4 != nil {
373 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error()) 383 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error())
374 } else { 384 } else {
  385 + // 更新账期结算单相关的分红预算单的分红结算状态
  386 + var dividendsEstimateIds []int64
  387 + for _, accountDetail := range creditAccount.AccountDetail {
  388 + dividendsEstimateIds = append(dividendsEstimateIds, accountDetail.DividendsEstimateOrderId)
  389 + }
  390 + if count, dividendsEstimates, err3 := dividendsEstimateRepository.Find(map[string]interface{}{
  391 + "dividendsEstimateIds": dividendsEstimateIds,
  392 + "offsetLimit": false,
  393 + }); err3 != nil {
  394 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err4.Error())
  395 + } else {
  396 + if count > 0 {
  397 + for i, _ := range dividendsEstimates {
  398 + dividendsEstimates[i].PaymentStatus = int32(2)
  399 + }
  400 + if _, err5 := dividendsEstimateRepository.UpdateMany(dividendsEstimates); err5 != nil {
  401 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err5.Error())
  402 + }
  403 + }
  404 + }
  405 +
375 if err3 := transactionContext.CommitTransaction(); err3 != nil { 406 if err3 := transactionContext.CommitTransaction(); err3 != nil {
376 return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error()) 407 return nil, application.ThrowError(application.TRANSACTION_ERROR, err3.Error())
377 } 408 }
@@ -605,6 +605,26 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -605,6 +605,26 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
605 dividendsEstimateDao = value 605 dividendsEstimateDao = value
606 } 606 }
607 607
  608 + // 分红订单仓储初始化
  609 + var dividendsOrderRepository domain.DividendsOrderRepository
  610 + if value, err := factory.CreateDividendsOrderRepository(map[string]interface{}{
  611 + "transactionContext": transactionContext,
  612 + }); err != nil {
  613 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  614 + } else {
  615 + dividendsOrderRepository = value
  616 + }
  617 +
  618 + // 分红退货单仓储初始化
  619 + var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository
  620 + if value, err := factory.CreateDividendsReturnedOrderRepository(map[string]interface{}{
  621 + "transactionContext": transactionContext,
  622 + }); err != nil {
  623 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  624 + } else {
  625 + dividendsReturnedOrderRepository = value
  626 + }
  627 +
608 // 初始化确认业绩激励分红预算领域服务 628 // 初始化确认业绩激励分红预算领域服务
609 var confirmDividendsIncentivesEstimateService service.ConfirmDividendsIncentivesEstimateService 629 var confirmDividendsIncentivesEstimateService service.ConfirmDividendsIncentivesEstimateService
610 if value, err := factory.CreateConfirmDividendsIncentivesEstimateService(map[string]interface{}{ 630 if value, err := factory.CreateConfirmDividendsIncentivesEstimateService(map[string]interface{}{
@@ -750,9 +770,11 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -750,9 +770,11 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
750 } 770 }
751 } 771 }
752 } 772 }
  773 +
753 log.Logger.Info("新增的分红预算单", map[string]interface{}{ 774 log.Logger.Info("新增的分红预算单", map[string]interface{}{
754 "dividendsEstimates": dividendsEstimates, 775 "dividendsEstimates": dividendsEstimates,
755 }) 776 })
  777 +
756 if dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates); err != nil { 778 if dividendsEstimatesSaved, err := dividendsEstimateRepository.SaveMany(dividendsEstimates); err != nil {
757 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 779 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
758 } else { 780 } else {
@@ -780,39 +802,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -780,39 +802,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
780 } 802 }
781 } 803 }
782 804
783 - // 完成第一阶段事务提交  
784 - if err := transactionContext.CommitTransaction(); err != nil {  
785 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
786 - }  
787 -  
788 - // 分析成功和失败原因  
789 - successfullyCount := len(dividendsEstimatesSaved)  
790 -  
791 - // 错误原因收集,返回第一个可能的原因  
792 - failedReason := make([]string, 0)  
793 - for _, v := range estimateFailedDividendsOrders {  
794 - failedReason = append(failedReason, v)  
795 - }  
796 -  
797 - var failedReasonStr string  
798 - if len(failedReason) > 0 {  
799 - failedReasonStr = failedReason[0]  
800 - } else {  
801 - failedReasonStr = "无"  
802 - }  
803 -  
804 - // 开启第二阶段事务:处理订单和产品状态  
805 - newTransactionContext, err := factory.CreateTransactionContext(nil)  
806 - if err != nil {  
807 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
808 - }  
809 - if err := newTransactionContext.StartTransaction(); err != nil {  
810 - return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
811 - }  
812 - defer func() {  
813 - _ = newTransactionContext.RollbackTransaction()  
814 - }()  
815 -  
816 // 分离分红订单和退货单 805 // 分离分红订单和退货单
817 dividendsOrderNumbers := make([]string, 0) 806 dividendsOrderNumbers := make([]string, 0)
818 dividendsReturnedOrderNumbers := make([]string, 0) 807 dividendsReturnedOrderNumbers := make([]string, 0)
@@ -826,15 +815,13 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -826,15 +815,13 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
826 } 815 }
827 } 816 }
828 817
829 - // 分红订单仓储初始化  
830 - var dividendsOrderRepository domain.DividendsOrderRepository  
831 - if value, err := factory.CreateDividendsOrderRepository(map[string]interface{}{  
832 - "transactionContext": newTransactionContext,  
833 - }); err != nil {  
834 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
835 - } else {  
836 - dividendsOrderRepository = value  
837 - } 818 + log.Logger.Info("分红订单", map[string]interface{}{
  819 + "dividendsOrderNumbers": dividendsOrderNumbers,
  820 + })
  821 +
  822 + log.Logger.Info("分红退货单", map[string]interface{}{
  823 + "dividendsReturnedOrderNumbers": dividendsReturnedOrderNumbers,
  824 + })
838 825
839 // 查找分红订单 826 // 查找分红订单
840 if len(dividendsOrderNumbers) > 0 { 827 if len(dividendsOrderNumbers) > 0 {
@@ -869,16 +856,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -869,16 +856,6 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
869 } 856 }
870 } 857 }
871 858
872 - // 分红退货单仓储初始化  
873 - var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository  
874 - if value, err := factory.CreateDividendsReturnedOrderRepository(map[string]interface{}{  
875 - "transactionContext": newTransactionContext,  
876 - }); err != nil {  
877 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
878 - } else {  
879 - dividendsReturnedOrderRepository = value  
880 - }  
881 -  
882 // 查找分红退货单 859 // 查找分红退货单
883 if len(dividendsReturnedOrderNumbers) > 0 { 860 if len(dividendsReturnedOrderNumbers) > 0 {
884 if countDividendsReturnedOrdersFound, dividendsReturnedOrdersFound, err := dividendsReturnedOrderRepository.Find(map[string]interface{}{ 861 if countDividendsReturnedOrdersFound, dividendsReturnedOrdersFound, err := dividendsReturnedOrderRepository.Find(map[string]interface{}{
@@ -912,11 +889,25 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent @@ -912,11 +889,25 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
912 } 889 }
913 } 890 }
914 891
915 - // 完成第二阶段事务提交  
916 - if err := newTransactionContext.CommitTransaction(); err != nil { 892 + if err := transactionContext.CommitTransaction(); err != nil {
917 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 893 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
918 } 894 }
919 895
  896 + // 统计成功的分红预算
  897 + successfullyCount := len(dividendsEstimatesSaved)
  898 +
  899 + // 错误原因收集,返回第一个可能的原因
  900 + failedReason := make([]string, 0)
  901 + for _, v := range estimateFailedDividendsOrders {
  902 + failedReason = append(failedReason, v)
  903 + }
  904 + var failedReasonStr string
  905 + if len(failedReason) > 0 {
  906 + failedReasonStr = failedReason[0]
  907 + } else {
  908 + failedReasonStr = "无"
  909 + }
  910 +
920 return map[string]interface{}{ 911 return map[string]interface{}{
921 "report": fmt.Sprintf("已完成%d单订单分红预算,生成%d单分红预算,%d笔订单分红预算失败,失败原因:%s", len(estimateSuccessfullyDividendsOrders), successfullyCount, len(estimateFailedDividendsOrders), failedReasonStr), 912 "report": fmt.Sprintf("已完成%d单订单分红预算,生成%d单分红预算,%d笔订单分红预算失败,失败原因:%s", len(estimateSuccessfullyDividendsOrders), successfullyCount, len(estimateFailedDividendsOrders), failedReasonStr),
922 }, nil 913 }, nil
@@ -1414,6 +1405,8 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE @@ -1414,6 +1405,8 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
1414 stageUndertakerMap[rule.MoneyIncentivesStage] = make([]*domain.Undertaker, 0) 1405 stageUndertakerMap[rule.MoneyIncentivesStage] = make([]*domain.Undertaker, 0)
1415 } 1406 }
1416 1407
  1408 + // TODO 校验当前时间和激励阶段是否匹配
  1409 +
1417 log.Logger.Info("阶段承接人map初始化", map[string]interface{}{ 1410 log.Logger.Info("阶段承接人map初始化", map[string]interface{}{
1418 "stageUndertakerMap": stageUndertakerMap, 1411 "stageUndertakerMap": stageUndertakerMap,
1419 }) 1412 })
@@ -1440,7 +1433,6 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE @@ -1440,7 +1433,6 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
1440 if countDividendsEstimates > 0 { // 已有分红预算 1433 if countDividendsEstimates > 0 { // 已有分红预算
1441 for _, dividendsEstimate := range dividendsEstimates { 1434 for _, dividendsEstimate := range dividendsEstimates {
1442 if !dividendsEstimate.IsCanceled { // 分红预算单状态为非取消状态 1435 if !dividendsEstimate.IsCanceled { // 分红预算单状态为非取消状态
1443 - //stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker)  
1444 for i, undertakerAppended := range stageUndertakerMap[dividendsEstimate.DividendsStage] { 1436 for i, undertakerAppended := range stageUndertakerMap[dividendsEstimate.DividendsStage] {
1445 if undertakerAppended.UndertakerId == undertaker.UndertakerId { 1437 if undertakerAppended.UndertakerId == undertaker.UndertakerId {
1446 // 将删除点前后的元素连接起来 1438 // 将删除点前后的元素连接起来
@@ -1450,14 +1442,11 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE @@ -1450,14 +1442,11 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
1450 } 1442 }
1451 } 1443 }
1452 } 1444 }
1453 - //else if countDividendsEstimates == 0 { // 未分红,可以加入任意阶段进行金额激励  
1454 - // for i, _ := range stageUndertakerMap {  
1455 - // stageUndertakerMap[i] = append(stageUndertakerMap[i], undertaker)  
1456 - // }  
1457 - //}  
1458 } 1445 }
1459 } 1446 }
1460 1447
  1448 + // TODO 去除没有承接人的阶段
  1449 +
1461 log.Logger.Info("阶段承接人map", map[string]interface{}{ 1450 log.Logger.Info("阶段承接人map", map[string]interface{}{
1462 "stageUndertakerMap": stageUndertakerMap, 1451 "stageUndertakerMap": stageUndertakerMap,
1463 }) 1452 })
@@ -15,4 +15,6 @@ type AccountDetail struct { @@ -15,4 +15,6 @@ type AccountDetail struct {
15 OrderGoodAmount float64 `json:"orderGoodAmount"` 15 OrderGoodAmount float64 `json:"orderGoodAmount"`
16 // 关联共创合约编号 16 // 关联共创合约编号
17 CooperationContractNumber string `json:"cooperationContractNumber"` 17 CooperationContractNumber string `json:"cooperationContractNumber"`
  18 + // 参与类型
  19 + ParticipateType string `json:"participateType"`
18 } 20 }
@@ -25,6 +25,8 @@ type DividendsEstimate struct { @@ -25,6 +25,8 @@ type DividendsEstimate struct {
25 DividendsEstimateId int64 `json:"dividendsEstimateId,string"` 25 DividendsEstimateId int64 `json:"dividendsEstimateId,string"`
26 // 分红结算状态,1待结算,2已结算 26 // 分红结算状态,1待结算,2已结算
27 DividendsAccountStatus int32 `json:"dividendsAccountStatus"` 27 DividendsAccountStatus int32 `json:"dividendsAccountStatus"`
  28 + // 分红支付状态,1未支付,2已支付
  29 + PaymentStatus int32 `json:"paymentStatus"`
28 // 分红金额 30 // 分红金额
29 DividendsAmount float64 `json:"dividendsAmount"` 31 DividendsAmount float64 `json:"dividendsAmount"`
30 // 承接人分红预算单号 32 // 承接人分红预算单号
@@ -11,6 +11,8 @@ type DividendsEstimate struct { @@ -11,6 +11,8 @@ type DividendsEstimate struct {
11 DividendsEstimateId int64 `comment:"承接人分红预算记录ID" pg:",pk"` 11 DividendsEstimateId int64 `comment:"承接人分红预算记录ID" pg:",pk"`
12 // 分红结算状态 12 // 分红结算状态
13 DividendsAccountStatus int32 `comment:"分红结算状态"` 13 DividendsAccountStatus int32 `comment:"分红结算状态"`
  14 + // 支付状态 1未支付,2已支付
  15 + PaymentStatus int32 `comment:"支付状态" pg:",default:1"`
14 // 分红金额 16 // 分红金额
15 DividendsAmount float64 `comment:"分红金额"` 17 DividendsAmount float64 `comment:"分红金额"`
16 // 承接人分红预算单号 18 // 承接人分红预算单号
@@ -11,6 +11,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel @@ -11,6 +11,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel
11 return &domain.DividendsEstimate{ 11 return &domain.DividendsEstimate{
12 DividendsEstimateId: dividendsEstimateModel.DividendsEstimateId, 12 DividendsEstimateId: dividendsEstimateModel.DividendsEstimateId,
13 DividendsAccountStatus: dividendsEstimateModel.DividendsAccountStatus, 13 DividendsAccountStatus: dividendsEstimateModel.DividendsAccountStatus,
  14 + PaymentStatus: dividendsEstimateModel.PaymentStatus,
14 DividendsAmount: dividendsAmount, 15 DividendsAmount: dividendsAmount,
15 DividendsEstimateOrderNumber: dividendsEstimateModel.DividendsEstimateOrderNumber, 16 DividendsEstimateOrderNumber: dividendsEstimateModel.DividendsEstimateOrderNumber,
16 DividendsEstimateTime: dividendsEstimateModel.DividendsEstimateTime, 17 DividendsEstimateTime: dividendsEstimateModel.DividendsEstimateTime,
@@ -28,6 +28,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -28,6 +28,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
28 sqlBuildFields := []string{ 28 sqlBuildFields := []string{
29 "dividends_estimate_id", 29 "dividends_estimate_id",
30 "dividends_account_status", 30 "dividends_account_status",
  31 + "payment_status",
31 "dividends_amount", 32 "dividends_amount",
32 "dividends_estimate_order_number", 33 "dividends_estimate_order_number",
33 "dividends_estimate_time", 34 "dividends_estimate_time",
@@ -64,6 +65,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -64,6 +65,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
64 pg.Scan( 65 pg.Scan(
65 &dividendsEstimate.DividendsEstimateId, 66 &dividendsEstimate.DividendsEstimateId,
66 &dividendsEstimate.DividendsAccountStatus, 67 &dividendsEstimate.DividendsAccountStatus,
  68 + &dividendsEstimate.PaymentStatus,
67 &dividendsEstimate.DividendsAmount, 69 &dividendsEstimate.DividendsAmount,
68 &dividendsEstimate.DividendsEstimateOrderNumber, 70 &dividendsEstimate.DividendsEstimateOrderNumber,
69 &dividendsEstimate.DividendsEstimateTime, 71 &dividendsEstimate.DividendsEstimateTime,
@@ -86,6 +88,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -86,6 +88,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
86 fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), 88 fmt.Sprintf("INSERT INTO dividends_estimates (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
87 dividendsEstimate.DividendsEstimateId, 89 dividendsEstimate.DividendsEstimateId,
88 dividendsEstimate.DividendsAccountStatus, 90 dividendsEstimate.DividendsAccountStatus,
  91 + dividendsEstimate.PaymentStatus,
89 dividendsEstimate.DividendsAmount, 92 dividendsEstimate.DividendsAmount,
90 dividendsEstimate.DividendsEstimateOrderNumber, 93 dividendsEstimate.DividendsEstimateOrderNumber,
91 dividendsEstimate.DividendsEstimateTime, 94 dividendsEstimate.DividendsEstimateTime,
@@ -112,6 +115,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -112,6 +115,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
112 pg.Scan( 115 pg.Scan(
113 &dividendsEstimate.DividendsEstimateId, 116 &dividendsEstimate.DividendsEstimateId,
114 &dividendsEstimate.DividendsAccountStatus, 117 &dividendsEstimate.DividendsAccountStatus,
  118 + &dividendsEstimate.PaymentStatus,
115 &dividendsEstimate.DividendsAmount, 119 &dividendsEstimate.DividendsAmount,
116 &dividendsEstimate.DividendsEstimateOrderNumber, 120 &dividendsEstimate.DividendsEstimateOrderNumber,
117 &dividendsEstimate.DividendsEstimateTime, 121 &dividendsEstimate.DividendsEstimateTime,
@@ -134,6 +138,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di @@ -134,6 +138,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di
134 fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), 138 fmt.Sprintf("UPDATE dividends_estimates SET %s WHERE dividends_estimate_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
135 dividendsEstimate.DividendsEstimateId, 139 dividendsEstimate.DividendsEstimateId,
136 dividendsEstimate.DividendsAccountStatus, 140 dividendsEstimate.DividendsAccountStatus,
  141 + dividendsEstimate.PaymentStatus,
137 dividendsEstimate.DividendsAmount, 142 dividendsEstimate.DividendsAmount,
138 dividendsEstimate.DividendsEstimateOrderNumber, 143 dividendsEstimate.DividendsEstimateOrderNumber,
139 dividendsEstimate.DividendsEstimateTime, 144 dividendsEstimate.DividendsEstimateTime,
@@ -175,6 +180,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do @@ -175,6 +180,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do
175 dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{ 180 dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
176 DividendsEstimateId: dividendsEstimate.DividendsEstimateId, 181 DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
177 DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus, 182 DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
  183 + PaymentStatus: dividendsEstimate.PaymentStatus,
178 DividendsAmount: dividendsEstimate.DividendsAmount, 184 DividendsAmount: dividendsEstimate.DividendsAmount,
179 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber, 185 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
180 DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime, 186 DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,
@@ -219,6 +225,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* @@ -219,6 +225,7 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []*
219 dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{ 225 dividendsEstimateModels = append(dividendsEstimateModels, &models.DividendsEstimate{
220 DividendsEstimateId: dividendsEstimate.DividendsEstimateId, 226 DividendsEstimateId: dividendsEstimate.DividendsEstimateId,
221 DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus, 227 DividendsAccountStatus: dividendsEstimate.DividendsAccountStatus,
  228 + PaymentStatus: dividendsEstimate.PaymentStatus,
222 DividendsAmount: dividendsEstimate.DividendsAmount, 229 DividendsAmount: dividendsEstimate.DividendsAmount,
223 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber, 230 DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
224 DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime, 231 DividendsEstimateTime: dividendsEstimate.DividendsEstimateTime,