作者 陈志颖

feat:添加业绩分红预算和金额激励预算领域服务

... ... @@ -149,6 +149,11 @@ func (creditAccountService *CreditAccountService) CreateCreditAccount(createCred
Status: dividendsEstimate.DividendsUser.Status,
Company: dividendsEstimate.DividendsUser.Company,
},
AccountDetail: &domain.AccountDetail{
DividendsEstimateOrderNumber: dividendsEstimate.DividendsEstimateOrderNumber,
DividendsType: dividendsEstimate.DividendsType,
DividendsAmount: dividendsEstimate.DividendsAmount,
},
PaymentDocumentAttachment: nil,
Org: organization,
Company: company,
... ...
... ... @@ -10,10 +10,8 @@ import (
// ConfirmDividendsIncentivesEstimateCommand 确定业绩分红预算
type ConfirmDividendsIncentivesEstimateCommand struct {
// 分红订单号/退货单号
OrderOrReturnedOrderNum string `cname:"分红订单号/退货单号" json:"orderOrReturnedOrderNum" valid:"Required"`
// 合约编号
CooperationContractNumber string `cname:"合约编号" json:"cooperationContractNumber" valid:"Required"`
// 订单产品ID列表
OrderGoodIds []string `cname:"订单产品ID列表" json:"orderGoodIds" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
... ...
... ... @@ -10,12 +10,12 @@ import (
// ConfirmMoneyIncentivesEstimateCommand 确定金额激励分红预算
type ConfirmMoneyIncentivesEstimateCommand struct {
// 共创项目合约编号
CooperationContractNumber string `cname:"共创项目合约编号" json:"cooperationContractNumber" valid:"Required"`
// 共创合约ID列表
CooperationContractIds []string `cname:"共创合约ID列表" json:"cooperationContractIds" valid:"Required"`
// 分红阶段
DividendsIncentivesStage int64 `cname:"分红阶段" json:"dividendsIncentivesStage,string" valid:"Required"`
// 承接人UID
UndertakerUid string `cname:"承接人UID" json:"undertakerUid" valid:"Required"`
UndertakerUids []string `cname:"承接人UID列表" json:"undertakerUids" valid:"Required"`
// 公司ID,通过集成REST上下文获取
CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"`
// 组织机构ID
... ...
... ... @@ -353,7 +353,7 @@ func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimat
}
}
// ConfirmDividendsIncentivesEstimate 确定业绩激励分红预算
// ConfirmDividendsIncentivesEstimate TODO 确定业绩激励分红预算
func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncentivesEstimate(confirmDividendsIncentivesEstimateCommand *command.ConfirmDividendsIncentivesEstimateCommand) (interface{}, error) {
if err := confirmDividendsIncentivesEstimateCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
... ... @@ -374,7 +374,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
return nil, nil
}
// ConfirmMoneyIncentivesEstimate 确定金额激励分红预算
// ConfirmMoneyIncentivesEstimate TODO 确定金额激励分红预算
func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentivesEstimate(confirmMoneyIncentivesEstimateCommand *command.ConfirmMoneyIncentivesEstimateCommand) (interface{}, error) {
if err := confirmMoneyIncentivesEstimateCommand.ValidateCommand(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
... ...
... ... @@ -29,3 +29,19 @@ func CreateCooperationStatisticsService(options map[string]interface{}) (*domain
}
return domain_service.NewCooperationStatisticsService(transactionContext)
}
func CreateConfirmDividendsIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmDividendsIncentivesEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewConfirmDividendsIncentivesEstimateService(transactionContext)
}
func CreateConfirmMoneyIncentivesEstimateService(options map[string]interface{}) (*domain_service.ConfirmMoneyIncentivesEstimateService, error) {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return domain_service.NewConfirmMoneyIncentivesEstimateService(transactionContext)
}
... ...
... ... @@ -3,8 +3,8 @@ package domain
type AccountDetail struct {
// 分红预算单号
DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
// 分红类型
DividendsType string `json:"dividendsType"`
// 分红类型,1订单分红,2退货冲销,3金额激励
DividendsType int32 `json:"dividendsType"`
// 分红金额
DividendsAmount float64 `json:"dividendsAmount"`
}
... ...
package service
type ConfirmDividendsIncentivesEstimateService interface {
Confirm()
}
... ...
package service
type ConfirmMoneyIncentivesEstimateService interface {
Confirm()
}
... ...
package domain_service
import (
"fmt"
coreDomain "github.com/linmadan/egglib-go/core/domain"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
)
type ConfirmDividendsIncentivesEstimateService struct {
coreDomain.BaseEventPublisher
transactionContext *pgTransaction.TransactionContext
}
func NewConfirmDividendsIncentivesEstimateService(transactionContext *pgTransaction.TransactionContext) (*ConfirmDividendsIncentivesEstimateService, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为空")
} else {
return &ConfirmDividendsIncentivesEstimateService{
transactionContext: transactionContext,
}, nil
}
}
... ...
package domain_service
import (
"fmt"
coreDomain "github.com/linmadan/egglib-go/core/domain"
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
)
type ConfirmMoneyIncentivesEstimateService struct {
coreDomain.BaseEventPublisher
transactionContext *pgTransaction.TransactionContext
}
func NewConfirmMoneyIncentivesEstimateService(transactionContext *pgTransaction.TransactionContext) (*ConfirmMoneyIncentivesEstimateService, error) {
if transactionContext == nil {
return nil, fmt.Errorf("transactionContext参数不能为空")
} else {
return &ConfirmMoneyIncentivesEstimateService{
transactionContext: transactionContext,
}, nil
}
}
... ...