...
|
...
|
@@ -8,7 +8,6 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/repository"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
|
|
|
)
|
|
|
|
|
|
type ConfirmDividendsIncentivesEstimateService struct {
|
...
|
...
|
@@ -85,12 +84,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
|
|
|
|
// 确认业绩分红预算
|
|
|
var dividendsEstimateDetails []*service.DividendsEstimateDetail
|
|
|
go func() {
|
|
|
for _, orderGood := range orderGoods {
|
|
|
log.Logger.Info("业绩分红预算产品", map[string]interface{}{
|
|
|
"orderGood": orderGood,
|
|
|
})
|
|
|
|
|
|
if orderGood.CooperationContractNumber == "" {
|
|
|
var orderNumber string
|
|
|
if orderGood.DividendsOrderNumber != "" {
|
...
|
...
|
@@ -462,6 +456,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
|
}
|
|
|
}
|
|
|
// 计算分红
|
|
|
if len(cooperationContract.Undertakers) <= 0 {
|
|
|
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
|
|
|
DividendsUser: nil,
|
|
|
DividendsParticipateType: 0,
|
|
|
DividendsStage: 0,
|
|
|
DividendsAmount: 0,
|
|
|
OrderOrReturnedOrderNumber: orderGood.DividendsReturnedOrderNumber,
|
|
|
IsSuccessfully: false,
|
|
|
Reason: "合约承接人不存在",
|
|
|
})
|
|
|
continue
|
|
|
} else {
|
|
|
for _, undertaker := range cooperationContract.Undertakers {
|
|
|
// 添加承接人分红退货预算信息详情
|
|
|
if dividendsIncentivesRuleMatched.DividendsIncentivesPercentage > 0 {
|
...
|
...
|
@@ -551,7 +557,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}()
|
|
|
}
|
|
|
|
|
|
return dividendsEstimateDetails, nil
|
|
|
}
|
...
|
...
|
|