dividends_estimate.go
4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// 分红预算管理
type DividendsEstimateService struct {
}
//piliao 取消分红预算
func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimate(cancelDividendsEstimateCommand *command.CancelDividendsEstimateCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(cancelDividendsEstimateCommand.Operator)
_, err := creationCooperationGateway.DividendsEstimatesBatchCancel(allied_creation_cooperation.ReqDividendsEstimateBatchCancel{
DividendsEstimateIds: cancelDividendsEstimateCommand.DividendsEstimateId,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return cancelDividendsEstimateCommand, nil
}
// 确定预算分红激励
func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncentives(estimateDividendsIncentivesCommand *command.EstimateDividendsIncentivesCommand) (interface{}, error) {
// creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// estimateDividendsIncentivesCommand.Operator)
return nil, nil
}
// 确定预算金额激励分红
func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentives(estimateMoneyIncentivesCommand *command.EstimateMoneyIncentivesCommand) (interface{}, error) {
// creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// estimateMoneyIncentivesCommand.Operator)
return nil, nil
}
// 查询分红预算单列表
func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimate(searchDividendsEstimateQuery *query.SearchDividendsEstimateQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
searchDividendsEstimateQuery.Operator)
result, err := creationCooperationGateway.DividendsEstimatesSearch(allied_creation_cooperation.ReqDividendsEstimateSearch{
//承接人分红预算单号
DividendsEstimateOrderNumber: searchDividendsEstimateQuery.DividendsEstimateOrderNumber,
//分红类型,1订单分红,2退货冲销,3金额激励
DividendsType: searchDividendsEstimateQuery.DividendsType,
PageNumber: searchDividendsEstimateQuery.PageNumber,
PageSize: searchDividendsEstimateQuery.PageSize,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
// 查询业绩分红
func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
searchDividendsIncentivesQuery.Operator)
result, err := creationCooperationGateway.DividendsEstimateSearchDividends(
allied_creation_cooperation.ReqDividendsEstimateSearchDividend{
PageNumber: searchDividendsIncentivesQuery.PageNumber,
PageSize: searchDividendsIncentivesQuery.PageSize,
CooperationContractNumber: searchDividendsIncentivesQuery.CooperationContractNumber,
OrderOrReturnedOrderNum: searchDividendsIncentivesQuery.OrderOrReturnedOrderNum,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
// 查询金额激励分红
func (dividendsEmmateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesQuery) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
searchMoneyIncentivesQuery.Operator)
result, err := creationCooperationGateway.DividendsEstimatesSearchMoney(allied_creation_cooperation.ReqDividendsEstimateSearchMoney{
PageNumber: searchMoneyIncentivesQuery.PageNumber,
PageSize: searchMoneyIncentivesQuery.PageSize,
CooperationContractName: searchMoneyIncentivesQuery.CooperationContractName,
DepartmentName: searchMoneyIncentivesQuery.DepartmentName,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
}
func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstimateService {
newDividendsEstimateService := &DividendsEstimateService{}
return newDividendsEstimateService
}