|
@@ -8,7 +8,6 @@ import ( |
|
@@ -8,7 +8,6 @@ import ( |
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
8
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/repository"
|
10
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/repository"
|
11
|
- "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
|
|
|
12
|
)
|
11
|
)
|
13
|
|
12
|
|
14
|
type ConfirmDividendsIncentivesEstimateService struct {
|
13
|
type ConfirmDividendsIncentivesEstimateService struct {
|
|
@@ -85,12 +84,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
@@ -85,12 +84,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
85
|
|
84
|
|
86
|
// 确认业绩分红预算
|
85
|
// 确认业绩分红预算
|
87
|
var dividendsEstimateDetails []*service.DividendsEstimateDetail
|
86
|
var dividendsEstimateDetails []*service.DividendsEstimateDetail
|
88
|
- go func() {
|
|
|
89
|
for _, orderGood := range orderGoods {
|
87
|
for _, orderGood := range orderGoods {
|
90
|
- log.Logger.Info("业绩分红预算产品", map[string]interface{}{
|
|
|
91
|
- "orderGood": orderGood,
|
|
|
92
|
- })
|
|
|
93
|
-
|
|
|
94
|
if orderGood.CooperationContractNumber == "" {
|
88
|
if orderGood.CooperationContractNumber == "" {
|
95
|
var orderNumber string
|
89
|
var orderNumber string
|
96
|
if orderGood.DividendsOrderNumber != "" {
|
90
|
if orderGood.DividendsOrderNumber != "" {
|
|
@@ -462,6 +456,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
@@ -462,6 +456,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
462
|
}
|
456
|
}
|
463
|
}
|
457
|
}
|
464
|
// 计算分红
|
458
|
// 计算分红
|
|
|
459
|
+ if len(cooperationContract.Undertakers) <= 0 {
|
|
|
460
|
+ dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
|
|
|
461
|
+ DividendsUser: nil,
|
|
|
462
|
+ DividendsParticipateType: 0,
|
|
|
463
|
+ DividendsStage: 0,
|
|
|
464
|
+ DividendsAmount: 0,
|
|
|
465
|
+ OrderOrReturnedOrderNumber: orderGood.DividendsReturnedOrderNumber,
|
|
|
466
|
+ IsSuccessfully: false,
|
|
|
467
|
+ Reason: "合约承接人不存在",
|
|
|
468
|
+ })
|
|
|
469
|
+ continue
|
|
|
470
|
+ } else {
|
465
|
for _, undertaker := range cooperationContract.Undertakers {
|
471
|
for _, undertaker := range cooperationContract.Undertakers {
|
466
|
// 添加承接人分红退货预算信息详情
|
472
|
// 添加承接人分红退货预算信息详情
|
467
|
if dividendsIncentivesRuleMatched.DividendsIncentivesPercentage > 0 {
|
473
|
if dividendsIncentivesRuleMatched.DividendsIncentivesPercentage > 0 {
|
|
@@ -551,7 +557,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
@@ -551,7 +557,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
551
|
}
|
557
|
}
|
552
|
}
|
558
|
}
|
553
|
}
|
559
|
}
|
554
|
- }()
|
560
|
+ }
|
555
|
|
561
|
|
556
|
return dividendsEstimateDetails, nil
|
562
|
return dividendsEstimateDetails, nil
|
557
|
}
|
563
|
}
|