...
|
...
|
@@ -3,6 +3,7 @@ package transform |
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/utils"
|
|
|
)
|
|
|
|
|
|
func TransformToCooperationContractDomainModelFromPgModels(
|
...
|
...
|
@@ -15,6 +16,7 @@ func TransformToCooperationContractDomainModelFromPgModels( |
|
|
// 分红激励规则
|
|
|
var dividendsIncentivesRulesDomain []*domain.DividendsIncentivesRule
|
|
|
for _, rule := range dividendsIncentivesRules {
|
|
|
stageString := utils.NumberToCNNumber(int(rule.DividendsIncentivesStage))
|
|
|
dividendsIncentivesRulesDomain = append(dividendsIncentivesRulesDomain, &domain.DividendsIncentivesRule{
|
|
|
DividendsIncentivesRuleId: rule.DividendsIncentivesRuleId,
|
|
|
CooperationContractNumber: rule.CooperationContractNumber,
|
...
|
...
|
@@ -22,6 +24,7 @@ func TransformToCooperationContractDomainModelFromPgModels( |
|
|
SalesmanPercentage: rule.SalesmanPercentage,
|
|
|
DividendsIncentivesPercentage: rule.DividendsIncentivesPercentage,
|
|
|
DividendsIncentivesStage: rule.DividendsIncentivesStage,
|
|
|
DividendsIncentivesStageCN: stageString,
|
|
|
DividendsIncentivesStageEnd: rule.DividendsIncentivesStageEnd,
|
|
|
DividendsIncentivesStageStart: rule.DividendsIncentivesStageStart,
|
|
|
Org: rule.Org,
|
...
|
...
|
@@ -34,11 +37,13 @@ func TransformToCooperationContractDomainModelFromPgModels( |
|
|
// 金额激励规则
|
|
|
var moneyIncentivesRulesDomain []*domain.MoneyIncentivesRule
|
|
|
for _, rule := range moneyIncentivesRules {
|
|
|
stageString := utils.NumberToCNNumber(int(rule.MoneyIncentivesStage))
|
|
|
moneyIncentivesRulesDomain = append(moneyIncentivesRulesDomain, &domain.MoneyIncentivesRule{
|
|
|
MoneyIncentivesRuleId: rule.MoneyIncentivesRuleId,
|
|
|
CooperationContractNumber: rule.CooperationContractNumber,
|
|
|
MoneyIncentivesAmount: rule.MoneyIncentivesAmount,
|
|
|
MoneyIncentivesStage: rule.MoneyIncentivesStage,
|
|
|
MoneyIncentivesStageCN: stageString,
|
|
|
MoneyIncentivesStageEnd: rule.MoneyIncentivesStageEnd,
|
|
|
MoneyIncentivesStageStart: rule.MoneyIncentivesStageStart,
|
|
|
MoneyIncentivesTime: rule.MoneyIncentivesTime,
|
...
|
...
|
|