credit_accounts_person.go
4.2 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package service
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
// PersonCreditAccountService 企业端账期结算 【0%】
type PersonCreditAccountService struct {
}
// CreditAccountGet 企业的账期结算明细
//func (srv PersonCreditAccountService) CreditAccountGet(cmd *command.CreditAccountGetCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountGet(allied_creation_cooperation.ReqCreditAccountGet{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
//// CreditAccountDelete 企业的账期结算删除
//func (srv PersonCreditAccountService) CreditAccountDelete(cmd *command.CreditAccountGetCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountRemove(allied_creation_cooperation.ReqCreditAccountRemove{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
//
//// CreditAccountPay 企业的账期结算支付
//func (srv PersonCreditAccountService) CreditAccountPay(cmd *command.CreditAccountPayCommand) (interface{}, error) {
// gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
// resultMenu, err := gateway.CreditAccountsPay(allied_creation_cooperation.ReqCreditAccountsPay{
// CreditAccountId: cmd.CreditAccountId,
// })
// if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// }
// return resultMenu, nil
//}
// CreditAccountPaySearch 企业分红结算支付记录
func (srv PersonCreditAccountService) CreditAccountPaySearch(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
cmd.Operator)
resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
PageNumber: cmd.PageNumber,
PageSize: cmd.PageSize,
PaymentStatus: 2,
// TODO:时间段过滤,用户过滤
})
if err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
return map[string]interface{}{
"grid": map[string]interface{}{
"list": resultMenu.Grid.List,
"sum": 6000,
},
}, nil
}
// PaymentHistoryStatistics 支付历史统计
func (srv PersonCreditAccountService) PaymentHistoryStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"rankItems": []struct{}{},
"totalPaymentAmount": 6000,
}, nil
}
// PaymentHistoryHistogramStatistics 支付历史统计-直方图
func (srv PersonCreditAccountService) PaymentHistoryHistogramStatistics(cmd *command.CreditAccountPaySearchCommand) (interface{}, error) {
//gateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
// cmd.Operator)
//resultMenu, err := gateway.CreditAccountsSearch(allied_creation_cooperation.ReqCreditAccountsSearch{
// PageNumber: cmd.PageNumber,
// PageSize: cmd.PageSize,
// PaymentStatus: 2,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
return map[string]interface{}{
"xAxis": map[string]interface{}{
"data": []string{"7-5", "7-15", "7-25"},
},
"yAxis": struct{}{},
"source": map[string]interface{}{
"value": []float64{60, 80, 90},
},
}, nil
}